Class UserMenu
java.lang.Object
com.vaadin.flow.component.Component
com.vaadin.flow.component.Composite<JmixMenuBar>
io.jmix.flowui.kit.component.usermenu.JmixUserMenu<org.springframework.security.core.userdetails.UserDetails>
io.jmix.flowui.component.usermenu.UserMenu
- All Implemented Interfaces:
com.vaadin.flow.component.AttachNotifier,com.vaadin.flow.component.BlurNotifier<JmixUserMenu<org.springframework.security.core.userdetails.UserDetails>>,com.vaadin.flow.component.DetachNotifier,com.vaadin.flow.component.Focusable<JmixUserMenu<org.springframework.security.core.userdetails.UserDetails>>,com.vaadin.flow.component.FocusNotifier<JmixUserMenu<org.springframework.security.core.userdetails.UserDetails>>,com.vaadin.flow.component.HasElement,com.vaadin.flow.component.HasEnabled,com.vaadin.flow.component.HasStyle,com.vaadin.flow.component.HasTheme,com.vaadin.flow.component.shared.HasOverlayClassName,com.vaadin.flow.component.shared.HasThemeVariant<UserMenuVariant>,HasViewMenuItems,HasSubParts,HasTitle,HasActionMenuItems,HasComponentMenuItems,HasMenuItems,HasTextMenuItems,Serializable,org.springframework.beans.factory.Aware,org.springframework.beans.factory.InitializingBean,org.springframework.context.ApplicationContextAware
public class UserMenu
extends JmixUserMenu<org.springframework.security.core.userdetails.UserDetails>
implements HasViewMenuItems, org.springframework.context.ApplicationContextAware, org.springframework.beans.factory.InitializingBean
A component that displays a user menu as a dropdown.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static classprotected static classNested classes/interfaces inherited from class io.jmix.flowui.kit.component.usermenu.JmixUserMenu
JmixUserMenu.AbstractTextUserMenuItem, JmixUserMenu.AbstractUserMenuItem, JmixUserMenu.ActionUserMenuItemImpl, JmixUserMenu.ComponentUserMenuItemImpl, JmixUserMenu.HasMenuItem, JmixUserMenu.JmixUserMenuSubMenu, JmixUserMenu.Renderer<T>, JmixUserMenu.TextUserMenuItemImpl, JmixUserMenu.UserChangedEvent<USER>Nested classes/interfaces inherited from interface com.vaadin.flow.component.BlurNotifier
com.vaadin.flow.component.BlurNotifier.BlurEvent<C extends com.vaadin.flow.component.Component>Nested classes/interfaces inherited from interface com.vaadin.flow.component.FocusNotifier
com.vaadin.flow.component.FocusNotifier.FocusEvent<C extends com.vaadin.flow.component.Component> -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected org.springframework.context.ApplicationContextprotected static final Stringprotected CurrentUserSubstitutionprotected Messagesprotected MetadataToolsprotected static final Stringprotected UiComponentsprotected UserRepositoryFields inherited from class io.jmix.flowui.kit.component.usermenu.JmixUserMenu
ATTRIBUTE_JMIX_ROLE_NAME, ATTRIBUTE_JMIX_ROLE_VALUE, BASE_CLASS_NAME, buttonRenderer, headerRenderer, headerWrapper, itemsDelegate, OVERLAY_CLASS_NAME, user, userMenuItem -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddViewItem(String id, Class<? extends View<?>> viewClass, String text) Adds a menu item associated with a specified view class and text.addViewItem(String id, Class<? extends View<?>> viewClass, String text, int index) Adds a menu item associated with a specified view class and text at a specific position.addViewItem(String id, Class<? extends View<?>> viewClass, String text, com.vaadin.flow.component.Component icon) Adds a menu item associated with a specified view class, text and icon.addViewItem(String id, Class<? extends View<?>> viewClass, String text, com.vaadin.flow.component.Component icon, int index) Adds a menu item associated with a specified view class, text and icon at a specific position.addViewItem(String id, String viewId, String text) Adds a menu item associated with a specified view id and text.addViewItem(String id, String viewId, String text, int index) Adds a menu item associated with a specified view id and text at a specific position.addViewItem(String id, String viewId, String text, com.vaadin.flow.component.Component icon) Adds a menu item associated with a specified view id, text and icon.addViewItem(String id, String viewId, String text, com.vaadin.flow.component.Component icon, int index) Adds a menu item associated with a specified view id, text and icon at a specific position.voidprotected voidprotected UserMenuItem.HasSubMenu.SubMenucreateSubMenu(JmixSubMenu subMenu) protected UserMenuItemsDelegatecreateUserMenuItemsDelegate(JmixSubMenu subMenu) protected com.vaadin.flow.component.ComponentdefaultButtonRenderer(org.springframework.security.core.userdetails.UserDetails userDetails) protected StringgenerateUserName(org.springframework.security.core.userdetails.UserDetails user) protected UserMenuItemsDelegateprotected voidprotected booleanprotected org.springframework.security.core.userdetails.UserDetailsloadUser()voidsetApplicationContext(org.springframework.context.ApplicationContext applicationContext) protected voidprotected voidMethods inherited from class io.jmix.flowui.kit.component.usermenu.JmixUserMenu
addActionItem, addActionItem, addComponentItem, addComponentItem, addComponentItem, addComponentItem, addSeparator, addSeparatorAtIndex, addTextItem, addTextItem, addTextItem, addTextItem, addTextItem, addTextItem, addTextItem, addTextItem, addUserChangedListener, createHeaderWrapper, findItem, getItem, getItems, getSubMenu, getSubPart, getUser, initContent, initUserMenuItem, isOpenOnHover, remove, remove, removeAll, setButtonRenderer, setHeaderRenderer, setOpenOnHover, setOverlayClassName, setUser, updateButton, updateHeaderMethods inherited from class com.vaadin.flow.component.Composite
getChildren, getContent, getElementMethods inherited from class com.vaadin.flow.component.Component
addListener, findAncestor, fireEvent, from, get, getEventBus, getId, getListeners, getLocale, getParent, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getUI, hasListener, isAttached, isTemplateMapped, isVisible, onAttach, onDetach, onEnabledStateChanged, removeFromParent, scrollIntoView, scrollIntoView, set, setElement, setId, setVisibleMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.vaadin.flow.component.AttachNotifier
addAttachListenerMethods inherited from interface com.vaadin.flow.component.BlurNotifier
addBlurListenerMethods inherited from interface com.vaadin.flow.component.DetachNotifier
addDetachListenerMethods inherited from interface com.vaadin.flow.component.Focusable
addFocusShortcut, blur, focus, getTabIndex, setTabIndexMethods inherited from interface com.vaadin.flow.component.FocusNotifier
addFocusListenerMethods inherited from interface com.vaadin.flow.component.HasElement
getElementMethods inherited from interface com.vaadin.flow.component.HasEnabled
isEnabled, setEnabledMethods inherited from interface io.jmix.flowui.kit.component.usermenu.HasMenuItems
addSeparator, addSeparatorAtIndex, findItem, getItem, getItems, remove, remove, removeAllMethods inherited from interface com.vaadin.flow.component.shared.HasOverlayClassName
getOverlayClassNameMethods inherited from interface com.vaadin.flow.component.HasStyle
addClassName, addClassNames, getClassName, getClassNames, getStyle, hasClassName, removeClassName, removeClassNames, setClassName, setClassNameMethods inherited from interface com.vaadin.flow.component.HasTheme
addThemeName, addThemeNames, getThemeName, getThemeNames, hasThemeName, removeThemeName, removeThemeNames, setThemeName, setThemeNameMethods inherited from interface com.vaadin.flow.component.shared.HasThemeVariant
addThemeVariants, removeThemeVariants
-
Field Details
-
SUBSTITUTED_THEME_NAME
- See Also:
-
BUTTON_CONTENT_CLASS_NAME
- See Also:
-
applicationContext
protected org.springframework.context.ApplicationContext applicationContext -
messages
-
uiComponents
-
metadataTools
-
userRepository
-
currentUserSubstitution
-
-
Constructor Details
-
UserMenu
public UserMenu()
-
-
Method Details
-
setApplicationContext
public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext) throws org.springframework.beans.BeansException - Specified by:
setApplicationContextin interfaceorg.springframework.context.ApplicationContextAware- Throws:
org.springframework.beans.BeansException
-
afterPropertiesSet
- Specified by:
afterPropertiesSetin interfaceorg.springframework.beans.factory.InitializingBean- Throws:
Exception
-
autowireDependencies
protected void autowireDependencies() -
initComponent
protected void initComponent() -
defaultButtonRenderer
@Nullable protected com.vaadin.flow.component.Component defaultButtonRenderer(@Nullable org.springframework.security.core.userdetails.UserDetails userDetails) -
loadUser
protected org.springframework.security.core.userdetails.UserDetails loadUser() -
userChangedInternal
protected void userChangedInternal()- Overrides:
userChangedInternalin classJmixUserMenu<org.springframework.security.core.userdetails.UserDetails>
-
isSubstituted
protected boolean isSubstituted() -
updateSubstitutedState
protected void updateSubstitutedState() -
generateUserName
-
addViewItem
Description copied from interface:HasViewMenuItemsAdds a menu item associated with a specified view class and text.- Specified by:
addViewItemin interfaceHasViewMenuItems- Parameters:
id- the unique identifier of the menu itemviewClass- the class of the view to associate with the menu itemtext- the text to be set for the menu item- Returns:
- the created
ViewUserMenuIteminstance
-
addViewItem
public ViewUserMenuItem addViewItem(String id, Class<? extends View<?>> viewClass, String text, int index) Description copied from interface:HasViewMenuItemsAdds a menu item associated with a specified view class and text at a specific position.- Specified by:
addViewItemin interfaceHasViewMenuItems- Parameters:
id- the unique identifier of the menu itemviewClass- the class of the view to associate with the menu itemtext- the text to be set for the menu itemindex- the position at which the menu item will be added- Returns:
- the created
ViewUserMenuIteminstance
-
addViewItem
public ViewUserMenuItem addViewItem(String id, Class<? extends View<?>> viewClass, String text, com.vaadin.flow.component.Component icon) Description copied from interface:HasViewMenuItemsAdds a menu item associated with a specified view class, text and icon.- Specified by:
addViewItemin interfaceHasViewMenuItems- Parameters:
id- the unique identifier of the menu itemviewClass- the class of the view to associate with the menu itemtext- the text to be set for the menu itemicon- the icon to be set for the menu item- Returns:
- the created
ViewUserMenuIteminstance
-
addViewItem
public ViewUserMenuItem addViewItem(String id, Class<? extends View<?>> viewClass, String text, com.vaadin.flow.component.Component icon, int index) Description copied from interface:HasViewMenuItemsAdds a menu item associated with a specified view class, text and icon at a specific position.- Specified by:
addViewItemin interfaceHasViewMenuItems- Parameters:
id- the unique identifier of the menu itemviewClass- the class of the view to associate with the menu itemtext- the text to be set for the menu itemicon- the icon to be set for the menu itemindex- the position at which the menu item will be added- Returns:
- the created
ViewUserMenuIteminstance
-
addViewItem
Description copied from interface:HasViewMenuItemsAdds a menu item associated with a specified view id and text.- Specified by:
addViewItemin interfaceHasViewMenuItems- Parameters:
id- the unique identifier of the menu itemviewId- the id of the view to associate with the menu itemtext- the text to be set for the menu item- Returns:
- the created
ViewUserMenuIteminstance
-
addViewItem
Description copied from interface:HasViewMenuItemsAdds a menu item associated with a specified view id and text at a specific position.- Specified by:
addViewItemin interfaceHasViewMenuItems- Parameters:
id- the unique identifier of the menu itemviewId- the id of the view to associate with the menu itemtext- the text to be set for the menu itemindex- the position at which the menu item will be added- Returns:
- the created
ViewUserMenuIteminstance
-
addViewItem
public ViewUserMenuItem addViewItem(String id, String viewId, String text, com.vaadin.flow.component.Component icon) Description copied from interface:HasViewMenuItemsAdds a menu item associated with a specified view id, text and icon.- Specified by:
addViewItemin interfaceHasViewMenuItems- Parameters:
id- the unique identifier of the menu itemviewId- the id of the view to associate with the menu itemtext- the text to be set for the menu itemicon- the icon to be set for the menu item- Returns:
- the created
ViewUserMenuIteminstance
-
addViewItem
public ViewUserMenuItem addViewItem(String id, String viewId, String text, com.vaadin.flow.component.Component icon, int index) Description copied from interface:HasViewMenuItemsAdds a menu item associated with a specified view id, text and icon at a specific position.- Specified by:
addViewItemin interfaceHasViewMenuItems- Parameters:
id- the unique identifier of the menu itemviewId- the id of the view to associate with the menu itemtext- the text to be set for the menu itemicon- the icon to be set for the menu itemindex- the position at which the menu item will be added- Returns:
- the created
ViewUserMenuIteminstance
-
getItemsDelegate
- Overrides:
getItemsDelegatein classJmixUserMenu<org.springframework.security.core.userdetails.UserDetails>
-