Bug 430988 - Show View should work on application model instead of ViewRegistry
Summary: Show View should work on application model instead of ViewRegistry
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.4   Edit
Hardware: PC All
: P3 normal with 1 vote (vote)
Target Milestone: 4.5 M4   Edit
Assignee: Lars Vogel CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 430602 (view as bug list)
Depends on: 445663 446093
Blocks: 376486 454143
  Show dependency tree
 
Reported: 2014-03-24 06:43 EDT by Lars Vogel CLA
Modified: 2022-04-04 09:47 EDT (History)
11 users (show)

See Also:


Attachments
Example project (6.35 KB, application/zip)
2014-03-24 07:16 EDT, Lars Vogel CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Lars Vogel CLA 2014-03-24 06:43:30 EDT
To allow that new views are contributed by fragments and processors we should rewrite the ShowViewDialog and its related classes to work on the application model.
Comment 1 Lars Vogel CLA 2014-03-24 06:44:20 EDT
https://git.eclipse.org/r/23785
Comment 2 Lars Vogel CLA 2014-03-24 07:16:13 EDT
Created attachment 241165 [details]
Example project

To test the change, add the following plugin with a PartDescriptor to your Eclipse runtime configuration.
Comment 3 Paul Webster CLA 2014-03-24 09:27:14 EDT
(In reply to Lars Vogel from comment #0)
> To allow that new views are contributed by fragments and processors we
> should rewrite the ShowViewDialog and its related classes to work on the
> application model.

New views in the workbench are still contributed via the extension points.

PW
Comment 4 Lars Vogel CLA 2014-03-24 09:35:14 EDT
(In reply to Paul Webster from comment #3)
> (In reply to Lars Vogel from comment #0)
> > To allow that new views are contributed by fragments and processors we
> > should rewrite the ShowViewDialog and its related classes to work on the
> > application model.
> 
> New views in the workbench are still contributed via the extension points.
> 
> PW

This still works, as the extension points are converted to model elements at start time.
Comment 5 Stefan Klein CLA 2014-03-28 07:53:30 EDT
Plus one.
We already developed new views for RCP application using fragments, and it is a challenge to reconvert them into extension points for our IDE users.
Comment 6 Lars Vogel CLA 2014-09-30 11:25:31 EDT
*** Bug 430602 has been marked as a duplicate of this bug. ***
Comment 7 Lars Vogel CLA 2014-10-06 19:29:38 EDT
The suggested change is ready, please note that if we start using the application model in the IDE, errors in it will surface. See for example Bug 445663. But IMHO these errors must be resolved in any case. 

https://git.eclipse.org/r/#/c/23785/
Comment 8 Lars Vogel CLA 2014-10-23 01:25:06 EDT
I plan to do this merge this early M4.
Comment 9 Lars Vogel CLA 2014-11-04 17:20:07 EST
To test this with a new part descriptor contributed via a model fragment, you need to add the "View" tag to the part descriptor. 

The category finding logic is at the moment a bit weird, see Bug 446093, but it works correctly IMHO based on the current data in the model. To define a category for your part descriptor use a tag similar to "categoryTag:YourCategory".
Comment 10 Lars Vogel CLA 2014-11-06 16:56:52 EST
For some reason I was unable to update the existing Gerrit review were the review took place. For reference: https://git.eclipse.org/r/#/c/23785/


New Gerrit review:

https://git.eclipse.org/r/#/c/36079/
Comment 11 Lars Vogel CLA 2014-11-06 18:00:20 EST
This bug is fixed with:

http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=b6821b521eefca7bf19e476741823e2a7c41f737

This fix allows the customer to contribute part descriptors to the Eclipse IDE which are also available in the Show View menu. Quick access to open parts contributed as part descriptors also work. 

If Bug 446093 get applied, the category determination can be simplified. Currently it uses the tag but with the  "categoryTag:[yourcategory]" prefix but Bug 446093 plans to use the category field for this.
Comment 12 Wojciech Sudol CLA 2014-12-04 10:34:51 EST
(In reply to Lars Vogel from comment #11)
> This bug is fixed with:
> 
> http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/
> ?id=b6821b521eefca7bf19e476741823e2a7c41f737

This commit introduced issues described in bug 454143.
Comment 13 Lars Vogel CLA 2015-01-30 11:41:27 EST
Issues introduced by this bug have been fixed. Verified in 4.5.0.I20150129-1830
Comment 14 Marc-André Laperle CLA 2015-02-23 16:55:49 EST
Hi Lars. We have a view category named "&C/C++". Before this commit, the & was getting erased when shown in the Show View dialog but after the commit it is shown. I'm not sure why we had the & in the first place (I don't see any possible way to use an accelerator for a category name) but I thought you might like to know in case you want to keep the behavior the same. We can fix it in CDT too, that's not a problem.
Comment 15 Lars Vogel CLA 2015-02-24 00:54:18 EST
(In reply to Marc-Andre Laperle from comment #14)
> Hi Lars. We have a view category named "&C/C++". Before this commit, the &
> was getting erased when shown in the Show View dialog but after the commit
> it is shown. I'm not sure why we had the & in the first place (I don't see
> any possible way to use an accelerator for a category name) but I thought
> you might like to know in case you want to keep the behavior the same. We
> can fix it in CDT too, that's not a problem.

I think the right place to fix this is CDT, I'm also not aware of a way to use an accelerator for view categories. Please link your bug to this one.
Comment 16 Marc-André Laperle CLA 2015-02-24 10:54:04 EST
(In reply to Lars Vogel from comment #15)
> I think the right place to fix this is CDT, I'm also not aware of a way to
> use an accelerator for view categories. Please link your bug to this one.

Thanks Lars! There is no bug, only a Gerrit change. I added it to the See Also.
Comment 17 Andrey Loskutov CLA 2015-11-07 15:03:59 EST
(In reply to Lars Vogel from comment #2)
> Created attachment 241165 [details]
> Example project
> 
> To test the change, add the following plugin with a PartDescriptor to your
> Eclipse runtime configuration.

Lars,
the attached project contains neither source code nor the e4xmi file. Do you have a *working* example of the fragment contributing a view which is supposed to work after fixing this bug? I'm trying to create one from scratch but either it still doesn't work or I'm doing something wrong.
Comment 18 Lars Vogel CLA 2015-11-07 15:55:59 EST
(In reply to Andrey Loskutov from comment #17)
> Lars,
> the attached project contains neither source code nor the e4xmi file. Do you
> have a *working* example of the fragment contributing a view which is
> supposed to work after fixing this bug? I'm trying to create one from
> scratch but either it still doesn't work or I'm doing something wrong.

Latest I-Build has a PDE template with an e4 view for the IDE. I'm currently of my computer, if you do not find it I can give more details or upload an example on Monday.
Comment 19 Andrey Loskutov CLA 2015-11-07 16:27:26 EST
(In reply to Lars Vogel from comment #18)
> Latest I-Build has a PDE template with an e4 view for the IDE.
Lars, where I have to start to see this template? New -> PDE -> New Plugin? The view template there is still the 3.x one, at least with the build from http://download.eclipse.org/eclipse/updates/4.6-I-builds/I20151103-0800.