JClass DesktopViews 6.3.0 API
Documentation

com.klg.jclass.util.treetable
Interface JCTreeTableModel

All Superinterfaces:
TreeModel
All Known Implementing Classes:
EmptyTreeTableModel, TreeWithSortableChildren

public interface JCTreeTableModel
extends TreeModel

Model that provides a tree and treetable interface. Note that specific implementations need to implement javax.swing.table.TableModel and javax.swing.tree.TreeModel for them to work properly.

This interface requires that some of the TableModel's methods be implemented. If the implementor of this model wishes the JCTreeTable component to be able to switch dynamically to a full table view of the data then they should complete the implementation of the TableModel as well as specifying that the class also implements it.

For reference, the methods needed to complete a TableModel implementation are:

   public int getRowCount();
   public Object getValueAt(int row, int column);
   public boolean isCellEditable(int row, int column);
   public void addTableModelListener(TableModelListener l);
   public void removeTableModelListener(TableModelListener l);
   public void setValueAt(Object value, int row, int column);
 


Method Summary
 Class getColumnClass(int column)
          Returns a class used to determine a renderer and editor for all the cell values in the column.
 int getColumnCount()
          Returns the number of columns in the model.
 String getColumnName(int column)
          The name of the column at the specified column index.
 Object getValueAt(Object node, int column)
          Returns the value of the specific node and column.
 boolean isCellEditable(Object node, int column)
          Returns whether a particular cell is editable given the node and column.
 void setValueAt(Object value, Object node, int column)
          Sets the value in the cell corresponding to the node and the column to the given value.
 
Methods inherited from interface javax.swing.tree.TreeModel
addTreeModelListener, getChild, getChildCount, getIndexOfChild, getRoot, isLeaf, removeTreeModelListener, valueForPathChanged
 

Method Detail

getValueAt

public Object getValueAt(Object node,
                         int column)
Returns the value of the specific node and column.

Parameters:
node - the node to be queried
column - the index of the column
Returns:
the value at the given node and column
See Also:
setValueAt(java.lang.Object, java.lang.Object, int)

isCellEditable

public boolean isCellEditable(Object node,
                              int column)
Returns whether a particular cell is editable given the node and column.

Parameters:
node - the node to be checked for editabiltily
column - the index of the column
Returns:
whether the cell at the given node and column is editable
See Also:
setValueAt(java.lang.Object, java.lang.Object, int)

setValueAt

public void setValueAt(Object value,
                       Object node,
                       int column)
Sets the value in the cell corresponding to the node and the column to the given value.

Parameters:
value - the new value
node - the node whose value is to be changed
column - the column whose value is to be changed
See Also:
getValueAt(java.lang.Object, int), isCellEditable(java.lang.Object, int)

getColumnClass

public Class getColumnClass(int column)
Returns a class used to determine a renderer and editor for all the cell values in the column.

Parameters:
column - the index of the column
Returns:
the class used to determine a renderer and editor for the column

getColumnCount

public int getColumnCount()
Returns the number of columns in the model.

Returns:
the current number of columns

getColumnName

public String getColumnName(int column)
The name of the column at the specified column index.

Parameters:
column - the index of the column whose name is required
Returns:
the name of the column at the given column index

Copyright © 2004 Quest Software Inc..
All rights reserved.