Package javax.help
Class FavoritesNode
- java.lang.Object
-
- javax.swing.tree.DefaultMutableTreeNode
-
- javax.help.FavoritesNode
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable,javax.swing.tree.MutableTreeNode,javax.swing.tree.TreeNode
public class FavoritesNode extends javax.swing.tree.DefaultMutableTreeNodeA class for Favorites node. This class forces none-folders to have children.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description FavoritesNode(FavoritesItem item)Creates a FavoritesNode for FavoritesItem.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(javax.swing.tree.DefaultMutableTreeNode child)Adds the child node.voidexport(java.io.OutputStream out)Exports nodes descendants to the OutputStreamjava.io.OutputStreamWriterexportHeader(java.io.OutputStream out)Exports header defined for this type of node to the OutputStream.voidexportNode(java.io.OutputStreamWriter writer)Exports node and its descendants to the xml file according favorites.dtd.booleangetAllowsChildren()Returns wheter node is allowed to have children or not.FavoritesNodegetDeepCopy()Returns the deep copy of nodejava.lang.StringgetOffset()Returns the string representation of offset.intgetVisibleChildCount()Returns the number of visible childrenjava.lang.StringgetXMLElement()Returns the XML element stringjava.lang.StringgetXMLHeader()Returns the XML header stringbooleanisVisible()Returns wheter node is visible or notvoidremove(javax.swing.tree.DefaultMutableTreeNode child)Removes the child node.voidsetVisible(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
-
-
-
-
Field Detail
-
HEADER
public static final java.lang.String HEADER
Header part of xml file- See Also:
- Constant Field Values
-
ELEMENT
public static final java.lang.String ELEMENT
XML element name- See Also:
- Constant Field Values
-
FOOTER
public static final java.lang.String FOOTER
Footer of xml document- See Also:
- Constant Field Values
-
-
Constructor Detail
-
FavoritesNode
public FavoritesNode(FavoritesItem item)
Creates a FavoritesNode for FavoritesItem.- Parameters:
item- The FavoritesItem
-
-
Method Detail
-
getAllowsChildren
public boolean getAllowsChildren()
Returns wheter node is allowed to have children or not.- Specified by:
getAllowsChildrenin interfacejavax.swing.tree.TreeNode- Overrides:
getAllowsChildrenin classjavax.swing.tree.DefaultMutableTreeNode
-
add
public void add(javax.swing.tree.DefaultMutableTreeNode child)
Adds the child node.- Parameters:
child- The DefaultMutableTreeNode with FavoritesItem as UserObject.
-
remove
public void remove(javax.swing.tree.DefaultMutableTreeNode child)
Removes the child node.- Parameters:
child- Node to remove.
-
getVisibleChildCount
public int getVisibleChildCount()
Returns the number of visible children
-
getOffset
public java.lang.String getOffset()
Returns the string representation of offset.
-
export
public void export(java.io.OutputStream out) throws java.io.IOExceptionExports nodes descendants to the OutputStream- Parameters:
out- The OutputStream- Throws:
java.io.IOException
-
exportNode
public void exportNode(java.io.OutputStreamWriter writer) throws java.io.IOExceptionExports node and its descendants to the xml file according favorites.dtd.- Parameters:
out- The OutputStream- Throws:
java.io.IOException
-
exportHeader
public java.io.OutputStreamWriter exportHeader(java.io.OutputStream out) throws java.io.IOExceptionExports header defined for this type of node to the OutputStream.- Parameters:
out- The OutputStream.- Throws:
java.io.IOException
-
getXMLHeader
public java.lang.String getXMLHeader()
Returns the XML header string
-
getXMLElement
public java.lang.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
-
-