org.gjt.sp.jedit
Class ActionSet

java.lang.Object
  |
  +--org.gjt.sp.jedit.ActionSet

public class ActionSet
extends java.lang.Object

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: Each action must have a property name.label containing the action's menu item label. The action code may use any predefined BeanShell variable; see BeanShell.

Since:
jEdit 4.0pre1
Version:
$Id: ActionSet.java,v 1.8 2003/02/11 02:31:05 spestov Exp $
Author:
Slava Pestov, John Gellene (API documentation)
See Also:
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

ActionSet

public ActionSet()
Creates a new action set.

Since:
jEdit 4.0pre1

ActionSet

public ActionSet(java.lang.String label)
Creates a new action set.

Parameters:
label - The label, shown in the shortcuts option pane
Since:
jEdit 4.0pre1
Method Detail

getLabel

public java.lang.String getLabel()
Return the action source label.

Since:
jEdit 4.0pre1

setLabel

public void setLabel(java.lang.String label)
Sets the action source label.

Parameters:
label - The label
Since:
jEdit 4.0pre1

addAction

public void addAction(EditAction action)
Adds an action to the action set.

Parameters:
action - The action
Since:
jEdit 4.0pre1

removeAction

public void removeAction(java.lang.String name)
Removes an action from the action set.

Parameters:
name - The action name
Since:
jEdit 4.0pre1

removeAllActions

public void removeAllActions()
Removes all actions from the action set.

Since:
jEdit 4.0pre1

getAction

public EditAction getAction(java.lang.String name)
Returns an action with the specified name.

Parameters:
name - The action name
Since:
jEdit 4.0pre1

getActionCount

public int getActionCount()
Returns the number of actions in the set.

Since:
jEdit 4.0pre1

getActions

public EditAction[] getActions()
Returns an array of all actions in this action set.

Since:
jEdit 4.0pre1

contains

public boolean contains(EditAction action)
Returns if this action set contains the specified action.

Parameters:
action - The action
Since:
jEdit 4.0pre1

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object