Summary: | [templates] New extension wizards for commands with toggle & radio state | ||||||
---|---|---|---|---|---|---|---|
Product: | [Eclipse Project] PDE | Reporter: | Prakash Rangaraj <prakash> | ||||
Component: | UI | Assignee: | PDE-UI-Inbox <pde-ui-inbox> | ||||
Status: | NEW --- | QA Contact: | |||||
Severity: | enhancement | ||||||
Priority: | P3 | CC: | contact, mjmeijer | ||||
Version: | 3.5 | ||||||
Target Milestone: | --- | ||||||
Hardware: | All | ||||||
OS: | All | ||||||
Whiteboard: | |||||||
Attachments: |
|
Description
Prakash Rangaraj
2009-03-18 02:05:09 EDT
Is this a duplicate almost of bug#194669? Toggling a Menu Command with two descriptions depending on state is already done the resolution of bug 395795. The trick is to use two 'push' style menuContributions with alternating visibility depending on presence or absence of the desired projectNature. <extension point="org.eclipse.ui.menus"> <menuContribution locationURI="popup:org.eclipse.ui.projectConfigure?after=additions"> <command commandId="bug269138.addRemoveSampleNature" label="Disable Sample builder" style="push"> <visibleWhen checkEnabled="false"> <with variable="selection"> <count value="1"> </count> <iterate> <adapt type="org.eclipse.core.resources.IProject"> <test value="bug269138.sampleNature" property="org.eclipse.core.resources.projectNature"> </test> </adapt> </iterate> </with> </visibleWhen> </command> <command commandId="bug269138.addRemoveSampleNature" label="Enable Sample builder" style="push"> <visibleWhen checkEnabled="false"> <with variable="selection"> <count value="1"> </count> <iterate> <adapt type="org.eclipse.core.resources.IProject"> <not> <test value="bug269138.sampleNature" property="org.eclipse.core.resources.projectNature"> </test> </not> </adapt> </iterate> </with> </visibleWhen> </command> </menuContribution> </extension> The code for this can be extracted and put in a separated template. The above plugin.xml code is generated in org.eclipse.pde.internal.ui.templates.ide.BuilderTemplate.updateModel(IProgressMonitor) Attaching Mylyn context. Created attachment 253494 [details]
mylyn/context/zip
|