%trimmedwindow.label.eclipseSDK 作为标题栏的文本:错误 373988

%trimmedwindow.label.eclipseSDK as text of title bar: Bug 373988

我目前正在将 Eclipse RCP 应用程序从 3.0 迁移到 4.4。由于迁移,标题栏的文本是“%trimmedwindow.label.eclipseSDK”,而不是它应该是的字符串。我这样设置标题:

public void preWindowOpen(IWorkbenchWindowConfigurer configurer)
{
    ...
    myConfigurer = configurer;
    myProductName = configurer.getTitle();
}
...
public void perspectiveActivated(IWorkbenchPage page, IPerspectiveDescriptor perspective) 
{
    myConfigurer.setTitle(myProductName + " " +          perspective.getLabel());
}

public void perspectiveChanged(IWorkbenchPage page, IPerspectiveDescriptor perspective, String changeId) 
{
    myConfigurer.setTitle(myProductName + " " + perspective.getLabel());
}
...

有趣的是:如果我调试preWindowOpen(IWorkbenchConfigurer configurer)的代码,变量configurer中包含的标题栏的文本是正确的,但是执行后myProductname = configurer.getTitle();标题栏文本的值更改为“%trimmedwindow.label.eclipseSDK”。

这个 一个错误 https://bugs.eclipse.org/bugs/show_bug.cgi?id=374116 应该为 Eclipse 4.4 修复,但我仍然遇到这种奇怪的行为。解决方法很简单:只需将文本设置为硬编码,但这不是很漂亮。而且我也不明白为什么我会得到这个错误,虽然它应该被修复。

顺便说一句:当然,在 Eclipse RCP 3.0 中一切正常。

此错误已针对 Eclipse 4.5 (Mars) 修复。 Bug 374116 comment 8 显示此错误的最后一次提交是在 2015 年 3 月到 master 分支。那是在 2014 年 6 月发布 4.4 之后。

如您所见,master (Neon) and 4.5 (Mars) have the correct contents, but the 4.4 (Luna) 上的文件没有修复。

如果您要开始一个新项目,我建议您从最新的(4.5.1 又名 Mars.1)(截至 2015 年 11 月)开始