public class FileNode extends AbstractSwingTreeNode implements IFileNode
Modifier and Type | Field and Description |
---|---|
protected java.lang.String |
displayname
The cached display name.
|
protected java.io.File |
file
The file.
|
protected IIconCache |
iconcache
The icon cache.
|
protected java.util.List |
lastsiblings
The last siblings.
|
protected java.lang.String |
relative
The relative file name.
|
protected java.lang.String |
tostring |
tree
Constructor and Description |
---|
FileNode(ISwingTreeNode parent,
AsyncSwingTreeModel model,
javax.swing.JTree tree,
java.io.File file,
IIconCache iconcache)
Create a new service container node.
|
Modifier and Type | Method and Description |
---|---|
protected static java.lang.String |
convertPathToRelative(java.io.File file)
Get the corresponding relative path for a file.
|
java.lang.String |
getDisplayName()
Get the display name.
|
java.io.File |
getFile()
Get the file.
|
java.lang.String |
getFileName()
Get the file name.
|
java.lang.String |
getFilePath()
Get the file path.
|
long |
getFileSize()
Get the file size.
|
byte[] |
getIcon()
Get the icon as byte[] for a node.
|
java.lang.Object |
getId()
Get the id used for lookup.
|
javax.swing.JComponent |
getPropertiesComponent()
Get or create a component displaying the node properties.
|
java.lang.String |
getRelativePath()
Get the relative path.
|
javax.swing.Icon |
getSwingIcon()
Get the icon for a node.
|
java.lang.String |
getTooltipText()
Get tooltip text.
|
boolean |
hasProperties()
True, if the node has properties that can be displayed.
|
boolean |
isDirectory()
Check if the file is a directory.
|
boolean |
isLeaf()
Check if the node is a leaf.
|
void |
refresh(boolean recurse)
Refresh the node.
|
protected void |
searchChildren()
Asynchronously search for children.
|
java.lang.String |
toString()
Create a string representation.
|
addChild, addChild, equals, expandChildren, getCachedChildren, getChild, getChildCount, getChildren, getIndexOfChild, getModel, getParent, getTree, removeChild, setChildren
checkChildren, dispose, hashCode, removeAllChildren, setParent
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getChild, getChildren, getParent
protected java.io.File file
protected final IIconCache iconcache
protected java.lang.String relative
protected java.lang.String displayname
protected java.lang.String tostring
protected java.util.List lastsiblings
public FileNode(ISwingTreeNode parent, AsyncSwingTreeModel model, javax.swing.JTree tree, java.io.File file, IIconCache iconcache)
public java.lang.Object getId()
getId
in interface jadex.base.gui.asynctree.ITreeNode
public byte[] getIcon()
getIcon
in interface jadex.base.gui.asynctree.ITreeNode
getIcon
in class jadex.base.gui.asynctree.AbstractTreeNode
public javax.swing.Icon getSwingIcon()
getSwingIcon
in interface ISwingTreeNode
getSwingIcon
in class AbstractSwingTreeNode
public void refresh(boolean recurse)
refresh
in interface jadex.base.gui.asynctree.ITreeNode
refresh
in class AbstractSwingTreeNode
recurse
- Recursively refresh subnodes, if true.protected void searchChildren()
searchChildren
in class jadex.base.gui.asynctree.AbstractTreeNode
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String getDisplayName()
public java.lang.String getTooltipText()
getTooltipText
in interface jadex.base.gui.asynctree.ITreeNode
getTooltipText
in class jadex.base.gui.asynctree.AbstractTreeNode
public boolean hasProperties()
hasProperties
in interface jadex.base.gui.asynctree.ITreeNode
hasProperties
in class jadex.base.gui.asynctree.AbstractTreeNode
public javax.swing.JComponent getPropertiesComponent()
getPropertiesComponent
in interface ISwingTreeNode
getPropertiesComponent
in class AbstractSwingTreeNode
public java.io.File getFile()
public java.lang.String getRelativePath()
protected static java.lang.String convertPathToRelative(java.io.File file)
public boolean isLeaf()
isLeaf
in interface jadex.base.gui.asynctree.ITreeNode
isLeaf
in class AbstractSwingTreeNode
public java.lang.String getFileName()
getFileName
in interface IFileNode
public java.lang.String getFilePath()
getFilePath
in interface IFileNode
public boolean isDirectory()
isDirectory
in interface IFileNode
public long getFileSize()
getFileSize
in interface IFileNode