Community
Participate
Working Groups
There is one element of the new command framework that I cannot find covered anywhere. I have experimented with code and have not solved the problem. This makes me conclude that the answer is so obvious I can't see it or that this is a bug / shortcoming of the Command Framework. Using the command framework I have not been able to add, using only plugin.xml entries, the ability to add /control toolbar menu items to a specific page of a pagebook view. For example, consider org.eclipse.ui.views.contentoutline.ContentOutline. The Eclipse PDE implements, in code, various contributing content outline pages for the outline view. When no editor is open the outline view has no toolbar items. Depending on the file opened for edit, the icons in the Content Outline view toolbar change to suit the file. Can that be done for a newly contributing page using only command framework entries? I also want to implement the same behaviour in my own pagebook views. Paul Webster's comment is: It doesn't look possible. If the page site and page action bars returned a ContributionManager you could use IMenuService to populateContributionManager(*) (this would allow your toolbar to pick up plugin.xml contributions) ... but I think a page site returns a SubToolBarManager, which is not an instance of ContributionManager.
I just ran into this while working on some customization for the XSL Tools editor's outline view. Any possibility of getting this addressed during 3.6?
Is this being worked on? 3.6?
Unfortunately, not for 3.6
Paul, One possible solution I can think of is adding a source variable (like active_pagebook_page). The contributions can be made to the toolbar/menu uri of the view and can have a visibleWhen element using the source variable. Is this ok or should we go with any alternative approaches?
(In reply to comment #4) > Paul, > > One possible solution I can think of is adding a source variable (like > active_pagebook_page). The contributions can be made to the toolbar/menu uri of > the view and can have a visibleWhen element using the source variable. Is this > ok or should we go with any alternative approaches? What we have today: A pagebook view gets its IActionBars, and a ToolBarManager/MenuManager from the framework. When the pagebook view creates a page, it uses SubActionBars. So a specific page gets its IToolBarManager and adds to it ... but they're really SubContributionItems going into a SubContributionManager. The question is, how do we correctly add items into the middle of the SCIs PW
Created attachment 183904 [details] Patch v01 (In reply to comment #5) > The question is, how do we correctly add items into the middle of the SCIs By creating a dummy toolbar/menu managers and updating the actual managers with the contributed items. We would need an id for the page to populate the contributions. Is this good?
(In reply to comment #6) > Created an attachment (id=183904) [details] > Patch v01 I had a quick look at the patch. 1) the items would potentially be out of order in the page toolbar as they were added in a block. Also, some contributions that depend on programmatic IContributionItems (after=some.id) would not be added. 2) We record the ContributionManagers that are passed in to the IMenuService for both updates and because the contributions need to be released when the ContributionManager is no longer in use. That breaks this API contract. PW
*** Bug 75737 has been marked as a duplicate of this bug. ***
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.