The command button component is a central building block for the Flamingo component suite. It aims to address the deficiencies of the core Swing button components, adding features expected by the modern applications. While the main goal of Flamingo is to provide a pure Java implementation of the Office 2007 ribbon container, the command buttons can certainly be used outside the ribbon.

The latest 4.2dev drop of the core Flamingo library and 6.0dev drop of the Substance Flamingo plugin provide support for command buttons that have no text and/or no icon. This is a big step forward that positions the Flamingo command button as a drop-in replacement for core Swing buttons, and here are a few screenshots to illustrate these new capabilities.

Here is a screenshot of a few command buttons that have both text and icon:

https://flamingo.dev.java.net/release-info/4.2/command-buttons-icon-and-text1.png

Here, the rows show the functionally equivalent command buttons that arrange the text and icon in different layouts – addressing the varying space available to host the specific button. The first column shows action buttons – clicking anywhere on a button will activate the registered listeners. The second column shows split buttons – clicking on icon / text will activate the listeners, while clicking on the drop arrow will show the popup menu.

The next screenshot shows text / icon command buttons of the other two kinds:

https://flamingo.dev.java.net/release-info/4.2/command-buttons-icon-and-text2.png

The first column shows another type of split button – where the popup menu is shown when the text is clicked (as opposed to the first split button type where clicking the text activates the main action). The second column is a menu button – clicking anywhere shows the popup menu.

The next two screenshots show the same button arrangement, but this time for buttons with no icons:

https://flamingo.dev.java.net/release-info/4.2/command-buttons-no-icon1.png

https://flamingo.dev.java.net/release-info/4.2/command-buttons-no-icon2.png

And the final screenshot shows the same button arrangement, but this time for buttons with no texts:

https://flamingo.dev.java.net/release-info/4.2/command-buttons-no-text.png

As mentioned in the JavaOne presentation on the Flamingo ribbon component, there are a few small features missing in the Swing implementation. The first drop of version 4.2dev (code-named Hiolair) now provides support for placing small command buttons in ribbon galleries.

A ribbon gallery is a compact way to display a large number of buttons that control the specific visual appearance of the selected document element. The ribbon gallery fits itself to the available horizontal space, and allows two navigation modes:

  • Using the scroll-up and scroll-down buttons to view additional button rows inside the ribbon itself
  • Using the expand button to view all the buttons in a scrollable popup

Here is how a ribbon gallery hosting big command buttons looks like:

And when it is expanded (with the bottom-right button), it looks like this:

Up until now the ribbon has supported placing only big buttons in ribbon galleries. Starting with version 4.2, the new JRibbonBand.addRibbonGallery that gets the CommandButtonDisplayState as one of the parameters can be used to create a ribbon gallery that hosts small command buttons. The following display states are supported:

  • JRibbonBand.BIG_FIXED_LANDSCAPE – this is the default display state. The buttons display big icon and text below it, and the buttons have fixed 5:4 ratio when displayed in the popup.
  • JRibbonBand.BIG_FIXED. The buttons display big icon and text below it, and the buttons have fixed 1:1 ratio when displayed in the popup.
  • CommandButtonDisplayState.SMALL. The buttons display only small icon with no text.

Here is a ribbon gallery that hosts small command buttons (in three rows):

And this is how it looks when it is expanded:

You’re more than welcome to take the first drop of version 4.2dev for a spin. You can also play with the WebStart demo of the ribbon under Substance look-and-feel by clicking on the button below. Switch to “Animations” task for a ribbon gallery with small command buttons.

I’ve just finished presenting my JavaOne session on the ribbon component. Thanks to everybody for coming. To all of you who attended but want to see the slides once again, and to those of you who couldn’t attend, here are the slides:

Since there were no animations in the slides, the two versions should be identical.

The test applications shown in the session can be found in the test.* package of Flamingo and Substance Flamingo distribution archives.

I am pleased today to announce the availability of the final release for version 4.1 of Flamingo component suite (code-named Guenivere). It is a stabilization release that adds a few minor features and fixes all known bugs.

Here is the list of minor features added in release 4.1:

  • Multi-row controls in ribbon bands
  • Rich tooltips for ribbon band expand buttons
  • Horizontal alignment for wrapped ribbon components
  • Internal tracking of disabled state of popup / action areas on command buttons for selecting the correct displayed icon
  • Tree breadcrumb adapter class is now abstract to enforce applications to provide the segment caption

To see the Flamingo ribbon component in action under core look-and-feels, run the following WebStart demo:

To see the Flamingo ribbon component in action under Substance look-and-feel, run the following WebStart demo:

If you want to test the ribbon in your applications, you would need the following (the last two only for applications running under Substance look-and-feel):

You are more than welcome to take Flamingo 4.1 for a ride and report any problems in the project mailing lists, forums or issue tracker.

Release 4.1 will be the base for the JavaOne technical session 4143 that will be held next Thursday, June 4th at 13:30 in Hall E 135. If you’re interested to hear about the ribbon and the Swing implementation, as well as in a few ribbon tricks that you might not be aware about, please drop by.