Interface AppMenu.MenuItem

All Known Implementing Classes:
AppMenuImpl.MenuItemImpl
Enclosing interface:
AppMenu

public static interface AppMenu.MenuItem
Menu item
  • Method Details

    • getId

      @Nullable String getId()
      Returns:
      id
    • getMenu

      AppMenu getMenu()
      Returns:
      owner
    • getCaption

      String getCaption()
      Returns:
      caption
    • setCaption

      void setCaption(String caption)
      Set item caption.
      Parameters:
      caption - caption
    • getDescription

      String getDescription()
      Returns:
      description
    • setDescription

      void setDescription(String description)
      Set description.
      Parameters:
      description - description
    • getIcon

      @Nullable String getIcon()
      Returns:
      icon name
    • setIcon

      void setIcon(@Nullable String icon)
      Set icon.
      Parameters:
      icon - icon name
    • isVisible

      boolean isVisible()
      Returns:
      true if item will be sent to the client side
    • setVisible

      void setVisible(boolean visible)
      Show or hide item.
      Parameters:
      visible - pass false to hide menu item
    • getStyleName

      String getStyleName()
      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

      void setStyleName(String styleName)
      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.
      Parameters:
      styleName - style name string
    • getCommand

      @Nullable Consumer<AppMenu.MenuItem> getCommand()
      Returns:
      item command
    • setCommand

      void setCommand(@Nullable Consumer<AppMenu.MenuItem> command)
      Set item command
      Parameters:
      command - item command
    • addChildItem

      void addChildItem(AppMenu.MenuItem menuItem)
      Add menu item to the end of children list.
      Parameters:
      menuItem - menu item
    • addChildItem

      void addChildItem(AppMenu.MenuItem menuItem, int index)
      Add menu item to specified position in the children list.
      Parameters:
      menuItem - menu item
      index - target index
    • removeChildItem

      void removeChildItem(AppMenu.MenuItem menuItem)
      Remove menu item from the children list.
      Parameters:
      menuItem - menu item
    • removeChildItem

      void removeChildItem(int index)
      Remove menu item from the children list by index.
      Parameters:
      index - index
    • getChildren

      List<AppMenu.MenuItem> getChildren()
      Returns:
      child items
    • hasChildren

      boolean hasChildren()
      Returns:
      true if the menu item has child items
    • isSeparator

      boolean isSeparator()
      Returns:
      true if item is separator