Skip to main content


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 08:23 Go to next message
Binuraj Mising name is currently offline Binuraj Mising nameFriend
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 16:17 Go to previous message
Craig Foote is currently offline Craig FooteFriend
Messages: 217
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: Tue Apr 16 21:16:46 GMT 2024

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

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

Back to the top