This class implements the javax.help.HelpModel API and
notifies the JHelpModel listeners when changes occur.
addHighlight
public void addHighlight(int pos0,
int pos1)
Highlights a range of positions in a document.
- addHighlight in interface TextHelpModel
pos0
- start positionpos1
- end position
addPropertyChangeListener
public void addPropertyChangeListener(PropertyChangeListener l)
Adds a listener to changes to the properties in this model.
- addPropertyChangeListener in interface HelpModel
fireHighlightsChanged
protected void fireHighlightsChanged(Object source)
fireIDChanged
protected void fireIDChanged(Object source,
Map.ID id,
URL url)
fireIDChanged
protected void fireIDChanged(Object source,
Map.ID id,
URL url,
String historyName,
JHelpNavigator navigator)
getCurrentID
public Map.ID getCurrentID()
Gets the current ID.
- getCurrentID in interface HelpModel
- the current ID. A null ID is a valid id. If no ID has been set
a null ID is returned.
getCurrentURL
public URL getCurrentURL()
Returns the current URL
- getCurrentURL in interface HelpModel
- The current URL. A null URL is a valid URL. If no URL has been
previously set a null URL will be returned.
getDocumentTitle
public String getDocumentTitle()
Gets the document title.
- getDocumentTitle in interface TextHelpModel
- The title for the current document. A null title is valid. If
the title has not be previously set it will be null.
removeHelpModelListener
public void removeHelpModelListener(HelpModelListener l)
Removes a listener previously added with addHelpListener
- removeHelpModelListener in interface HelpModel
l
- - The listener to remove. If l is not in the list of listeners
it is ignored.
removePropertyChangeListener
public void removePropertyChangeListener(PropertyChangeListener l)
Removes a listener to changes to the properties in this model.
- removePropertyChangeListener in interface HelpModel
l
- the listener to remove. If l is not on the list of listeners
it is ignored.
setCurrentID
public void setCurrentID(Map.ID ident)
throws InvalidHelpSetContextException
Sets the current ID.
HelpModelListeners and HelpVisitListeners are notified.
If the parameter ident is null, the homeID of the current HelpSet is
used unless it is also null in which case the method returns without
setting the currentID.
- setCurrentID in interface HelpModel
ident
- The ID to set.
If ident is null set the currentID to the HelpSet's HomeID.
If the HomeID doesn't exist the currentID is set to null.
setCurrentID
public void setCurrentID(Map.ID ident,
String historyName,
JHelpNavigator navigator)
throws InvalidHelpSetContextException
Sets the current ID relative to some HelpSet
HelpModelListeners and HelpVisitListeners are notified
- setCurrentID in interface HelpModel
historyName
- the name for history storagenavigator
- the name of the navigator for history
setCurrentURL
public void setCurrentURL(URL url)
Sets the current URL.
The current ID changes if there is a matching ID for this URL
and HelpModelListners are notified.
- setCurrentURL in interface HelpModel
url
- The url to set the model to. A null URL is a valid url.
setCurrentURL
public void setCurrentURL(URL url,
String historyName,
JHelpNavigator navigator)
Sets the current URL and the name wich will appear in history list.
HelpModelListeners are notified.
The current ID changes if there is a matching id for this URL
- setCurrentURL in interface HelpModel
url
- The URL to set.historyName
- The name to set for historynavigator
- The name of the navigator for history
setDocumentTitle
public void setDocumentTitle(String title)
Assigns the document title.
- setDocumentTitle in interface TextHelpModel
title
- the Title for the document currently being shown. A null
title is valid.
setHelpSet
public void setHelpSet(HelpSet hs)
Sets the HelpSet for this HelpModel. A null hs is valid.
- setHelpSet in interface HelpModel
setHighlights
public void setHighlights(TextHelpModel.Highlight[] h)
Set highlights. Clear the current Hightlights and set new Highlights
- setHighlights in interface TextHelpModel
h
- An array of Hightlights. If h is null it is the same as setting
no highlights