3

How I can open specific help topic in eclipse help window programatically running on Linux(Ubuntu 14.04)?

Ex: I want to open "Tasks view" help as shown in below pic pro-grammatically.

enter image description here I tried with:

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

But the help topic is opening in external browser(firefox) NOT in eclipse help widow.

How I can open this topic in eclipse help widow(Window which opens when clicked Help > Help contents menu in eclipse workbench).

flavio.donze
  • 7,432
  • 9
  • 58
  • 91
Chandrayya G K
  • 8,719
  • 5
  • 40
  • 68

1 Answers1

2

According to your print screen you are using Linux. The internal Window only works for Windows.

Have a look at the code in DefaultHelpUI (On non Windows platforms, use external when modal window is displayed):

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;
}
flavio.donze
  • 7,432
  • 9
  • 58
  • 91
  • Yes. I am on Linux(Ubuntu 14.04). But at the time of invoking help topic, help window was NOT opened. The comment in the code ***// On non Windows platforms, use external when modal window is displayed*** says, open help in external browser on non Window OSes **IF MODAL WINDOW IS DISPLAYED**. Is there any way to open help topic in help window ONLY on Linux? – Chandrayya G K Sep 06 '16 at 09:30
  • I guess `DefaultHelpUI.isDisplayModal()` will mostly return true since the active shell is probably the main application window. `(SWT.APPLICATION_MODAL | SWT.PRIMARY_MODAL | SWT.SYSTEM_MODAL))`. So, no you probably can't. – flavio.donze Sep 06 '16 at 14:36
  • At least if you are using the `DefaultHelpUI`, maybe you could if you implement your own HelpUI, extending `AbstractHelpUI`. – flavio.donze Sep 06 '16 at 14:43