public class FileTreeNode extends AsyncUniqueNode<FileTreeNode,File> implements TextBridge<TreeNodeParameters<FileTreeNode,WebAsyncTree<FileTreeNode>>>
AsyncUniqueNode
representing single File
.Modifier and Type | Field and Description |
---|---|
static String |
rootId
Root node ID.
|
protected String |
title
Custom node title.
|
failedStateIcon, failedStateIcons, failureCause, ID_PREFIX, loadIconType, observer, state
id
allowsChildren, children, parent, userObject
Constructor and Description |
---|
FileTreeNode(File file)
Constructs file node for the specified file.
|
Modifier and Type | Method and Description |
---|---|
File |
getFile()
Returns file for this node.
|
String |
getId()
Returns node ID and creates it if it doesn't exist.
|
Icon |
getNodeIcon(TreeNodeParameters<FileTreeNode,WebAsyncTree<FileTreeNode>> parameters)
Returns specific icon for this node.
|
String |
getText(TreeNodeParameters<FileTreeNode,WebAsyncTree<FileTreeNode>> parameters) |
String |
getTitle()
Returns node title.
|
int |
indexOfFileChild(File file)
Returns index of child node with the specified file.
|
void |
setFile(File file)
Sets file for this node.
|
void |
setTitle(String title)
Sets custom name for this node.
|
String |
toString()
Returns text node representation.
|
attachLoadIconObserver, detachLoadIconObserver, getFailedStateIcon, getFailureCause, getIcon, getLoadIcon, getState, isFailed, isLoaded, isLoading, isWaiting, setFailureCause, setState
setId
add, breadthFirstEnumeration, children, clone, depthFirstEnumeration, getAllowsChildren, getChildAfter, getChildAt, getChildBefore, getChildCount, getDepth, getFirstChild, getFirstLeaf, getIndex, getLastChild, getLastLeaf, getLeafCount, getLevel, getNextLeaf, getNextNode, getNextSibling, getParent, getPath, getPreviousLeaf, getPreviousNode, getPreviousSibling, getRoot, getSharedAncestor, getSiblingCount, getTreePath, getUserObject, getUserObjectPath, insert, isLeaf, isNodeAncestor, isNodeChild, isNodeDescendant, isNodeRelated, isNodeSibling, isRoot, pathFromAncestorEnumeration, postorderEnumeration, preorderEnumeration, remove, remove, removeAllChildren, removeFromParent, setAllowsChildren, setParent, setUserObject
public static final String rootId
@NotNull public String getId()
UniqueNode
getId
in interface Identifiable
getId
in class UniqueNode<FileTreeNode,File>
public void setFile(@Nullable File file)
file
- file for this node@Nullable public Icon getNodeIcon(@NotNull TreeNodeParameters<FileTreeNode,WebAsyncTree<FileTreeNode>> parameters)
AsyncUniqueNode
getNodeIcon
in class AsyncUniqueNode<FileTreeNode,File>
parameters
- TreeNodeParameters
public String getText(@NotNull TreeNodeParameters<FileTreeNode,WebAsyncTree<FileTreeNode>> parameters)
getText
in interface TextBridge<TreeNodeParameters<FileTreeNode,WebAsyncTree<FileTreeNode>>>
public void setTitle(@Nullable String title)
title
- custom name for this nodepublic int indexOfFileChild(@Nullable File file)
file
- file to search for in child nodes@NotNull public String toString()
UniqueNode
toString
in class UniqueNode<FileTreeNode,File>
WebTreeNode.getUserObject()
Copyright © 2020. All rights reserved.