com.alee.extended.filechooser
Class WebFileTableModel

java.lang.Object
  extended by javax.swing.table.AbstractTableModel
      extended by com.alee.extended.filechooser.WebFileTableModel
All Implemented Interfaces:
WebFileTableColumns, java.io.Serializable, javax.swing.table.TableModel

public class WebFileTableModel
extends javax.swing.table.AbstractTableModel
implements WebFileTableColumns

Data model for WebFileTable.

Author:
Mikle Garin
See Also:
Serialized Form

Field Summary
 
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
 
Fields inherited from interface com.alee.extended.filechooser.WebFileTableColumns
COLUMN_PREFIX, CREATION_DATE_COLUMN, DEFAULT_COLUMNS, EXTENSION_COLUMN, MODIFICATION_DATE_COLUMN, NAME_COLUMN, NUMBER_COLUMN, SIZE_COLUMN
 
Constructor Summary
WebFileTableModel()
          Constructs empty model with default displayed columns.
WebFileTableModel(java.util.Collection<java.io.File> files, java.util.List<java.lang.String> columns)
          Constructs model with specified displayed columns and files.
WebFileTableModel(java.util.Collection<java.io.File> files, java.lang.String... columns)
          Constructs model with specified displayed columns and files.
WebFileTableModel(java.util.List<java.lang.String> columns)
          Constructs empty model with specified displayed columns.
WebFileTableModel(java.lang.String... columns)
          Constructs empty model with specified displayed columns.
 
Method Summary
 void addFiles(java.util.Collection<java.io.File> files)
          Adds displayed files.
 java.lang.Class<?> getColumnClass(int columnIndex)
          
 int getColumnCount()
          
 java.lang.String getColumnId(int column)
          Returns column id at the specified index.
 int getColumnIndex(java.lang.String column)
          Returns index of the specified column.
 java.lang.String getColumnName(int column)
          
 java.io.File getFileAtRow(int row)
          Returns file for the specified row.
 int getFileRow(java.io.File file)
          Returns index of row with the specified file.
 int getRowCount()
          
 java.lang.Object getValueAt(int rowIndex, int columnIndex)
          
 boolean isCellEditable(int rowIndex, int columnIndex)
          
 boolean isColumnDisplayed(java.lang.String column)
          Returns whether the specified column is displayed or not.
 void setColumns(java.util.List<java.lang.String> columns)
          Sets displayed column ids list.
 void setFiles(java.util.Collection<java.io.File> files)
          Sets displayed files.
 void setValueAt(java.lang.Object aValue, int rowIndex, int columnIndex)
          
 
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

WebFileTableModel

public WebFileTableModel()
Constructs empty model with default displayed columns.


WebFileTableModel

public WebFileTableModel(java.lang.String... columns)
Constructs empty model with specified displayed columns.

Parameters:
columns - columns to display

WebFileTableModel

public WebFileTableModel(java.util.List<java.lang.String> columns)
Constructs empty model with specified displayed columns.

Parameters:
columns - columns to display

WebFileTableModel

public WebFileTableModel(java.util.Collection<java.io.File> files,
                         java.lang.String... columns)
Constructs model with specified displayed columns and files.

Parameters:
files - files to display
columns - columns to display

WebFileTableModel

public WebFileTableModel(java.util.Collection<java.io.File> files,
                         java.util.List<java.lang.String> columns)
Constructs model with specified displayed columns and files.

Parameters:
files - files to display
columns - columns to display
Method Detail

setFiles

public void setFiles(java.util.Collection<java.io.File> files)
Sets displayed files.

Parameters:
files - files to display

addFiles

public void addFiles(java.util.Collection<java.io.File> files)
Adds displayed files.

Parameters:
files - files to display

getFileRow

public int getFileRow(java.io.File file)
Returns index of row with the specified file.

Parameters:
file - file to find
Returns:
index of row with the specified file

getFileAtRow

public java.io.File getFileAtRow(int row)
Returns file for the specified row.

Parameters:
row - row to process
Returns:
file for the specified row

setColumns

public void setColumns(java.util.List<java.lang.String> columns)
Sets displayed column ids list.

Parameters:
columns - displayed column ids list

getColumnId

public java.lang.String getColumnId(int column)
Returns column id at the specified index.

Parameters:
column - column index
Returns:
column id at the specified index

isColumnDisplayed

public boolean isColumnDisplayed(java.lang.String column)
Returns whether the specified column is displayed or not.

Parameters:
column - column to process
Returns:
true if the specified column is displayed, false otherwise

getColumnIndex

public int getColumnIndex(java.lang.String column)
Returns index of the specified column.

Parameters:
column - column to process
Returns:
index of the specified column

getColumnName

public java.lang.String getColumnName(int column)

Specified by:
getColumnName in interface javax.swing.table.TableModel
Overrides:
getColumnName in class javax.swing.table.AbstractTableModel

getRowCount

public int getRowCount()

Specified by:
getRowCount in interface javax.swing.table.TableModel

getColumnCount

public int getColumnCount()

Specified by:
getColumnCount in interface javax.swing.table.TableModel

getValueAt

public java.lang.Object getValueAt(int rowIndex,
                                   int columnIndex)

Specified by:
getValueAt in interface javax.swing.table.TableModel

setValueAt

public void setValueAt(java.lang.Object aValue,
                       int rowIndex,
                       int columnIndex)

Specified by:
setValueAt in interface javax.swing.table.TableModel
Overrides:
setValueAt in class javax.swing.table.AbstractTableModel

getColumnClass

public java.lang.Class<?> getColumnClass(int columnIndex)

Specified by:
getColumnClass in interface javax.swing.table.TableModel
Overrides:
getColumnClass in class javax.swing.table.AbstractTableModel

isCellEditable

public boolean isCellEditable(int rowIndex,
                              int columnIndex)

Specified by:
isCellEditable in interface javax.swing.table.TableModel
Overrides:
isCellEditable in class javax.swing.table.AbstractTableModel