Package javax.help

# Class FavoritesNode

java.lang.Object
javax.swing.tree.DefaultMutableTreeNode
javax.help.FavoritesNode

All Implemented Interfaces:
  `Serializable`, `Cloneable`, `MutableTreeNode`, `TreeNode`

public class FavoritesNode extends DefaultMutableTreeNode
A class for Favorites node. This class forces none-folders to have children.

See Also:
  - Serialized Form

## Field Summary

Fields
Modifier and Type
Field
Description
`static final String`
`ELEMENT`
XML element name
`static final String`
`FOOTER`
Footer of xml document
`static final String`
`HEADER`
Header part of xml file

### Fields inherited from class javax.swing.tree.DefaultMutableTreeNode

`allowsChildren, children, EMPTY_ENUMERATION, parent, userObject`

## Constructor Summary

Constructors
Constructor
Description
`FavoritesNode(FavoritesItem item)`
Creates a FavoritesNode for FavoritesItem.

## Method Summary

Modifier and Type
Method
Description
`void`
`add(DefaultMutableTreeNode child)`
Adds the child node.
`void`
`export(OutputStream out)`
Exports nodes descendants to the OutputStream
`OutputStreamWriter`
`exportHeader(OutputStream out)`
Exports header defined for this type of node to the OutputStream.
`void`
`exportNode(OutputStreamWriter writer)`
Exports node and its descendants to the xml file according favorites.dtd.
`boolean`
`getAllowsChildren()`
Returns wheter node is allowed to have children or not.
`FavoritesNode`
`getDeepCopy()`
Returns the deep copy of node
`String`
`getOffset()`
Returns the string representation of offset.
`int`
`getVisibleChildCount()`
Returns the number of visible children
`String`
`getXMLElement()`
Returns the XML element string
`String`
`getXMLHeader()`
Returns the XML header string
`boolean`
`isVisible()`
Returns wheter node is visible or not
`void`
`remove(DefaultMutableTreeNode child)`
Removes the child node.
`void`
`setVisible(boolean vis)`
Sets visibility of node

### Methods inherited from class javax.swing.tree.DefaultMutableTreeNode

`add, breadthFirstEnumeration, children, clone, depthFirstEnumeration, getChildAfter, getChildAt, getChildBefore, getChildCount, getDepth, getFirstChild, getFirstLeaf, getIndex, getLastChild, getLastLeaf, getLeafCount, getLevel, getNextLeaf, getNextNode, getNextSibling, getParent, getPath, getPathToRoot, getPreviousLeaf, getPreviousNode, getPreviousSibling, getRoot, getSharedAncestor, getSiblingCount, getUserObject, getUserObjectPath, insert, isLeaf, isNodeAncestor, isNodeChild, isNodeDescendant, isNodeRelated, isNodeSibling, isRoot, pathFromAncestorEnumeration, postorderEnumeration, preorderEnumeration, remove, remove, removeAllChildren, removeFromParent, setAllowsChildren, setParent, setUserObject, toString`

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

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

## Field Details

### HEADER

public static final String HEADER
Header part of xml file

See Also:
  - Constant Field Values

### ELEMENT

public static final String ELEMENT
XML element name

See Also:
  - Constant Field Values

### FOOTER

public static final String FOOTER
Footer of xml document

See Also:
  - Constant Field Values

## Constructor Details

### FavoritesNode

public FavoritesNode(FavoritesItem item)
Creates a FavoritesNode for FavoritesItem.

Parameters:
  `item` - The FavoritesItem

## Method Details

### getAllowsChildren

public boolean getAllowsChildren()
Returns wheter node is allowed to have children or not.

Specified by:
  `getAllowsChildren` in interface `TreeNode`
Overrides:
  `getAllowsChildren` in class `DefaultMutableTreeNode`

### add

public void add(DefaultMutableTreeNode child)
Adds the child node.

Parameters:
  `child` - The DefaultMutableTreeNode with FavoritesItem as UserObject.

### remove

public void remove(DefaultMutableTreeNode child)
Removes the child node.

Parameters:
  `child` - Node to remove.

### getVisibleChildCount

public int getVisibleChildCount()
Returns the number of visible children

### getOffset

public String getOffset()
Returns the string representation of offset.

### export

public void export(OutputStream out) throws IOException
Exports nodes descendants to the OutputStream

Parameters:
  `out` - The OutputStream
Throws:
  `IOException`

### exportNode

public void exportNode(OutputStreamWriter writer) throws IOException
Exports node and its descendants to the xml file according favorites.dtd.

Parameters:
  `out` - The OutputStream
Throws:
  `IOException`

### exportHeader

public OutputStreamWriter exportHeader(OutputStream out) throws IOException
Exports header defined for this type of node to the OutputStream.

Parameters:
  `out` - The OutputStream.
Throws:
  `IOException`

### getXMLHeader

public String getXMLHeader()
Returns the XML header string

### getXMLElement

public String getXMLElement()
Returns the XML element string

### getDeepCopy

public FavoritesNode getDeepCopy()
Returns the deep copy of node

### isVisible

public boolean isVisible()
Returns wheter node is visible or not

### setVisible

public void setVisible(boolean vis)
Sets visibility of node