Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 248231 - [ds tooling] Sort and disallow duplicates in Provided Services list
Summary: [ds tooling] Sort and disallow duplicates in Provided Services list
Status: RESOLVED FIXED
Alias: None
Product: PDE
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.5   Edit
Hardware: PC Windows XP
: P3 enhancement (vote)
Target Milestone: 3.5 M3   Edit
Assignee: Rafael Oliveira Nóbrega CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-09-22 22:32 EDT by Simon Archer CLA
Modified: 2008-10-03 17:23 EDT (History)
1 user (show)

See Also:


Attachments
DSErrorReporter and DSProvideSection updates (7.45 KB, text/plain)
2008-10-03 12:17 EDT, Rafael Oliveira Nóbrega CLA
no flags Details
DSErrorReporter and DSProvideSection updates (8.23 KB, text/plain)
2008-10-03 13:11 EDT, Rafael Oliveira Nóbrega CLA
caniszczyk: iplog+
Details
org.eclipse.pde.ds.patch (9.86 KB, patch)
2008-10-03 16:33 EDT, Chris Aniszczyk CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Simon Archer CLA 2008-09-22 22:32:05 EDT
Using Eclipse 3.5M2.

In the Service Component editor the Provided Services list should:

- Be alphabetically sorted, since order is not significant to the XML.
- Disallow duplicates.

While duplicate <service> elements can be prevented in the form-based editor, it will clearly still be possible to add duplicates to the source editor, so duplicates in the document should be marked as a warning in both the form-based editor and the source editor.
Comment 1 Chris Aniszczyk CLA 2008-09-23 11:09:58 EDT
This one shouldn't be too bad Rafael.
Comment 2 Rafael Oliveira Nóbrega CLA 2008-10-03 12:01:34 EDT
How should I prevent duplicated interfaces? 

Should I show a message if the user select a duplicate interface? Is there any standard pop-up menu for this?
Comment 3 Chris Aniszczyk CLA 2008-10-03 12:03:06 EDT
I would just make sure that the error reporter reports this case.

So just do the sorting ;)
Comment 4 Rafael Oliveira Nóbrega CLA 2008-10-03 12:17:51 EDT
Created attachment 114207 [details]
DSErrorReporter and DSProvideSection updates

DSErrorReporter: Warning for duplicated interfaces

DSProvideSection: Don't add a duplicated interface.

We need to define how we're going to inform the user that a selected interface is duplicated.
Comment 5 Rafael Oliveira Nóbrega CLA 2008-10-03 12:19:35 EDT
sorting was implemente too.

Chris, Could you discard the handleAdd() updates?
Comment 6 Chris Aniszczyk CLA 2008-10-03 12:22:07 EDT
Can you provide a new patch?

Also, for sorting, we can take advantage of JFace here... ie.,

fProvidesTable.setComparator(comparator)...

just create a standard ViewerComparator and that should give us the same results.
Comment 7 Simon Archer CLA 2008-10-03 12:33:44 EDT
Please make sure that when the user clicks the "Add..." button and choses a duplicate that it is NOT added to the list.

Of course in the perfect world the dialog should not let you choose a type that already exists in the list, but I don't know how to do that using JavaUI's createTypeDialog helper method.

We need to do all that we can to prevent the user from making a mistake, especially in the form-based editor.  To let them add a duplicate and then ding them with an error marker would be bad.

Comment 8 Rafael Oliveira Nóbrega CLA 2008-10-03 12:43:30 EDT
So, should we prevent added duplicated interfaces?
Comment 9 Simon Archer CLA 2008-10-03 12:56:18 EDT
No, duplicate provided service interfaces are OK, although rather rare.  See bug 248557 for more on this.
Comment 10 Rafael Oliveira Nóbrega CLA 2008-10-03 13:11:15 EDT
Created attachment 114212 [details]
DSErrorReporter and DSProvideSection updates

DSErrorReporter = check for duplicates interfaces
DSProvideSection = sorting interfaces
Comment 11 Chris Aniszczyk CLA 2008-10-03 16:33:18 EDT
Created attachment 114225 [details]
org.eclipse.pde.ds.patch

What Simon wants is what Simon gets (usually).

We now filter out duplicates in the JDT dialog.
Comment 12 Chris Aniszczyk CLA 2008-10-03 16:33:53 EDT
done.

> 20091003
Comment 13 Simon Archer CLA 2008-10-03 16:46:07 EDT
Frosty beverages for everyone!
Comment 14 Chris Aniszczyk CLA 2008-10-03 17:23:33 EDT
you learn something new ;)

I had no idea about the 'TypeSelectionExtension' in JDT :)