Package io.jmix.flowui.action.list
Class RemoveAction<E>
java.lang.Object
io.jmix.flowui.kit.action.AbstractAction
io.jmix.flowui.kit.action.BaseAction<RemoveAction<E>>
io.jmix.flowui.action.ObservableBaseAction<RemoveAction<E>>
io.jmix.flowui.action.SecuredBaseAction<RemoveAction<E>>
io.jmix.flowui.action.list.ListDataComponentAction<RemoveAction<E>,E>
io.jmix.flowui.action.list.SecuredListDataComponentAction<RemoveAction<E>,E>
io.jmix.flowui.action.list.RemoveAction<E>
- All Implemented Interfaces:
AdjustWhenViewReadOnly,ExecutableAction,SecurityConstraintAction,TargetAction<ListDataComponent<E>>,Action,HasShortcutCombination
@ActionType("list_remove")
public class RemoveAction<E>
extends SecuredListDataComponentAction<RemoveAction<E>,E>
implements AdjustWhenViewReadOnly
-
Nested Class Summary
Nested classes/interfaces inherited from class io.jmix.flowui.action.SecuredBaseAction
SecuredBaseAction.EnabledRule -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Consumer<RemoveOperation.ActionCancelledEvent<E>> protected Consumer<RemoveOperation.AfterActionPerformedEvent<E>> protected Consumer<RemoveOperation.BeforeActionPerformedEvent<E>> protected booleanprotected Stringprotected Stringprotected Consumer<Collection<E>> static final Stringprotected RemoveOperationFields inherited from class io.jmix.flowui.action.list.SecuredListDataComponentAction
accessManager, applicationContext, constraintEntityOp, metadataFields inherited from class io.jmix.flowui.action.list.ListDataComponentAction
selectionListenerRegistration, targetFields inherited from class io.jmix.flowui.action.SecuredBaseAction
enabledRulesFields inherited from class io.jmix.flowui.action.ObservableBaseAction
uiObservationSupportFields inherited from class io.jmix.flowui.kit.action.BaseAction
enabledExplicitly, visibleExplicitlyFields inherited from class io.jmix.flowui.kit.action.AbstractAction
description, enabled, eventBus, icon, id, shortcutCombination, text, variant, visibleFields inherited from interface io.jmix.flowui.kit.action.Action
PROP_DESCRIPTION, PROP_ENABLED, PROP_ICON, PROP_SHORTCUT_COMBINATION, PROP_TEXT, PROP_VARIANT, PROP_VISIBLE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanvoidexecute()Executes the action.@Nullable StringReturns confirmation dialog header if it was set bysetConfirmationHeader(String)or in the view XML.@Nullable StringReturns confirmation dialog text if it was set bysetConfirmationText(String)or in the view XML.protected voidbooleanprotected booleanvoidsetActionCancelledHandler(@Nullable Consumer<RemoveOperation.ActionCancelledEvent<E>> actionCancelledHandler) Sets the handler to be invoked if the action was cancelled by the user.voidsetAfterActionPerformedHandler(@Nullable Consumer<RemoveOperation.AfterActionPerformedEvent<E>> afterActionPerformedHandler) Sets the handler to be invoked after removing entities.voidsetBeforeActionPerformedHandler(@Nullable Consumer<RemoveOperation.BeforeActionPerformedEvent<E>> beforeActionPerformedHandler) Sets the handler to be invoked before removing entities.voidsetConfirmation(boolean confirmation) Sets whether to ask confirmation from the user.voidsetConfirmationHeader(@Nullable String confirmationHeader) Sets confirmation dialog header.voidsetConfirmationText(@Nullable String confirmationText) Sets confirmation dialog text.voidsetDelegate(@Nullable Consumer<Collection<E>> delegate) Sets the delegate to be invoked instead of DataManager to remove the entities from a storage.protected voidprotected voidsetMessages(Messages messages) voidsetRemoveOperation(RemoveOperation removeOperation) protected voidsetUiComponentProperties(UiComponentProperties uiComponentProperties) withAfterActionCancelledHandler(@Nullable Consumer<RemoveOperation.ActionCancelledEvent<E>> actionCancelledHandler) withAfterActionPerformedHandler(@Nullable Consumer<RemoveOperation.AfterActionPerformedEvent<E>> afterActionPerformedHandler) withBeforeActionPerformedHandler(@Nullable Consumer<RemoveOperation.BeforeActionPerformedEvent<E>> beforeActionPerformedHandler) withConfirmation(boolean confirmation) withConfirmationHeader(@Nullable String confirmationHeader) withConfirmationText(@Nullable String confirmationText) Methods inherited from class io.jmix.flowui.action.list.SecuredListDataComponentAction
getConstraintEntityOp, isApplicable, setAccessManager, setApplicationContext, setConstraintEntityOp, setMetadata, withConstraintEntityOpMethods inherited from class io.jmix.flowui.action.list.ListDataComponentAction
actionPerform, attachSelectionListener, checkTarget, checkTargetItems, getTarget, onSelectionChange, setTarget, withTargetMethods inherited from class io.jmix.flowui.action.SecuredBaseAction
addEnabledRule, isEnabledByRule, refreshState, removeEnabledRuleMethods inherited from class io.jmix.flowui.action.ObservableBaseAction
getUiObservationSupportMethods inherited from class io.jmix.flowui.kit.action.BaseAction
addActionPerformedListener, self, setEnabled, setEnabledInternal, setVisible, setVisibleInternal, withDescription, withEnabled, withHandler, withIcon, withShortcutCombination, withText, withVariant, withVisibleMethods inherited from class io.jmix.flowui.kit.action.AbstractAction
addPropertyChangeListener, firePropertyChange, getDescription, getEventBus, getIcon, getIconComponent, getId, getShortcutCombination, getText, getVariant, hasListener, isEnabled, isVisible, setDescription, setIcon, setIconComponent, setShortcutCombination, setText, setVariantMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.jmix.flowui.kit.action.Action
actionPerform, addPropertyChangeListener, getDescription, getIcon, getIconComponent, getId, getText, getVariant, isEnabled, isVisible, refreshState, setDescription, setEnabled, setIcon, setIconComponent, setText, setVariant, setVisibleMethods inherited from interface io.jmix.flowui.action.AdjustWhenViewReadOnly
isDisabledWhenViewReadOnlyMethods inherited from interface io.jmix.flowui.kit.component.HasShortcutCombination
getShortcutCombination, setShortcutCombination
-
Field Details
-
ID
- See Also:
-
removeOperation
-
confirmation
protected boolean confirmation -
confirmationText
-
confirmationHeader
-
beforeActionPerformedHandler
-
afterActionPerformedHandler
-
actionCancelledHandler
-
delegate
-
-
Constructor Details
-
RemoveAction
public RemoveAction() -
RemoveAction
-
-
Method Details
-
initAction
protected void initAction()- Overrides:
initActionin classListDataComponentAction<RemoveAction<E>,E>
-
setMessages
-
setIcons
-
setRemoveOperation
-
setUiComponentProperties
-
isConfirmation
public boolean isConfirmation()- Returns:
- whether to ask confirmation from the user
-
setConfirmation
public void setConfirmation(boolean confirmation) Sets whether to ask confirmation from the user. -
getConfirmationText
Returns confirmation dialog text if it was set bysetConfirmationText(String)or in the view XML. Otherwise, returns null. -
setConfirmationText
Sets confirmation dialog text. -
getConfirmationHeader
Returns confirmation dialog header if it was set bysetConfirmationHeader(String)or in the view XML. Otherwise, returns null. -
setConfirmationHeader
Sets confirmation dialog header. -
setBeforeActionPerformedHandler
public void setBeforeActionPerformedHandler(@Nullable Consumer<RemoveOperation.BeforeActionPerformedEvent<E>> beforeActionPerformedHandler) Sets the handler to be invoked before removing entities.- Parameters:
beforeActionPerformedHandler- handler to be set
-
setAfterActionPerformedHandler
public void setAfterActionPerformedHandler(@Nullable Consumer<RemoveOperation.AfterActionPerformedEvent<E>> afterActionPerformedHandler) Sets the handler to be invoked after removing entities. -
setActionCancelledHandler
public void setActionCancelledHandler(@Nullable Consumer<RemoveOperation.ActionCancelledEvent<E>> actionCancelledHandler) Sets the handler to be invoked if the action was cancelled by the user. -
setDelegate
Sets the delegate to be invoked instead of DataManager to remove the entities from a storage. -
isPermitted
protected boolean isPermitted()- Overrides:
isPermittedin classSecuredListDataComponentAction<RemoveAction<E>,E>
-
checkRemovePermission
protected boolean checkRemovePermission() -
execute
public void execute()Executes the action.- Specified by:
executein interfaceExecutableAction
-
withConfirmation
-
withConfirmationText
-
withConfirmationHeader
-
withBeforeActionPerformedHandler
public RemoveAction<E> withBeforeActionPerformedHandler(@Nullable Consumer<RemoveOperation.BeforeActionPerformedEvent<E>> beforeActionPerformedHandler) -
withAfterActionPerformedHandler
public RemoveAction<E> withAfterActionPerformedHandler(@Nullable Consumer<RemoveOperation.AfterActionPerformedEvent<E>> afterActionPerformedHandler) -
withAfterActionCancelledHandler
public RemoveAction<E> withAfterActionCancelledHandler(@Nullable Consumer<RemoveOperation.ActionCancelledEvent<E>> actionCancelledHandler)
-