de.matthiasmann.twl.model
Class FileSystemTreeModel

java.lang.Object
  extended by de.matthiasmann.twl.model.AbstractTableColumnHeaderModel
      extended by de.matthiasmann.twl.model.AbstractTreeTableModel
          extended by de.matthiasmann.twl.model.FileSystemTreeModel
All Implemented Interfaces:
TableColumnHeaderModel, TreeTableModel, TreeTableNode

public class FileSystemTreeModel
extends AbstractTreeTableModel

A tree model which displays the folders of a FileSystemModel


Nested Class Summary
static class FileSystemTreeModel.FolderFilter
           
static class FileSystemTreeModel.FolderNode
           
 
Nested classes/interfaces inherited from interface de.matthiasmann.twl.model.TreeTableModel
TreeTableModel.ChangeListener
 
Nested classes/interfaces inherited from interface de.matthiasmann.twl.model.TableColumnHeaderModel
TableColumnHeaderModel.ColumnHeaderChangeListener
 
Field Summary
protected  java.util.Comparator<java.lang.Object> sorter
           
 
Constructor Summary
FileSystemTreeModel(FileSystemModel fsm)
           
FileSystemTreeModel(FileSystemModel fsm, boolean includeLastModified)
           
 
Method Summary
 java.lang.String getColumnHeaderText(int column)
          The text of the specified column header.
 FileSystemModel getFileSystemModel()
           
 FileSystemTreeModel.FolderNode getNodeForFolder(java.lang.Object obj)
           
 int getNumColumns()
           
 java.util.Comparator<java.lang.Object> getSorter()
           
 void insertRoots()
          Removes all nodes from the tree and creates the root nodes
 void setSorter(java.util.Comparator<java.lang.Object> sorter)
          Sets the sorter used for sorting folders (the root nodes are not sorted).
 
Methods inherited from class de.matthiasmann.twl.model.AbstractTreeTableModel
addChangeListener, fireColumnDeleted, fireColumnHeaderChanged, fireColumnInserted, fireNodesAdded, fireNodesChanged, fireNodesRemoved, getChild, getChildIndex, getData, getNumChildren, getParent, getTooltipContent, insertChild, isLeaf, removeAllChildren, removeChangeListener, removeChild
 
Methods inherited from class de.matthiasmann.twl.model.AbstractTableColumnHeaderModel
getColumnHeaderState, getColumnHeaderStates
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface de.matthiasmann.twl.model.TableColumnHeaderModel
getColumnHeaderState, getColumnHeaderStates
 

Field Detail

sorter

protected java.util.Comparator<java.lang.Object> sorter
Constructor Detail

FileSystemTreeModel

public FileSystemTreeModel(FileSystemModel fsm,
                           boolean includeLastModified)

FileSystemTreeModel

public FileSystemTreeModel(FileSystemModel fsm)
Method Detail

getNumColumns

public int getNumColumns()

getColumnHeaderText

public java.lang.String getColumnHeaderText(int column)
Description copied from interface: TableColumnHeaderModel
The text of the specified column header.

Parameters:
column - the column index
Returns:
the column header test

getFileSystemModel

public FileSystemModel getFileSystemModel()

insertRoots

public void insertRoots()
Removes all nodes from the tree and creates the root nodes


getNodeForFolder

public FileSystemTreeModel.FolderNode getNodeForFolder(java.lang.Object obj)

getSorter

public java.util.Comparator<java.lang.Object> getSorter()

setSorter

public void setSorter(java.util.Comparator<java.lang.Object> sorter)
Sets the sorter used for sorting folders (the root nodes are not sorted). Will call insertRoots() when the sorter is changed.

Parameters:
sorter - The new sorter - can be null
See Also:
insertRoots()