public class TextConsoleViewer extends SourceViewer implements LineStyleListener, LineBackgroundListener, MouseTrackListener, MouseMoveListener, MouseListener
TextConsole.
Clients may subclass this class.
SourceViewer.RulerLayoutTextViewer.TextHoverKey, TextViewer.WidgetCommand_SELECTION_POSITION_CATEGORY, fAnnotationHover, fContentAssistant, fContentAssistantInstalled, fContentFormatter, fInformationPresenter, fOverviewRulerAnnotationHover, fPresentationReconciler, fQuickAssistAssistant, fQuickAssistAssistantInstalled, fReconciler, fSelectionCategory, fSelections, fSelectionUpdater, GAP_SIZE, GAP_SIZE_1, MODEL_ANNOTATION_MODELfAutoIndentStrategies, fDefaultPrefixChars, fDoubleClickStrategies, fEventConsumer, fFindReplaceDocumentAdapter, fHoverControlCreator, fHyperlinkDetectors, fHyperlinkManager, fHyperlinkPresenter, fHyperlinkStateMask, fIgnoreAutoIndent, fIndentChars, fInformationMapping, fLastTopPixel, fMarkPosition, fPaintManager, fPartitioning, fReplaceTextPresentation, fTextHovers, fTextInputListeners, fTextListeners, fTextPresentationListeners, fUndoManager, fViewportListeners, INTERNAL, KEY, MOUSE, MOUSE_END, RESIZE, SCROLLER, SHIFTING, TRACE_ERRORSWIDGET_DATA_KEYCONTENTASSIST_CONTEXT_INFORMATION, CONTENTASSIST_PROPOSALS, FORMAT, INFORMATION, QUICK_ASSISTDEFAULT_HOVER_STATE_MASKCOPY, CUT, DELETE, PASTE, PREFIX, PRINT, REDO, SELECT_ALL, SHIFT_LEFT, SHIFT_RIGHT, STRIP_PREFIX, UNDO| Constructor and Description |
|---|
TextConsoleViewer(Composite parent,
TextConsole console)
Constructs a new viewer in the given parent for the specified console.
|
| Modifier and Type | Method and Description |
|---|---|
protected IDocumentAdapter |
createDocumentAdapter()
Factory method to create the document adapter to be used by this viewer.
|
protected Cursor |
getHandCursor()
Returns the hand cursor.
|
IHyperlink |
getHyperlink()
Returns the currently active hyperlink or
null if none. |
IHyperlink |
getHyperlink(int offset)
Returns the hyperlink at the specified offset, or
null if
none. |
protected Cursor |
getTextCursor()
Returns the text cursor.
|
protected void |
handleDispose()
Frees all resources allocated by this viewer.
|
protected void |
internalRevealRange(int start,
int end)
Reveals the given range of the visible document.
|
void |
lineGetBackground(LineBackgroundEvent event)
This method is called when a line is about to be drawn in order to get its
background color.
|
void |
lineGetStyle(LineStyleEvent event)
This method is called when a line is about to be drawn in order to get the
line's style information.
|
protected void |
linkEntered(IHyperlink link)
Notification a hyperlink has been entered.
|
protected void |
linkExited(IHyperlink link)
Notification a link was exited.
|
void |
mouseDoubleClick(MouseEvent e)
Sent when a mouse button is pressed twice within the
(operating system specified) double click period.
|
void |
mouseDown(MouseEvent e)
Sent when a mouse button is pressed.
|
void |
mouseEnter(MouseEvent e)
Sent when the mouse pointer passes into the area of
the screen covered by a control.
|
void |
mouseExit(MouseEvent e)
Sent when the mouse pointer passes out of the area of
the screen covered by a control.
|
void |
mouseHover(MouseEvent e)
Sent when the mouse pointer hovers (that is, stops moving
for an (operating system specified) period of time) over
a control.
|
void |
mouseMove(MouseEvent e)
Sent when the mouse moves.
|
void |
mouseUp(MouseEvent e)
Sent when a mouse button is released.
|
protected void |
revealEndOfDocument()
Positions the cursor at the end of the document.
|
void |
setConsoleWidth(int width)
Sets the console to have a fixed character width.
|
void |
setFont(Font font)
Sets the font used by this viewer.
|
void |
setTabWidth(int tabWidth)
Sets the tab width used by this viewer.
|
protected void |
updateLinks(int offset)
The cursor has just be moved to the given offset, the mouse has hovered
over the given offset.
|
protected void |
updateTextListeners(TextViewer.WidgetCommand cmd)
Informs all registered text listeners about the change specified by the
widget command.
|
activatePlugins, canDoOperation, clearRememberedSelection, configure, createControl, createFormattingContext, createLayout, createVisualAnnotationModel, disposeVisualAnnotationModel, doOperation, enableOperation, ensureAnnotationHoverManagerInstalled, ensureOverviewHoverManagerInstalled, getAnnotationModel, getControl, getCurrentAnnotationHover, getQuickAssistAssistant, getQuickAssistInvocationContext, getRangeIndication, getVerticalRuler, getVisualAnnotationModel, rememberSelection, removeRangeIndication, restoreSelection, setAnnotationHover, setDocument, setDocument, setDocument, setDocument, setOverviewRulerAnnotationHover, setRangeIndication, setRangeIndicator, showAnnotations, showAnnotationsOverview, unconfigure, updateSlaveDocuments_getVisibleRegionOffset, _internalGetVisibleRegion, addPainter, addPostSelectionChangedListener, addTextInputListener, addTextListener, addTextPresentationListener, addViewportListener, appendVerifyKeyListener, areMultipleLinesSelected, canPerformFind, changeTextPresentation, copyMarkedRegion, createSlaveDocument, createSlaveDocumentManager, createTextWidget, customizeDocumentCommand, deleteText, disableRedrawing, enabledRedrawing, enabledRedrawing, event2ModelRange, findAndSelect, findAndSelect, findAndSelectInRange, fireInputDocumentAboutToBeChanged, fireInputDocumentChanged, firePostSelectionChanged, fireSelectionChanged, freeSlaveDocument, getAverageCharWidth, getBottomIndex, getBottomIndexEndOffset, getClosestWidgetLineForModelLine, getCurrentTextHover, getDocument, getDocumentPartitioning, getEmptySelectionChangedEventDelay, getExtent, getFindReplaceDocumentAdapter, getFindReplaceTarget, getHoverEventLocation, getInput, getMark, getModelCoverage, getPaintManager, getRegisteredSupports, getRewriteTarget, getSelectedRange, getSelection, getSelectionProvider, getSlaveDocumentManager, getTextHover, getTextHover, getTextHoveringController, getTextOperationTarget, getTextWidget, getTopIndex, getTopIndexStartOffset, getTopInset, getUndoManager, getVisibleDocument, getVisibleLinesInViewport, getVisibleRegion, getWidthInPixels, getWidthInPixels, handleVerifyEvent, handleVisibleDocumentAboutToBeChanged, handleVisibleDocumentChanged, ignoreAutoEditStrategies, initializeDocumentInformationMapping, inputChanged, invalidateTextPresentation, invalidateTextPresentation, isBlockSelected, isEditable, isIgnoringAutoEditStrategies, isPrintable, markChanged, modelLine2WidgetLine, modelOffset2WidgetOffset, modelRange2ClosestWidgetRange, modelRange2WidgetRange, modelRange2WidgetRange, modelSelection2WidgetSelection, modelStyleRange2WidgetStyleRange, moveFocusToWidgetToken, overlapsWithVisibleRegion, prependAutoEditStrategy, prependVerifyKeyListener, print, redraws, refresh, register, releaseWidgetToken, removeAutoEditStrategy, removePainter, removePostSelectionChangedListener, removeTextHovers, removeTextInputListener, removeTextListener, removeTextPresentationListener, removeVerifyKeyListener, removeViewportListener, requestWidgetToken, requestWidgetToken, resetPlugins, resetVisibleRegion, revealRange, selectContentTypePlugin, selectionChanged, setAutoEditStrategies, setAutoIndentStrategy, setDefaultPrefixes, setDocumentPartitioning, setEditable, setEventConsumer, setHoverControlCreator, setHyperlinkDetectors, setHyperlinkPresenter, setIndentPrefixes, setInput, setMark, setRedraw, setRedraw, setSelectedRange, setSelection, setTextColor, setTextColor, setTextDoubleClickStrategy, setTextHover, setTextHover, setTopIndex, setUndoManager, setVisibleDocument, setVisibleRegion, shift, shift, startSequentialRewriteMode, stopSequentialRewriteMode, unregister, updateSlaveDocument, updateViewportListeners, updateVisibleDocument, validateSelectionRange, widgetLine2ModelLine, widgetLineOfWidgetOffset, widgetlLine2ModelLine, widgetOffset2ModelOffset, widgetRange2ModelRange, widgetSelection2ModelSelectionaddHelpListener, addSelectionChangedListener, fireHelpRequested, fireSelectionChanged, getData, handleHelpRequest, removeHelpListener, removeSelectionChangedListener, scrollDown, scrollUp, setData, setSelectionclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddTextInputListener, addTextListener, addViewportListener, changeTextPresentation, getBottomIndex, getBottomIndexEndOffset, getDocument, getFindReplaceTarget, getSelectedRange, getSelectionProvider, getTextOperationTarget, getTextWidget, getTopIndex, getTopIndexStartOffset, getTopInset, getVisibleRegion, invalidateTextPresentation, isEditable, overlapsWithVisibleRegion, removeTextInputListener, removeTextListener, removeViewportListener, resetPlugins, resetVisibleRegion, revealRange, setAutoIndentStrategy, setDefaultPrefixes, setEditable, setEventConsumer, setIndentPrefixes, setSelectedRange, setTextColor, setTextColor, setTextDoubleClickStrategy, setTextHover, setTopIndex, setUndoManager, setVisibleRegionaddSelectionChangedListener, removeSelectionChangedListener, setSelectionpublic TextConsoleViewer(Composite parent, TextConsole console)
parent - containing widgetconsole - text consolepublic void setTabWidth(int tabWidth)
tabWidth - the tab width used by this viewerpublic void setFont(Font font)
font - the font used by this viewerprotected void revealEndOfDocument()
public void lineGetStyle(LineStyleEvent event)
LineStyleListenerThe following event fields are used:
lineGetStyle in interface LineStyleListenerevent - the given eventLineStyleEventpublic void lineGetBackground(LineBackgroundEvent event)
LineBackgroundListenerThe following event fields are used:
lineGetBackground in interface LineBackgroundListenerevent - the given eventLineBackgroundEventprotected Cursor getHandCursor()
protected Cursor getTextCursor()
protected void linkEntered(IHyperlink link)
link - the link that was enteredprotected void linkExited(IHyperlink link)
link - the link that was exitedpublic void mouseEnter(MouseEvent e)
MouseTrackListenermouseEnter in interface MouseTrackListenere - an event containing information about the mouse enterpublic void mouseExit(MouseEvent e)
MouseTrackListenermouseExit in interface MouseTrackListenere - an event containing information about the mouse exitpublic void mouseHover(MouseEvent e)
MouseTrackListenermouseHover in interface MouseTrackListenere - an event containing information about the hoverpublic void mouseMove(MouseEvent e)
MouseMoveListenermouseMove in interface MouseMoveListenere - an event containing information about the mouse moveprotected void updateLinks(int offset)
offset - public IHyperlink getHyperlink()
null if none.null if nonepublic IHyperlink getHyperlink(int offset)
null if
none.offset - offset at which a hyperlink has been requestednull if nonepublic void mouseDoubleClick(MouseEvent e)
MouseListenermouseDoubleClick in interface MouseListenere - an event containing information about the mouse double clickDisplay.getDoubleClickTime()public void mouseDown(MouseEvent e)
MouseListenermouseDown in interface MouseListenere - an event containing information about the mouse button presspublic void mouseUp(MouseEvent e)
MouseListenermouseUp in interface MouseListenere - an event containing information about the mouse button releaseprotected IDocumentAdapter createDocumentAdapter()
TextViewercreateDocumentAdapter in class TextViewerpublic void setConsoleWidth(int width)
width - fixed character width of the console, or -1protected void handleDispose()
TextViewerhandleDispose in class SourceViewerprotected void updateTextListeners(TextViewer.WidgetCommand cmd)
TextViewerupdateTextListeners in class TextViewercmd - the widget command translated into a text event sent to all text listenersprotected void internalRevealRange(int start,
int end)
TextViewerinternalRevealRange in class TextViewerstart - the start offset of the rangeend - the end offset of the rangeGuidelines for using Eclipse APIs. Copyright (c) IBM Corp. and others 2000, 2006. All rights reserved.