public abstract class AbstractTreeTableModel extends DefaultTableModel implements TreeTableModel
Modifier and Type | Field and Description |
---|---|
protected List<Class<?>> |
classes |
protected List<String> |
headers |
protected EventListenerList |
listener |
protected List<Object> |
objects |
protected List<Functor> |
readFunctors |
protected TreeNode |
rootNode |
protected List<Functor> |
writeFunctors |
columnIdentifiers, dataVector
listenerList
Constructor and Description |
---|
AbstractTreeTableModel(String[] headers,
Functor[] readFunctors,
Functor[] writeFunctors,
Class<?>[] editorClasses) |
AbstractTreeTableModel(TreeNode root) |
Modifier and Type | Method and Description |
---|---|
void |
addTableModelListener(TableModelListener l) |
void |
clearData() |
void |
fireTreeNodesChanged(TreeNode source,
Object[] path,
int[] indexes,
Object[] children) |
Object |
getChild(Object parent,
int index) |
int |
getChildCount(Object parent) |
Class<?> |
getColumnClass(int arg0) |
int |
getColumnCount()
The implementation is exactly the same as ObjectTableModel.getColumnCount.
|
String |
getColumnName(int columnIndex) |
Object |
getRootNode()
The root node for the TreeTable
|
int |
getRowCount()
The implementation is exactly the same as ObjectTableModel.getRowCount.
|
Object |
getValueAt(int rowIndex,
int columnIndex)
Subclasses need to implement the logic for the method and
return the value at the specific cell.
|
Object |
getValueAt(Object node,
int col)
The method is similar to getValueAt(int,int).
|
boolean |
isCellEditable(int rowIndex,
int columnIndex)
By default the abstract class returns true.
|
boolean |
isCellEditable(Object node,
int col)
the method is similar to isCellEditable(int,int).
|
boolean |
isLeaf(Object node)
the implementation checks if the Object is a treenode.
|
void |
nodeStructureChanged(TreeNode node) |
void |
removeTableModelListener(TableModelListener l) |
void |
setValueAt(Object aValue,
int rowIndex,
int columnIndex) |
void |
setValueAt(Object val,
Object node,
int column)
the method is similar to isCellEditable(int,int).
|
addColumn, addColumn, addColumn, addRow, addRow, convertToVector, convertToVector, getDataVector, insertRow, insertRow, moveRow, newDataAvailable, newRowsAdded, removeRow, rowsRemoved, setColumnCount, setColumnIdentifiers, setColumnIdentifiers, setDataVector, setDataVector, setNumRows, setRowCount
findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, getTableModelListeners
protected final TreeNode rootNode
protected final EventListenerList listener
public AbstractTreeTableModel(TreeNode root)
public Object getRootNode()
public Object getValueAt(Object node, int col)
getValueAt
in interface TreeTableModel
node
- the node which value is to be fetchedcol
- the column of the nodepublic boolean isCellEditable(Object node, int col)
isCellEditable
in interface TreeTableModel
node
- the node which value is to be fetchedcol
- the column of the nodetrue
if cell is editablepublic void setValueAt(Object val, Object node, int column)
setValueAt
in interface TreeTableModel
val
- the value to be setnode
- the node which value is to be setcolumn
- the column of the nodepublic int getColumnCount()
getColumnCount
in interface TableModel
getColumnCount
in class DefaultTableModel
public int getRowCount()
getRowCount
in interface TableModel
getRowCount
in class DefaultTableModel
public boolean isCellEditable(int rowIndex, int columnIndex)
isCellEditable
in interface TableModel
isCellEditable
in class DefaultTableModel
public Class<?> getColumnClass(int arg0)
getColumnClass
in interface TableModel
getColumnClass
in class AbstractTableModel
public Object getValueAt(int rowIndex, int columnIndex)
getValueAt
in interface TableModel
getValueAt
in class DefaultTableModel
public void setValueAt(Object aValue, int rowIndex, int columnIndex)
setValueAt
in interface TableModel
setValueAt
in class DefaultTableModel
public String getColumnName(int columnIndex)
getColumnName
in interface TableModel
getColumnName
in class DefaultTableModel
public int getChildCount(Object parent)
public boolean isLeaf(Object node)
isLeaf()
, otherwise it returns
false
.node
- object to be checked for isLeaf()
true
if object is a leaf node, false
otherwisepublic void addTableModelListener(TableModelListener l)
addTableModelListener
in interface TableModel
addTableModelListener
in class AbstractTableModel
public void removeTableModelListener(TableModelListener l)
removeTableModelListener
in interface TableModel
removeTableModelListener
in class AbstractTableModel
public void nodeStructureChanged(TreeNode node)
public void fireTreeNodesChanged(TreeNode source, Object[] path, int[] indexes, Object[] children)
public void clearData()
Copyright © 1998-2019 Apache Software Foundation. All Rights Reserved.