Java Code Examples for javax.help.CSH#DisplayHelpFromSource

The following examples show how to use javax.help.CSH#DisplayHelpFromSource . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: GlobalOptions.java    From dsworkbench with Apache License 2.0 4 votes vote down vote up
public static CSH.DisplayHelpFromSource getHelpDisplay() {
    return csh;
}
 
Example 2
Source File: BoardMenuHelp.java    From Freerouting with GNU General Public License v3.0 4 votes vote down vote up
private void initialize_help(java.util.Locale p_locale)
{
    // try to find the helpset and create a HelpBroker object
    if (BoardFrame.help_broker == null)
    {
        String language = p_locale.getLanguage();
        String helpset_name;
        if (language.equalsIgnoreCase("de"))
        {
            helpset_name = "helpset/de/Help.hs";
        }
        else
        {
            helpset_name = "helpset/en/Help.hs";
        }
        try
        {
            URL hsURL = HelpSet.findHelpSet(this.getClass().getClassLoader(), helpset_name);
            if (hsURL == null)
            {
                System.out.println("HelpSet " + helpset_name + " not found.");
            }
            else
            {
                BoardFrame.help_set = new HelpSet(null, hsURL);
            }
        }
        catch (HelpSetException ee)
        {
            System.out.println("HelpSet " + helpset_name + " could not be opened.");
            System.out.println(ee.getMessage());
        }
        if (BoardFrame.help_set != null)
        {
            BoardFrame.help_broker = BoardFrame.help_set.createHelpBroker();
        }
        if (BoardFrame.help_broker != null)
        {
            // CSH.DisplayHelpFromSource is a convenience class to display the helpset
            contents_help = new CSH.DisplayHelpFromSource(BoardFrame.help_broker);
            direct_help = new CSH.DisplayHelpAfterTracking(BoardFrame.help_broker);
        }
    }
}
 
Example 3
Source File: BoardMenuHelp.java    From freerouting with GNU General Public License v3.0 4 votes vote down vote up
private void initialize_help(java.util.Locale p_locale)
{
    // try to find the helpset and create a HelpBroker object
    if (BoardFrame.help_broker == null)
    {
        String language = p_locale.getLanguage();
        String helpset_name;
        if (language.equalsIgnoreCase("de"))
        {
            helpset_name = "/eu/mihosoft/freerouting/helpset/de/Help.hs";
        }
        else
        {
            helpset_name = "/eu/mihosoft/freerouting/helpset/en/Help.hs";
        }
        try
        {
            // original author tries to get language specific url
            // via HelpSet utility methods which does not work that well
            // and doesn't really make sense if the language is specified
            // manually
            // TODO find out why previous approach does not work reliably
            URL hsURL = getClass().getResource(helpset_name);
            if (hsURL == null)
            {
                FRLogger.warn("HelpSet " + helpset_name + " not found.");
            }
            else
            {
                BoardFrame.help_set = new HelpSet(null, hsURL);
            }
        }
        catch (HelpSetException ee)
        {
            FRLogger.error("HelpSet " + helpset_name + " could not be opened.", ee);
        }
        if (BoardFrame.help_set != null)
        {
            BoardFrame.help_broker = BoardFrame.help_set.createHelpBroker();
        }
        if (BoardFrame.help_broker != null)
        {
            // CSH.DisplayHelpFromSource is a convenience class to display the helpset
            contents_help = new CSH.DisplayHelpFromSource(BoardFrame.help_broker);
            direct_help = new CSH.DisplayHelpAfterTracking(BoardFrame.help_broker);
        }
    }
}