|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.tivoli.twg.console.TWGHelpContext
This class is used for all Director help associations. A help context provides the base structure to allow task frames and other windows to associate a specific help panel with a specific frame window or dialog. A component would create one instance of this class for their use, passing in the instance of the main gui and the name of the mapping file to use to locate the correct HTML file for a specific topic ID. This context is then used to associate help to components using addHelp().
TWGTaskFrame will automatically create a help context if the task has specified the helpTopicsMapping attribute in the tasks property file. The helpTopicsMapping property specifies another property file that will contain the mappings of help topics to html help files. A TWGTaskFrame instance only has to request its context using getHelpContext() and it can then associate help with any of the components within the frame by using addHelp() on that context. Note that help cannot be specified directly on the frame itself, but must be set on a component with the frame. When F1 is pressed while that frame has focus, help is then invoked. Additionally, if help is associated with a button or menu, then pressing that button or selecting that menu will invoke help.
TWGDynamicHelp
,
TWGTaskFrame
Constructor Summary | |
---|---|
TWGHelpContext(com.tivoli.twg.console.TWGMainGUI gui,
java.lang.String bundleName)
A help instance is used to locate the appropriate html file to display based on the locale. |
Method Summary | |
---|---|
void |
addHelp(javax.swing.JComponent comp,
java.lang.String topicID)
Register a help listener to initiate a help event for this component. |
java.lang.String |
getBundle()
Convenience method for retrieving the help context's resource bundle. |
static java.lang.String |
getHelpNLSDirectory(boolean full)
Determine the language name to use as the directory for loading the HTML files from. |
static java.net.URL |
getValidNLSHelpURL(java.lang.String htmlFile)
Find the closest matching valid URL to load the help files file. |
void |
launchHelp(java.lang.String bundleName,
java.lang.String topicID)
Launch the help window (if not already showing) and use the specified bundle and topic ID as the page to show. |
void |
removeHelp(javax.swing.JComponent comp)
Unregister the help listener that would initiate a help event if the component specified (or the window it is in) has the focus. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public TWGHelpContext(com.tivoli.twg.console.TWGMainGUI gui, java.lang.String bundleName)
gui
- The instance of the main console controller. If null,
then we launch help using a default size each time. If non-null,
we can query the previous size and location used to display
the help window.bundleName
- The name of the resource bundle that contains
the mappings of the topic IDs to the html file names.
This file is in the same format as a regular
properties file.Method Detail |
public void addHelp(javax.swing.JComponent comp, java.lang.String topicID)
comp
- The component to register the help for.topicID
- Identifies the help panel to bring up
when help is requested. If NULL is set, then
dynamic help is setup for the component and the
component will be queried for the topic ID (and
optionally a different mapping file) when help is
requested.public void removeHelp(javax.swing.JComponent comp)
public void launchHelp(java.lang.String bundleName, java.lang.String topicID)
bundleName
- The name of the resource bundle that is
searched for the topic ID specified.topicID
- The name of the topic ID to search for in the
resource bundle specified. This topic will
be matched with an HTML file which is used as
the visible page for the help window.public java.lang.String getBundle()
public static java.lang.String getHelpNLSDirectory(boolean full)
full
- If true, then use both language and country
locale additions. Otherwise, just use language
modifiers in the search.
public static java.net.URL getValidNLSHelpURL(java.lang.String htmlFile)
htmlFile
- The base name of the help file to be loaded.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |