com.jstatcom.component
Class JHelpContextMgr

java.lang.Object
  extended by com.jstatcom.component.JHelpContextMgr

public final class JHelpContextMgr
extends java.lang.Object

Manages the mapping between IDs for context sensitive help topics and the respective components. The mapping is stored in an XML file help_context.xml. Components that should use context sensitive help must register with the JHelpContextMgr. This class is used to maintain all help IDs in a single place that can be edited without changing the code. Components are identified via their classname.

Author:
Markus Kraetzig

Nested Class Summary
static class JHelpContextMgr.ContextID
          Inner class for storing mappings as XML elements.
 
Field Summary
static java.lang.String helpIDFile
           
static javolution.xml.XmlFormat<JHelpContextMgr> JHelpContextMgr_XML
          XML format field for (de)serialization.
 
Method Summary
 java.util.Iterator<java.lang.String> compNames()
          Gets an itertor of all available keys.
 java.lang.String getID(java.lang.Object key)
          Gets the ID according to the component name.
static void register(java.awt.Component comp)
          Retrieves the helpID from the stored map for comp according to the classname of that Component and sets the helpID for context sensitive help.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

helpIDFile

public static final java.lang.String helpIDFile
See Also:
Constant Field Values

JHelpContextMgr_XML

public static final javolution.xml.XmlFormat<JHelpContextMgr> JHelpContextMgr_XML
XML format field for (de)serialization.

Method Detail

register

public static void register(java.awt.Component comp)
Retrieves the helpID from the stored map for comp according to the classname of that Component and sets the helpID for context sensitive help.

Parameters:
comp - the component to set the stored helpID for
Throws:
java.lang.IllegalArgumentException - if (comp == null)

compNames

public java.util.Iterator<java.lang.String> compNames()
Gets an itertor of all available keys.

Returns:
the names of the components that are currently mapped

getID

public java.lang.String getID(java.lang.Object key)
Gets the ID according to the component name.

Parameters:
key - the name of a component
Returns:
the mapped helpID