Bug 188077 - [Dialogs] Behavioral change for FilteredItemsSelectionDialog#setDetailsLabelProvider(..) must be documented
Summary: [Dialogs] Behavioral change for FilteredItemsSelectionDialog#setDetailsLabelP...
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.3   Edit
Hardware: PC Windows XP
: P3 major (vote)
Target Milestone: 3.3 RC2   Edit
Assignee: Krzysztof Michalski CLA
QA Contact:
URL:
Whiteboard:
Keywords: contributed
Depends on:
Blocks:
 
Reported: 2007-05-21 08:28 EDT by Markus Keller CLA
Modified: 2007-06-22 07:00 EDT (History)
2 users (show)

See Also:


Attachments
Fix (1.76 KB, patch)
2007-05-24 09:46 EDT, Szymon Brandys 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 2007-05-21 08:28:27 EDT
3.3 RC1

The fix for bug 175817 fixed the problem in the SDK, but the fix is not good enough for 3.3:

(In reply to bug 175817 comment #6)
> Furthermore, you can't just set the input of the DetailsContentViewer to a
> String and hope the client's label provider just passes the string on.

(In reply to bug 175817 comment #10)
> In any case, setDetailsLabelProvider(..) would have to specify how clients
> must handle the additional element types.

At last the Javadoc of setDetailsLabelProvider(..) needs to state explicitly that a String is passed as element for multiselections. I would also include the hint for clients that they can supply a custom message in that case and use #getSelectedItems() to get at the items count.

This change also needs to be mentioned in the build notes, since it will affect existing clients whose label provider does not handle String elements. I even think this should be announced on the mailing list.
Comment 1 Szymon Brandys CLA 2007-05-24 09:46:52 EDT
Created attachment 68568 [details]
Fix
Comment 2 Tod Creasey CLA 2007-05-24 10:00:31 EDT
/**
	 * Sets label provider for the details field.
	 * 
	 * For a single selection, the element sent to {@link ILabelProvider#getImage(Object)}
	 * and {@link ILabelProvider#getText(Object)} is the selected object, 
	 * for multiple selection a {@link String} with amount of selected items is the
	 * element.
	 * 
	 * @see {@link FilteredItemsSelectionDialog#getSelectedItems()} can be used to
	 * retrieve selected items and get the items count.
	 * 
	 * @param detailsLabelProvider
	 *            the label provider for the details field
	 */

I think this is clearer. This is pretty unusual behaviour which we should revisit in 3.4.

Comment 3 Tod Creasey CLA 2007-05-24 10:04:49 EDT
I have updated the javadoc with my changes. Let me know if you want it refined further.

Released to build 20070524-1300
Comment 4 Markus Keller CLA 2007-05-24 10:46:13 EDT
"[..] @see {@link FilteredItemsSelectionDialog#getSelectedItems()} can be [..]"

is not legal Javadoc, see http://java.sun.com/j2se/1.5.0/docs/tooldocs/windows/javadoc.html#@see

You can enable Javadoc validation in your compiler options to see such violations in Eclipse.

The rest looks good.
Comment 5 Tod Creasey CLA 2007-05-24 10:57:06 EDT
Thanks Markus. We actually had 3 problem places and I fixed all of them.