Package ca.corbett.extras.dirtree
Class DirTreeNode
java.lang.Object
javax.swing.tree.DefaultMutableTreeNode
ca.corbett.extras.dirtree.DirTreeNode
- All Implemented Interfaces:
Serializable,Cloneable,MutableTreeNode,TreeNode
Represents a single node (directory or file) within our DirTree.
- Since:
- 2017-11-09
- Author:
- scorbo2
- See Also:
-
Field Summary
Fields inherited from class javax.swing.tree.DefaultMutableTreeNode
allowsChildren, children, EMPTY_ENUMERATION, parent, userObject -
Constructor Summary
ConstructorsConstructorDescriptionDirTreeNode(File dir, boolean showHiddenDirs) Deprecated.DirTreeNode(File dir, boolean showHidden, boolean showFiles, FileFilter fileFilter) Creates a new DirTreeNode for the given directory or file. -
Method Summary
Modifier and TypeMethodDescriptionbooleangetDir()booleaninthashCode()booleanReturns whether this node represents a file (as opposed to a directory).booleanisLeaf()booleanIndicates whether hidden directories and files are shown.booleanDeprecated.UseisShowHidden()instead.voidMethods inherited from class javax.swing.tree.DefaultMutableTreeNode
add, breadthFirstEnumeration, children, clone, depthFirstEnumeration, getAllowsChildren, 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, isNodeAncestor, isNodeChild, isNodeDescendant, isNodeRelated, isNodeSibling, isRoot, pathFromAncestorEnumeration, postorderEnumeration, preorderEnumeration, remove, remove, removeAllChildren, removeFromParent, setAllowsChildren, setParent, setUserObject, toString
-
Constructor Details
-
DirTreeNode
Deprecated.UseDirTreeNode(File, boolean, boolean, FileFilter)instead.Creates a new DirTreeNode for the given directory.- Parameters:
dir- The directory (or file) this node represents.showHiddenDirs- Whether to show hidden directories and files.
-
DirTreeNode
Creates a new DirTreeNode for the given directory or file.- Parameters:
dir- The directory (or file) this node represents.showHidden- Whether to show hidden directories and files.showFiles- Whether to show files as child nodes of directories.fileFilter- An optional FileFilter to restrict which files are shown (null means all files).
-
-
Method Details
-
isLeaf
public boolean isLeaf()- Specified by:
isLeafin interfaceTreeNode- Overrides:
isLeafin classDefaultMutableTreeNode
-
getDir
-
isFileNode
public boolean isFileNode()Returns whether this node represents a file (as opposed to a directory).- Returns:
- true if this node represents a file.
-
isShowHiddenDirs
Deprecated.UseisShowHidden()instead.Indicates whether hidden directories and files are shown. -
isShowHidden
public boolean isShowHidden()Indicates whether hidden directories and files are shown. -
loadChildren
public void loadChildren() -
hasChildren
public boolean hasChildren() -
equals
-
hashCode
public int hashCode()
-
DirTreeNode(File, boolean, boolean, FileFilter)instead.