Class JRibbon

java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
org.pushingpixels.flamingo.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 adde 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 big round button shown in the top left corner of the ribbon. If the setApplicationMenu(RibbonApplicationMenu) 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 a taskbar component use the addTaskbarComponent(Component) API. The taskbar panel lives to the right of the application menu button. Taskbar components can be removed with the removeTaskbarComponent(Component) API.

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 Ctrl+F1 key combination.

A minimized ribbon shows the application menu button, taskbar panel, task buttons and help button, 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: