javax.help

Class DefaultHelpHistoryModel

Implemented Interfaces:
java.util.EventListener, HelpHistoryModel, HelpModelListener, Serializable

public class DefaultHelpHistoryModel
extends java.lang.Object
implements HelpHistoryModel

DefaultHelpHistoryModel is default implementation of HelpHistoryModel interface

Field Summary

protected JHelp
help
protected HelpModel
helpModel
protected Vector
history
protected int
historyIndex
protected EventListenerList
listenerList

Constructor Summary

DefaultHelpHistoryModel(JHelp help)
Creates new DefaultHelpHistoryModel for given JHelp

Method Summary

void
addHelpHistoryModelListener(HelpHistoryModelListener l)
Adds a listener for the HelpHistoryModelEvent posted after the model has changed.
void
discard()
Discards a history
protected void
fireHistoryChanged(Object source, boolean previous, boolean next)
Fires the history change
Vector
getBackwardHistory()
Returns a backward history vector
Vector
getForwardHistory()
Returns a forward history vector
Vector
getHistory()
Returns a history
int
getIndex()
Returns a current history position
protected HelpModel
getModel()
Returns HelpModel
void
goBack()
Sets the previous histroy entry
void
goForward()
Sets the next history entry
void
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 addHelpHistoryModelListener
void
removeHelpSet(HelpSet hs)
Removes entries related to removed HelpSet from history
void
removeLastEntry()
Removes the last history entry
void
setHelpModel(HelpModel model)
Sets a new HelpModel
void
setHistoryEntry(int index)
Sets the current history entry

Field Details

help

protected JHelp help

helpModel

protected HelpModel helpModel

history

protected Vector history

historyIndex

protected int historyIndex

listenerList

protected EventListenerList listenerList

Constructor Details

DefaultHelpHistoryModel

public DefaultHelpHistoryModel(JHelp help)
Creates new DefaultHelpHistoryModel for given JHelp
Parameters:
help - The JHelp

Method Details

addHelpHistoryModelListener

public void addHelpHistoryModelListener(HelpHistoryModelListener l)
Adds a listener for the HelpHistoryModelEvent posted after the model has changed.
Specified by:
addHelpHistoryModelListener in interface HelpHistoryModel
Parameters:
l - The listener to add.

discard

public void discard()
Discards a history
Specified by:
discard in interface HelpHistoryModel

fireHistoryChanged

protected void fireHistoryChanged(Object source,
                                  boolean previous,
                                  boolean next)
Fires the history change

getBackwardHistory

public Vector getBackwardHistory()
Returns a backward history vector
Specified by:
getBackwardHistory in interface HelpHistoryModel
Returns:
The vector of backward history entries

getForwardHistory

public Vector getForwardHistory()
Returns a forward history vector
Specified by:
getForwardHistory in interface HelpHistoryModel
Returns:
The vector of forward history entries

getHistory

public Vector getHistory()
Returns a history
Specified by:
getHistory in interface HelpHistoryModel
Returns:
The vector of history entries

getIndex

public int getIndex()
Returns a current history position
Specified by:
getIndex in interface HelpHistoryModel
Returns:
The history index

getModel

protected HelpModel getModel()
Returns HelpModel
Returns:
The HelpModel

goBack

public void goBack()
Sets the previous histroy entry
Specified by:
goBack in interface HelpHistoryModel

goForward

public void goForward()
Sets the next history entry
Specified by:
goForward in interface HelpHistoryModel

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 interface HelpModelListener
Parameters:
e - The event

removeHelpHistoryModelListener

public void removeHelpHistoryModelListener(HelpHistoryModelListener l)
Removes a listener previously added with addHelpHistoryModelListener
Specified by:
removeHelpHistoryModelListener in interface HelpHistoryModel
Parameters:
l - The listener to remove.

removeHelpSet

public void removeHelpSet(HelpSet hs)
Removes entries related to removed HelpSet from history
Specified by:
removeHelpSet in interface HelpHistoryModel
Parameters:
hs - The removed HelpSet

removeLastEntry

public void removeLastEntry()
Removes the last history entry

setHelpModel

public void setHelpModel(HelpModel model)
Sets a new HelpModel
Specified by:
setHelpModel in interface HelpHistoryModel
Parameters:
model - The new HelpModel

setHistoryEntry

public void setHistoryEntry(int index)
Sets the current history entry
Specified by:
setHistoryEntry in interface HelpHistoryModel
Parameters:
index - The index of history entry