com.jgoodies.uif.action
Class ActionSet

java.lang.Object
  extended by com.jgoodies.uif.action.ActionSet

public final class ActionSet
extends Object

Describes, holds and manages a set of Actions. Useful to group related Actions, for example to enable and disable them all at the same time.

Version:
$Revision: 1.6 $
Author:
Karsten Lentzsch
See Also:
Action, AbstractAction

Constructor Summary
ActionSet(String name, Action... actions)
          Constructs an ActionSet with the given name and array of Actions.
ActionSet(String name, List<Action> actions)
          Constructs an ActionSet with the given name and list of Actions.
 
Method Summary
 void add(Action action)
          Adds an Action to this set of Actions.
 List<Action> getActions()
          Returns an unmodifiable list of this ActionSet's actions.
 String getName()
          Returns this set's name.
 void remove(Action action)
          Removes an Action from this set of Actions.
 void setEnabled(boolean enabled)
          Enables or disables all actions in this set of actions.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ActionSet

public ActionSet(String name,
                 List<Action> actions)
Constructs an ActionSet with the given name and list of Actions.

Parameters:
name - describes this ActionSet
actions - The Actions that make this set
Throws:
NullPointerException - if the list of actions is null.

ActionSet

public ActionSet(String name,
                 Action... actions)
Constructs an ActionSet with the given name and array of Actions.

Parameters:
name - describes this ActionSet
actions - The Actions that make this set
Throws:
NullPointerException - if the list of actions is null.
Method Detail

getName

public String getName()
Returns this set's name.

Returns:
this ActionSet's name

getActions

public List<Action> getActions()
Returns an unmodifiable list of this ActionSet's actions.

Returns:
an unmodifiable list of this ActionSet's actions

add

public void add(Action action)
Adds an Action to this set of Actions.

Parameters:
action - the Action to add
Throws:
NullPointerException - if the action is null

remove

public void remove(Action action)
Removes an Action from this set of Actions.

Parameters:
action - the Action to remove
Throws:
NullPointerException - if the action is null

setEnabled

public void setEnabled(boolean enabled)
Enables or disables all actions in this set of actions.

Parameters:
enabled - true to enable all actions, false to disable.


Copyright © 2000-2008 JGoodies Karsten Lentzsch. All Rights Reserved.