Class MenuBuilder


  • public class MenuBuilder
    extends Object
    Builder to create a Menu.
    • Constructor Detail

      • MenuBuilder

        public MenuBuilder()
    • Method Detail

      • createPath

        public void createPath​(String... path)
        Creates the provided menu path (e.g. File, Save As)
        Parameters:
        path - The path to create
      • addMenuItem

        public void addMenuItem​(MenuItem menuItem,
                                String... parentPath)
        Adds a menu item for path. If path is empty, it is added as a root entry.
        Parameters:
        menuItem - The item to add.
        parentPath - The item to add to
      • setTopLevelMenuOrder

        public void setTopLevelMenuOrder​(List<String> menuOrder)
      • setSubMenuGroupOrder

        public void setSubMenuGroupOrder​(Map<String,​List<String>> submenOrderMap)
      • determineAndApplyOrder

        protected void determineAndApplyOrder()
      • applyOrderToChildren

        protected void applyOrderToChildren​(MenuItem parent)
      • build

        public com.vaadin.ui.MenuBar build​(List<VertexRef> targets,
                                           OperationContext operationContext,
                                           Runnable... hooks)
        Converts the current menu configuration to Vaadin's MenuBar representation.
        Parameters:
        targets - The current targets (e.g. the selection)
        operationContext - The current OperationContext.
        hooks - Optional hooks to be executed after a menu item's command has been executed.
        Returns:
        The converted MenuBar
      • removeLabelProperties

        protected static String removeLabelProperties​(String commandKey)