Package javax.help
Class DefaultHelpHistoryModel
java.lang.Object
javax.help.DefaultHelpHistoryModel
- All Implemented Interfaces:
Serializable
,EventListener
,HelpModelListener
,HelpHistoryModel
DefaultHelpHistoryModel is default implementation of HelpHistoryModel interface
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected JHelp
protected HelpModel
protected Vector
protected int
protected EventListenerList
-
Constructor Summary
ConstructorsConstructorDescriptionDefaultHelpHistoryModel
(JHelp help) Creates new DefaultHelpHistoryModel for given JHelp -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds a listener for the HelpHistoryModelEvent posted after the model has changed.void
discard()
Discards a historyprotected void
fireHistoryChanged
(Object source, boolean previous, boolean next) Fires the history changeReturns a backward history vectorReturns a forward history vectorReturns a historyint
getIndex()
Returns a current history positionprotected HelpModel
getModel()
Returns HelpModelvoid
goBack()
Sets the previous histroy entryvoid
Sets the next history entryvoid
Tells the listener that the current ID in the HelpModel has changed.void
Removes a listener previously added with addHelpHistoryModelListenervoid
removeHelpSet
(HelpSet hs) Removes entries related to removed HelpSet from historyvoid
Removes the last history entryvoid
setHelpModel
(HelpModel model) Sets a new HelpModelvoid
setHistoryEntry
(int index) Sets the current history entry
-
Field Details
-
history
-
historyIndex
protected int historyIndex -
helpModel
-
listenerList
-
help
-
-
Constructor Details
-
DefaultHelpHistoryModel
Creates new DefaultHelpHistoryModel for given JHelp- Parameters:
help
- The JHelp
-
-
Method Details
-
setHelpModel
Sets a new HelpModel- Specified by:
setHelpModel
in interfaceHelpHistoryModel
- Parameters:
model
- The new HelpModel
-
removeHelpHistoryModelListener
Removes a listener previously added with addHelpHistoryModelListener- Specified by:
removeHelpHistoryModelListener
in interfaceHelpHistoryModel
- Parameters:
l
- The listener to remove.- See Also:
-
addHelpHistoryModelListener
Adds a listener for the HelpHistoryModelEvent posted after the model has changed.- Specified by:
addHelpHistoryModelListener
in interfaceHelpHistoryModel
- Parameters:
l
- The listener to add.- See Also:
-
discard
public void discard()Discards a history- Specified by:
discard
in interfaceHelpHistoryModel
-
getHistory
Returns a history- Specified by:
getHistory
in interfaceHelpHistoryModel
- Returns:
- The vector of history entries
-
removeLastEntry
public void removeLastEntry()Removes the last history entry -
getIndex
public int getIndex()Returns a current history position- Specified by:
getIndex
in interfaceHelpHistoryModel
- Returns:
- The history index
-
goForward
public void goForward()Sets the next history entry- Specified by:
goForward
in interfaceHelpHistoryModel
-
goBack
public void goBack()Sets the previous histroy entry- Specified by:
goBack
in interfaceHelpHistoryModel
-
getForwardHistory
Returns a forward history vector- Specified by:
getForwardHistory
in interfaceHelpHistoryModel
- Returns:
- The vector of forward history entries
-
getBackwardHistory
Returns a backward history vector- Specified by:
getBackwardHistory
in interfaceHelpHistoryModel
- Returns:
- The vector of backward history entries
-
setHistoryEntry
public void setHistoryEntry(int index) Sets the current history entry- Specified by:
setHistoryEntry
in interfaceHelpHistoryModel
- Parameters:
index
- The index of history entry
-
fireHistoryChanged
Fires the history change -
idChanged
Tells the listener that the current ID in the HelpModel has changed. All highlights from the previous location change at this point.- Specified by:
idChanged
in interfaceHelpModelListener
- Parameters:
e
- The event
-
removeHelpSet
Removes entries related to removed HelpSet from history- Specified by:
removeHelpSet
in interfaceHelpHistoryModel
- Parameters:
hs
- The removed HelpSet
-
getModel
Returns HelpModel- Returns:
- The HelpModel
-