Skip to main content

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

Nick, thanks for your note. Just to be sure I'm not missing the point, are you saying there is no way to add dynamic content (code or xml) in the context of an objectContribution rather than a toolbar or view?

I looked at the OpenWithMenu and I see other examples that add "drop down" style menus, but they all stem from toolbars or views. If there is a mechanism, even with code, that I can build a "drop down" menu from an object context, please hit me over the head with it.

Justification: we are trying to implement the contextual launch in such a way as to minimize the need for further extension point contributions (since most of the data is already specified for launch shortcuts). We want it to be as general as possible so that it works in all reasonable views and perhaps editors.

Thanks, Chris

Nick Edgar wrote:

Chris,

ObjectContributions do not currently support dynamic items, nor do viewActions or editorActions. And action sets only apply to the main menus and toolbars (independent of selection). The Open With submenu in our views is added in code, not via extensio (If you're interested, see o.e.ui.actions.OpenWithMenu and o.e.ui.views.navigator.OpenActionGroup.fillOpenWithMenu). It would be feasible to add the "dropdown" style similar to what's in action sets. The corresponding interface is IWorkbenchWindowPulldownDelegate2. Darin (either S or W) knows all about this one.

Nick





Chris Tilt <chris@xxxxxxxxx> Sent by: platform-ui-dev-admin@xxxxxxxxxxx
01/19/2004 07:17 PM
Please respond to
platform-ui-dev


To
platform-ui-dev@xxxxxxxxxxx
cc

Subject
[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>
_______________________________________________
platform-ui-dev mailing list
platform-ui-dev@xxxxxxxxxxx
http://dev.eclipse.org/mailman/listinfo/platform-ui-dev


_______________________________________________
platform-ui-dev mailing list
platform-ui-dev@xxxxxxxxxxx
http://dev.eclipse.org/mailman/listinfo/platform-ui-dev



Back to the top