Oracle Help for Java API Reference
Release 4.2.7.0.0
B12198-01

oracle.help
Class CSHManager

java.lang.Object
  |
  +--oracle.help.CSHManager

public class CSHManager
extends java.lang.Object

CSHManager is a helper class to manage Help with in an application. This class is useful for applications implementing context-sensitive help.

The CSHManager class provides multiple flavors of addComponent() to register objects for which help should be shown automatically upon receiving the F1 KeyPress event or a right-mouse pressed MouseEvent. Applications can also show help for objects explicitly by calling showHelpForComponent .

Applications in general should create only one instance of this class at application start up and share that instance. Applications having a single help Book can register their book as the DefaultBook. DefaultBook is used as the help book when no book is specified at object registration time.


Constructor Summary
CSHManager(Help help)
          Creates a new instance of CSHManager class.
 
Method Summary
 void addBook(Book book, boolean isDefault)
          Adds the book to the help system.
 void addComponent(java.awt.Component component, Book book, java.lang.String topicId)
          Registers a component with the help manager.
 void addComponent(java.awt.Component component, Book book, java.lang.String topicId, boolean needF1Help, boolean needPopupHelp)
          Registers a component with the CSHManager.
 void addComponent(java.awt.Component component, java.lang.String topicId)
          Registers a component with the help manager.
 void addComponent(java.awt.Component component, java.lang.String topicId, boolean needF1Help, boolean needPopupHelp)
          Registers a component with the CSHManager using the default book.
 Navigator[] getAllNavigators()
          Get the Navigator objects displayed in the help system's Navigator Window
protected  Help getHelpObject()
          Gets the Help object of this HelpManager.
 void removeBook(Book book)
          Removes a book from the help system.
 void removeComponent(java.awt.Component component)
          Unregisters a component with the CSHManager.
 void setDefaultBook(Book book)
          Sets the specified Book as the default Book.
 void showHelpForComponent(java.awt.Component component)
          Shows help for the specified component.
 void showNavigatorWindow()
          Shows the help system's navigator window
 void showNavigatorWindow(Book activeBook)
          Show the Navigator Window with the NavigatorTabPanel for the given Book initially displayed.
 void showNavigatorWindow(Navigator activeNavigator)
          Shows the help system's navigator window with the given navigator selected
 void showTopic(java.lang.String topicId)
          Shows help topic corresponding to the specified topic id.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CSHManager

public CSHManager(Help help)
Creates a new instance of CSHManager class. All the subsequent calls to this manager object will use the specified Help object.
Parameters:
help - Help object to be used for displaying help
Method Detail

setDefaultBook

public void setDefaultBook(Book book)
Sets the specified Book as the default Book. This Book will be as used the default Book for components registered without specifying a Book.
Parameters:
book - Book to be set
See Also:
addComponent(java.awt.Component, java.lang.String)

addBook

public void addBook(Book book,
                    boolean isDefault)
Adds the book to the help system.
Parameters:
book - Book to be added
default - If true, this book is used as the default Book for the CSHManager
See Also:
Help.addBook(oracle.help.library.Book)

removeBook

public void removeBook(Book book)
Removes a book from the help system.
See Also:
Help.removeBook(oracle.help.library.Book)

showNavigatorWindow

public void showNavigatorWindow()
Shows the help system's navigator window
See Also:
Help.showNavigatorWindow()

showNavigatorWindow

public void showNavigatorWindow(Navigator activeNavigator)
Shows the help system's navigator window with the given navigator selected
Parameters:
activeNavigator - the Navigator to initially display
See Also:
Help.showNavigatorWindow()

showNavigatorWindow

public void showNavigatorWindow(Book activeBook)
Show the Navigator Window with the NavigatorTabPanel for the given Book initially displayed. If the Help object was created with the combineBooks flag set to false, a separate NavigatorTabPanel was created for each book that was added to the Help object. This version of the showNavigatorWindow method allows you to programmatically select which Book's tab panel is displayed initially.

If the Help object was created with combineBooks set to true, then the one and only tab panel will be displayed regardless of the book passed as a parameter.

Parameters:
activeBook - -- the Book object whose associated NavigatorTabPanel should be initially displayed when the Navigator Window is shown. The Book should have already been added to the Help system, if it has not been or if the parameter is null the previously selected NavigatorTabPanel will be initially displayed.
See Also:
Help.showNavigatorWindow()

getAllNavigators

public Navigator[] getAllNavigators()
Get the Navigator objects displayed in the help system's Navigator Window
See Also:
Help.getAllNavigators()

addComponent

public void addComponent(java.awt.Component component,
                         java.lang.String topicId)
Registers a component with the help manager. The defaultBook is used for looking up the topicId. If no defaultBook is registered at the time of calling this method then the component is not registered with the help manager and help will not be shown when showHelpForComponent() is later called for this component.

For components registered using this method, HelpManager will not display help in response to F1 KeyPress event or right mouse click.

Parameters:
component - Component to be added.
topicId - Help topicId for this object.

addComponent

public void addComponent(java.awt.Component component,
                         Book book,
                         java.lang.String topicId)
Registers a component with the help manager.

For components registered using this method, HelpManager will not display help in response to F1 KeyPress event or right mouse click.

Parameters:
component - Component to be added.
book - Book containing the help topic.
topicId - help topicId for this object.

addComponent

public void addComponent(java.awt.Component component,
                         java.lang.String topicId,
                         boolean needF1Help,
                         boolean needPopupHelp)
Registers a component with the CSHManager using the default book. If no defaultBook is registered at the time of calling this method then the component is not registered.
Parameters:
component - Component to be added.
topicId - Help topicId for this object.
needF1Help - if true, displays help for this component in response to F1 KeyPress event
needPopupHelp - if true, displays help PopupMenu upon right mouse click and displays help for the component if "Help" menu item is selected

addComponent

public void addComponent(java.awt.Component component,
                         Book book,
                         java.lang.String topicId,
                         boolean needF1Help,
                         boolean needPopupHelp)
Registers a component with the CSHManager.
Parameters:
component - Component to be added
book - Book containing the help topic.
topicId - Help topicId for this object.
needF1Help - if true, displays help for this component in response to F1 KeyPress event
needPopupHelp - if true, displays a PopupMenu upon right mouse click and displays help for the component if "Help" menu item is selected

removeComponent

public void removeComponent(java.awt.Component component)
Unregisters a component with the CSHManager. Call this method for each component that you register with the CSHManager when you no longer need context sensitive help from that component. This removes any references to the component held by the CSHManager.
Parameters:
component - Component to be removed

showHelpForComponent

public void showHelpForComponent(java.awt.Component component)
Shows help for the specified component. If the specified object is not a registered object, then no help will be shown.

showTopic

public void showTopic(java.lang.String topicId)
Shows help topic corresponding to the specified topic id.

getHelpObject

protected Help getHelpObject()
Gets the Help object of this HelpManager. Subclasses can use this method to get to Help object.
Returns:
Help object

HELP ${project.version}

Copyright © 1998,2003, Oracle. All Rights Reserved.