protected boolean resolvePage(String contextId, boolean endpoint) { String contextName = contextId; IContext context = HelpSystem.getContext(contextName); if (context == null) { if (endpoint) { contextName = "org.fusesource.ide.camel.editor.endpoint"; } else { contextName = "org.fusesource.ide.camel.editor.allEIPs"; context = HelpSystem.getContext(""); } context = HelpSystem.getContext(contextName); // Activator.getLogger().debug("Context ID " + contextId + // " is bad using default."); } if (context == null) { Activator.getLogger().warning("Could not find context: " + contextName); return false; } IHelpResource[] relatedTopics = context.getRelatedTopics(); if (relatedTopics != null && relatedTopics.length > 0) { IHelpResource resource = relatedTopics[0]; if (resource != null) { String helpUrl = resource.getHref(); IWorkbenchHelpSystem helpSystem = PlatformUI.getWorkbench().getHelpSystem(); URL url = helpSystem.resolve(helpUrl, true); return browser.setUrl(url.toExternalForm()); } } Activator.getLogger().warning("Could not find resource in context: " + contextName); return false; }
public static void displayHelp(String contextId, Object[] selected) throws CoreException { IContext context = HelpSystem.getContext(contextId); if (context != null) { if (selected != null && selected.length > 0) { context = new JavadocHelpContext(context, selected); } PlatformUI.getWorkbench().getHelpSystem().displayHelp(context); } }
@Override public void performHelp() { // TODO: in next version: refer to ICPropertyTab instead of AbstractCPropertyTab if (currentTab != null && currentTab instanceof AbstractCPropertyTab) { String s = ((AbstractCPropertyTab) currentTab).getHelpContextId(); if (s != null && s.length() > 0) { IContext context = HelpSystem.getContext(s); if (context != null) PlatformUI.getWorkbench().getHelpSystem().displayHelp(context); else PlatformUI.getWorkbench().getHelpSystem().displayDynamicHelp(); } } }