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

Bug 82947

Summary: [BiDi] Mutli page editors need mixed BIDI support
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: douglas.pollock, Ed.Merks, Kenn.Hussey, salexb, semion, steven.wasleski
Version: 3.1   
Target Milestone: 3.1 M6   
Hardware: PC   
OS: Windows 2000   
Whiteboard:
Attachments:
Description Flags
LTR and RTL pages of multi-page editor none

Description Emad Al-Agouz CLA 2005-01-17 04:32:53 EST
Tested on Win2K Arabic default locale, Version: 3.1.0 Build id: I20050111-1300 
with Arabic Translation Fragments and launched with rtl direction.
-Select window>Open perspective>Plug-in development perspective
-Create a new Plug-in or fragment or feature project.
-Open the generated XML file
-Observe that the editor is LTR oriented.

The three editors are not displayed RTL. Please  provide RTL support for :
- Feature manifest editor.
- Plug-in manifest editor.
- Properties file editor.
Comment 1 Emad Al-Agouz CLA 2005-01-17 04:46:43 EST
The same behaviour occurs with the build properties editor.
(To open this editor simply open the generated build.properties file)
Comment 2 Dejan Glozic CLA 2005-01-20 11:59:54 EST
PDE team, please check how we create the source editor page. I suspect that we 
don't pass some important data to the source editor that would allow it to go 
into the BIDI mode. Eclipse Forms don't handle source in any interesting way.

If you find out that MultiPageEditorPart is causing the problem, route this 
defect back to the Platform UI.
Comment 3 Dejan Glozic CLA 2005-01-20 12:13:23 EST
Upon further investigation done by Ed, it seems that this style is inherited 
by the new API 'getOrientation()' on EditorPart that is set to LEFT_TO_RIGHT 
by default. 

Returning to Platform UI for comments. Is the default correct and if not, what 
should be done?
Comment 4 Tod Creasey CLA 2005-01-20 15:51:17 EST
Yes the default is correct. We are overriding on a editor by editor basis.

If you think a particular editor should be overridden then the editor owner 
can change that.
Comment 5 Ed Merks CLA 2005-01-20 15:55:14 EST
I feel strongly that this is wrong.  An editor that doesn't want to pick up the
workbench default setting should explicitly override to not use it, rather than
to force all editors to jump through hoops just to pick up the workbench
default.  What is the justification for this design?
Comment 6 Tod Creasey CLA 2005-01-20 16:27:22 EST
The issue is the case where someone has designed thier editor with BIDI in 
mind or not. If the editor was designed LTR only and we go and flip 
orientations on them it may not be useful anymore. A good example is the Java 
editor which is pretty clearly best left RTL.

If someone has gone to the trouble to check this out they can implement the 
method. What we want to avoid is RTL user being forced into not using RTL 
because some of thier editors are useless in that orientation. 

 
Comment 7 Ed Merks CLA 2005-01-20 16:45:55 EST
This statement just argues that the JavaEditor should force LEFT_TO_RIGHT
regardless of the workbench setting because it can't support RIGHT_TO_LEFT, not
that every editor should be assumed not to support RIGHT_TO_LEFT and hence every
editor should take action to make normal inheritance from the container work.

It's interesting to note that any editor that uses a multipage editor should at
least have its tabs right to left if not the contents within the tabs. Any other
behavior is simply wrong and having wrong default behavior is not really
justifiable.

So I still feel very strongly that a hard coded LEFT_TO_RIGHT default for all
editors is inappropriate. I did not design any of my (EMF) GUI with
RIGHT_TO_LEFT in mind yet everything, including wizards, dialogs, the overviews,
work, BUT NOT the editor.  

Please reconsider.
Comment 8 Tod Creasey CLA 2005-01-20 16:56:11 EST
>This statement just argues that the JavaEditor should force LEFT_TO_RIGHT
>regardless of the workbench setting because it can't support RIGHT_TO_LEFT, 
>not that every editor should be assumed not to support RIGHT_TO_LEFT and 
>hence every editor should take action to make normal inheritance from the 
>container work.

Perhaps the Java Editor was not my best example. The case I am concerned about 
is that a user who had been happily using an editor in the pre-BIDI days wants 
to take advantage of the new BIDI features but they cannot because the editor 
does not work in this case.

There is little the user can do about it except to turn the BIDI support off. 
As the workbench is a framework we have to make decisions based on backwards 
compatibility in an unbounded space - i.e. I have no idea about all of the 
editors out there currently so I must assume the case I mention above is 
possible.

When we first put the BIDI support in many Hebrew users were upset because we 
were too aggressive with changing orientation because thier work environment 
was set up for that. If this feature has to be abandoned by someone because of 
compatibility issues we will have made the wrong decision.
Comment 9 Semion Chichelnitsky CLA 2005-01-23 05:53:02 EST
This problem is described in general in the bug 82951, and there can be found 
some of our suggestions. "Problematical" editor from this bug can be used as a 
good example for them.
Plug-in manifets editor is multi-page editor, which contains 8 pages. First 6 
pages are not editors(it means, they are not WorkbenchParts) and generally 
speaking they are simply containters(Composites) with more or less complicated 
contents. Text from these pages can be translated, therefore it will be 
correct, if they will inherit orientation from workbench window. 2 remaining 
pages contain real text editors, which should not be rtl (at list by default). 
It will be correct for these 2 pages, if they will be loaded with ltr 
orientation.
We already have mechanism, which allows us to load "mono-page" editors with 
editor-specific orientation. We need to use the same mechanism for loading 
editors on the pages of multi-page editor:
In MultiPageEditorPart.addPage(IEditorPart editor, IEditorInput 
input):
...
        int orient = SWT.NONE;
        if (editor instanceof WorkbenchPart)
        	orient = ((WorkbenchPart)editor).getOrientation();
        Composite parent2 = new Composite(getContainer(), orient);
...

In addition, we need override WorkbenchPart.getOrientation(), and not in the 
superclass of all editors - EditorPart - but in the superclasses of such 
editors, wich are designed as LTR only or should be LTR by the default. The 
best candidates for this, as far as I currently see, are AbstractTextEditor 
and GraphicalEditor. Expected results are: all text and visual editors are 
ltr, just as all other inherit orientation from workbench window. The next 
step can be searching the editors, which should not use these rules and adding 
to them methods getOrientation() with specific return.
Using suggestions below, in the case of plug-in manifets editor and with rtl 
orientation of workbench we will receive 6 pages (which contain collections of 
labels, text entries, tabels, trees etc.) with rtl orientation, and  "real" 
text editors in the remaining two pages in ltr orientation. As far as I 
understand, it is exactly, what we need.
Comment 10 Semion Chichelnitsky CLA 2005-01-23 06:00:15 EST
Created attachment 17381 [details]
LTR and RTL pages of multi-page editor
Comment 11 Tod Creasey CLA 2005-01-24 10:32:55 EST
I have added comments on the general editor issue to Bug 82951. Ed you likely 
will be interested in the discussion there.

I have renamed this report so that we can use it to focus on the MPE issues 
here and the general orientation issues in Bug 82951.
Comment 12 Jonathan Simpson CLA 2005-02-09 15:49:45 EST
Any progress on this bug?
Comment 13 Tod Creasey CLA 2005-02-23 13:33:54 EST
I have implemented essentially what Semion suggested in build >20050223
Comment 14 Emad Al-Agouz CLA 2005-03-16 08:06:33 EST
 Verified on build I20050315-1100
Closing...