Package io.jmix.ui.action
Class AbstractScreenAction<A extends AbstractScreenAction<A,S>,S extends Screen>
java.lang.Object
io.jmix.ui.action.AbstractAction
io.jmix.ui.action.BaseAction
io.jmix.ui.action.AbstractScreenAction<A,S>
- Type Parameters:
A- type of actionS- type of screen
- All Implemented Interfaces:
Action,Action.ExecutableAction,Action.HasPrimaryState,Action.ScreenAction<S>,Action.SecuredAction
- Direct Known Subclasses:
OperationResultScreenAction
public abstract class AbstractScreenAction<A extends AbstractScreenAction<A,S>,S extends Screen>
extends BaseAction
implements Action.ScreenAction<S>, Action.ExecutableAction
Base class for screen actions.
-
Nested Class Summary
Nested classes/interfaces inherited from class io.jmix.ui.action.BaseAction
BaseAction.EnabledRuleNested 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.OperationResultAction, Action.ScreenAction<S extends Screen>, Action.ScreenOpeningAction, Action.SecuredAction, Action.Status -
Field Summary
FieldsFields inherited from class io.jmix.ui.action.AbstractAction
caption, description, enabled, eventHub, icon, id, owners, primary, shortcut, visibleFields inherited from interface io.jmix.ui.action.Action
PROP_CAPTION, PROP_DESCRIPTION, PROP_ENABLED, PROP_ICON, PROP_SHORTCUT, PROP_VISIBLE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidactionPerform(Component component) Invoked by owning component to execute the action.protected voidprotected voidprotected booleanCallback method which is invoked by the action to determine its enabled state.voidwithCaption(String caption) Set caption using fluent API method.withDescription(String description) Set description using fluent API method.withEnabled(boolean enabled) withEnabledByUiPermissions(boolean enabledByUiPermissions) withHandler(Consumer<Action.ActionPerformedEvent> handler) Set action performed event handler using fluent API method.Set icon using fluent API method.withPrimary(boolean primary) Set whether this action is primary using fluent API method.withShortcut(String shortcut) Set shortcut using fluent API method.withTarget(S target) withVisible(boolean visible) withVisibleByUiPermissions(boolean visibleByUiPermissions) Methods inherited from class io.jmix.ui.action.BaseAction
addActionPerformedListener, addEnabledRule, isEnabledByRule, isEnabledByUiPermissions, isPermitted, isVisibleByUiPermissions, refreshState, removeEnabledRule, setEnabled, setEnabledByUiPermissions, setEnabledInternal, setVisible, setVisibleByUiPermissions, setVisibleInternalMethods 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, setShortcutCombinationMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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, setVisibleMethods inherited from interface io.jmix.ui.action.Action.ExecutableAction
execute
-
Field Details
-
target
-
-
Constructor Details
-
AbstractScreenAction
-
-
Method Details
-
initAction
protected void initAction() -
getTarget
- Specified by:
getTargetin interfaceAction.ScreenAction<A extends AbstractScreenAction<A,S>>
-
setTarget
- Specified by:
setTargetin interfaceAction.ScreenAction<A extends AbstractScreenAction<A,S>>
-
withTarget
-
withCaption
Set caption using fluent API method.- Overrides:
withCaptionin classBaseAction- Parameters:
caption- caption- Returns:
- current instance of action
-
withDescription
Set description using fluent API method.- Overrides:
withDescriptionin classBaseAction- Parameters:
description- description- Returns:
- current instance of action
-
withEnabled
-
withVisible
-
withIcon
Set icon using fluent API method.- Overrides:
withIconin classBaseAction- Parameters:
icon- icon- Returns:
- current instance of action
-
withShortcut
Set shortcut using fluent API method.- Overrides:
withShortcutin classBaseAction- Parameters:
shortcut- shortcut- Returns:
- current instance of action
-
withHandler
Set action performed event handler using fluent API method. Can be used instead of subclassing BaseAction class.- Overrides:
withHandlerin classBaseAction- Parameters:
handler- action performed handler- Returns:
- current instance of action
-
withPrimary
Set whether this action is primary using fluent API method. Can be used instead of subclassing BaseAction class.- Overrides:
withPrimaryin classBaseAction- Parameters:
primary- primary- Returns:
- current instance of action
-
withEnabledByUiPermissions
-
withVisibleByUiPermissions
-
actionPerform
Description copied from interface:ActionInvoked by owning component to execute the action.- Specified by:
actionPerformin interfaceAction- Overrides:
actionPerformin classBaseAction- Parameters:
component- invoking component
-
isApplicable
protected boolean isApplicable()Description copied from class:BaseActionCallback method which is invoked by the action to determine its enabled state.- Overrides:
isApplicablein classBaseAction- Returns:
- true if the action is enabled for the current context, e.g. there is a selected row in a table
-
checkTarget
protected void checkTarget()
-