Class ExcludeAction<E>

All Implemented Interfaces:
Action, Action.AdjustWhenScreenReadOnly, Action.ExecutableAction, Action.HasPrimaryState, Action.HasSecurityConstraint, Action.HasTarget, Action.SecuredAction

@StudioAction(target="io.jmix.ui.component.ListComponent", description="Excludes entities from the list. The excluded entities are not deleted.", availableInScreenWizard=true) @ActionType("exclude") public class ExcludeAction<E> extends SecuredListAction implements Action.AdjustWhenScreenReadOnly, Action.ExecutableAction
Standard action for excluding entity instances from the list. The excluded entities are not deleted.

Should be defined for a list component (Table, DataGrid, etc.) connected to a nested data container.

The action instance can be parameterized using the nested properties XML element or programmatically in the screen controller.

  • Field Details

  • Constructor Details

    • ExcludeAction

      public ExcludeAction()
    • ExcludeAction

      public ExcludeAction(String id)
  • Method Details

    • getConfirmation

      @Nullable public Boolean getConfirmation()
      Returns true/false if the confirmation flag was set by setConfirmation(Boolean) or in the screen XML. Otherwise returns null.
    • setConfirmation

      @StudioPropertiesItem(defaultValue="true") public void setConfirmation(Boolean confirmation)
      Sets whether to ask confirmation from the user.
    • getConfirmationMessage

      @Nullable public String getConfirmationMessage()
      Returns confirmation dialog message if it was set by setConfirmationMessage(String) or in the screen XML. Otherwise returns null.
    • setConfirmationMessage

      @StudioPropertiesItem public void setConfirmationMessage(String confirmationMessage)
      Sets confirmation dialog message.
    • getConfirmationTitle

      @Nullable public String getConfirmationTitle()
      Returns confirmation dialog title if it was set by setConfirmationTitle(String) or in the screen XML. Otherwise returns null.
    • setConfirmationTitle

      @StudioPropertiesItem public void setConfirmationTitle(String confirmationTitle)
      Sets confirmation dialog title.
    • setAfterActionPerformedHandler

      public void setAfterActionPerformedHandler(Consumer<RemoveOperation.AfterActionPerformedEvent<E>> afterActionPerformedHandler)
      Sets the handler to be invoked after excluding entities.

      The preferred way to set the handler is using a controller method annotated with Install, e.g.:

       @Install(to = "petsTable.exclude", subject = "afterActionPerformedHandler")
       protected void petsTableExcludeAfterActionPerformedHandler(RemoveOperation.AfterActionPerformedEvent event) {
           System.out.println("Removed " + event.getItems());
       }
       
    • setActionCancelledHandler

      public void setActionCancelledHandler(Consumer<RemoveOperation.ActionCancelledEvent<E>> actionCancelledHandler)
      Sets the handler to be invoked if the action was cancelled by the user.

      The preferred way to set the handler is using a controller method annotated with Install, e.g.:

       @Install(to = "petsTable.exclude", subject = "actionCancelledHandler")
       protected void petsTableExcludeActionCancelledHandler(RemoveOperation.ActionCancelledEvent event) {
           System.out.println("Cancelled");
       }
       
    • setIcons

      @Autowired protected void setIcons(Icons icons)
    • setMessages

      @Autowired protected void setMessages(Messages messages)
    • setUiComponentProperties

      @Autowired protected void setUiComponentProperties(UiComponentProperties componentProperties)
    • setRemoveOperation

      @Autowired public void setRemoveOperation(RemoveOperation removeOperation)
    • isPermitted

      protected boolean isPermitted()
      Description copied from class: BaseAction
      Callback method which is invoked by the action to determine its enabled state.
      Overrides:
      isPermitted in class SecuredListAction
      Returns:
      true if the action is enabled for the current user
    • 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
    • execute

      public void execute()
      Executes the action.
      Specified by:
      execute in interface Action.ExecutableAction