File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed
src/main/java/org/ainm/controllers Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -287,13 +287,17 @@ void new_todo_list(ActionEvent event) throws IOException {
287287 // Create the file
288288 String directoryPath = createFileDialogController .getDirectory ();
289289 String fileName = createFileDialogController .getFilename ();
290- File file = new File (
291- (( directoryPath . endsWith ( "/" )) ? directoryPath : directoryPath + "/" ) + fileName + ".todo" );
290+ String fullPath = (( directoryPath . endsWith ( "/" )) ? directoryPath : directoryPath + "/" ) + fileName + ".todo" ;
291+ File file = new File ( fullPath );
292292 if (!file .exists ()) {
293293 file .createNewFile ();
294294 }
295295 // Load the todolist view in current tab
296- Node todolistView = FXMLLoader .load (getClass ().getResource ("/fxml/views/todo/todo_view.fxml" ));
296+ FXMLLoader loader = new FXMLLoader ();
297+ loader .setLocation ("/fxml/views/todo/todo_view.fxml" );
298+ Node todolistView = loader .load ();
299+ TodolistController controller = loader .getController ();
300+ controller .openedFile = Paths .get (fullPath );
297301 addViewToCurrentTab (todolistView );
298302 }
299303 }
@@ -351,4 +355,4 @@ public static Object getController(Node node) {
351355 } while (controller == null && node != null );
352356 return controller ;
353357 }
354- }
358+ }
You can’t perform that action at this time.
0 commit comments