javax.help

Class ServletHelpBroker

Implemented Interfaces:
HelpBroker

public class ServletHelpBroker
extends java.lang.Object
implements HelpBroker

An implmentation of the HelpBroker interface for Servlets

Field Summary

protected NavigatorView
curNav
protected Font
font
protected HelpSet
helpset
protected Locale
locale
protected DefaultHelpModel
model
protected boolean
viewDisplayed

Constructor Summary

ServletHelpBroker()
Zero-argument constructor.

Method Summary

void
enableHelp(Component comp, String id, HelpSet hs)
Enables help for a Component.
void
enableHelp(MenuItem comp, String id, HelpSet hs)
Enables help for a MenuItem.
void
enableHelpKey(Component comp, String id, HelpSet hs)
Enables the Help key on a Component.
void
enableHelpKey(Component comp, String id, HelpSet hs, String presentation, String presentationName)
void
enableHelpOnButton(Component comp, String id, HelpSet hs)
Enables help for a Component.
void
enableHelpOnButton(MenuItem comp, String id, HelpSet hs)
Enables help for a MenuItem.
void
enableHelpOnButton(Object obj, String id, HelpSet hs, String presentation, String presentationName)
Map.ID
getCurrentID()
Determines which ID is displayed (if any).
NavigatorView
getCurrentNavigatorView()
Returns the current navigator as a NavigatorView.
URL
getCurrentURL()
Determines which URL is displayed.
String
getCurrentView()
Determines the current navigator.
Font
getFont()
Gets the font for this HelpBroker.
HelpSet
getHelpSet()
Returns the default HelpSet
Locale
getLocale()
Gets the locale of this component.
Point
getLocation()
Requests the location of the presentation.
int
getScreen()
Requests the screen of the presentation.
Dimension
getSize()
Requests the size of the presentation.
void
initPresentation()
Initializes the presentation.
boolean
isDisplayed()
Determines if the presentation is displayed.
boolean
isViewDisplayed()
Determines if the current view is visible.
void
setCurrentID(String id)
Shows this ID as content relative to the (top) HelpSet for the HelpBroker instance--HelpVisitListeners are notified.
void
setCurrentID(Map.ID id)
Displays this ID--HelpVisitListeners are notified.
void
setCurrentURL(URL url)
Displays this URL.
void
setCurrentView(String name)
Set the currentView to the navigator with the same name as the name parameter.
void
setDisplayed(boolean b)
Displays the presentation to the user.
void
setFont(Font f)
Sets the font for this this HelpBroker.
void
setHelpSet(HelpSet hs)
Changes the HelpSet for this broker.
void
setHelpSetPresentation(HelpSet.Presentation pres)
void
setLocale(Locale l)
Sets the locale of this HelpBroker.
void
setLocation(Point p)
Requests the presentation be located at a given position.
void
setScreen(int screen)
Requests the presentation be set to a given screen.
void
setSize(Dimension d)
Requests the presentation be set to a given size.
void
setViewDisplayed(boolean displayed)
Hides/Shows view.
void
showID(String id, String presentation, String presentationName)
void
showID(Map.ID id, String presentation, String presentationName)

Field Details

curNav

protected NavigatorView curNav

font

protected Font font

helpset

protected HelpSet helpset

locale

protected Locale locale

model

protected DefaultHelpModel model

viewDisplayed

protected boolean viewDisplayed

Constructor Details

ServletHelpBroker

public ServletHelpBroker()
Zero-argument constructor. It should be followed by a setHelpSet() invocation.

Method Details

enableHelp

public void enableHelp(Component comp,
                       String id,
                       HelpSet hs)
Enables help for a Component. Not implemented in ServletHelpBroker
Specified by:
enableHelp in interface HelpBroker

enableHelp

public void enableHelp(MenuItem comp,
                       String id,
                       HelpSet hs)
Enables help for a MenuItem. Not implemented in ServletHelpBroker
Specified by:
enableHelp in interface HelpBroker

enableHelpKey

public void enableHelpKey(Component comp,
                          String id,
                          HelpSet hs)
Enables the Help key on a Component. Not implemented in ServletHelpBroker
Specified by:
enableHelpKey in interface HelpBroker

enableHelpKey

public void enableHelpKey(Component comp,
                          String id,
                          HelpSet hs,
                          String presentation,
                          String presentationName)
Specified by:
enableHelpKey in interface HelpBroker

enableHelpOnButton

public void enableHelpOnButton(Component comp,
                               String id,
                               HelpSet hs)
Enables help for a Component. Not implemented in ServletHelpBroker
Specified by:
enableHelpOnButton in interface HelpBroker

enableHelpOnButton

public void enableHelpOnButton(MenuItem comp,
                               String id,
                               HelpSet hs)
Enables help for a MenuItem. Not implemented in ServletHelpBroker.
Specified by:
enableHelpOnButton in interface HelpBroker

enableHelpOnButton

