Right-to-left support for command buttons in Flamingo 5.0

March 26th, 2010

With Substance 6.0 in release candidate stage, it’s time to go back and work on the missing features in the Flamingo component suite. As mentioned in the JavaOne ’09 presentation on the project, there are a few features missing in the Swing implementation, and today i’m going to talk about supporting right-to-left orientation on command buttons and related components.

Four RTL languages are supported in Java: Hebrew, Arabic, Farsi, and Urdu. Substance provides full RTL support for core Swing components, and you can see older entries (Aligning menu items in Swing applications – welcome to the real world and RTL support in Swing – part II) for a glimpse of RTL-related issues. The latest drop of Flamingo 5.0 (code-named Imogene) has added RTL support to the following components:

  • Command buttons
  • Command button strips
  • Command button panels
  • Command menu buttons
  • Command popup menus

RTL support is best illustrated by screenshots, so let’s begin (and yes, the Hebrew texts are notjust gibberish if you were wondering). The first screenshot shows a number of command buttons with different states and kinds (see the JavaOne presentation for more info) under the en_US locale – click for a full size image:

and here are the same buttons under iw_IL locale (with the matching texts) – click for a full size image:

The next screenshot shows a command button with a simple popup containing a few command menu buttons and a separator under en_US locale:


and the same button + menu under iw_IL locale:


Flamingo provides an API to embed a command button panel into the popup menu. Here is how such a menu looks like under en_US locale:


and the same rich popup menu under iw_IL locale:


Command button panels can be used as standalone containers. Here is a button panel with row-fill layout and group titles under en_US locale:


and the same button panel under iw_IL locale (note the order of the buttons):


Command button panel can be configured to use column fill layout:


and it is fully supported in RTL mode (note the order of buttons and groups):


This is the first step towards full RTL support in all Flamingo components. Stay tuned for more. To test the new functionality in your applications, you will need the following:

Note that the last two are required if you’re running your application under one of Substance skins – such as Office Blue 2007 used in all the screenshots in this entry.