enableHelp
public void enableHelp(Component comp,
String id,
HelpSet hs)
Enables help for a Component. This method sets a
component's helpID and HelpSet.
- enableHelp in interface HelpBroker
comp
- the Component to set the id and hs on.id
- the String value of an Map.ID.hs
- the HelpSet the id is in. If hs is null the default HelpSet
will be assumed.
CSH.setHelpID
, CSH.setHelpSet
enableHelp
public void enableHelp(MenuItem comp,
String id,
HelpSet hs)
Enables help for a MenuItem. This method sets a
component's helpID and HelpSet.
- enableHelp in interface HelpBroker
comp
- the MenuItem to set the id and hs on.id
- the String value of an Map.ID.hs
- the HelpSet the id is in. If hs is null the default HelpSet
will be assumed.
CSH.setHelpID
, CSH.setHelpSet
enableHelpKey
public void enableHelpKey(Component comp,
String id,
HelpSet hs)
Enables the Help key on a Component. This method works best when
the component is the
rootPane of a JFrame in Swing implementations, or a java.awt.Window
(or subclass thereof) in AWT implementations.
This method sets the default
helpID and HelpSet for the Component and registers keyboard actions
to trap the "Help" keypress. When the "Help" key is pressed, if the
object with the current focus has a helpID, the helpID is displayed.
otherwise the default helpID is displayed.
- enableHelpKey in interface HelpBroker
comp
- the Component to enable the keyboard actions on.id
- the default HelpID to be displayedhs
- the default HelpSet to be displayed. If hs is null the default HelpSet
will be assumed.
getHelpKeyActionListener
, enableHelpKey(Component, String, HelpSet, String, String);
enableHelpKey
public void enableHelpKey(Component comp,
String id,
HelpSet hs,
String presentation,
String presentationName)
Enables the Help key on a Component. This method works best when
the component is the
rootPane of a JFrame in Swing implementations, or a java.awt.Window
(or subclass thereof) in AWT implementations.
This method sets the default
helpID and HelpSet for the Component and registers keyboard actions
to trap the "Help" keypress. When the "Help" key is pressed, if the
object with the current focus has a helpID, the helpID is displayed.
otherwise the default helpID is displayed.
- enableHelpKey in interface HelpBroker
comp
- the Component to enable the keyboard actions on.id
- the default HelpID to be displayedhs
- the default HelpSet to be displayed. If hs is null the
default HelpSet from the HelpBroker is assummed. null is not
valid if presenation is not null.presentation
- The Presentation class to display the content in.
If presentation is null the HelpBroker is used to display the
content.presentationName
- The name of a Presentation section to control
the display of the content. Also for some Presenations this
will be used to "name" the Presentation.
getHelpKeyActionListener
, enableHelpKey(Component, String, HelpSet);
enableHelpOnButton
public void enableHelpOnButton(Component comp,
String id,
HelpSet hs)
Enables help for a Component. This method sets a
Component's helpID and HelpSet and adds an ActionListener.
When an action is performed
it displays the Component's helpID and HelpSet in the default viewer.
- enableHelpOnButton in interface HelpBroker
comp
- the Component to set the id and hs on. If the Component is not
a javax.swing.AbstractButton or a
java.awt.Button an IllegalArgumentException is thrown.id
- the String value of an Map.ID.hs
- the HelpSet the id is in. If hs is null the default HelpSet
will be assumed.
CSH.setHelpID
, CSH.setHelpSet
, javax.swing.AbstractButton
, java.awt.Button
enableHelpOnButton
public void enableHelpOnButton(MenuItem comp,
String id,
HelpSet hs)
Enables help for a MenuItem. This method sets a
Component's helpID and HelpSet and adds an ActionListener.
When an action is performed
it displays the Component's helpID and HelpSet in the default viewer.
- enableHelpOnButton in interface HelpBroker
comp
- the MenuItem to set the id and hs on. If comp is null
an IllegalAgrumentException is thrown.id
- the String value of an Map.ID.hs
- the HelpSet the id is in. If hs is null the default HelpSet
will be assumed.
CSH.setHelpID
, CSH.setHelpSet
, java.awt.MenuItem
enableHelpOnButton
public void enableHelpOnButton(Object obj,
String id,
HelpSet hs,
String presentation,
String presentationName)
Enables help for a Component. This method sets a
Component's helpID and HelpSet and adds an ActionListener.
When an action is performed
it displays the Component's helpID and HelpSet in the default viewer.
- enableHelpOnButton in interface HelpBroker
id
- the String value of an Map.ID.hs
- the HelpSet the id is in. If hs is null the default HelpSet
will be assumed.
CSH.setHelpID
, CSH.setHelpSet
, javax.swing.AbstractButton
, java.awt.Button
getDisplayHelpFromFocus
protected ActionListener getDisplayHelpFromFocus()
Returns the default DisplayHelpFromFocus listener.
getDisplayHelpFromSource
protected ActionListener getDisplayHelpFromSource()
Returns the default DisplayHelpFromSource listener.
getFont
public Font getFont()
Gets the font for this HelpBroker.
- getFont in interface HelpBroker
getLocale
public Locale getLocale()
Gets the locale of this component.
- getLocale in interface HelpBroker
- This component's locale. If this component does not
have a locale, the defaultLocale is returned.
getLocation
public Point getLocation()
Requests the location of the presentation.
- getLocation in interface HelpBroker
getWindowPresentation
public WindowPresentation getWindowPresentation()
Get the WindowPresentation for this HelpBroker
initPresentation
public void initPresentation()
Initializes the presentation.
This method allows the presentation to be initialized but not displayed.
Typically this would be done in a separate thread to reduce the
intialization time.
- initPresentation in interface HelpBroker
isDisplayed
public boolean isDisplayed()
Determines if the presentation is displayed.
- isDisplayed in interface HelpBroker
isViewDisplayed
public boolean isViewDisplayed()
Determines if the current view is visible.
- isViewDisplayed in interface HelpBroker
keyPressed
public void keyPressed(KeyEvent e)
Invoked when a key is pressed. Not intended to be overridden or extended.
keyReleased
public void keyReleased(KeyEvent e)
Invoked when a key is released. Not intended to be overridden or extended.
keyTyped
public void keyTyped(KeyEvent e)
Invoked when a key is typed. This event occurs when a
key press is followed by a key release. Not intended to be overridden or extended.
setActivationObject
public void setActivationObject(Object comp)
Set the activation window from given Component or MenuItem. It find Window component
in the component tree from given Component or MenuItem end call
setActivationWindow
.
setActivationWindow
public void setActivationWindow(Window window)
Set the activation window. If the window is an instance of a
Dialog and the is modal, modallyActivated help is set to true and
ownerDialog is set to the window. In all other instances
modallyActivated is set to false and ownerDialog is set to null.
window
- the activating window
setCurrentID
public void setCurrentID(String id)
throws BadIDException
Shows this ID as content relative to the (top) HelpSet for the HelpBroker
instance--HelpVisitListeners are notified.
- setCurrentID in interface HelpBroker
id
- A string that identifies the topic to show for the loaded (top) HelpSet
setCurrentURL
public void setCurrentURL(URL url)
Displays this URL.
HelpVisitListeners are notified.
The currentID changes if there is a mathing ID for this URL
- setCurrentURL in interface HelpBroker
url
- The url to display. A null URL is a valid url.
setCurrentView
public void setCurrentView(String name)
Set the currentView to the navigator with the same
name as the name parameter.
- setCurrentView in interface HelpBroker
name
- The name of the navigator to set as the
current view. If nav is null or not a valid Navigator
in this HelpBroker then an
IllegalArgumentException is thrown.
setDisplayed
public void setDisplayed(boolean b)
Displays the presentation to the user.
- setDisplayed in interface HelpBroker
setFont
public void setFont(Font f)
Sets the font for this this HelpBroker.
- setFont in interface HelpBroker
setHelpSet
public void setHelpSet(HelpSet hs)
Changes the HelpSet for this broker.
- setHelpSet in interface HelpBroker
hs
- The HelpSet to set for this broker.
A null hs is valid parameter.
setHelpSetPresentation
public void setHelpSetPresentation(HelpSet.Presentation hsPres)
Set the presentation attributes from a HelpSet.Presentation.
The HelpSet.Presentation must be in the current HelpSet.
- setHelpSetPresentation in interface HelpBroker
hsPres
- The HelpSet.Presentation
setLocale
public void setLocale(Locale l)
Sets the locale of this HelpBroker. The locale is propagated to
the presentation.
- setLocale in interface HelpBroker
l
- The locale to become this component's locale. A null locale
is the same as the defaultLocale.
setLocation
public void setLocation(Point p)
Requests the presentation be located at a given position.
- setLocation in interface HelpBroker
setScreen
public void setScreen(int screen)
Requests the presentation be set to a given screen.
- setScreen in interface HelpBroker
setSize
public void setSize(Dimension d)
Requests the presentation be set to a given size.
- setSize in interface HelpBroker
showID
public void showID(String id,
String presentation,
String presentationName)
throws BadIDException
Shows this ID.
- showID in interface HelpBroker
id
- A string that identifies the topic to show for the loaded (top) HelpSetpresentation
- The Presentation class to display the Help in.presentationName
- The name of a Presentation section from a
HelpSet to use. For some Presentations this will also be
the name to apply to the Presentation.
showID
public void showID(Map.ID id,
String presentation,
String presentationName)
throws InvalidHelpSetContextException
Show this ID.
- showID in interface HelpBroker
id
- a Map.ID indicating the URL to displaypresentation
- The Presentation class to display the Help in.presentationName
- The name of a Presentation section from a
HelpSet to use. For some Presentations this will also be
the name to apply to the Presentation.