public abstract class RecordableTextAction extends TextAction
RTextAreaEditorKit. This action is what allows instances of
RTextArea to record keystrokes into "macros;" if an action is
recordable and occurs while the user is recording a macro, it adds itself to
the currently-being-recorded macro.changeSupport, enabledACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, DISPLAYED_MNEMONIC_INDEX_KEY, LARGE_ICON_KEY, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SELECTED_KEY, SHORT_DESCRIPTION, SMALL_ICON| Constructor and Description |
|---|
RecordableTextAction(String text)
Constructor.
|
RecordableTextAction(String text,
Icon icon,
String desc,
Integer mnemonic,
KeyStroke accelerator)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
actionPerformed(ActionEvent e)
This method is final so that you cannot override it and mess up the
macro-recording part of it.
|
abstract void |
actionPerformedImpl(ActionEvent e,
RTextArea textArea)
The actual meat of the action.
|
KeyStroke |
getAccelerator()
Returns the accelerator for this action.
|
String |
getDescription()
Returns the description for this action.
|
Icon |
getIcon()
Returns the icon for this action.
|
abstract String |
getMacroID()
Returns the identifier for this macro.
|
int |
getMnemonic()
Returns the mnemonic for this action.
|
String |
getName()
Returns the name of this action.
|
boolean |
isRecordable()
Returns whether or not this action will be recorded and replayed in
a macro.
|
void |
setMnemonic(Integer mnemonic)
Sets the mnemonic for this action.
|
void |
setRecordable(boolean recordable)
Sets whether or not this action will be recorded and replayed in
a macro.
|
augmentList, getFocusedComponent, getTextComponentaddPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabledpublic RecordableTextAction(String text)
text - The text (name) associated with the action.public RecordableTextAction(String text, Icon icon, String desc, Integer mnemonic, KeyStroke accelerator)
text - The text (name) associated with the action.icon - The icon associated with the action.desc - The description of the action.mnemonic - The mnemonic for the action.accelerator - The accelerator key for the action.public final void actionPerformed(ActionEvent e)
actionPerformedImpl.e - The action being performed.actionPerformedImpl(java.awt.event.ActionEvent, org.fife.ui.rtextarea.RTextArea)public abstract void actionPerformedImpl(ActionEvent e, RTextArea textArea)
e - The action being performed.textArea - The text area "receiving" the action.actionPerformed(java.awt.event.ActionEvent)public KeyStroke getAccelerator()
public String getDescription()
public Icon getIcon()
public abstract String getMacroID()
RTextAreaEditorKit.CutAction
action, for example, rename it to "Remove", and it will still be
recorded as a "cut" action. Subclasses should return a unique string
from this method; preferably the name of the action.
If you subclass a RecordableTextAction, you should NOT
override this method; if you do, the action may not be properly
recorded in a macro.
public int getMnemonic()
-1 if not defined.setMnemonic(Integer)public String getName()
public boolean isRecordable()
setRecordable(boolean)public void setMnemonic(Integer mnemonic)
mnemonic - The new mnemonic.getMnemonic()public void setRecordable(boolean recordable)
recordable - Whether or not this action should be recorded
and replayed.isRecordableCopyright © 2009-2013 jtstand.com. All Rights Reserved.