Search in sources :

Example 1 with ContextFileProvider

use of org.eclipse.help.internal.context.ContextFileProvider in project statecharts by Yakindu.

the class AbstractUserHelpDocumentationProvider method parseHelp.

private String parseHelp(String contextId) throws Exception {
    ContextFileProvider provider = new ContextFileProvider();
    IContext context = provider.getContext(contextId, Locale.getDefault().toString());
    IHelpResource[] relatedTopics = context.getRelatedTopics();
    Assert.isTrue(relatedTopics != null);
    // We assume that there is only one topic registered
    IHelpResource helpResource = relatedTopics[0];
    String href = helpResource.getHref().substring(1);
    URL url = new URL("platform:/plugin/" + href);
    return convertStreamToString(url.openConnection().getInputStream());
}
Also used : ContextFileProvider(org.eclipse.help.internal.context.ContextFileProvider) IContext(org.eclipse.help.IContext) IHelpResource(org.eclipse.help.IHelpResource) URL(java.net.URL)

Aggregations

URL (java.net.URL)1 IContext (org.eclipse.help.IContext)1 IHelpResource (org.eclipse.help.IHelpResource)1 ContextFileProvider (org.eclipse.help.internal.context.ContextFileProvider)1