Confused with actions [message #328914] |
Fri, 06 June 2008 11:48 |
Eclipse User |
|
|
|
Hi,
I need to contribute action to workbench toolbar and make it enabled if C
project or C editor selected.
Well, I made action enabled for C project using the following extension
point:
<extension
point="org.eclipse.ui.actionSets">
<actionSet
id="myplug.actionSet"
label="Sample Action Set"
visible="true">
<menu
id="sampleMenu"
label="Sample &Menu">
<separator
name="sampleGroup">
</separator>
</menu>
<action
class="myplug.actions.SampleAction"
icon="icons/sample.gif"
id="myplug.actions.SampleAction"
label="&Sample Action"
menubarPath="sampleMenu/sampleGroup"
toolbarPath="sampleGroup"
tooltip="Hello, Eclipse world">
<enablement>
<and>
<objectClass name="org.eclipse.core.resources.IProject"/>
<objectState name="nature"
value="org.eclipse.cdt.core.cnature"/>
</and>
</enablement>
</action>
</actionSet>
</extension>
but I still don't know how to make it enabled if C editor active, please
help me.
Sergey
|
|
|
Powered by
FUDForum. Page generated in 0.06416 seconds