Bug 250427 - Javadoc of constructor Cursor(Device, int) should mention Display#getSystemCursor(int)
Summary: Javadoc of constructor Cursor(Device, int) should mention Display#getSystemCu...
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 3.5   Edit
Hardware: PC Windows XP
: P3 trivial (vote)
Target Milestone: 3.6 RC3   Edit
Assignee: Lakshmi P Shanmugam CLA
QA Contact:
URL:
Whiteboard:
Keywords: Documentation
Depends on:
Blocks:
 
Reported: 2008-10-10 08:30 EDT by Markus Keller CLA
Modified: 2010-05-26 11:53 EDT (History)
4 users (show)

See Also:


Attachments
modified javadoc for Cursor(Device, int) (1.06 KB, patch)
2010-05-25 07:20 EDT, Lakshmi P Shanmugam CLA
no flags Details | Diff
patch to remove reference to Display (1.03 KB, patch)
2010-05-26 11:53 EDT, Silenio Quarti CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Markus Keller CLA 2008-10-10 08:30:36 EDT
I20081007-1600

The Javadoc of constructor Cursor(Device, int) should recommend that clients use Display#getSystemCursor(int).

Since the Display method supports exactly the same CURSOR_* constants as the constructor, it rarely makes sense for clients to create and manage another resource. But the frequency of calls to the constructor in the SDK indicate that users (including me) tend to forget the easy way.

I would even deprecate the constructor.
Comment 1 Lakshmi P Shanmugam CLA 2010-05-25 07:20:18 EDT
Created attachment 169808 [details]
modified javadoc for Cursor(Device, int)

Hi Carolyn, came across this one while looking for doc bugs.
Comment 2 Carolyn MacLeod CLA 2010-05-26 01:13:21 EDT
Looks good, Lakshmi - go ahead and commit the patch. Please make sure to take ownership of the bug, and set the target milestone to 3.6RC3.
Comment 3 Carolyn MacLeod CLA 2010-05-26 01:24:13 EDT
Actually, when you are done, can you please open a new bug against SWT to use Display.getSystemCursor() instead of new Cursor()/dispose() in the following classes? Our examples should be setting a good example...  :)  Thanks!
org.eclipse.swt.examples.addressbook.AddressBook
org.eclipse.swt.examples.fileviewer.IconCache
org.eclipse.swt.examples.graphics.CurvesSWTTab
org.eclipse.swt.examples.graphics.CurvesTab
org.eclipse.swt.examples.imageanalyzer.ImageAnalyzer
org.eclipse.swt.custom.CBanner
Comment 4 Lakshmi P Shanmugam CLA 2010-05-26 01:55:56 EDT
Fixed in HEAD > 20100526
Thanks Carolyn!
Comment 5 Silenio Quarti CLA 2010-05-26 11:53:49 EDT
Created attachment 170023 [details]
patch to remove reference to Display

Classes in the org.eclipse.swt.graphics package are not supposed to reference classes in the org.eclipse.swt.widgets package.