|
Eclipse Platform 2.0 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
In addition to the text viewer functionality a source viewer supports:
As the visibility of visual annotations can dynamically be changed, it is assumed that the annotation presentation area can dynamically be hidden if it is different from the text widget.
Clients may implement this interface or use the default implementation provided
by SourceViewer
.
Field Summary | |
static int |
CONTENTASSIST_CONTEXT_INFORMATION
Text operation code for requesting content assist to show the content information for the current insert position. |
static int |
CONTENTASSIST_PROPOSALS
Text operation code for requesting content assist to show completetion proposals for the current insert position. |
static int |
FORMAT
Text operation code for formatting the selected text or complete document of this viewer if the selection is empty. |
static int |
INFORMATION
Text operation code for requesting information at the current insertion position. |
Method Summary | |
void |
configure(SourceViewerConfiguration configuration)
Configures the source viewer using the given configuration. |
IAnnotationModel |
getAnnotationModel()
Returns this viewer's annotation model. |
IRegion |
getRangeIndication()
Returns the viewer's range indication. |
void |
removeRangeIndication()
Removes the viewer's range indication. |
void |
setAnnotationHover(IAnnotationHover annotationHover)
Sets the annotation hover of this source viewer. |
void |
setDocument(IDocument document,
IAnnotationModel annotationModel)
Sets the given document as this viewer's text model and the given annotation model as the model for this viewer's visual annotations. |
void |
setDocument(IDocument document,
IAnnotationModel annotationModel,
int visibleRegionOffset,
int visibleRegionLength)
Sets the given document as this viewer's text model and the given annotation model as the model for this viewer's visual annotations. |
void |
setRangeIndication(int offset,
int length,
boolean moveCursor)
Sets the viewers's range indication to the specified range. |
void |
setRangeIndicator(Annotation rangeIndicator)
Sets the annotation used by this viewer as range indicator. |
void |
showAnnotations(boolean show)
Controls the visibility of annotations and in the case of separate presentation areas of text and annotations, the visibility of the annotation's presentation area. |
Field Detail |
public static final int CONTENTASSIST_PROPOSALS
public static final int CONTENTASSIST_CONTEXT_INFORMATION
public static final int FORMAT
public static final int INFORMATION
Method Detail |
public void configure(SourceViewerConfiguration configuration)
configuration
- the source viewer configuration to be usedpublic void setAnnotationHover(IAnnotationHover annotationHover)
annotationHover
- the hover to be used, null
is a valid argumentpublic void setDocument(IDocument document, IAnnotationModel annotationModel)
TextEvent
is issued. This text event does not carry
a related document event.
document
- the viewer's new input documentannotationModel
- the model for the viewer's visual annotationsITextViewer.setDocument(IDocument)
public void setDocument(IDocument document, IAnnotationModel annotationModel, int visibleRegionOffset, int visibleRegionLength)
TextEvent
is issued. The text event does not carry a
related document event. This method is a convenience method for
setDocument(document, annotationModel);setVisibleRegion(offset, length)
.
document
- the new input documentannotationModel
- the model of the viewer's visual annotationsvisibleRegionOffset
- the offset of the visible regionvisibleRegionLength
- the length of the visible regionITextViewer.setDocument(IDocument, int, int)
public IAnnotationModel getAnnotationModel()
public void setRangeIndicator(Annotation rangeIndicator)
rangeIndicator
- the annotation to be used as this viewer's range indicatorpublic void setRangeIndication(int offset, int length, boolean moveCursor)
offset
- the offset of the rangelength
- the length of the rangemoveCursor
- indicates whether the cursor should be moved to the given offsetpublic IRegion getRangeIndication()
public void removeRangeIndication()
public void showAnnotations(boolean show)
By default, annotations and their presentation area are visible.
show
- indicates the visibility of annotations
|
Eclipse Platform 2.0 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |