Commit 90fd10c9 authored by Jay Jay Billings's avatar Jay Jay Billings
Browse files

Merge branch 'next' of https://github.com/eclipse/ice into next

parents c155d908 d1faacb9
......@@ -56,12 +56,12 @@ public class NewICEItemProjectTester {
bot.button("Next >").click();
bot.comboBox().setText("Oak Ridge National Laboratory");
bot.button("Next >").click();
bot.textWithLabel("Class Base Name").setText("NewItem");
bot.textWithLabel("Item Class Base Name").setText("NewItem");
bot.button("Finish").click();
// Wait for the wizard to complete
try {
Thread.sleep(8000);
Thread.sleep(20000);
} catch (InterruptedException e2) {
// TODO Auto-generated catch block
e2.printStackTrace();
......
......@@ -4,15 +4,16 @@
<extension-point id="pluginContent" name="%expoint.pluginContent.name" schema="schema/pluginContent.exsd"/>
<extension
point="org.eclipse.ui.newWizards">
<category
id="org.eclipse.ice.projectgeneration.wizards"
name="ICE Item Creation Wizards">
<category
id="org.eclipse.ice.projectgeneration.wizards"
name="ICE Item Creation Wizards">
</category>
<wizard
category="org.eclipse.ice.projectgeneration.wizards"
class="org.eclipse.ice.projectgeneration.wizards.NewICEItemProjectWizard"
id="org.eclipse.ice.projectgeneration.wizard.new.item"
name="ICE Item Project Creation Wizard">
category="org.eclipse.ice.projectgeneration.wizards"
class="org.eclipse.ice.projectgeneration.wizards.NewICEItemProjectWizard"
id="org.eclipse.ice.projectgeneration.wizard.new.item"
name="ICE Item Project Creation Wizard"
project="true">
</wizard>
</extension>
<extension
......@@ -43,7 +44,7 @@
pureOSGi="false"
rcp="false"
requiresActivator="false"
ui-content="true">
ui-content="false">
<description>
Creates a new ICE Item project
</description>
......@@ -53,7 +54,8 @@
point="org.eclipse.pde.ui.newExtension">
<category
id="templates"
name="ICE Item Templates">
name="ICE Item Templates"
parentCategory="templates">
</category>
<wizard
availableAsShortcut="true"
......
......@@ -43,7 +43,9 @@ public class ICEItemTemplate extends OptionTemplateSection {
protected static final String EXTENSION_POINT = "org.eclipse.ice.item.itemBuilder";
protected static final String KEY_CLASS_NAME = "className";
protected static final String KEY_EXTENSION_NAME = "packageName";
protected static final String KEY_JOB_LAUNCHER_EXT = "createJobLauncher";
protected static final String KEY_MODEL_EXT = "createModel";
/**
* Constructor
*/
......@@ -59,8 +61,9 @@ public class ICEItemTemplate extends OptionTemplateSection {
public void addPages(Wizard wizard) {
// create one wizard page for the options
WizardPage p1 = createPage(0);
p1.setPageComplete(false);
p1.setTitle("New ICE Item Project");
p1.setDescription("Specify ICE Item parameters");
p1.setDescription("Specify ICE Item Parameters.");
wizard.addPage(p1);
markPagesAdded();
}
......@@ -69,7 +72,9 @@ public class ICEItemTemplate extends OptionTemplateSection {
* Define the options, descriptions, default values, and page numbers
*/
protected void setOptions() {
addOption(KEY_CLASS_NAME , "Class Base Name" , "" , 0);
addOption(KEY_CLASS_NAME , "Item Class Base Name" , "" , 0);
addOption(KEY_JOB_LAUNCHER_EXT, "Create Job Launcher?", true, 0);
addOption(KEY_MODEL_EXT, "Create Model?", true, 0);
}
@Override
......@@ -118,31 +123,41 @@ public class ICEItemTemplate extends OptionTemplateSection {
@Override
protected void updateModel(IProgressMonitor monitor) throws CoreException {
IPluginBase plugin;
String pluginId;
IPluginExtension extension;
IPluginModelFactory factory;
IPluginElement element;
// Model builder plugin.xml entry
IPluginBase plugin = model.getPluginBase();
String pluginId = plugin.getId();
IPluginExtension extension = createExtension(EXTENSION_POINT, false);
extension.setName(splitCamelCase(getStringOption(KEY_CLASS_NAME) + " Model"));
extension.setId(getStringOption(KEY_CLASS_NAME) + "ModelBuilder");
IPluginModelFactory factory = model.getPluginFactory();
IPluginElement element = factory.createElement(extension);
element.setName("implementation");
element.setAttribute("class", pluginId + ".model." + getStringOption(KEY_CLASS_NAME) + "ModelBuilder");
extension.add(element);
if (!extension.isInTheModel())
plugin.add(extension);
if (getBooleanOption(KEY_MODEL_EXT)) {
plugin = model.getPluginBase();
pluginId = plugin.getId();
extension = createExtension(EXTENSION_POINT, false);
extension.setName(splitCamelCase(getStringOption(KEY_CLASS_NAME) + " Model"));
extension.setId(getStringOption(KEY_CLASS_NAME) + "ModelBuilder");
factory = model.getPluginFactory();
element = factory.createElement(extension);
element.setName("implementation");
element.setAttribute("class", pluginId + ".model." + getStringOption(KEY_CLASS_NAME) + "ModelBuilder");
extension.add(element);
if (!extension.isInTheModel())
plugin.add(extension);
}
// Job launcher builder plugin.xml entry
plugin = model.getPluginBase();
extension = createExtension(EXTENSION_POINT, false);
extension.setName(splitCamelCase(getStringOption(KEY_CLASS_NAME)+ " Launcher"));
extension.setId(getStringOption(KEY_CLASS_NAME) + "LauncherBuilder");
factory = model.getPluginFactory();
element = factory.createElement(extension);
element.setName("implementation");
element.setAttribute("class", pluginId + ".launcher." + getStringOption(KEY_CLASS_NAME) + "LauncherBuilder");
extension.add(element);
if (!extension.isInTheModel())
plugin.add(extension);
if (getBooleanOption(KEY_JOB_LAUNCHER_EXT)) {
plugin = model.getPluginBase();
pluginId = plugin.getId();
extension = createExtension(EXTENSION_POINT, false);
extension.setName(splitCamelCase(getStringOption(KEY_CLASS_NAME)+ " Launcher"));
extension.setId(getStringOption(KEY_CLASS_NAME) + "LauncherBuilder");
factory = model.getPluginFactory();
element = factory.createElement(extension);
element.setName("implementation");
element.setAttribute("class", pluginId + ".launcher." + getStringOption(KEY_CLASS_NAME) + "LauncherBuilder");
extension.add(element);
if (!extension.isInTheModel())
plugin.add(extension);
}
}
}
......@@ -56,8 +56,7 @@ import org.eclipse.ice.projectgeneration.templates.ICEItemWizard;
/**
* This class defines the steps for creating a new New ICE Item project via the
* wizard that us accessible via: 'File -> New... -> Other -> New ICE Item
* Project'
* wizard that us accessible via: 'File -> New... -> New ICE Item Project'
*
* @author arbennett
*/
......@@ -137,6 +136,8 @@ public class NewICEItemProjectWizard extends NewPluginProjectFromTemplateWizard
}
}
/**
* Takes all of the information from the wizard pages and uses it to create
* the plugin and java classes.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment