Community
Participate
Working Groups
Description: When launching Eclipse with RTL dir, a java file stays in LTR direction (which is good). However, when using the "Compare with" function, the source code file is shown in RTL direction. It should be also displayed in LTR direction since it contains source code. Scenario: 1. Run Eclipse using -rtl attribute. 2. Create a Java class. 3. Verify it opens in editor in LTR dir. 4. Right click on the class name and select "Compare with -> Local history" Result: The compare wizard is displayed the file in RTL orientation in both sides. Note: There is another problem regarding this wizard: If the file contains long lines thus the java source compare windows have horizontal scroolbar, the text is being curropted once one drag the scrollbar to the left and back to the right. Sometimes it should be done several times in order to see the curruption text. An attachment is to be attached.
Created attachment 35397 [details] Screenshot describes the curroption occured in text when using the scrollbar
Okay, not sure UI is the right component. The editor in the view is not being created with the right flags. Amir, when the first problem is fixed you probably won't see the pixel corruption anymore. But I think you should open separated problem report to make sure the problem gets looked at.
I suspect that this is a compare issue...feel free to punt back if you disagree.
The editor needs to override WorkbenchPart.getOrientation() to return SWT.LEFT_TO_RIGHT if the editor is java code or xml - otherwise the locale's default orientation (in this case RTL) will be used.
Can this be resolved for 3.2? This bug is on the list of sev 1 defects from IES.
This is a pretty easy fix. All you need to do is override IWorkbenchPartOrientation#getOrientation() to return SWT.LEFT_TO_RIGHT for the editor part class the implements the compare editor (is it the CompareEditor class). Can someone please look at this bug?
No, I don't think this is an easy fix. The problem is that the CompareEditor doesn't know whether its showing Java or XML. It is a Viewer inside the editor that knows this, but this Viewer is switched dynamically. But this viewer uses a SourceViewer which is based on a StyledText. So what is the mechanism to control BIDI direction for a SourceViewer or a StyledText?
Eek, so it is complicated. You can create a StyledText with the SWT#LEFT_TO_RIGHT style bit. I don't know of a way to hard code the orientation of a Viewer. Felipe, do you have any suggestions?
I don't know anything about viewer, sorry. In StyledText you can change the orientation on the fly using StyledText#setOrientation(int). Does that help ?
Imporant question for the BIDI experts: Is it correct that the two sides of a compare editor are flipped in Right-to-Left mode? If yes, this means that the direction of "incoming" (blue arrow pointing to the left) and "outgoing" (black arrow point to right) would have to be flipped too.
fixed for > 20060410
In RTL mode indeed the two sides of a compare editor are flipped. For the arrows, I don't really know which arrows you intend to.
With my fix the sides of Compare are no longer flipped. This means that arrow icon directions don't have to change.
verifying...
verified that the compare viewer shows Java code always LTR.
Works at build I20060505