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
Modifier and TypeFieldDescriptionprotected BulkEditors
protected String
protected Function<List<MetaProperty>,
Map<MetaProperty, Integer>> static final String
protected boolean
protected boolean
Fields inherited from class io.jmix.flowui.action.list.SecuredListDataComponentAction
accessManager, applicationContext, constraintEntityOp, metadata
Fields inherited from class io.jmix.flowui.action.list.ListDataComponentAction
selectionListenerRegistration, target
Fields inherited from class io.jmix.flowui.action.SecuredBaseAction
enabledByUiPermissions, enabledRules, visibleByUiPermissions
Fields inherited from class io.jmix.flowui.kit.action.BaseAction
enabledExplicitly, visibleExplicitly
Fields inherited from class io.jmix.flowui.kit.action.AbstractAction
description, enabled, eventBus, icon, id, shortcutCombination, text, variant, visible
Fields 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
-
Method Summary
Modifier and TypeMethodDescriptionvoid
actionPerform
(com.vaadin.flow.component.Component component) void
execute()
Executes the action.boolean
protected void
protected boolean
boolean
protected void
setAccessManager
(AccessManager accessManager) void
setBulkEditors
(BulkEditors bulkEditors) void
setExclude
(String exclude) void
setFieldSorter
(Function<List<MetaProperty>, Map<MetaProperty, Integer>> fieldSorter) void
setIncludeProperties
(List<String> includeProperties) protected void
setMessages
(Messages messages) void
setUseConfirmDialog
(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, withConstraintEntityOp
Methods 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, withVisibleByUiPermissions
Methods inherited from class io.jmix.flowui.action.SecuredBaseAction
addEnabledRule, isEnabledByRule, isEnabledByUiPermissions, refreshState, removeEnabledRule, setEnabledByUiPermissions, setVisibleByUiPermissions
Methods inherited from class io.jmix.flowui.kit.action.BaseAction
addActionPerformedListener, setEnabled, setEnabledInternal, setVisible, setVisibleInternal
Methods 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, setVariant
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.jmix.flowui.kit.action.Action
addPropertyChangeListener, getDescription, getIcon, getId, getText, getVariant, isEnabled, isVisible, refreshState, setDescription, setEnabled, setIcon, setText, setVariant, setVisible
Methods 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:
initAction
in 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:
setAccessManager
in classSecuredListDataComponentAction<BulkEditAction<E>,
E>
-
isVisibleByUiPermissions
public boolean isVisibleByUiPermissions()- Specified by:
isVisibleByUiPermissions
in interfaceSecuredAction
- Overrides:
isVisibleByUiPermissions
in classSecuredBaseAction
-
setBulkEditors
-
isPermitted
protected boolean isPermitted()- Overrides:
isPermitted
in classSecuredListDataComponentAction<BulkEditAction<E>,
E>
-
actionPerform
public void actionPerform(com.vaadin.flow.component.Component component) - Specified by:
actionPerform
in interfaceAction
- Overrides:
actionPerform
in classListDataComponentAction<BulkEditAction<E>,
E>
-
execute
public void execute()Executes the action.- Specified by:
execute
in interfaceExecutableAction
-
withExclude
- See Also:
-
withFieldSorter
public BulkEditAction<E> withFieldSorter(Function<List<MetaProperty>, Map<MetaProperty, Integer>> fieldSorter) - See Also:
-
withIncludeProperties
- See Also:
-
withUseConfirmDialog
- See Also:
-