Context Sensitive New-wizard [message #537291] |
Tue, 01 June 2010 19:46 |
Troy Nichols Messages: 28 Registered: July 2009 |
Junior Member |
|
|
Hello,
Question about how to make the available "New..." wizards in the
(right-click) popup context menu (Package Explorer) context-sensitive,
i.e. available wizards are filtered based on what resource is currently
selected in Package Explorer.
We have a set of plugins that contributes our own perspective. Part of
our tooling includes adding some New wizard extensions, via the
org.eclipse.ui.newWizards extension point. We have created our own
category for these wizards, and they show up in the expected way if go
into File > New > Other... and find them under our category.
To get the wizards to show up in the right-click context menu, we are
calling some code like this in our Perspective class's
createInitialLayout() method:
layout.addNewWizardShortcut(SOME_WIZARD_ID);
There are about 15 new-wizards in all, and currently they always show up
in the File > New menu, no matter what kind of resource is selected.
Certain wizards really only apply to certain kinds of resources though,
so we would like to be able to filter based on type. This is how it
works in JDT, for instance, so it does seem to be possible (e.g. if you
have selected a Java resource, get the option to pick some Java-related
wizards, etc).
What is the best way to filter which wizards show up in File > New based
on the type of resource currently selected?
|
|
|
Powered by
FUDForum. Page generated in 0.03092 seconds