public final class JHelp extends Object
Constructor and Description |
---|
JHelp() |
Modifier and Type | Method and Description |
---|---|
static IdMap |
addIdMap(URL url)
Adds the ID map of a help document to the (ordered) list of ID maps.
|
static boolean |
configureHelpButton(AbstractButton button,
String topicId)
Configures specified button to display the help topic having
specified ID.
|
static DefaultViewer |
getDefaultViewer()
Specifies how to invoke the system Web browser.
|
static URI |
getHelpBaseURI()
The base URI used to resolve the relative URIs of some help documents.
|
static String |
getHelpTitle()
The title of the embedded help browser.
|
static IdMap[] |
getIdMaps()
Returns the (ordered) llist of ID maps of help documents registered
with this help system.
|
static boolean |
hasHelpTopics()
Returns
true if some help topics are available;
false otherwise. |
static void |
initialize(String helpTitle,
URI helpBaseURI,
DefaultViewer viewer)
Initializes the help system.
|
static void |
pickHelpTopic(Component component)
Show the help topic associated to the component clicked upon.
|
static void |
setHelpTopicId(Component component,
String topicId)
Associate specified help topic ID to specified component.
|
static boolean |
showHelpTopic(String topicId,
boolean useFallback,
Component parentComponent)
Show help topic having specified ID.
|
static boolean |
showHelpTopic(String topicId,
Component parentComponent)
Equivalent to
showHelpTopic(topicId, true, parentComponent) . |
static void |
unsetHelpTopicId(Component component)
Un-associate help topic ID, if any, from specified component.
|
public static void initialize(String helpTitle, URI helpBaseURI, DefaultViewer viewer)
helpTitle
- the title of the embedded help browser.
May be null
in which case the title of the
first help document is used (or fixed string "Help"
if no help documents have been registered with this help system).helpBaseURI
- the base URI used to resolve
the relative URIs of some help documents. May be null
if all help documents have absolute URIs.viewer
- specifies how to invoke the system Web browser. This
system Web browser is used when the embedded help browser
is not available (e.g. Java runtime older than version 1.8.0_40).public static String getHelpTitle()
null
.public static URI getHelpBaseURI()
null
.public static DefaultViewer getDefaultViewer()
DefaultViewerImpl
.public static IdMap addIdMap(URL url)
This method basically registers a new help document with this help system.
getIdMaps()
public static IdMap[] getIdMaps()
addIdMap(java.net.URL)
public static void setHelpTopicId(Component component, String topicId)
component
- component to be configured to display a help topictopicId
- ID of a help topic.
A null
or empty topicId may be used to specify
the first topic of the first help document.configureHelpButton(javax.swing.AbstractButton, java.lang.String)
public static void unsetHelpTopicId(Component component)
public static boolean hasHelpTopics()
true
if some help topics are available;
false
otherwise.
This method may be used to disable a Help button at dialog box creation time.
public static boolean configureHelpButton(AbstractButton button, String topicId)
button
- button to be configured to display a help topictopicId
- ID of a help topic.
A null
or empty topicId may be used to specify
the first topic of the first help document.true
if specified button has been enabled as
a help button; false
otherwise.setHelpTopicId(java.awt.Component, java.lang.String)
public static boolean showHelpTopic(String topicId, Component parentComponent)
showHelpTopic(topicId, true, parentComponent)
.public static boolean showHelpTopic(String topicId, boolean useFallback, Component parentComponent)
topicId
- ID of a help topic.
A null
or empty topicId may be used to specify
the first topic of the first help document.useFallback
- if true
, use the first topic of
the first help document as a fallbackparentComponent
- parent of a possible user feedback dialog boxtrue
if topic having specified ID
(or the fallback topic when useFallback is true
)
has been displayed; false
otherwisepickHelpTopic(java.awt.Component)
public static void pickHelpTopic(Component component)
component
- used to specify the root ancestor of
the component to be clicked uponshowHelpTopic(String, Component)