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

public abstract class Action<T> extends Object
  • Constructor Details

  • Method Details

    • getId

      public String getId()
      Returns a unique identifier for this action.
    • getLabel

      public String getLabel()
      Human-readable label for this action.
    • getSpec

      public Spec 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

      public Action.ActionStyle 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

      public void addChangeListener(ActionChangeListener listener)
      Add a listener that will get notified whenever one of the action properties has changed.
    • removeChangeListener

      public void removeChangeListener(ActionChangeListener listener)
      Remove a previously registered change listeners.
    • execute

      public abstract void execute(T target, com.google.gson.JsonObject request, ActionResult result)
      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 action
      request - Optional request options
      result - Object where to mark the successful end of an action.