Search in sources :

Example 1 with HelpSetPath

use of com.intellij.ide.plugins.HelpSetPath in project intellij-community by JetBrains.

the class HelpManagerImpl method createHelpSet.

@Nullable
private static HelpSet createHelpSet() {
    String urlToHelp = ApplicationInfo.getInstance().getHelpURL() + "/" + HELP_HS;
    HelpSet mainHelpSet = loadHelpSet(urlToHelp);
    if (mainHelpSet == null)
        return null;
    // merge plugins help sets
    IdeaPluginDescriptor[] pluginDescriptors = PluginManagerCore.getPlugins();
    for (IdeaPluginDescriptor pluginDescriptor : pluginDescriptors) {
        HelpSetPath[] sets = pluginDescriptor.getHelpSets();
        for (HelpSetPath hsPath : sets) {
            String url = "jar:file:///" + pluginDescriptor.getPath().getAbsolutePath() + "/help/" + hsPath.getFile() + "!";
            if (!hsPath.getPath().startsWith("/")) {
                url += "/";
            }
            url += hsPath.getPath();
            HelpSet pluginHelpSet = loadHelpSet(url);
            if (pluginHelpSet != null) {
                mainHelpSet.add(pluginHelpSet);
            }
        }
    }
    return mainHelpSet;
}
Also used : HelpSet(javax.help.HelpSet) HelpSetPath(com.intellij.ide.plugins.HelpSetPath) IdeaPluginDescriptor(com.intellij.ide.plugins.IdeaPluginDescriptor) Nullable(org.jetbrains.annotations.Nullable)

Aggregations

HelpSetPath (com.intellij.ide.plugins.HelpSetPath)1 IdeaPluginDescriptor (com.intellij.ide.plugins.IdeaPluginDescriptor)1 HelpSet (javax.help.HelpSet)1 Nullable (org.jetbrains.annotations.Nullable)1