Commit bfdfaa1f authored by arbennett's avatar arbennett
Browse files

Improving New ICE Item Project Creation wizard.


Signed-off-by: default avatararbennett <bennett.andr@gmail.com>
parent 48faa763
......@@ -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
*/
......@@ -60,7 +62,7 @@ public class ICEItemTemplate extends OptionTemplateSection {
// create one wizard page for the options
WizardPage p1 = createPage(0);
p1.setTitle("New ICE Item Project");
p1.setDescription("Specify ICE Item parameters");
p1.setDescription("Specify ICE Item Parameters.");
wizard.addPage(p1);
markPagesAdded();
}
......@@ -69,7 +71,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 +122,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);
}
}
}
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