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

Bug 314914

Summary: Confusing GridData javadoc
Product: [Eclipse Project] Platform Reporter: Miles Parker <milesparker>
Component: SWTAssignee: Carolyn MacLeod <carolynmacleod4>
Status: RESOLVED FIXED QA Contact:
Severity: trivial    
Priority: P3 CC: Silenio_Quarti
Version: 3.6Keywords: Documentation
Target Milestone: 3.6 RC4   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
patch to fix GridData javadoc none

Description Miles Parker CLA 2010-05-28 12:55:51 EDT
GridData class docs sez:

" * </pre>
 * The second is to take advantage of convenience style bits defined 
 * by <code>GridData</code>:
 * <pre>
 *      button1.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL));
 * </pre>
 * </p>
 * <p>"

But when you look at docs for those styles, we have:

	 * Not recommended. Use
	 * <code>new GridData(SWT.FILL, int, boolean, boolean)</code>
	 * instead.
	 */
	public static final int HORIZONTAL_ALIGN_FILL = 1 << 8;

	 * Not recommended. Use
	 * <code>new GridData(int, int, true, boolean)</code>
	 * instead.
	 */
	public static final int GRAB_HORIZONTAL = 1 << 9;

Why are we using as an example something that isn't recommended?
Comment 1 Carolyn MacLeod CLA 2010-06-01 14:47:31 EDT
Created attachment 170678 [details]
patch to fix GridData javadoc

We added some convenience constructors in Eclipse 3.0 that use SWT constants (instead of GridData constants) for consistency with other SWT constructors.
We forgot to update the class comment for GridData to refer to the new convenience constructors. Thanks for noticing!
Comment 2 Carolyn MacLeod CLA 2010-06-02 12:07:18 EDT
Fixed > 20100602. This fix will be in Eclipse 3.6 RC4.
Comment 3 Miles Parker CLA 2010-06-02 13:46:46 EDT
Wow, quick work guys! I'll be sure to post any other little things like this I notice now.
Comment 4 Carolyn MacLeod CLA 2010-06-02 13:51:59 EDT
Thanks, Miles! Always appreciated.