Home » Eclipse Projects » GEF » RTL alignement with GEF editors 
| RTL alignement with GEF editors [message #164081] | 
Mon, 17 January 2005 10:02   | 
 
Eclipse User  | 
 | 
 | 
   | 
 
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    | 
 
Eclipse User  | 
 | 
 | 
   | 
 
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    | 
 
Eclipse User  | 
 | 
 | 
   | 
 
"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    | 
 
Eclipse User  | 
 | 
 | 
   | 
 
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    | 
 
Eclipse User  | 
 | 
 | 
   | 
 
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    | 
 
Eclipse User  | 
 | 
 | 
   | 
 
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   | 
 
Eclipse User  | 
 | 
 | 
   | 
 
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
 |  
 |  
  |   
Goto Forum:
 
 Current Time: Tue Nov 04 08:46:58 EST 2025 
 Powered by  FUDForum. Page generated in 0.04949 seconds  
 |