com.quadrique.jbuildingblocks.gui
Class OnlineHelp

java.lang.Object
  extended by com.quadrique.jbuildingblocks.gui.OnlineHelp

public class OnlineHelp
extends Object

This class helps you incorporate online help in your application. It uses the Java Help technology and helps you manipulate a help set file (see http://http://java.sun.com/products/javahelp/index.html)

Author:
Hervé Rivere

Constructor Summary
OnlineHelp()
          constructor
 
Method Summary
 void enableHelpKey(JRootPane zRootPane, String zIdForHelpKey)
          Call this method to display the online help window when the end user types on the "Help" key (e.g.
 ActionListener getContextSensitiveHelpActionListener()
          getContextSensitiveHelpActionListener
 ActionListener getHelpActionListener()
          getHelpActionListener
static OnlineHelp getInstance()
          This method returns an instance of the OnlineHelp class.
 void initialize(String zHelpSetFileName)
           
 boolean isEnabled()
           
 void setCshId(JComponent zComponent, String zId)
          to associate a context sensitive help id to a given component
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OnlineHelp

public OnlineHelp()
constructor

Method Detail

getInstance

public static final OnlineHelp getInstance()
This method returns an instance of the OnlineHelp class. If there has been already one instantiation, the same instance is returned so that it can be shared accross the application. A typical would be: OnlineHelp.getInstance().getXxxx() or OnlineHelp lOnlineHelp = OnlineHelp.getInstance();

Returns:
the unique OnlineHelp instance

initialize

public void initialize(String zHelpSetFileName)
                throws Exception
Parameters:
zHelpSetFileName - the name of the help set file (e.g. "MyApplication.hs")
Throws:
Exception - if an error occurs

isEnabled

public boolean isEnabled()
Returns:
true if the online help is enabled

enableHelpKey

public void enableHelpKey(JRootPane zRootPane,
                          String zIdForHelpKey)
                   throws Exception
Call this method to display the online help window when the end user types on the "Help" key (e.g. "F1" on a Microsoft platform)

Parameters:
zRootPane - the main window/frame root pane
zIdForHelpKey - the index of the page to display in the help set
Throws:
Exception - if an error occurs

getHelpActionListener

public ActionListener getHelpActionListener()
getHelpActionListener

Returns:
null if the online hlep hasn't been initialized, an action listerner that will trigger the display of the online help window otherwise.

getContextSensitiveHelpActionListener

public ActionListener getContextSensitiveHelpActionListener()
getContextSensitiveHelpActionListener

Returns:
null if the online hlep hasn't been initialized, an action listerner that will trigger the context sensitive help mechanism (cursor will be changed, display of the online help window whenever a component has been selected) otherwise.

setCshId

public void setCshId(JComponent zComponent,
                     String zId)
to associate a context sensitive help id to a given component

Parameters:
zComponent - the component
zId - the context sensitive help id to associate to the component


Copyright © 2001-2009 Quadrique Corporation. All Rights Reserved.