public abstract class RecordableTextAction
extends javax.swing.text.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.构造器和说明 |
---|
RecordableTextAction(java.lang.String text)
Constructor.
|
RecordableTextAction(java.lang.String text,
javax.swing.Icon icon,
java.lang.String desc,
java.lang.Integer mnemonic,
javax.swing.KeyStroke accelerator)
Constructor.
|
限定符和类型 | 方法和说明 |
---|---|
void |
actionPerformed(java.awt.event.ActionEvent e)
This method is final so that you cannot override it and mess up the
macro-recording part of it.
|
abstract void |
actionPerformedImpl(java.awt.event.ActionEvent e,
RTextArea textArea)
The actual meat of the action.
|
javax.swing.KeyStroke |
getAccelerator()
Returns the accelerator for this action.
|
java.lang.String |
getDescription()
Returns the description for this action.
|
javax.swing.Icon |
getIcon()
Returns the icon for this action.
|
abstract java.lang.String |
getMacroID()
Returns the identifier for this macro.
|
int |
getMnemonic()
Returns the mnemonic for this action.
|
java.lang.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 |
setAccelerator(javax.swing.KeyStroke accelerator)
Sets the accelerator for this action.
|
void |
setMnemonic(char mnemonic)
Sets the mnemonic for this action.
|
void |
setMnemonic(java.lang.Integer mnemonic)
Sets the mnemonic for this action.
|
void |
setName(java.lang.String name)
Sets the name of this action.
|
void |
setProperties(java.lang.String keyRoot)
Sets the name, mnemonic, and description of this action.
|
void |
setRecordable(boolean recordable)
Sets whether or not this action will be recorded and replayed in
a macro.
|
void |
setShortDescription(java.lang.String shortDesc)
Sets the short description for this action.
|
public RecordableTextAction(java.lang.String text)
text
- The text (name) associated with the action.public RecordableTextAction(java.lang.String text, javax.swing.Icon icon, java.lang.String desc, java.lang.Integer mnemonic, javax.swing.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(java.awt.event.ActionEvent e)
actionPerformedImpl
.e
- The action being performed.actionPerformedImpl(java.awt.event.ActionEvent, com.fr.design.gui.syntax.ui.rtextarea.RTextArea)
public abstract void actionPerformedImpl(java.awt.event.ActionEvent e, RTextArea textArea)
e
- The action being performed.textArea
- The text area "receiving" the action.actionPerformed(java.awt.event.ActionEvent)
public javax.swing.KeyStroke getAccelerator()
setAccelerator(KeyStroke)
public java.lang.String getDescription()
public javax.swing.Icon getIcon()
public abstract java.lang.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(char)
,
setMnemonic(Integer)
public java.lang.String getName()
setName(String)
public boolean isRecordable()
setRecordable(boolean)
public void setAccelerator(javax.swing.KeyStroke accelerator)
accelerator
- The new accelerator.getAccelerator()
public void setMnemonic(char mnemonic)
mnemonic
- The new mnemonic.setMnemonic(Integer)
,
getMnemonic()
public void setMnemonic(java.lang.Integer mnemonic)
mnemonic
- The new mnemonic.setMnemonic(char)
,
getMnemonic()
public void setName(java.lang.String name)
name
- The new name.getName()
public void setProperties(java.lang.String keyRoot)
keyRoot
- The root of the keys for the properties.
".Name
", ".Mnemonic
", and
".Desc
" will be appended to create the key for each
property.public void setRecordable(boolean recordable)
recordable
- Whether or not this action should be recorded
and replayed.isRecordable()
public void setShortDescription(java.lang.String shortDesc)
shortDesc
- The short description for this action.