java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
org.pushingpixels.radiance.component.api.ribbon.JRibbon
All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable

public class JRibbon extends JComponent
The ribbon component.

The ribbon has the following major parts:

While multiple ribbon tasks can be added to the ribbon, only one is visible at any given time. This task is called the selected task. Tasks can be switched with the task buttons placed along the top part of the ribbon. Once a task has been added to the ribbon, it cannot be removed.

The contextual ribbon task groups allow showing and hiding ribbon tasks based on the current selection in the application. For example, Word only shows the table tasks when a table is selected in the document. By default, tasks belonging to the groups added by addContextualTaskGroup(RibbonContextualTaskGroup) are not visible. To show the tasks belonging to the specific group, call setVisible(RibbonContextualTaskGroup, boolean) API. Note that you can have multiple task groups visible at the same time.

The application menu button is a rectangular button shown in the top left corner of the ribbon. If the setApplicationMenuCommand(RibbonApplicationMenuCommandButtonProjection) is not called, or called with the null value, the application menu button is not shown, and ribbon task buttons are shifted to the left.

The taskbar panel allows showing controls that are visible no matter what ribbon task is selected. To add content to taskbar, use the addTaskbarCommand(BaseCommandButtonProjection), addTaskbarGalleryDropdown(RibbonGalleryProjection) and addTaskbarComponent(ComponentProjection) APIs. The taskbar panel lives in the top-left corner of the application frame.

The ribbon can be minimized in one of the following ways:

  • Calling setMinimized(boolean) with true.
  • User double-clicking on a task button.
  • User pressing Meta+Alt+R key combination on a Mac machine or Ctrl+F1 key combination on a non-Mac machine.

A minimized ribbon shows the application menu button, taskbar panel, task buttons and anchored contet, but not the ribbon bands of the selected task. Clicking a task button shows the ribbon bands of that task in a popup without shifting the application content down.

See Also: