/******************************************************************************* * Copyright (c) 2015 QNX Software 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 *******************************************************************************/ package org.eclipse.cdt.arduino.ui.internal.project; import org.eclipse.cdt.arduino.core.internal.ArduinoProjectGenerator; import org.eclipse.jface.dialogs.Dialog; import org.eclipse.swt.widgets.Composite; import org.eclipse.tools.templates.core.IGenerator; import org.eclipse.tools.templates.ui.TemplateWizard; import org.eclipse.ui.dialogs.WizardNewProjectCreationPage; public class NewArduinoCPPSketchWizard extends TemplateWizard { private WizardNewProjectCreationPage mainPage; @Override public void addPages() { mainPage = new WizardNewProjectCreationPage("basicNewProjectPage") { //$NON-NLS-1$ @Override public void createControl(Composite parent) { super.createControl(parent); createWorkingSetGroup((Composite) getControl(), getSelection(), new String[] { "org.eclipse.ui.resourceWorkingSetPage" }); //$NON-NLS-1$ Dialog.applyDialogFont(getControl()); } }; mainPage.setTitle("New Arduino Project"); //$NON-NLS-1$ mainPage.setDescription("Specify properties of new Arduino project."); //$NON-NLS-1$ this.addPage(mainPage); } @Override protected IGenerator getGenerator() { ArduinoProjectGenerator generator = new ArduinoProjectGenerator("templates/cppsketch/manifest.xml"); //$NON-NLS-1$ generator.setProjectName(mainPage.getProjectName()); if (!mainPage.useDefaults()) { generator.setLocationURI(mainPage.getLocationURI()); } return generator; } }