Package jadex.commons.gui.jtreetable
Class DefaultTreeTableModel
- java.lang.Object
-
- jadex.commons.gui.jtreetable.AbstractTreeTableModel
-
- jadex.commons.gui.jtreetable.DefaultTreeTableModel
-
- All Implemented Interfaces:
TreeTableModel
,javax.swing.tree.TreeModel
public class DefaultTreeTableModel extends AbstractTreeTableModel
Default implementation of the TreeTableModel interface.
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.String[]
columns
The column names.protected boolean[]
editable
The editable columns.protected TreeTableNode
root
The root node.-
Fields inherited from class jadex.commons.gui.jtreetable.AbstractTreeTableModel
listenerList
-
-
Constructor Summary
Constructors Constructor Description DefaultTreeTableModel(TreeTableNode root, java.lang.String[] columns)
Create a new tree table model with the given root node and column names.DefaultTreeTableModel(TreeTableNode root, java.lang.String[] columns, boolean[] editable)
Create a new tree table model with the given root node and column names.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Object
getChild(java.lang.Object node, int index)
Get a child of a node.int
getChildCount(java.lang.Object node)
Get the number of children of a node.java.lang.Class
getColumnClass(int column)
Get the class of a column.int
getColumnCount()
Get the number of columns.java.lang.String
getColumnName(int column)
Get the name of a column.java.lang.Object
getValueAt(java.lang.Object node, int column)
Get the number of children of a node.boolean
isCellEditable(java.lang.Object node, int column)
Test if a cell is editable-
Methods inherited from class jadex.commons.gui.jtreetable.AbstractTreeTableModel
addTreeModelListener, fireTreeNodesChanged, fireTreeNodesInserted, fireTreeNodesRemoved, fireTreeStructureChanged, getIndexOfChild, getPathToRoot, getPathToRoot, getRoot, isLeaf, reload, removeTreeModelListener, setValueAt, valueForPathChanged
-
-
-
-
Field Detail
-
root
protected TreeTableNode root
The root node.
-
columns
protected java.lang.String[] columns
The column names.
-
editable
protected boolean[] editable
The editable columns.
-
-
Constructor Detail
-
DefaultTreeTableModel
public DefaultTreeTableModel(TreeTableNode root, java.lang.String[] columns)
Create a new tree table model with the given root node and column names.- Parameters:
root
- The root node.columns
- The column names.
-
DefaultTreeTableModel
public DefaultTreeTableModel(TreeTableNode root, java.lang.String[] columns, boolean[] editable)
Create a new tree table model with the given root node and column names.- Parameters:
root
- The root node.columns
- The column names.editable
- The editable columns.
-
-
Method Detail
-
getColumnClass
public java.lang.Class getColumnClass(int column)
Get the class of a column.- Specified by:
getColumnClass
in interfaceTreeTableModel
- Overrides:
getColumnClass
in classAbstractTreeTableModel
- Parameters:
column
- The column.- Returns:
- The class.
-
getChild
public java.lang.Object getChild(java.lang.Object node, int index)
Get a child of a node.- Parameters:
node
- The node.index
- The index of the child.- Returns:
- The child at the specified index.
-
getChildCount
public int getChildCount(java.lang.Object node)
Get the number of children of a node.- Parameters:
node
- The node.- Returns:
- The number of children of a node.
-
getValueAt
public java.lang.Object getValueAt(java.lang.Object node, int column)
Get the number of children of a node.- Parameters:
node
- The node.column
- The column.- Returns:
- The node's value at the specified column.
-
getColumnCount
public int getColumnCount()
Get the number of columns.- Returns:
- The number of columns.
-
getColumnName
public java.lang.String getColumnName(int column)
Get the name of a column.- Parameters:
column
- The column.- Returns:
- The name of the column.
-
isCellEditable
public boolean isCellEditable(java.lang.Object node, int column)
Test if a cell is editable- Specified by:
isCellEditable
in interfaceTreeTableModel
- Overrides:
isCellEditable
in classAbstractTreeTableModel
-
-