Class HelpUtil


  • public final class HelpUtil
    extends Object
    Provides utility methods for help system.
    Since:
    2252
    • Method Detail

      • getWikiBaseUrl

        public static String getWikiBaseUrl()
        Replies the base wiki URL.
        Returns:
        the base wiki URL
      • getWikiBaseHelpUrl

        public static String getWikiBaseHelpUrl()
        Replies the base wiki URL for help pages
        Returns:
        the base wiki URL for help pages
      • getHelpTopicEditUrl

        public static String getHelpTopicEditUrl​(String absoluteHelpTopic)
        Replies the URL to the edit page for the absolute help topic.
        Parameters:
        absoluteHelpTopic - the absolute help topic
        Returns:
        the URL to the edit page
      • extractRelativeHelpTopic

        public static String extractRelativeHelpTopic​(String url)
        Extracts the relative help topic from an URL. Replies null, if no relative help topic is found.
        Parameters:
        url - the url
        Returns:
        the relative help topic in the URL, i.e. "/Action/New"
      • extractAbsoluteHelpTopic

        public static String extractAbsoluteHelpTopic​(String url)
        Extracts the absolute help topic from an URL. Replies null, if no absolute help topic is found.
        Parameters:
        url - the url
        Returns:
        the absolute help topic in the URL, i.e. "/De:Help/Action/New"
      • getHelpTopicPrefix

        private static String getHelpTopicPrefix​(LanguageInfo.LocaleType type)
        Replies the help topic prefix for the given locale. Examples:
        • /Help if the locale is a locale with language "en"
        • /De:Help if the locale is a locale with language "de"
        Parameters:
        type - the type of the locale to use
        Returns:
        the help topic prefix
        Since:
        5915
      • buildAbsoluteHelpTopic

        public static String buildAbsoluteHelpTopic​(String topic,
                                                    LanguageInfo.LocaleType type)
        Replies the absolute, localized help topic for the given topic. Example: for a topic "/Dialog/RelationEditor" and the locale "de", this method replies "/De:Help/Dialog/RelationEditor"
        Parameters:
        topic - the relative help topic. Home help topic assumed, if null.
        type - the locale. Locale.ENGLISH assumed, if null.
        Returns:
        the absolute, localized help topic
        Since:
        5915
      • getContextSpecificHelpTopic

        public static String getContextSpecificHelpTopic​(Object context)
        Replies the context specific help topic configured for context.
        Parameters:
        context - The UI object used as context
        Returns:
        the help topic. null, if no context specific help topic is found
      • getHelpAction

        private static Action getHelpAction()
        Replies the global help action, if available. Otherwise, creates an instance of HelpAction.
        Returns:
        instance of help action
      • setHelpContext

        public static void setHelpContext​(JComponent component,
                                          String relativeHelpTopic)
        Makes a component aware of context sensitive help. A relative help topic doesn't start with /Help and doesn't include a locale code. Example: /Dialog/RelationEditor is a relative help topic, /De:Help/Dialog/RelationEditor is not.
        Parameters:
        component - the component
        relativeHelpTopic - the help topic. Set to the default help topic if null.
      • ht

        public static String ht​(String helpTopic)
        This is a simple marker method for help topic literals. If you declare a help topic literal in the source you should enclose it in ht(...). Example
             String helpTopic = ht("/Dialog/RelationEditor");
          or
             putValue("help", ht("/Dialog/RelationEditor"));
          
        Parameters:
        helpTopic - Help topic to mark
        Returns:
        helpTopic