Bug 130592 - [render] Strings with basic LTR reading order not rendered correctly in RTL locales
Summary: [render] Strings with basic LTR reading order not rendered correctly in RTL l...
Status: RESOLVED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.2   Edit
Hardware: PC Windows All
: P3 normal (vote)
Target Milestone: 3.4 M7   Edit
Assignee: Martin Aeschlimann CLA
QA Contact:
URL:
Whiteboard:
Keywords: nl
Depends on:
Blocks: 131156
  Show dependency tree
 
Reported: 2006-03-06 13:07 EST by Karice McIntyre CLA
Modified: 2009-03-09 09:21 EDT (History)
1 user (show)

See Also:


Attachments
screen shots of examples of incorrect rendering (129.93 KB, application/zip)
2006-03-06 13:07 EST, Karice McIntyre CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Karice McIntyre CLA 2006-03-06 13:07:02 EST
In RTL orientation, there are some strings that should maintain basic LTR reading order - examples are file paths, URLs and file associations.  Even though Eclipse provides full BiDi support as of 3.1, these strings are special cases and so are not rendered correctly due to the presence of neutral characters - that is, characters whose directionality is determined based on the directionality of its surrounding text.  See http://www.unicode.org/reports/tr9/ for the full specification on the Bidirectional algorithm.  The Eclipse platform now provides API that will render these strings correctly in RTL locales (Hebrew and Arabic) by inserting directional marker characters into the string in the appropriate places.  Strings that utilize this API are intended to have an overall reading order of left to right (e.g.file paths, file associations, URLs) and are segmented according to delimiter characters where each segment will have the usual BiDi rendering algorithm applied to it.  To use this API, call
    org.eclipse.osgi.util.TextProcessor.process(String, String) 
where the first string is the string to manipulate (e.g. a file path, URL, etc) and the second string is a string of delimiters which define how the string should be segmented.
  
Example 1 
string=d:\AAA\bbb\CCC\ddd.html
delimiter=".:\"

Example 2
string=*.html
delimiter="*."

Example 3
http://AAA/bbb/ccc.html
delimiter=".:/"


Since file paths and URLs will likely be the most common use case for this API, a set of default delimiters="./\:" is provided so a call to 
    org.eclipse.osgi.util.TextProcessor.process(String) 
is all that is required in these cases.  

Test cases to check for:
URL example to test = http:\\abc\ABC where lower case is Latin (e.g. English) and upper case is Hebrew/Arabic
Without using the new API, it renders CBA\http:\\abc

File path to test = d:\abc\ABC where lower case is Latin (e.g. English) and upper case is Hebrew/Arabic
Without using the new API, it renders CBA\d:\abc

Originating from bug 119517.

Please do a complete review of the UI elements of this component in order to identify and call the new API for all occurrences of file/directory paths, URLs, file associations and any other strings that should have overall left to right reading order.  Check views, wizards, property and preference pages, and dialogs as a starting point.  Some examples of this problem that I have found in this component thus far are:

*New Variable Classpath Entry dialog: variable paths in list aren't rendered correctly
*Javadoc Location property page: location field
*Add JRE dialog: JRE Home directory and JRE System libraries list (paths in list don't render correctly)
*Classpath variables preference page: paths in listed variables aren't rendered correctly
*Installed JREs preference page: Location column (path)
*New Java Project from Ant build file wizard: Ant buildfile field
*New Java project, Java settings page, Libraries tab: paths in list aren't rendered correctly
Comment 1 Karice McIntyre CLA 2006-03-06 13:07:48 EST
Created attachment 35775 [details]
screen shots of examples of incorrect rendering
Comment 2 Karice McIntyre CLA 2006-03-06 13:08:46 EST
I should mention that this problem seems to be specific only to Windows.  I am unsure what Mac does, haven't checked yet.  Linux (GTK, at least) seems to render properly.
Comment 3 Markus Keller CLA 2006-03-07 06:52:53 EST
> I should mention that this problem seems to be specific only to Windows.  I am
> unsure what Mac does, haven't checked yet.  Linux (GTK, at least) seems to
> render properly.

Shouldn't this be fixed in SWT then?
Comment 4 Karice McIntyre CLA 2006-03-07 09:17:01 EST
This is not an SWT bug.  I mentioned that you will not see the problem on Linux becaue I originally marked the bug against all platforms, which was untrue.  

The reason it is not an SWT bug is because certain strings (like URLs and file paths) have semantic meaning that goes beyond what the basic BiDi rendering algorithm can provide.  In this case, the overall reading order of (for example) a file path or URL is left to right, but each segment of the file path should still follow the basic BiDi algorithm.  In order to achieve the intended rendering of the string we need to insert the correct directional marker characters into the string.
Comment 5 Martin Aeschlimann CLA 2006-03-21 17:07:39 EST
Have to decide if we do this for 3.2
Comment 6 Martin Aeschlimann CLA 2006-04-27 14:03:21 EDT
Not for 3.2
Comment 7 Martin Aeschlimann CLA 2006-06-09 06:30:42 EDT
I filed bug 146220 to request label renderers for paths where RTL/LRT issues can be encapsulated and not everybody has to know all the details.
Comment 8 Martin Aeschlimann CLA 2007-04-27 10:08:07 EDT
not planed for 3.4
Comment 9 Martin Aeschlimann CLA 2007-04-27 10:08:33 EDT
sorry, not planed for 3.3, I meant.
Comment 10 Martin Aeschlimann CLA 2008-04-17 11:47:39 EDT
Classpath variables preference page is bug 181954 (fixed).

I don't think we can fix paths or Java element labels in input fields. User input will distroy our escaping.
Best would be if we can mark an input field as LTR as a whole.

Dani and I made a pass over the UI and are now processing all Java element labels.
Please file separate bugs if you find something new.