java.lang.Object
org.yamcs.actions.Action<T>
- Type Parameters:
T- the type of the action target
- Direct Known Subclasses:
FileAction,LinkAction
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddChangeListener(ActionChangeListener listener) Add a listener that will get notified whenever one of the action properties has changed.abstract voidexecute(T target, com.google.gson.JsonObject request, ActionResult result) Execute an action.getId()Returns a unique identifier for this action.getLabel()Human-readable label for this action.getSpec()Specification of action arguments (if the actions supports or requires this)getStyle()Return the style of this action.booleanReturns the checked state of this action.booleanReturns whether this action is enabled.voidremoveChangeListener(ActionChangeListener listener) Remove a previously registered change listeners.voidsetChecked(boolean checked) Sets the checked state of this action.voidsetEnabled(boolean enabled) Set the enabled state of this action.
-
Constructor Details
-
Action
-
Action
-
-
Method Details
-
getId
Returns a unique identifier for this action. -
getLabel
Human-readable label for this action. -
getSpec
Specification of action arguments (if the actions supports or requires this) -
isEnabled
public boolean isEnabled()Returns whether this action is enabled. -
setEnabled
public void setEnabled(boolean enabled) Set the enabled state of this action.An action that is not enabled, is visible, but can't be executed.
-
getStyle
Return the style of this action. -
isChecked
public boolean isChecked()Returns the checked state of this action.Only relevant if the style of this action is set to
Action.ActionStyle.CHECK_BOX. -
setChecked
public void setChecked(boolean checked) Sets the checked state of this action.Only relevant if the style of this action is set to
Action.ActionStyle.CHECK_BOX. -
addChangeListener
Add a listener that will get notified whenever one of the action properties has changed. -
removeChangeListener
Remove a previously registered change listeners. -
execute
Execute an action.When successful, use the
resultparameter to provide the action result (which may be null).When an error occurs, use the
resultparameter to provide the exception.- Parameters:
target- The target of this actionrequest- Optional request optionsresult- Object where to mark the successful end of an action.
-