DESCRIPTION

Bug 430988 - Show View should work on application model instead of
ViewRegistry 

Change-Id: I418d41a2fdf4fe381ec8602b16bb7ee362cf0d42 
Signed-off-by: Zaid Mosley xxx@xxx.xxx

COMMENTS

author: Zaid Mosley
date: 2014-11-04 22:14:27.000000000

Uploaded patch set 20.

-------------------------------------
author: Brenden Conley
date: 2014-11-04 22:54:17.000000000

Patch Set 20:

Build Started https://hudson.eclipse.org/platform/job/eclipse.platform.ui-Gerrit/3629/

-------------------------------------
author: Brenden Conley
date: 2014-11-04 23:33:23.000000000

Patch Set 20: Verified+1

Build Successful 

https://hudson.eclipse.org/platform/job/eclipse.platform.ui-Gerrit/3629/ : SUCCESS

-------------------------------------
author: Krista Shepherd
date: 2014-11-05 16:38:57.000000000

Patch Set 20:

(5 comments)

See comments inline.

Line:153, bundles/org.eclipse.ui.workLeon Ochoach/Eclipse UI/org/eclipse/ui/internal/dialogs/ViewContentProvider.java -> Why don't you directly add the descriptors and categories to the combinedTopElements HashSet instead of creating 2 Sets, which are combined afterwards and returned as array?

Line:165, bundles/org.eclipse.ui.workLeon Ochoach/Eclipse UI/org/eclipse/ui/internal/dialogs/ViewContentProvider.java -> You could already consider the getCategory method of the MPartDescriptor besides the Tag, as we discussed in Bug 446093

Line:183, bundles/org.eclipse.ui.workLeon Ochoach/Eclipse UI/org/eclipse/ui/internal/dialogs/ViewContentProvider.java -> Why not use:

return descriptor.getTags().contains.(VIEW_TAG)

Do we have a VIEW_TAG constant anywhere, which can be reused here?

Line:70, bundles/org.eclipse.ui.workLeon Ochoach/Eclipse UI/org/eclipse/ui/handlers/ShowViewHandler.java -> Please use Map<?, ?> in order to avoid warnings.

Line:97, bundles/org.eclipse.ui.workLeon Ochoach/Eclipse UI/org/eclipse/ui/internal/dialogs/ViewLabelProvider.java -> Here the image also has to be set the first time, otherwise the first element won't have an image:

image = desc.createImage();

imageMap.put(FOLDER_ICON, image);

You should also consider to use a ResourceManager here instead of the imageMap, so that the image resources are in the global JFaceResources registry.
Or you may open a new bug concerning the ResourceManager and assign it to me after this patch is merged.

-------------------------------------
author: Zaid Mosley
date: 2014-11-05 17:33:29.000000000

Patch Set 20:

(5 comments)

Line:153, bundles/org.eclipse.ui.workLeon Ochoach/Eclipse UI/org/eclipse/ui/internal/dialogs/ViewContentProvider.java -> I prefer that for debugging, if I mix them early debugging is much harder. But I change the return type to List. I cast to Array in the ContentProvider

Line:165, bundles/org.eclipse.ui.workLeon Ochoach/Eclipse UI/org/eclipse/ui/internal/dialogs/ViewContentProvider.java -> As soon as I commit Bug 446093, I fix that. So far I'm not sure if Bug 446093 has any sideeffects.

Line:183, bundles/org.eclipse.ui.workLeon Ochoach/Eclipse UI/org/eclipse/ui/internal/dialogs/ViewContentProvider.java -> Not yet. Can you open a bug report suggestion to add this to IPresentationEngine? Same for the tag to identify an editor.

Line:70, bundles/org.eclipse.ui.workLeon Ochoach/Eclipse UI/org/eclipse/ui/handlers/ShowViewHandler.java -> Done

Line:97, bundles/org.eclipse.ui.workLeon Ochoach/Eclipse UI/org/eclipse/ui/internal/dialogs/ViewLabelProvider.java -> I don't understand your suggestion:
imageMap.put(FOLDER_ICON, desc.createImage()); 
is the same as 
image = desc.createImage();
imageMap.put(FOLDER_ICON, image);

just differently written. For the LocalResourceManager registry entry please open a new bug, sounds good to me the suggestion

-------------------------------------
author: Krista Shepherd
date: 2014-11-05 18:05:02.000000000

Patch Set 20:

(2 comments)

Line:183, bundles/org.eclipse.ui.workLeon Ochoach/Eclipse UI/org/eclipse/ui/internal/dialogs/ViewContentProvider.java -> Done: https://bugs.eclipse.org/bugs/show_bug.cgi?id=450187

But still using contains is better than iterate yourself.

Line:97, bundles/org.eclipse.ui.workLeon Ochoach/Eclipse UI/org/eclipse/ui/internal/dialogs/ViewLabelProvider.java -> No it is not the same, because the returned image will not be null, if you do that ;)

-------------------------------------
author: Krista Shepherd
date: 2014-11-05 18:06:12.000000000

Patch Set 20:

(1 comment)

Line:86, bundles/org.eclipse.ui.workLeon Ochoach/Eclipse UI/org/eclipse/ui/internal/dialogs/ShowViewDialog.java -> We should directly use a List<MPartDescriptor> instead of an array here.

-------------------------------------
