Package io.jmix.ui.action.list
Class ExcludeAction<E>
java.lang.Object
io.jmix.ui.action.AbstractAction
io.jmix.ui.action.BaseAction
io.jmix.ui.action.ListAction
io.jmix.ui.action.list.SecuredListAction
io.jmix.ui.action.list.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.
-
Nested Class Summary
Nested classes/interfaces inherited from class io.jmix.ui.action.BaseAction
BaseAction.EnabledRuleNested classes/interfaces inherited from interface io.jmix.ui.action.Action
Action.ActionPerformedEvent, Action.AdjustWhenScreenReadOnly, Action.ExecutableAction, Action.HasPrimaryState, Action.HasSecurityConstraint, Action.HasTarget, Action.MainTabSheetAction, Action.OperationResultAction, Action.ScreenAction<S extends Screen>, Action.ScreenOpeningAction, Action.SecuredAction, Action.Status -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Consumer<RemoveOperation.ActionCancelledEvent<E>>protected Consumer<RemoveOperation.AfterActionPerformedEvent<E>>protected Booleanprotected Stringprotected Stringstatic final Stringprotected RemoveOperationFields inherited from class io.jmix.ui.action.list.SecuredListAction
accessManager, applicationContext, constraintEntityOp, metadataFields inherited from class io.jmix.ui.action.ListAction
targetFields inherited from class io.jmix.ui.action.AbstractAction
caption, description, enabled, eventHub, icon, id, owners, primary, shortcut, visibleFields inherited from interface io.jmix.ui.action.Action
PROP_CAPTION, PROP_DESCRIPTION, PROP_ENABLED, PROP_ICON, PROP_SHORTCUT, PROP_VISIBLE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidactionPerform(Component component) Invoked by owning component to execute the action.voidexecute()Executes the action.Returns true/false if the confirmation flag was set bysetConfirmation(Boolean)or in the screen XML.Returns confirmation dialog message if it was set bysetConfirmationMessage(String)or in the screen XML.Returns confirmation dialog title if it was set bysetConfirmationTitle(String)or in the screen XML.protected booleanCallback method which is invoked by the action to determine its enabled state.voidsetActionCancelledHandler(Consumer<RemoveOperation.ActionCancelledEvent<E>> actionCancelledHandler) Sets the handler to be invoked if the action was cancelled by the user.voidsetAfterActionPerformedHandler(Consumer<RemoveOperation.AfterActionPerformedEvent<E>> afterActionPerformedHandler) Sets the handler to be invoked after excluding entities.voidsetConfirmation(Boolean confirmation) Sets whether to ask confirmation from the user.voidsetConfirmationMessage(String confirmationMessage) Sets confirmation dialog message.voidsetConfirmationTitle(String confirmationTitle) Sets confirmation dialog title.protected voidprotected voidsetMessages(Messages messages) voidsetRemoveOperation(RemoveOperation removeOperation) protected voidsetUiComponentProperties(UiComponentProperties componentProperties) Methods inherited from class io.jmix.ui.action.list.SecuredListAction
getConstraintEntityOp, isApplicable, setAccessManager, setApplicationContext, setConstraintEntityOp, setMetadataMethods inherited from class io.jmix.ui.action.ListAction
getTarget, setTarget, withCaption, withDescription, withHandler, withIcon, withPrimary, withShortcutMethods inherited from class io.jmix.ui.action.BaseAction
addActionPerformedListener, addEnabledRule, isEnabledByRule, isEnabledByUiPermissions, isVisibleByUiPermissions, refreshState, removeEnabledRule, setEnabled, setEnabledByUiPermissions, setEnabledInternal, setVisible, setVisibleByUiPermissions, setVisibleInternalMethods inherited from class io.jmix.ui.action.AbstractAction
addOwner, addPropertyChangeListener, firePropertyChange, getCaption, getDescription, getEventHub, getIcon, getId, getOwner, getOwners, getShortcutCombination, hasSubscriptions, isEnabled, isPrimary, isVisible, removeOwner, removePropertyChangeListener, setCaption, setDescription, setIcon, setPrimary, setShortcut, setShortcutCombinationMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.jmix.ui.action.Action
addOwner, addPropertyChangeListener, getCaption, getDescription, getIcon, getId, getOwner, getOwners, getShortcutCombination, isEnabled, isVisible, refreshState, removeOwner, removePropertyChangeListener, setCaption, setDescription, setEnabled, setIcon, setShortcut, setShortcutCombination, setVisibleMethods inherited from interface io.jmix.ui.action.Action.AdjustWhenScreenReadOnly
isDisabledWhenScreenReadOnly
-
Field Details
-
ID
- See Also:
-
removeOperation
-
confirmation
-
confirmationMessage
-
confirmationTitle
-
afterActionPerformedHandler
-
actionCancelledHandler
-
-
Constructor Details
-
ExcludeAction
public ExcludeAction() -
ExcludeAction
-
-
Method Details
-
getConfirmation
Returns true/false if the confirmation flag was set bysetConfirmation(Boolean)or in the screen XML. Otherwise returns null. -
setConfirmation
Sets whether to ask confirmation from the user. -
getConfirmationMessage
Returns confirmation dialog message if it was set bysetConfirmationMessage(String)or in the screen XML. Otherwise returns null. -
setConfirmationMessage
Sets confirmation dialog message. -
getConfirmationTitle
Returns confirmation dialog title if it was set bysetConfirmationTitle(String)or in the screen XML. Otherwise returns null. -
setConfirmationTitle
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
-
setMessages
-
setUiComponentProperties
-
setRemoveOperation
-
isPermitted
protected boolean isPermitted()Description copied from class:BaseActionCallback method which is invoked by the action to determine its enabled state.- Overrides:
isPermittedin classSecuredListAction- Returns:
- true if the action is enabled for the current user
-
actionPerform
Description copied from interface:ActionInvoked by owning component to execute the action.- Specified by:
actionPerformin interfaceAction- Overrides:
actionPerformin classBaseAction- Parameters:
component- invoking component
-
execute
public void execute()Executes the action.- Specified by:
executein interfaceAction.ExecutableAction
-