public class FileDataTreeViewModel extends MyAbstractTreeTableModel<TreeFileDataNode>
absoluteRoot, listenerList, visibleRoot
Constructor and Description |
---|
FileDataTreeViewModel(UploadPolicy uploadPolicy,
FilePanelFlatDataModel2 flatModel) |
Modifier and Type | Method and Description |
---|---|
int |
attachObject(Object o)
This method searches in the hierarchy of files and folder to upload, the node which contains this file.
|
Class<?> |
getColumnClass(int column)
Returns the type (class) of a column.
|
int |
getColumnCount()
Returns the number of available columns.
|
String |
getColumnName(int column)
Returns the column name.
|
int |
getColumnSizePercentage(int col)
Retrieves the default colum percentage size of a column, that is: its percentage of the available width.
|
TreePath |
getTreePathForObject(Object o)
Get the
TreePath for the given object. |
TreePath |
getTreePathFromFile(File file,
boolean createIntermediateNode)
|
Object |
getValueAt(TreeFileDataNode node,
int column)
Returns the value of a node in a column.
|
boolean |
isCellEditable(TreeFileDataNode node,
int column)
Check if a cell of a node in one column is editable.
|
void |
setValueAt(Object aValue,
TreeFileDataNode node,
int col)
Sets a value for a node in one column.
|
addTreeModelListener, cleanHierarchy, cleanHierarchy, fireTreeNodesChanged, fireTreeNodesInserted, fireTreeNodesRemoved, fireTreeStructureChanged, getAbsoluteRoot, getChild, getChildCount, getIndexOfChild, getRoot, getTree, getTreePath, isLeaf, reload, reload, remove, removeAndClean, removeTreeModelListener, setRoot, setTree, valueForPathChanged
public FileDataTreeViewModel(UploadPolicy uploadPolicy, FilePanelFlatDataModel2 flatModel)
public int getColumnCount()
public String getColumnName(int column)
column
- Column numberpublic int getColumnSizePercentage(int col)
col
- The index of the column to query.public Class<?> getColumnClass(int column)
column
- Column numberpublic Object getValueAt(TreeFileDataNode node, int column)
getValueAt
in interface MyTreeTableModel<TreeFileDataNode>
getValueAt
in class MyAbstractTreeTableModel<TreeFileDataNode>
node
- Nodecolumn
- Column numberpublic boolean isCellEditable(TreeFileDataNode node, int column)
MyTreeTableModel
node
- Nodecolumn
- Column numberTableModel.isCellEditable(int, int)
public void setValueAt(Object aValue, TreeFileDataNode node, int col)
MyTreeTableModel
aValue
- New valuenode
- Nodecol
- Column numberTableModel.setValueAt(Object, int, int)
public TreePath getTreePathFromFile(File file, boolean createIntermediateNode) throws JUploadExceptionStopAddingFiles
TreePath
for the given File
. This TreePath is basically the array of
TreeFileDataNode
, representing the given file. the root path if the filename for the RootNode
,
that is: the empty String: ""fileRoot
- The File we want the path for. It may be the root, a folder, leaf... If the given file is null,
the returned TreePath
is a one level TreePath
, containing only the absolute root of
the tree view.createIntermediateNode
- If true, all missing intermediate nodes are created. If false, no node are created.
In this last case, the returned TreePath
is null, if one or mode nodes are missing.JUploadExceptionStopAddingFiles
public int attachObject(Object o) throws NullPointerException, IllegalArgumentException, JUploadExceptionStopAddingFiles
o
- A File or Folder. If o is a file, it will just be added. If o is a folder, it will be added, including
all its content (child, grand-child...)JUploadExceptionStopAddingFiles
- When an exception occursNullPointerException
- When o is nullIllegalArgumentException
- When o is not a File
MyAbstractTreeTableModel
public TreePath getTreePathForObject(Object o)
TreePath
for the given object. This method is optional. It is typically only applicable if this
hierarchy maps on another hierarchy (for instance a hierarchy of files, based on a local file system)Copyright © 2015. All rights reserved.