Package de.tsl2.nano.action
Interface IAction<RETURNTYPE>
- All Superinterfaces:
Runnable
- All Known Implementing Classes:
CommonAction
provides all informations to start an action (through Runnable) and to handle a graphical user interface of type
button etc.
- Version:
- $Revision: 1.0 $
- Author:
- ts 13.11.2008
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final intdialog return value: dialog will be closed, and IDialogConstants.CANCEL_ID will be returnedstatic final intdialog return value: dialog will be closed, and IDialogConstants.OK_ID will be returnedstatic final intdialog return value - no dialog handling will be done -
Method Summary
Modifier and TypeMethodDescriptionaction()The action to be startedactivate()starts this action.static intdoFor(Collection<?> forCollection, IAction<?> doAction) starts the given action for all items of the given collection - as first action parameter.intaction mode. e.g. on dialogs it is usable to define the buttons result type. seeMODE_DLG_CANCEL,MODE_DLG_OK.Class[]getArgumentTypesgetId()Getter getIdGetter getKeyStrokeGetter getLongDescriptionObject[]getParameter(int i) the receivers will receive the result of the activation.Getter getShortDescriptionbooleanGetter isDefaultbooleanGetter isEnabledbooleanbooleanGetter isSynchronvoidsetDefault(boolean isDefault) setDefaultvoidsetEnabled(boolean isEnabled) Setter isEnabledsetParameter(Object... parameter)
-
Field Details
-
CANCELED
- See Also:
-
MODE_UNDEFINED
static final int MODE_UNDEFINEDdialog return value - no dialog handling will be done- See Also:
-
MODE_DLG_CANCEL
static final int MODE_DLG_CANCELdialog return value: dialog will be closed, and IDialogConstants.CANCEL_ID will be returned- See Also:
-
MODE_DLG_OK
static final int MODE_DLG_OKdialog return value: dialog will be closed, and IDialogConstants.OK_ID will be returned- See Also:
-
-
Method Details
-
isEnabled
boolean isEnabled()Getter isEnabled- Returns:
- Returns the isEnabled.
-
setEnabled
void setEnabled(boolean isEnabled) Setter isEnabled- Parameters:
isEnabled- The isEnabled to set.
-
getKeyStroke
Object getKeyStroke()Getter getKeyStroke- Returns:
- Returns the keyStroke.
-
getId
String getId()Getter getId- Returns:
- Returns the id.
-
getShortDescription
String getShortDescription()Getter getShortDescription- Returns:
- Returns the shortDescription.
-
getLongDescription
String getLongDescription()Getter getLongDescription- Returns:
- Returns the longDescription.
-
getImagePath
String getImagePath()- Returns:
- image
-
isDefault
boolean isDefault()Getter isDefault- Returns:
- Returns the isDefault.
-
setDefault
void setDefault(boolean isDefault) setDefault- Parameters:
isDefault- whether to set the action as default action
-
isSynchron
boolean isSynchron()Getter isSynchron- Returns:
- Returns the synchron.
-
action
The action to be started -
activate
RETURNTYPE activate()starts this action.- Returns:
- the result
-
getReceiverIDs
Collection<String> getReceiverIDs()the receivers will receive the result of the activation.- Returns:
- list of ids of receiver fields (IComponentDescriptor)
-
getArgumentTypes
Class[] getArgumentTypes()getArgumentTypes- Returns:
- optional definition of argument types to check
getParameter()andsetParameter(Object...). default is null
-
getParameter
Object[] getParameter()- Returns:
- optional call arguments for action.
-
getParameter
-
setParameter
- Parameters:
parameter- call arguments
-
getActionMode
int getActionMode()action mode. e.g. on dialogs it is usable to define the buttons result type. seeMODE_DLG_CANCEL,MODE_DLG_OK.- Returns:
- action mode
-
isRunning
boolean isRunning() -
doFor
starts the given action for all items of the given collection - as first action parameter.- Parameters:
forCollection- to iteratedoAction- to do- Returns:
- iteration size
-