org.argouml.uml.diagram.ui
Class ActionAddExtensionPoint

java.lang.Object
  extended byjavax.swing.AbstractAction
      extended byorg.argouml.uml.ui.UMLAction
          extended byorg.argouml.uml.diagram.ui.ActionAddExtensionPoint
All Implemented Interfaces:
Action, ActionListener, Cloneable, EventListener, Serializable

public final class ActionAddExtensionPoint
extends UMLAction

A class to implement the addition of extension points to use cases.

This is a singleton. Implemented with a private constructor and a static access method. Marked as final, since it can't sensibly be subclassed (the access method wouldn't work properly).

See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class javax.swing.AbstractAction
 
Field Summary
private static ActionAddExtensionPoint singleton
          Our private copy of the instance.
 
Fields inherited from class org.argouml.uml.ui.UMLAction
HAS_ICON, NO_ICON
 
Fields inherited from class javax.swing.AbstractAction
changeSupport, enabled
 
Fields inherited from interface javax.swing.Action
ACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SHORT_DESCRIPTION, SMALL_ICON
 
Constructor Summary
ActionAddExtensionPoint()
          Constructor is private, since it cannot be called directly for a singleton.
 
Method Summary
 void actionPerformed(ActionEvent ae)
          Called if this action is invoked.
 boolean shouldBeEnabled()
          A predicate to determine if this action should be enabled.
static ActionAddExtensionPoint singleton()
          Get the single instance of the action.
 
Methods inherited from class org.argouml.uml.ui.UMLAction
getMnemonic, getValue, isEnabled, putValue, updateEnabled, updateEnabled
 
Methods inherited from class javax.swing.AbstractAction
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, removePropertyChangeListener, setEnabled
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

singleton

private static ActionAddExtensionPoint singleton
Our private copy of the instance. Only accessible through the proper access method.

Constructor Detail

ActionAddExtensionPoint

public ActionAddExtensionPoint()
Constructor is private, since it cannot be called directly for a singleton. Make use of the access funtion.

Method Detail

singleton

public static ActionAddExtensionPoint singleton()
Get the single instance of the action.

Since we are a singleton, this is the only way of accessing the instance, which is created if it does not exist.

Returns:
The singleton instance.

actionPerformed

public void actionPerformed(ActionEvent ae)
Called if this action is invoked.

Specified by:
actionPerformed in interface ActionListener
Overrides:
actionPerformed in class UMLAction
Parameters:
ae - The action that caused us to be invoked.
See Also:
ActionListener.actionPerformed(java.awt.event.ActionEvent)

shouldBeEnabled

public boolean shouldBeEnabled()
A predicate to determine if this action should be enabled.

Overrides:
shouldBeEnabled in class UMLAction
Returns:
true if the superclass believes we should be enabled and the target is a use case. false otherwise.
See Also:
UMLAction.shouldBeEnabled()


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