Package jadex.base.gui.filetree
Class FileNode
- java.lang.Object
- 
- jadex.base.gui.asynctree.AbstractTreeNode
- 
- jadex.base.gui.asynctree.AbstractSwingTreeNode
- 
- jadex.base.gui.filetree.FileNode
 
 
 
- 
- All Implemented Interfaces:
- ISwingTreeNode,- ITreeNode,- IFileNode
 - Direct Known Subclasses:
- DirNode
 
 public class FileNode extends AbstractSwingTreeNode implements IFileNode Node object representing a service container.
- 
- 
Field SummaryFields Modifier and Type Field Description protected java.lang.StringdisplaynameThe cached display name.protected java.io.FilefileThe file.protected IIconCacheiconcacheThe icon cache.protected java.util.ListlastsiblingsThe last siblings.protected java.lang.StringrelativeThe relative file name.protected java.lang.Stringtostring- 
Fields inherited from class jadex.base.gui.asynctree.AbstractSwingTreeNodetree
 - 
Fields inherited from class jadex.base.gui.asynctree.AbstractTreeNodechildrenfuture, dirty, model, parent, recurse, searching
 
- 
 - 
Constructor SummaryConstructors Constructor Description FileNode(ISwingTreeNode parent, AsyncSwingTreeModel model, javax.swing.JTree tree, java.io.File file, IIconCache iconcache)Create a new service container node.
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected static java.lang.StringconvertPathToRelative(java.io.File file)Get the corresponding relative path for a file.java.lang.StringgetDisplayName()Get the display name.java.io.FilegetFile()Get the file.java.lang.StringgetFileName()Get the file name.java.lang.StringgetFilePath()Get the file path.longgetFileSize()Get the file size.byte[]getIcon()Get the icon as byte[] for a node.java.lang.ObjectgetId()Get the id used for lookup.javax.swing.JComponentgetPropertiesComponent()Get or create a component displaying the node properties.java.lang.StringgetRelativePath()Get the relative path.javax.swing.IcongetSwingIcon()Get the icon for a node.java.lang.StringgetTooltipText()Get tooltip text.booleanhasProperties()True, if the node has properties that can be displayed.booleanisDirectory()Check if the file is a directory.booleanisLeaf()Check if the node is a leaf.voidrefresh(boolean recurse)Refresh the node.protected voidsearchChildren()Asynchronously search for children.java.lang.StringtoString()Create a string representation.- 
Methods inherited from class jadex.base.gui.asynctree.AbstractSwingTreeNodeaddChild, addChild, equals, expandChildren, getCachedChildren, getChild, getChildCount, getChildren, getIndexOfChild, getModel, getParent, getTree, removeChild, setChildren
 - 
Methods inherited from class jadex.base.gui.asynctree.AbstractTreeNodecheckChildren, dispose, hashCode, removeAllChildren, setParent
 - 
Methods inherited from class java.lang.Objectclone, finalize, getClass, notify, notifyAll, wait, wait, wait
 - 
Methods inherited from interface jadex.base.gui.asynctree.ISwingTreeNodegetChild, getChildren, getParent
 - 
Methods inherited from interface jadex.base.gui.asynctree.ITreeNodedispose, getCachedChildren, getChildCount, getIndexOfChild
 
- 
 
- 
- 
- 
Field Detail- 
fileprotected java.io.File file The file.
 - 
iconcacheprotected final IIconCache iconcache The icon cache.
 - 
relativeprotected java.lang.String relative The relative file name.
 - 
displaynameprotected java.lang.String displayname The cached display name.
 - 
tostringprotected java.lang.String tostring 
 - 
lastsiblingsprotected java.util.List lastsiblings The last siblings.
 
- 
 - 
Constructor Detail- 
FileNodepublic FileNode(ISwingTreeNode parent, AsyncSwingTreeModel model, javax.swing.JTree tree, java.io.File file, IIconCache iconcache) Create a new service container node.
 
- 
 - 
Method Detail- 
getIdpublic java.lang.Object getId() Get the id used for lookup.
 - 
getIconpublic byte[] getIcon() Get the icon as byte[] for a node.- Specified by:
- getIconin interface- ITreeNode
- Specified by:
- getIconin class- AbstractTreeNode
 
 - 
getSwingIconpublic javax.swing.Icon getSwingIcon() Get the icon for a node.- Specified by:
- getSwingIconin interface- ISwingTreeNode
- Specified by:
- getSwingIconin class- AbstractSwingTreeNode
 
 - 
refreshpublic void refresh(boolean recurse) Refresh the node.- Specified by:
- refreshin interface- ITreeNode
- Overrides:
- refreshin class- AbstractSwingTreeNode
- Parameters:
- recurse- Recursively refresh subnodes, if true.
 
 - 
searchChildrenprotected void searchChildren() Asynchronously search for children. Should call setChildren() once children are found.- Specified by:
- searchChildrenin class- AbstractTreeNode
 
 - 
toStringpublic java.lang.String toString() Create a string representation.- Overrides:
- toStringin class- java.lang.Object
 
 - 
getDisplayNamepublic java.lang.String getDisplayName() Get the display name.
 - 
getTooltipTextpublic java.lang.String getTooltipText() Get tooltip text.- Specified by:
- getTooltipTextin interface- ITreeNode
- Specified by:
- getTooltipTextin class- AbstractTreeNode
 
 - 
hasPropertiespublic boolean hasProperties() True, if the node has properties that can be displayed.- Specified by:
- hasPropertiesin interface- ITreeNode
- Overrides:
- hasPropertiesin class- AbstractTreeNode
 
 - 
getPropertiesComponentpublic javax.swing.JComponent getPropertiesComponent() Get or create a component displaying the node properties. Only to be called if hasProperties() is true;- Specified by:
- getPropertiesComponentin interface- ISwingTreeNode
- Overrides:
- getPropertiesComponentin class- AbstractSwingTreeNode
 
 - 
getFilepublic java.io.File getFile() Get the file.- Returns:
- the file.
 
 - 
getRelativePathpublic java.lang.String getRelativePath() Get the relative path.
 - 
convertPathToRelativeprotected static java.lang.String convertPathToRelative(java.io.File file) Get the corresponding relative path for a file. Handles jars specially.
 - 
isLeafpublic boolean isLeaf() Check if the node is a leaf.- Specified by:
- isLeafin interface- ITreeNode
- Overrides:
- isLeafin class- AbstractSwingTreeNode
 
 - 
getFileNamepublic java.lang.String getFileName() Get the file name.- Specified by:
- getFileNamein interface- IFileNode
 
 - 
getFilePathpublic java.lang.String getFilePath() Get the file path.- Specified by:
- getFilePathin interface- IFileNode
 
 - 
isDirectorypublic boolean isDirectory() Check if the file is a directory.- Specified by:
- isDirectoryin interface- IFileNode
 
 - 
getFileSizepublic long getFileSize() Get the file size.- Specified by:
- getFileSizein interface- IFileNode
 
 
- 
 
-