|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.gjt.sp.jedit.ActionSet
A set of actions.
Action sets are read from actions.xml
files
contained inside plugin JARs. An action definition file has the following
form:
<?xml version="1.0"?> <!DOCTYPE ACTIONS SYSTEM "actions.dtd"> <ACTIONS> <ACTION NAME="some-action"> <CODE> // Action code </CODE> </ACTION> <ACTION NAME="some-toggle-action"> <CODE> // Action code </CODE> <IS_SELECTED> // Returns true or false </IS_SELECTED> </ACTION> </ACTIONS>The following elements are valid:
ACTIONS
is the top-level element and refers
to the set of actions used by the plugin.
ACTION
contains the data for a particular action.
It has three attributes: a required NAME
;
an optional NO_REPEAT
, which is a flag
indicating whether the action should not be repeated with the
C+ENTER command; and an optional
NO_RECORD
which is a a flag indicating whether the
action should be recorded if it is invoked while the user is recording a
macro. The two flag attributes
can have two possible values, "TRUE" or
"FALSE". In both cases, "FALSE" is the
default if the attribute is not specified.
ACTION
can have two child elements
within it: a required CODE
element which
specifies the
BeanShell code that will be executed when the action is invoked,
and an optional IS_SELECTED
element, used for
checkbox
menu items. The IS_SELECTED
element contains
BeanShell code that returns a boolean flag that will
determine the state of the checkbox.
name.label
containing
the action's menu item label. The action code may use any predefined
BeanShell variable; see BeanShell
.
jEdit.getActionSets()
,
jEdit.addActionSet(ActionSet)
Constructor Summary | |
ActionSet()
Creates a new action set. |
|
ActionSet(java.lang.String label)
Creates a new action set. |
Method Summary | |
void |
addAction(EditAction action)
Adds an action to the action set. |
boolean |
contains(EditAction action)
Returns if this action set contains the specified action. |
EditAction |
getAction(java.lang.String name)
Returns an action with the specified name. |
int |
getActionCount()
Returns the number of actions in the set. |
EditAction[] |
getActions()
Returns an array of all actions in this action set. |
java.lang.String |
getLabel()
Return the action source label. |
void |
removeAction(java.lang.String name)
Removes an action from the action set. |
void |
removeAllActions()
Removes all actions from the action set. |
void |
setLabel(java.lang.String label)
Sets the action source label. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public ActionSet()
public ActionSet(java.lang.String label)
label
- The label, shown in the shortcuts option paneMethod Detail |
public java.lang.String getLabel()
public void setLabel(java.lang.String label)
label
- The labelpublic void addAction(EditAction action)
action
- The actionpublic void removeAction(java.lang.String name)
name
- The action namepublic void removeAllActions()
public EditAction getAction(java.lang.String name)
name
- The action namepublic int getActionCount()
public EditAction[] getActions()
public boolean contains(EditAction action)
action
- The actionpublic java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |