org.jppf.ui.treetable
Class FileSystemModel

java.lang.Object
  extended by org.jppf.ui.treetable.AbstractTreeTableModel
      extended by org.jppf.ui.treetable.FileSystemModel
All Implemented Interfaces:
TreeModel, TreeTableModel

public class FileSystemModel
extends AbstractTreeTableModel
implements TreeTableModel

FileSystemModel is a TreeTableModel representing a hierarchical file system. Nodes in the FileSystemModel are FileNodes which, when they are directory nodes, cache their children to avoid repeatedly querying the real file system.

Version:
%I% %G%
Author:
Philip Milne, Scott Violet

Field Summary
static Integer ZERO
          The the returned file length for directories.
 
Fields inherited from class org.jppf.ui.treetable.AbstractTreeTableModel
listenerList, root
 
Constructor Summary
FileSystemModel()
          Default constructor.
 
Method Summary
 Object getChild(Object node, int i)
          
 int getChildCount(Object node)
          
protected  Object[] getChildren(Object node)
          Get the children of the specified node.
 Class getColumnClass(int column)
          Returns the type for column number column.
 int getColumnCount()
          Returns the number ofs available columns.
 String getColumnName(int column)
          Returns the name for column number column.
protected  File getFile(Object node)
          Get the file a node points to.
 Object getValueAt(Object node, int column)
          Returns the value to be displayed for node node, at column number column.
 boolean isLeaf(Object node)
          
 
Methods inherited from class org.jppf.ui.treetable.AbstractTreeTableModel
addTreeModelListener, fireTreeNodesChanged, fireTreeNodesInserted, fireTreeNodesRemoved, fireTreeStructureChanged, getIndexOfChild, getRoot, isCellEditable, removeTreeModelListener, setValueAt, valueForPathChanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jppf.ui.treetable.TreeTableModel
isCellEditable, setValueAt
 
Methods inherited from interface javax.swing.tree.TreeModel
addTreeModelListener, getIndexOfChild, getRoot, removeTreeModelListener, valueForPathChanged
 

Field Detail

ZERO

public static final Integer ZERO
The the returned file length for directories.

Constructor Detail

FileSystemModel

public FileSystemModel()
Default constructor.

Method Detail

getFile

protected File getFile(Object node)
Get the file a node points to.

Parameters:
node - the node to get the file from.
Returns:
a File instance.

getChildren

protected Object[] getChildren(Object node)
Get the children of the specified node.

Parameters:
node - the node to get the children of.
Returns:
the children as an array of objects

getChildCount

public int getChildCount(Object node)

Specified by:
getChildCount in interface TreeModel

getChild

public Object getChild(Object node,
                       int i)

Specified by:
getChild in interface TreeModel

isLeaf

public boolean isLeaf(Object node)

Specified by:
isLeaf in interface TreeModel
Overrides:
isLeaf in class AbstractTreeTableModel

getColumnCount

public int getColumnCount()
Returns the number ofs available columns.

Specified by:
getColumnCount in interface TreeTableModel
Returns:
the number of columns.

getColumnName

public String getColumnName(int column)
Returns the name for column number column.

Specified by:
getColumnName in interface TreeTableModel
Parameters:
column - the column number.
Returns:
the name of the column as a string.

getColumnClass

public Class getColumnClass(int column)
Returns the type for column number column.

Specified by:
getColumnClass in interface TreeTableModel
Overrides:
getColumnClass in class AbstractTreeTableModel
Parameters:
column - the column number.
Returns:
the type of the column.

getValueAt

public Object getValueAt(Object node,
                         int column)
Returns the value to be displayed for node node, at column number column.

Specified by:
getValueAt in interface TreeTableModel
Parameters:
node - the nodefor which to get the value.
column - the comumn whzere the value is.
Returns:
the value for the specified node and column.


Copyright © 2005-2010 JPPF Team.