Package javax.help
Class FavoritesNode
java.lang.Object
javax.swing.tree.DefaultMutableTreeNode
javax.help.FavoritesNode
- All Implemented Interfaces:
Serializable
,Cloneable
,MutableTreeNode
,TreeNode
A class for Favorites node. This class forces none-folders to have children.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
XML element namestatic final String
Footer of xml documentstatic final String
Header part of xml fileFields inherited from class javax.swing.tree.DefaultMutableTreeNode
allowsChildren, children, EMPTY_ENUMERATION, parent, userObject
-
Constructor Summary
ConstructorsConstructorDescriptionFavoritesNode
(FavoritesItem item) Creates a FavoritesNode for FavoritesItem. -
Method Summary
Modifier and TypeMethodDescriptionvoid
add
(DefaultMutableTreeNode child) Adds the child node.void
export
(OutputStream out) Exports nodes descendants to the OutputStreamexportHeader
(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
Returns wheter node is allowed to have children or not.Returns the deep copy of nodeReturns the string representation of offset.int
Returns the number of visible childrenReturns the XML element stringReturns the XML header stringboolean
Returns wheter node is visible or notvoid
remove
(DefaultMutableTreeNode child) Removes the child node.void
setVisible
(boolean vis) Sets visibility of nodeMethods 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
-
Field Details
-
HEADER
Header part of xml file- See Also:
-
ELEMENT
XML element name- See Also:
-
FOOTER
Footer of xml document- See Also:
-
-
Constructor Details
-
FavoritesNode
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 interfaceTreeNode
- Overrides:
getAllowsChildren
in classDefaultMutableTreeNode
-
add
Adds the child node.- Parameters:
child
- The DefaultMutableTreeNode with FavoritesItem as UserObject.
-
remove
Removes the child node.- Parameters:
child
- Node to remove.
-
getVisibleChildCount
public int getVisibleChildCount()Returns the number of visible children -
getOffset
Returns the string representation of offset. -
export
Exports nodes descendants to the OutputStream- Parameters:
out
- The OutputStream- Throws:
IOException
-
exportNode
Exports node and its descendants to the xml file according favorites.dtd.- Parameters:
out
- The OutputStream- Throws:
IOException
-
exportHeader
Exports header defined for this type of node to the OutputStream.- Parameters:
out
- The OutputStream.- Throws:
IOException
-
getXMLHeader
Returns the XML header string -
getXMLElement
Returns the XML element string -
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
-