Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 337354 - org.eclipse.java2d.label broken in bidi when text string has embedded brackets
Summary: org.eclipse.java2d.label broken in bidi when text string has embedded brackets
Status: CLOSED WONTFIX
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 4.1   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform-SWT-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-02-16 15:19 EST by Michael R Cooper CLA
Modified: 2011-02-17 09:43 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael R Cooper CLA 2011-02-16 15:19:59 EST
Build Identifier: 3.6.2

code sample here:

public class PrimaryView extends ViewPart {
	private Button clickMeButton;
	
	public PrimaryView() {
		super();
	}

	public void createPartControl(final Composite parent)
	{
		
	    Canvas canvas = new Canvas(parent, SWT.NULL);
	    
	    LightweightSystem lws = new LightweightSystem(canvas);
	    
	    Label lb = new Label();
	    lb.setText("[this is a test of bracket]Is this BIDI enabled");
	    lws.setContents(lb);


		
	}

	public void setFocus() {
	}

}

the output will look like this when in bidi:

... is a test of bracket]Is this BIDI enabled]





Reproducible: Always

Steps to Reproduce:
1.build the code snippet
2.put in bidi env
3.run snippet
Comment 1 Felipe Heidrich CLA 2011-02-16 17:09:06 EST
That is the correct bidi reordering.
Comment 2 Michael R Cooper CLA 2011-02-16 17:25:47 EST
expecting:

[... is a test of bracket]Is this BIDI enabled

not

... is a test of bracket]Is this BIDI enabled]


The error we have in our product using eclipse is:

NON-BIDI
[Deprecated]Use Browser URL

BIDI
Deprecated]Use Browser URL]


That is incorrect - the only thing that should be done is the whole text string should just get right justified.
Comment 3 Felipe Heidrich CLA 2011-02-17 09:43:38 EST
Please read 
http://www.unicode.org/reports/tr9/

You can use the TextProcessor to solve your problem:
http://wiki.eclipse.org/New_Bidi_APIs