Package org.eclipse.jface.text
Class PaintManager
java.lang.Object
org.eclipse.jface.text.PaintManager
- All Implemented Interfaces:
EventListener
,ITextInputListener
,ITextListener
,ISelectionChangedListener
,KeyListener
,MouseListener
,SWTEventListener
public final class PaintManager
extends Object
implements KeyListener, MouseListener, ISelectionChangedListener, ITextListener, ITextInputListener
Manages the
IPainter
object registered with an
ITextViewer
.
Clients usually instantiate and configure objects of this type.
- Since:
- 2.1
-
Constructor Summary
ConstructorDescriptionPaintManager
(ITextViewer textViewer) Creates a new paint manager for the given text viewer. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addPainter
(IPainter painter) Adds the given painter to the list of painters managed by this paint manager.void
dispose()
Disposes this paint manager.void
inputDocumentAboutToBeChanged
(IDocument oldInput, IDocument newInput) Called before the input document is replaced.void
inputDocumentChanged
(IDocument oldInput, IDocument newInput) Called after the input document has been replaced.void
Sent when a key is pressed on the system keyboard.void
Sent when a key is released on the system keyboard.void
Sent when a mouse button is pressed twice within the (operating system specified) double click period.void
Sent when a mouse button is pressed.void
Sent when a mouse button is released.void
removePainter
(IPainter painter) Removes the given painter from the list of painters managed by this paint manager.void
Notifies that the selection has changed.void
textChanged
(TextEvent event) The visual representation of a text viewer this listener is registered with has been changed.
-
Constructor Details
-
PaintManager
Creates a new paint manager for the given text viewer.- Parameters:
textViewer
- the text viewer associated to this newly created paint manager
-
-
Method Details
-
addPainter
Adds the given painter to the list of painters managed by this paint manager. If the painter is already registered with this paint manager, this method is without effect.- Parameters:
painter
- the painter to be added
-
removePainter
Removes the given painter from the list of painters managed by this paint manager. If the painter has not previously been added to this paint manager, this method is without effect.- Parameters:
painter
- the painter to be removed
-
dispose
public void dispose()Disposes this paint manager. The paint manager uninstalls itself and clears all registered painters. This method is also called when the last painter is removed from the list of managed painters. -
keyPressed
Description copied from interface:KeyListener
Sent when a key is pressed on the system keyboard.- Specified by:
keyPressed
in interfaceKeyListener
- Parameters:
e
- an event containing information about the key press
-
keyReleased
Description copied from interface:KeyListener
Sent when a key is released on the system keyboard.- Specified by:
keyReleased
in interfaceKeyListener
- Parameters:
e
- an event containing information about the key release
-
mouseDoubleClick
Description copied from interface:MouseListener
Sent when a mouse button is pressed twice within the (operating system specified) double click period.- Specified by:
mouseDoubleClick
in interfaceMouseListener
- Parameters:
e
- an event containing information about the mouse double click- See Also:
-
mouseDown
Description copied from interface:MouseListener
Sent when a mouse button is pressed.- Specified by:
mouseDown
in interfaceMouseListener
- Parameters:
e
- an event containing information about the mouse button press
-
mouseUp
Description copied from interface:MouseListener
Sent when a mouse button is released.- Specified by:
mouseUp
in interfaceMouseListener
- Parameters:
e
- an event containing information about the mouse button release
-
selectionChanged
Description copied from interface:ISelectionChangedListener
Notifies that the selection has changed.- Specified by:
selectionChanged
in interfaceISelectionChangedListener
- Parameters:
event
- event object describing the change
-
textChanged
Description copied from interface:ITextListener
The visual representation of a text viewer this listener is registered with has been changed.- Specified by:
textChanged
in interfaceITextListener
- Parameters:
event
- the description of the change
-
inputDocumentAboutToBeChanged
Description copied from interface:ITextInputListener
Called before the input document is replaced.- Specified by:
inputDocumentAboutToBeChanged
in interfaceITextInputListener
- Parameters:
oldInput
- the text viewer's previous input documentnewInput
- the text viewer's new input document
-
inputDocumentChanged
Description copied from interface:ITextInputListener
Called after the input document has been replaced.- Specified by:
inputDocumentChanged
in interfaceITextInputListener
- Parameters:
oldInput
- the text viewer's previous input documentnewInput
- the text viewer's new input document
-