Bug 461724 - Part Stack context menus cannot be extended
Summary: Part Stack context menus cannot be extended
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.5   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: 4.5 M7   Edit
Assignee: Brian de Alwis CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 463124 471719
  Show dependency tree
 
Reported: 2015-03-09 10:45 EDT by Brian de Alwis CLA
Modified: 2016-10-12 14:47 EDT (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Brian de Alwis CLA 2015-03-09 10:45:58 EDT
There have been requests on forums and elsewhere to both control and add to the items shown the part stack context menu.
Comment 1 Eclipse Genie CLA 2015-03-09 11:03:02 EDT
New Gerrit change created: https://git.eclipse.org/r/43447
Comment 2 Lars Vogel CLA 2015-03-09 13:53:36 EDT
The renderer are still considered internal API but +1 for this change. 

(I'm absolute NOT influenced by our EclipseCon tutorial for which this would also be very handy.)
Comment 3 Thomas Schindl CLA 2015-03-09 14:08:08 EDT
Generally I'm not against this but I think it would be a lot better if we could provide people access to such a feature without having to role their own renderer.
Comment 4 Lars Vogel CLA 2015-03-09 14:08:53 EDT
(In reply to Thomas Schindl from comment #3)
> Generally I'm not against this but I think it would be a lot better if we
> could provide people access to such a feature without having to role their
> own renderer.

I agree but I think that would be another bug.
Comment 5 Brian de Alwis CLA 2015-03-09 15:57:40 EDT
We could consider exposing this menu via the normal extension mechanisms, but I worry that the menu would be flooded by contributions on org.eclipse.ui.popup.any.
Comment 6 Lars Vogel CLA 2015-03-09 17:58:59 EDT
(In reply to Brian de Alwis from comment #5)
> We could consider exposing this menu via the normal extension mechanisms,
> but I worry that the menu would be flooded by contributions on
> org.eclipse.ui.popup.any.

We could extend the model to allow model menu contributions for MPartStack elements.
Comment 7 Lars Vogel CLA 2015-03-17 16:34:31 EDT
Brian, I move this to M7, if you still plan to commit this for M6, please move it back.
Comment 8 Brian de Alwis CLA 2015-03-17 17:11:07 EDT
Sorry, this slipped through the cracks: as it's just moving some code into a new method, if you're ok with it for M6 then I'll commit it tonight.
Comment 9 Lars Vogel CLA 2015-03-17 17:13:58 EDT
(In reply to Brian de Alwis from comment #8)
> Sorry, this slipped through the cracks: as it's just moving some code into a
> new method, if you're ok with it for M6 then I'll commit it tonight.

If there is no pressing need, I suggest to wait for early M7.
Comment 10 Brian de Alwis CLA 2015-03-24 12:05:17 EDT
Seeking PMC approval since this patch introduces a new protected method "populateTabMenu(Menu, MPart)" intended to be for subclasses on StackRenderer, and exposes a previously-private method "isClosable(MPart)" as it's useful for these subclasses.

Even with a model-based solution as per Tom and Lars' comments above, this separation is still useful to provide RCP products the ability to customize the part stack context menus; I know of one commercial product that wants this ability.
Comment 11 Lars Vogel CLA 2015-03-24 21:30:45 EDT
(In reply to Brian de Alwis from comment #10)
> Seeking PMC approval since this patch introduces a new protected method
> "populateTabMenu(Menu, MPart)" intended to be for subclasses on
> StackRenderer, and exposes a previously-private method "isClosable(MPart)"
> as it's useful for these subclasses.

AFAIK the renderer are not API, so PMC approval should not necessary. See the MANIFEST.MF of org.eclipse.e4.ui.workbench.renderers.swt. I remove the PMC flag, please add it again, if I oversee something.
Comment 12 Brian de Alwis CLA 2015-03-24 21:48:57 EDT
(In reply to Lars Vogel from comment #11)
> AFAIK the renderer are not API, so PMC approval should not necessary. See
> the MANIFEST.MF of org.eclipse.e4.ui.workbench.renderers.swt. I remove the
> PMC flag, please add it again, if I oversee something.

Oops, thanks for pointing that out!  Great, I'll commit shortly.
Comment 14 Brian de Alwis CLA 2015-03-25 12:05:32 EDT
Fixed for M7
Comment 15 Brian de Alwis CLA 2015-03-25 12:06:22 EDT
Reopening to track the model-based solution.
Comment 16 Lars Vogel CLA 2015-03-25 12:50:33 EDT
I suggest to open a new bug for the possible model extension and to mark this one as fixed.
Comment 17 Brian de Alwis CLA 2015-03-25 13:40:27 EDT
Will do.
Comment 18 Brian de Alwis CLA 2015-04-28 10:33:05 EDT
Verified by inspection in I20150428-0100
Comment 19 Jonathan Rajotte Julien CLA 2016-10-12 14:17:28 EDT
Is there any progress on the model extension for this?

Thanks
Comment 20 Brian de Alwis CLA 2016-10-12 14:47:13 EDT
No sorry. Please discuss on bug 463124.