com.puppycrawl.tools.checkstyle.gui
Class AbstractTreeTableModel

java.lang.Object
  extended by com.puppycrawl.tools.checkstyle.gui.AbstractTreeTableModel
All Implemented Interfaces:
TreeTableModel, TreeModel
Direct Known Subclasses:
ParseTreeModel

public abstract class AbstractTreeTableModel
extends Object
implements TreeTableModel

An abstract implementation of the TreeTableModel interface, handling the list of listeners. Original Source Location

Author:
Philip Milne

Constructor Summary
AbstractTreeTableModel(Object root)
           
 
Method Summary
 void addTreeModelListener(TreeModelListener l)
           
protected  void fireTreeNodesChanged(Object source, Object[] path, int[] childIndices, Object[] children)
           
protected  void fireTreeNodesInserted(Object source, Object[] path, int[] childIndices, Object[] children)
           
protected  void fireTreeNodesRemoved(Object source, Object[] path, int[] childIndices, Object[] children)
           
protected  void fireTreeStructureChanged(Object source, Object[] path, int[] childIndices, Object[] children)
           
 Class<?> getColumnClass(int column)
           
 int getIndexOfChild(Object parent, Object child)
           
 Object getRoot()
           
 boolean isCellEditable(Object node, int column)
          By default, make the column with the Tree in it the only editable one.
 boolean isLeaf(Object node)
           
 void removeTreeModelListener(TreeModelListener l)
           
 void setValueAt(Object aValue, Object node, int column)
          Sets the value for node node, at column number column.
 void valueForPathChanged(TreePath path, Object newValue)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.puppycrawl.tools.checkstyle.gui.TreeTableModel
getColumnCount, getColumnName, getValueAt
 
Methods inherited from interface javax.swing.tree.TreeModel
getChild, getChildCount
 

Constructor Detail

AbstractTreeTableModel

public AbstractTreeTableModel(Object root)
Method Detail

getRoot

public Object getRoot()
Specified by:
getRoot in interface TreeModel

isLeaf

public boolean isLeaf(Object node)
Specified by:
isLeaf in interface TreeModel

valueForPathChanged

public void valueForPathChanged(TreePath path,
                                Object newValue)
Specified by:
valueForPathChanged in interface TreeModel

getIndexOfChild

public int getIndexOfChild(Object parent,
                           Object child)
Specified by:
getIndexOfChild in interface TreeModel

addTreeModelListener

public void addTreeModelListener(TreeModelListener l)
Specified by:
addTreeModelListener in interface TreeModel

removeTreeModelListener

public void removeTreeModelListener(TreeModelListener l)
Specified by:
removeTreeModelListener in interface TreeModel

fireTreeNodesChanged

protected void fireTreeNodesChanged(Object source,
                                    Object[] path,
                                    int[] childIndices,
                                    Object[] children)

fireTreeNodesInserted

protected void fireTreeNodesInserted(Object source,
                                     Object[] path,
                                     int[] childIndices,
                                     Object[] children)

fireTreeNodesRemoved

protected void fireTreeNodesRemoved(Object source,
                                    Object[] path,
                                    int[] childIndices,
                                    Object[] children)

fireTreeStructureChanged

protected void fireTreeStructureChanged(Object source,
                                        Object[] path,
                                        int[] childIndices,
                                        Object[] children)

getColumnClass

public Class<?> getColumnClass(int column)
Specified by:
getColumnClass in interface TreeTableModel
Parameters:
column - the column number
Returns:
the type for column number column.

isCellEditable

public boolean isCellEditable(Object node,
                              int column)
By default, make the column with the Tree in it the only editable one. Making this column editable causes the JTable to forward mouse and keyboard events in the Tree column to the underlying JTree.

Specified by:
isCellEditable in interface TreeTableModel
Parameters:
node - the node.
column - the column number
Returns:
true if editable

setValueAt

public void setValueAt(Object aValue,
                       Object node,
                       int column)
Description copied from interface: TreeTableModel
Sets the value for node node, at column number column.

Specified by:
setValueAt in interface TreeTableModel
Parameters:
aValue - the value to set
node - the node to set the value on
column - the column number


Copyright © 2001-2011. All Rights Reserved.