Bug 308315

Summary: [Palette] BIDI3.6: Flipped icon in palette in RTL orientation
Product: [Tools] GEF Reporter: amir <bamir>
Component: GEF-Legacy GEF (MVC)Assignee: Anthony Hunter <ahunter.eclipse>
Status: ASSIGNED --- QA Contact:
Severity: normal    
Priority: P3 CC: ahunter.eclipse, camle, kitlo, nyssen
Version: 3.6   
Target Milestone: ---   
Hardware: PC   
OS: Windows Vista   
Whiteboard:
Attachments:
Description Flags
The icon in order to expand the palette. Should be right in RTL
none
The icon in order to hide the palette. Should be left in RTL none

Description amir CLA 2010-04-07 07:14:56 EDT
Build Identifier: I20100330-0800

The arrow icons using for expand and hide the palette should be flipped in RTL mode i.e right arrow for expanding and left arrow in order to hide it.

Reproducible: Always

Steps to Reproduce:
1. Launch eclipse using -nl he attribute in order to enable RTL orientation
2. Select File -> New -> Example -> Logic Diagram and hit "Next."
3. In the new logic file dialog type some file name and click Finish

Result:
In the logic editor that opens up, the appropriate arrow icons for the palette are flipped.
See attached screenshots
Comment 1 amir CLA 2010-04-07 07:18:55 EDT
Created attachment 164032 [details]
The icon in order to expand the palette. Should be right in RTL
Comment 2 amir CLA 2010-04-07 07:21:11 EDT
Created attachment 164033 [details]
The icon in order to hide the palette. Should be left in RTL
Comment 3 Kit Lo CLA 2010-04-07 22:33:09 EDT
I did some investigation. The show and hide palette triangles are constructed in org.eclipse.gef.ui.palette.FlyoutPaletteComposite, instead of using a real bitmap. Looks like the ButtonCanvas.getArrowDirection() method has some logics to check if the UI is mirrored and set the arrow direction accordingly. Seems like the code is not working. Please investigate.

private int getArrowDirection() {
	int direction = PositionConstants.EAST;
	if (isInState(STATE_EXPANDED | STATE_PINNED_OPEN))
	    direction = dock == PositionConstants.WEST ? PositionConstants.WEST : PositionConstants.EAST;
	else 
	    direction = dock == PositionConstants.WEST ? PositionConstants.EAST : PositionConstants.WEST;
	if (isMirrored()) {
		if (direction == PositionConstants.WEST)
		    direction = PositionConstants.EAST;
		else
		    direction = PositionConstants.WEST;
	}
	return direction;	
}