Package io.jmix.flowui.action.view
Class ViewAction<A extends ViewAction<A,V>,V extends View>
java.lang.Object
io.jmix.flowui.kit.action.AbstractAction
io.jmix.flowui.kit.action.BaseAction
io.jmix.flowui.action.SecuredBaseAction
io.jmix.flowui.action.view.ViewAction<A,V>
- All Implemented Interfaces:
ExecutableAction,SecuredAction,TargetAction<V>,Action,HasShortcutCombination
- Direct Known Subclasses:
CreateNotificationAction,InputDialogAction,OperationResultViewAction,RunSingleEntityReportAction
public abstract class ViewAction<A extends ViewAction<A,V>,V extends View>
extends SecuredBaseAction
implements TargetAction<V>, ExecutableAction
-
Nested Class Summary
Nested classes/interfaces inherited from class io.jmix.flowui.action.SecuredBaseAction
SecuredBaseAction.EnabledRule -
Field Summary
FieldsFields 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) Executes action logic.protected voidprotected voidprotected booleanvoidwithEnabled(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.withTarget(V target) 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.action.SecuredBaseAction
addEnabledRule, isEnabledByRule, isEnabledByUiPermissions, isPermitted, isVisibleByUiPermissions, refreshState, removeEnabledRule, setEnabledByUiPermissions, setVisibleByUiPermissionsMethods inherited from class io.jmix.flowui.kit.action.BaseAction
addActionPerformedListener, 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
addPropertyChangeListener, getDescription, getIcon, getId, getText, getVariant, isEnabled, isVisible, refreshState, setDescription, setEnabled, setIcon, setText, setVariant, setVisibleMethods inherited from interface io.jmix.flowui.action.ExecutableAction
executeMethods inherited from interface io.jmix.flowui.kit.component.HasShortcutCombination
getShortcutCombination, setShortcutCombination
-
Field Details
-
target
-
-
Constructor Details
-
ViewAction
-
-
Method Details
-
initAction
protected void initAction() -
getTarget
- Specified by:
getTargetin interfaceTargetAction<A extends ViewAction<A,V>>
-
setTarget
- Specified by:
setTargetin interfaceTargetAction<A extends ViewAction<A,V>>
-
withTarget
-
withText
Description copied from class:BaseActionSets the text property value of an action. May be used by components to initialize their appearance.- Overrides:
withTextin classSecuredBaseAction- 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 classSecuredBaseAction- 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 classSecuredBaseAction- 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 classSecuredBaseAction- 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 classSecuredBaseAction- 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 classSecuredBaseAction- 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 classSecuredBaseAction- 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 classSecuredBaseAction- 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 classSecuredBaseAction- Parameters:
handler- listener to add ornullto remove all- Returns:
- this object
-
withEnabledByUiPermissions
- Overrides:
withEnabledByUiPermissionsin classSecuredBaseAction
-
withVisibleByUiPermissions
- Overrides:
withVisibleByUiPermissionsin classSecuredBaseAction
-
actionPerform
public void actionPerform(com.vaadin.flow.component.Component component) Description copied from interface:ActionExecutes action logic.- Specified by:
actionPerformin interfaceAction- Overrides:
actionPerformin classBaseAction- Parameters:
component-Componentthat triggered this action
-
isApplicable
protected boolean isApplicable()- Overrides:
isApplicablein classBaseAction
-
checkTarget
protected void checkTarget()
-