|
Eclipse Platform 2.1 |
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object
|
+--org.eclipse.jface.viewers.Viewer
|
+--org.eclipse.jface.text.TextViewer
|
+--org.eclipse.jface.text.source.SourceViewer
|
+--org.eclipse.jface.text.source.ProjectionSourceViewer
A projection source viewer is a source viewer which does not support the concept of a visible region. Instead it supports
to dynamically hide and show regions of its document. Uses ProjectionDocumentManager as it internal slave document manager.
This class is for internal use only.
| Nested Class Summary |
| Nested classes inherited from class org.eclipse.jface.text.TextViewer |
TextViewer.TextHoverKey, TextViewer.WidgetCommand |
| Field Summary |
| Fields inherited from class org.eclipse.jface.text.source.SourceViewer |
fAnnotationHover, fContentAssistant, fContentAssistantInstalled, fContentFormatter, fInformationPresenter, fPresentationReconciler, fReconciler, GAP_SIZE |
| Fields inherited from class org.eclipse.jface.text.TextViewer |
fAutoIndentStrategies, fDefaultPrefixChars, fDoubleClickStrategies, fEventConsumer, fHoverControlCreator, fIgnoreAutoIndent, fIndentChars, fInformationMapping, fLastTopPixel, fPaintManager, fReplaceTextPresentation, fTextHovers, fTextInputListeners, fTextListeners, fUndoManager, fViewportListeners, INTERNAL, KEY, MOUSE, MOUSE_END, RESIZE, SCROLLER, SHIFTING, TRACE_ERRORS |
| Fields inherited from class org.eclipse.jface.viewers.Viewer |
WIDGET_DATA_KEY |
| Fields inherited from interface org.eclipse.jface.text.source.ISourceViewer |
CONTENTASSIST_CONTEXT_INFORMATION, CONTENTASSIST_PROPOSALS, FORMAT, INFORMATION |
| Fields inherited from interface org.eclipse.jface.text.ITextViewerExtension2 |
DEFAULT_HOVER_STATE_MASK |
| Fields inherited from interface org.eclipse.jface.text.ITextOperationTarget |
COPY, CUT, DELETE, PASTE, PREFIX, PRINT, REDO, SELECT_ALL, SHIFT_LEFT, SHIFT_RIGHT, STRIP_PREFIX, UNDO |
| Constructor Summary | |
ProjectionSourceViewer(Composite parent,
IVerticalRuler ruler,
int styles)
Creates a new projection source viewer. |
|
| Method Summary | |
void |
collapse(int offset,
int length)
Hides the given range by collapsing it. |
protected ISlaveDocumentManager |
createSlaveDocumentManager()
Creates a new slave document manager. |
void |
expand(int offset,
int length)
Makes all hidden ranges in the given range visible again. |
IAnnotationModel |
getProjectionAnnotationModel()
Returns the projection annotation model. |
IDocument |
getVisibleDocument()
Returns the viewer's visible document. |
IRegion |
getVisibleRegion()
Returns the current visible region of this viewer's document. |
protected int |
getVisibleRegionOffset()
|
protected void |
handleDispose()
Frees all resources allocated by this viewer. |
protected void |
handleVerifyEvent(VerifyEvent e)
|
protected IRegion |
internalGetVisibleRegion()
|
boolean |
overlapsWithVisibleRegion(int offset,
int length)
Returns whether a given range overlaps with the visible region of this viewer's document. |
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 |
setProjectionAnnotationModel(IAnnotationModel projectionAnnotationModel)
Sets the projection annotation model. |
protected boolean |
updateVisibleDocument(IDocument visibleDocument,
int visibleRegionOffset,
int visibleRegionLength)
Sets the given slave document to the specified range of its master document. |
| Methods inherited from class org.eclipse.jface.text.source.SourceViewer |
activatePlugins, canDoOperation, configure, createControl, doOperation, enableOperation, ensureAnnotationHoverManagerInstalled, ensureOverviewHoverManagerInstalled, getAnnotationModel, getControl, getRangeIndication, removeRangeIndication, setAnnotationHover, setDocument, setDocument, setDocument, setRangeIndication, setRangeIndicator, showAnnotations, showAnnotationsOverview |
| Methods inherited from class org.eclipse.jface.viewers.Viewer |
addHelpListener, addSelectionChangedListener, fireHelpRequested, fireSelectionChanged, getData, handleHelpRequest, removeHelpListener, removeSelectionChangedListener, scrollDown, scrollUp, setData, setSelection |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.eclipse.jface.text.source.ISourceViewer |
configure, getAnnotationModel, getRangeIndication, removeRangeIndication, setAnnotationHover, setDocument, setRangeIndication, setRangeIndicator, showAnnotations |
| Methods inherited from interface org.eclipse.jface.text.ITextViewerExtension3 |
getModelCoverage, modelLine2WidgetLine, modelOffset2WidgetOffset, modelRange2WidgetRange, widgetLineOfWidgetOffset, widgetlLine2ModelLine, widgetOffset2ModelOffset, widgetRange2ModelRange |
| Constructor Detail |
public ProjectionSourceViewer(Composite parent,
IVerticalRuler ruler,
int styles)
parent - the SWT parent controlruler - the vertical rulerstyles - the SWT style bits| Method Detail |
public void setDocument(IDocument document,
IAnnotationModel annotationModel,
int visibleRegionOffset,
int visibleRegionLength)
ISourceViewerTextEvent 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).
setDocument in interface ISourceViewersetDocument in class SourceViewerdocument - 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)protected void handleDispose()
TextViewer
handleDispose in class SourceViewerpublic IAnnotationModel getProjectionAnnotationModel()
public void setProjectionAnnotationModel(IAnnotationModel projectionAnnotationModel)
projectionAnnotationModel - the projection annotation modelprotected ISlaveDocumentManager createSlaveDocumentManager()
TextViewerChildDocumentManager.
createSlaveDocumentManager in class TextViewer
protected boolean updateVisibleDocument(IDocument visibleDocument,
int visibleRegionOffset,
int visibleRegionLength)
throws BadLocationException
TextViewer
updateVisibleDocument in class TextViewervisibleDocument - the slave documentvisibleRegionOffset - the offset of the master document rangevisibleRegionLength - the length of the master document range
true if the slave has been adapted successfully
BadLocationException - in case the specified range is not valid in the master document
public void collapse(int offset,
int length)
offset - the offset of the range to hidelength - the length of the range to hide
public void expand(int offset,
int length)
offset - the offset of the rangelength - the length of the rangepublic IRegion getVisibleRegion()
ITextViewersetVisibleRegion
if the document has been modified since then.
getVisibleRegion in interface ITextViewergetVisibleRegion in class TextViewerprotected int getVisibleRegionOffset()
protected IRegion internalGetVisibleRegion()
public boolean overlapsWithVisibleRegion(int offset,
int length)
ITextViewer
overlapsWithVisibleRegion in interface ITextVieweroverlapsWithVisibleRegion in class TextViewertrue if the specified range overlaps with the visible regionpublic IDocument getVisibleDocument()
TextViewer
getVisibleDocument in class TextViewerprotected void handleVerifyEvent(VerifyEvent e)
handleVerifyEvent in class TextViewerVerifyListener.verifyText(VerifyEvent)
|
Eclipse Platform 2.1 |
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||