org.openide.util
Class HelpCtx
java.lang.Object
|
+--org.openide.util.HelpCtx
- public final class HelpCtx
- extends Object
Provides help for any window or other feature in the system.
It is designed to be JavaHelp-compatible and to use the same tactics when
assigning help to JComponent
instances.
Constructor Summary |
HelpCtx(Class clazz)
Create a help context by class. |
HelpCtx(String helpID)
Create a help context by tag. |
HelpCtx(URL helpCtx)
Create a help context by URL. |
DEFAULT_HELP
public static final HelpCtx DEFAULT_HELP
- Default help page.
This (hopefully) points to a note explaining to the user that no help is available.
Precisely, the Help ID is set to
org.openide.util.HelpCtx.DEFAULT_HELP
.
HelpCtx
public HelpCtx(URL helpCtx)
- Create a help context by URL.
- Parameters:
helpCtx
- URL to point help to
HelpCtx
public HelpCtx(String helpID)
- Create a help context by tag.
You must provide an ID of the
desired help for the item. The ID should refer to an
already installed help; this can be easily installed by specifying
a JavaHelp HelpSet file in the module manifest tag
OpenIDE-Module-Description
.
- Parameters:
helpID
- the JavaHelp ID of the help
HelpCtx
public HelpCtx(Class clazz)
- Create a help context by class.
Assigns the name of a class as
the ID.
- Parameters:
clazz
- the class to take the name from
getHelp
public URL getHelp()
- Get a URL to the help page, if applicable.
- Returns:
- a URL to the page, or
null
if the target was specified by ID
getHelpID
public String getHelpID()
- Get the ID of the help page, if applicable.
- Returns:
- the JavaHelp ID string, or
null
if specified by URL
hashCode
public int hashCode()
- Overrides:
hashCode
in class Object
equals
public boolean equals(Object o)
- Overrides:
equals
in class Object
toString
public String toString()
- Overrides:
toString
in class Object
setHelpIDString
public static void setHelpIDString(JComponent comp,
String helpID)
- Set the help ID for a component.
- Parameters:
comp
- the visual component to associate help tohelpID
- help ID, or null
if the help ID should be removed
findHelp
public static HelpCtx findHelp(Component comp)
- Find the help ID for a component.
If the component is a top component, then
TopComponent.getHelpCtx()
is called.
If the component has help attached by setHelpIDString(javax.swing.JComponent, java.lang.String)
, it returns that.
Otherwise it checks the parent component recursively.
- Parameters:
comp
- the component to find help for- Returns:
- the help for that component (never
null
)
Built on February 22 2001. | Portions Copyright 1997-2000 Sun Microsystems, Inc. All rights reserved.