Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » ShowViewMenu and activities
ShowViewMenu and activities [message #336239] Tue, 02 June 2009 19:41 Go to next message
Albert Choi is currently offline Albert ChoiFriend
Messages: 4
Registered: July 2009
Junior Member

I have a question about the behaviour of the Show View Menu in conjunction
activities, a.k.a. capabilities. I have a plugin (say pluginB) which
contributes a viewShortcut and a perspectiveShortcut to a custom
which exists in pluginA:

<extension point="org.eclipse.ui.perspectiveExtensions">
<perspectiveExtension targetID="pluginA.myPerspective">
<viewShortcut id="pluginB.myView">
<perspectiveExtension targetID="pluginA.myPerspective">
<perspectiveShortcut id="pluginB.myOtherPerspective">

I also have a extension for org.eclipse.ui.activities. pluginA is mapped
to one
activity, and pluginB and mapped to another activity. E.g.

<extension point="org.eclipse.ui.activities">
<activity id="activityA" name="Activity A">
<activity id="activityB" name="Activity B">
<activityPatternBinding activityId="activityA" pattern="pluginA/.*">
<activityPatternBinding activityId="activityB" pattern="pluginB/.*">

If I have pluginA.myPerspective open, I see pluginB.myOtherPerspective in
Open Perspective menu, and pluginB.myView in the Show View menu, as
When I go to disable activityB in the Capabilities preference page,
pluginB.myOtherPerspective disappears from the Open Perspective menu
(good), but
pluginB.myView remains in the Show View menu (bad).

I was able to trace the issue to the internal class
org.eclipse.ui.internal.ShowViewMenu. In particular, it executes the
when it populates the menu:

for (Iterator i = actions.iterator(); i.hasNext();) {
CommandContributionItem item =
new CommandContributionItem(
if (WorkbenchActivityHelper.filterItem(item)) {

This is the right idea, but WorkbenchActivityHelper has the following

public static final boolean filterItem(Object object) {
if (object instanceof IPluginContribution) {
return false;

Trouble is, CommandContributionItem is not derived from
Therefore, the items are never filtered out.

Am I reading this right? Are there any workarounds for this issue? Any
would be appreciated.

Albert Choi
Re: ShowViewMenu and activities [message #336265 is a reply to message #336239] Thu, 04 June 2009 12:54 Go to previous message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

Please open a bug at &component=UI
that CommandContributionItems aren't filtered correctly


Paul Webster e.platform.doc.isv/guide/workbench.htm

Previous Topic:get the active project
Next Topic:How to make an editor readonly
Goto Forum:

Current Time: Tue May 22 10:21:06 GMT 2018

Powered by FUDForum. Page generated in 0.01943 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top