public class TextConsoleViewer extends SourceViewer implements LineStyleListener, LineBackgroundListener, MouseTrackListener, MouseMoveListener, MouseListener
TextConsole
.
Clients may subclass this class.
SourceViewer.RulerLayout
TextViewer.TextHoverKey, TextViewer.WidgetCommand
ITextViewerExtension8.EnrichMode
_SELECTION_POSITION_CATEGORY, fAnnotationHover, fContentAssistant, fContentAssistantInstalled, fContentFormatter, fInformationPresenter, fOverviewRulerAnnotationHover, fPresentationReconciler, fQuickAssistAssistant, fQuickAssistAssistantInstalled, fReconciler, fSelectionCategory, fSelections, fSelectionUpdater, GAP_SIZE, GAP_SIZE_1, MODEL_ANNOTATION_MODEL
fAutoIndentStrategies, 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_ERRORS
WIDGET_DATA_KEY
CONTENTASSIST_CONTEXT_INFORMATION, CONTENTASSIST_PROPOSALS, FORMAT, INFORMATION, QUICK_ASSIST
DEFAULT_HOVER_STATE_MASK
COPY, 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.
|
TextConsoleViewer(Composite parent,
TextConsole console,
IScrollLockStateProvider scrollLockStateProvider)
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, addVerticalRulerColumn, canDoOperation, clearRememberedSelection, configure, createControl, createFormattingContext, createFormattingContext, createLayout, createVisualAnnotationModel, disposeVisualAnnotationModel, doOperation, enableOperation, ensureAnnotationHoverManagerInstalled, ensureOverviewHoverManagerInstalled, getAnnotationModel, getContentAssistantFacade, getControl, getCurrentAnnotationHover, getQuickAssistAssistant, getQuickAssistInvocationContext, getRangeIndication, getVerticalRuler, getVisualAnnotationModel, rememberSelection, removeRangeIndication, removeVerticalRulerColumn, restoreSelection, setAnnotationHover, setDocument, setDocument, setDocument, setDocument, setHoverEnrichMode, 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, 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, setTabsToSpacesConverter, setTextColor, setTextColor, setTextDoubleClickStrategy, setTextHover, setTextHover, setTopIndex, setUndoManager, setVisibleDocument, setVisibleRegion, shift, shift, startSequentialRewriteMode, stopSequentialRewriteMode, unregister, updateSlaveDocument, updateViewportListeners, updateVisibleDocument, validateSelectionRange, widgetLine2ModelLine, widgetLineOfWidgetOffset, widgetlLine2ModelLine, widgetOffset2ModelOffset, widgetRange2ModelRange, widgetSelection2ModelSelection
addHelpListener, addSelectionChangedListener, fireHelpRequested, fireSelectionChanged, getData, handleHelpRequest, removeHelpListener, removeSelectionChangedListener, scrollDown, scrollUp, setData, setSelection
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addTextInputListener, 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, setVisibleRegion
addSelectionChangedListener, removeSelectionChangedListener, setSelection
public TextConsoleViewer(Composite parent, TextConsole console, IScrollLockStateProvider scrollLockStateProvider)
parent
- the containing compositeconsole
- the text consolescrollLockStateProvider
- the scroll lock state providerpublic 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)
LineStyleListener
The following event fields are used:
lineGetStyle
in interface LineStyleListener
event
- the given eventLineStyleEvent
public void lineGetBackground(LineBackgroundEvent event)
LineBackgroundListener
The following event fields are used:
lineGetBackground
in interface LineBackgroundListener
event
- the given eventLineBackgroundEvent
protected 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)
MouseTrackListener
mouseEnter
in interface MouseTrackListener
e
- an event containing information about the mouse enterpublic void mouseExit(MouseEvent e)
MouseTrackListener
mouseExit
in interface MouseTrackListener
e
- an event containing information about the mouse exitpublic void mouseHover(MouseEvent e)
MouseTrackListener
mouseHover
in interface MouseTrackListener
e
- an event containing information about the hoverpublic void mouseMove(MouseEvent e)
MouseMoveListener
mouseMove
in interface MouseMoveListener
e
- 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)
MouseListener
mouseDoubleClick
in interface MouseListener
e
- an event containing information about the mouse double clickDisplay.getDoubleClickTime()
public void mouseDown(MouseEvent e)
MouseListener
mouseDown
in interface MouseListener
e
- an event containing information about the mouse button presspublic void mouseUp(MouseEvent e)
MouseListener
mouseUp
in interface MouseListener
e
- an event containing information about the mouse button releaseprotected IDocumentAdapter createDocumentAdapter()
TextViewer
createDocumentAdapter
in class TextViewer
public void setConsoleWidth(int width)
width
- fixed character width of the console, or -1protected void handleDispose()
TextViewer
handleDispose
in class SourceViewer
protected void updateTextListeners(TextViewer.WidgetCommand cmd)
TextViewer
updateTextListeners
in class TextViewer
cmd
- the widget command translated into a text event sent to all text listenersprotected void internalRevealRange(int start, int end)
TextViewer
internalRevealRange
in class TextViewer
start
- the start offset of the rangeend
- the end offset of the range
Copyright (c) 2000, 2015 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.