Class AppMenuImpl
java.lang.Object
io.jmix.ui.component.impl.AbstractComponent<JmixMenuBar>
io.jmix.ui.component.mainwindow.impl.AppMenuImpl
- All Implemented Interfaces:
AttachNotifier,Component,Component.BelongToFrame,Component.Focusable,Component.HasCaption,Component.HasDescription,Component.HasIcon,Component.HasXmlDescriptor,Component.Wrapper,HasContextHelp,HasDebugId,HasHtmlCaption,HasHtmlDescription,HasHtmlSanitizer,AppMenu
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface io.jmix.ui.component.mainwindow.AppMenu
AppMenu.MenuItemNested 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.ContextHelpIconClickEvent -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Map<String,AppMenu.MenuItem> protected IconResolverstatic final Stringprotected MenuBuilderprotected Map<com.vaadin.ui.MenuBar.MenuItem,AppMenu.MenuItem> Fields 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 TypeMethodDescriptionvoidaddMenuItem(AppMenu.MenuItem menuItem) Add menu item to the end of root items list.voidaddMenuItem(AppMenu.MenuItem menuItem, int index) Add menu item to specified position in the root items list.protected voidassignJTestIds(AppMenu.MenuItem menuItem, String id) 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<AppMenu.MenuItem> command) Create new menu item.Creates menu separatorvoidfocus()Sets focus to this componentgetMenuItem(String id) getMenuItemNN(String id) Styles implementation is client-type-specific.intGets the tabulator index of theHasTabIndexcomponent.protected voidhandleAttach(com.vaadin.server.ClientConnector.AttachEvent event) booleanvoidloadMenu()Load menu structure fromMenuConfigprotected voidregisterMenuItem(AppMenu.MenuItem menuItem) voidremoveMenuItem(int index) Remove menu item from the root items list by index.voidremoveMenuItem(AppMenu.MenuItem menuItem) Remove menu item from the root items list.voidsetMenuItemShortcutCaption(AppMenu.MenuItem menuItem, String shortcut) Sets caption to MenuItem with value of shortcut key combination.voidsetStyleName(String name) Sets one or more style names of the component, replacing any previous styles.voidsetTabIndex(int tabIndex) Sets the tabulator index of theFocusablecomponent.protected voidunregisterItem(AppMenu.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, 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, 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, getWidth, getWidthSizeUnit, isEnabled, isEnabledRecursive, isResponsive, isVisible, isVisibleRecursive, removeStyleName, setAlignment, setEnabled, setHeight, setHeightAuto, setHeightFull, setId, setParent, setResponsive, setSizeAuto, setSizeFull, 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
-
iconResolver
-
allItemsIds
-
viewModelMap
-
MENU_STYLENAME
- See Also:
-
Constructor Details
-
AppMenuImpl
public AppMenuImpl()
-
-
Method Details
-
handleAttach
protected void handleAttach(com.vaadin.server.ClientConnector.AttachEvent event) -
setStyleName
Description copied from interface:ComponentSets one or more style names of the component, replacing any previous styles. Multiple styles can be specified as a space-separated list of style names. Styles implementation is client-type-specific.- Specified by:
setStyleNamein interfaceComponent- Overrides:
setStyleNamein classAbstractComponent<JmixMenuBar>- Parameters:
name- one or more style names separated by space.
-
getStyleName
Description copied from interface:ComponentStyles implementation is client-type-specific.- Specified by:
getStyleNamein interfaceComponent- Overrides:
getStyleNamein classAbstractComponent<JmixMenuBar>- Returns:
- current style name.
-
loadMenu
public void loadMenu()Description copied from interface:AppMenuLoad menu structure fromMenuConfig -
createMenuItem
Description copied from interface:AppMenuCreate new menu item. Does not add item to menu. Id must be unique for whole menu.- Specified by:
createMenuItemin interfaceAppMenu- Parameters:
id- item id- Returns:
- menu item instance
-
createMenuItem
Description copied from interface:AppMenuCreate new menu item. Does not add item to menu. Id must be unique for whole menu.- Specified by:
createMenuItemin interfaceAppMenu- Parameters:
id- item idcaption- item caption- Returns:
- menu item instance
-
createMenuItem
public AppMenu.MenuItem createMenuItem(String id, String caption, @Nullable String icon, @Nullable Consumer<AppMenu.MenuItem> command) Description copied from interface:AppMenuCreate new menu item. Does not add item to menu. Id must be unique for whole menu.- Specified by:
createMenuItemin interfaceAppMenu- Parameters:
id- item idcaption- item captionicon- iconcommand- command- Returns:
- menu item instance
-
assignJTestIds
-
addMenuItem
Description copied from interface:AppMenuAdd menu item to the end of root items list.- Specified by:
addMenuItemin interfaceAppMenu- Parameters:
menuItem- menu item
-
addMenuItem
Description copied from interface:AppMenuAdd menu item to specified position in the root items list.- Specified by:
addMenuItemin interfaceAppMenu- Parameters:
menuItem- menu itemindex- target index
-
registerMenuItem
-
removeMenuItem
Description copied from interface:AppMenuRemove menu item from the root items list.- Specified by:
removeMenuItemin interfaceAppMenu- Parameters:
menuItem- menu item
-
removeMenuItem
public void removeMenuItem(int index) Description copied from interface:AppMenuRemove menu item from the root items list by index.- Specified by:
removeMenuItemin interfaceAppMenu- Parameters:
index- index
-
unregisterItem
-
getMenuItem
- Specified by:
getMenuItemin interfaceAppMenu- Parameters:
id- item id- Returns:
- item from the menu tree by its id
-
getMenuItemNN
- Specified by:
getMenuItemNNin interfaceAppMenu- Parameters:
id- item id- Returns:
- item from the menu tree by its id
-
getMenuItems
- Specified by:
getMenuItemsin interfaceAppMenu- Returns:
- root menu items
-
hasMenuItems
public boolean hasMenuItems()- Specified by:
hasMenuItemsin interfaceAppMenu- Returns:
- true if the menu has items
-
checkItemIdDuplicate
-
checkItemOwner
-
createSeparator
Description copied from interface:AppMenuCreates menu separator- Specified by:
createSeparatorin interfaceAppMenu
-
setMenuItemShortcutCaption
Description copied from interface:AppMenuSets caption to MenuItem with value of shortcut key combination.- Specified by:
setMenuItemShortcutCaptionin interfaceAppMenu- Parameters:
menuItem- MenuItem instanceshortcut- shortcut key combination string representation
-
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
-