A convenience class that provides simple
access to context-senstive help functionality. It creates a default JavaHelp
viewer as well as ActionListeners for "Help" keys, on-item help, and
help buttons.
addManager
public static void addManager(int i,
CSH.Manager m)
Registers the specified manager to maintain dynamic CSH at the specified
position in list of managers.
i
- index at which specified manager is to be inserted.m
- the CSH manager
addManager
public static void addManager(CSH.Manager m)
Registers the specified manager to maintain dynamic CSH.
getHelpIDString
public static String getHelpIDString(Component comp)
Returns the static helpID for a component.
If the component doesn't have associated help, traverse the
component's ancestors for help.
This method calls
CSH.getHelpIDString(comp, null)
.
getHelpIDString
public static String getHelpIDString(MenuItem comp)
Returns the static helpID for a MenuItem.
If the component doesn't have associated help, traverse the
component's ancestors for help.
This method calls
CSH.getHelpIDString(comp, null)
.
getHelpIDString
public static String getHelpIDString(Object comp,
AWTEvent evt)
Returns the dynamic HelpID for a object. The method passes the arguments
into all registered CSH manageres to obtain dynamic HelpID. If no manager
provides HelpID for the object, the static HelpID is returned or traverse
to the component's ancestors for help.
getHelpSet
public static HelpSet getHelpSet(Component comp)
Returns the static HelpSet for a Component.
HelpSets are stored in conjunction with helpIDs. It is possible for a
Component to have
a helpID without a HelpSet, but a Component cannot have a HelpSet
without a helpID.
If the component doesn't have an associated helpID, traverse the
component's ancestors for a helpID. If the componet has a helpID but
doesn't have a HelpSet, return null.
This method calls
CSH.getHelpSet(comp, null)
.
getHelpSet
public static HelpSet getHelpSet(MenuItem comp)
Returns the static HelpSet for a MenuItem.
HelpSets are stored in conjunction with helpIDs. It is possible for a
MenuItem to have a helpID without a HelpSet, but a MenuItem
cannot have a HelpSet without a helpID.
If the component doesn't have an associated helpID, traverse the
component's ancestors for a helpID. If the componet has a helpID, but
doesn't have a HelpSet return null.
This method calls CSH.getHelpIDString(comp, null)
.
getHelpSet
public static HelpSet getHelpSet(Object comp,
AWTEvent evt)
Returns the dynamic HelpSet for an object.
HelpSets are stored in conjunction with helpIDs. It is possible for a
object to have a helpID without a HelpSet, but a object cannot have a HelpSet
without a helpID.
If the component doesn't have an associated helpID, traverse the
component's ancestors for a helpID. If the componet has a helpID but
doesn't have a HelpSet, return null.
getManager
public static CSH.Manager getManager(int i)
Returns the manager at the specified position in manager list.
i
- index of manager to return.
getManagerCount
public static int getManagerCount()
Returns the number of managers registered to maintain dynamic CSH.
getManagers
public static CSH.Manager[] getManagers()
Returns array of managers registered to maintain dynamic CSH.
- an array containing the managers.
removeAllManagers
public static void removeAllManagers()
Removes all managers from manager list.
removeManager
public static void removeManager(int i)
Removes the manager at the specified position in manager list.
i
- the index of the manager to removed.
removeManager
public static boolean removeManager(CSH.Manager m)
Removes the first occurrence of the specified manager in manager list.
m
- manager to be removed from the list, if present.
true
if the list contained the specified manager.
setHelpIDString
public static void setHelpIDString(Component comp,
String helpID)
Sets the helpID for a Component.
If helpID is null this method removes the helpID from the component.
setHelpIDString
public static void setHelpIDString(MenuItem comp,
String helpID)
Sets the helpID for a MenuItem.
If helpID is null, this method removes the helpID from the component.
setHelpSet
public static void setHelpSet(Component comp,
HelpSet hs)
Sets the static HelpSet for a Component.
If HelpSet is null, this method removes the HelpSet
from the component.
setHelpSet
public static void setHelpSet(MenuItem comp,
HelpSet hs)
Sets the static HelpSet for a MenuItem.
If HelpSet is null, this method removes the HelpSet
from the component.
trackCSEvents
public static Object trackCSEvents()
Context Sensitive Event Tracking
Creates a new EventDispatchThread from which to dispatch events. This
method returns when stopModal is invoked.
- Object The object on which the event occurred. Null if
cancelled on an undetermined object.