dynamic sub menu ala Build Configurations -> Set Active [message #197794] |
Thu, 19 July 2007 10:49 |
Eclipse User |
|
|
|
Originally posted by: g_boivin_dufault.hotmail.com
Hi,
I want to achieve in my Plug In something similar to the Build
Configurations -> Set Active popup menu under the Project Explorer. I've
started to implement it with an org.eclipse.ui.menus extension (new since
3.3). I'm using a dynamic element (under a menuContribution element/menu
element) that populates my popup menu via a built in class that extends
the org.eclipse.ui.actions.CompoundContributionItem class. The thing is I
don't know how to let my Plug In know that a dynamic subMenu item has been
selected. I'm lost with the command/handler notion. Could someone give me
a plugin.xml code snippet or give me pointers to what elements are missing
in my own plugin.xml code?
My plugin.xml :
<extension
point="org.eclipse.ui.menus">
<menuContribution
locationURI="popup:org.eclipse.ui.popup.any?after=group.properties ">
<menu
id="aMenuId"
label="aLabel">
<dynamic
class="aBuiltInClass that extends org.eclipse.ui.actions.
CompoundContributionItem"
id="aDynamicClassId">
</dynamic>
<visibleWhen>
<iterate>
<adapt
type="org.eclipse.core.resources.IResource">
<test
property="org.eclipse.core.resources.projectNature"
value="aCustomProjectNature">
</test>
</adapt>
</iterate>
</visibleWhen>
<!-- Do I put a command element here??? (inside the menu
element) - ->
<command
commandId="aCommandId"
id="anId">
</command>
</menu>
<!-- Or here??? (inside the menuContribution element)-->
<command
commandId="aCommandId"
id="anId">
</command>
</menuContribution>
</extension>
<!-- Or maybe as a new extension???
<extension
point="org.eclipse.ui.commands">
<command
defaultHandler="aBuiltInHandlerClass"
id="anId"
name="aName">
</command>
</extension>
Thanks in advance,
Guillaume Boivin
|
|
|
Powered by
FUDForum. Page generated in 0.06718 seconds