Package org.yamcs.actions
Class Action<T>
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
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addChangeListener
(ActionChangeListener listener) Add a listener that will get notified whenever one of the action properties has changed.abstract void
execute
(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.boolean
Returns the checked state of this action.boolean
Returns whether this action is enabled.void
removeChangeListener
(ActionChangeListener listener) Remove a previously registered change listeners.void
setChecked
(boolean checked) Sets the checked state of this action.void
setEnabled
(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
result
parameter to provide the action result (which may be null).When an error occurs, use the
result
parameter to provide the exception.- Parameters:
target
- The target of this actionrequest
- Optional request optionsresult
- Object where to mark the successful end of an action.
-