Bug 314914 - Confusing GridData javadoc
Summary: Confusing GridData javadoc
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 3.6   Edit
Hardware: All All
: P3 trivial (vote)
Target Milestone: 3.6 RC4   Edit
Assignee: Carolyn MacLeod CLA
QA Contact:
URL:
Whiteboard:
Keywords: Documentation
Depends on:
Blocks:
 
Reported: 2010-05-28 12:55 EDT by Miles Parker CLA
Modified: 2010-06-02 13:51 EDT (History)
1 user (show)

See Also:


Attachments
patch to fix GridData javadoc (1.50 KB, patch)
2010-06-01 14:47 EDT, Carolyn MacLeod CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.