Package javax.help
Class DefaultHelpHistoryModel
- java.lang.Object
-
- javax.help.DefaultHelpHistoryModel
-
- All Implemented Interfaces:
java.io.Serializable
,java.util.EventListener
,HelpModelListener
,HelpHistoryModel
public class DefaultHelpHistoryModel extends java.lang.Object implements HelpHistoryModel
DefaultHelpHistoryModel is default implementation of HelpHistoryModel interface- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected JHelp
help
protected HelpModel
helpModel
protected java.util.Vector
history
protected int
historyIndex
protected EventListenerList
listenerList
-
Constructor Summary
Constructors Constructor Description DefaultHelpHistoryModel(JHelp help)
Creates new DefaultHelpHistoryModel for given JHelp
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addHelpHistoryModelListener(HelpHistoryModelListener l)
Adds a listener for the HelpHistoryModelEvent posted after the model has changed.void
discard()
Discards a historyprotected void
fireHistoryChanged(java.lang.Object source, boolean previous, boolean next)
Fires the history changejava.util.Vector
getBackwardHistory()
Returns a backward history vectorjava.util.Vector
getForwardHistory()
Returns a forward history vectorjava.util.Vector
getHistory()
Returns a historyint
getIndex()
Returns a current history positionprotected HelpModel
getModel()
Returns HelpModelvoid
goBack()
Sets the previous histroy entryvoid
goForward()
Sets the next history entryvoid
idChanged(HelpModelEvent e)
Tells the listener that the current ID in the HelpModel has changed.void
removeHelpHistoryModelListener(HelpHistoryModelListener l)
Removes a listener previously added with addHelpHistoryModelListenervoid
removeHelpSet(HelpSet hs)
Removes entries related to removed HelpSet from historyvoid
removeLastEntry()
Removes the last history entryvoid
setHelpModel(HelpModel model)
Sets a new HelpModelvoid
setHistoryEntry(int index)
Sets the current history entry
-
-
-
Field Detail
-
history
protected java.util.Vector history
-
historyIndex
protected int historyIndex
-
helpModel
protected HelpModel helpModel
-
listenerList
protected EventListenerList listenerList
-
help
protected JHelp help
-
-
Constructor Detail
-
DefaultHelpHistoryModel
public DefaultHelpHistoryModel(JHelp help)
Creates new DefaultHelpHistoryModel for given JHelp- Parameters:
help
- The JHelp
-
-
Method Detail
-
setHelpModel
public void setHelpModel(HelpModel model)
Sets a new HelpModel- Specified by:
setHelpModel
in interfaceHelpHistoryModel
- Parameters:
model
- The new HelpModel
-
removeHelpHistoryModelListener
public void removeHelpHistoryModelListener(HelpHistoryModelListener l)
Removes a listener previously added with addHelpHistoryModelListener- Specified by:
removeHelpHistoryModelListener
in interfaceHelpHistoryModel
- Parameters:
l
- The listener to remove.- See Also:
HelpHistoryModel.addHelpHistoryModelListener(javax.help.event.HelpHistoryModelListener)
-
addHelpHistoryModelListener
public void addHelpHistoryModelListener(HelpHistoryModelListener l)
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:
HelpHistoryModel.removeHelpHistoryModelListener(javax.help.event.HelpHistoryModelListener)
-
discard
public void discard()
Discards a history- Specified by:
discard
in interfaceHelpHistoryModel
-
getHistory
public java.util.Vector 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
public java.util.Vector getForwardHistory()
Returns a forward history vector- Specified by:
getForwardHistory
in interfaceHelpHistoryModel
- Returns:
- The vector of forward history entries
-
getBackwardHistory
public java.util.Vector 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
protected void fireHistoryChanged(java.lang.Object source, boolean previous, boolean next)
Fires the history change
-
idChanged
public void idChanged(HelpModelEvent e)
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
public void removeHelpSet(HelpSet hs)
Removes entries related to removed HelpSet from history- Specified by:
removeHelpSet
in interfaceHelpHistoryModel
- Parameters:
hs
- The removed HelpSet
-
getModel
protected HelpModel getModel()
Returns HelpModel- Returns:
- The HelpModel
-
-