Simplify event log popup flow

This commit is contained in:
Clément Fournier 2019-02-03 17:53:36 +01:00
parent 455860a9a9
commit 1daa3382ae
2 changed files with 2 additions and 17 deletions

View File

@ -80,9 +80,6 @@ public class MainDesignerController extends AbstractController<AbstractControlle
private Menu openRecentMenu;
@FXML
private Menu fileMenu;
/* Center toolbar */
@FXML
private ToggleButton bottomTabsToggle;
/* Bottom panel */
@FXML
private TabPane bottomTabPane;

View File

@ -74,9 +74,6 @@ public final class EventLogController extends AbstractController<MainDesignerCon
private final Stage myPopupStage;
// subscription allowing to unbind from the popup.
private Subscription popupBinding = () -> {};
public EventLogController(MainDesignerController mediator) {
super(mediator);
@ -90,8 +87,6 @@ public final class EventLogController extends AbstractController<MainDesignerCon
@Override
protected void beforeParentInit() {
popupBinding.unsubscribe();
final DateFormat dateFormat = new SimpleDateFormat("HH:mm:ss");
logDateColumn.setCellValueFactory(entry -> new SimpleObjectProperty<>(entry.getValue()));
logDateColumn.setCellFactory(column -> new TableCell<LogEntry, LogEntry>() {
@ -214,16 +209,9 @@ public final class EventLogController extends AbstractController<MainDesignerCon
public void showPopup(Subscription extSub) {
myPopupStage.show();
popupBinding = bindPopupToThisController().and(extSub);
Subscription popupBinding = bindPopupToThisController().and(extSub);
eventLogTableView.refresh();
myPopupStage.setOnCloseRequest(e -> hidePopup());
}
private void hidePopup() {
myPopupStage.hide();
popupBinding.unsubscribe();
popupBinding = () -> {};
myPopupStage.setOnCloseRequest(e -> popupBinding.unsubscribe());
}