Commit 86d320a0 authored by Robert Smith's avatar Robert Smith
Browse files

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

parents 4553b9d0 8fc081ab
......@@ -18,27 +18,21 @@ import org.eclipse.ice.item.Item;
import org.eclipse.ice.item.ItemType;
/**
* <p>
* This class realizes the ItemBuilder interface to provide instances of the
* GeometryEditor to ICE. Calling GeometryEditorBuilder.build() will return an
* instance of the GeometryEditor that is fully-initialized and ready for use.
* </p>
*
* @author Jay Jay Billings
*/
public class GeometryEditorBuilder extends AbstractItemBuilder {
/**
* <p>
* The name of the Geometry Editor.
* </p>
*
*/
public static final String name = "Geometry Editor";
/**
* <p>
* The Item type of the Geometry Editor.
* </p>
*
*/
public static final ItemType type = ItemType.Geometry;
......@@ -49,10 +43,13 @@ public class GeometryEditorBuilder extends AbstractItemBuilder {
setName(name);
setType(type);
}
/*
* (non-Javadoc)
* @see org.eclipse.ice.item.AbstractItemBuilder#getInstance(org.eclipse.core.resources.IProject)
*
* @see
* org.eclipse.ice.item.AbstractItemBuilder#getInstance(org.eclipse.core.
* resources.IProject)
*/
@Override
public Item getInstance(IProject projectSpace) {
......
......@@ -4,8 +4,7 @@ Bundle-Name: Vibe
Bundle-SymbolicName: org.eclipse.ice.vibe;singleton:=true
Bundle-Version: 2.1.8.20160208
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
Import-Package: org.eclipse.ice.io.ips,
org.eclipse.ice.io.serializable,
Import-Package: org.eclipse.ice.io.serializable,
org.osgi.framework;version="1.3.0",
org.slf4j;version="1.7.2"
Bundle-ActivationPolicy: lazy
......
......@@ -25,10 +25,9 @@ import org.eclipse.ice.datastructures.entry.IEntry;
import org.eclipse.ice.datastructures.form.DataComponent;
import org.eclipse.ice.datastructures.form.FormStatus;
import org.eclipse.ice.datastructures.form.TableComponent;
import org.eclipse.ice.io.ips.IPSReader;
import org.eclipse.ice.io.ips.IPSWriter;
import org.eclipse.ice.io.serializable.IIOService;
import org.eclipse.ice.io.serializable.IOService;
import org.eclipse.ice.io.serializable.IReader;
import org.eclipse.ice.item.jobLauncher.JobLauncher;
/**
......@@ -78,11 +77,7 @@ public class VibeLauncher extends JobLauncher {
* </p>
*/
public VibeLauncher(IProject project) {
// Call the JobLauncher constructor
super(project);
return;
}
/**
......@@ -106,13 +101,6 @@ public class VibeLauncher extends JobLauncher {
setIOService(new IOService());
ioService = getIOService();
}
if (ioService.getReader("IPSReader") == null) {
ioService.addReader(new IPSReader());
}
if (ioService.getWriter("IPSWriter") == null) {
ioService.addWriter(new IPSWriter());
}
return;
}
/**
......@@ -158,8 +146,6 @@ public class VibeLauncher extends JobLauncher {
form.removeComponent(1);
form.addComponent(fileComponent);
update(fileComponent.retrieveEntry("Use custom key-value pair file?"));
return;
}
/**
......@@ -177,10 +163,7 @@ public class VibeLauncher extends JobLauncher {
@Override
public FormStatus process(String actionName) {
// Local Declarations
String separator = System.getProperty("file.separator");
IPSReader reader = (IPSReader) ioService.getReader("IPSReader");
IPSWriter writer = (IPSWriter) ioService.getWriter("IPSWriter");
IReader reader = (IReader) ioService.getReader("IPSReader");
DataComponent fileComponent = (DataComponent) form.getComponent(1);
IEntry inputFileEntry = fileComponent.retrieveEntry("Input File");
IEntry kvPairFileEntry = fileComponent.retrieveEntry("Use custom key-value pair file?");
......@@ -220,13 +203,6 @@ public class VibeLauncher extends JobLauncher {
dataDir = dataDir.substring(0, dataDir.length() - (caseName.length() + 1));
}
// Get the input file directory for the simulation
String inputDir = "";
ArrayList<IEntry> inputDirMatches = reader.findAll(inputFile, ".*INPUT_DIR.*");
if (inputDirMatches != null && !inputDirMatches.isEmpty()) {
inputDir = inputDirMatches.get(0).getName().split("=")[1];
}
// If we are supplying a new KV Pair file replace it in the input file
update(fileComponent.retrieveEntry("Use custom key-value pair file?"));
String setKVPerms = "";
......@@ -258,7 +234,6 @@ public class VibeLauncher extends JobLauncher {
setExecutable(getName(), getDescription(), this.fullExecCMD);
return super.process(actionName);
}
/**
......
......@@ -30,10 +30,10 @@ import org.eclipse.core.runtime.CoreException;
import org.eclipse.ice.datastructures.ICEObject.Component;
import org.eclipse.ice.datastructures.form.Form;
import org.eclipse.ice.datastructures.form.FormStatus;
import org.eclipse.ice.io.ips.IPSReader;
import org.eclipse.ice.io.ips.IPSWriter;
import org.eclipse.ice.io.serializable.IIOService;
import org.eclipse.ice.io.serializable.IOService;
import org.eclipse.ice.io.serializable.IReader;
import org.eclipse.ice.io.serializable.IWriter;
import org.eclipse.ice.item.Item;
/**
......@@ -95,6 +95,13 @@ public class VibeModel extends Item {
// Create a fresh form to start with
form = new Form();
// Set up the necessary io services if they aren't already done.
ioService = getIOService();
if (ioService == null) {
setIOService(new IOService());
ioService = getIOService();
}
// If loading from the new item button we should just
// load up the default case 6 file by passing in null
if (project != null) {
......@@ -117,19 +124,6 @@ public class VibeModel extends Item {
customTaggedExportString = "Export to VIBE INI format";
allowedActions.add(0, customTaggedExportString);
actionItems = getAvailableActions();
// Set up the necessary io services if they aren't already done.
ioService = getIOService();
if (ioService == null) {
setIOService(new IOService());
ioService = getIOService();
}
if (ioService.getReader("IPSReader") == null) {
ioService.addReader(new IPSReader());
}
if (ioService.getWriter("IPSWriter") == null) {
ioService.addWriter(new IPSWriter());
}
}
/**
......@@ -144,7 +138,6 @@ public class VibeModel extends Item {
@Override
protected FormStatus reviewEntries(Form preparedForm) {
FormStatus retStatus = FormStatus.ReadyToProcess;
Component dataComp = null;
// Grab the data component from the Form and only proceed if it exists
ArrayList<Component> components = preparedForm.getComponents();
......@@ -184,7 +177,7 @@ public class VibeModel extends Item {
if (components.size() > 3) {
// create a new IPSWriter with the output file
IPSWriter writer = (IPSWriter) ioService.getWriter("IPSWriter");
IWriter writer = (IWriter) ioService.getWriter("IPSWriter");
try {
// Write the output file
writer.write(form, outputFile);
......@@ -274,7 +267,7 @@ public class VibeModel extends Item {
// Load the components from the file and setup the form
logger.info("VibeModel Message: Loading " + inputFile.getName());
IPSReader reader = (IPSReader) ioService.getReader("IPSReader"); //new IPSReader();
IReader reader = (IReader) ioService.getReader("IPSReader"); //new IPSReader();
form = reader.read(inputFile);
form.setName(getName());
form.setDescription(getDescription());
......
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