Package javax.help

# Class TOCView

java.lang.Object
javax.help.NavigatorView
javax.help.TOCView

All Implemented Interfaces:
  `Serializable`

public class TOCView extends NavigatorView
Navigational View information for a TOC. This includes information about how to parse the data format.

See Also:
  - Serialized Form

## Nested Class Summary

Nested Classes
Modifier and Type
Class
Description
`static class`
`TOCView.DefaultTOCFactory`
A default TreeItemFactory that can be used to parse TOC items as used by this navigator.

## Field Summary

Fields
Modifier and Type
Field
Description
`static final String`
`publicIDString`
PublicID (known to this XML processor) to the DTD for version 1.0 of the TOC.
`static final String`
`publicIDString_V2`
PublicID (known to this XML processor) to the DTD for version 2.0 of the TOC.

## Constructor Summary

Constructors
Constructor
Description
`TOCView(HelpSet hs, String name, String label, Hashtable params)`
Constructs a TOC VIew with some given data.
`TOCView(HelpSet hs, String name, String label, Locale locale, Hashtable params)`
Constructs a TOC VIew with some given data.

## Method Summary

Modifier and Type
Method
Description
`Component`
`createNavigator(HelpModel model)`
Creates a navigator for a given model.
`Map.ID`
`getCategoryClosedImageID()`
Returns the default category closed image ID.
`Map.ID`
`getCategoryOpenImageID()`
Returns the default category open image ID.
`DefaultMutableTreeNode`
`getDataAsTree()`
Public method that gets a DefaultMutableTreeNode representing the information in this view instance.
`String`
`getMergeType()`
Get the TOC navigators mergeType.
`Map.ID`
`getTopicImageID()`
Returns the topic image ID.
`static DefaultMutableTreeNode`
`parse(URL url, HelpSet hs, Locale locale, TreeItemFactory factory)`
Public method for parsing a TOC in a URL.
`static DefaultMutableTreeNode`
`parse(URL url, HelpSet hs, Locale locale, TreeItemFactory factory, TOCView view)`
Public method for parsing a TOC in a URL.
`void`
`setCategoryClosedImageID(String imageID)`
Set the default category closed image ID.
`void`
`setCategoryOpenImageID(String imageID)`
Set the default category open image ID.
`void`
`setTopicImageID(String imageID)`
Set the topic image ID param String ID for the topic image

### Methods inherited from class javax.help.NavigatorView

`create, getHelpSet, getImageID, getLabel, getLabel, getLocale, getName, getParameters`

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

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

## Field Details

### publicIDString

public static final String publicIDString
PublicID (known to this XML processor) to the DTD for version 1.0 of the TOC.

See Also:
  - Constant Field Values

### publicIDString_V2

public static final String publicIDString_V2
PublicID (known to this XML processor) to the DTD for version 2.0 of the TOC.

See Also:
  - Constant Field Values

## Constructor Details

### TOCView

public TOCView(HelpSet hs, String name, String label, Hashtable params)
Constructs a TOC VIew with some given data. Locale defaults to that of the HelpSet.

Parameters:
  `hs` - The HelpSet that provides context information.
  `name` - The name of the View.
  `label` - The label (to show the user) of the View.
  `params` - A hashtable that provides different key/values for this type.

### TOCView

public TOCView(HelpSet hs, String name, String label, Locale locale, Hashtable params)
Constructs a TOC VIew with some given data.

Parameters:
  `hs` - The HelpSet that provides context information.
  `name` - The name of the View.
  `label` - The label (to show the user) of the View.
  `locale` - The default locale to interpret the data in this TOC.
  `params` - A hashtable that provides different key/values for this type.

## Method Details

### createNavigator

public Component createNavigator(HelpModel model)
Creates a navigator for a given model.

Specified by:
  `createNavigator` in class `NavigatorView`
Parameters:
  `model` - The model for the Navigator.

### getMergeType

public String getMergeType()
Get the TOC navigators mergeType. Overrides getMergeType in NavigatorView

Overrides:
  `getMergeType` in class `NavigatorView`
Returns:
  The merge type of this Navigator view

### getDataAsTree

public DefaultMutableTreeNode getDataAsTree()
Public method that gets a DefaultMutableTreeNode representing the information in this view instance. The default implementation parses the data in the URL but a subclass may override this method and provide a different implemenation--for example, by creating the tree programatically.

### parse

public static DefaultMutableTreeNode parse(URL url, HelpSet hs, Locale locale, TreeItemFactory factory)
Public method for parsing a TOC in a URL. Returns a DefaultMutableTreeNode whose children are the DefaultMutableTreeNode corresponding to the tocitem's in the TOC. The factory is invoked to create the TreeItems that are included in the DefaultMutableTreeNode as user data. The factory is also invoked with start data, and whenever any parsing error is found.

Parameters:
  `url` - Where the TOC lives. If null, returns a null value.
  `hs` - The HelpSet context for this TOC. Null hs is ignored.
  `locale` - The default locale to interpret the data in this TOC. Null locale is treated as the default locale.
  `factory` - A factory instance used to create the TOCItems.
Returns:
  A TreeNode that represents the TOC. Returns null if parsing errors were encountered.

### parse

public static DefaultMutableTreeNode parse(URL url, HelpSet hs, Locale locale, TreeItemFactory factory, TOCView view)
Public method for parsing a TOC in a URL. Returns a DefaultMutableTreeNode whose children are the DefaultMutableTreeNode corresponding to the tocitem's in the TOC. The factory is invoked to create the TreeItems that are included in the DefaultMutableTreeNode as user data. The factory is also invoked with start data, and whenever any parsing error is found.

Parameters:
  `url` - Where the TOC lives. If null, returns a null value.
  `hs` - The HelpSet context for this TOC. Null hs is ignored.
  `locale` - The default locale to interpret the data in this TOC. Null locale is treated as the default locale.
  `factory` - A factory instance used to create the TOCItems.
  `view` - The TOCView instance. May be null
Returns:
  A TreeNode that represents the TOC. Returns null if parsing errors were encountered.

### setCategoryOpenImageID

public void setCategoryOpenImageID(String imageID)
Set the default category open image ID. param String ID of catagory open image

### getCategoryOpenImageID

public Map.ID getCategoryOpenImageID()
Returns the default category open image ID. return ID the ID for the category open image, if the category open image is null return the category closed image if it is defined, otherwise return null

### setCategoryClosedImageID

public void setCategoryClosedImageID(String imageID)
Set the default category closed image ID. param String ID of catagory closed image

### getCategoryClosedImageID

public Map.ID getCategoryClosedImageID()
Returns the default category closed image ID. return ID the ID for the category closed image or null if not defined

### setTopicImageID

public void setTopicImageID(String imageID)
Set the topic image ID param String ID for the topic image

### getTopicImageID

public Map.ID getTopicImageID()
Returns the topic image ID. return String the ID for the topic image or null if not defined