EventTests
This commit is contained in:
@@ -103,7 +103,7 @@ public class MenubarController implements Initializable, Controller {
|
||||
try {
|
||||
File dir = FileOperations.openFolderWithDialog(stage);
|
||||
|
||||
this.eventBus.post(new OpenProjectEvent(dir.toPath()));
|
||||
this.eventBus.post(new OpenProjectEvent(Optional.of(dir.toPath())));
|
||||
} catch (FileNotFoundException e) {}
|
||||
}
|
||||
|
||||
|
||||
@@ -10,21 +10,21 @@ import app.model.Model;
|
||||
*/
|
||||
public class OpenProjectEvent extends Event {
|
||||
|
||||
private Path path;
|
||||
private Optional<Path> path;
|
||||
|
||||
/**
|
||||
* Event signalizing that a folder is supposed to be opened in the filetree.
|
||||
* @param path The path of the folder to be opened
|
||||
*/
|
||||
public OpenProjectEvent(Path path) {
|
||||
public OpenProjectEvent(Optional<Path> path) {
|
||||
this.path = path;
|
||||
Model.setProjectPath(Optional.of(path));
|
||||
Model.setProjectPath(path);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return The path of the folder to be opened
|
||||
*/
|
||||
public Path getPath() {
|
||||
public Optional<Path> getPath() {
|
||||
return this.path;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user