public final class HelpCtx extends Object
JComponent
instances.Modifier and Type | Class and Description |
---|---|
static interface |
HelpCtx.Displayer
Service to display a
HelpCtx in a help viewer. |
static interface |
HelpCtx.Provider
An object implementing this interface is willing to answer
the HelpCtx.findHelp() query itself.
|
Modifier and Type | Field and Description |
---|---|
static HelpCtx |
DEFAULT_HELP
Default help page.
|
Constructor and Description |
---|
HelpCtx(Class<?> clazz)
Deprecated.
Too easily breaks IDs after code refactoring. Rather use
HelpCtx.HelpCtx(String) with a constant value known to be in the JavaHelp map. |
HelpCtx(String helpID)
Create a help context by tag.
|
HelpCtx(URL helpCtx)
Deprecated.
Does not work nicely with JavaHelp.
|
Modifier and Type | Method and Description |
---|---|
boolean |
display()
Displays the help page in a supported viewer, if any.
|
boolean |
equals(Object obj) |
static HelpCtx |
findHelp(Component comp)
Find the help ID for a component.
|
static HelpCtx |
findHelp(Object instance)
Finds help context for a generic object.
|
URL |
getHelp()
Get a URL to the help page, if applicable.
|
String |
getHelpID()
Get the ID of the help page, if applicable.
|
int |
hashCode() |
static void |
setHelpIDString(JComponent comp,
String helpID)
Set the help ID for a component.
|
String |
toString() |
public static final HelpCtx DEFAULT_HELP
org.openide.util.HelpCtx.DEFAULT_HELP
.@Deprecated public HelpCtx(URL helpCtx)
helpCtx
- URL to point help topublic HelpCtx(String helpID)
helpID
- the JavaHelp ID of the help@Deprecated public HelpCtx(Class<?> clazz)
HelpCtx.HelpCtx(String)
with a constant value known to be in the JavaHelp map.clazz
- the class to take the name frompublic URL getHelp()
null
if the target was specified by IDpublic String getHelpID()
null
if specified by URLpublic boolean display()
HelpCtx.Displayer.display(org.openide.util.HelpCtx)
public static void setHelpIDString(JComponent comp, String helpID)
comp
- the visual component to associate help tohelpID
- help ID, or null
if the help ID should be removedpublic static HelpCtx findHelp(Component comp)
HelpCtx.Provider
,
its method HelpCtx.Provider.getHelpCtx()
is called.
If the component has help attached by HelpCtx.setHelpIDString(javax.swing.JComponent, java.lang.String)
, it returns that.
Otherwise it checks the parent component recursively.comp
- the component to find help fornull
)public static HelpCtx findHelp(Object instance)
BeanDescriptor
's are checked for a string-valued attribute
helpID
, as per the JavaHelp specification (but no help sets
will be loaded).instance
- to search help forHelpCtx.DEFAULT_HELP
if HelpCtx cannot be found