Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Eclipse Layout Problem on Bidi OS
Eclipse Layout Problem on Bidi OS [message #671462] Wed, 18 May 2011 01:10 Go to next message
Eclipse User is currently offline Eclipse UserFriend
Messages: 25
Registered: July 2009
Junior Member
Hi,

By default, Eclipse layout is still LTR on bidi OS such as Arabic. Seems the layout changes to RTL only if start Eclipse with '-nl ar' option. Is this by design? If yes, is there any way for the Eclipse based applications to override this behavior in the code?

Thanks.
Re: Eclipse Layout Problem on Bidi OS [message #671504 is a reply to message #671462] Wed, 18 May 2011 07:08 Go to previous messageGo to next message
Dani Megert is currently offline Dani MegertFriend
Messages: 3802
Registered: July 2009
Senior Member
On 18.05.2011 03:10, forums-noreply@eclipse.org wrote:
> Hi,
>
> By default, Eclipse layout is still LTR on bidi OS such as
> Arabic. Seems the layout changes to RTL only if start
> Eclipse with '-nl ar' option. Is this by design?
It should use the user locale set on the machine. Maybe the machine has
the Arabic OS installed but the user locale is set to something different?

Dani
> If yes, is
> there any way for the Eclipse based applications to override
> this behavior in the code?
>
> Thanks.
Re: Eclipse Layout Problem on Bidi OS [message #671767 is a reply to message #671504] Wed, 18 May 2011 23:06 Go to previous messageGo to next message
Eclipse User is currently offline Eclipse UserFriend
Messages: 25
Registered: July 2009
Junior Member
Confirmed with Eclipse team that this is by design -- e.g. the RTL layout is displayed only when Eclipse is started with '-nl ar' option on Arabic OS.

Now my question is: is there any way for the applications to override this behavior in the source code?

Thanks.
Re: Eclipse Layout Problem on Bidi OS [message #672003 is a reply to message #671767] Thu, 19 May 2011 14:35 Go to previous messageGo to next message
Dani Megert is currently offline Dani MegertFriend
Messages: 3802
Registered: July 2009
Senior Member
On 19.05.2011 01:06, forums-noreply@eclipse.org wrote:
> Confirmed with Eclipse team that this is by design -- e.g. the RTL
> layout is displayed only when Eclipse is started with '-nl ar' option
> on Arabic OS.
Yes indeed. It only takes the corresponding nl files and uses the text
processor but doesn't mirror the GUI.
>
> Now my question is: is there any way for the applications to override
> this behavior in the source code?
What are you implementing? An RCP or just a plug-in? Do you want to
override this only for your part or overall?

Dani
>
> Thanks.
Re: Eclipse Layout Problem on Bidi OS [message #672036 is a reply to message #672003] Thu, 19 May 2011 16:31 Go to previous messageGo to next message
Eclipse User is currently offline Eclipse UserFriend
Messages: 25
Registered: July 2009
Junior Member
Thanks for your reply, Dani! We are implementing an RCP. The workaround of adding '-nl ar' to the .ini file might not apply to our product since our product is an installer of itself. The installer can be downloaded to any platform.

Janice.
Re: Eclipse Layout Problem on Bidi OS [message #672272 is a reply to message #672036] Fri, 20 May 2011 13:53 Go to previous messageGo to next message
Dani Megert is currently offline Dani MegertFriend
Messages: 3802
Registered: July 2009
Senior Member
On 19.05.2011 18:31, forums-noreply@eclipse.org wrote:
> Thanks for your reply, Dani! We are implementing an RCP. The
> workaround of adding '-nl ar' to the .ini file might not apply to our
> product since our product is an installer of itself. The installer can
> be downloaded to any platform.
If you have your own RCP then you could add this in your workbench advisor:

public WorkbenchWindowAdvisor
createWorkbenchWindowAdvisor(IWorkbenchWindowConfigurer configurer) {
return new WorkbenchWindowAdvisor(configurer) {
public void preWindowOpen() {
super.preWindowOpen();
IWorkbenchWindowConfigurer wc= getWindowConfigurer();
wc.setShellStyle(SWT.RIGHT_TO_LEFT | wc.getShellStyle());
}
}
}

Of course you would always set SWT.RIGHT_TO_LEFT but do this probably
based on the user's locale.

Dani
> Janice.
Re: Eclipse Layout Problem on Bidi OS [message #672275 is a reply to message #672036] Fri, 20 May 2011 13:57 Go to previous messageGo to next message
Dani Megert is currently offline Dani MegertFriend
Messages: 3802
Registered: July 2009
Senior Member
On 19.05.2011 18:31, forums-noreply@eclipse.org wrote:
> Thanks for your reply, Dani! We are implementing an RCP.
If you have your own RCP then you could add this in your workbench advisor:

public WorkbenchWindowAdvisor
createWorkbenchWindowAdvisor(IWorkbenchWindowConfigurer configurer) {
return new WorkbenchWindowAdvisor(configurer) {
public void preWindowOpen() {
super.preWindowOpen();
IWorkbenchWindowConfigurer wc= getWindowConfigurer();
wc.setShellStyle(SWT.RIGHT_TO_LEFT | wc.getShellStyle());
}
}
}

Of course you would not always set SWT.RIGHT_TO_LEFT but do this
probably based on the user's locale.

Dani
> The workaround of adding '-nl ar' to the .ini file might not apply to
> our product since our product is an installer of itself. The installer
> can be downloaded to any platform.
> Janice.
Re: Eclipse Layout Problem on Bidi OS [message #674430 is a reply to message #672275] Thu, 26 May 2011 21:39 Go to previous messageGo to next message
Eclipse User is currently offline Eclipse UserFriend
Messages: 25
Registered: July 2009
Junior Member
Thank you, Dani!

The workaround code works after the workbench starts. But for any windows opened before the workbench starts, the layout is still LTR. For example, the progress bar on the Splash Screen, dialogs opened after "PlatformUI.createDisplay()" and before "PlatformUI.createAndRunWorkbench()". Any suggestion to those problems?

Janice.
Re: Eclipse Layout Problem on Bidi OS [message #675663 is a reply to message #674430] Wed, 01 June 2011 07:04 Go to previous messageGo to next message
Dani Megert is currently offline Dani MegertFriend
Messages: 3802
Registered: July 2009
Senior Member
On 26.05.2011 23:39, forums-noreply@eclipse.org wrote:
> Thank you, Dani!
>
> The workaround code works after the workbench starts. But for any
> windows opened before the workbench starts, the layout is still LTR.
> For example, the progress bar on the Splash Screen, dialogs opened
> after "PlatformUI.createDisplay()" and before
> "PlatformUI.createAndRunWorkbench()". Any suggestion to those problems?
You could also set the default orientation in the start method of your
application (see
org.eclipse.equinox.app.IApplication.start(IApplicationContext)) using
the following code:
Window.setDefaultOrientation(SWT.RIGHT_TO_LEFT);

Dani
>
> Janice.
icon8.gif  Re: Eclipse Layout Problem on Bidi OS [message #728352 is a reply to message #671462] Fri, 23 September 2011 05:10 Go to previous message
Shankar Ramachandran is currently offline Shankar RamachandranFriend
Messages: 6
Registered: September 2011
Junior Member
Hi,

I have a similar problem where the Application title bar and the menu bar don't come in RTL mode (Right to left mirroring) while the rest of the view does. I am using Eclipse 3.5.1 to do this and I am not sure why it is behaving this way. Is there any explicit setting that needs to be done in the Manifest/plugin.xml to get this working in RTL for the Menu and Application title bars also?

The application's view is properly displaying all contents in RTL mode and so are the dialog boxes and pop ups. Just the main screen has this problem. Please provide me with some leads. i tried the changes suggested here but they didn't help.

Thanks
Previous Topic:Copy preferences to other workspaces
Next Topic:How transform VariableDeclarationStatement to ExpressionStatement using AST
Goto Forum:
  


Current Time: Thu Apr 18 01:27:47 GMT 2024

Powered by FUDForum. Page generated in 0.02024 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top