Package javax.help

# Class DefaultHelpHistoryModel

java.lang.Object
javax.help.DefaultHelpHistoryModel

All Implemented Interfaces:
  `Serializable`, `EventListener`, `HelpModelListener`, `HelpHistoryModel`

public class DefaultHelpHistoryModel extends 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 Vector`
`history`
`protected int`
`historyIndex`
`protected EventListenerList`
`listenerList`

## Constructor Summary

Constructors
Constructor
Description
`DefaultHelpHistoryModel(JHelp help)`
Creates new DefaultHelpHistoryModel for given JHelp

## Method Summary

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 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

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### history

protected Vector history

### historyIndex

protected int historyIndex

### helpModel

protected HelpModel helpModel

### listenerList

protected EventListenerList listenerList

### help

protected JHelp help

## Constructor Details

### DefaultHelpHistoryModel

public DefaultHelpHistoryModel(JHelp help)
Creates new DefaultHelpHistoryModel for given JHelp

Parameters:
  `help` - The JHelp

## Method Details

### setHelpModel

public void setHelpModel(HelpModel model)
Sets a new HelpModel

Specified by:
  `setHelpModel` in interface `HelpHistoryModel`
Parameters:
  `model` - The new HelpModel

### 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.
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 interface `HelpHistoryModel`
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 interface `HelpHistoryModel`

### getHistory

public Vector getHistory()
Returns a history

Specified by:
  `getHistory` in interface `HelpHistoryModel`
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 interface `HelpHistoryModel`
Returns:
  The history index

### goForward

public void goForward()
Sets the next history entry

Specified by:
  `goForward` in interface `HelpHistoryModel`

### goBack

public void goBack()
Sets the previous histroy entry

Specified by:
  `goBack` in interface `HelpHistoryModel`

### getForwardHistory

public Vector getForwardHistory()
Returns a forward history vector

Specified by:
  `getForwardHistory` in interface `HelpHistoryModel`
Returns:
  The vector of forward history entries

### getBackwardHistory

public Vector getBackwardHistory()
Returns a backward history vector

Specified by:
  `getBackwardHistory` in interface `HelpHistoryModel`
Returns:
  The vector of backward history entries

### setHistoryEntry

public void setHistoryEntry(int index)
Sets the current history entry

Specified by:
  `setHistoryEntry` in interface `HelpHistoryModel`
Parameters:
  `index` - The index of history entry

### fireHistoryChanged

protected void fireHistoryChanged(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 interface `HelpModelListener`
Parameters:
  `e` - The event

### 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

### getModel

protected HelpModel getModel()
Returns HelpModel

Returns:
  The HelpModel