wt.help
Interface HelpSystem

All Known Implementing Classes:
NFHelpSystem

public interface HelpSystem

The HelpSystem is used to integrate a set of HelpContexts. HelpSystem manages accessing the help resource bundle and launching help content in a browser. Each HelpContext is usually associated with a java.awt.Window (although it only requires a java.awt.Container). The HelpContext allows the association of each of the Window's Components with a topic identifier. The combination of the HelpSystem id (name) with the context id,

The help resource bundle contains a set of key value pairs. The keys are hierarchical keys which which are used to either identify a display string or a URL. The display strings are used directly on the frame to show things such as tool tips. URL's are used to launch a context sensitive help browser.

The following is an example of a help resource bundle:

public class HelpResources extends ListResourceBundle { public Object[][] getContents() { return contents; } static final Object[][] contents = { // LOCALIZE THIS {"Contents/HelpDesk", "HelpDeskContents.html"}, // Contents URL for appl HelpDesk {"Help/HelpDesk", "HelpDeskHelp.html"}, // Help URL for HelpDesk {"Desc/HelpDesk", "Press F1 for help." }, // Description URL. {"Help/HelpDesk/Login", "Login/help.html"}, // Help URL for login. {"Desc/HelpDesk/Login", "Press F1 for help."}, // Description for login. {"Help/HelpDesk/Login/OKButton", "Login/OKButton/help.html"},// URL Help for login OK button. {"Tip/HelpDesk/Login/OKButton", "Press OK to login." }, // Tool tip for login OK button. {"Desc/HelpDesk/Login/OKButton", "This is Description11" } // Descriptoin for login OK button. // END OF MATERIAL TO LOCALIZE }; // Object[][] contents } // class HelpURLMap

Supported API: true
Extendable: false


Field Summary
static String APPLET_CONTEXT
          Property name for HelpSystem attribute name.
static String CONTENTS_KEY
          Prefix for identifying contents urls.
static String CONTENTS_URL
          Property name for HelpSystem attribute name.
static String DESCRIPTION_KEY
          Prefix for identifying description text.
static String DOCUMENT_BASE
          Property name for HelpSystem attribute name.
static String HELP_KEY
          Prefix for identifying help urls.
static String HELP_URL
          Property name for HelpSystem attribute name.
static String KEY_DELIMITER
          Delimiter for resource keys.
static String MISSING_RESOURCE
          String displayed when a resource is not found.
static String NAME
          Property name for HelpSystem attribute name.
static String RESOURCES
          Property name for HelpSystem attribute name.
static String SHOW_IN_CURRENT_FRAME
          Final value which indicates that help should be shown in the current frame.
static String SHOW_IN_PARENT_FRAME
          Final value which indicates that help should be shown in the parent frame.
static String SHOW_IN_SEPARATE_FRAME
          Final value which indicates that help should be shown in a separate unnamed frame.
static String SHOW_IN_TOP_FRAME
          Final value which indicates that help should be shown in the top frame.
static String TIP_KEY
          Prefix for identifying tool tip text.
static String WHERE_TO_SHOW_DOCUMENT
          Property name for HelpSystem attribute name.
 
Method Summary
 void addPropertyChangeListener(PropertyChangeListener listener)
          Add property change listener.
 AppletContext getAppletContext()
          Get the applet context for this HelpSystem.
 String getContentsURL()
          The current help contents help URL.
 URL getDocumentBase()
          Get the base url used to show help urls.
 String getHelpURL()
          The current help url.
 String getName()
          Get the HelpSystem name.
 ResourceBundle getResources()
          Get the resource bundle for help.
 String getToolDescription(String contextId, String toolId)
          The tool description for the component over which the mouse is positioned.
 String getToolTipText(String contextId, String toolId)
          The tool tip for the component over which the mouse is positioned.
 String getWhereToShowDocument()
          Get String used to indicate whether help URLs should be displayed in the current frame, the parent frame, top frame or a separate frame.
 void removePropertyChangeListener(PropertyChangeListener listener)
          Remove property change listener.
 void setAppletContext(AppletContext newValue)
          Set the applet context for this HelpSystem.
 void setDocumentBase(URL documentBase)
          Set the base url used to show help urls.
 void setName(String newValue)
          Set the HelpSystem name.
 void setResources(ResourceBundle resourceBundle)
          Set the resource bundle for help.
 void setWhereToShowDocument(String where)
          Set String used to indicate which frame help should be displayed in.
 void showContents(String contextId)
          Show help contents for the context id.
 void showFind(String contextId)
           
