Skip to main content


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 13:57 Go to next message
Sebastian  is currently offline Sebastian Friend
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 14:31 Go to previous messageGo to next message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
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 14:45 Go to previous messageGo to next message
Sebastian  is currently offline Sebastian Friend
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 18:40 Go to previous message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
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: Fri Apr 26 10:30:12 GMT 2024

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

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

Back to the top