|
Eclipse Platform Release 3.0 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
A painter is responsible for creating, managing, updating, and removing visual decorations on an ITextViewer's text widget. Examples are the highlighting of the caret line, the print margin, or the highlighting of matching peer characters such as pairs of brackets. Clients may implement this interface.
Painters should be registered with a PaintManager. The paint manager tracks several classes of events issued by an ITextViewer and reacts by appropriately invoking the registered painters.
Painters are either active or inactive. Usually, painters are initially inactive and are activated by the first call to their paint method. Painters can be deactivated by calling deactivate. Inactive painter can be reactivated by calling paint.
Painters usually have to manage state information. E.g., a painter painting a caret line highlight must redraw the previous and the actual caret line in the advent of a change of the caret position. This state information must be adapted to changes of the viewer's content. In order to support this common scenario, the PaintManager gives a painter access to a IPaintPositionManager. The painter can use this updater to manage its state information.
Field Summary | |
static int | CONFIGURATION
Constant describing the reason of a repaint request: paint manager or painter configuration changed. |
static int | INTERNAL
Constant describing the reason of a repaint request: paint manager internal change. |
static int | KEY_STROKE
Constant describing the reason of a repaint request: key pressed. |
static int | MOUSE_BUTTON
Constant describing the reason of a repaint request: mouse button pressed. |
static int | SELECTION
Constant describing the reason of a repaint request: selection changed. |
static int | TEXT_CHANGE
Constant describing the reason of a repaint request: text changed. |
Method Summary | |
void | deactivate(boolean redraw)
Deactivates this painter. |
void | dispose()
Disposes this painter. |
void | paint(int reason)
Requests this painter to repaint because of the given reason. |
void | setPositionManager(IPaintPositionManager manager)
Sets the paint position manager that can be used by this painter or removes any previously set paint position manager. |
Field Detail |
public static final int SELECTION
public static final int TEXT_CHANGE
public static final int KEY_STROKE
public static final int MOUSE_BUTTON
public static final int INTERNAL
public static final int CONFIGURATION
Method Detail |
public void dispose()
public void paint(int reason)
public void deactivate(boolean redraw)
public void setPositionManager(IPaintPositionManager manager)
|
Eclipse Platform Release 3.0 | ||||||||||
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, 2004. All rights reserved.