Metadata description of the application menu of the {@link 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. There are three different types of primary entries:
- Associated {@link ActionListener} passed to the constructor of the{@link RibbonApplicationMenuEntryPrimary}. When this entry is armed (with mouse rollover or via keyboard navigation), the contents of the secondary area are cleared. The
Quit
menu item is an example of such a primary menu entry. - Associated {@link PrimaryRolloverCallback} set by the{@link RibbonApplicationMenuEntryPrimary#setRolloverCallback(PrimaryRolloverCallback)}. When this entry is armed (with mouse rollover or via keyboard navigation), the contents of the secondary area are populated by the application callback implementation of {@link PrimaryRolloverCallback#menuEntryActivated(javax.swing.JPanel)}. The
Open
menu item is an example of such a primary menu entry, showing a list of recently opened files. - Associated list of {@link RibbonApplicationMenuEntrySecondary}s added with the {@link RibbonApplicationMenuEntryPrimary#addSecondaryMenuGroup(String,RibbonApplicationMenuEntrySecondary)}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 {@link JCommandMenuButton}, but the application code does not operate on that level. Instead, the application code creates metadata-driven description of the ribbon application menu, and that description is used to create and populate the "real" controls of the application menu popup.
Note that once a {@link RibbonApplicationMenu} is set on the {@link JRibbon}with the {@link JRibbon#setApplicationMenu(RibbonApplicationMenu)}, its contents cannot be changed. An {@link IllegalStateException} will be thrownfrom {@link #addMenuEntry(RibbonApplicationMenuEntryPrimary)} and{@link #addFooterEntry(RibbonApplicationMenuEntryFooter)}.
@author Kirill Grouchnikov