Class AbstractScreenAction<A extends AbstractScreenAction<A,S>,S extends Screen>

Type Parameters:
A - type of action
S - type of screen
All Implemented Interfaces:
Action, Action.ExecutableAction, Action.HasPrimaryState, Action.ScreenAction<S>, Action.SecuredAction
Direct Known Subclasses:
OperationResultScreenAction

public abstract class AbstractScreenAction<A extends AbstractScreenAction<A,S>,S extends Screen> extends BaseAction implements Action.ScreenAction<S>, Action.ExecutableAction
Base class for screen actions.
  • Field Details

    • target

      protected S extends Screen target
  • Constructor Details

    • AbstractScreenAction

      public AbstractScreenAction(String id)
  • Method Details

    • initAction

      protected void initAction()
    • getTarget

      @Nullable public S getTarget()
      Specified by:
      getTarget in interface Action.ScreenAction<A extends AbstractScreenAction<A,S>>
    • setTarget

      public void setTarget(@Nullable S target)
      Specified by:
      setTarget in interface Action.ScreenAction<A extends AbstractScreenAction<A,S>>
    • withTarget

      public A withTarget(@Nullable S target)
    • withCaption

      public A withCaption(@Nullable String caption)
      Set caption using fluent API method.
      Overrides:
      withCaption in class BaseAction
      Parameters:
      caption - caption
      Returns:
      current instance of action
    • withDescription

      public A withDescription(@Nullable String description)
      Set description using fluent API method.
      Overrides:
      withDescription in class BaseAction
      Parameters:
      description - description
      Returns:
      current instance of action
    • withEnabled

      public A withEnabled(boolean enabled)
    • withVisible

      public A withVisible(boolean visible)
    • withIcon

      public A withIcon(@Nullable String icon)
      Set icon using fluent API method.
      Overrides:
      withIcon in class BaseAction
      Parameters:
      icon - icon
      Returns:
      current instance of action
    • withShortcut

      public A withShortcut(@Nullable String shortcut)
      Set shortcut using fluent API method.
      Overrides:
      withShortcut in class BaseAction
      Parameters:
      shortcut - shortcut
      Returns:
      current instance of action
    • withHandler

      public A withHandler(Consumer<Action.ActionPerformedEvent> handler)
      Set action performed event handler using fluent API method. Can be used instead of subclassing BaseAction class.
      Overrides:
      withHandler in class BaseAction
      Parameters:
      handler - action performed handler
      Returns:
      current instance of action
    • withPrimary

      public A withPrimary(boolean primary)
      Set whether this action is primary using fluent API method. Can be used instead of subclassing BaseAction class.
      Overrides:
      withPrimary in class BaseAction
      Parameters:
      primary - primary
      Returns:
      current instance of action
    • withEnabledByUiPermissions

      public A withEnabledByUiPermissions(boolean enabledByUiPermissions)
    • withVisibleByUiPermissions

      public A withVisibleByUiPermissions(boolean visibleByUiPermissions)
    • actionPerform

      public void actionPerform(Component component)
      Description copied from interface: Action
      Invoked by owning component to execute the action.
      Specified by:
      actionPerform in interface Action
      Overrides:
      actionPerform in class BaseAction
      Parameters:
      component - invoking component
    • isApplicable

      protected boolean isApplicable()
      Description copied from class: BaseAction
      Callback method which is invoked by the action to determine its enabled state.
      Overrides:
      isApplicable in class BaseAction
      Returns:
      true if the action is enabled for the current context, e.g. there is a selected row in a table
    • checkTarget

      protected void checkTarget()