public class SwingFormAction extends AbstractAction implements FormAction
A Swing specific implementation of the FormAction interface.
This class serves as an adapter between the generic FormAction
interface and Swing specific actions.
| Modifier and Type | Field and Description |
|---|---|
static String |
CHECKED
Constant for the CHECKED property.
|
changeSupport, enabledACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, DISPLAYED_MNEMONIC_INDEX_KEY, LARGE_ICON_KEY, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SELECTED_KEY, SHORT_DESCRIPTION, SMALL_ICON| Constructor and Description |
|---|
SwingFormAction(String aName,
Object aTask)
Creates a new instance of
SwingFormAction and initializes
it. |
| Modifier and Type | Method and Description |
|---|---|
void |
actionPerformed(ActionEvent event)
Callback method for action events.
|
void |
execute(BuilderEvent event)
Executes this action.
|
String |
getName()
Returns the name of this action.
|
Object |
getTask()
Returns the task of this action.
|
boolean |
isChecked()
Returns the value of the
checked property. |
void |
setChecked(boolean f)
Sets the value of the
checked property. |
void |
setTask(Object task)
Sets the task of this action.
|
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabledequals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitisEnabled, setEnabledpublic static final String CHECKED
public SwingFormAction(String aName, Object aTask)
SwingFormAction and initializes
it. The task is checked (using ActionHelper)
whether it is of an allowed type.aName - the name of the actionaTask - the task with the executable codeIllegalArgumentException - if the name is null or the task
is invalidpublic String getName()
getName in interface FormActionpublic boolean isChecked()
checked property.isChecked in interface FormActionchecked property.public void setChecked(boolean f)
checked property. This property is
used for checked menu items or toggle buttons in toolbars.setChecked in interface FormActionf - the value of the propertypublic Object getTask()
getTask in interface FormActionpublic void setTask(Object task)
ActionHelper is used.setTask in interface FormActiontask - the new taskIllegalArgumentException - if the task object is not allowedpublic void execute(BuilderEvent event)
ActionHelper class.execute in interface FormActionevent - the causing eventpublic void actionPerformed(ActionEvent event)
actionPerformed in interface ActionListenerevent - the action eventCopyright © 2016 The JGUIraffe Team. All rights reserved.