|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.swing.AbstractAction org.yasl.arch.impl.action.YASLGUIAbstractAction
Base YASL action for GUI applications.
Implements the actionPerformed
method
from the Action interface as a Runnable wrapper that is started by
a call to SwingUtilities.invokeLater
.
Extending classes implement their code in the
performAction
method.
Runnable
,
Serialized FormField Summary | |
static String |
COMMAND_SYNCHRONOUS_CALL
A command string that signals the call to the action's method should be synchronous instead of the default asynchronous call. |
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 | |
YASLGUIAbstractAction(String name,
boolean initialState,
ImageIcon imageIcon,
YASLGUIApplication yaslApp)
Sets the NAME and SHORT_DESCRIPTION properties to the value of the name param. |
|
YASLGUIAbstractAction(String name,
boolean initialState,
YASLGUIApplication yaslApp)
Sets the NAME and SHORT_DESCRIPTION properties to the value of the name param. |
|
YASLGUIAbstractAction(String name,
String shortName,
boolean initialState,
ImageIcon imageIcon,
YASLGUIApplication yaslApp)
Sets the NAME, SHORT_DESCRIPTION, and SMALL_ICON properties. |
|
YASLGUIAbstractAction(String name,
String shortName,
boolean initialState,
YASLGUIApplication yaslApp)
Sets the NAME and SHORT_DESCRIPTION properties. |
Method Summary | |
void |
actionPerformed(ActionEvent e)
Creates a Runnable object that wraps a call to performAction . |
boolean |
getInitialState()
Returns the initial state. |
String |
getName()
Returns the NAME property. |
protected YASLApplication |
getYASLApplication()
Returns the application object as a YASLApplication instance. |
protected YASLGUIApplication |
getYASLGUIApplication()
Returns the application object as a YASLGUIApplication instance. |
protected abstract void |
performAction(ActionEvent e)
Abstract method that is called from the actionPerformed method. |
void |
setName(String name)
Sets the NAME and SHORT_DESCRIPTION properties to the param value. |
void |
setName(String name,
String shortName)
Sets the NAME and SHORT_DESCRIPTION properties to the respective param values. |
void |
setToInitialState()
Resets the action to its initial state. |
Methods inherited from class javax.swing.AbstractAction |
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final String COMMAND_SYNCHRONOUS_CALL
Constructor Detail |
public YASLGUIAbstractAction(String name, boolean initialState, YASLGUIApplication yaslApp)
name
- StringinitialState
- booleanyaslApp
- YASLGUIApplicationpublic YASLGUIAbstractAction(String name, boolean initialState, ImageIcon imageIcon, YASLGUIApplication yaslApp)
name
- StringinitialState
- booleanimageIcon
- ImageIconyaslApp
- YASLGUIApplicationpublic YASLGUIAbstractAction(String name, String shortName, boolean initialState, YASLGUIApplication yaslApp)
name
- StringshortName
- StringinitialState
- booleanyaslApp
- YASLGUIApplicationpublic YASLGUIAbstractAction(String name, String shortName, boolean initialState, ImageIcon imageIcon, YASLGUIApplication yaslApp)
name
- StringshortName
- StringinitialState
- booleanimageIcon
- ImageIconyaslApp
- YASLGUIApplicationMethod Detail |
public void setName(String name)
name
- Stringpublic void setName(String name, String shortName)
name
- StringshortName
- Stringpublic String getName()
public void setToInitialState()
public boolean getInitialState()
protected abstract void performAction(ActionEvent e) throws Exception
actionPerformed
method.
Extending classes must implement their action specific code
in this method.
e
- ActionEvent
Exception
protected YASLApplication getYASLApplication()
protected YASLGUIApplication getYASLGUIApplication()
public final void actionPerformed(ActionEvent e)
performAction
. The
runnable object is started with a call to
SwingUtilities.invokeLater
.
e
- ActionEventRunnable
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |