6e said:
I was wondering if anyone has used this treetable before, and may be
able to give me some guidance as far as creating a TreeTableModel
without use of a filesystem
for instance I want to create a hierarchial browsing system for rows of
editable information...
You might want to take a look at the implementation of the
AbstractTreeTableModel, and the classes it inherits from in the
WebScarab source. It is available in the CVS repository of the OWASP
project on sourceforge.
<
http://cvs.sourceforge.net/viewcvs....stractTreeTableModel.java?rev=1.4&view=markup>
This implementation is not editable, but you would easily be able to
make it editable, I reckon, by overriding the methods shown below.
Rogan
P.S. You would basically have to override or implement the following
methods:
// Left to be implemented in the subclass:
/* From TreeModel
* public Object getRoot()
* public Object getChild(Object parent, int index)
* public int getChildCount(Object parent)
* public boolean isLeaf(Object node)
*
* From TreeTableModel
* public int getColumnCount()
* public String getColumnName(Object node, int column)
* public Object getValueAt(Object node, int column)
*/
public boolean isCellEditable(Object node, int column) {
return getColumnClass(column) == TreeTableModel.class;
}
public void setValueAt(Object aValue, Object node, int column) {}