3

如何在 Linux(Ubuntu 14.04)上以编程方式运行的 Eclipse 帮助窗口中打开特定的帮助主题?

例如:我想以编程方式打开“任务视图”帮助,如下图所示。

在此处输入图像描述 我试过:

PlatformUI.getWorkbench().getHelpSystem() .displayHelpResource("/org.eclipse.platform.doc.user/concepts/ctskview.htm");

但帮助主题是在外部浏览器(firefox)中打开,而不是在 eclipse 帮助寡妇中。

如何在 Eclipse 帮助寡妇中打开此主题(单击Help > Help contentsEclipse 工作台中的菜单时打开的窗口)。

4

1 回答 1

2

根据您的打印屏幕,您使用的是 Linux。内部窗口仅适用于 Windows。

看看中的代码DefaultHelpUI在非 Windows 平台上,显示模态窗口时使用外部):

private boolean useExternalBrowser(String url) {
    // On non Windows platforms, use external when modal window is displayed
    if (!Constants.OS_WIN32.equalsIgnoreCase(Platform.getOS())) {
        Display display = Display.getCurrent();
        if (display != null) {
            if (insideModalParent(display))
                return true;
        }
    }

    // Use external when no help frames are to be displayed, otherwise no
    // navigation buttons.
    if (url != null) {
        if (url.indexOf("?noframes=true") > 0 //$NON-NLS-1$
                || url.indexOf("&noframes=true") > 0) { //$NON-NLS-1$
            return true;
        }
    }
    return false;
}
于 2016-09-06T08:46:26.743 回答