Search in sources :

Example 1 with HelpSet

use of javax.help.HelpSet in project ACS by ACS-Community.

the class CommandCenterGui method showHelpBrowser.

protected void showHelpBrowser() {
    if (helpBroker == null) {
        HelpSet helpSet = controller.getHelpSet();
        if (helpSet == null) {
            ErrorBox.showMessageDialog(frame, "Online Help could not be loaded", true);
            return;
        }
        helpBroker = (DefaultHelpBroker) helpSet.createHelpBroker();
    }
    helpBroker.setCurrentID("intro");
    helpBroker.setDisplayed(true);
}
Also used : HelpSet(javax.help.HelpSet)

Example 2 with HelpSet

use of javax.help.HelpSet 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)

Example 3 with HelpSet

use of javax.help.HelpSet in project JMRI by JMRI.

the class HelpUtil method initOK.

public static boolean initOK() {
    if (!init) {
        init = true;
        try {
            Locale locale = Locale.getDefault();
            String language = locale.getLanguage();
            String helpsetName = "help/" + language + "/JmriHelp_" + language + ".hs";
            URL hsURL = FileUtil.findURL(helpsetName);
            if (hsURL != null) {
                log.debug("JavaHelp using {}", helpsetName);
            } else {
                log.warn("JavaHelp: File " + helpsetName + " not found, dropping to default");
                language = "en";
                helpsetName = "help/" + language + "/JmriHelp_" + language + ".hs";
                hsURL = FileUtil.findURL(helpsetName);
            }
            try {
                globalHelpSet = new HelpSet(null, hsURL);
            } catch (java.lang.NoClassDefFoundError ee) {
                log.debug("classpath={}", System.getProperty("java.class.path", "<unknown>"));
                log.debug("classversion={}", System.getProperty("java.class.version", "<unknown>"));
                log.error("Help classes not found, help system omitted");
                return false;
            } catch (java.lang.Exception e2) {
                log.error("HelpSet " + helpsetName + " not found, help system omitted");
                return false;
            }
            globalHelpBroker = globalHelpSet.createHelpBroker();
        } catch (java.lang.NoSuchMethodError e2) {
            log.error("Is jh.jar available? Error starting help system: " + e2);
        }
        failed = false;
    }
    return !failed;
}
Also used : Locale(java.util.Locale) HelpSet(javax.help.HelpSet) URL(java.net.URL)

Example 4 with HelpSet

use of javax.help.HelpSet in project keystore-explorer by kaikramer.

the class HelpAction method createAndDisplayHelp.

private void createAndDisplayHelp() throws HelpSetException {
    URL hsUrl = getClass().getResource(res.getString("HelpAction.HelpSet"));
    HelpSet hs = new HelpSet(getClass().getClassLoader(), hsUrl);
    if (LnfUtil.isDarculaAvailable()) {
        URL hsDarculaUrl = getClass().getResource(res.getString("HelpAction.DarculaHelpSet"));
        HelpSet hsDarcula = new HelpSet(getClass().getClassLoader(), hsDarculaUrl);
        hs.add(hsDarcula);
    }
    helpBroker = new DefaultHelpBroker(hs);
    WindowPresentation windowPresentation = helpBroker.getWindowPresentation();
    windowPresentation.createHelpWindow();
    // Make window immune to modal dialogs in application
    Window helpWindow = windowPresentation.getHelpWindow();
    helpWindow.setModalExclusionType(ModalExclusionType.APPLICATION_EXCLUDE);
    // Set help icons - set lots of different sizes to give each OS the most
    // flexibility in choosing an icon for display
    ArrayList<Image> icons = new ArrayList<Image>();
    icons.add(Toolkit.getDefaultToolkit().createImage(getClass().getResource(res.getString("HelpAction.image.16x16"))));
    icons.add(Toolkit.getDefaultToolkit().createImage(getClass().getResource(res.getString("HelpAction.image.24x24"))));
    icons.add(Toolkit.getDefaultToolkit().createImage(getClass().getResource(res.getString("HelpAction.image.32x32"))));
    helpWindow.setIconImages(icons);
    helpBroker.setLocation(new Point(frame.getX() + 25, frame.getY() + 25));
    helpBroker.setSize(new Dimension(850, 600));
    helpBroker.setCurrentID(START_ID);
    helpBroker.setDisplayed(true);
}
Also used : Window(java.awt.Window) HelpSet(javax.help.HelpSet) WindowPresentation(javax.help.WindowPresentation) ArrayList(java.util.ArrayList) DefaultHelpBroker(javax.help.DefaultHelpBroker) Point(java.awt.Point) Dimension(java.awt.Dimension) Image(java.awt.Image) URL(java.net.URL)

