Bug 412273 - [Viewers] Add generics to the ComboViewer
Summary: [Viewers] Add generics to the ComboViewer
Status: CLOSED DUPLICATE of bug 402445
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.3   Edit
Hardware: All All
: P3 normal with 1 vote (vote)
Target Milestone: ---   Edit
Assignee: Jeanderson Candido CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-07-04 04:45 EDT by Hendrik Still CLA
Modified: 2015-08-14 11:19 EDT (History)
6 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Hendrik Still CLA 2013-07-04 04:45:26 EDT
The ComboViewer as part of the JFace Viewer should support Java Generics. 

This should be the first viewer to be ported, as subtask of the bug 402445 .
Comment 1 Hendrik Still CLA 2013-07-08 15:08:22 EDT
I'm currently working on this Bug at a github repository.
https://github.com/Gamma32/eclipse.platform.ui/tree/PlayGroundGenerics

I also created a small sample application which sould demonstrate the use of the current changes. 
https://github.com/Gamma32/de.gammas.JfaceGenericsTest/blob/master/src/de/gammas/JfaceGenericsTest/parts/SamplePart.java
Comment 2 Hendrik Still CLA 2013-07-23 14:41:22 EDT
I've uploaded a patch to gerrit:
https://git.eclipse.org/r/#/c/14787/


The current changes lead to more compiler warning caused by the generification of some interfaces. I'll fix this warnings with the porting of the other viewers. 
I'll also update the JUnit Tests and the JFace Snippets.

A sample usage is demonstrated here:
https://github.com/Gamma32/de.gammas.JfaceGenericsTest/blob/master/src/de/gammas/JfaceGenericsTest/parts/SamplePart.java
Comment 3 John Arthorne CLA 2013-07-25 16:37:31 EDT
I didn't have time for a complete review today. One quick comment is that we will need to be consistent across JFace on the type names we use for generic types. I see you are using E for "model element" which sounds fine. For viewer input, you are using the default 'T' which I think isn't helpful. When there is more than one generic type on a class it helps to give it a more descriptive type name. I propose 'I' for the Viewer input type.
Comment 4 Hendrik Still CLA 2013-07-25 17:21:41 EDT
Okay that sounds reasonable. I'll update this tomorrow. Currently this patch mostly supports just the generics on the api side(not internal) to see if this is the right way to implement it.
Comment 5 Hendrik Still CLA 2013-07-26 04:45:45 EDT
I changed the Viewer input type to 'I'
Comment 6 Hendrik Still CLA 2013-07-29 16:17:00 EDT
I've abandoned my old changes and added a new one:

https://git.eclipse.org/r/#/c/14941/
Comment 7 Paul Webster CLA 2013-08-02 10:20:52 EDT
I've released this as http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=d5c62ff8e7265c5edbee67c8dbe2144cc113baa0

Thanks Hendrik.

Can we generify org.eclipse.jface.tests.viewers.ComboViewerTest and org.eclipse.jface.tests.viewers.CComboViewerTest to show how this viewer is now supposed to be used?

PW
Comment 8 Hendrik Still CLA 2013-08-03 07:25:12 EDT
Hey Paul,
thanks for your review. 
I'll do this tomorrow or on Monday. I'll also update the JFace Snippets

(In reply to comment #7)
> I've released this as
> http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/
> ?id=d5c62ff8e7265c5edbee67c8dbe2144cc113baa0
> 
> Thanks Hendrik.
> 
> Can we generify org.eclipse.jface.tests.viewers.ComboViewerTest and
> org.eclipse.jface.tests.viewers.CComboViewerTest to show how this viewer is
> now supposed to be used?
> 
> PW
Comment 9 Hendrik Still CLA 2013-08-05 08:04:58 EDT
I've uploaded a patch for the JUnit Tests.
https://git.eclipse.org/r/#/c/15130/


Instead of changing the existing tests, I've added new generic versions of the classes. The reason for this was that:
1. I think it's good to have tests for the backwards compatibility to the non-generic use of the viewers
2. The class TestModelContentProvider implements the generified IStructuredContentProvider and the currently not generified ITreeContentProvider.
The ITreeContentProvider also implements the IStructuredContentProvider.
So the ContentProvider had to implent a typed and a none typed version of the IStructuredContentProvider interface, which is not possible.
Comment 10 Paul Webster CLA 2013-08-12 13:48:00 EDT
(In reply to comment #9)
> I've uploaded a patch for the JUnit Tests.
> https://git.eclipse.org/r/#/c/15130/

Abandoned, I guess we need a new review URL

PW
Comment 11 Hendrik Still CLA 2013-08-13 03:58:38 EDT
Yes, I guess an update for the existing testcases is a better solution. 
But for this update wee need to update the TreeViewer first.
Comment 13 Lars Vogel CLA 2014-07-11 14:37:12 EDT
I suggest to close this issue once we merged your work into master.
Comment 14 Jeanderson Candido CLA 2014-07-12 01:43:55 EDT
(In reply to Lars Vogel from comment #13)
> I suggest to close this issue once we merged your work into master.

I was suggesting to use a status more meaningful (maybe resolved?).
Even better: I think I could just use Github Issue Tracker to keep issues/bugs organized (what was done, etc). In this case, ignore my last comment :)
Comment 15 Lars Vogel CLA 2015-08-14 11:19:19 EDT
This will be handled via Bug 	402445

*** This bug has been marked as a duplicate of bug 402445 ***