Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[platform-ui-dev] dynamic content in pop-up menus for objectContribution

My apologies for posting to the dev list, but we've spent considerable time looking for the answer.

Is it possible to contribute dynamic content (as in late-binding actions and labels) to a cascaded pop-up menu in an objectContribution? I've read through the plugin schemas and it seems that objectContributions in the context of a pop-up menu extension have a limited set of attributes that do not support dynamic actions.

I also tried attaching an actionSet (within actionSet extension) to a menu defined within a pop-up extension. But of course, you know that didn't work.

The OpenWith class is used often for dynamic menu content, but only in viewContribution(s), as far as I see.

The debug team is working on creating Run/Debug in a context menu, which will be most useful as an objectContribution. I would greatly appreciate any hints.

Cheers, Chris

P.S. Pasted below is non-working attempt that shows the desired feature.

Chris Tilt
IBM/US/Beaverton
Eclipse Debug Team

<!-- ========================================= -->
<!-- Contextual Launch Menu (Work in Progress) -->
<!-- ========================================= -->
   <extension
point="org.eclipse.ui.popupMenus"> <!-- this is what we are extending -->
      <objectContribution
            objectClass="org.eclipse.core.resources.IResource"
            id="org.eclipse.debug.ui.contextualLaunch">
		<menu
				label="%LaunchMenu.label"
				path="additions"
id="contextualLaunch.popupMenu"> <!-- others may reference this launch pop-up -->
			<separator
				name="launchGroup">
			</separator>
		</menu>
	  </objectContribution>
	</extension>
<!-- Add Run and Debug Menu Group points to the Contextual Launch pop-up -->
	<extension
         point="org.eclipse.ui.popupMenus">
      <objectContribution
            objectClass="org.eclipse.core.resources.IResource"
            id="org.eclipse.debug.ui.contextualLaunch.run_debug">
         <menu
               label="%LaunchActionsMenu.label"
               path="contextualLaunch.popupMenu/launchGroup"
               id="org.eclipse.debug.ui.contextual.launch">
            <separator
                  name="runGroup">
            </separator>
            <separator
                  name="debugGroup">
            </separator>
         </menu>
       </objectContribution>
	</extension>
	<!-- Add specific Run and Debug Actions to the Contextual Launch pop-up -->
	<extension
         point="org.eclipse.ui.actionSets">
      <actionSet
            label="%LaunchActions.label"
            visible="true"
            id="org.eclipse.debug.ui.ContextualLaunchActions">
         <action

definitionId="org.eclipse.debug.internal.ui.actions.RunHistoryMenuAction"
               label="%RunAsMenu.label"
               style="pulldown"

class="org.eclipse.debug.internal.ui.actions.ContextualRunAs"

menubarPath="org.eclipse.debug.ui.contextual.launch/runGroup"
               id="org.eclipse.debug.internal.ui.actions.ContextualRunAs">
         </action>
         <action

definitionId="org.eclipse.debug.internal.ui.actions.DebugHistoryMenuAction"
               label="%DebugAsMenu.label"
               style="pulldown"

class="org.eclipse.debug.internal.ui.actions.ContextualDebugAs"

menubarPath="org.eclipse.debug.ui.contextual.launch/debugGroup"

id="org.eclipse.debug.internal.ui.actions.ContextualDebugAs">
         </action>
      </actionSet>
    </extension>


Back to the top