ReportSpecEditPaneController.java 文件源码

java
阅读 17 收藏 0 点赞 0 评论 0

项目:story-inspector 作者:
/**
 * Do initialization after fx components have been generated.
 */
@FXML
private void initialize() {
    this.reportSpecObservableValue = new ObservableReportSpec();

    // If we detect the user deleted a tab, then make our observable report spec no longer depend on that tab
    this.reportSectionsTabPane.getTabs().addListener((final Change<? extends Tab> c) -> {
        while (c.next()) {
            if (c.wasRemoved()) {
                for (final Tab t : c.getRemoved()) {
                    this.reportSpecObservableValue.unbindTab(t);
                }
            }
        }
    });

    this.saveManager = new ReportSpecSaveManager(this, this.analysisSerializer);

    newEntity();
    this.saveManager.syncSavedEntity();

    ControllerUtils.performWithStage(this.reportSectionsTabPane, stage -> {
        stage.setOnCloseRequest(e -> {
            final boolean safeToProceed = this.saveManager
                    .promptSave("Save changes to current report before closing? Otherwise your current changes will be lost.");

            if (!safeToProceed)
                e.consume();
        });
    });
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号