Class RibbonApplicationMenu

  • All Implemented Interfaces:
    ChangeAware, ContentModel


    public class RibbonApplicationMenu
    extends CommandMenuContentModel
    Metadata description of the application menu of the JRibbon component. The ribbon application menu has three parts:
     +-------------------------------------+
     |           |                         |
     |           |                         |
     |  primary  |        secondary        |
     |   area    |           area          |
     |           |                         |
     |           |                         |
     |-------------------------------------|
     |            footer area              |
     +-------------------------------------+
     

    The entries in the primary area are always visible. The secondary area entries are shown based on the currently active element in the primary area. The secondary entries are Commands configured with the Command.BaseBuilder.setSecondaryContentModel(CommandMenuContentModel) API. When this entry is armed (with mouse rollover or via keyboard navigation), the secondary area shows menu buttons for the registered secondary menu entries. The Save As menu item is an example of such a primary menu item, showing a list of default save formats.

    At runtime, the application menu entries are implemented as JCommandButtons, but the application code does not operate on that level. Instead, the application code creates metadata-driven description of the ribbon application menu with Command.Builder, and those commands is used to create and populate the "real" controls of the application menu popup.

    Note that once a RibbonApplicationMenu is set on the JRibbon with the JRibbon.setApplicationMenuCommand(RibbonApplicationMenuCommandButtonProjection), its contents cannot be changed.

    • Constructor Detail

      • RibbonApplicationMenu

        public RibbonApplicationMenu​(CommandGroup commands)
      • RibbonApplicationMenu

        public RibbonApplicationMenu​(CommandGroup... commandGroups)
      • RibbonApplicationMenu

        public RibbonApplicationMenu​(java.util.List<CommandGroup> commands)
    • Method Detail

      • addFooterCommand

        public void addFooterCommand​(Command entry)
        Adds the specified footer command.
        Parameters:
        entry - Footer command to add.
        See Also:
        getFooterCommands()
      • getFooterCommands

        public CommandGroup getFooterCommands​()
        Returns the footer commands of this application menu. The result is guaranteed to be non-null.
        Returns:
        The footer commands of this application menu.
        See Also:
        addFooterCommand(Command)