Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Hide menus thr' activities/perspectiveExtensions not working(Hide menus thr' activities/perspectiveExtensions not working)
Hide menus thr' activities/perspectiveExtensions not working [message #736687] Fri, 14 October 2011 04:23 Go to next message
Binuraj Mising name is currently offline Binuraj Mising name
Messages: 3
Registered: October 2011
Junior Member
Hi,

I am trying to hide a menu contribution by trying two approaches .

Approach 1- through "org.eclipse.ui.activities"
The menu is defined as given below

Snippet -1
<command commandId="com.teamcenter.rac.newPart"
id="com.teamcenter.rac.pse.mc.newPart"
mnemonic="%newPartAction.MNEMONIC">
<visibleWhen>
<and>
<reference
definitionId="com.teamcenter.rac.pse.inMainView"/>
<with variable="rac_command_suppression">
<not>
<iterate operator="or">
<equals value="com.teamcenter.rac.newPart"/>
</iterate>
</not>
</with>
</and>
</visibleWhen>
</command>

I have tried the following to hide this menu iseing activities

Snippet -2
<extension point="org.eclipse.ui.activities">
<activity id="com.teamcenter.rac.VMPartPse" name="HideCommonPartMenuPse" description="This activIty will hide the common Part menu when VM is installed" />
<activityPatternBinding activityId="com.teamcenter.rac.VMPartPse" isEqualityPattern="true"
pattern="com.teamcenter.rac.pse/com.teamcenter.rac.pse.mc.newPart">
</activityPatternBinding>
</extension>

Here "com.teamcenter.rac.pse" is the plugin id and "com.teamcenter.rac.pse.mc.newPart" is the command id in menu contribution as given in Snippet -1.

Any idea why this is not working?

Approach -2 though "org.eclipse.ui.perspectiveExtensions"
I have tried an alternative option using "org.eclipse.ui.perspectiveExtensions" as given below

Snippet-3
<extension point="org.eclipse.ui.perspectiveExtensions">
<perspectiveExtension targetID="com.teamcenter.rac.pse.PSEPerspective">
<hiddenMenuItem id="com.teamcenter.rac.newPart" />
</perspectiveExtension>
</extension>

Any idea why these options are not working?

Thanks
Binu

Note: I have successfully hidden menus using the approach-1 for one use case.
But the same is now working for another usecase.


Can I achieve the same through any other mechanism, like context?

Here my constraint is I don't have permission to edit the already existing menu contribution which I am trying to hide from my custom plugin.

Thanks
Binu
Re: Hide menus thr' activities/perspectiveExtensions not working [message #741538 is a reply to message #736687] Wed, 19 October 2011 12:17 Go to previous message
Craig Foote is currently offline Craig Foote
Messages: 195
Registered: July 2009
Senior Member
"..."com.teamcenter.rac.pse.mc.newPart" is the command id..."

<extension point="org.eclipse.ui.perspectiveExtensions">
<perspectiveExtension targetID="com.teamcenter.rac.pse.PSEPerspective">
<hiddenMenuItem id="com.teamcenter.rac.pse.mc.newPart" />
</perspectiveExtension>
</extension>
Previous Topic:How to call a handler from a popup menu or generate an ExecutionEvent?
Next Topic:Show a particular PreferencePage?
Goto Forum:
  


Current Time: Fri Aug 22 13:55:29 EDT 2014

Powered by FUDForum. Page generated in 0.01641 seconds