Package io.jmix.ui.action.list
Class BulkEditAction
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.BulkEditAction
- All Implemented Interfaces:
Action
,Action.ExecutableAction
,Action.HasPrimaryState
,Action.HasSecurityConstraint
,Action.HasTarget
,Action.SecuredAction
@StudioAction(target="io.jmix.ui.component.ListComponent",
description="Opens an editor for changing attribute values for several entity instances at once")
@ActionType("bulkEdit")
public class BulkEditAction
extends SecuredListAction
implements Action.ExecutableAction
Standard action for changing attribute values for several entity instances at once.
Should be defined for a list component (Table
, DataGrid
, etc.) 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.ui.action.BaseAction
BaseAction.EnabledRule
Nested 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.ScreenOpeningAction, Action.SecuredAction, Action.Status
-
Field Summary
Modifier and TypeFieldDescriptionprotected BulkEditors
protected ColumnsMode
protected String
protected FieldSorter
static final String
protected Boolean
protected Messages
protected OpenMode
protected Boolean
protected boolean
Fields inherited from class io.jmix.ui.action.list.SecuredListAction
accessManager, applicationContext, constraintEntityOp, metadata
Fields inherited from class io.jmix.ui.action.ListAction
target
Fields inherited from class io.jmix.ui.action.AbstractAction
caption, description, enabled, eventHub, icon, id, owners, primary, shortcut, visible
Fields inherited from interface io.jmix.ui.action.Action
PROP_CAPTION, PROP_DESCRIPTION, PROP_ENABLED, PROP_ICON, PROP_SHORTCUT, PROP_VISIBLE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
actionPerform
(Component component) Invoked by owning component to execute the action.void
execute()
Executes the action.Returns the columns mode which defines the number of columns either it was set bysetColumnsMode(ColumnsMode)
or in the screen XML.Returns a regular expression to exclude fields if it was set bysetExclude(String)
or in the screen XML.Returns a list entity attributes to be included to bulk editor window if it was set bysetIncludeProperties(List)
or in the screen XML.Returns true/false if the flag was set bysetLoadDynamicAttributes(Boolean)
or in the screen XML.Returns the bulk editor screen open mode if it was set bysetOpenMode(OpenMode)
or in the screen XML.Returns true/false if the flag was set bysetUseConfirmDialog(Boolean)
or in the screen XML.protected boolean
Callback method which is invoked by the action to determine its enabled state.boolean
protected void
setAccessManager
(AccessManager accessManager) void
setBulkEditors
(BulkEditors bulkEditors) void
setColumnsMode
(ColumnsMode columnsMode) Sets the columns mode which defines the number of columns.void
setExclude
(String exclude) Sets a regular expression to exclude some fields explicitly from the list of attributes available for editing.void
setFieldSorter
(FieldSorter fieldSorter) Sets field sorter that allows you to sort fields by custom logic.protected void
void
setIncludeProperties
(List<String> includeProperties) Sets the entity attributes to be included to bulk editor window.void
setLoadDynamicAttributes
(Boolean loadDynamicAttributes) Sets whether dynamic attributes of the edited entity should be displayed on the entity's bulk editor screen.protected void
setMessages
(Messages messages) void
setOpenMode
(OpenMode openMode) Sets the bulk editor screen open mode.void
setUseConfirmDialog
(Boolean useConfirmDialog) Sets whether or not the confirmation dialog should be displayed to the user before saving the changes.Methods inherited from class io.jmix.ui.action.list.SecuredListAction
getConstraintEntityOp, isApplicable, setApplicationContext, setConstraintEntityOp, setMetadata
Methods inherited from class io.jmix.ui.action.ListAction
getTarget, setTarget, withCaption, withDescription, withHandler, withIcon, withPrimary, withShortcut
Methods inherited from class io.jmix.ui.action.BaseAction
addActionPerformedListener, addEnabledRule, isEnabledByRule, isEnabledByUiPermissions, refreshState, removeEnabledRule, setEnabled, setEnabledByUiPermissions, setEnabledInternal, setVisible, setVisibleByUiPermissions, setVisibleInternal
Methods 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, setShortcutCombination
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods 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, setVisible
-
Field Details
-
ID
- See Also:
-
messages
-
bulkEditors
-
columnsMode
-
exclude
-
fieldSorter
-
includeProperties
-
openMode
-
loadDynamicAttributes
-
useConfirmDialog
-
visibleBySpecificUiPermission
protected boolean visibleBySpecificUiPermission
-
-
Constructor Details
-
BulkEditAction
public BulkEditAction() -
BulkEditAction
-
-
Method Details
-
getColumnsMode
Returns the columns mode which defines the number of columns either it was set bysetColumnsMode(ColumnsMode)
or in the screen XML. Otherwise returns null. -
setColumnsMode
@StudioPropertiesItem(defaultValue="TWO_COLUMNS") public void setColumnsMode(ColumnsMode columnsMode) Sets the columns mode which defines the number of columns. -
getExclude
Returns a regular expression to exclude fields if it was set bysetExclude(String)
or in the screen XML. Otherwise returns null. -
setExclude
Sets a regular expression to exclude some fields explicitly from the list of attributes available for editing. -
setFieldSorter
Sets field sorter that allows you to sort fields by custom logic. -
getIncludeProperties
Returns a list entity attributes to be included to bulk editor window if it was set bysetIncludeProperties(List)
or in the screen XML. Otherwise returns null. -
setIncludeProperties
Sets the entity attributes to be included to bulk editor window. If set, other attributes will be ignored. -
getOpenMode
Returns the bulk editor screen open mode if it was set bysetOpenMode(OpenMode)
or in the screen XML. Otherwise returns null. -
setOpenMode
Sets the bulk editor screen open mode. -
getLoadDynamicAttributes
Returns true/false if the flag was set bysetLoadDynamicAttributes(Boolean)
or in the screen XML. Otherwise returns null. -
setLoadDynamicAttributes
@StudioPropertiesItem(defaultValue="true") public void setLoadDynamicAttributes(Boolean loadDynamicAttributes) Sets whether dynamic attributes of the edited entity should be displayed on the entity's bulk editor screen. The default value is true. -
getUseConfirmDialog
Returns true/false if the flag was set bysetUseConfirmDialog(Boolean)
or in the screen XML. Otherwise returns null. -
setUseConfirmDialog
@StudioPropertiesItem(defaultValue="true") public void setUseConfirmDialog(Boolean useConfirmDialog) Sets whether or not the confirmation dialog should be displayed to the user before saving the changes. The default value is true. -
setIcons
-
setMessages
-
setAccessManager
- Overrides:
setAccessManager
in classSecuredListAction
-
isVisibleByUiPermissions
public boolean isVisibleByUiPermissions()- Specified by:
isVisibleByUiPermissions
in interfaceAction.SecuredAction
- Overrides:
isVisibleByUiPermissions
in classBaseAction
-
setBulkEditors
-
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 classSecuredListAction
- Returns:
- true if the action is enabled for the current user
-
actionPerform
Description copied from interface:Action
Invoked by owning component to execute the action.- Specified by:
actionPerform
in interfaceAction
- Overrides:
actionPerform
in classBaseAction
- Parameters:
component
- invoking component
-
execute
public void execute()Executes the action.- Specified by:
execute
in interfaceAction.ExecutableAction
-