Summary: | [IDE] A registry of nature to "Nature Configuration Wizards" | ||
---|---|---|---|
Product: | [Eclipse Project] Platform | Reporter: | Mickael Istria <mistria> |
Component: | UI | Assignee: | Platform UI Triaged <platform-ui-triaged> |
Status: | NEW --- | QA Contact: | |
Severity: | enhancement | ||
Priority: | P3 | ||
Version: | 4.4 | ||
Target Milestone: | --- | ||
Hardware: | All | ||
OS: | All | ||
See Also: |
https://bugs.eclipse.org/bugs/show_bug.cgi?id=102527 https://bugs.eclipse.org/bugs/show_bug.cgi?id=354524 |
||
Whiteboard: |
Description
Mickael Istria
2014-02-13 06:32:12 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")); } } } 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 |