|
Eclipse Platform Release 3.2 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.jface.text.source.LineChangeHover
public class LineChangeHover
A hover for line oriented diffs. It determines the text to show as hover for a certain line in the document.
Constructor Summary | |
---|---|
LineChangeHover()
|
Method Summary | |
---|---|
boolean |
canHandleMouseCursor()
Returns whether the provided information control can interact with the mouse cursor. |
protected Point |
computeLineRange(ISourceViewer viewer,
int line,
int min,
int max)
Computes the block of lines which form a contiguous block of changes covering line . |
protected java.lang.String |
decorateText(java.util.List diffInfos,
int maxLines)
Takes a list of ILineDiffInfo s and computes a hover of at most maxLines . |
protected java.lang.String |
formatSource(java.lang.String content)
Formats the source w/ syntax coloring etc. |
IInformationControlCreator |
getHoverControlCreator()
Returns the hover control creator of this annotation hover. |
java.lang.Object |
getHoverInfo(ISourceViewer sourceViewer,
ILineRange lineRange,
int visibleLines)
Returns the object which should be presented in the a hover popup window. |
java.lang.String |
getHoverInfo(ISourceViewer sourceViewer,
int lineNumber)
Returns the text which should be presented in the a hover popup window. |
ILineRange |
getHoverLineRange(ISourceViewer viewer,
int lineNumber)
Returns the range of lines that include the given line number for which the same hover information is valid. |
IInformationControlCreator |
getInformationPresenterControlCreator()
Returns the information control creator of this information provider. |
protected java.lang.String |
getTabReplacement()
Returns a replacement for the tab character. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public LineChangeHover()
Method Detail |
---|
public java.lang.String getHoverInfo(ISourceViewer sourceViewer, int lineNumber)
IAnnotationHover
getHoverInfo
in interface IAnnotationHover
sourceViewer
- the source viewer this hover is registered withlineNumber
- the line number for which information is requested
null
if no such information existsprotected java.lang.String formatSource(java.lang.String content)
content
- the hover content
content
reformattedprotected java.lang.String getTabReplacement()
protected java.lang.String decorateText(java.util.List diffInfos, int maxLines)
ILineDiffInfo
s and computes a hover of at most maxLines
.
Added lines are prefixed with a '+'
, changed lines with '>'
and
deleted lines with '-'
.
Deleted and added lines can even each other out, so that a number of deleted lines get displayed where - in the current document - the added lines are.
diffInfos
- a List
of ILineDiffInfo
maxLines
- the maximum number of lines. Note that adding up all annotations might give
more than that due to deleted lines.
String
suitable for hover displayprotected Point computeLineRange(ISourceViewer viewer, int line, int min, int max)
line
.
viewer
- the source viewer showingline
- the line which a hover is displayed formin
- the first line in viewer
's document to considermax
- the last line in viewer
's document to consider
viewer
containing line
that is covered by the hover information returned by the receiver.public java.lang.Object getHoverInfo(ISourceViewer sourceViewer, ILineRange lineRange, int visibleLines)
IAnnotationHoverExtension
getHoverInfo
in interface IAnnotationHoverExtension
sourceViewer
- the source viewer this hover is registered withlineRange
- the line range for which information is requestedvisibleLines
- the number of visible lines
null
if no such information existspublic ILineRange getHoverLineRange(ISourceViewer viewer, int lineNumber)
IAnnotationHoverExtension
getHoverLineRange
in interface IAnnotationHoverExtension
viewer
- the viewer which the hover is queried forlineNumber
- the line number of the line for which a hover is displayed for
null
for no rangepublic boolean canHandleMouseCursor()
IAnnotationHoverExtension
canHandleMouseCursor
in interface IAnnotationHoverExtension
true
if the mouse cursor can be handledpublic IInformationControlCreator getHoverControlCreator()
IAnnotationHoverExtension
getHoverControlCreator
in interface IAnnotationHoverExtension
public IInformationControlCreator getInformationPresenterControlCreator()
IInformationProviderExtension2
getInformationPresenterControlCreator
in interface IInformationProviderExtension2
|
Eclipse Platform Release 3.2 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Guidelines for using Eclipse APIs.
Copyright (c) IBM Corp. and others 2000, 2006. All rights reserved.