Package javax.help
Class ServletHelpBroker
java.lang.Object
javax.help.ServletHelpBroker
- All Implemented Interfaces:
HelpBroker
An implmentation of the HelpBroker interface for Servlets
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected NavigatorViewprotected Fontprotected HelpSetprotected Localeprotected DefaultHelpModelprotected boolean -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidenableHelp(Component comp, String id, HelpSet hs) Enables help for a Component.voidenableHelp(MenuItem comp, String id, HelpSet hs) Enables help for a MenuItem.voidenableHelpKey(Component comp, String id, HelpSet hs) Enables the Help key on a Component.voidEnables the Help key on a component.voidenableHelpOnButton(Component comp, String id, HelpSet hs) Enables help for a Component.voidenableHelpOnButton(MenuItem comp, String id, HelpSet hs) Enables help for a MenuItem.voidEnables help for an object.Determines which ID is displayed (if any).Returns the current navigator as a NavigatorView.Determines which URL is displayed.Determines the current navigator.getFont()Gets the font for this HelpBroker.Returns the default HelpSetGets the locale of this component.Requests the location of the presentation.intRequests the screen of the presentation.getSize()Requests the size of the presentation.voidInitializes the presentation.booleanDetermines if the presentation is displayed.booleanDetermines if the current view is visible.voidsetCurrentID(String id) Shows this ID as content relative to the (top) HelpSet for the HelpBroker instance--HelpVisitListeners are notified.voidsetCurrentID(Map.ID id) Displays this ID--HelpVisitListeners are notified.voidsetCurrentURL(URL url) Displays this URL.voidsetCurrentView(String name) Set the currentView to the navigator with the same name as the name parameter.voidsetDisplayed(boolean b) Displays the presentation to the user.voidSets the font for this this HelpBroker.voidsetHelpSet(HelpSet hs) Changes the HelpSet for this broker.voidSets the presentation attributes from a HelpSet.Presentation.voidSets the locale of this HelpBroker.voidsetLocation(Point p) Requests the presentation be located at a given position.voidsetScreen(int screen) Requests the presentation be set to a given screen.voidRequests the presentation be set to a given size.voidsetViewDisplayed(boolean displayed) Hides/Shows view.voidDisplays this ID in a particular presentationvoidDisplays this ID in a given presentation
-
Field Details
-
helpset
-
model
-
viewDisplayed
protected boolean viewDisplayed -
locale
-
font
-
-
Constructor Details
-
ServletHelpBroker
public ServletHelpBroker()Zero-argument constructor. It should be followed by a setHelpSet() invocation.
-
-
Method Details
-
getHelpSet
Returns the default HelpSet- Specified by:
getHelpSetin interfaceHelpBroker- Returns:
- The HelpSet this JavaHelp is presenting.
-
setHelpSet
Changes the HelpSet for this broker.- Specified by:
setHelpSetin interfaceHelpBroker- Parameters:
hs- The HelpSet to set for this broker. A null hs is valid parameter.
-
getLocale
Gets the locale of this component.- Specified by:
getLocalein interfaceHelpBroker- Returns:
- This component's locale. If this component does not have a locale, the defaultLocale is returned.
- See Also:
-
setLocale
Sets the locale of this HelpBroker. The locale is propagated to the presentation.- Specified by:
setLocalein interfaceHelpBroker- Parameters:
l- The locale to become this component's locale. A null locale is the same as the defaultLocale.- See Also:
-
getFont
Gets the font for this HelpBroker.- Specified by:
getFontin interfaceHelpBroker
-
setFont
Sets the font for this this HelpBroker.- Specified by:
setFontin interfaceHelpBroker- Parameters:
f- The font.
-
setCurrentView
Set the currentView to the navigator with the same name as the name parameter.- Specified by:
setCurrentViewin interfaceHelpBroker- Parameters:
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.- Throws:
IllegalArgumentException- if nav is null or not a valid Navigator.
-
getCurrentView
Determines the current navigator.- Specified by:
getCurrentViewin interfaceHelpBroker- Returns:
- The name of the current navigational view.
-
initPresentation
public void initPresentation()Initializes the presentation. Not implemented in ServletHelpBroker.- Specified by:
initPresentationin interfaceHelpBroker
-
setDisplayed
public void setDisplayed(boolean b) Displays the presentation to the user.- Specified by:
setDisplayedin interfaceHelpBroker- Parameters:
b- Makes the presentation visible or not.
-
isDisplayed
public boolean isDisplayed()Determines if the presentation is displayed.- Specified by:
isDisplayedin interfaceHelpBroker- Returns:
- Whether the presentation is currently visible.
-
setLocation
Requests the presentation be located at a given position. This operation throws an UnsupportedOperationException in ServletHelpBroker- Specified by:
setLocationin interfaceHelpBroker- Throws:
UnsupportedOperationException
-
getLocation
Requests the location of the presentation. This operation throws an UnsupportedOperationException in ServletHelpBroker- Specified by:
getLocationin interfaceHelpBroker- Throws:
UnsupportedOperationException
-
setSize
Requests the presentation be set to a given size. This operation throws an UnsupportedOperationException in ServletHelpBroker- Specified by:
setSizein interfaceHelpBroker- Throws:
UnsupportedOperationException
-
getSize
Requests the size of the presentation. throws UnsupportedOperationException in ServletHelpBroker.- Specified by:
getSizein interfaceHelpBroker- Throws:
UnsupportedOperationException
-
setScreen
Requests the presentation be set to a given screen. This operation throws an UnsupportedOperationException in ServletHelpBroker- Specified by:
setScreenin interfaceHelpBroker- Throws:
UnsupportedOperationException
-
getScreen
Requests the screen of the presentation. throws UnsupportedOperationException in ServletHelpBroker.- Specified by:
getScreenin interfaceHelpBroker- Throws:
UnsupportedOperationException
-
setViewDisplayed
public void setViewDisplayed(boolean displayed) Hides/Shows view.- Specified by:
setViewDisplayedin interfaceHelpBroker- Parameters:
displayed- Make the navigational views visible or not.
-
isViewDisplayed
public boolean isViewDisplayed()Determines if the current view is visible.- Specified by:
isViewDisplayedin interfaceHelpBroker- Returns:
- Whether the navigational views are visible.
-
setCurrentID
Shows this ID as content relative to the (top) HelpSet for the HelpBroker instance--HelpVisitListeners are notified.- Specified by:
setCurrentIDin interfaceHelpBroker- Parameters:
id- A string that identifies the topic to show for the loaded (top) HelpSet- Throws:
BadIDException- The ID is not valid for the HelpSet
-
setCurrentID
Displays this ID--HelpVisitListeners are notified.- Specified by:
setCurrentIDin interfaceHelpBroker- Parameters:
id- a Map.ID indicating the URL to display- Throws:
InvalidHelpSetContextException- if the current helpset does not contain id.helpset- See Also:
-
getCurrentID
Determines which ID is displayed (if any).- Specified by:
getCurrentIDin interfaceHelpBroker- Returns:
- The ID being shown.
-
setCurrentURL
Displays this URL. HelpVisitListeners are notified. The currentID changes if there is a mathing ID for this URL- Specified by:
setCurrentURLin interfaceHelpBroker- Parameters:
url- The url to display. A null URL is a valid url.
-
getCurrentURL
Determines which URL is displayed.- Specified by:
getCurrentURLin interfaceHelpBroker- Returns:
- The URL being shown.
-
enableHelpKey
Enables the Help key on a Component. Not implemented in ServletHelpBroker- Specified by:
enableHelpKeyin interfaceHelpBroker- Parameters:
comp- The component to enable the keyboard actions on.id- The default HelpID to be displayed.hs- The default HelpSet to be displayed.
-
enableHelp
Enables help for a Component. Not implemented in ServletHelpBroker- Specified by:
enableHelpin interfaceHelpBroker- See Also:
-
CSH.setHelpIDCSH.setHelpSet
-
enableHelp
Enables help for a MenuItem. Not implemented in ServletHelpBroker- Specified by:
enableHelpin interfaceHelpBroker- See Also:
-
CSH.setHelpIDCSH.setHelpSet
-
enableHelpOnButton
Enables help for a Component. Not implemented in ServletHelpBroker- Specified by:
enableHelpOnButtonin interfaceHelpBroker- See Also:
-
CSH.setHelpIDCSH.setHelpSetAbstractButtonButton
-
enableHelpOnButton
Enables help for a MenuItem. Not implemented in ServletHelpBroker.- Specified by:
enableHelpOnButtonin interfaceHelpBroker- See Also:
-
CSH.setHelpIDCSH.setHelpSetMenuItem
-
setHelpSetPresentation
Description copied from interface:HelpBrokerSets the presentation attributes from a HelpSet.Presentation. The HelpSet.Presentation must be in the current HelpSet.- Specified by:
setHelpSetPresentationin interfaceHelpBroker- Parameters:
pres- The HelpSet.Presentation
-
showID
Description copied from interface:HelpBrokerDisplays this ID in a particular presentation- Specified by:
showIDin interfaceHelpBroker- Parameters:
id- A String identifying the topic to show relative to getHelpSet()presentation- 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.- Throws:
BadIDException- if the ID is not valid in the map.- See Also:
-
showID
public void showID(Map.ID id, String presentation, String presentationName) throws InvalidHelpSetContextException Description copied from interface:HelpBrokerDisplays this ID in a given presentation- Specified by:
showIDin interfaceHelpBroker- Parameters:
id- An ID that identifies the topic to display.presentation- 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.- Throws:
InvalidHelpSetContextException- If id.hs is not contanied in the current HelpSet of this broker.- See Also:
-
enableHelpKey
public void enableHelpKey(Component comp, String id, HelpSet hs, String presentation, String presentationName) Description copied from interface:HelpBrokerEnables 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.- Specified by:
enableHelpKeyin interfaceHelpBroker- Parameters:
comp- The component to enable the keyboard actions on.id- The default HelpID to be displayed.hs- The default HelpSet to be displayed.presentation- 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.- See Also:
-
enableHelpOnButton
public void enableHelpOnButton(Object obj, String id, HelpSet hs, String presentation, String presentationName) Description copied from interface:HelpBrokerEnables help for an object. This method sets a object'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 or the presenation if defined. If the component is not a javax.swing.AbstractButton or a java.awt.Button an IllegalArgumentException is thrown.- Specified by:
enableHelpOnButtonin interfaceHelpBrokerid- The default HelpID to be displayed.hs- The default HelpSet to be displayed.presentation- 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.- See Also:
-
PresentationCSH.setHelpIDCSH.setHelpSetAbstractButtonButton
-