public class CSHManager
extends java.lang.Object
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 and Description |
---|
CSHManager(Help help)
Creates a new instance of CSHManager class.
|
Modifier and Type | Method and Description |
---|---|
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.
|
public CSHManager(Help help)
Help
object.help
- Help object to be used for displaying helppublic void setDefaultBook(Book book)
Book
as the default Book. This Book
will be as used the default Book for components registered without
specifying a Book.book
- Book to be setaddComponent(java.awt.Component, java.lang.String)
public void addBook(Book book, boolean isDefault)
book
- Book to be addeddefault
- If true, this book is used as the default Book for
the CSHManagerHelp.addBook(oracle.help.library.Book)
public void removeBook(Book book)
public void showNavigatorWindow()
Help.showNavigatorWindow()
public void showNavigatorWindow(Navigator activeNavigator)
activeNavigator
- the Navigator to initially displayHelp.showNavigatorWindow()
public void showNavigatorWindow(Book activeBook)
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.
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.Help.showNavigatorWindow()
public Navigator[] getAllNavigators()
Help.getAllNavigators()
public void addComponent(java.awt.Component component, java.lang.String topicId)
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.
component
- Component to be added.topicId
- Help topicId for this object.public void addComponent(java.awt.Component component, Book book, java.lang.String topicId)
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.
component
- Component to be added.book
- Book containing the help topic.topicId
- help topicId for this object.public void addComponent(java.awt.Component component, java.lang.String topicId, boolean needF1Help, boolean needPopupHelp)
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.component
- Component to be added.topicId
- Help topicId for this object.needF1Help
- if true
, displays help
for this component in response to F1
KeyPress eventneedPopupHelp
- if true
, displays help PopupMenu
upon right mouse click and displays help for the
component if "Help" menu item is selectedpublic void addComponent(java.awt.Component component, Book book, java.lang.String topicId, boolean needF1Help, boolean needPopupHelp)
component
with the CSHManager.component
- Component to be addedbook
- Book containing the help topic.topicId
- Help topicId for this object.needF1Help
- if true
, displays help
for this component in response to F1
KeyPress eventneedPopupHelp
- if true
, displays a PopupMenu
upon right mouse click and displays help for the
component if "Help" menu item is selectedpublic void removeComponent(java.awt.Component component)
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.component
- Component to be removedpublic void showHelpForComponent(java.awt.Component component)
public void showTopic(java.lang.String topicId)
protected Help getHelpObject()