Class SideMenuImpl
java.lang.Object
io.jmix.ui.component.impl.AbstractComponent<JmixSideMenu>
io.jmix.ui.component.mainwindow.impl.SideMenuImpl
- All Implemented Interfaces:
 AttachNotifier,Component,Component.BelongToFrame,Component.Focusable,Component.HasCaption,Component.HasDescription,Component.HasIcon,Component.HasXmlDescriptor,Component.Wrapper,HasContextHelp,HasDebugId,HasHtmlCaption,HasHtmlDescription,HasHtmlSanitizer,SideMenu
- 
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static classprotected static classNested classes/interfaces inherited from interface io.jmix.ui.component.Component
Component.Alignment, Component.BelongToFrame, Component.Disposable, Component.Editable, Component.Focusable, Component.HasCaption, Component.HasDescription, Component.HasIcon, Component.HasXmlDescriptor, Component.WrapperNested classes/interfaces inherited from interface io.jmix.ui.component.HasContextHelp
HasContextHelp.ContextHelpIconClickEventNested classes/interfaces inherited from interface io.jmix.ui.component.mainwindow.SideMenu
SideMenu.ItemSelectEvent, SideMenu.MenuItem - 
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Map<String,SideMenu.MenuItem> protected Componentprotected ButtonFields inherited from class io.jmix.ui.component.impl.AbstractComponent
alignment, applicationContext, component, contextHelpIconClickHandler, contextHelpIconClickListener, descriptionAsHtml, element, frame, htmlSanitizerEnabled, icon, ICON_STYLE, id, parentFields inherited from interface io.jmix.ui.component.Component
AUTO_SIZE, AUTO_SIZE_PX, FULL_SIZE - 
Constructor Summary
Constructors - 
Method Summary
Modifier and TypeMethodDescriptionAdds a listener that will be fired when leaf (non-expandable) menu item is clicked.voidaddMenuItem(SideMenu.MenuItem menuItem) Add menu item to the end of root items list.voidaddMenuItem(SideMenu.MenuItem menuItem, int index) Add menu item to specified position in the root items list.protected voidassignJTestId(SideMenu.MenuItem menuItem) protected voidassignJTestIdInternal(SideMenu.MenuItem menuItem) protected voidprotected voidcreateMenuItem(String id) Create new menu item.createMenuItem(String id, String caption) Create new menu item.createMenuItem(String id, String caption, String icon, Consumer<SideMenu.MenuItem> command) Create new menu item.voidfocus()Sets focus to this componentgetMenuItem(String id) getMenuItemNN(String id) intGets the tabulator index of theHasTabIndexcomponent.protected voidhandleAttach(com.vaadin.server.ClientConnector.AttachEvent attachEvent) booleanbooleanbooleanvoidLoad menu structure fromMenuConfigprotected voidregisterMenuItem(SideMenu.MenuItem menuItem) voidRemove all the root menu items.voidremoveMenuItem(int index) Remove menu item from the root items list by index.voidremoveMenuItem(SideMenu.MenuItem menuItem) Remove menu item from the root items list.voidsetSelectedItem(SideMenu.MenuItem selectedItem) Set selected item.voidsetSelectOnClick(boolean selectOnClick) Enable or disable automatic selected styling by click.voidsetShowSingleExpandedMenu(boolean singleExpandedMenu) Set true for collapsing a submenu when another parent menu item is clickedvoidsetSidePanel(Component sidePanel) Bind side panel for show/hide action.voidsetSidePanelToggleButton(Button toggleButton) Bind show/hide side panel action to button.voidsetTabIndex(int tabIndex) Sets the tabulator index of theFocusablecomponent.protected voidprotected voidunregisterItem(SideMenu.MenuItem menuItem) Methods inherited from class io.jmix.ui.component.impl.AbstractComponent
addAttachListener, addDetachListener, addStyleName, assignDebugId, attached, detached, getAlignment, getCaption, getComponent, getComposition, getContextHelpIconClickHandler, getContextHelpText, getDebugId, getDescription, getEventHub, getFrame, getHeight, getHeightSizeUnit, getHtmlSanitizer, getIcon, getIconName, getIconResource, getId, getParent, getStyleName, getUiComponentProperties, getUiProperties, getWidth, getWidthSizeUnit, getXmlDescriptor, hasSubscriptions, hasValidationError, isAttached, isCaptionAsHtml, isContextHelpTextHtmlEnabled, isDescriptionAsHtml, isEnabled, isEnabledRecursive, isHtmlSanitizerEnabled, isResponsive, isVisible, isVisibleRecursive, onContextHelpIconClick, publish, removeStyleName, sanitize, setAlignment, setApplicationContext, setCaption, setCaptionAsHtml, setContextHelpIconClickHandler, setContextHelpText, setContextHelpTextHtmlEnabled, setDebugId, setDescription, setDescriptionAsHtml, setEnabled, setFrame, setHeight, setHtmlSanitizerEnabled, setIcon, setIconFromSet, setId, setParent, setResponsive, setStyleName, setValidationError, setVisible, setWidth, setXmlDescriptor, unsubscribe, unwrap, unwrapComposition, unwrapCompositionOrNull, unwrapOrNull, withUnwrapped, withUnwrappedCompositionMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.jmix.ui.component.Component
addStyleName, getAlignment, getHeight, getHeightSizeUnit, getId, getParent, getStyleName, getWidth, getWidthSizeUnit, isEnabled, isEnabledRecursive, isResponsive, isVisible, isVisibleRecursive, removeStyleName, setAlignment, setEnabled, setHeight, setHeightAuto, setHeightFull, setId, setParent, setResponsive, setSizeAuto, setSizeFull, setStyleName, setVisible, setWidth, setWidthAuto, setWidthFull, unwrap, unwrapComposition, unwrapCompositionOrNull, unwrapOrNull, withUnwrapped, withUnwrappedCompositionMethods inherited from interface io.jmix.ui.component.Component.BelongToFrame
getFrame, setFrameMethods inherited from interface io.jmix.ui.component.Component.Focusable
isFocusable, setFocusable 
- 
Field Details
- 
allItemsIds
 - 
