Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 401291

Summary: Javadoc of SWT.LEFT/RIGHT suggests to use LEAD/TRAIL, but they are not mentioned as valid arguments
Product: [Eclipse Project] Platform Reporter: Dani Megert <daniel_megert>
Component: SWTAssignee: Platform-SWT-Inbox <platform-swt-inbox>
Status: CLOSED WONTFIX QA Contact:
Severity: normal    
Priority: P3 CC: arunkumar.thondapu, markus.kell.r
Version: 4.3   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard: stalebug

Description Dani Megert CLA 2013-02-20 05:53:31 EST
Javadoc of SWT.LEFT/RIGHT suggests to use LEAD/TRAIL, but GridData does not mention it as valid argument.
Comment 1 Dani Megert CLA 2013-04-29 10:59:38 EDT
I'm increasing this to 'major' since none of the things that specify LEFT or RIGHT, now also allow LEAD or TRAIL. With this, no one will start to use the preferred constants.
Comment 2 Markus Keller CLA 2013-04-29 11:37:32 EDT
A better solution is to just declare LEAD/TRAIL as optional alternatives for LEFT/RIGHT for those who want to use them.

99% of developers are not concerned with RTL layouts. Mentioning LEAD/TRAIL in every API again just causes bloat, since LEFT/RIGHT must stay in the APIs. And there will always be inconsistencies with APIs like GridLayout#marginLeft/Right, which cannot be changed. Not even classes Point and Rectangle talk about RTL, since that's handled transparently.

It's actually less confusing to consistently have left/right everywhere and just make the switch when the orientation is reversed. This bug is 'minor', IMO.
Comment 3 Dani Megert CLA 2013-04-29 11:55:18 EDT
(In reply to comment #2)
> A better solution is to just declare LEAD/TRAIL as optional alternatives for
> LEFT/RIGHT for those who want to use them.
> 
> 99% of developers are not concerned with RTL layouts. Mentioning LEAD/TRAIL
> in every API again just causes bloat, since LEFT/RIGHT must stay in the
> APIs. And there will always be inconsistencies with APIs like
> GridLayout#marginLeft/Right, which cannot be changed. Not even classes Point
> and Rectangle talk about RTL, since that's handled transparently.
> 
> It's actually less confusing to consistently have left/right everywhere and
> just make the switch when the orientation is reversed. This bug is 'minor',
> IMO.

I'm fine to just mark LEAD/TRAIL as optional alternatives, but currently LEFT/RIGHT indicate that they are outdated and should not be used:

* Newer
* applications should use {@link #LEAD} instead of {@link #LEFT} to make code 
* more understandable on right-to-left platforms.

And LEAD/TRAIL don't mention that they are synonyms for LEFT/RIGHT. Instead, they declare to be style constants for e.g. Button, but when going Button's Javadoc, the style is not mentioned, hence the client does not know for sure whether it's allowed or not. Plus, things like GridData are not mentioned.

I agree, it's not 'major' though.
Comment 4 Eclipse Genie CLA 2019-09-02 13:05:36 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.