首页 > 解决方案 > Gluon Afterburner Presenter.initialize() 未调用

问题描述

存储库链接:https ://gitlab.com/RichardGladman/medimindr

我使用 IntelliJ 插件使用 Afterburner 项目创建了一个新的多视图,并向该项目添加了一个新视图。它显示了一些关于我认为很容易的信息。该视图显示得很好,但 AboutPresenter 未初始化意味着 AppBar 未填充。

演示者类

package com.thefifthcontinent.medimindr.views;

... imports snipped ...

public class AboutPresenter extends GluonPresenter<MediMindr> {

    @FXML
    private View about;

    public void initialize() {
        about.showingProperty().addListener((obs, oldValue, newValue) -> {
            if (newValue) {
                AppBar appBar = getApp().getAppBar();
                appBar.setNavIcon(MaterialDesignIcon.MENU.button(e ->
                        getApp().getDrawer().open()));
                appBar.setTitleText("About");
            }
        });
    }
}

AppViewManager 中的创建

public static final AppView ABOUT_VIEW = view(
        bundle.getString("drawer.about"),
        AboutPresenter.class,
        MaterialDesignIcon.DASHBOARD,
        SHOW_IN_DRAWER);

我看不出我所做的和项目创建的有什么区别。

标签: gluon-mobileafterburner.fx

解决方案


事实证明它们仍然在 pom.xml 中配置。我认为这将是使用 Afterburner 的自动喷射。


推荐阅读