Package io.jmix.flowui.action
Class SecuredBaseAction
java.lang.Object
io.jmix.flowui.kit.action.AbstractAction
io.jmix.flowui.kit.action.BaseAction
io.jmix.flowui.action.SecuredBaseAction
- All Implemented Interfaces:
SecuredAction,Action,HasShortcutCombination
- Direct Known Subclasses:
DialogAction,FragmentAction,GenericFilterAction,ListDataComponentAction,PickerAction,ViewAction
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceCallback interface which is invoked by the action to determine its enabled state. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanprotected List<SecuredBaseAction.EnabledRule>protected booleanFields 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 TypeMethodDescriptionvoidaddEnabledRule(SecuredBaseAction.EnabledRule enabledRule) Add new enabled rule for the action.protected booleanbooleanprotected booleanbooleanvoidRefreshes internal state of the action to initialize enabled, visible, text, icon, etc.voidremoveEnabledRule(SecuredBaseAction.EnabledRule enabledRule) Remove enabled rule.voidsetEnabledByUiPermissions(boolean enabledByUiPermissions) voidsetVisibleByUiPermissions(boolean visibleByUiPermissions) withEnabled(boolean enabled) Sets the enabled property value of an action.withEnabledByUiPermissions(boolean enabledByUiPermissions) withHandler(Consumer<ActionPerformedEvent> handler) Adds a listener to be notified when action is performed.withIcon(com.vaadin.flow.component.icon.Icon icon) Sets the icon property value of an action.withIcon(com.vaadin.flow.component.icon.VaadinIcon icon) Sets the icon property value of an action.withShortcutCombination(KeyCombination shortcutCombination) Sets object that stores information about keys, modifiers and additional settings that describe shortcut combinations.Sets the text property value of an action.Sets the description property value of an action.withVariant(ActionVariant actionVariant) Sets the variant property value of an action.withVisible(boolean visible) Sets the visible property value of an action.withVisibleByUiPermissions(boolean visibleByUiPermissions) Methods inherited from class io.jmix.flowui.kit.action.BaseAction
actionPerform, addActionPerformedListener, isApplicable, setEnabled, setEnabledInternal, setVisible, setVisibleInternal, withDescriptionMethods 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
actionPerform, addPropertyChangeListener, getDescription, getIcon, getId, getText, getVariant, isEnabled, isVisible, setDescription, setEnabled, setIcon, setText, setVariant, setVisibleMethods inherited from interface io.jmix.flowui.kit.component.HasShortcutCombination
getShortcutCombination, setShortcutCombination
-
Field Details
-
enabledByUiPermissions
protected boolean enabledByUiPermissions -
visibleByUiPermissions
protected boolean visibleByUiPermissions -
enabledRules
-
-
Constructor Details
-
SecuredBaseAction
-
-
Method Details
-
refreshState
public void refreshState()Description copied from interface:ActionRefreshes internal state of the action to initialize enabled, visible, text, icon, etc. properties depending on programmatically set values and user permissions set at runtime.For example, this method is called by visual components holding actions when they are bound to data. At this moment the action can find out what entity it is connected to and change its state according to the user permissions.
- Specified by:
refreshStatein interfaceAction- Overrides:
refreshStatein classBaseAction
-
isEnabledByUiPermissions
public boolean isEnabledByUiPermissions()- Specified by:
isEnabledByUiPermissionsin interfaceSecuredAction
-
setEnabledByUiPermissions
public void setEnabledByUiPermissions(boolean enabledByUiPermissions) - Specified by:
setEnabledByUiPermissionsin interfaceSecuredAction
-
isVisibleByUiPermissions
public boolean isVisibleByUiPermissions()- Specified by:
isVisibleByUiPermissionsin interfaceSecuredAction
-
setVisibleByUiPermissions
public void setVisibleByUiPermissions(boolean visibleByUiPermissions) - Specified by:
setVisibleByUiPermissionsin interfaceSecuredAction
-
isPermitted
protected boolean isPermitted() -
isEnabledByRule
protected boolean isEnabledByRule() -
addEnabledRule
Add new enabled rule for the action.- Parameters:
enabledRule- boolean rule for the action enabled state
-
removeEnabledRule
Remove enabled rule.- Parameters:
enabledRule- boolean rule for the action enabled state
-
withText
Description copied from class:BaseActionSets the text property value of an action. May be used by components to initialize their appearance.- Overrides:
withTextin classBaseAction- Parameters:
text- text to set ornullto remove- Returns:
- this object
-
withEnabled
Description copied from class:BaseActionSets the enabled property value of an action. May be used by components to initialize their appearance.- Overrides:
withEnabledin classBaseAction- Parameters:
enabled- whether the action is currently enabled- Returns:
- this object
-
withVisible
Description copied from class:BaseActionSets the visible property value of an action. May be used by components to initialize their appearance.- Overrides:
withVisiblein classBaseAction- Parameters:
visible- whether the action is currently visible- Returns:
- this object
-
withIcon
Description copied from class:BaseActionSets the icon property value of an action. May be used by components to initialize their appearance.- Overrides:
withIconin classBaseAction- Parameters:
icon- icon to set ornullto remove- Returns:
- this object
-
withIcon
Description copied from class:BaseActionSets the icon property value of an action. May be used by components to initialize their appearance.- Overrides:
withIconin classBaseAction- Parameters:
icon- icon to set ornullto remove- Returns:
- this object
-
withTitle
Description copied from class:BaseActionSets the description property value of an action. May be used by components to initialize their appearance.- Overrides:
withTitlein classBaseAction- Parameters:
title- description to set ornullto remove- Returns:
- this object
-
withVariant
Description copied from class:BaseActionSets the variant property value of an action. May be used by components to initialize their appearance.- Overrides:
withVariantin classBaseAction- Parameters:
actionVariant- variant to set- Returns:
- this object
-
withShortcutCombination
Description copied from class:BaseActionSets object that stores information about keys, modifiers and additional settings that describe shortcut combinations.- Overrides:
withShortcutCombinationin classBaseAction- Parameters:
shortcutCombination- key combination to set ornullto remove- Returns:
- this object
-
withHandler
Description copied from class:BaseActionAdds a listener to be notified when action is performed.- Overrides:
withHandlerin classBaseAction- Parameters:
handler- listener to add ornullto remove all- Returns:
- this object
-
withEnabledByUiPermissions
-
withVisibleByUiPermissions
-