0

我有一个 JFace 向导,我想为不同的向导页面设置不同的窗口标题。目前我已经覆盖了名为 as 的方法,setWindowTitle并且我正在从向导页面调用此方法,但标题没有出现在向导页面上。

向导上的代码是

@Override
public void setWindowTitle(String newTitle) {
    super.setWindowTitle(newTitle);
}

而在 JFace WizardPage 上是

private InstallationWizard iWizard = new InstallationWizard();
        iWizard.setWindowTitle(PropertyClass.getPropertyLabel(Constants.QTL_INSTALLATION_WIZARD_1));
4

1 回答 1

2

getWindowTitle()像这样在您的向导中覆盖:

@Override
public String getWindowTitle() {
    if (getContainer() != null) {
        IWizardPage currentPage = getContainer().getCurrentPage();

        if (currentPage == wizardPage1)
            return "title1";
        else if (currentPage == wizardPage2)
            return "title2";
    }

    return "otherwise";
}
于 2013-04-02T09:49:26.267 回答