Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Visibility of context menu option(Using core.expressions.definitions for conditional display of context menu options)
Visibility of context menu option [message #1036793] Mon, 08 April 2013 20:35
Jane M.  is currently offline Jane M. Friend
Messages: 9
Registered: August 2011
Junior Member
I want to use org.eclipse.core.expressions.definitions to make a context menu option visible conditionally. What expression should I use to evaluate whether the menu option displays based on a preference setting in the plugin. The preference is visible at runtime, so I set forcePluginActivation to true. I tried using the 'test' expression. Would the ProjectPropertyTester apply here? Or, maybe the 'test' expression isn't the correct one? The code below was an attempt but it doesn't work.

<extension
point="org.eclipse.core.expressions.definitions">
<definition
id="expression.">
<test
forcePluginActivation="true"
property="com.test.myPreference.PREF_CHECKED"
value="true">
</test>
</definition>
</extension>

Using the expression in my menuContribution. The CheckOut menu option displays if I don't implement the code above.

<menuContribution
allPopups="false"
locationURI="popup:org.eclipse.ui.popup.any?after=additions ">
<command
commandId="myplugin.myContribution.CheckOut"
mnemonic="C"
style="push">
<visibleWhen
checkEnabled="false">
<reference
definitionId="expression.onlyOneItemSelected">
</reference>
</visibleWhen>
</command>
</menuContribution>
Previous Topic:Need to add Weblogic plugin to Eclipse Juno
Next Topic:Arduino 1.5.2
Goto Forum:
  


Current Time: Tue Apr 23 11:54:38 GMT 2024

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

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

Back to the top