Class BasicAction
java.lang.Object
com.levigo.jadice.web.client.util.action.BasicAction
- All Implemented Interfaces:
Action
A simple
Action which is not registered in an action registry. This action can be used
for dynamic content without keystrokes like AnnotationPropertyEditors, buttons in widgets or
sub-menu buttons.-
Constructor Summary
ConstructorsConstructorDescriptionBasicAction(String label, StateIcon stateIcon, Command command) Create a newBasicActionwith the given parameterBasicAction(String label, StateIcon icon, Command command, boolean closeOnExecution) Create a newBasicActionwith the given parameterBasicAction(String label, String description, StateIcon icon, Command command) Create a newBasicActionwith the given parameterBasicAction(String label, String description, StateIcon icon, Command command, boolean closeOnExecution) Create a newBasicActionwith the given parameter -
Method Summary
Modifier and TypeMethodDescriptionReturns the accelerator key stroke (e.g.Returns a second, alternative accelerator key stroke for this action.booleanIf this action is contained in anContextMenu, this value indicates whether the context menu should be closed after executing the command contained in this action.Returns theCommandfor this action.The context this action is bound to.Returns the description of the action which should be displayed when hovering over the GUI component containing this action.getIcon()Returns theStateIconfor this action.getLabel()Returns the label of the action which should be displayed in the toolbar or context menu.voidsetAlternativeAcceleratorKey(KeyStroke alternativeKeyStroke) Sets the givenKeyStroketo this action as an alternative KeyStroke.voidsetCommand(Command command) Should be only used for sub-menu actions.
-
Constructor Details
-
BasicAction
Create a newBasicActionwith the given parameter- Parameters:
label- the displayed name; it is also used as hover descriptionstateIcon- the icon which should be displayedcommand- the command which should be executed
-
BasicAction
Create a newBasicActionwith the given parameter- Parameters:
label- the displayed namedescription- the hover descriptionicon- the icon which should be displayedcommand- the command which should be executed
-
BasicAction
Create a newBasicActionwith the given parameter- Parameters:
label- the displayed name; it is also used as hover descriptionicon- the icon which should be displayedcommand- the command which should be executedcloseOnExecution- whether the containing menu should be closed after executing the command
-
BasicAction
public BasicAction(String label, String description, StateIcon icon, Command command, boolean closeOnExecution) Create a newBasicActionwith the given parameter- Parameters:
label- the displayed namedescription- the hover descriptionicon- the icon which should be displayedcommand- the command which should be executedcloseOnExecution- whether the containing menu should be closed after executing the command
-
-
Method Details
-
getLabel
Description copied from interface:ActionReturns the label of the action which should be displayed in the toolbar or context menu. -
getDescription
Description copied from interface:ActionReturns the description of the action which should be displayed when hovering over the GUI component containing this action.- Specified by:
getDescriptionin interfaceAction- Returns:
- the description
-
getIcon
Description copied from interface:ActionReturns theStateIconfor this action. -
getCommand
Description copied from interface:ActionReturns theCommandfor this action.- Specified by:
getCommandin interfaceAction- Returns:
- the command
-
getAcceleratorKey
Description copied from interface:ActionReturns the accelerator key stroke (e.g. CTRL + S) for this action.- Specified by:
getAcceleratorKeyin interfaceAction- Returns:
- the accelerator key; null if undefined
-
getAlternativeAcceleratorKey
Description copied from interface:ActionReturns a second, alternative accelerator key stroke for this action.- Specified by:
getAlternativeAcceleratorKeyin interfaceAction- Returns:
- the accelerator key; null if undefined
-
setAlternativeAcceleratorKey
Description copied from interface:ActionSets the givenKeyStroketo this action as an alternative KeyStroke. Resetting the KeyStroke is not supported.- Specified by:
setAlternativeAcceleratorKeyin interfaceAction- Parameters:
alternativeKeyStroke- the alternative KeyStroke
-
getCloseOnExecution
public boolean getCloseOnExecution()Description copied from interface:ActionIf this action is contained in anContextMenu, this value indicates whether the context menu should be closed after executing the command contained in this action.- Specified by:
getCloseOnExecutionin interfaceAction- Returns:
- whether the context menu should be closed or not
-
getContext
Description copied from interface:ActionThe context this action is bound to.- Specified by:
getContextin interfaceAction- Returns:
- the context objects used to execute the command
-
setCommand
Description copied from interface:ActionShould be only used for sub-menu actions. TheCommandis set by the button.- Specified by:
setCommandin interfaceAction- Parameters:
command- the open sub-menu command
-