Class TreeTableModelAdapter
- java.lang.Object
-
- javax.swing.table.AbstractTableModel
-
- com.puppycrawl.tools.checkstyle.gui.TreeTableModelAdapter
-
- All Implemented Interfaces:
Serializable
,TableModel
public class TreeTableModelAdapter extends AbstractTableModel
This is a wrapper class takes a TreeTableModel and implements the table model interface. The implementation is trivial, with all the event dispatching support provided by the superclass: the AbstractTableModel. Original Source Location- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private class
TreeTableModelAdapter.UpdatingTreeExpansionListener
TreeExpansionListener that can update the table when tree changes.private class
TreeTableModelAdapter.UpdatingTreeModelListener
TreeModelListener that can update the table when tree changes.
-
Field Summary
Fields Modifier and Type Field Description private static long
serialVersionUID
A unique serial version identifier.private JTree
tree
JTree component.private ParseTreeTableModel
treeTableModel
Tree table model.-
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
-
-
Constructor Summary
Constructors Constructor Description TreeTableModelAdapter(ParseTreeTableModel treeTableModel, JTree tree)
Initialise tree and treeTableModel class attributes.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Class<?>
getColumnClass(int column)
int
getColumnCount()
String
getColumnName(int column)
int
getRowCount()
Object
getValueAt(int row, int column)
boolean
isCellEditable(int row, int column)
private Object
nodeForRow(int row)
Finds node for a given row.-
Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, getTableModelListeners, removeTableModelListener, setValueAt
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
A unique serial version identifier.- See Also:
- Constant Field Values
-
treeTableModel
private final transient ParseTreeTableModel treeTableModel
Tree table model.
-
-
Constructor Detail
-
TreeTableModelAdapter
public TreeTableModelAdapter(ParseTreeTableModel treeTableModel, JTree tree)
Initialise tree and treeTableModel class attributes.- Parameters:
treeTableModel
- Tree table model.tree
- JTree component.
-
-
Method Detail
-
getColumnCount
public int getColumnCount()
-
getColumnName
public String getColumnName(int column)
- Specified by:
getColumnName
in interfaceTableModel
- Overrides:
getColumnName
in classAbstractTableModel
-
getColumnClass
public Class<?> getColumnClass(int column)
- Specified by:
getColumnClass
in interfaceTableModel
- Overrides:
getColumnClass
in classAbstractTableModel
-
getRowCount
public int getRowCount()
-
getValueAt
public Object getValueAt(int row, int column)
-
isCellEditable
public boolean isCellEditable(int row, int column)
- Specified by:
isCellEditable
in interfaceTableModel
- Overrides:
isCellEditable
in classAbstractTableModel
-
nodeForRow
private Object nodeForRow(int row)
Finds node for a given row.- Parameters:
row
- Row for which to find a related node.- Returns:
- Node for a given row.
-
-