Example 5 with HelpSet

use of javax.help.HelpSet in project edumips64 by lupino3.

the class GUIHelp method showHelp.

/**
 * Shows the EduMIPS64 help window.
 *
 * @param parent the window that owns this help dialog
 * @param helpSetUrl the URL to the directory of the help set.
 */
public static void showHelp(Window parent, URL helpSetUrl, ConfigStore cfg) throws HelpSetException, BadIDException, MalformedURLException {
    // Clean up the URL from spaces.
    String cleanUrl = helpSetUrl.getProtocol() + ":" + helpSetUrl.getPath().replace("%20", " ");
    URL[] aurl = GUIHelp.parseURLs(cleanUrl);
    URLClassLoader urlclassloader = new URLClassLoader(aurl);
    URL url = HelpSet.findHelpSet(urlclassloader, HELPSET);
    int desiredFontSize = cfg.getInt(ConfigKey.UI_FONT_SIZE);
    float windowScalingFactor = desiredFontSize / 12.0f;
    HelpSet helpset = new HelpSet(urlclassloader, url);
    HelpBroker helpBroker = helpset.createHelpBroker();
    helpBroker.initPresentation();
    helpBroker.setSize(new Dimension((int) (800 * windowScalingFactor), (int) (600 * windowScalingFactor)));
    // Update the font.
    helpBroker.setSize(helpBroker.getSize());
    Font newFont = helpBroker.getFont().deriveFont((float) desiredFontSize);
    ((DefaultHelpBroker) helpBroker).setActivationWindow(parent);
    helpBroker.initPresentation();
    helpBroker.setFont(newFont);
    helpBroker.setDisplayed(true);
}
Also used : DefaultHelpBroker(javax.help.DefaultHelpBroker) HelpBroker(javax.help.HelpBroker) HelpSet(javax.help.HelpSet) URLClassLoader(java.net.URLClassLoader) DefaultHelpBroker(javax.help.DefaultHelpBroker) URL(java.net.URL)

Aggregations

HelpSet (javax.help.HelpSet)18 URL (java.net.URL)12 HelpSetException (javax.help.HelpSetException)7 DefaultHelpBroker (javax.help.DefaultHelpBroker)3 HelpBroker (javax.help.HelpBroker)3 Dimension (java.awt.Dimension)2 FileNotFoundException (java.io.FileNotFoundException)2 IOException (java.io.IOException)2 BadIDException (javax.help.BadIDException)2 CSH (javax.help.CSH)2 JHelp (javax.help.JHelp)2 WindowPresentation (javax.help.WindowPresentation)2 ExecuteAcs (alma.acs.commandcenter.engine.ExecuteAcs)1 ExecuteContainer (alma.acs.commandcenter.engine.ExecuteContainer)1 ExecuteManager (alma.acs.commandcenter.engine.ExecuteManager)1 ExecuteServices (alma.acs.commandcenter.engine.ExecuteServices)1 ExecuteTools (alma.acs.commandcenter.engine.ExecuteTools)1 CommandCenterGui (alma.acs.commandcenter.gui.CommandCenterGui)1 Firestarter (alma.acs.commandcenter.meta.Firestarter)1 OrbInitException (alma.acs.commandcenter.meta.Firestarter.OrbInitException)1