Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Evaluating the VisibleWhen tag in menu contributions(Is is possible to programatically evaluate the visibleWhen tag in menu contributions?)
Evaluating the VisibleWhen tag in menu contributions [message #647902] Mon, 10 January 2011 06:43 Go to next message
Saurabh Mising name is currently offline Saurabh Mising name
Messages: 21
Registered: October 2010
Junior Member
I am using the extension registry to read menu contributions programatically.
The element "menu" has a visibleWhen tag.
I want to evaluate the visibleWhen tag programatically. If the menu is not visible, then i want to change my logic.

Is there a way to do this in eclipse?
Thanks,
Saurabh
Re: Evaluating the VisibleWhen tag in menu contributions [message #647926 is a reply to message #647902] Mon, 10 January 2011 08:44 Go to previous messageGo to next message
Paul Webster is currently offline Paul Webster
Messages: 6857
Registered: July 2009
Location: Ottawa
Senior Member

On 01/10/2011 06:43 AM, Saurabh wrote:
> I am using the extension registry to read menu contributions
> programatically.
> The element "menu" has a visibleWhen tag.
> I want to evaluate the visibleWhen tag programatically. If the menu is
> not visible, then i want to change my logic.

if you read the extension, you have IConfigurationElements?
IEvaluationService is the service that updates eclipse's global
application state from all of the source providers (i.e. it maintains
all of the variables mentioned in ISources).

You can turn the first valid core expression child into a programmatic
expression using
org.eclipse.core.expressions.ExpressionConverter.getDefault( ).perform(configElement)

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: Evaluating the VisibleWhen tag in menu contributions [message #647934 is a reply to message #647926] Mon, 10 January 2011 09:05 Go to previous message
Saurabh Mising name is currently offline Saurabh Mising name
Messages: 21
Registered: October 2010
Junior Member
Paul,
Thanks a lot for the help. I was struggling for a while to get this information.

Regards,
Saurabh
Previous Topic:Repository for the different localized version of rcp
Next Topic:Query current activation state of handlers in plugin.xml
Goto Forum:
  


Current Time: Wed Jul 23 08:00:55 EDT 2014

Powered by FUDForum. Page generated in 0.01784 seconds