com.ibm.richtext.textpanel
Class TextPanelEvent

java.lang.Object
  |
  +--java.util.EventObject
        |
        +--com.ibm.richtext.textpanel.TextPanelEvent
All Implemented Interfaces:
java.io.Serializable

public final class TextPanelEvent
extends java.util.EventObject

TextPanelEvent is generated by an MTextPanel to notify listeners of changes. To receive TextPanelEvents from an MTextPanel, clients must implement TextPanelListener and add themselves to the MTextPanel's list of listeners.

Some event types are special cases of others. This is intentional - it allows notifications to be sent less often in certain common cases. For example, a change in the selection range generates a SELECTION_RANGE_CHANGED event. This is a very common occurrance, and if many clients listen for this event, there may be a significant performance penalty. By listening for a more specialized event (such as SELECTION_EMPTY_CHANGED), clients can reduce the number of notifications sent.

See Also:
MTextPanel, TextPanelListener, Serialized Form

Field Summary
static int CLIPBOARD_CHANGED
          Events of this type are sent when the clipboard state changes.
static int FORMAT_WIDTH_CHANGED
          Events of this type are sent when the wrap width of the text changes.
static int KEYREMAP_CHANGED
          Events of this type are sent when the key remap changes.
static int SELECTION_EMPTY_CHANGED
          Events of this type are sent when the selection range becomes 0-length after not being 0-length, or vice versa.
static int SELECTION_RANGE_CHANGED
          Events of this type indicate a change in the selection range.
static int SELECTION_STYLES_CHANGED
          Events of this type are sent when the styles in the current selection change.
static int TEXT_CHANGED
          Events of this type indicate that the text in the TextPanel changed.
static int TEXT_PANEL_FIRST
          The lower bound of TextPanelEvent ID's.
static int TEXT_PANEL_LAST
          The upper bound of TextPanelEvent ID's.
static int UNDO_STATE_CHANGED
          Events of this type are sent when the undo/redo state changes.
 
Fields inherited from class java.util.EventObject
source
 
Method Summary
 int getID()
          Return the event ID for this event.
 java.lang.String toString()
           
 
Methods inherited from class java.util.EventObject
getSource
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

TEXT_PANEL_FIRST

public static final int TEXT_PANEL_FIRST
The lower bound of TextPanelEvent ID's.

SELECTION_RANGE_CHANGED

public static final int SELECTION_RANGE_CHANGED
Events of this type indicate a change in the selection range. This occurs quite often. Most clients do not need to be notified every time the selection range changes.

SELECTION_EMPTY_CHANGED

public static final int SELECTION_EMPTY_CHANGED
Events of this type are sent when the selection range becomes 0-length after not being 0-length, or vice versa. This event is a special case of SELECTION_RANGE_CHANGED.

TEXT_CHANGED

public static final int TEXT_CHANGED
Events of this type indicate that the text in the TextPanel changed. This type of event occurs often.

SELECTION_STYLES_CHANGED

public static final int SELECTION_STYLES_CHANGED
Events of this type are sent when the styles in the current selection change.

UNDO_STATE_CHANGED

public static final int UNDO_STATE_CHANGED
Events of this type are sent when the undo/redo state changes.

CLIPBOARD_CHANGED

public static final int CLIPBOARD_CHANGED
Events of this type are sent when the clipboard state changes.

FORMAT_WIDTH_CHANGED

public static final int FORMAT_WIDTH_CHANGED
Events of this type are sent when the wrap width of the text changes.

KEYREMAP_CHANGED

public static final int KEYREMAP_CHANGED
Events of this type are sent when the key remap changes.

TEXT_PANEL_LAST

public static final int TEXT_PANEL_LAST
The upper bound of TextPanelEvent ID's.
Method Detail

getID

public int getID()
Return the event ID for this event. Event ID's are one of the class constants.
Returns:
the event ID for this event

toString

public java.lang.String toString()
Overrides:
toString in class java.util.EventObject


Copyright (c) 1998-2000 IBM Corporation and others.