public interface FormAction
An interface describing an action.
An action in terms of this framework is a piece of code that must be executed in reaction of a user action. Actions are associated with GUI controls like menu items or toolbar buttons.
This definition of an action is compatible with similar concepts in typical GUI libraries like Swing or SWT (jface). The purpose of this interface is to provide an abstraction for specific action classes and/or interfaces used in different GUI libraries. There will be adapter implementations for the supported libraries.
From this framework's point of view an action has the following characteristics:
execute()
method for invoking the action.Note: Concrete implementations cannot be expected to be thread-safe; the manipulation of an action's properties is only safe in the UI thread of the platform in use.
Modifier and Type | Method and Description |
---|---|
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 a flag whether this action is checked at the moment.
|
boolean |
isEnabled()
Returns a flag whether this action is enabled at the moment.
|
void |
setChecked(boolean f)
Allows to set this action's checked flag.
|
void |
setEnabled(boolean f)
Allows to set this action's enabled flag.
|
void |
setTask(Object task)
Sets the task of this action.
|
String getName()
boolean isEnabled()
void setEnabled(boolean f)
f
- the value of the enabled flagboolean isChecked()
void setChecked(boolean f)
f
- the value of the checked flagvoid execute(BuilderEvent event)
event
- the event that caused the execution of this actionObject getTask()
void setTask(Object task)
FormAction
implementation should support objects
implementing one of these interfaces: Runnable
,
ActionTask
.task
- the task for this actionIllegalArgumentException
- if the task is not supported by this
actionCopyright © 2016 The JGUIraffe Team. All rights reserved.