Skip to content

Commit 47a7f68

Browse files
committed
Creating a new sbol document no longer asks you to save.
1 parent ec2657c commit 47a7f68

1 file changed

Lines changed: 6 additions & 13 deletions

File tree

src/main/java/edu/utah/ece/async/sboldesigner/sbol/editor/SBOLDesignerPanel.java

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -140,19 +140,12 @@ protected void perform() {
140140
"newFolder.png") {
141141
@Override
142142
protected void perform() {
143-
JOptionPane.showMessageDialog(SBOLDesignerPanel.this,
144-
"Please select a file to save the new SBOL Document into.");
145-
int returnVal = fc.showSaveDialog(SBOLDesignerPanel.this);
146-
if (returnVal == JFileChooser.APPROVE_OPTION) {
147-
File file = fc.getSelectedFile();
148-
Preferences.userRoot().node("path").put("path", file.getPath());
149-
try {
150-
new FileDocumentIO(false).write(new SBOLDocument());
151-
openDocument(new FileDocumentIO(false));
152-
} catch (SBOLValidationException | IOException | SBOLConversionException e) {
153-
MessageDialog.showMessage(null, "There was a problem creating this document: ", e.getMessage());
154-
e.printStackTrace();
155-
}
143+
try {
144+
newPart(SBOLEditorPreferences.INSTANCE.getUserInfo().getURI().toString().equals("http://www.dummy.org"),
145+
true);
146+
} catch (SBOLValidationException e) {
147+
MessageDialog.showMessage(null, "There was a problem creating this document: ", e.getMessage());
148+
e.printStackTrace();
156149
}
157150
}
158151
}.precondition(CONFIRM_SAVE);

0 commit comments

Comments
 (0)