Package io.jmix.bulkeditor.action
Class BulkEditAction<E>
java.lang.Object
io.jmix.flowui.kit.action.AbstractAction
io.jmix.flowui.kit.action.BaseAction
io.jmix.flowui.action.SecuredBaseAction
io.jmix.flowui.action.list.ListDataComponentAction<A,E>
io.jmix.flowui.action.list.SecuredListDataComponentAction<BulkEditAction<E>,E>
io.jmix.bulkeditor.action.BulkEditAction<E>
- Type Parameters:
E- entity type
- All Implemented Interfaces:
ExecutableAction,SecuredAction,SecurityConstraintAction,TargetAction<ListDataComponent<E>>,Action,HasShortcutCombination
@ActionType("bulked_edit")
public class BulkEditAction<E>
extends SecuredListDataComponentAction<BulkEditAction<E>,E>
implements ExecutableAction
Standard action for changing attribute values for several entity instances at once.
Should be defined for a list data component in a screen XML descriptor.
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.flowui.action.SecuredBaseAction
SecuredBaseAction.EnabledRule -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected BulkEditorsprotected Stringprotected Function<List<MetaProperty>,Map<MetaProperty, Integer>> static final Stringprotected booleanprotected booleanFields 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
enabledByUiPermissions, enabledRules, visibleByUiPermissionsFields 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 TypeMethodDescriptionvoidactionPerform(com.vaadin.flow.component.Component component) voidexecute()Executes the action.booleanprotected voidprotected booleanbooleanprotected voidsetAccessManager(AccessManager accessManager) voidsetBulkEditors(BulkEditors bulkEditors) voidsetExclude(String exclude) voidsetFieldSorter(Function<List<MetaProperty>, Map<MetaProperty, Integer>> fieldSorter) voidsetIncludeProperties(List<String> includeProperties) protected voidsetMessages(Messages messages) voidsetUseConfirmDialog(boolean useConfirmDialog) withExclude(String exclude) withFieldSorter(Function<List<MetaProperty>, Map<MetaProperty, Integer>> fieldSorter) withIncludeProperties(List<String> includeProperties) withUseConfirmDialog(boolean useConfirmDialog) Methods inherited from class io.jmix.flowui.action.list.SecuredListDataComponentAction
getConstraintEntityOp, isApplicable, setApplicationContext, setConstraintEntityOp, setMetadata, withConstraintEntityOpMethods inherited from class io.jmix.flowui.action.list.ListDataComponentAction
attachSelectionListener, checkTarget, checkTargetItems, getTarget, onSelectionChange, setTarget, withEnabled, withEnabledByUiPermissions, withHandler, withIcon, withIcon, withShortcutCombination, withTarget, withText, withTitle, withVariant, withVisible, withVisibleByUiPermissionsMethods inherited from class io.jmix.flowui.action.SecuredBaseAction
addEnabledRule, isEnabledByRule, isEnabledByUiPermissions, refreshState, removeEnabledRule, setEnabledByUiPermissions, setVisibleByUiPermissionsMethods inherited from class io.jmix.flowui.kit.action.BaseAction
addActionPerformedListener, setEnabled, setEnabledInternal, setVisible, setVisibleInternalMethods inherited from class io.jmix.flowui.kit.action.AbstractAction
addPropertyChangeListener, firePropertyChange, getDescription, getEventBus, getIcon, getId, getShortcutCombination, getText, getVariant, hasListener, isEnabled, isVisible, setDescription, setIcon, 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
addPropertyChangeListener, getDescription, getIcon, getId, getText, getVariant, isEnabled, isVisible, refreshState, setDescription, setEnabled, setIcon, setText, setVariant, setVisibleMethods inherited from interface io.jmix.flowui.kit.component.HasShortcutCombination
getShortcutCombination, setShortcutCombination
-
Field Details
-
ID
- See Also:
-
bulkEditors
-
exclude
-
fieldSorter
-
includeProperties
-
useConfirmDialog
protected boolean useConfirmDialog -
visibleBySpecificUiPermission
protected boolean visibleBySpecificUiPermission
-
-
Constructor Details
-
BulkEditAction
public BulkEditAction() -
BulkEditAction
-
-
Method Details
-
initAction
protected void initAction()- Overrides:
initActionin classListDataComponentAction<BulkEditAction<E>,E>
-
getExclude
- Returns:
- regular expression to exclude fields if it was set by
setExclude(String)or in the screen XML. Otherwise, returns null
-
setExclude
- Parameters:
exclude- regular expression to exclude some fields explicitly from the list of attributes available for editing
-
setFieldSorter
- Parameters:
fieldSorter- function to sort fields by custom logic
-
getIncludeProperties
- Returns:
- list entity attributes to be included to bulk editor window if it was set by
setIncludeProperties(List)or in the screen XML. Otherwise, returns null
-
setIncludeProperties
- Parameters:
includeProperties- entity attributes to be included to bulk editor window. If set, other attributes will be ignored
-
getUseConfirmDialog
public boolean getUseConfirmDialog()- Returns:
- true/false whether confirmation dialog
setUseConfirmDialog(boolean)is used.
-
setUseConfirmDialog
public void setUseConfirmDialog(boolean useConfirmDialog) - Parameters:
useConfirmDialog- flag whether the confirmation dialog should be displayed to the user before saving the changes. The default value is true
-
setMessages
-
setAccessManager
- Overrides:
setAccessManagerin classSecuredListDataComponentAction<BulkEditAction<E>,E>
-
isVisibleByUiPermissions
public boolean isVisibleByUiPermissions()- Specified by:
isVisibleByUiPermissionsin interfaceSecuredAction- Overrides:
isVisibleByUiPermissionsin classSecuredBaseAction
-
setBulkEditors
-
isPermitted
protected boolean isPermitted()- Overrides:
isPermittedin classSecuredListDataComponentAction<BulkEditAction<E>,E>
-
actionPerform
public void actionPerform(com.vaadin.flow.component.Component component) - Specified by:
actionPerformin interfaceAction- Overrides:
actionPerformin classListDataComponentAction<BulkEditAction<E>,E>
-
execute
public void execute()Executes the action.- Specified by:
executein interfaceExecutableAction
-
withExclude
- See Also:
-
withFieldSorter
public BulkEditAction<E> withFieldSorter(Function<List<MetaProperty>, Map<MetaProperty, Integer>> fieldSorter) - See Also:
-
withIncludeProperties
- See Also:
-
withUseConfirmDialog
- See Also:
-