public class EditableTextDecorator extends 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 KeyListener |
editorKeyListener |
Constructor and Description |
---|
EditableTextDecorator(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 KeyListener editorKeyListener
public EditableTextDecorator(JTextComponent jTextComponent)
protected void defineEditorKeyListener()
public void setUndoRedoLimitActions(int limit)
IEditableText
setUndoRedoLimitActions
in interface IEditableText
limit
- sets the limit of actions that can holdpublic int getUndoRedoLimitActions()
IEditableText
getUndoRedoLimitActions
in interface IEditableText
public void addUndoRedoEditListener(UndoRedoEditListener listener)
IEditableText
addUndoRedoEditListener
in interface IEditableText
listener
- the listener to be addedUndoRedoEditEvent
public void removeUndoRedoEditListener(UndoRedoEditListener listener)
IEditableText
removeUndoRedoEditListener
in interface IEditableText
listener
- the listener to be removedUndoRedoEditEvent
public UndoRedoEditListener[] getUndoRedoEditListeners()
IEditableText
UndoRedoEditListener
registered on this text component.getUndoRedoEditListeners
in interface IEditableText
UndoRedoEditListener
s
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