Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » popupMenu visibility restrictions
popupMenu visibility restrictions [message #632301] Tue, 12 October 2010 09:57 Go to next message
Sebastian  is currently offline Sebastian
Messages: 22
Registered: September 2010
Junior Member
Hey,

I am adding an action to a TableViewers context menu in a different plug-in using the popupMenu extension.

Now, what I want is to only show this menu item when a certain perspective is active.


Please advise Smile
Re: popupMenu visibility restrictions [message #632318 is a reply to message #632301] Tue, 12 October 2010 10:31 Go to previous messageGo to next message
Paul Webster is currently offline Paul Webster
Messages: 6857
Registered: July 2009
Location: Ottawa
Senior Member

Well, popupMenus/objectContributions supports enablement, which is the
core expressions enablement. That's extensible enough that you could
write a property tester of some kind and find out if you're in the right
perspective.

PW

--
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Platform_Expression_Framework
http://wiki.eclipse.org/Menu_Contributions
http://wiki.eclipse.org/Menus_Extension_Mapping
http://help.eclipse.org/galileo/index.jsp?topic=/org.eclipse .platform.doc.isv/guide/workbench.htm


Re: popupMenu visibility restrictions [message #632321 is a reply to message #632301] Tue, 12 October 2010 10:45 Go to previous messageGo to next message
Sebastian  is currently offline Sebastian
Messages: 22
Registered: September 2010
Junior Member
Hey Paul,

thanks for your reply.

Could you help me a little more here? Because I don't really know where to start right now.

Oh, I am using a viewerContribution.
Re: popupMenu visibility restrictions [message #632398 is a reply to message #632321] Tue, 12 October 2010 14:40 Go to previous message
Paul Webster is currently offline Paul Webster
Messages: 6857
Registered: July 2009
Location: Ottawa
Senior Member

Sebastian wrote:
>
> Oh, I am using a viewerContribution.

You're out of luck, then. It only works for objectContributions. You
should consider org.eclipse.ui.menus and commands/handlers. Partly
because it is the command framework, but also because the visibleWhen
can be used more expressively than the objectClass/objectState code.

A good starting point on our use of core expressions:
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Platform_Expression_Framework


PW


--
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Platform_Expression_Framework
http://wiki.eclipse.org/Menu_Contributions
http://wiki.eclipse.org/Menus_Extension_Mapping
http://help.eclipse.org/galileo/index.jsp?topic=/org.eclipse .platform.doc.isv/guide/workbench.htm


Previous Topic:JRE gets included in product
Next Topic:RCP Start View
Goto Forum:
  


Current Time: Wed Jul 23 14:09:38 EDT 2014

Powered by FUDForum. Page generated in 0.01551 seconds