# Bidirectional Support in the Eclipse Workbench

As of Eclipse 3.1 RC2 bidirectional support will be complete are supported in JFace and the Workbench. A bidirectional language is one that can write both right to left and left to right based on context. Eclipse will recognize Hebrew, Arabic, Farsi and Urdu as bidirectional by default.

## Enabling Bidirectional Support in the SDK

The orientation of the workbench will be flipped if one of the following ways (in order of priority)

- -dir command line parameter. If the -dir command line option is used this will be the default orientation. Valid values are -dir rtl or -dir ltr.
- system properties. If the system property eclipse.orientation is set this will be used. The value is of the same format as -dir.
- -nl command line parameter. If the -nl option is used and the language is Hebrew, Arabic, Farsi or Urdu the orientation will be right to left, otherwise it will be left to right. Note this is s

These values will be used to call org.eclipse.jface.Window#setDefaultOrientation(). All subclasses of Window and the children of those windows will get the orientation specified. The default orientation is SWT#NONE.

Views and editors will by default inherit the window orientation from their parent. Dialogs should inherit orientation by using the shellStyle of their parent when setting their own by calling super#getShellStyle.

Figure 1 - Screen shot of right to left orientation of the resource perspective

## Enabling your plug-in for looking up alternate icons

In many cases your icons will not make any sense in right to left mode. In particular any icon to do with editing will have this issue.To enable lookup of images in a fragment all you need to do to nl enable $nl$ in your path and use the Platform bundle support to lookup the icons file.

For example

String iconPath = "$nl$/icons/myicon.gif";

URL url = Platform.find( Platform.getBundle(MyPluginId), new Path(iconPath));

Image Descriptor descriptor = ImageDescriptor.createFromURL(url);

If the icon reference is in your plugin.xml just make sure you have the $nl$ prefix on your path. If it is an extension point defined by the workbench the lookup will be handled for you. Just make sure if you create your own extension point that it loads ImageDescriptors this way.

## How to choose icons to override

There is no hard and fast rules for choosing which icons to override but in general you should focus on the icons that imply a textual direction with a horizontal arrow.