Bug 428089 - [IDE] A registry of nature to "Nature Configuration Wizards"
Summary: [IDE] A registry of nature to "Nature Configuration Wizards"
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.4   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Platform UI Triaged CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-02-13 06:32 EST by Mickael Istria CLA
Modified: 2014-10-22 08:08 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mickael Istria CLA 2014-02-13 06:32:12 EST
It would be quite helpful in order to improve the "Import Project" and "project managemetn after import" scenarios to set up a registry (most likely an extension point), that would allow to configure a new nature for a given project.

This extension point could be consumed by the current Configure menu to show the possible natures to enable on a project, or in hthe "Nature" project property page as suggested in bug 102527
It also somehow makes sense for bug 37478, which is about importing any folder as a new project: with this mechanism, user could 1st create project, and then see a list of available natures to configure for the project

This could have 2 methods:
* showForProject(IProject) to determine whether to show this in the context menu (or list of available wizards in case of import of a new projecT)
* applyTo(IProject) that would apply the settings of the project
Comment 1 Paul Webster CLA 2014-02-13 15:14:44 EST
Right now contributing a conversion wizard is adding the appropriate action/command to launch the contributors wizard to IWorkbenchActionConstants.M_PROJECT_CONFIGURE.

If I scan what's in my SDK (eclipse classic + xtext, emf, and egit):
action: Convert to Plug-in Projects...
action: Convert Jars to Plug-in Projects...
action: Add Xtext Nature
action: Remove Xtext Nature


The code I used to do it:
MApplication app = (MApplication) window.getService(MApplication.class);
for (MMenuContribution contribution : app.getMenuContributions()) {
	if (IWorkbenchActionConstants.M_PROJECT_CONFIGURE
			.equals(contribution.getParentId())) {
		for (MMenuElement element : contribution.getChildren()) {
			if (element instanceof MMenuItem) {
				System.out.println("command: " + element.getLabel());
			}
		}
	}
}
IExtensionRegistry registry = (IExtensionRegistry) window
		.getService(IExtensionRegistry.class);
for (IConfigurationElement element : registry
		.getConfigurationElementsFor("org.eclipse.ui.popupMenus")) {
	for (IConfigurationElement action : element.getChildren("action")) {
		String path = action.getAttribute("menubarPath");
		if (path != null
				&& path.startsWith(IWorkbenchActionConstants.M_PROJECT_CONFIGURE)) {
			System.out.println("action: " + action.getAttribute("label"));
		}
	}
}
Comment 2 Paul Webster CLA 2014-02-13 15:16:12 EST
So having a guaranteed location to put a conversion wizard, only PDE and XText offer it (out of my selection).

Adding an extension point would probably make it easier to offer both (the Configure submenu and a property page) but I don't see a lot of buy in and Configure has been available for quite a while now.

PW