public void enableHelpOnButton(Object obj,
                               String id,
                               HelpSet hs,
                               String presentation,
                               String presentationName)
Specified by:
enableHelpOnButton in interface HelpBroker

getCurrentID

public Map.ID getCurrentID()
Determines which ID is displayed (if any).
Specified by:
getCurrentID in interface HelpBroker

getCurrentNavigatorView

public NavigatorView getCurrentNavigatorView()
Returns the current navigator as a NavigatorView.

getCurrentURL

public URL getCurrentURL()
Determines which URL is displayed.
Specified by:
getCurrentURL in interface HelpBroker

getCurrentView

public String getCurrentView()
Determines the current navigator.
Specified by:
getCurrentView in interface HelpBroker

getFont

public Font getFont()
Gets the font for this HelpBroker.
Specified by:
getFont in interface HelpBroker

getHelpSet

public HelpSet getHelpSet()
Returns the default HelpSet
Specified by:
getHelpSet in interface HelpBroker

getLocale

public Locale getLocale()
Gets the locale of this component.
Specified by:
getLocale in interface HelpBroker
Returns:
This component's locale. If this component does not have a locale, the defaultLocale is returned.

getLocation

public Point getLocation()
            throws UnsupportedOperationException
Requests the location of the presentation. This operation throws an UnsupportedOperationException in ServletHelpBroker
Specified by:
getLocation in interface HelpBroker

getScreen

public int getScreen()
            throws UnsupportedOperationException
Requests the screen of the presentation. throws UnsupportedOperationException in ServletHelpBroker.
Specified by:
getScreen in interface HelpBroker

getSize

public Dimension getSize()
            throws UnsupportedOperationException
Requests the size of the presentation. throws UnsupportedOperationException in ServletHelpBroker.
Specified by:
getSize in interface HelpBroker

initPresentation

public void initPresentation()
Initializes the presentation. Not implemented in ServletHelpBroker.
Specified by:
initPresentation in interface HelpBroker

isDisplayed

public boolean isDisplayed()
Determines if the presentation is displayed.
Specified by:
isDisplayed in interface HelpBroker

isViewDisplayed

public boolean isViewDisplayed()
Determines if the current view is visible.
Specified by:
isViewDisplayed in interface HelpBroker

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.
Specified by:
setCurrentID in interface HelpBroker
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

public void setCurrentID(Map.ID id)
            throws InvalidHelpSetContextException
Displays this ID--HelpVisitListeners are notified.
Specified by:
setCurrentID in interface HelpBroker
Parameters:
id - a Map.ID indicating the URL to display
Throws:
InvalidHelpSetContextException - if the current helpset does not contain id.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
Specified by:
setCurrentURL in interface HelpBroker
Parameters:
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.
Specified by:
setCurrentView in interface HelpBroker
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.

setDisplayed

public void setDisplayed(boolean b)
Displays the presentation to the user.
Specified by:
setDisplayed in interface HelpBroker

setFont

public void setFont(Font f)
Sets the font for this this HelpBroker.
Specified by:
setFont in interface HelpBroker
Parameters:
f - The font.

setHelpSet

public void setHelpSet(HelpSet hs)
Changes the HelpSet for this broker.
Specified by:
setHelpSet in interface HelpBroker
Parameters:
hs - The HelpSet to set for this broker. A null hs is valid parameter.

setHelpSetPresentation

public void setHelpSetPresentation(HelpSet.Presentation pres)
Specified by:
setHelpSetPresentation in interface HelpBroker

setLocale

public void setLocale(Locale l)
Sets the locale of this HelpBroker. The locale is propagated to the presentation.
Specified by:
setLocale in interface HelpBroker
Parameters:
l - The locale to become this component's locale. A null locale is the same as the defaultLocale.
See Also:
getLocale()

setLocation

public void setLocation(Point p)
            throws UnsupportedOperationException
Requests the presentation be located at a given position. This operation throws an UnsupportedOperationException in ServletHelpBroker
Specified by:
setLocation in interface HelpBroker

setScreen

public void setScreen(int screen)
            throws UnsupportedOperationException
Requests the presentation be set to a given screen. This operation throws an UnsupportedOperationException in ServletHelpBroker
Specified by:
setScreen in interface HelpBroker

setSize

public void setSize(Dimension d)
            throws UnsupportedOperationException
Requests the presentation be set to a given size. This operation throws an UnsupportedOperationException in ServletHelpBroker
Specified by:
setSize in interface HelpBroker

setViewDisplayed

public void setViewDisplayed(boolean displayed)
Hides/Shows view.
Specified by:
setViewDisplayed in interface HelpBroker

showID

public void showID(String id,
                   String presentation,
                   String presentationName)
            throws BadIDException
Specified by:
showID in interface HelpBroker

showID

public void showID(Map.ID id,
                   String presentation,
                   String presentationName)
            throws InvalidHelpSetContextException
Specified by:
showID in interface HelpBroker