1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

Remore unused New New Wizard

This code is not used and hasn't been touched since 2012.
Now it can be referred as the "old new new wizard".

Change-Id: Iccc60651a8233a5ef5b138dfcc334cfcf926d109
Signed-off-by: Marc-Andre Laperle <marc-andre.laperle@ericsson.com>
This commit is contained in:
Marc-Andre Laperle 2015-12-05 13:21:54 -05:00 committed by Gerrit Code Review @ Eclipse.org
parent 00e7081b17
commit 1c258538de
20 changed files with 10 additions and 711 deletions

View file

@ -29,7 +29,7 @@ Require-Bundle: org.eclipse.ui.ide;bundle-version="[3.2.0,4.0.0)",
org.eclipse.core.resources;bundle-version="[3.2.0,4.0.0)",
org.eclipse.ui;bundle-version="[3.2.0,4.0.0)",
org.eclipse.cdt.core;bundle-version="[5.0.0,6.0.0)",
org.eclipse.cdt.ui;bundle-version="[5.0.0,6.0.0)",
org.eclipse.cdt.ui;bundle-version="[6.0.0,7.0.0)",
org.eclipse.cdt.make.core;bundle-version="[7.0.0,8.1.0)",
org.eclipse.core.runtime;bundle-version="[3.2.0,4.0.0)",
org.eclipse.debug.ui;bundle-version="[3.2.0,4.0.0)",

View file

@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.cdt.managedbuilder.ui; singleton:=true
Bundle-Version: 8.2.2.qualifier
Bundle-Version: 9.0.0.qualifier
Bundle-Activator: org.eclipse.cdt.managedbuilder.ui.properties.ManagedBuilderUIPlugin
Bundle-Vendor: %providerName
Bundle-Localization: plugin
@ -18,7 +18,7 @@ Require-Bundle: org.eclipse.core.resources;bundle-version="[3.2.0,4.0.0)",
org.eclipse.cdt.make.core,
org.eclipse.cdt.make.ui,
org.eclipse.cdt.managedbuilder.core;bundle-version="[8.1.0,9.0.0)",
org.eclipse.cdt.ui;bundle-version="[5.0.0,6.0.0)",
org.eclipse.cdt.ui;bundle-version="[6.0.0,7.0.0)",
org.eclipse.ui;bundle-version="[3.2.0,4.0.0)",
org.eclipse.ui.console;bundle-version="[3.5.100,4.0.0)",
org.eclipse.ui.ide;bundle-version="[3.2.0,4.0.0)",

View file

@ -844,29 +844,6 @@
</description>
</wizard>
</extension>
<extension
point="org.eclipse.cdt.ui.projectTypePages">
<projectTypePage
class="org.eclipse.cdt.managedbuilder.ui.wizards.ToolChainSelectionPage"
id="org.eclipse.cdt.managedbuilder.ui.exeProjectTypePage"
projectType="org.eclipse.cdt.build.core.buildArtefactType.exe">
</projectTypePage>
<projectTypePage
class="org.eclipse.cdt.managedbuilder.ui.wizards.ToolChainSelectionPage"
id="org.eclipse.cdt.managedbuilder.ui.staticLibProjectTypePage"
projectType="org.eclipse.cdt.build.core.buildArtefactType.staticLib">
</projectTypePage>
<projectTypePage
class="org.eclipse.cdt.managedbuilder.ui.wizards.ToolChainSelectionPage"
id="org.eclipse.cdt.managedbuilder.ui.sharedLibProjectTypePage"
projectType="org.eclipse.cdt.build.core.buildArtefactType.sharedLib">
</projectTypePage>
<projectTypePage
class="org.eclipse.cdt.managedbuilder.ui.wizards.ToolChainSelectionPage"
id="org.eclipse.cdt.managedbuilder.ui.makefileProjectTypePage"
projectType="org.eclipse.cdt.build.makefile.projectType">
</projectTypePage>
</extension>
<extension
point="org.eclipse.cdt.ui.LanguageSettingsProviderAssociation">
<id-association

View file

