public class UserEditor extends AbstractEditor<User>
Modifier and Type | Class and Description |
---|---|
protected class |
UserEditor.AddRoleAction |
protected class |
UserEditor.AddSubstitutedAction |
static interface |
UserEditor.Companion |
protected class |
UserEditor.EditRoleAction |
protected class |
UserEditor.EditSubstitutedAction |
protected class |
UserEditor.RemoveRoleAction |
Screen.AfterCloseEvent, Screen.AfterDetachEvent, Screen.AfterInitEvent, Screen.AfterShowEvent, Screen.BeforeCloseEvent, Screen.BeforeShowEvent, Screen.InitEvent
Window.BeforeCloseEvent, Window.BeforeCloseWithCloseButtonEvent, Window.BeforeCloseWithShortcutEvent, Window.CloseListener, Window.CloseOrigin, Window.CloseWithCommitListener, Window.Committable, Window.ContentSwitchMode, Window.Editor<T extends Entity>, Window.HasFoldersPane, Window.HasUserIndicator, Window.HasWorkArea, Window.Lookup<T extends Entity>, Window.TopLevelWindow, Window.Wrapper
Frame.MessageMode, Frame.MessageType, Frame.NotificationType
ExpandingLayout.ExpandDirection
Component.Alignment, Component.BelongToFrame, Component.Disposable, Component.Editable, Component.Focusable, Component.HasCaption, Component.HasDescription, Component.HasIcon, Component.HasXmlDescriptor, Component.OptionsStyleProvider
commitActionPerformed, crossFieldValidate, justLocked, readOnly, showSaveNotification
frame, messages, UNKNOWN_CLOSE_ACTION_ID
NAME
BROWSE_WINDOW_SUFFIX, CLOSE_ACTION_ID, COMMIT_ACTION_ID, CREATE_WINDOW_SUFFIX, EDITOR_WINDOW_SUFFIX, LOOKUP_WINDOW_SUFFIX, SELECT_ACTION_ID
AUTO_SIZE, AUTO_SIZE_PX, FULL_SIZE, UNITS_PERCENTAGE, UNITS_PIXELS
WINDOW_CLOSE, WINDOW_COMMIT, WINDOW_COMMIT_AND_CLOSE
NO_OPTIONS, WINDOW_CLOSE_ACTION, WINDOW_COMMIT_AND_CLOSE_ACTION, WINDOW_DISCARD_AND_CLOSE_ACTION
Constructor and Description |
---|
UserEditor() |
Modifier and Type | Method and Description |
---|---|
protected void |
addDefaultRoles(User user) |
protected void |
createGroupField() |
protected void |
createLanguageLookup() |
protected void |
createPasswordFields(boolean isNew) |
protected void |
createTimeZoneField() |
void |
init(java.util.Map<java.lang.String,java.lang.Object> params)
Called by the framework after creation of all components and before showing the screen.
|
void |
initCopy() |
protected void |
initCustomFields(boolean isNew) |
protected void |
initNewItem(User item)
Hook to be implemented in subclasses.
|
protected void |
initUserGroup(User user) |
protected void |
postInit()
Hook to be implemented in subclasses.
|
protected boolean |
preCommit()
Hook to be implemented in subclasses.
|
protected void |
publishPasswordChangedEvent(User user,
java.lang.String newPassword) |
protected void |
publishUserSubstitutionsChanged(User user) |
protected void |
updateSessionSubstitutions(java.util.Set<Entity> committedEntities) |
afterWindowApplyPostInit, closeWithCommit, commit, commit, commitAndClose, commitInternal, getDatasourceInternal, getEditedEntity, getItem, getMetaClassForLocking, getParentDs, handlePreviouslyDeletedCompositionItems, hasUnsavedChanges, initCommitActions, isCrossFieldValidate, isLocked, isModified, isShowSaveNotification, postCommit, releaseLock, setCrossFieldValidate, setEntityToEdit, setItem, setItemInternal, setParentDs, setShowSaveNotification, validateAdditionalRules
add, add, addAction, addAction, addBeforeWindowCloseListener, addFacet, addStyleName, addTimer, afterShow, applySettings, beforeClose, closeWithDiscard, deleteSettings, expand, expand, formatMessage, getAction, getActions, getActionsPermissions, getAlignment, getCaption, getCompanion, getComponent, getComponent, getComponent, getComponents, getComposition, getContentSwitchMode, getContext, getDescription, getDialogOptions, getDsContext, getExpandDirection, getExpandRatio, getFacet, getFacets, getFocusComponent, getFrame, getFrameOwner, getHeight, getHeightSizeUnit, getIcon, getMargin, getMaxHeight, getMaxWidth, getMessage, getMessagesPack, getMinHeight, getMinWidth, getOwnComponent, getOwnComponents, getOwnComponentsStream, getParent, getScreenHashCode, getSettings, getSpacing, getStyleName, getTimer, getWidth, getWidthSizeUnit, getWindowManager, getWrappedFrame, getWrappedWindow, getXmlDescriptor, handleValidationErrors, indexOf, init, isAttributeAccessControlEnabled, isCloseable, isEnabled, isEnabledRecursive, isExpanded, isResponsive, isSameScreen, isValid, isVisible, isVisibleRecursive, postValidate, preClose, ready, remove, removeAction, removeAction, removeAll, removeAllActions, removeBeforeWindowCloseListener, removeFacet, removeStyleName, resetExpanded, saveSettings, setAlignment, setCaption, setCloseable, setCompanion, setContentSwitchMode, setDescription, setDsContext, setEnabled, setExpandRatio, setFocusComponent, setFrame, setHeight, setIcon, setIconFromSet, setId, setMargin, setMaxHeight, setMaxWidth, setMessagesPack, setMinHeight, setMinWidth, setParent, setResponsive, setSpacing, setStyleName, setVisible, setWidth, setWindow, setXmlDescriptor, showValidationErrors, unwrap, unwrapComposition, validate, validate, validateAll
addAfterCloseListener, addAfterDetachListener, addAfterInitListener, addAfterShowListener, addBeforeCloseListener, addBeforeShowListener, addInitListener, addUrlParamsChangeListener, applyDataLoadingSettings, close, closeWithDefaultAction, fireEvent, getBeanLocator, getEventHub, getExtensions, getId, getScreenData, getUiEventListeners, getWindow, isMultipleOpen, isSaveScreenHistoryOnClose, isSaveSettingsOnClose, setBeanLocator, setExtensions, setScreenData, setUiEventListeners, show
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addBeforeCloseWithCloseButtonListener, addBeforeCloseWithShortcutListener, addBeforeWindowCloseListener, addCloseListener, addCloseWithCommitListener, addListener, addTimer, applySettings, close, close, closeAndRun, deleteSettings, getContext, getDialogOptions, getFocusComponent, getFrameOwner, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getSettings, getTimer, getWindowManager, isCloseable, removeBeforeCloseWithCloseButtonListener, removeBeforeCloseWithShortcutListener, removeBeforeWindowCloseListener, removeCloseListener, removeCloseWithCommitListener, removeListener, saveSettings, setCloseable, setFocusComponent, setMaxHeight, setMaxWidth, setMinHeight, setMinWidth, validate, validateAll
addFacet, getFacet, getFacetNN, getFacets, isValid, removeFacet, validate
expand, expand, getExpandDirection, isExpanded, resetExpanded
add, getComponent, getComponentNN, indexOf
add, add, focusFirstComponent, getComponent, getComponentNN, getComponents, getOwnComponent, getOwnComponents, getOwnComponentsStream, remove, remove, removeAll
addStyleName, getAlignment, getHeight, getHeightSizeUnit, getHeightUnits, getId, getParent, getStyleName, getWidth, getWidthSizeUnit, getWidthUnits, isEnabled, isEnabledItself, isEnabledRecursive, isResponsive, isVisible, isVisibleItself, isVisibleRecursive, removeStyleName, requestFocus, setAlignment, setEnabled, setHeight, setHeightAuto, setHeightFull, setId, setParent, setResponsive, setSizeAuto, setSizeFull, setStyleName, setVisible, setWidth, setWidthAuto, setWidthFull, unwrap, unwrapComposition
getFrame, setFrame
getSpacing, setSpacing
getMargin, setMargin, setMargin, setMargin
addAction, addAction, getAction, getActionNN, getActions, getSubPart, removeAction, removeAction, removeAllActions
getIcon, setIcon, setIconFromSet
getCaption, setCaption
getDescription, setDescription
openEditor, openEditor, openEditor, openEditor, openEditor, openEditor, openEditor, openFrame, openFrame, openLookup, openLookup, openLookup, openLookup, openWindow, openWindow, showMessageDialog, showNotification, showNotification, showNotification, showOptionDialog, showOptionDialog, showWebPage
getExpandRatio, setExpandRatio
getCompanion, getContext, getDsContext, getMessagesPack, getXmlDescriptor, isValid, setDsContext, setMessagesPack, setXmlDescriptor, validate, validate, validateAll
getComponent, getComposition
getWrappedFrame
@Inject protected DsContext dsContext
@Inject protected DataSupplier dataSupplier
@Inject protected Datasource<User> userDs
@Inject protected UserManagementService userManagementService
@Inject protected CollectionDatasource<UserRole,java.util.UUID> rolesDs
@Inject protected CollectionDatasource<UserSubstitution,java.util.UUID> substitutionsDs
@Inject protected Table<UserSubstitution> substTable
@Inject protected FieldGroup fieldGroupLeft
@Inject protected FieldGroup fieldGroupRight
@Inject protected Icons icons
protected PasswordField passwField
protected PasswordField confirmPasswField
protected LookupField<java.lang.String> languageLookup
protected LookupField<java.lang.String> timeZoneLookup
@Inject protected UserSession userSession
@Inject protected UiComponents uiComponents
@Inject protected Configuration configuration
@Inject protected Metadata metadata
@Inject protected Security security
@Inject protected PasswordEncryption passwordEncryption
@Inject protected ThemeConstants themeConstants
@Inject protected TimeZones timeZones
@Inject protected Events events
protected java.lang.Boolean initCopy
public void init(java.util.Map<java.lang.String,java.lang.Object> params)
AbstractWindow
init
in class AbstractWindow
params
- parameters passed from caller's code, usually from
HasWindowManager.openWindow(String, WindowManager.OpenType)
and similar methods, or set in
screens.xml
for this registered screenprotected void updateSessionSubstitutions(java.util.Set<Entity> committedEntities)
protected void postInit()
AbstractEditor
AbstractEditor.setItem(com.haulmont.cuba.core.entity.Entity)
.
At the moment of calling the main datasource is initialized and AbstractEditor.getItem()
returns reloaded entity instance.
AbstractEditor.postCommit(boolean, boolean)
if the window is not closed after
commit. Then AbstractEditor.getItem()
contains instance, returned from DataService.commit()
.
This is useful for initialization of components that have to show fresh information from the current instance.
protected void postInit() { if (!PersistenceHelper.isNew(getItem())) { diffFrame.loadVersions(getItem()); entityLogDs.refresh(); } }
postInit
in class AbstractEditor<User>
protected void initNewItem(User item)
AbstractEditor
AbstractEditor.setItem(com.haulmont.cuba.core.entity.Entity)
when
the editor is opened for a new entity instance. Allows to additionally initialize the new entity instance
before setting it into the datasource.initNewItem
in class AbstractEditor<User>
item
- entity instanceprotected void initUserGroup(User user)
protected void addDefaultRoles(User user)
protected void initCustomFields(boolean isNew)
protected void createTimeZoneField()
protected void createGroupField()
protected void createPasswordFields(boolean isNew)
protected void createLanguageLookup()
protected boolean preCommit()
AbstractEditor
preCommit
in class AbstractEditor<User>
public void initCopy()
protected void publishUserSubstitutionsChanged(User user)
protected void publishPasswordChangedEvent(User user, java.lang.String newPassword)