Add comment toggle feature

This commit is contained in:
2021-02-23 16:44:26 +01:00
parent 0ba350395b
commit 302b10a5a6
9 changed files with 170 additions and 5 deletions

View File

@@ -9,6 +9,7 @@ import com.google.common.eventbus.Subscribe;
import app.events.ExitApplicationEvent;
import app.events.LanguageChangedEvent;
import app.events.ToggleCommentEvent;
import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.fxml.Initializable;
@@ -82,6 +83,10 @@ public class MenubarController implements Initializable, Controller {
this.eventBus.register(this);
}
/* ------------------------------------------------------------------------ */
/* FILE */
/* ------------------------------------------------------------------------ */
/**
* Handles the event where the language was change from the menu.
* @param event
@@ -102,6 +107,15 @@ public class MenubarController implements Initializable, Controller {
this.eventBus.post(new ExitApplicationEvent());
}
/* ------------------------------------------------------------------------ */
/* EDIT */
/* ------------------------------------------------------------------------ */
@FXML
private void handleToggleComment(ActionEvent event) {
this.eventBus.post(new ToggleCommentEvent());
}
/**
* Updates menubuttons whenever the language is changed
* @param event
@@ -117,4 +131,9 @@ public class MenubarController implements Initializable, Controller {
.orElseThrow()
.setSelected(true);
}
/* ------------------------------------------------------------------------ */
/* ABOUT */
/* ------------------------------------------------------------------------ */
}