Class SubstituteUserAction
java.lang.Object
io.jmix.ui.action.AbstractAction
io.jmix.ui.action.BaseAction
io.jmix.ui.component.mainwindow.impl.SubstituteUserAction
- All Implemented Interfaces:
Action
,Action.HasPrimaryState
,Action.SecuredAction
Makes UI-specific preparations to user substitution and performs it using
UserSubstitutionManager
Checks if there are screens that have unsaved changes and shows dialog window with options:
- Discard changes (and close all windows, cleanups background tasks, then performs substitution and recreates main window)
- Cancel (invokes all
cancelAction
s)
-
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 Icons
static final String
protected Messages
protected org.springframework.security.core.userdetails.UserDetails
protected org.springframework.security.core.userdetails.UserDetails
protected UserSubstitutionManager
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
ConstructorDescriptionSubstituteUserAction
(org.springframework.security.core.userdetails.UserDetails newSubstitutedUser, org.springframework.security.core.userdetails.UserDetails oldSubstitutedUser, Messages messages, Icons icons, UserSubstitutionManager substitutionManager) -
Method Summary
Modifier and TypeMethodDescriptionvoid
actionPerform
(Component component) Invoked by owning component to execute the action.protected void
cancel()
protected void
doSubstituteUser
(AppUI currentUI) withCancelAction
(Consumer<org.springframework.security.core.userdetails.UserDetails> cancelStep) Methods inherited from class io.jmix.ui.action.BaseAction
addActionPerformedListener, addEnabledRule, isApplicable, isEnabledByRule, isEnabledByUiPermissions, isPermitted, isVisibleByUiPermissions, refreshState, removeEnabledRule, setEnabled, setEnabledByUiPermissions, setEnabledInternal, setVisible, setVisibleByUiPermissions, setVisibleInternal, withCaption, withDescription, withHandler, withIcon, withPrimary, withShortcut
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, removeOwner, removePropertyChangeListener, setCaption, setDescription, setIcon, setShortcut, setShortcutCombination
-
Field Details
-
ID
- See Also:
-
cancelActions
-
newSubstitutedUser
protected org.springframework.security.core.userdetails.UserDetails newSubstitutedUser -
prevSubstitutedUser
protected org.springframework.security.core.userdetails.UserDetails prevSubstitutedUser -
messages
-
icons
-
substitutionManager
-
-
Constructor Details
-
SubstituteUserAction
public SubstituteUserAction(org.springframework.security.core.userdetails.UserDetails newSubstitutedUser, org.springframework.security.core.userdetails.UserDetails oldSubstitutedUser, Messages messages, Icons icons, UserSubstitutionManager substitutionManager)
-
-
Method Details
-
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
-
doSubstituteUser
-
cancel
protected void cancel() -
withCancelAction
public SubstituteUserAction withCancelAction(Consumer<org.springframework.security.core.userdetails.UserDetails> cancelStep)
-