toggleButton
 - 
sidePanel
 
 - 
 - 
Constructor Details
- 
SideMenuImpl
public SideMenuImpl() 
 - 
 - 
Method Details
- 
handleAttach
protected void handleAttach(com.vaadin.server.ClientConnector.AttachEvent attachEvent)  - 
loadMenuConfig
public void loadMenuConfig()Description copied from interface:SideMenuLoad menu structure fromMenuConfig- Specified by:
 loadMenuConfigin interfaceSideMenu
 - 
setSidePanelToggleButton
Description copied from interface:SideMenuBind show/hide side panel action to button.- Specified by:
 setSidePanelToggleButtonin interfaceSideMenu- Parameters:
 toggleButton- button that should trigger show/hide of side panel
 - 
toggleSidePanel
protected void toggleSidePanel() - 
getSidePanelToggleButton
- Specified by:
 getSidePanelToggleButtonin interfaceSideMenu- Returns:
 - side panel toggle button
 
 - 
setSidePanel
Description copied from interface:SideMenuBind side panel for show/hide action.- Specified by:
 setSidePanelin interfaceSideMenu- Parameters:
 sidePanel- side panel
 - 
getSidePanel
- Specified by:
 getSidePanelin interfaceSideMenu- Returns:
 - side panel
 
 - 
isSelectOnClick
public boolean isSelectOnClick()- Specified by:
 isSelectOnClickin interfaceSideMenu- Returns:
 - true if an item becomes selected by click
 
 - 
setSelectOnClick
public void setSelectOnClick(boolean selectOnClick) Description copied from interface:SideMenuEnable or disable automatic selected styling by click.- Specified by:
 setSelectOnClickin interfaceSideMenu- Parameters:
 selectOnClick- enable/disable option
 - 
getSelectedItem
- Specified by:
 getSelectedItemin interfaceSideMenu- Returns:
 - currently selected item
 
 - 
setSelectedItem
Description copied from interface:SideMenuSet selected item.- Specified by:
 setSelectedItemin interfaceSideMenu- Parameters:
 selectedItem- new selected item
 - 
checkItemIdDuplicate
 - 
checkItemOwner
 - 
createMenuItem
Description copied from interface:SideMenuCreate new menu item. Does not add item to menu. Id must be unique for whole menu.- Specified by:
 createMenuItemin interfaceSideMenu- Parameters:
 id- item id- Returns:
 - menu item instance
 
 - 