@ -11,7 +11,7 @@
<relativePath>../../pom.xml</relativePath>
</parent>
<version>8.2.2-SNAPSHOT</version>
<version>9.0.0-SNAPSHOT</version>
<artifactId>org.eclipse.cdt.managedbuilder.ui</artifactId>
<packaging>eclipse-plugin</packaging>
</project>

View file

@ -278,8 +278,6 @@ public class Messages extends NLS {
public static String WizardDefaultsTab_0;
public static String WizardDefaultsTab_1;
public static String RefreshPolicyTab_resourcesTreeLabel;
public static String ToolChainSelectionPage_Description;
public static String ToolChainSelectionPage_Title;
static {
// Initialize resource bundle.

View file

@ -288,9 +288,6 @@ NewCfgDialog_3=-- not selected --
NewCfgDialog_4=Import from projects
NewCfgDialog_5=Import predefined
ToolChainSelectionPage_Description=Select the initial toolchain for this project.
ToolChainSelectionPage_Title=Select Tool Chain
# Language Settings Providers
BuiltinSpecsDetectorOptionPage_AllocateConsole=Allocate console in the Console View
BuiltinSpecsDetectorOptionPage_Browse=Browse...

View file

@ -1,100 +0,0 @@
/*******************************************************************************
* Copyright (c) 2012 Doug Schaefer and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Doug Schaefer - initial API and implementation
*******************************************************************************/
package org.eclipse.cdt.managedbuilder.ui.wizards;
import org.eclipse.cdt.managedbuilder.core.IToolChain;
import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager;
import org.eclipse.cdt.managedbuilder.internal.ui.Messages;
import org.eclipse.cdt.ui.templateengine.Template;
import org.eclipse.cdt.ui.wizards.ProjectTypePage;
import org.eclipse.jface.wizard.IWizard;
import org.eclipse.jface.wizard.IWizardPage;
import org.eclipse.jface.wizard.WizardPage;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.List;
/**
* @since 8.1
*
*/
public class ToolChainSelectionPage extends WizardPage implements ProjectTypePage {
private IWizardPage nextPage;
private String[] toolChainIds;
private String selectedToolChainId;
private List toolChainList;
public ToolChainSelectionPage() {
super("ToolChainSelectionPage"); //$NON-NLS-1$
setTitle(Messages.ToolChainSelectionPage_Title);
setDescription(Messages.ToolChainSelectionPage_Description);
}
@Override
public void createControl(Composite parent) {
Composite comp = new Composite(parent, SWT.NONE);
comp.setLayout(new GridLayout(1, true));
toolChainList = new List(comp, SWT.BORDER | SWT.SINGLE);
toolChainList.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
for (String toolChainId : toolChainIds) {
IToolChain toolChain = ManagedBuildManager.getExtensionToolChain(toolChainId);
if (toolChain != null)
toolChainList.add(toolChain.getName());
}
toolChainList.addSelectionListener(new SelectionListener() {
@Override
public void widgetSelected(SelectionEvent e) {
if (toolChainList.getSelectionCount() == 0)
selectedToolChainId = null;
else
selectedToolChainId = toolChainIds[toolChainList.getSelectionIndex()];
}
@Override
public void widgetDefaultSelected(SelectionEvent e) {
widgetSelected(e);
}
});
setControl(comp);
}
@Override
public boolean init(Template template, IWizard wizard, IWizardPage nextPage) {
this.nextPage = nextPage;
setWizard(wizard);
toolChainIds = template.getTemplateInfo().getToolChainIds();
// only need this page if there are multiple toolChains to select from.
return toolChainIds != null && toolChainIds.length > 1;
}
@Override
public IWizardPage getNextPage() {
if (nextPage != null)
return nextPage;
return super.getNextPage();
}
@Override
public boolean isPageComplete() {
return selectedToolChainId != null;
}
}

View file

@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.cdt.ui; singleton:=true
Bundle-Version: 5.12.0.qualifier
Bundle-Version: 6.0.0.qualifier
Bundle-Activator: org.eclipse.cdt.ui.CUIPlugin
Bundle-Vendor: %providerName
Bundle-Localization: plugin

4
core/org.eclipse.cdt.ui/plugin.properties Executable file → Normal file
View file

@ -664,10 +664,6 @@ callHierarchyProviders.name = Call Hierarchy Providers
externalSearchProviders.name = External Search Providers
RefreshExclusionContributorExtensionPoint = Refresh Exclusion Contributor
# New New Project Wizard
newProjectWizard.name = C/C++ Project (prototype)
projectTypePages = Project Type Pages
semanticHighlightingExtensionPoint = Semantic Highlighting Extension Point
UserSettingEntries.name = CDT User Setting Entries

View file

@ -30,7 +30,6 @@
<extension-point id="workingSetConfigurations" name="%workingSetConfigurationsExtensionPoint" schema="schema/workingSetConfigurations.exsd"/>
<extension-point id="LanguageSettingsProviderAssociation" name="%LanguageSettingsProviderAssociationExtensionPoint" schema="schema/LanguageSettingsProviderAssociation.exsd"/>
<extension-point id="RefreshExclusionContributor" name="%RefreshExclusionContributorExtensionPoint" schema="schema/RefreshExclusionContributor.exsd"/>
<extension-point id="projectTypePages" name="%projectTypePages" schema="schema/projectTypePages.exsd"/>
<extension-point id="semanticHighlighting" name="%semanticHighlightingExtensionPoint" schema="schema/semanticHighlighting.exsd"/>
<extension
@ -459,17 +458,6 @@
%Cproject.desc
</description>
</wizard>
<!-- (defered) wizard
canFinishEarly="false"
category="org.eclipse.cdt.ui.newCWizards"
class="org.eclipse.cdt.ui.wizards.NewCDTProjectWizard"
finalPerspective="org.eclipse.cdt.ui.CPerspective"
hasPages="true"
icon="icons/elcl16/newmngc_app.gif"
id="org.eclipse.cdt.ui.wizards.newProject"
name="%newProjectWizard.name"
project="true">
</wizard-->
</extension>
<!-- Define the document setup participant for the C/C++ and Assembly Editors -->

View file

@ -11,7 +11,7 @@
<relativePath>../../pom.xml</relativePath>
</parent>
<version>5.12.0-SNAPSHOT</version>
<version>6.0.0-SNAPSHOT</version>
<artifactId>org.eclipse.cdt.ui</artifactId>
<packaging>eclipse-plugin</packaging>
</project>

View file

@ -1,80 +0,0 @@
<?xml version='1.0' encoding='UTF-8'?>
<!-- Schema file written by PDE -->
<schema targetNamespace="org.eclipse.cdt.ui" xmlns="http://www.w3.org/2001/XMLSchema">
<annotation>
<appInfo>
<meta.schema plugin="org.eclipse.cdt.ui" id="projectTypePages" name="%ProjectTypePages"/>
</appInfo>
<documentation>
This extension is used to register a page in the CDT new project wizard to support
specifying additional information based on the project type associated with a template.
</documentation>
</annotation>
<element name="extension">
<annotation>
<appInfo>
<meta.element />
</appInfo>
</annotation>
<complexType>
<sequence>
<element ref="projectTypePage" minOccurs="1" maxOccurs="unbounded"/>
</sequence>
<attribute name="point" type="string" use="required">
<annotation>
<documentation>
</documentation>
</annotation>
</attribute>
<attribute name="id" type="string">
<annotation>
<documentation>
</documentation>
</annotation>
</attribute>
<attribute name="name" type="string">
<annotation>
<documentation>
</documentation>
<appInfo>
<meta.attribute translatable="true"/>
</appInfo>
</annotation>
</attribute>
</complexType>
</element>
<element name="projectTypePage">
<complexType>
<attribute name="id" type="string" use="required">
<annotation>
<documentation>
</documentation>
<appInfo>
<meta.attribute kind="identifier"/>
</appInfo>
</annotation>
</attribute>
<attribute name="projectType" type="string" use="required">
<annotation>
<documentation>
</documentation>
</annotation>
</attribute>
<attribute name="class" type="string">
<annotation>
<documentation>
</documentation>
<appInfo>
<meta.attribute kind="java" basedOn=":org.eclipse.cdt.ui.wizards.ProjectTypePage"/>
</appInfo>
</annotation>
</attribute>
</complexType>
</element>
</schema>

View file

@ -71,13 +71,6 @@ public final class CUIMessages extends NLS {
public static String FileTransferDragAdapter_refreshing;
public static String FileTransferDragAdapter_problem;
public static String FileTransferDragAdapter_problemTitle;
public static String NewCDTProjectWizard_mainPageDesc;
public static String NewCDTProjectWizard_mainPageTitle;
public static String NewCDTProjectWizard_refPageDesc;
public static String NewCDTProjectWizard_refPageTitle;
public static String NewCDTProjectWizard_templatePageDesc;
public static String NewCDTProjectWizard_templatePageTitle;
public static String NewCDTProjectWizard_windowTitle;
public static String CUIPlugin_initPrefs;
static {

View file

@ -74,12 +74,4 @@ FileTransferDragAdapter_refreshing=Refreshing...
FileTransferDragAdapter_problem=Problem while moving or copying files.
FileTransferDragAdapter_problemTitle=Drag & Drop
NewCDTProjectWizard_mainPageDesc=Create a new C/C++ Project
NewCDTProjectWizard_mainPageTitle=Project
NewCDTProjectWizard_refPageDesc=Select referenced projects
NewCDTProjectWizard_refPageTitle=Project References
NewCDTProjectWizard_templatePageDesc=Select a project template for the new project
NewCDTProjectWizard_templatePageTitle=Project Template
NewCDTProjectWizard_windowTitle=New C/C++ Project
CUIPlugin_initPrefs=Initialize C/C++ UI Preferences
CUIPlugin_initPrefs=Initialize C/C++ UI Preferences

View file

@ -1,92 +0,0 @@
package org.eclipse.cdt.ui.wizards;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.wizard.IWizardPage;
import org.eclipse.jface.wizard.Wizard;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.ui.INewWizard;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.dialogs.WizardNewProjectCreationPage;
import org.eclipse.ui.dialogs.WizardNewProjectReferencePage;
import org.eclipse.cdt.internal.ui.CUIMessages;
/**
* This is the new CDT project wizard.
*
* Without subclassing, it is in it's most generic form.
*
* Subclasses can filter or select the languages and add template filters.
*
* @author Doug Schaefer
* @since 5.4
*/
public class NewCDTProjectWizard extends Wizard implements INewWizard {
private IStructuredSelection selection;
private WizardNewProjectCreationPage mainPage;
private TemplateSelectionPage templatePage;
private WizardNewProjectReferencePage referencePage;
@Override
public void init(IWorkbench workbench, IStructuredSelection selection) {
this.selection = selection;
setNeedsProgressMonitor(true);
setWindowTitle(CUIMessages.NewCDTProjectWizard_windowTitle);
}
@Override
public boolean performFinish() {
return true;
}
@Override
public void addPages() {
super.addPages();
mainPage = new WizardNewProjectCreationPage("basicNewProjectPage") { //$NON-NLS-1$
@Override
public void createControl(Composite parent) {
super.createControl(parent);
createWorkingSetGroup(
(Composite) getControl(),
selection,
new String[] { "org.eclipse.ui.resourceWorkingSetPage", //$NON-NLS-1$
"org.eclipse.cdt.ui.CElementWorkingSetPage" }); //$NON-NLS-1$
Dialog.applyDialogFont(getControl());
}
};
mainPage.setTitle(CUIMessages.NewCDTProjectWizard_mainPageTitle);
mainPage.setDescription(CUIMessages.NewCDTProjectWizard_mainPageDesc);
addPage(mainPage);
templatePage = new TemplateSelectionPage();
templatePage.setTitle(CUIMessages.NewCDTProjectWizard_templatePageTitle);
templatePage.setDescription(CUIMessages.NewCDTProjectWizard_templatePageDesc);
addPage(templatePage);
// only add page if there are already projects in the workspace
if (ResourcesPlugin.getWorkspace().getRoot().getProjects().length > 0) {
referencePage = new WizardNewProjectReferencePage(
"basicReferenceProjectPage");//$NON-NLS-1$
referencePage.setTitle(CUIMessages.NewCDTProjectWizard_refPageTitle);
referencePage
.setDescription(CUIMessages.NewCDTProjectWizard_refPageDesc);
this.addPage(referencePage);
}
}
@Override
public boolean canFinish() {
IWizardPage page = mainPage;
while (page != null) {
if (!page.isPageComplete())
return false;
page = page.getNextPage();
}
return true;
}
}

View file

@ -1,33 +0,0 @@
/*******************************************************************************
* Copyright (c) 2012 Doug Schaefer and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Doug Schaefer - initial API and implementation
*******************************************************************************/
package org.eclipse.cdt.ui.wizards;
import org.eclipse.jface.wizard.IWizard;
import org.eclipse.jface.wizard.IWizardPage;
import org.eclipse.cdt.ui.templateengine.Template;
/**
* @since 5.4
*/
public interface ProjectTypePage extends IWizardPage {
/**
* Init the page. Return false if the page isn't needed.
*
* @param template The selected template
* @param wizard The wizard object
* @param nextPage The next page after this one
* @return whether page is really needed
*/
boolean init(Template template, IWizard wizard, IWizardPage nextPage);
}

View file

@ -1,337 +0,0 @@
/*******************************************************************************
* Copyright (c) 2012 Wind River Systems and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Doug Schaefer - initial API and implementation
*******************************************************************************/
package org.eclipse.cdt.ui.wizards;
import java.util.LinkedList;
import java.util.List;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.core.runtime.IExtension;
import org.eclipse.core.runtime.IExtensionPoint;
import org.eclipse.core.runtime.IExtensionRegistry;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Status;
import org.eclipse.jface.viewers.ILabelProvider;
import org.eclipse.jface.viewers.ILabelProviderListener;
import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.ITreeContentProvider;
import org.eclipse.jface.viewers.SelectionChangedEvent;
import org.eclipse.jface.viewers.TreeViewer;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.jface.wizard.IWizard;
import org.eclipse.jface.wizard.IWizardPage;
import org.eclipse.jface.wizard.WizardPage;
import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.cdt.core.templateengine.TemplateCategory;
import org.eclipse.cdt.core.templateengine.TemplateEngine2;
import org.eclipse.cdt.core.templateengine.TemplateInfo2;
import org.eclipse.cdt.ui.CUIPlugin;
import org.eclipse.cdt.ui.templateengine.Template;
import org.eclipse.cdt.ui.templateengine.TemplateEngineUI;
/**
* @author Doug Schaefer
* @since 5.4
*/
public class TemplateSelectionPage extends WizardPage {
private static class Node {
private final Object object;
private final Node parent;
private final List<Node> children = new LinkedList<Node>();
public Node(Node parent, Object object) {
this.parent = parent;
this.object = object;
if (parent != null)
parent.addChild(this);
}
private void addChild(Node child) {
children.add(child);
}
public Node getChild(Object child) {
for (Node childNode : children)
if (childNode.getObject().equals(child))
return childNode;
return null;
}
public Object getObject() {
return object;
}
public Node getParent() {
return parent;
}
public List<Node> getChildren() {
return children;
}
}
private static Node tree;
private final TemplateEngine2 coreEngine = TemplateEngine2.getDefault();
private final TemplateEngineUI uiEngine = TemplateEngineUI.getDefault();
private TreeViewer templateTree;
private Template selectedTemplate;
private IWizardPage nextPage;
public TemplateSelectionPage() {
super("templateSelection"); //$NON-NLS-1$
}
@Override
public void createControl(Composite parent) {
Composite comp = new Composite(parent, SWT.NONE);
comp.setLayout(new GridLayout(1, false));
templateTree = new TreeViewer(comp);
templateTree.getTree().setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
templateTree.setContentProvider(new ITreeContentProvider() {
@Override
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
}
@Override
public void dispose() {
}
@Override
public boolean hasChildren(Object element) {
if (element instanceof Node)
return !((Node)element).getChildren().isEmpty();
return false;
}
@Override
public Object getParent(Object element) {
if (element instanceof Node)
return ((Node)element).getParent();
return null;
}
@Override
public Object[] getElements(Object inputElement) {
if (inputElement instanceof Node)
return ((Node)inputElement).getChildren().toArray();
return null;
}
@Override
public Object[] getChildren(Object parentElement) {
if (parentElement instanceof Node)
return ((Node)parentElement).getChildren().toArray();
return null;
}
});
templateTree.setLabelProvider(new ILabelProvider() {
@Override
public void removeListener(ILabelProviderListener listener) {
}
@Override
public boolean isLabelProperty(Object element, String property) {
return false;
}
@Override
public void dispose() {
}
@Override
public void addListener(ILabelProviderListener listener) {
}
@Override
public String getText(Object element) {
if (element instanceof Node) {
Object object = ((Node)element).getObject();
if (object instanceof TemplateCategory)
return ((TemplateCategory)object).getLabel();
else if (object instanceof Template)
return ((Template)object).getLabel();
}
return element.toString();
}
@Override
public Image getImage(Object element) {
return null;
}
});
templateTree.addSelectionChangedListener(new ISelectionChangedListener() {
@Override
public void selectionChanged(SelectionChangedEvent event) {
selectedTemplate = null;
nextPage = null;
IStructuredSelection selection = (IStructuredSelection)templateTree.getSelection();
Object selObj = selection.getFirstElement();
if (selObj instanceof Node) {
Object object = ((Node)selObj).getObject();
if (object instanceof Template) {
IWizard wizard = getWizard();
selectedTemplate = (Template)object;
// Get the template pages
IWizardPage[] templatePages = selectedTemplate.getTemplateWizardPages(TemplateSelectionPage.this,
wizard.getNextPage(TemplateSelectionPage.this), wizard);
if (templatePages != null && templatePages.length > 0)
nextPage = templatePages[0];
String projectType = selectedTemplate.getTemplateInfo().getProjectType();
ProjectTypePage projectTypePage = getProjectTypePage(projectType);
if (projectTypePage != null) {
if (projectTypePage.init(selectedTemplate, wizard, nextPage))
nextPage = projectTypePage;
}
setPageComplete(true);
} else {
setPageComplete(false);
}
} else {
setPageComplete(false);
}
}
});
buildTree();
templateTree.setInput(tree);
setControl(comp);
}
public Template getSelectedTemplate() {
return selectedTemplate;
}
@Override
public boolean isPageComplete() {
return selectedTemplate != null;
}
@Override
public IWizardPage getNextPage() {
if (nextPage != null)
return nextPage;
return super.getNextPage();
}
private void buildTree() {
if (tree != null)
return;
tree = new Node(null, null);
Template[] templates = uiEngine.getTemplates();
for (Template template : templates) {
List<String> parentCategoryIds = ((TemplateInfo2)template.getTemplateInfo()).getParentCategoryIds();
boolean inTree = false;
if (!parentCategoryIds.isEmpty()) {
for (String parentCategoryId : parentCategoryIds) {
List<Node> parents = getParents(parentCategoryId);
if (!parents.isEmpty()) {
for (Node parent : parents)
new Node(parent, template);
inTree = true;
}
}
}
if (!inTree) {
// no parents
new Node(tree, template);
}
}
}
private List<Node> getParents(String parentCategoryId) {
List<Node> nodes = new LinkedList<Node>();
TemplateCategory category = coreEngine.getCategory(parentCategoryId);
if (category == null) {
// undefined, log it
CUIPlugin.log(new Status(IStatus.ERROR, CUIPlugin.PLUGIN_ID, "Undefined parent category " + parentCategoryId)); //$NON-NLS-1$
return nodes;
}
// Hook me up to my parents
List<String> parentCategoryIds = category.getParentCategoryIds();
boolean inTree = false;
if (!parentCategoryIds.isEmpty()) {
for (String myParentId : parentCategoryIds) {
List<Node> parents = getParents(myParentId);
if (!parents.isEmpty()) {
for (Node parent : parents) {
Node node = parent.getChild(category);
if (node == null)
nodes.add(new Node(parent, category));
else
nodes.add(node);
}
inTree = true;
}
}
}
if (!inTree) {
// parents not found, I'm an orphan
Node node = tree.getChild(category);
if (node == null)
nodes.add(new Node(tree, category));
else
nodes.add(node);
}
return nodes;
}
private ProjectTypePage getProjectTypePage(String projectType) {
if (projectType != null && !projectType.isEmpty()) {
IExtensionRegistry reg = Platform.getExtensionRegistry();
IExtensionPoint point = reg.getExtensionPoint(CUIPlugin.PLUGIN_ID, "projectTypePages"); //$NON-NLS-1$
if (point == null)
return null;
IExtension[] exts = point.getExtensions();
for (IExtension ext : exts) {
IConfigurationElement[] elems = ext.getConfigurationElements();
for (IConfigurationElement elem : elems) {
if (elem.getName().equals("projectTypePage")) { //$NON-NLS-1$
String ept = elem.getAttribute("projectType"); //$NON-NLS-1$
if (projectType.equals(ept)) {
try {
Object obj = elem.createExecutableExtension("class"); //$NON-NLS-1$
if (obj instanceof ProjectTypePage)
return (ProjectTypePage)obj;
} catch (CoreException e) {
CUIPlugin.log(e.getStatus());
}
}
}
}
}
}
return null;
}
}

View file

@ -20,7 +20,7 @@ Require-Bundle: org.eclipse.core.resources;bundle-version="[3.2.0,4.0.0)",
org.eclipse.cdt.debug.ui;bundle-version="[7.0.0,8.1.0)",
org.eclipse.cdt.debug.core;bundle-version="[7.0.0,8.1.0)",
org.eclipse.cdt.core;bundle-version="[5.0.0,6.0.0)",
org.eclipse.cdt.ui;bundle-version="[5.0.0,6.0.0)",
org.eclipse.cdt.ui;bundle-version="[6.0.0,7.0.0)",
org.eclipse.debug.core;bundle-version="[3.2.0,4.0.0)",
org.eclipse.debug.ui;bundle-version="[3.2.0,4.0.0)",
org.eclipse.core.runtime;bundle-version="[3.2.0,4.0.0)",

View file

@ -50,7 +50,7 @@ Require-Bundle: org.eclipse.ui.ide;bundle-version="[3.2.0,4.0.0)",
org.eclipse.debug.ui;bundle-version="[3.7.0,4.0.0)",
org.eclipse.debug.core;bundle-version="[3.7.0,4.0.0)",
org.eclipse.cdt.debug.core;bundle-version="[7.0.0,8.1.0)",
org.eclipse.cdt.ui;bundle-version="[5.0.0,6.0.0)",
org.eclipse.cdt.ui;bundle-version="[6.0.0,7.0.0)",
org.eclipse.cdt.core;bundle-version="[5.0.0,6.0.0)",
org.eclipse.core.runtime;bundle-version="[3.2.0,4.0.0)",
org.eclipse.ui.console;bundle-version="[3.1.100,4.0.0)",

View file

@ -18,7 +18,7 @@ Require-Bundle: org.eclipse.ui.ide;bundle-version="[3.2.0,4.0.0)",
org.eclipse.debug.ui;bundle-version="[3.2.0,4.0.0)",
org.eclipse.ui;bundle-version="[3.2.0,4.0.0)",
org.eclipse.cdt.core;bundle-version="[5.0.0,6.0.0)",
org.eclipse.cdt.ui;bundle-version="[5.0.0,6.0.0)",
org.eclipse.cdt.ui;bundle-version="[6.0.0,7.0.0)",
org.eclipse.cdt.debug.core;bundle-version="[7.0.0,8.1.0)",
org.eclipse.cdt.debug.ui;bundle-version="[7.0.0,8.1.0)",
org.eclipse.core.runtime;bundle-version="[3.2.0,4.0.0)",