org.argouml.ui
Class Actions

java.lang.Object
  extended byorg.argouml.ui.Actions
All Implemented Interfaces:
EventListener, TargetListener

public class Actions
extends Object
implements TargetListener

Collects ArgoUML's global actions, and takes care of the "enabled" status of all these actions.

Which means:
Any instance of UMLAction may (at construction time) tell Actions by calling addAction() about UMLActions of which the availability depends on the currently selected Target or the state of ArgoUML.

From here on, Actions will check the availability of all enlisted UMLActions after every Target change and after every ArgoUML state change (i.e. every user action), and downlight or enable the corresponding UI element, e.g. menu item or toolbar item.

Once UMLActions are enlisted, they can never be removed!

This class is a Singleton.


Field Summary
private static Vector allActions
          allActions is the list of global UMLActions in ArgoUML.
private static Actions INSTANCE
           
private static Logger LOG
           
 
Constructor Summary
private Actions()
           
 
Method Summary
static void addAction(UMLAction newAction)
          Add actions to the global actions list.
static Actions getInstance()
           
static boolean isGlobalAction(UMLAction action)
           
 void targetAdded(TargetEvent e)
          Fired when a target is added to the list of targets.
 void targetRemoved(TargetEvent e)
          Fired when a target is removed from the list of targets
 void targetSet(TargetEvent e)
          Fired when a total new set of targets is set
static void updateAllEnabled()
          Updates all global actions: check if enabled or not.
private static void updateAllEnabled(TargetEvent e)
          Updates all global actions as a consequence of the send TargetEvent.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOG

private static final Logger LOG

INSTANCE

private static final Actions INSTANCE

allActions

private static Vector allActions
allActions is the list of global UMLActions in ArgoUML. All these are UMLActions!

Constructor Detail

Actions

private Actions()
Method Detail

getInstance

public static Actions getInstance()
Returns:
the singleton

updateAllEnabled

public static void updateAllEnabled()
Updates all global actions: check if enabled or not. This function used to be deprecated for unclear reasons - see issue 2735.


updateAllEnabled

private static void updateAllEnabled(TargetEvent e)
Updates all global actions as a consequence of the send TargetEvent.

Parameters:
e - the target event, which is used to determine the new target

addAction

public static void addAction(UMLAction newAction)
Add actions to the global actions list. Only done at construction time for UMLActions.

Parameters:
newAction - the new action to be added

isGlobalAction

public static boolean isGlobalAction(UMLAction action)
Parameters:
action - the given action
Returns:
true if this is a global action

targetAdded

public void targetAdded(TargetEvent e)
Description copied from interface: TargetListener
Fired when a target is added to the list of targets.

Specified by:
targetAdded in interface TargetListener
Parameters:
e - The targetevent, name will be TARGET_ADDED
See Also:
TargetListener.targetAdded( org.argouml.ui.targetmanager.TargetEvent)

targetRemoved

public void targetRemoved(TargetEvent e)
Description copied from interface: TargetListener
Fired when a target is removed from the list of targets

Specified by:
targetRemoved in interface TargetListener
Parameters:
e - The targetevent, name will be TARGET_REMOVED
See Also:
TargetListener.targetRemoved( org.argouml.ui.targetmanager.TargetEvent)

targetSet

public void targetSet(TargetEvent e)
Description copied from interface: TargetListener
Fired when a total new set of targets is set

Specified by:
targetSet in interface TargetListener
Parameters:
e - The targetevent, name will be TARGET_SET
See Also:
TargetListener.targetSet( org.argouml.ui.targetmanager.TargetEvent)


ArgoUML © 1996-2004 (20050222)ArgoUML HomepageArgoUML Developers' pageArgoUML Cookbook