Community
Participate
Working Groups
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.
This one shouldn't be too bad Rafael.
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?
I would just make sure that the error reporter reports this case. So just do the sorting ;)
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.
sorting was implemente too. Chris, Could you discard the handleAdd() updates?
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.
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.
So, should we prevent added duplicated interfaces?
No, duplicate provided service interfaces are OK, although rather rare. See bug 248557 for more on this.
Created attachment 114212 [details] DSErrorReporter and DSProvideSection updates DSErrorReporter = check for duplicates interfaces DSProvideSection = sorting interfaces
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.
done. > 20091003
Frosty beverages for everyone!
you learn something new ;) I had no idea about the 'TypeSelectionExtension' in JDT :)