if one tries to SaveAs now and projectpatch i selected, it will op there instead of deafult
This commit is contained in:
parent
06397cc6cf
commit
509f5224b5
|
@ -161,7 +161,7 @@ public class EditorController implements Initializable, Controller {
|
|||
|
||||
} catch (FileNotFoundException ex) {
|
||||
Alert error = new Alert(AlertType.ERROR);
|
||||
error.setContentText("Could not be opened!\nMust be a java or md file. Try again.");
|
||||
error.setContentText("Could not be opened!\nMust be a java or md file or not null. Try again.");
|
||||
|
||||
error.showAndWait();
|
||||
System.err.println(filePath);
|
||||
|
@ -183,7 +183,7 @@ public class EditorController implements Initializable, Controller {
|
|||
|
||||
} catch (FileNotFoundException ex) {
|
||||
Alert error = new Alert(AlertType.ERROR);
|
||||
error.setContentText("Could not save file!\nMust be a java or md file or not null. Try again.");
|
||||
error.setContentText("Could not save file!\nMust be a java or md file. Try again.");
|
||||
|
||||
error.showAndWait();
|
||||
System.err.println(filePath);
|
||||
|
|
|
@ -142,7 +142,8 @@ public class FiletreeController implements Initializable, Controller {
|
|||
/* ------------------------------------------------------------------------ */
|
||||
|
||||
/**
|
||||
* Handles whenever a filetree item is clicked twice.
|
||||
* Handles whenever a filetree item is clicked twice. A while loop to create the
|
||||
* correct filepath.
|
||||
*/
|
||||
@FXML
|
||||
private void handleMouseClick(MouseEvent event) {
|
||||
|
|
|
@ -83,7 +83,7 @@ public class MenubarController implements Initializable, Controller {
|
|||
}
|
||||
|
||||
/* ------------------------------------------------------------------------ */
|
||||
/* OPEN FILE */
|
||||
/* OPEN FILE/PROJECT */
|
||||
/* ------------------------------------------------------------------------ */
|
||||
|
||||
/**
|
||||
|
@ -148,6 +148,9 @@ public class MenubarController implements Initializable, Controller {
|
|||
private void handleSaveAsFile() {
|
||||
FileChooser fc = new FileChooser();
|
||||
fc.setTitle("Save as");
|
||||
if (Model.getProjectPath() != null) {
|
||||
fc.setInitialDirectory(Model.getProjectPath().toFile());
|
||||
}
|
||||
Stage stage = (Stage) menubar.getScene().getWindow();
|
||||
|
||||
FileChooser.ExtensionFilter extJava = new FileChooser.ExtensionFilter("Java", "*.java");
|
||||
|
|
Loading…
Reference in New Issue