public class EditableTextDecorator extends java.lang.Object implements IEditableText
Extra functionality that allows a JTextComponent having graphical edition options,
which allows user to select any: COPY, CUT, PASTE, SELECT ALL, REMOVE, UNDO, REDO in a popup menu.
All options will be about the edition of the text in the component.
How select an edition option using the mouse: press the right button of the mouse on the text area, and a popup with the options will be displayed. Select and option.
Default fast-access keys:
This component by default stores 100 undo/redo actions. This value can be modified.
A developer would have to re-implement #defineEditorKeyListener(), creating
a new editorKeyListener for changing any fast-access key.
| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_UNDO_REDO_LIMIT_ACTIONS |
protected java.awt.event.KeyListener |
editorKeyListener |
| Constructor and Description |
|---|
EditableTextDecorator(javax.swing.text.JTextComponent jTextComponent)
Default constructor
|
| Modifier and Type | Method and Description |
|---|---|
void |
addUndoRedoEditListener(UndoRedoEditListener listener)
Adds a listener for notification of an undo or redo operation executed.
|
protected void |
defineEditorKeyListener()
Defines a key listener for the editor of the text component.
|
protected void |
fireUndoRedoEditUpdate(UndoRedoEditEvent e)
Notifies all listeners that have registered interest for
notification on this event type.
|
UndoRedoEditListener[] |
getUndoRedoEditListeners()
Returns an array of all the
UndoRedoEditListener
registered on this text component. |
int |
getUndoRedoLimitActions()
Gets the limit of actions that can hold the UndoManager.
|
void |
removeUndoRedoEditListener(UndoRedoEditListener listener)
Removes a listener for notification of an undo or redo operation executed.
|
void |
setUndoRedoLimitActions(int limit)
Sets the limit of actions that can hold the UndoManager of this component.
|
public static final int DEFAULT_UNDO_REDO_LIMIT_ACTIONS
protected java.awt.event.KeyListener editorKeyListener
public EditableTextDecorator(javax.swing.text.JTextComponent jTextComponent)
protected void defineEditorKeyListener()
public void setUndoRedoLimitActions(int limit)
IEditableTextsetUndoRedoLimitActions in interface IEditableTextlimit - sets the limit of actions that can holdpublic int getUndoRedoLimitActions()
IEditableTextgetUndoRedoLimitActions in interface IEditableTextpublic void addUndoRedoEditListener(UndoRedoEditListener listener)
IEditableTextaddUndoRedoEditListener in interface IEditableTextlistener - the listener to be addedjavax.swing.event.UndoRedoEditEventpublic void removeUndoRedoEditListener(UndoRedoEditListener listener)
IEditableTextremoveUndoRedoEditListener in interface IEditableTextlistener - the listener to be removedjavax.swing.event.UndoRedoEditEventpublic UndoRedoEditListener[] getUndoRedoEditListeners()
IEditableTextUndoRedoEditListener
registered on this text component.getUndoRedoEditListeners in interface IEditableTextUndoRedoEditListeners
or an empty
array if no listeners of that kind are currently registeredIEditableText.addUndoRedoEditListener(org.gvsig.gui.beans.editabletextcomponent.event.UndoRedoEditListener),
IEditableText.removeUndoRedoEditListener(org.gvsig.gui.beans.editabletextcomponent.event.UndoRedoEditListener)protected void fireUndoRedoEditUpdate(UndoRedoEditEvent e)
e - the eventEventListenerList