|
Eclipse Platform Release 3.1 |
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.jface.viewers.Viewer
org.eclipse.jface.text.TextViewer
org.eclipse.ui.console.TextConsoleViewer
Default viewer used to display a TextConsole
.
Clients may subclass this class.
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.viewers.Viewer |
---|
WIDGET_DATA_KEY |
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 | |
---|---|
TextConsoleViewer(Composite parent,
TextConsole console)
Constructs a new viewer in the given parent for the specified console. |
Method Summary | |
---|---|
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. |
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. |
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.viewers.ISelectionProvider |
---|
addSelectionChangedListener, removeSelectionChangedListener, setSelection |
Constructor Detail |
public TextConsoleViewer(Composite parent, TextConsole console)
parent
- containing widgetconsole
- text consoleMethod Detail |
public 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 requested
null
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 characater width of the console, or -1protected void handleDispose()
TextViewer
handleDispose
in class TextViewer
protected void updateTextListeners(TextViewer.WidgetCommand cmd)
TextViewer
updateTextListeners
in class TextViewer
cmd
- the widget command translated into a text event sent to all text listeners
|
Eclipse Platform Release 3.1 |
|||||||||||
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, 2005. All rights reserved.