Class RibbonApplicationMenu
- java.lang.Object
-
- org.pushingpixels.radiance.component.api.common.model.CommandMenuContentModel
-
- org.pushingpixels.radiance.component.api.ribbon.RibbonApplicationMenu
-
- All Implemented Interfaces:
BaseCommandMenuContentModel
,ChangeAware
,ContentModel
public class RibbonApplicationMenu extends CommandMenuContentModel
Metadata description of the application menu of theJRibbon
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
Command
s configured with theCommand.Builder#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. TheSave 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
JCommandButton
s, but the application code does not operate on that level. Instead, the application code creates metadata-driven description of the ribbon application menu withCommand.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 theJRibbon
with theJRibbon.setApplicationMenuCommand(RibbonApplicationMenuCommandButtonProjection)
, its contents cannot be changed.
-
-
Field Summary
Fields Modifier and Type Field Description private CommandGroup
footerCommands
Footer commands.
-
Constructor Summary
Constructors Constructor Description RibbonApplicationMenu(java.util.List<CommandGroup> commands)
RibbonApplicationMenu(CommandGroup commands)
RibbonApplicationMenu(CommandGroup... commandGroups)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addFooterCommand(Command entry)
Adds the specified footer command.CommandGroup
getFooterCommands()
Returns the footer commands of this application menu.boolean
isEmpty()
-
Methods inherited from class org.pushingpixels.radiance.component.api.common.model.CommandMenuContentModel
addChangeListener, addCommandGroup, getCommandGroups, getHighlightedCommand, getPanelContentModel, removeAllCommandGroups, removeChangeListener, removeCommandGroup, setHighlightedCommand
-
-
-
-
Field Detail
-
footerCommands
private CommandGroup footerCommands
Footer commands.
-
-
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)
-
isEmpty
public boolean isEmpty()
- Specified by:
isEmpty
in interfaceBaseCommandMenuContentModel
- Overrides:
isEmpty
in classCommandMenuContentModel
-
-