public class CommandAction extends java.lang.Object implements ICommandAction
Constructor and Description |
---|
CommandAction() |
CommandAction(IActionBuilder builder) |
CommandAction(java.lang.String text) |
CommandAction(java.lang.String text,
IImageConstant icon) |
CommandAction(java.lang.String text,
java.lang.String toolTipText) |
CommandAction(java.lang.String text,
java.lang.String toolTipText,
IImageConstant icon) |
Modifier and Type | Method and Description |
---|---|
static IActionBuilder |
builder() |
static IActionBuilder |
builder(java.lang.String text) |
static IActionBuilder |
builder(java.lang.String text,
IImageConstant icon) |
static IActionBuilder |
builder(java.lang.String text,
java.lang.String toolTipText) |
static IActionBuilder |
builder(java.lang.String text,
java.lang.String toolTipText,
IImageConstant icon) |
void |
execute(IExecutionContext actionEvent)
Executes the action
|
Accelerator |
getAccelerator()
Gets the actions accelerator
|
IActionChangeObservable |
getActionChangeObservable()
For mutable actions, an observable can be implemented to recognize changes
on this action.
|
ICommand |
getCommand()
Gets the command
|
IExceptionHandler |
getExceptionHandler()
Gets the ExceptionHandler of this action.
|
IImageConstant |
getIcon()
Gets the action icon
|
java.lang.Character |
getMnemonic()
Gets the action mnemonic
|
java.lang.String |
getText()
Gets the action label text
|
java.lang.String |
getToolTipText()
Gets the actions tooltip text
|
boolean |
isEnabled()
Gets the enabled state of the action.
|
void |
setActionExceptionHandler(IExceptionHandler exceptionHandler)
Set's the ExceptionHandler of the action.
|
void |
setCommand(ICommand command)
Sets the actions command
|
void |
setCommand(ICommandExecutor command)
Sets the actions command defined by a command executor
The command that will be set has no enabled checker and no exception handler
|
void |
setCommand(ICommandExecutor command,
IEnabledChecker enabledChecker)
Sets the actions command defined by a command executor and enabled checker
The command that will be set has no exception handler
|
void |
setCommand(ICommandExecutor command,
IEnabledChecker enabledChecker,
IExceptionHandler exceptionHandler)
Sets the actions command defined by a command executor, enabled checker and exception handler
|
void |
setCommand(ICommandExecutor command,
IExceptionHandler exceptionHandler)
Sets the actions command defined by a command executor and exception handler
The command that will be set has no enabled checker
|
void |
setEnabled(boolean enabled)
Sets the enabled state of the action
|
void |
setIcon(IImageConstant icon)
Sets the actions icon
|
void |
setText(java.lang.String text)
Sets the actions label text
|
void |
setToolTipText(java.lang.String toolTipText)
Sets the actions tooltip text
|
public CommandAction()
public CommandAction(java.lang.String text)
public CommandAction(java.lang.String text, IImageConstant icon)
public CommandAction(java.lang.String text, java.lang.String toolTipText)
public CommandAction(java.lang.String text, java.lang.String toolTipText, IImageConstant icon)
public CommandAction(IActionBuilder builder)
public final void setText(java.lang.String text)
ICommandAction
setText
in interface ICommandAction
text
- The text to setpublic final java.lang.String getText()
IAction
public final void setToolTipText(java.lang.String toolTipText)
ICommandAction
setToolTipText
in interface ICommandAction
toolTipText
- The text to setpublic final java.lang.String getToolTipText()
IAction
getToolTipText
in interface IAction
public final IImageConstant getIcon()
IAction
public final void setIcon(IImageConstant icon)
ICommandAction
setIcon
in interface ICommandAction
icon
- The icon to setpublic final java.lang.Character getMnemonic()
IAction
getMnemonic
in interface IAction
public final void setEnabled(boolean enabled)
ICommandAction
setEnabled
in interface ICommandAction
enabled
- The enabled state to setpublic final Accelerator getAccelerator()
IAction
getAccelerator
in interface IAction
public final void setCommand(ICommand command)
ICommandAction
setCommand
in interface ICommandAction
command
- The command to set, may be null if the action should not have a commandpublic ICommand getCommand()
ICommandAction
getCommand
in interface ICommandAction
public final boolean isEnabled()
IAction
public final void execute(IExecutionContext actionEvent) throws java.lang.Exception
IAction
public final void setCommand(ICommandExecutor command)
ICommandAction
setCommand
in interface ICommandAction
public final void setCommand(ICommandExecutor command, IEnabledChecker enabledChecker)
ICommandAction
setCommand
in interface ICommandAction
enabledChecker
- The enabled checker of the command to setpublic final IExceptionHandler getExceptionHandler()
IAction
getExceptionHandler
in interface IAction
public final void setCommand(ICommandExecutor command, IExceptionHandler exceptionHandler)
ICommandAction
setCommand
in interface ICommandAction
exceptionHandler
- The exception handler of the command to setpublic final void setCommand(ICommandExecutor command, IEnabledChecker enabledChecker, IExceptionHandler exceptionHandler)
ICommandAction
setCommand
in interface ICommandAction
enabledChecker
- The enabled checker of the command to setexceptionHandler
- The exception handler of the command to setpublic final void setActionExceptionHandler(IExceptionHandler exceptionHandler)
ICommandAction
setActionExceptionHandler
in interface ICommandAction
exceptionHandler
- The ExceptionHandler to setpublic final IActionChangeObservable getActionChangeObservable()
IAction
getActionChangeObservable
in interface IAction
public static IActionBuilder builder()
public static IActionBuilder builder(java.lang.String text)
public static IActionBuilder builder(java.lang.String text, IImageConstant icon)
public static IActionBuilder builder(java.lang.String text, java.lang.String toolTipText)
public static IActionBuilder builder(java.lang.String text, java.lang.String toolTipText, IImageConstant icon)
Siehe auch Jowidgets Nutzerhandbuch