Skip to main content



      Home
Home » Eclipse Projects » GEF » RTL alignement with GEF editors
RTL alignement with GEF editors [message #164081] Mon, 17 January 2005 10:02 Go to next message
Eclipse UserFriend
Hi,
I'd like to make a GEF flow editor be aligned from right to left, so that
the upper right corner will be (0,0) and indexes will flow from right to
left accordingly instead of from left to right. How can I do that?

Thanks, Maya
Re: RTL alignement with GEF editors [message #164113 is a reply to message #164081] Mon, 17 January 2005 10:56 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

If you enable SWT mirroring support, this will happen internally by SWT.
But we don't support mirroring in the 3.0 release. It's not clear yet if we
will support it at all. There are lots of places where we would have to
write twice as much code to support mirrored controls, even *after* we
already have BiDi layout working for textual documents.

"Maya Barnea" <mayab@il.ibm.com> wrote in message
news:csgk2r$b0r$1@www.eclipse.org...
> Hi,
> I'd like to make a GEF flow editor be aligned from right to left, so that
> the upper right corner will be (0,0) and indexes will flow from right to
> left accordingly instead of from left to right. How can I do that?
>
> Thanks, Maya
>
Re: RTL alignement with GEF editors [message #165746 is a reply to message #164113] Wed, 26 January 2005 16:11 Go to previous messageGo to next message
Eclipse UserFriend
To get RTL display, you have to use eclipse 3.1M4 + GEF 3.1M4
When you are launching your rcp application (/or workbench) simply add
'-dir' program argument (-dir rtl or ltr) into the command line.

Stephane

Randy Hudson wrote:
> If you enable SWT mirroring support, this will happen internally by SWT.
> But we don't support mirroring in the 3.0 release. It's not clear yet if we
> will support it at all. There are lots of places where we would have to
> write twice as much code to support mirrored controls, even *after* we
> already have BiDi layout working for textual documents.
>
> "Maya Barnea" <mayab@il.ibm.com> wrote in message
> news:csgk2r$b0r$1@www.eclipse.org...
>
>>Hi,
>>I'd like to make a GEF flow editor be aligned from right to left, so that
>>the upper right corner will be (0,0) and indexes will flow from right to
>>left accordingly instead of from left to right. How can I do that?
>>
>>Thanks, Maya
>>
>
>
>
Re: RTL alignement with GEF editors [message #171768 is a reply to message #165746] Mon, 14 March 2005 16:37 Go to previous messageGo to next message
Eclipse UserFriend
What does specifying 'rtl' do exactly for the GEF editors?
By this I mean that the workbench itself is laid out in a RTL format, but
the GEF editor itself, e.g. Logic Editor, still functions in LTR mode. The
origin (0,0) is still in the top-left corner, and the text layout of Arabic
in a label is governed by LTR layout rules. For example, if I have an Arabic
phrase that starts with Arabic text, logically followed by an English word,
the proper RTL display would look like this: "house <arabic text>". However,
the Logic Editor running with the rtl option displays the label text as
"<arabic text> house".

I've been playing around with enabling my own GEF editor to be RTL. I
managed to create an RTL, mirrored editor by creating an swt GC with the
proper right-to-left style bit set. GEF 3.1M5 now creates a GC and sets it
style bit with LTR or RTL by getting the value from the control. The
problem, as far as I can see, is that the control doesn't have its LTR/RTL
style bit set anywhere.

Are RTL and mirroring two separate issues? If I run a GEF editor that is in
RTL mode, is the origin (0,0) supposed to be top-right or top-left?

If RTL implies mirroring, then is all that is required to create a proper
RTL GEF editor is to create the GC with the RTL bit set? If so, will GEF
provide this enablement in the near future?

thanks

"St
Re: RTL alignement with GEF editors [message #171791 is a reply to message #171768] Mon, 14 March 2005 17:20 Go to previous messageGo to next message
Eclipse UserFriend
"Thuc" <tqnguyen@ca.ibm.com> wrote in message
news:d15067$76d$1@www.eclipse.org...
> What does specifying 'rtl' do exactly for the GEF editors?
> By this I mean that the workbench itself is laid out in a RTL format, but
> the GEF editor itself, e.g. Logic Editor, still functions in LTR mode. The

That's right. Editors are not mirrored. I believe platform made that
decision. Try it out in the Java editor. It does the same.

> origin (0,0) is still in the top-left corner, and the text layout of
Arabic
> in a label is governed by LTR layout rules. For example, if I have an
Arabic
> phrase that starts with Arabic text, logically followed by an English
word,
> the proper RTL display would look like this: "house <arabic text>".
However,
> the Logic Editor running with the rtl option displays the label text as
> "<arabic text> house".

Set the BlockFlow's orientation to SWT.RIGHT_TO_LEFT and you'll get the
desired effect.

>
> I've been playing around with enabling my own GEF editor to be RTL. I
> managed to create an RTL, mirrored editor by creating an swt GC with the
> proper right-to-left style bit set. GEF 3.1M5 now creates a GC and sets it
> style bit with LTR or RTL by getting the value from the control. The
> problem, as far as I can see, is that the control doesn't have its LTR/RTL
> style bit set anywhere.
>
> Are RTL and mirroring two separate issues? If I run a GEF editor that is
in
> RTL mode, is the origin (0,0) supposed to be top-right or top-left?
>
> If RTL implies mirroring, then is all that is required to create a proper
> RTL GEF editor is to create the GC with the RTL bit set? If so, will GEF
> provide this enablement in the near future?
>
> thanks
>
> "St
Re: RTL alignement with GEF editors [message #171879 is a reply to message #171768] Tue, 15 March 2005 11:13 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

This is another example that the platform thinks that everything in the
world is a source editor. They have hardcoded editors to be LTR, since that
is what makes sense for java source editing. It's a bug in the workbench.

"Thuc" <tqnguyen@ca.ibm.com> wrote in message
news:d15067$76d$1@www.eclipse.org...
> What does specifying 'rtl' do exactly for the GEF editors?
> By this I mean that the workbench itself is laid out in a RTL format, but
> the GEF editor itself, e.g. Logic Editor, still functions in LTR mode. The
> origin (0,0) is still in the top-left corner, and the text layout of
> Arabic
> in a label is governed by LTR layout rules. For example, if I have an
> Arabic
> phrase that starts with Arabic text, logically followed by an English
> word,
> the proper RTL display would look like this: "house <arabic text>".
> However,
> the Logic Editor running with the rtl option displays the label text as
> "<arabic text> house".
>
> I've been playing around with enabling my own GEF editor to be RTL. I
> managed to create an RTL, mirrored editor by creating an swt GC with the
> proper right-to-left style bit set. GEF 3.1M5 now creates a GC and sets it
> style bit with LTR or RTL by getting the value from the control. The
> problem, as far as I can see, is that the control doesn't have its LTR/RTL
> style bit set anywhere.
>
> Are RTL and mirroring two separate issues? If I run a GEF editor that is
> in
> RTL mode, is the origin (0,0) supposed to be top-right or top-left?
>
> If RTL implies mirroring, then is all that is required to create a proper
> RTL GEF editor is to create the GC with the RTL bit set? If so, will GEF
> provide this enablement in the near future?
>
> thanks
>
> "St
Re: RTL alignement with GEF editors [message #172195 is a reply to message #171879] Wed, 16 March 2005 19:07 Go to previous messageGo to next message
Eclipse UserFriend
Are you referring to the EditorPart.getOrientation method, where it always
returns SWT.LEFT_TO_RIGHT? Taking the Logic editor as an example, to
recognize the orientation setting, could we simply override getOrientation()
in LogicEditor and set the orientation based on, say, the locale? I tried
this, and it seems to work fine, except for strange text behaviour.

This text behaviour is as follows:
Suppose I have the phrase "cost: 25 (USD)"
In an RTL language, assuming I don't translate the currency, I should see
"(USD) 25 :<rtl text>"

In another post, Pratik mentioned I could achieve this text layout behaviour
by setting the BlockFlow's orientation. In combination with the
getOrientation return value I mention in my first paragraph above, I see the
following results in a Logic editor label:

| BlockFlow orientation
= LTR | BlockFlow orientation = RTL

EditorPart.getOrientation = LTR | 25 :<rtl text> (USD) |
(USD) 25 :<rtl text>

EditorPart.getOrientation = RTL | (USD) <rtl text> :25 |
<rtl text> :25) USD(

Of the four results in the grid, only the top-right appears correctly. The
bottom-right result is quite bizarre.

FYI, in another editor I'm developing in GEF 3.0, I'm using a draw2d.Label
that displays the text correctly simply by using a graphics object that has
its GC style bit set to RTL.


"Randy Hudson" <none@us.ibm.com> wrote in message
news:d171id$286$1@www.eclipse.org...
> This is another example that the platform thinks that everything in the
> world is a source editor. They have hardcoded editors to be LTR, since
that
> is what makes sense for java source editing. It's a bug in the workbench.
>
> "Thuc" <tqnguyen@ca.ibm.com> wrote in message
> news:d15067$76d$1@www.eclipse.org...
> > What does specifying 'rtl' do exactly for the GEF editors?
> > By this I mean that the workbench itself is laid out in a RTL format,
but
> > the GEF editor itself, e.g. Logic Editor, still functions in LTR mode.
The
> > origin (0,0) is still in the top-left corner, and the text layout of
> > Arabic
> > in a label is governed by LTR layout rules. For example, if I have an
> > Arabic
> > phrase that starts with Arabic text, logically followed by an English
> > word,
> > the proper RTL display would look like this: "house <arabic text>".
> > However,
> > the Logic Editor running with the rtl option displays the label text as
> > "<arabic text> house".
> >
> > I've been playing around with enabling my own GEF editor to be RTL. I
> > managed to create an RTL, mirrored editor by creating an swt GC with the
> > proper right-to-left style bit set. GEF 3.1M5 now creates a GC and sets
it
> > style bit with LTR or RTL by getting the value from the control. The
> > problem, as far as I can see, is that the control doesn't have its
LTR/RTL
> > style bit set anywhere.
> >
> > Are RTL and mirroring two separate issues? If I run a GEF editor that is
> > in
> > RTL mode, is the origin (0,0) supposed to be top-right or top-left?
> >
> > If RTL implies mirroring, then is all that is required to create a
proper
> > RTL GEF editor is to create the GC with the RTL bit set? If so, will GEF
> > provide this enablement in the near future?
> >
> > thanks
> >
> > "St
Re: RTL alignement with GEF editors [message #172202 is a reply to message #172195] Wed, 16 March 2005 19:17 Go to previous messageGo to next message
Eclipse UserFriend
Seems the newsgroup program didn't like my grid, so let me try a different
format.
See my original message below.

---- top-left ----------------------------
EditorPart.getOrientation = LTR
BlockFlow orientation = LTR
"25 :<rtl text> (USD)"


---- top- right ---------------------------
EditorPart.getOrientation = LTR
BlockFlow orientation = RTL
"(USD) 25 :<rtl text>"


---- bottom-left -------------------------
EditorPart.getOrientation = RTL
BlockFlow orientation = LTR
"(USD) <rtl text> :25"


---- bottom-right -----------------------
EditorPart.getOrientation = RTL
BlockFlow orientation = RTL
"<rtl text> :25) USD("
--------------------------------------


"Thuc" <tqnguyen@ca.ibm.com> wrote in message
news:d1ahms$hht$1@www.eclipse.org...
> Are you referring to the EditorPart.getOrientation method, where it always
> returns SWT.LEFT_TO_RIGHT? Taking the Logic editor as an example, to
> recognize the orientation setting, could we simply override
getOrientation()
> in LogicEditor and set the orientation based on, say, the locale? I tried
> this, and it seems to work fine, except for strange text behaviour.
>
> This text behaviour is as follows:
> Suppose I have the phrase "cost: 25 (USD)"
> In an RTL language, assuming I don't translate the currency, I should see
> "(USD) 25 :<rtl text>"
>
> In another post, Pratik mentioned I could achieve this text layout
behaviour
> by setting the BlockFlow's orientation. In combination with the
> getOrientation return value I mention in my first paragraph above, I see
the
> following results in a Logic editor label:
>
> | BlockFlow
orientation
> = LTR | BlockFlow orientation = RTL
>
> EditorPart.getOrientation = LTR | 25 :<rtl text> (USD)
|
> (USD) 25 :<rtl text>
>
> EditorPart.getOrientation = RTL | (USD) <rtl text> :25
|
> <rtl text> :25) USD(
>
> Of the four results in the grid, only the top-right appears correctly. The

> bottom-right result is quite bizarre.
>
> FYI, in another editor I'm developing in GEF 3.0, I'm using a draw2d.Label
> that displays the text correctly simply by using a graphics object that
has
> its GC style bit set to RTL.
>
>
> "Randy Hudson" <none@us.ibm.com> wrote in message
> news:d171id$286$1@www.eclipse.org...
> > This is another example that the platform thinks that everything in the
> > world is a source editor. They have hardcoded editors to be LTR, since
> that
> > is what makes sense for java source editing. It's a bug in the
workbench.
> >
> > "Thuc" <tqnguyen@ca.ibm.com> wrote in message
> > news:d15067$76d$1@www.eclipse.org...
> > > What does specifying 'rtl' do exactly for the GEF editors?
> > > By this I mean that the workbench itself is laid out in a RTL format,
> but
> > > the GEF editor itself, e.g. Logic Editor, still functions in LTR mode.
> The
> > > origin (0,0) is still in the top-left corner, and the text layout of
> > > Arabic
> > > in a label is governed by LTR layout rules. For example, if I have an
> > > Arabic
> > > phrase that starts with Arabic text, logically followed by an English
> > > word,
> > > the proper RTL display would look like this: "house <arabic text>".
> > > However,
> > > the Logic Editor running with the rtl option displays the label text
as
> > > "<arabic text> house".
> > >
> > > I've been playing around with enabling my own GEF editor to be RTL. I
> > > managed to create an RTL, mirrored editor by creating an swt GC with
the
> > > proper right-to-left style bit set. GEF 3.1M5 now creates a GC and
sets
> it
> > > style bit with LTR or RTL by getting the value from the control. The
> > > problem, as far as I can see, is that the control doesn't have its
> LTR/RTL
> > > style bit set anywhere.
> > >
> > > Are RTL and mirroring two separate issues? If I run a GEF editor that
is
> > > in
> > > RTL mode, is the origin (0,0) supposed to be top-right or top-left?
> > >
> > > If RTL implies mirroring, then is all that is required to create a
> proper
> > > RTL GEF editor is to create the GC with the RTL bit set? If so, will
GEF
> > > provide this enablement in the near future?
> > >
> > > thanks
> > >
> > > "St
Re: RTL alignement with GEF editors [message #172488 is a reply to message #172202] Fri, 18 March 2005 11:19 Go to previous message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

Can you explain which one is correct and which one is wrong? Let's do this
in a new post so that I don't have to scroll all the way down here to find
it :-). This is important. Bidi is a major concern of ours.

"Thuc" <tqnguyen@ca.ibm.com> wrote in message
news:d1ai9e$k2o$1@www.eclipse.org...
> Seems the newsgroup program didn't like my grid, so let me try a different
> format.
> See my original message below.
>
> ---- top-left ----------------------------
> EditorPart.getOrientation = LTR
> BlockFlow orientation = LTR
> "25 :<rtl text> (USD)"
>
>
> ---- top- right ---------------------------
> EditorPart.getOrientation = LTR
> BlockFlow orientation = RTL
> "(USD) 25 :<rtl text>"
>
>
> ---- bottom-left -------------------------
> EditorPart.getOrientation = RTL
> BlockFlow orientation = LTR
> "(USD) <rtl text> :25"
>
>
> ---- bottom-right -----------------------
> EditorPart.getOrientation = RTL
> BlockFlow orientation = RTL
> "<rtl text> :25) USD("
> --------------------------------------
>
>
> "Thuc" <tqnguyen@ca.ibm.com> wrote in message
> news:d1ahms$hht$1@www.eclipse.org...
>> Are you referring to the EditorPart.getOrientation method, where it
>> always
>> returns SWT.LEFT_TO_RIGHT? Taking the Logic editor as an example, to
>> recognize the orientation setting, could we simply override
> getOrientation()
>> in LogicEditor and set the orientation based on, say, the locale? I tried
>> this, and it seems to work fine, except for strange text behaviour.
>>
>> This text behaviour is as follows:
>> Suppose I have the phrase "cost: 25 (USD)"
>> In an RTL language, assuming I don't translate the currency, I should see
>> "(USD) 25 :<rtl text>"
>>
>> In another post, Pratik mentioned I could achieve this text layout
> behaviour
>> by setting the BlockFlow's orientation. In combination with the
>> getOrientation return value I mention in my first paragraph above, I see
> the
>> following results in a Logic editor label:
>>
>> | BlockFlow
> orientation
>> = LTR | BlockFlow orientation = RTL
>>
>> EditorPart.getOrientation = LTR | 25 :<rtl text> (USD)
> |
>> (USD) 25 :<rtl text>
>>
>> EditorPart.getOrientation = RTL | (USD) <rtl text> :25
> |
>> <rtl text> :25) USD(
>>
>> Of the four results in the grid, only the top-right appears correctly.
>> The
>
>> bottom-right result is quite bizarre.
>>
>> FYI, in another editor I'm developing in GEF 3.0, I'm using a
>> draw2d.Label
>> that displays the text correctly simply by using a graphics object that
> has
>> its GC style bit set to RTL.
>>
>>
>> "Randy Hudson" <none@us.ibm.com> wrote in message
>> news:d171id$286$1@www.eclipse.org...
>> > This is another example that the platform thinks that everything in the
>> > world is a source editor. They have hardcoded editors to be LTR, since
>> that
>> > is what makes sense for java source editing. It's a bug in the
> workbench.
>> >
>> > "Thuc" <tqnguyen@ca.ibm.com> wrote in message
>> > news:d15067$76d$1@www.eclipse.org...
>> > > What does specifying 'rtl' do exactly for the GEF editors?
>> > > By this I mean that the workbench itself is laid out in a RTL format,
>> but
>> > > the GEF editor itself, e.g. Logic Editor, still functions in LTR
>> > > mode.
>> The
>> > > origin (0,0) is still in the top-left corner, and the text layout of
>> > > Arabic
>> > > in a label is governed by LTR layout rules. For example, if I have an
>> > > Arabic
>> > > phrase that starts with Arabic text, logically followed by an English
>> > > word,
>> > > the proper RTL display would look like this: "house <arabic text>".
>> > > However,
>> > > the Logic Editor running with the rtl option displays the label text
> as
>> > > "<arabic text> house".
>> > >
>> > > I've been playing around with enabling my own GEF editor to be RTL. I
>> > > managed to create an RTL, mirrored editor by creating an swt GC with
> the
>> > > proper right-to-left style bit set. GEF 3.1M5 now creates a GC and
> sets
>> it
>> > > style bit with LTR or RTL by getting the value from the control. The
>> > > problem, as far as I can see, is that the control doesn't have its
>> LTR/RTL
>> > > style bit set anywhere.
>> > >
>> > > Are RTL and mirroring two separate issues? If I run a GEF editor that
> is
>> > > in
>> > > RTL mode, is the origin (0,0) supposed to be top-right or top-left?
>> > >
>> > > If RTL implies mirroring, then is all that is required to create a
>> proper
>> > > RTL GEF editor is to create the GC with the RTL bit set? If so, will
> GEF
>> > > provide this enablement in the near future?
>> > >
>> > > thanks
>> > >
>> > > "St
Previous Topic:outline view
Next Topic:Changing EditPart color
Goto Forum:
  


Current Time: Tue Nov 04 08:46:53 EST 2025

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

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

Back to the top