Skip to main content



      Home
Home » Eclipse Projects » Rich Client Platform (RCP) » How to make new-wizards *actually* show up in the File menu/ toolbar? (broken in 3.2?)
How to make new-wizards *actually* show up in the File menu/ toolbar? (broken in 3.2?) [message #460060] Tue, 12 December 2006 16:23 Go to next message
Eclipse UserFriend
R3.2.1, WinXP

I have two items plugged into newWizard, both of which appear in the "new wizard" when the user
presses "CTRL-N", and both work.

But the docco does not address the issue of adding new-wizards to the file-menu or the toolbar, so
far as I can see; and the two earlier posts on this newsgroup give sample code/markup that does not
work. (They are for 3.1, so maybe newWizards got broken in RCP in 3.2?) I never see my new-wizards
on my toolbar at all; and the File-menu => "New" shows me only the "Other..." item (which indeed
opens the new-wizard with my two items), and never do I get my two items into that submenu, no
matter what I have put in for "category".

Here is my *plugin.xml* (both for the newWizard and the perspectiveExtension):

<extension
point="org.eclipse.ui.perspectiveExtensions">
<perspectiveExtension targetID="com.mun.ist.app.myPerspective">
<newWizardShortcut id="com.mun.ist.app.newFooWizard"/>
<newWizardShortcut id="com.mun.ist.app.newSchmooWizard"/>
</perspectiveExtension>
</extension>
<extension
point="org.eclipse.ui.newWizards">
<wizard
canFinishEarly="true"
category="org.eclipse.ui.Basic"
class="com.mun.ist.app.editors.NewFooWizard"
finalPerspective="com.mun.ist.app.myPerspective"
hasPages="false"
icon="icons/newFoo.PNG"
id="com.mun.ist.app.newFooWizard"
name="New Fact Query"
project="false"/>
<wizard
canFinishEarly="true"
category="org.eclipse.ui.Basic"
class="com.mun.ist.app.editors.NewSchmooWizard"
finalPerspective="com.mun.ist.app.myPerspective"
hasPages="false"
icon="icons/newSchmoo.PNG"
id="com.mun.ist.app.newSchmooWizard"
name="New Semantic Query"
project="false"/>
</extension>

(I've also tried putting the following code into the persp-factory of com.mun.ist.app.myPerspective,
with success or even effect:
public void createInitialLayout(final IPageLayout layout) {
layout.addNewWizardShortcut("com.mun.ist.app.newFooWizard");
layout.addNewWizardShortcut("com.mun.ist.app.newSchmooWizard ");
<other typical persp-factory code>
}
)

Here is what I have in my *ActionBarAdvisor* class:

@Override
protected void fillCoolBar(final ICoolBarManager coolBar) {
super.fillCoolBar(coolBar);
final IWorkbenchWindow window =
getActionBarConfigurer().getWindowConfigurer().getWindow();
register(ActionFactory.NEW_WIZARD_DROP_DOWN.create(window));
coolBar.add(getAction(ActionFactory.NEW_WIZARD_DROP_DOWN.get Id()));
}
@Override
protected void fillMenuBar(final IMenuManager menuBar) {
final IWorkbenchWindow window =
getActionBarConfigurer().getWindowConfigurer().getWindow();
menuBar.add(createFileMenu(window));
menuBar.add(createEditMenu(window));
menuBar.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
menuBar.add(createWindowMenu(window));
menuBar.add(createHelpMenu(window));
}
protected MenuManager createFileMenu(final IWorkbenchWindow window) {
MenuManager menu =
new MenuManager(FILE_MENU, IWorkbenchActionConstants.M_FILE);
menu.add(new GroupMarker(IWorkbenchActionConstants.FILE_START));

// this causes a "New Wizards..." item to appear, but its submenu says:
// "<No Applicable Items>"
// register(ActionFactory.NEW_WIZARD_DROP_DOWN.create(window));
// menu.add(getAction(ActionFactory.NEW_WIZARD_DROP_DOWN.getId( )));

final String newId = ActionFactory.NEW.getId();
final MenuManager newMenu = new MenuManager("New...", newId);
newMenu.add(new Separator(newId));
final IContributionItem newWizards =
ContributionItemFactory.NEW_WIZARD_SHORTLIST.create(window);
newMenu.add(newWizards);
newMenu.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
menu.add(newMenu);
<add other actions, all fine>
}

So -- what is missing?

thanks,
Paul
Re: How to make new-wizards *actually* show up in the File menu/ toolbar? (broken in 3.2?) [message #460063 is a reply to message #460060] Tue, 12 December 2006 16:53 Go to previous message
Eclipse UserFriend
Hmm -- adding a trailing "/" to the "category" makes my new-wizards show up properly in the File
menu -- not altogether clear from the docco!

But they still do not appear on the toolbar ...

Paul
Previous Topic:any API to set description and/or title of the "new wizard"?
Next Topic:Automatic Updates and New Features
Goto Forum:
  


Current Time: Tue Mar 18 01:10:20 EDT 2025

Powered by FUDForum. Page generated in 0.03683 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top