createMenuItem
Description copied from interface:SideMenuCreate new menu item. Does not add item to menu. Id must be unique for whole menu.- Specified by:
 createMenuItemin interfaceSideMenu- Parameters:
 id- item idcaption- item caption- Returns:
 - menu item instance
 
 - 
createMenuItem
public SideMenu.MenuItem createMenuItem(String id, String caption, @Nullable String icon, @Nullable Consumer<SideMenu.MenuItem> command) Description copied from interface:SideMenuCreate new menu item. Does not add item to menu. Id must be unique for whole menu.- Specified by:
 createMenuItemin interfaceSideMenu- Parameters:
 id- item idcaption- item captionicon- iconcommand- command- Returns:
 - menu item instance
 
 - 
assignJTestId
 - 
assignJTestIdInternal
 - 
addMenuItem
Description copied from interface:SideMenuAdd menu item to the end of root items list.- Specified by:
 addMenuItemin interfaceSideMenu- Parameters:
 menuItem- menu item
 - 
registerMenuItem
 - 
unregisterItem
 - 
addMenuItem
Description copied from interface:SideMenuAdd menu item to specified position in the root items list.- Specified by:
 addMenuItemin interfaceSideMenu- Parameters:
 menuItem- menu itemindex- target index
 - 
removeMenuItem
Description copied from interface:SideMenuRemove menu item from the root items list.- Specified by:
 removeMenuItemin interfaceSideMenu- Parameters:
 menuItem- menu item
 - 
removeAllMenuItems
public void removeAllMenuItems()Description copied from interface:SideMenuRemove all the root menu items.- Specified by:
 removeAllMenuItemsin interfaceSideMenu
 - 
removeMenuItem
public void removeMenuItem(int index) Description copied from interface:SideMenuRemove menu item from the root items list by index.- Specified by:
 removeMenuItemin interfaceSideMenu- Parameters:
 index- index
 - 
getMenuItem
- Specified by:
 getMenuItemin interfaceSideMenu- Parameters:
 id- item id- Returns:
 - item from the menu tree by its id
 
 - 
getMenuItemNN
- Specified by:
 getMenuItemNNin interfaceSideMenu- Parameters:
 id- item id- Returns:
 - item from the menu tree by its id
 
 - 
getMenuItems
- Specified by:
 getMenuItemsin interfaceSideMenu- Returns:
 - root menu items
 
 - 
hasMenuItems
public boolean hasMenuItems()- Specified by:
 hasMenuItemsin interfaceSideMenu- Returns:
 - true if the menu has items
 
 - 
focus
public void focus()Description copied from interface:Component.FocusableSets focus to this component- Specified by:
 focusin interfaceComponent.Focusable
 - 
getTabIndex
public int getTabIndex()Description copied from interface:Component.FocusableGets the tabulator index of theHasTabIndexcomponent.- Specified by:
 getTabIndexin interfaceComponent.Focusable- Returns:
 - tab index set for the 
HasTabIndexcomponent 
 - 
setTabIndex
public void setTabIndex(int tabIndex) Description copied from interface:Component.FocusableSets the tabulator index of theFocusablecomponent. The tab index property is used to specify the order in which the fields are focused when the user presses the Tab key. Components with a defined tab index are focused sequentially first, and then the components with no tab index.- Specified by:
 setTabIndexin interfaceComponent.Focusable- Parameters:
 tabIndex- tab index
 - 
setShowSingleExpandedMenu
public void setShowSingleExpandedMenu(boolean singleExpandedMenu) Description copied from interface:SideMenuSet true for collapsing a submenu when another parent menu item is clicked- Specified by:
 setShowSingleExpandedMenuin interfaceSideMenu
 - 
isShowSingleExpandedMenu
public boolean isShowSingleExpandedMenu()- Specified by:
 isShowSingleExpandedMenuin interfaceSideMenu- Returns:
 - true if a submenu is collapsing when another parent menu item is clicked
 
 - 
addItemSelectListener
Description copied from interface:SideMenuAdds a listener that will be fired when leaf (non-expandable) menu item is clicked.- Specified by:
 addItemSelectListenerin interfaceSideMenu- Parameters:
 listener- a listener to add- Returns:
 - a 
Subscriptionobject 
 
 -