com.alee.extended.tree
Class FileTreeNode

java.lang.Object
  extended by javax.swing.tree.DefaultMutableTreeNode
      extended by com.alee.laf.tree.UniqueNode
          extended by com.alee.extended.tree.AsyncUniqueNode
              extended by com.alee.extended.tree.FileTreeNode
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, javax.swing.tree.MutableTreeNode, javax.swing.tree.TreeNode

public class FileTreeNode
extends AsyncUniqueNode

Custom AsyncUniqueNode for WebFileTree.

Author:
Mikle Garin
See Also:
Serialized Form

Field Summary
protected  java.io.File file
          File for this node.
protected  java.lang.String name
          Custom node name.
 
Fields inherited from class com.alee.extended.tree.AsyncUniqueNode
failureCause, loaderIcon, state
 
Fields inherited from class com.alee.laf.tree.UniqueNode
id, ID_PREFIX
 
Fields inherited from class javax.swing.tree.DefaultMutableTreeNode
allowsChildren, children, EMPTY_ENUMERATION, parent, userObject
 
Constructor Summary
FileTreeNode(java.io.File file)
          Constructs file node for the specified file.
FileTreeNode(java.io.File file, java.lang.String name)
          Constructs file node for the specified file with custom name.
 
Method Summary
 FileTreeNode getChildAt(int index)
          
 java.io.File getFile()
          Returns file for this node.
 java.lang.String getId()
          Returns node ID and creates it if it doesn't exist.
 java.lang.String getName()
          Returns custom name for this node.
 FileTreeNode getParent()
          
 int indexOfFileChild(java.io.File file)
          Returns index of child node with the specified file.
 void setFile(java.io.File file)
          Sets file for this node.
 void setName(java.lang.String name)
          Sets custom name for this node.
 java.lang.String toString()
          Returns text node representation.
 
Methods inherited from class com.alee.extended.tree.AsyncUniqueNode
createLoaderIcon, getFailureCause, getLoaderIcon, getState, isFailed, isLoaded, isLoading, isWaiting, setFailureCause, setState
 
Methods inherited from class com.alee.laf.tree.UniqueNode
getTreePath, setId, setId
 
Methods inherited from class javax.swing.tree.DefaultMutableTreeNode
add, breadthFirstEnumeration, children, clone, depthFirstEnumeration, getAllowsChildren, getChildAfter, getChildBefore, getChildCount, getDepth, getFirstChild, getFirstLeaf, getIndex, getLastChild, getLastLeaf, getLeafCount, getLevel, getNextLeaf, getNextNode, getNextSibling, 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
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

file

protected java.io.File file
File for this node.


name

protected java.lang.String name
Custom node name.

Constructor Detail

FileTreeNode

public FileTreeNode(java.io.File file)
Constructs file node for the specified file.

Parameters:
file - node file

FileTreeNode

public FileTreeNode(java.io.File file,
                    java.lang.String name)
Constructs file node for the specified file with custom name.

Parameters:
file - node file
name - custom node name
Method Detail

getId

public java.lang.String getId()
Returns node ID and creates it if it doesn't exist.

Overrides:
getId in class UniqueNode
Returns:
node ID

getFile

public java.io.File getFile()
Returns file for this node.

Returns:
file for this node

setFile

public void setFile(java.io.File file)
Sets file for this node.

Parameters:
file - file for this node

getName

public java.lang.String getName()
Returns custom name for this node.

Returns:
custom name for this node

setName

public void setName(java.lang.String name)
Sets custom name for this node.

Parameters:
name - custom name for this node

getParent

public FileTreeNode getParent()

Specified by:
getParent in interface javax.swing.tree.TreeNode
Overrides:
getParent in class AsyncUniqueNode

getChildAt

public FileTreeNode getChildAt(int index)

Specified by:
getChildAt in interface javax.swing.tree.TreeNode
Overrides:
getChildAt in class AsyncUniqueNode

indexOfFileChild

public int indexOfFileChild(java.io.File file)
Returns index of child node with the specified file.

Parameters:
file - file to search for in child nodes
Returns:
index of child node with the specified file

toString

public java.lang.String toString()
Returns text node representation.

Overrides:
toString in class UniqueNode
Returns:
text node representation