 void showFind(String contextId, String keyword)
           
 void showHelp(String contextId)
          Show help for the context id.
 void showHelp(String contextId, String topicId)
          Show help contents for the context id and topic id.
 

Field Detail

NAME

public static final String NAME
Property name for HelpSystem attribute name.

See Also:
Constant Field Values

APPLET_CONTEXT

public static final String APPLET_CONTEXT
Property name for HelpSystem attribute name.

See Also:
Constant Field Values

DOCUMENT_BASE

public static final String DOCUMENT_BASE
Property name for HelpSystem attribute name.

See Also:
Constant Field Values

WHERE_TO_SHOW_DOCUMENT

public static final String WHERE_TO_SHOW_DOCUMENT
Property name for HelpSystem attribute name.

See Also:
Constant Field Values

RESOURCES

public static final String RESOURCES
Property name for HelpSystem attribute name.

See Also:
Constant Field Values

CONTENTS_URL

public static final String CONTENTS_URL
Property name for HelpSystem attribute name.

See Also:
Constant Field Values

HELP_URL

public static final String HELP_URL
Property name for HelpSystem attribute name.

See Also:
Constant Field Values

MISSING_RESOURCE

public static final String MISSING_RESOURCE
String displayed when a resource is not found.

See Also:
Constant Field Values

KEY_DELIMITER

public static final String KEY_DELIMITER
Delimiter for resource keys.

See Also:
Constant Field Values

CONTENTS_KEY

public static final String CONTENTS_KEY
Prefix for identifying contents urls.

See Also:
Constant Field Values

HELP_KEY

public static final String HELP_KEY
Prefix for identifying help urls.

See Also:
Constant Field Values

TIP_KEY

public static final String TIP_KEY
Prefix for identifying tool tip text.

See Also:
Constant Field Values

DESCRIPTION_KEY

public static final String DESCRIPTION_KEY
Prefix for identifying description text.

See Also:
Constant Field Values

SHOW_IN_CURRENT_FRAME

public static final String SHOW_IN_CURRENT_FRAME
Final value which indicates that help should be shown in the current frame. Passed as an argument to operation setWhereToShowDocument(). See documentation for java.awt.AppletContext.

See Also:
Constant Field Values

SHOW_IN_PARENT_FRAME

public static final String SHOW_IN_PARENT_FRAME
Final value which indicates that help should be shown in the parent frame. Passed as an argument to operation setWhereToShowDocument(). See documentation for java.awt.AppletContext.

See Also:
Constant Field Values

SHOW_IN_TOP_FRAME

public static final String SHOW_IN_TOP_FRAME
Final value which indicates that help should be shown in the top frame. Passed as an argument to operation setWhereToShowDocument(). See documentation for java.awt.AppletContext.

See Also:
Constant Field Values

SHOW_IN_SEPARATE_FRAME

public static final String SHOW_IN_SEPARATE_FRAME
Final value which indicates that help should be shown in a separate unnamed frame. Passed as an argument to operation setWhereToShowDocument(). See documentation for java.awt.AppletContext.

See Also:
Constant Field Values
Method Detail

getName

public String getName()
Get the HelpSystem name. This name is used to construct help keys.


setName

public void setName(String newValue)
             throws PropertyVetoException
Set the HelpSystem name.

Parameters:
newValue - the new name.
Throws:
PropertyVetoException - if the new value is invalid.

getAppletContext

public AppletContext getAppletContext()
Get the applet context for this HelpSystem.

Returns:
the AppletContext, may be null.

setAppletContext

public void setAppletContext(AppletContext newValue)
                      throws PropertyVetoException
Set the applet context for this HelpSystem. The showDocument operation is called on this AppletContext to show help urls.

Parameters:
newValue - the new AppletContext.
Throws:
PropertyVetoException - if the new value is invalid.

getDocumentBase

public URL getDocumentBase()
Get the base url used to show help urls.

Returns:
the document base URL.

setDocumentBase

public void setDocumentBase(URL documentBase)
                     throws PropertyVetoException
Set the base url used to show help urls.

Parameters:
documentBase - the new value of the document.
Throws:
PropertyVetoException - if the new value is invalid.

getWhereToShowDocument

public String getWhereToShowDocument()
Get String used to indicate whether help URLs should be displayed in the current frame, the parent frame, top frame or a separate frame. See documentation for operation java.applet.AppletContext.showDocument(). Legal values include SHOW_IN_CURRENT_FRAME, SHOW_IN_PARENT_FRAME, SHOW_IN_TOP_FRAME, SHOW_IN_SEPARATE_FRAME. If a String other than those listed is passed then a separate frame with the passed name will be used.

Returns:
the String indicating what frame the help will be displayed, e.g. "_self".
See Also:
AppletContext

setWhereToShowDocument

public void setWhereToShowDocument(String where)
                            throws PropertyVetoException
Set String used to indicate which frame help should be displayed in.

Parameters:
where - The frame for displaying help, e.g. HelpSystem.SHOW_IN_CURRENT_FRAME.
Throws:
PropertyVetoException - if the where value is invalid.
See Also:
AppletContext

getResources

public ResourceBundle getResources()
Get the resource bundle for help. Resources include help text and urls.

Returns:
the help system resource bundle.

setResources

public void setResources(ResourceBundle resourceBundle)
                  throws PropertyVetoException
Set the resource bundle for help.

Parameters:
resourceBundle - the localized help ResourceBundle.
Throws:
PropertyVetoException - if the resourceBundle is invalid.

getContentsURL

public String getContentsURL()
The current help contents help URL. Listeners may subscribe to this property.

Returns:
the URL for the help contents.

getHelpURL

public String getHelpURL()
The current help url. Listeners may subcribe to this property.

Returns:
the help URL.

getToolTipText

public String getToolTipText(String contextId,
                             String toolId)
The tool tip for the component over which the mouse is positioned. Listeners may subscribe to this property.

Parameters:
contextId - the sub-key for the context.
toolId - the sub-key for the tool.
Returns:
the tool tip from the localized resource bundle.

getToolDescription

public String getToolDescription(String contextId,
                                 String toolId)
The tool description for the component over which the mouse is positioned. Listeners may subscribe to this property.

Parameters:
contextId - the sub-key for the context.
toolId - the sub-key for the tool.
Returns:
the description from the localized resource bundle.

showContents

public void showContents(String contextId)
Show help contents for the context id. The context id will be combined with the help system name to form a help resource url. The help resource url will be launched in the current applet context.

Parameters:
contextId - the context help sub-key.

showHelp

public void showHelp(String contextId)
Show help for the context id. The context id will be combined with the help system name to form a help resource url. The help resource url will be launched in the current applet context.

Parameters:
contextId - the context help sub-key.

showHelp

public void showHelp(String contextId,
                     String topicId)
Show help contents for the context id and topic id. The context id and topic id will be combined with the help system name to form a help resource url. The help resource url will be launched in the current applet context.

Parameters:
contextId - the context help sub-key.
topicId - the topic help sub-key.

showFind

public void showFind(String contextId)

showFind

public void showFind(String contextId,
                     String keyword)

addPropertyChangeListener

public void addPropertyChangeListener(PropertyChangeListener listener)
Add property change listener.

Parameters:
listener - the new listener.

removePropertyChangeListener

public void removePropertyChangeListener(PropertyChangeListener listener)
Remove property change listener.

Parameters:
listener - the listener to be removed.