Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 356673 - RTL orientation problem in AbstractFlowLayoutEditPolicy
Summary: RTL orientation problem in AbstractFlowLayoutEditPolicy
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: WindowBuilder (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 major (vote)
Target Milestone: ---   Edit
Assignee: Konstantin Scheglov CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-09-04 03:56 EDT by Dolev Dori CLA
Modified: 2021-06-04 16:45 EDT (History)
2 users (show)

See Also:


Attachments
Patch for enabling RTL support in flow based layouts (1.55 KB, patch)
2011-09-04 03:56 EDT, Dolev Dori CLA
Konstantin.Scheglov: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dolev Dori CLA 2011-09-04 03:56:14 EDT
Created attachment 202714 [details]
Patch for enabling RTL support in flow based layouts

We are in the process of writing a custom UI toolkit for an XML based Swing UI language. Since most of our customers speak Hebrew, we require RTL support in most of the screens we build, which led us to discover the following bug:

When adding or moving components in a container with FlowLayout and RTL orientation (also when reordering tabs in a tabbed pane), the insertion point for the new component is incorrect.
For example, if we look at a container with one component, trying to insert a new component to its left results in the component being placed to the right (this is because WindowBuilder thinks we are trying to add the component as the first child, but in fact, in RTL the left-most position is the position of the last child).
So, in the above example, the ordering of the container:
 C
^
N

Becomes:
C N

instead of:
N C

Reproducible: Always

Proposed solution:
Add an abstract method isRTL to AbstractFlowLayoutEditPolicy (similar to isHorizontal), and fix getInsertionReference to return the correct reference for RTL (proposed patch included as attachment).

Thanks in advance
Comment 1 Konstantin Scheglov CLA 2011-10-25 10:26:50 EDT
Implemented in trunk.
Comment 2 Wayne Beaton CLA 2014-05-30 15:09:46 EDT
(In reply to Konstantin Scheglov from comment #1)
> Implemented in trunk.

If the patch has been applied, the corresponding attachment should be marked iplog+ so that it appears in the IP Log as a contribution.