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 theIPainterobject registered with anITextViewer.Clients usually instantiate and configure objects of this type.
- Since:
- 2.1
-
-
Constructor Summary
Constructors Constructor Description PaintManager(ITextViewer textViewer)Creates a new paint manager for the given text viewer.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddPainter(IPainter painter)Adds the given painter to the list of painters managed by this paint manager.voiddispose()Disposes this paint manager.voidinputDocumentAboutToBeChanged(IDocument oldInput, IDocument newInput)Called before the input document is replaced.voidinputDocumentChanged(IDocument oldInput, IDocument newInput)Called after the input document has been replaced.voidkeyPressed(KeyEvent e)Sent when a key is pressed on the system keyboard.voidkeyReleased(KeyEvent e)Sent when a key is released on the system keyboard.voidmouseDoubleClick(MouseEvent e)Sent when a mouse button is pressed twice within the (operating system specified) double click period.voidmouseDown(MouseEvent e)Sent when a mouse button is pressed.voidmouseUp(MouseEvent e)Sent when a mouse button is released.voidremovePainter(IPainter painter)Removes the given painter from the list of painters managed by this paint manager.voidselectionChanged(SelectionChangedEvent event)Notifies that the selection has changed.voidtextChanged(TextEvent event)The visual representation of a text viewer this listener is registered with has been changed.
-
-
-
Constructor Detail
-
PaintManager
public PaintManager(ITextViewer textViewer)
Creates a new paint manager for the given text viewer.- Parameters:
textViewer- the text viewer associated to this newly created paint manager
-
-
Method Detail
-
addPainter
public void addPainter(IPainter painter)
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
public void removePainter(IPainter painter)
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
public void keyPressed(KeyEvent e)
Description copied from interface:KeyListenerSent when a key is pressed on the system keyboard.- Specified by:
keyPressedin interfaceKeyListener- Parameters:
e- an event containing information about the key press
-
keyReleased
public void keyReleased(KeyEvent e)
Description copied from interface:KeyListenerSent when a key is released on the system keyboard.- Specified by:
keyReleasedin interfaceKeyListener- Parameters:
e- an event containing information about the key release
-
mouseDoubleClick
public void mouseDoubleClick(MouseEvent e)
Description copied from interface:MouseListenerSent when a mouse button is pressed twice within the (operating system specified) double click period.- Specified by:
mouseDoubleClickin interfaceMouseListener- Parameters:
e- an event containing information about the mouse double click- See Also:
Display.getDoubleClickTime()
-
mouseDown
public void mouseDown(MouseEvent e)
Description copied from interface:MouseListenerSent when a mouse button is pressed.- Specified by:
mouseDownin interfaceMouseListener- Parameters:
e- an event containing information about the mouse button press
-
mouseUp
public void mouseUp(MouseEvent e)
Description copied from interface:MouseListenerSent when a mouse button is released.- Specified by:
mouseUpin interfaceMouseListener- Parameters:
e- an event containing information about the mouse button release
-
selectionChanged
public void selectionChanged(SelectionChangedEvent event)
Description copied from interface:ISelectionChangedListenerNotifies that the selection has changed.- Specified by:
selectionChangedin interfaceISelectionChangedListener- Parameters:
event- event object describing the change
-
textChanged
public void textChanged(TextEvent event)
Description copied from interface:ITextListenerThe visual representation of a text viewer this listener is registered with has been changed.- Specified by:
textChangedin interfaceITextListener- Parameters:
event- the description of the change
-
inputDocumentAboutToBeChanged
public void inputDocumentAboutToBeChanged(IDocument oldInput, IDocument newInput)
Description copied from interface:ITextInputListenerCalled before the input document is replaced.- Specified by:
inputDocumentAboutToBeChangedin interfaceITextInputListener- Parameters:
oldInput- the text viewer's previous input documentnewInput- the text viewer's new input document
-
inputDocumentChanged
public void inputDocumentChanged(IDocument oldInput, IDocument newInput)
Description copied from interface:ITextInputListenerCalled after the input document has been replaced.- Specified by:
inputDocumentChangedin interfaceITextInputListener- Parameters:
oldInput- the text viewer's previous input documentnewInput- the text viewer's new input document
-
-