Class BasicMenuBuilder

    • Constructor Detail

      • BasicMenuBuilder

        public BasicMenuBuilder​(Collection<Object> context)
        Creates a new BasicMenuBuilder with the given context.
        Parameters:
        context - the context
    • Method Detail

      • installAction

        public void installAction​(String group,
                                  Action action)
        Description copied from interface: MenuBuilder
        Install the given action into the given menu group. If the group does not exist, it will be created on the fly.
        Specified by:
        installAction in interface MenuBuilder
        Parameters:
        group - the group into which to install it
        action - the Action to install
        See Also:
        MenuBuilder.GROUP_DEFAULT
      • findSubMenu

        public MenuBuilder findSubMenu​(String id)
        Description copied from interface: MenuBuilder
        Find a MenuBuilder for an existing sub-menu. If the sub-menu does not exist, this will return null.
        Specified by:
        findSubMenu in interface MenuBuilder
        Parameters:
        id - the sub-menu's id
        Returns:
        the MenuBuilder or null, if there is no sub-menu with the given id.
      • getGroups

        public List<String> getGroups()
        Description copied from interface: MenuBuilder
        Return the (read-only) list of group names already defined.
        Specified by:
        getGroups in interface MenuBuilder
        Returns:
        a list of Strings.
      • getSubMenuIDs

        public Set<String> getSubMenuIDs()
        Description copied from interface: MenuBuilder
        Return the (read-only) list of sub-menu ids already defined.
        Specified by:
        getSubMenuIDs in interface MenuBuilder
        Returns:
        a list of Strings.
      • createContentToolbarItems

        public void createContentToolbarItems​(Bar toolbar)
        Description copied from interface: MenuBuilder
        Fills the toolbar with the installed actions and submenus. Adds separators between different groups.
        Specified by:
        createContentToolbarItems in interface MenuBuilder
        Parameters:
        toolbar - the toolbar which should be filled
      • createContextMenu

        public ContextMenu createContextMenu()
        Description copied from interface: MenuBuilder
        Creates a ContextMenu containing the installed actions and submenus. Adds a separator between different groups.
        Specified by:
        createContextMenu in interface MenuBuilder
        Returns:
        the created context menu
      • fillContextMenu

        public void fillContextMenu​(ContextMenu contextMenu)
        Description copied from interface: MenuBuilder
        Fills the ContextMenu with the installed actions and submenus. Adds a separator between different groups.
        Specified by:
        fillContextMenu in interface MenuBuilder
        Parameters:
        contextMenu - the context menu which should be filled