Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 82951

Summary: BIDI:Eclipse editors should be RTL except those that are generally used for typing English text
Product: [Eclipse Project] Platform Reporter: Emad Al-Agouz <agouz>
Component: UIAssignee: Tod Creasey <Tod_Creasey>
Status: CLOSED FIXED QA Contact:
Severity: major    
Priority: P2 CC: aboualy, camle, Ed.Merks, jeffliu, kai-uwe_maetzel, Kenn.Hussey, semion, steven.wasleski, Tod_Creasey
Version: 3.1   
Target Milestone: 3.1 M6   
Hardware: PC   
OS: Windows 2000   
Whiteboard:
Bug Depends on:    
Bug Blocks: 82067, 86326, 86328    

Description Emad Al-Agouz CLA 2005-01-17 05:07:08 EST
Tested on Win2K Arabic default locale, Version: 3.1.0 Build id: I20050111-1300 
with Arabic Translation Fragments and launched with rtl direction.

Generally all editors in the Arabic translated Eclipse must be RTL oriented, 
except for the following editors will be accepted LTR since they are generally 
used for typing English text:
1.Java editor 
2.Java Visual editor
3.C/C++ editor
4.Make file editor 
5.XML editor
6.Properties File editor

And the following Views:
1.Console (Java Perspective & C/C++ Perpective)
2.Declaration (Java Perspective)

Please take the appropriate action to apply the requested changes.
Comment 1 Semion Chichelnitsky CLA 2005-01-17 09:28:23 EST
Tod, I think, we need "hardcoded" orientation only in the level of pure text 
editors. In addition we can ask orientation of each editor, which is added to 
the MultiPageEditorPart - if it is text editor, it should appear ltr.
We suggest:
1) remove method getOrientation() from EditorPart
2) add this method (witch returns SWT.LEFT_TO_RIGHT) to AbstractTextEditor
3) change method MultiPageEditorPart.addPage(IEditorPart editor, IEditorInput 
input), for example, as following:
...
        int orient = SWT.NONE;
        if (editor instanceof WorkbenchPart)
        	orient = ((WorkbenchPart)editor).getOrientation();
        Composite parent2 = new Composite(getContainer(), orient);
...
Comment 2 Tod Creasey CLA 2005-01-17 10:45:40 EST
This us a UI/Text issue not SWT (they just provide the widgets).

The text editors are owned by Text but I want to make the right decision here -
 right now this can be overridden easily enough if required.

What about graphical editors for instance? What would be the right decision 
there? I think LTR as a general default is a good idea as editors are not 
designed generally to handle both and should only say they support RTL if they 
have actually tried it.
Comment 3 Semion Chichelnitsky CLA 2005-01-17 11:44:22 EST
AbstractTextEditor is subclass of EditorPart, it inherits method getOrientation
() and can override it. From this point of view it is SWT Composite. 

Note,we try to find the "not very bad" solution for GUI, that currently can't 
be mirrored in runtime - therefore solution can't be good enough. It is 
correct, that getOrientation() method was added with purpose to override it, 
when it is needed. Question here - where it can be overriden by the most 
simple way? Using current solution, what we can do with translated contents of 
multi-page editors?
Comment 4 Steve Northover CLA 2005-01-19 20:30:16 EST
getOrientation() is not meant to be overridden.
Comment 5 Semion Chichelnitsky CLA 2005-01-20 03:37:29 EST
This is getOrientation() from WorkbenchPart, and it is already overriden (see 
EditorPart).
Comment 6 Kenn Hussey CLA 2005-01-20 11:53:54 EST
*** Bug 82946 has been marked as a duplicate of this bug. ***
Comment 7 Tod Creasey CLA 2005-01-24 10:31:24 EST
I think the other thing we need to consider is the option for a user overide. 
I'll use the TextEditor as an example.

I could use it for either reading a Java file (in which case I would want LTR) 
or reading some notes for a colleague in Egypt in Arabic (RTL).

We would need a way for the user to go into the Editors preference page and 
set the orientation based on how they use an editor.

This would solve my concern about flipping an editor and making it unusable 
(as the user could flip it back).  So I think Semions suggestion is less risky 
if we do this.
Comment 8 Semion Chichelnitsky CLA 2005-01-24 11:44:52 EST
From my point of view, only dynamic orientation change can make editor really 
useable for bidi users. But we have what we have. As far as I understand, if 
editor is already loaded, change in the preferences page can't help - is this 
correct? Do you mean, that we need preferences page for each editor? What do 
you think about properties, which can be set/edit by user before start eclipse 
('key' can be id of editor or view)? If such property will be, as usually, 
merged with system properties, every plugin will receive ability to change it 
even in the runtime... Again, it can't help, if view or editor is already 
loaded.
Comment 9 Emad Al-Agouz CLA 2005-02-03 07:31:19 EST
The GEF Flow Diagram editor is not RTL mirrored in the N20050203-0010 build.
And this editor affects the translation support in another product.
Please provide fast RTL orientation support for this editor.
Comment 10 Tod Creasey CLA 2005-02-03 07:36:54 EST
Emad please log a problem report to the GEF component as we do not handle that 
editor
Comment 11 Tod Creasey CLA 2005-02-23 13:38:58 EST
I have implemented this as suggested - i.e. editors will take the default
orientaton now unless overridden by getOrientation.

Ficed in build >20050223
Comment 12 Emad Al-Agouz CLA 2005-03-16 07:56:07 EST
Tested on Build I20050315-1100....
The Java Editor is the only editor from the list of editors that is LTR 
oriented.
Please Take the appropriate action to apply LTR orientation on the other 
editors listed in the description...
Note that by including XML editor we also address similar editors(HTML, XSD 
editors,etc...)
Comment 13 Tod Creasey CLA 2005-03-16 08:49:17 EST
Emad we need to have these components know individually about the need to slip
orientation - if you find one that needs to be retored to LTR please log a new
report (the other teams don't track Platform UI reports).
Comment 14 Randy Hudson CLA 2005-03-16 10:16:27 EST
*** Bug 84323 has been marked as a duplicate of this bug. ***
Comment 15 Emad Al-Agouz CLA 2005-03-17 03:07:33 EST
The XML and HTML editors need to be LTR oriented...
Please apply the changes needed on these two editors...
Comment 16 Tod Creasey CLA 2005-03-17 08:31:26 EST
Emad we need to have these components know individually about the need to flip
orientation - please log a report to whoever supplies the xml and html editors
you found (the platform does not have any). 

I need to leave this one fixed to make sure that it gets picked up in our M6
test pass for the platform. Please do not reopen it.
Comment 17 Randy Hudson CLA 2005-03-17 09:46:22 EST
*** Bug 84323 has been marked as a duplicate of this bug. ***
Comment 18 Emad Al-Agouz CLA 2005-03-22 04:43:53 EST
Closed...