|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjavax.swing.table.AbstractTableModel
com.mucommander.ui.main.table.FileTableModel
public class FileTableModel
This class maps table cells onto file attributes.
| Field Summary | |
|---|---|
static ConfigurationListener |
CONFIGURATION_ADAPTER
Listens to configuration changes and updates static fields accordingly |
static java.lang.String |
DIRECTORY_SIZE_STRING
String used as size information for directories |
| Fields inherited from class javax.swing.table.AbstractTableModel |
|---|
listenerList |
| Constructor Summary | |
|---|---|
FileTableModel()
Creates a new FileTableModel, without any initial current folder. |
|
| Method Summary | |
|---|---|
AbstractFile |
getCachedFileAtRow(int rowIndex)
Returns a CachedFile instance of the file located at the given row index. |
AbstractFile[] |
getCachedFiles()
Returns the current folder's children. |
int |
getColumnCount()
|
java.lang.String |
getColumnName(int columnIndex)
|
AbstractFile |
getCurrentFolder()
Returns the current folder, i.e. |
long |
getCurrentFolderDateSnapshot()
Returns the date of the current folder, when it was set using setCurrentFolder(com.mucommander.file.AbstractFile, com.mucommander.file.AbstractFile[]). |
AbstractFile |
getFileAt(int fileIndex)
Returns the file located at the given index, not including the parent file. |
AbstractFile |
getFileAtRow(int rowIndex)
Returns the file located at the given row index. |
int |
getFileCount()
Returns the actual number of files the current folder contains, excluding the parent '..' file (if any). |
int |
getFileRow(AbstractFile file)
Returns the index of the row where the given file is located, -1 |
AbstractFile[] |
getFiles()
Returns the current folder's children. |
FileSet |
getMarkedFiles()
Returns a FileSet with all currently marked files. |
FileSet |
getMarkedFiles(boolean cloneFileSet)
Same usage as getMarkedFiles() except that it can be specified whether the returned
FileSet should be cloned or not. |
int |
getNbMarkedFiles()
Returns the number of marked files. |
AbstractFile |
getParentFolder()
Returns the current folder's parent if there is one, null otherwise. |
int |
getRowCount()
Returns the total number of rows, including the special parent folder file '..', if there is one. |
long |
getTotalMarkedSize()
Returns the combined size of marked files. |
java.lang.Object |
getValueAt(int rowIndex,
int columnIndex)
|
boolean |
hasParentFolder()
Returns true if the current folder has a parent. |
boolean |
isCellEditable(int rowIndex,
int columnIndex)
Returns true if name column has temporarily be made editable by FileTable
and given row doesn't correspond to parent file '..', false otherwise. |
boolean |
isRowMarked(int row)
Returns true if the given row is marked (/!\ not selected). |
void |
setFileMarked(AbstractFile file,
boolean marked)
Marks/Unmarks the given file. |
void |
setFilesMarked(FileFilter filter,
boolean marked)
Marks/unmarks the files that match the given FileFilter. |
void |
setRangeMarked(int startRow,
int endRow,
boolean marked)
Marks/unmarks the given row range, delimited by the provided start row index and end row index (inclusive). |
void |
setRowMarked(int row,
boolean marked)
Marks/Unmarks the given row. |
| Methods inherited from class javax.swing.table.AbstractTableModel |
|---|
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getColumnClass, getListeners, getTableModelListeners, removeTableModelListener, setValueAt |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String DIRECTORY_SIZE_STRING
public static final ConfigurationListener CONFIGURATION_ADAPTER
| Constructor Detail |
|---|
public FileTableModel()
| Method Detail |
|---|
public AbstractFile getCurrentFolder()
setCurrentFolder(com.mucommander.file.AbstractFile, com.mucommander.file.AbstractFile[]).
public long getCurrentFolderDateSnapshot()
setCurrentFolder(com.mucommander.file.AbstractFile, com.mucommander.file.AbstractFile[]).
In other words, the returned date is a snapshot of the current folder's date which is never updated.
public boolean hasParentFolder()
true if the current folder has a parent.
true if the current folder has a parentpublic AbstractFile getParentFolder()
null otherwise.
null otherwisepublic AbstractFile getCachedFileAtRow(int rowIndex)
Returns null if rowIndex is lower than 0 or is greater than or equals
getRowCount().
rowIndex - a row index, comprised between 0 and #getRowCount()
public AbstractFile[] getCachedFiles()
CachedFile instances, where
most attributes have already been fetched and cached.
getFiles()public AbstractFile getFileAtRow(int rowIndex)
Returns null if rowIndex is lower than 0 or is greater than or equals
getRowCount().
rowIndex - a row index, comprised between 0 and #getRowCount()
public AbstractFile[] getFiles()
AbstractFile instances, and not
CachedFile instances contrary to getCachedFiles().
getCachedFiles()public int getFileRow(AbstractFile file)
-1 if the file is not in the
current folder.
- Parameters:
file - the file for which to find the row index
- Returns:
- the index of the row where the given file is located,
-1 if the file is not in the
current folder
public AbstractFile getFileAt(int fileIndex)
null if fileIndex is lower than 0 or is greater than or equals getFileCount().
fileIndex - index of a file, comprised between 0 and #getFileCount()
public int getFileCount()
public boolean isRowMarked(int row)
true if the given row is marked (/!\ not selected). If the specified row corresponds to the
special '..' parent file, false is always returned.
row - index of a row to test
true if the given row is marked
public void setRowMarked(int row,
boolean marked)
row - the row to mark/unmarkmarked - true to mark the row, false to unmark it
public void setRangeMarked(int startRow,
int endRow,
boolean marked)
startRow - index of the first row to mark/unmarkendRow - index of the last row to mark/ummark, startRow may be less or greater than startRowmarked - if true, all the rows within the range will be marked, unmarked otherwise
public void setFileMarked(AbstractFile file,
boolean marked)
file - the file to mark/unmarkmarked - true to mark the row, false to unmark it.
public void setFilesMarked(FileFilter filter,
boolean marked)
FileFilter.
filter - the FileFilter to match the files againstmarked - if true, matching files will be marked, if false, they will be unmarkedpublic FileSet getMarkedFiles()
FileSet with all currently marked files.
The returned FileSet is a clone of the internal FileSet, so it can be safely modified.
However, it won't be kept current : the returned FileSet is just a snapshot which might not reflect the current marked files state after this method has returned and additional files have been marked/unmarked.
public FileSet getMarkedFiles(boolean cloneFileSet)
getMarkedFiles() except that it can be specified whether the returned
FileSet should be cloned or not.
Not cloning the FileSet can be used for efficiency reasons when the FileSet is only accessed, but great precaution must be taken to ensure that the FileSet is never modified.
cloneFileSet - specifies whether the internal marked files FileSet should be cloned or not
public int getNbMarkedFiles()
public long getTotalMarkedSize()
public int getColumnCount()
public java.lang.String getColumnName(int columnIndex)
getColumnName in interface javax.swing.table.TableModelgetColumnName in class javax.swing.table.AbstractTableModelpublic int getRowCount()
public java.lang.Object getValueAt(int rowIndex,
int columnIndex)
public boolean isCellEditable(int rowIndex,
int columnIndex)
true if name column has temporarily be made editable by FileTable
and given row doesn't correspond to parent file '..', false otherwise.
isCellEditable in interface javax.swing.table.TableModelisCellEditable in class javax.swing.table.AbstractTableModel
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
This file is part of muCommander - Copyright (C) 2002-2008 Maxence Bernard