|
SPT Core API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnextapp.echo.app.table.AbstractTableModel
com.sptci.echo.table.AbstractTableModel<D>
com.sptci.echo.table.TableModel<D>
com.sptci.echo.table.DefaultPageableTableModel<File>
com.sptci.echo.tree.filesystem.DirectoryTableModel
public class DirectoryTableModel
A table model that represents all the files under a directory.
The following keys must be configured in the localisation files for the column names:
com.sptci.echo.tree.filesystem.DirectoryTableModel.column.name
- The column in which the file name is displayed.com.sptci.echo.tree.filesystem.DirectoryTableModel.column.size
- The column in which the file size is displayed.com.sptci.echo.tree.filesystem.DirectoryTableModel.column.modified
- The column in which the file last modification time is displayed.com.sptci.echo.tree.filesystem.DirectoryTableModel.column.type
- The column in which the file type is displayed.© Copyright 2009 Sans Pareil Technologies, Inc.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface com.sptci.echo.table.SortableTableModel |
|---|
SortableTableModel.Direction |
| Field Summary | |
|---|---|
protected static String[] |
columnNames
The array of column name keys for the model. |
protected SimpleDateFormat |
dateFormat
The date formatter used to format the file last modification time. |
protected File |
directory
The directory whose contents are being displayed in the model. |
| Fields inherited from class com.sptci.echo.table.DefaultPageableTableModel |
|---|
page, pageSize, totalRows |
| Fields inherited from class com.sptci.echo.table.TableModel |
|---|
columns, data |
| Fields inherited from class com.sptci.echo.table.AbstractTableModel |
|---|
sortDirection, sortIndex |
| Constructor Summary | |
|---|---|
DirectoryTableModel(File directory)
Create a new model for the specified directory. |
|
| Method Summary | |
|---|---|
Class |
getColumnClass(int column)
Over-ridden to always return String.class. |
int |
getColumnCount()
Returns the number of columns displayed in the table. |
String |
getColumnName(int column)
Returns the name of the specified column. |
File |
getDirectory()
|
SortableTableModel.Direction |
getSortDirection(int column)
Return the sort direction for the specified column. |
Object |
getValueAt(int column,
int row)
Return the value at the specified coordinate in the table. |
void |
init()
Over-ridden to do nothing as no processing is required. |
void |
setDirectory(File directory)
Set the directory to display in this model. |
void |
setPage(int page)
Set the page currently displayed in the model. |
void |
setPageSize(int pageSize)
Set the number of rows to display in a page. |
void |
sort(int column)
Sort the data by the values in the specified column index. |
void |
sort(int column,
SortableTableModel.Direction direction)
Sort the data by the values in the specified column index. |
| Methods inherited from class com.sptci.echo.table.DefaultPageableTableModel |
|---|
getPage, getPageSize, getTotalPages, setPageSize |
| Methods inherited from class com.sptci.echo.table.TableModel |
|---|
addRow, deleteRow, deleteRow, getColumnAnnotations, getObjectAt, getRowCount, insertRow, processColumnAnnotations, processColumns, processColumnsAnnotation, processFields, updateRow |
| Methods inherited from class nextapp.echo.app.table.AbstractTableModel |
|---|
addTableModelListener, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getEventListenerList, removeTableModelListener |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static final String[] columnNames
protected File directory
protected SimpleDateFormat dateFormat
| Constructor Detail |
|---|
public DirectoryTableModel(File directory)
directory - The directory whose contents are to be displayed.| Method Detail |
|---|
public SortableTableModel.Direction getSortDirection(int column)
getSortDirection in interface SortableTableModelgetSortDirection in class AbstractTableModel<File>column - The column whose sort direction is to be returned.
null if
no sort directive is available.public void sort(int column)
SortableTableModel.Direction of sorting is inferred from the current sort order.
sort in interface SortableTableModelcolumn - The index of the column by which the data is to
be sorted.AbstractTableModel.fireTableDataChanged()
public void sort(int column,
SortableTableModel.Direction direction)
sort in interface SortableTableModelcolumn - The index of the column by which the data is to
be sorted.direction - The direction in which the data is to be sorted.AbstractTableModel.fireTableDataChanged()public void setPage(int page)
setPage in interface PageableTableModelpage - The page to be displayed.public void setPageSize(int pageSize)
setPageSize in interface PageableTableModelpageSize - The number of rows to display in a page.public File getDirectory()
public int getColumnCount()
getColumnCount in interface TableModelgetColumnCount in class TableModel<File>TableModel.getColumnCount()public String getColumnName(int column)
<D.class.getName()>.<fieldName>.heading
and if found returns the localised value.
getColumnName in interface TableModelgetColumnName in class TableModel<File>column - The index of the column whose name is to be returned.
TableModel.getColumnName(int)
public Object getValueAt(int column,
int row)
throws IllegalArgumentException
TableModelLevel.SEVERE message with stack trace is logged.
Throwing a RuntimeException results in Echo
framework handling it improperly and ultimately killing the user
session with a unrelated message.
getValueAt in interface TableModelgetValueAt in class TableModel<File>column - The column index.row - The row index.
IllegalArgumentException - If column or
row indices are invalid for this model.TableModel.getValueAt(int, int)public Class getColumnClass(int column)
String.class.
Returns the class of the objects displayed in the specified column.
getColumnClass in interface TableModelgetColumnClass in class TableModel<File>column - The column whose class is to be returned.
TableModel.getColumnClass(int)public void init()
init in class DefaultPageableTableModel<File>TableModel.processColumns()public void setDirectory(File directory)
directory - The directory to use as the backing model.
|
SPT Core API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||