org.esa.beam.framework.help
Class HelpSys

java.lang.Object
  extended by org.esa.beam.framework.help.HelpSys

public class HelpSys
extends Object

This utility class supports the java help system.

It contains exclusively static methods and can hold a HelpBroker singleton from which this class receives its functionallity.

This class can be used in all components which have a context sensitive help.

Version:
$Revision$ $Date$
Author:
Sabine Embacher

Constructor Summary
HelpSys()
           
 
Method Summary
static void add(javax.help.HelpSet helpSet)
          Adds the given help set to the current helpset.
static void dispose()
          Disposes the application help system.
static boolean enableHelp(Component component, String helpId)
          Enables help for a component.
static boolean enableHelpKey(Component component, String helpId)
          Enables the Help key on a component.
static boolean enableHelpOnButton(Component component, String helpId)
          Enables help for a component.
static javax.help.HelpBroker getHelpBroker()
          Gets the held help broker
static javax.help.HelpSet getHelpSet()
          Gets the help set from the held help broker
static boolean isInitialized()
           
static boolean isValidID(String id)
           
static void showTheme(String helpId)
          If the help system is initialised this method shows the given help theme.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HelpSys

public HelpSys()
Method Detail

add

public static void add(javax.help.HelpSet helpSet)
Adds the given help set to the current helpset.

Parameters:
helpSet - the help set to be added

getHelpBroker

public static javax.help.HelpBroker getHelpBroker()
Gets the held help broker

Returns:
the held help broker if there is any, otherways null

getHelpSet

public static javax.help.HelpSet getHelpSet()
Gets the help set from the held help broker

Returns:
the help set from the held help broker if there is any, otherways null

enableHelp

public static boolean enableHelp(Component component,
                                 String helpId)
Enables help for a component. Convenience method which delegates to the held help broker, if ther is any, an applies the help set from the help broker and the help id to the given component.

Parameters:
component - the component to which the help id should applied
helpId - the help id to be applied
Returns:
true if the help was enabled, otherwise false.
Throws:
IllegalArgumentException - if the given component is null
IllegalArgumentException - if the given help id is null
See Also:
HelpBroker.enableHelp(Component, String, HelpSet)

enableHelpKey

public static boolean enableHelpKey(Component component,
                                    String helpId)
Enables the Help key on a component. Convenience method which delegates to the held help broker, if ther is any. an applies the help set from the help broker and the help id to the given component.

Parameters:
component - the component to which the help id should applied
helpId - the help id to be applied
Returns:
true if the help key was enabled, otherwise false.
Throws:
IllegalArgumentException - if the given component is null
IllegalArgumentException - if the given help id is null
See Also:
HelpBroker.enableHelpKey(Component, String, HelpSet)

enableHelpOnButton

public static boolean enableHelpOnButton(Component component,
                                         String helpId)
Enables help for a component. Convenience method which delegates to the held help broker, if ther is any. This method sets a component's helpID and HelpSet and adds an ActionListener. When an action is performed it displays the component's helpID and HelpSet in the default viewer.

Parameters:
component - the component to which the help id should applied
helpId - the help id to be applied
Returns:
true if the help was enabled, otherwise false.
Throws:
IllegalArgumentException - if the component is not a javax.swing.AbstractButton or a java.awt.Button or the given component is null
See Also:
HelpBroker.enableHelpOnButton(Component, String, HelpSet)

isValidID

public static boolean isValidID(String id)

showTheme

public static void showTheme(String helpId)
If the help system is initialised this method shows the given help theme.

Parameters:
helpId - the help theme

isInitialized

public static boolean isInitialized()

dispose

public static void dispose()
Disposes the application help system.



Copyright © 2002-2013 Brockmann Consult GmbH. All Rights Reserved.