[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.platform.rcp] Re: Radio Context Menu in View

Guillaume Boivin wrote:
Thanks for the quick reply Paul. According to your answers:

Paul Webster wrote:

The menu contributions are applied after any programmatic actions (Properties is added by the Package Explorer) but before any action contributions (like popupMenus). If the Properties action had an ID you could place yourself after it, but I wasn't able to find an ID for that action. There are enhancements to the locationURI to include some other options (append maybe, or after/before) but they won't be available until 3.4.

query section). By using the constants' values from the interface org.eclipse.search.ui.IContextMenuConstants, you can add your contribution precisely at the desired location. In my case, popup:org.eclipse.ui.popup.any?after=group.properties is good except for the query section I'm not able to set properly. As mentionned in my initial post, tried the group.additions but didn't worked. Remember that I want to add my menu contribution at the VERY END of the menu.

Right, my point was you cannot do that in 3.3 ... you are already after the group.properties group, but because of the processing order Properties shows up at the end. Properties doesn't have an ID, so there's no way to say ?after=org.eclipse.properties.action. In 3.4 there will hopefully be additional query operations available (as opposed to just "after" and "before").



I don't know yet how to link a "command" Extension with my org.eclipse.ui.menus extension. Also, you mention the notion of handler. I'm lost. Should I add an org.eclipse.ui.commands extension and set the defaultHandler field to a custom built class that implements IHandler and IElementUpdater? How do I link all these extensions together? Do you have a plugin.xml code snippet you could provide?
Thanks in advance,

An example of using IElementUpdater is available in the org.eclipse.ui.tests plugin, ToggleContextHandler.


http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.ui.tests/Eclipse%20UI%20Tests/org/eclipse/ui/tests/menus/ToggleContextHandler.java?view=co

You can see how it is used in the org.eclipse.ui.tests/plugin.xml by tracking the command id, org.eclipse.ui.tests.menus.toggleContext

This is a little different from your scenario, as it is implementing a set of toggle commands (parameterized on the specific context they toggle).

Later,
PW