我有一个 JFace 向导,我想为不同的向导页面设置不同的窗口标题。目前,我已经重写了名为 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));
最佳答案
在向导中重写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";
}
关于java - 为不同的 IWizardPages 设置不同的窗口标题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15757374/