|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.swing.AbstractAction
org.argouml.uml.ui.UMLAction
The prototype of all actions within ArgoUML.
Nested Class Summary |
Nested classes inherited from class javax.swing.AbstractAction |
|
Field Summary | |
static boolean |
HAS_ICON
Constant for determining the icon. |
private String |
iconName
|
private static Logger |
LOG
|
static boolean |
NO_ICON
Constant for determining the 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 | |
UMLAction(String name)
The constructor for a non-global action with icon. |
|
UMLAction(String name,
boolean hasIcon)
The constructor for a non-global action. |
|
UMLAction(String name,
boolean global,
boolean hasIcon)
The constructor. |
Method Summary | |
void |
actionPerformed(ActionEvent e)
Perform the work the action is supposed to do. |
static String |
getMnemonic(String key)
This function returns a localized string corresponding to the specified key. |
Object |
getValue(String key)
Gets one of this object's properties using the associated key. |
boolean |
isEnabled()
|
void |
putValue(String key,
Object value)
Sets one of this object's properties using the associated key. |
boolean |
shouldBeEnabled()
Return true if this action should be available to the user. |
private static String |
stripJunk(String s)
|
void |
updateEnabled()
Enable the action if it should be enabled. |
void |
updateEnabled(Object target)
|
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 |
private static final Logger LOG
public static final boolean HAS_ICON
public static final boolean NO_ICON
private String iconName
Constructor Detail |
public UMLAction(String name)
name
- the (to be localized) description of the actionpublic UMLAction(String name, boolean hasIcon)
name
- the (to be localized) description of the actionhasIcon
- true if an icon is to be shownpublic UMLAction(String name, boolean global, boolean hasIcon)
hasIcon
- true if an icon has to be shownname
- the (to be localized) description of the actionglobal
- the action is global, i.e. implements shouldBeEnabled(),
and listens to Target changesMethod Detail |
public void putValue(String key, Object value)
PropertyChangeEvent
is sent to
listeners.
key
- a String
containing the key.value
- an Object
value.public Object getValue(String key)
key
- the name of the property.
putValue(String, Object)
public void actionPerformed(ActionEvent e)
ActionListener.actionPerformed(java.awt.event.ActionEvent)
public void updateEnabled(Object target)
target
- the action to be enabledpublic void updateEnabled()
public boolean shouldBeEnabled()
"Global" actions shall implement this function! - Otherwise it is not usefull to make them global...
private static String stripJunk(String s)
s
- the string to be stripped from junk
public static final String getMnemonic(String key)
key
- the given key
public boolean isEnabled()
Action.isEnabled()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ArgoUML © 1996-2004 (20050222) | ArgoUML Homepage | ArgoUML Developers' page | ArgoUML Cookbook |