Class EditableTextDecorator
java.lang.Object
org.gvsig.gui.beans.editabletextcomponent.EditableTextDecorator
- All Implemented Interfaces:
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:
- COPY: CTRL + C. Copies from the text field to the clipboard.
- CUT: CTRL + X. Cuts from the text field to the clipboad.
- PASTE: CTRL + V. Copies from the clipboard to the text field.
- REMOVE: SUPR (in spanish keyboard, and the equivalent in others). Removes the selected text.
- SELECT ALL: CTRL + A. Selects all the text.
- UNDO: CTRL + Z. Undoes.
- REDO: SHIFT + CTRL + Z. Redoes.
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.
- Version:
- 27/02/2008
- Author:
- Pablo Piqueras Bartolomé (pablo.piqueras@iver.es)
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddUndoRedoEditListener(UndoRedoEditListener listener) Adds a listener for notification of an undo or redo operation executed.protected voidDefines a key listener for the editor of the text component.protected voidNotifies all listeners that have registered interest for notification on this event type.Returns an array of all theUndoRedoEditListenerregistered on this text component.intGets the limit of actions that can hold the UndoManager.voidRemoves a listener for notification of an undo or redo operation executed.voidsetUndoRedoLimitActions(int limit) Sets the limit of actions that can hold the UndoManager of this component.
-
Field Details
-
DEFAULT_UNDO_REDO_LIMIT_ACTIONS
public static final int DEFAULT_UNDO_REDO_LIMIT_ACTIONS- See Also:
-
editorKeyListener
-
-
Constructor Details
-
EditableTextDecorator
Default constructor
-
-
Method Details
-
defineEditorKeyListener
protected void defineEditorKeyListener()Defines a key listener for the editor of the text component. -
setUndoRedoLimitActions
public void setUndoRedoLimitActions(int limit) Description copied from interface:IEditableTextSets the limit of actions that can hold the UndoManager of this component.- Specified by:
setUndoRedoLimitActionsin interfaceIEditableText- Parameters:
limit- sets the limit of actions that can hold
-
getUndoRedoLimitActions
public int getUndoRedoLimitActions()Description copied from interface:IEditableTextGets the limit of actions that can hold the UndoManager.- Specified by:
getUndoRedoLimitActionsin interfaceIEditableText- Returns:
- int limit of actions that can hold
-
addUndoRedoEditListener
Description copied from interface:IEditableTextAdds a listener for notification of an undo or redo operation executed.- Specified by:
addUndoRedoEditListenerin interfaceIEditableText- Parameters:
listener- the listener to be added- See Also:
-
removeUndoRedoEditListener
Description copied from interface:IEditableTextRemoves a listener for notification of an undo or redo operation executed.- Specified by:
removeUndoRedoEditListenerin interfaceIEditableText- Parameters:
listener- the listener to be removed- See Also:
-
getUndoRedoEditListeners
Description copied from interface:IEditableTextReturns an array of all theUndoRedoEditListenerregistered on this text component.- Specified by:
getUndoRedoEditListenersin interfaceIEditableText- Returns:
- all of this component's
UndoRedoEditListeners or an empty array if no listeners of that kind are currently registered - See Also:
-
fireUndoRedoEditUpdate
Notifies all listeners that have registered interest for notification on this event type. The event instance is lazily created using the parameters passed into the fire method. The listener list is processed in a last-to-first manner.- Parameters:
e- the event- See Also:
-