Class CompositeAction

All Implemented Interfaces:
ActionListener, ItemListener, Serializable, Cloneable, EventListener, Action

public class CompositeAction extends AbstractActionExt
A class that represents an action which will fire a sequence of actions. The action ids are added to the internal list. When this action is invoked, the event will be dispatched to the actions in the internal list.

The action ids are represented by the value of the Action.ACTION_COMMAND_KEY and must be managed by the ActionManager. When this action is invoked, then the actions are retrieved from the ActionManager in list order and invoked.

See Also:
  • Field Details

    • LIST_IDS

      private static final String LIST_IDS
      Keys for storing extended action attributes. May make public.
      See Also:
  • Constructor Details

    • CompositeAction

      public CompositeAction()
    • CompositeAction

      public CompositeAction(String name)
    • CompositeAction

      public CompositeAction(String name, String command)
      Parameters:
      name - display name of the action
      command - the value of the action command key
    • CompositeAction

      public CompositeAction(String name, Icon icon)
    • CompositeAction

      public CompositeAction(String name, String command, Icon icon)
      Parameters:
      name - display name of the action
      command - the value of the action command key
      icon - icon to display
  • Method Details

    • addAction

      public void addAction(String id)
      Add an action id to the action list. This action will be invoked when this composite action is invoked.
    • getActionIDs

      public List<String> getActionIDs()
      Returns a list of action ids which indicates that this is a composite action.
      Returns:
      a valid list of action ids or null
    • actionPerformed

      public void actionPerformed(ActionEvent evt)
      Callback for composite actions. This method will redispatch the ActionEvent to all the actions held in the list.
    • itemStateChanged

      public void itemStateChanged(ItemEvent evt)
      Callback for toggle actions.
      Specified by:
      itemStateChanged in interface ItemListener
      Overrides:
      itemStateChanged in class AbstractActionExt
      Parameters:
      evt - the ItemEvent fired by a ItemSelectable on changing the selected state.