Class AppMenuImpl.MenuItemImpl

java.lang.Object
io.jmix.ui.component.mainwindow.impl.AppMenuImpl.MenuItemImpl
All Implemented Interfaces:
AppMenu.MenuItem
Enclosing class:
AppMenuImpl

protected class AppMenuImpl.MenuItemImpl extends Object implements AppMenu.MenuItem
  • Field Details

    • id

      protected String id
    • delegateItem

      protected com.vaadin.ui.MenuBar.MenuItem delegateItem
    • command

      protected Consumer<AppMenu.MenuItem> command
    • icon

      protected String icon
    • separator

      protected boolean separator
  • Constructor Details

  • Method Details

    • getId

      @Nullable public String getId()
      Specified by:
      getId in interface AppMenu.MenuItem
      Returns:
      id
    • getMenu

      public AppMenu getMenu()
      Specified by:
      getMenu in interface AppMenu.MenuItem
      Returns:
      owner
    • getDelegateItem

      public com.vaadin.ui.MenuBar.MenuItem getDelegateItem()
    • setDelegateItem

      public void setDelegateItem(com.vaadin.ui.MenuBar.MenuItem delegateItem)
    • getCaption

      public String getCaption()
      Specified by:
      getCaption in interface AppMenu.MenuItem
      Returns:
      caption
    • setCaption

      public void setCaption(String caption)
      Description copied from interface: AppMenu.MenuItem
      Set item caption.
      Specified by:
      setCaption in interface AppMenu.MenuItem
      Parameters:
      caption - caption
    • getDescription

      public String getDescription()
      Specified by:
      getDescription in interface AppMenu.MenuItem
      Returns:
      description
    • setDescription

      public void setDescription(String description)
      Description copied from interface: AppMenu.MenuItem
      Set description.
      Specified by:
      setDescription in interface AppMenu.MenuItem
      Parameters:
      description - description
    • getIcon

      @Nullable public String getIcon()
      Specified by:
      getIcon in interface AppMenu.MenuItem
      Returns:
      icon name
    • setIcon

      public void setIcon(@Nullable String icon)
      Description copied from interface: AppMenu.MenuItem
      Set icon.
      Specified by:
      setIcon in interface AppMenu.MenuItem
      Parameters:
      icon - icon name
    • isVisible

      public boolean isVisible()
      Specified by:
      isVisible in interface AppMenu.MenuItem
      Returns:
      true if item will be sent to the client side
    • setVisible

      public void setVisible(boolean visible)
      Description copied from interface: AppMenu.MenuItem
      Show or hide item.
      Specified by:
      setVisible in interface AppMenu.MenuItem
      Parameters:
      visible - pass false to hide menu item
    • getStyleName

      public String getStyleName()
      Specified by:
      getStyleName in interface AppMenu.MenuItem
      Returns:
      all user-defined CSS style names of a component. If the item has multiple style names defined, the return string is a space-separated list of style names.
    • setStyleName

      public void setStyleName(String styleName)
      Description copied from interface: AppMenu.MenuItem
      Sets one or more user-defined style names of the component, replacing any previous user-defined styles. Multiple styles can be specified as a space-separated list of style names. The style names must be valid CSS class names.
      Specified by:
      setStyleName in interface AppMenu.MenuItem
      Parameters:
      styleName - style name string
    • getCommand

      @Nullable public Consumer<AppMenu.MenuItem> getCommand()
      Specified by:
      getCommand in interface AppMenu.MenuItem
      Returns:
      item command
    • setCommand

      public void setCommand(@Nullable Consumer<AppMenu.MenuItem> command)
      Description copied from interface: AppMenu.MenuItem
      Set item command
      Specified by:
      setCommand in interface AppMenu.MenuItem
      Parameters:
      command - item command
    • addChildItem

      public void addChildItem(AppMenu.MenuItem menuItem)
      Description copied from interface: AppMenu.MenuItem
      Add menu item to the end of children list.
      Specified by:
      addChildItem in interface AppMenu.MenuItem
      Parameters:
      menuItem - menu item
    • addChildItem

      public void addChildItem(AppMenu.MenuItem menuItem, int index)
      Description copied from interface: AppMenu.MenuItem
      Add menu item to specified position in the children list.
      Specified by:
      addChildItem in interface AppMenu.MenuItem
      Parameters:
      menuItem - menu item
      index - target index
    • removeChildItem

      public void removeChildItem(AppMenu.MenuItem menuItem)
      Description copied from interface: AppMenu.MenuItem
      Remove menu item from the children list.
      Specified by:
      removeChildItem in interface AppMenu.MenuItem
      Parameters:
      menuItem - menu item
    • removeChildItem

      public void removeChildItem(int index)
      Description copied from interface: AppMenu.MenuItem
      Remove menu item from the children list by index.
      Specified by:
      removeChildItem in interface AppMenu.MenuItem
      Parameters:
      index - index
    • getChildren

      public List<AppMenu.MenuItem> getChildren()
      Specified by:
      getChildren in interface AppMenu.MenuItem
      Returns:
      child items
    • hasChildren

      public boolean hasChildren()
      Specified by:
      hasChildren in interface AppMenu.MenuItem
      Returns:
      true if the menu item has child items
    • isSeparator

      public boolean isSeparator()
      Specified by:
      isSeparator in interface AppMenu.MenuItem
      Returns:
      true if item is separator
    • setSeparator

      protected void setSeparator(boolean separator)