ActionBarAdvisor with ActionSets failing to load actions [message #435975] |
Fri, 26 August 2005 20:32 |
Justin Couch Messages: 1 Registered: July 2009 |
Junior Member |
|
|
I'm faced with a rather baffling problem with Eclipse 3.1 and the
combination of a custom ActionBarAdvisor and trying to add new menus and
menu items. I've looked at a lot of custom RCP apps out there and of
course every online tutorial I can find and still coming up with a blank.
My code is the typical setup:
public void fillMenuBar(IMenuManager mgr)
{
IActionBarConfigurer conf = getActionBarConfigurer();
IWorkbenchWindowConfigurer w_conf = conf.getWindowConfigurer();
IWorkbenchWindow window = w_conf.getWindow();
mgr.add(createFileMenu(window));
mgr.add(createEditMenu(window));
mgr.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
mgr.add(createHelpMenu(window));
}
with a plugin.xml that looks somewhat like this:
<extension point="org.eclipse.ui.actionsSets">
<menu id="user" label="User Management"/>
<actionSet label="User management menus" visible="true"
id="org.iloc.ui.user.userActionSet">
<action
label="Login"
class="org.iloc.ui.user.LoginAction"
allowLabelUpdates="true"
name="User login management"
menubarPath="user"
id="org.iloc.ui.user.actions.LoginAction"
/>
</actionSet>
</extension>
(alternatively the menubarPath could be something in one of the existing
menus like file/additions, either way it doesn't work).
My action class (LoginAction) implements IWorkbenchWindowActionDelegate.
What is happening is that eclipse is loading the plugin definition fine,
but never goes on to resolve the action itself (ie about dialog says the
plugin state is Resolved, not Active) and place it in the menu.
As far as I can see, everything is by the book according to tutorials
and example code. There's only one small difference in that we're not
using any perspective
(MyWorkbenchAdvisor.getInitialWindowPerspectiveId() returns null). I've
seen one vague reference that actionSets are only resolved relative to
an active perspective, but there's been nothing to corroborate that.
I'm completely baffled as to why it is not loading up the action
delegates. Would greatly appreciate any tips or pointers into getting
this working. I've spent 2 days now banging my head against the wall :(
Justin Couch
|
|
|
Powered by
FUDForum. Page generated in 0.02734 seconds