forked from phoedos/pmd
Simplify event log popup flow
This commit is contained in:
parent
455860a9a9
commit
1daa3382ae
@ -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;
|
||||
|
@ -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());
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user