Commit a14b41d3 authored by Matija Obreza's avatar Matija Obreza
Browse files

Remember workspace file name

parent 42abdb40
......@@ -152,7 +152,7 @@
<dependency>
<groupId>org.genesys2</groupId>
<artifactId>client-api</artifactId>
<version>0.0.1-SNAPSHOT</version>
<version>0.0.1</version>
</dependency>
<dependency>
<groupId>commons-collections</groupId>
......
......@@ -240,11 +240,11 @@ public class AppWindow {
AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext(SpringConfig.class);
AppWindow appWindow = (AppWindow) ctx.getBean("appWindow");
appWindow.execute();
_log.info("Closing Spring context");
ctx.close();
_log.info("All tidied up.");
// Workaround for hanging derby.rawStoreDeamon
System.exit(0);
}
......@@ -611,7 +611,13 @@ public class AppWindow {
FileDialog dialog = new FileDialog(shlGenesysMagic, SWT.SAVE);
dialog.setFilterNames(new String[] { "JSON Format" });
dialog.setFilterExtensions(new String[] { "*.json" });
dialog.setFileName("workspace.json");
if (builder.getWorkspaceFilename() == null) {
dialog.setFileName("workspace.json");
} else {
File file = new File(builder.getWorkspaceFilename());
dialog.setFileName(file.getName());
dialog.setFilterPath(file.getParent());
}
String path = dialog.open();
if (path != null) {
......
......@@ -36,11 +36,16 @@ import org.json.JSONTokener;
public class DwcaBuilder extends AbstractModelObject {
private List<DataSourceFile> fileRoots = new ArrayList<DataSourceFile>();
private String workspaceFilename = null;
public List<DataSourceFile> getFileRoots() {
return fileRoots;
}
public String getWorkspaceFilename() {
return workspaceFilename;
}
public void addDataSource(DataSourceFile dataSource) {
if (dataSource == null)
return;
......@@ -133,6 +138,7 @@ public class DwcaBuilder extends AbstractModelObject {
fileWriter.close();
System.out.println(main.toString());
this.workspaceFilename = filePath;
}
public void loadWorkspace(String filePath, Settings settings) throws FileNotFoundException, JSONException {
......@@ -222,6 +228,7 @@ public class DwcaBuilder extends AbstractModelObject {
settings.setOauthSettings(oAuthSettings);
this.workspaceFilename = filePath;
}
}
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