JComponentPack 1.5.0

com.zfqjava.swing.model
Class FileTableModel

java.lang.Object
  extended by javax.swing.table.AbstractTableModel
      extended by com.zfqjava.swing.model.FileTableModel
All Implemented Interfaces:
ColumnSorter, Reloadable, Serializable, TableModel

public class FileTableModel
extends AbstractTableModel
implements ColumnSorter, Reloadable

FileTableModel provides a file table model.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
 
Constructor Summary
FileTableModel(File directory)
           
FileTableModel(File directory, boolean sync, Component component)
          Creates a FileTableModel.
 
Method Summary
 Class getColumnClass(int column)
           
 int getColumnCount()
           
 String getColumnName(int column)
           
 File getDirectory()
           
 int getRowCount()
           
 Object getValueAt(int row, int column)
           
 boolean isCellEditable(int row, int column)
           
 void reload()
          Reloads the model contents.
 void setValueAt(Object o, int row, int column)
           
 void sortColumn(int column, boolean ascending)
          Sorts the specified column.
 
Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, getTableModelListeners, removeTableModelListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileTableModel

public FileTableModel(File directory)

FileTableModel

public FileTableModel(File directory,
                      boolean sync,
                      Component component)
Creates a FileTableModel.

Parameters:
directory - the directory to display
sync - false will list the files in background thread
component - the component to display the wait cursor
Method Detail

getDirectory

public File getDirectory()

reload

public void reload()
Description copied from interface: Reloadable
Reloads the model contents.

Specified by:
reload in interface Reloadable

sortColumn

public void sortColumn(int column,
                       boolean ascending)
Sorts the specified column.

Specified by:
sortColumn in interface ColumnSorter
Parameters:
column - the column to sort
ascending - the sort order

getRowCount

public int getRowCount()
Specified by:
getRowCount in interface TableModel

getColumnCount

public int getColumnCount()
Specified by:
getColumnCount in interface TableModel

getColumnName

public String getColumnName(int column)
Specified by:
getColumnName in interface TableModel
Overrides:
getColumnName in class AbstractTableModel

getColumnClass

public Class getColumnClass(int column)
Specified by:
getColumnClass in interface TableModel
Overrides:
getColumnClass in class AbstractTableModel

getValueAt

public Object getValueAt(int row,
                         int column)
Specified by:
getValueAt in interface TableModel

setValueAt

public void setValueAt(Object o,
                       int row,
                       int column)
Specified by:
setValueAt in interface TableModel
Overrides:
setValueAt in class AbstractTableModel

isCellEditable

public boolean isCellEditable(int row,
                              int column)
Specified by:
isCellEditable in interface TableModel
Overrides:
isCellEditable in class AbstractTableModel

JComponentPack 1.5.0

Send your Feedback
JComponentPack 1.5.0
Copyright © 2001-2007 Extreme Component, Inc. All rights reserved.