Class ParseTreeTableModel
- java.lang.Object
-
- com.puppycrawl.tools.checkstyle.gui.ParseTreeTableModel
-
- All Implemented Interfaces:
javax.swing.tree.TreeModel
public class ParseTreeTableModel extends java.lang.Object implements javax.swing.tree.TreeModel
The model that backs the parse tree in the GUI.
-
-
Constructor Summary
Constructors Constructor Description ParseTreeTableModel(DetailAST parseTree)
Initialise pModel.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addTreeModelListener(javax.swing.event.TreeModelListener listener)
java.lang.Object
getChild(java.lang.Object parent, int index)
int
getChildCount(java.lang.Object parent)
java.lang.Class<?>
getColumnClass(int column)
Returns type of specified column number.int
getColumnCount()
Returns number of available column.java.lang.String
getColumnName(int column)
Returns column name of specified column number.int
getIndexOfChild(java.lang.Object parent, java.lang.Object child)
java.lang.Object
getRoot()
java.lang.Object
getValueAt(java.lang.Object node, int column)
Returns the value to be displayed for node at column number.boolean
isCellEditable(int column)
Indicates whether the the value for nodenode
, at column numbercolumn
is editable.boolean
isLeaf(java.lang.Object node)
void
removeTreeModelListener(javax.swing.event.TreeModelListener listener)
protected void
setParseMode(MainFrameModel.ParseMode mode)
Set parse mode.protected void
setParseTree(DetailAST parseTree)
Sets parse tree.void
valueForPathChanged(javax.swing.tree.TreePath path, java.lang.Object newValue)
-
-
-
Constructor Detail
-
ParseTreeTableModel
public ParseTreeTableModel(DetailAST parseTree)
Initialise pModel.- Parameters:
parseTree
- DetailAST parse tree.
-
-
Method Detail
-
setParseTree
protected final void setParseTree(DetailAST parseTree)
Sets parse tree.- Parameters:
parseTree
- DetailAST parse tree.
-
setParseMode
protected void setParseMode(MainFrameModel.ParseMode mode)
Set parse mode.- Parameters:
mode
- ParseMode enum
-
getColumnCount
public int getColumnCount()
Returns number of available column.- Returns:
- the number of available column.
-
getColumnName
public java.lang.String getColumnName(int column)
Returns column name of specified column number.- Parameters:
column
- the column number- Returns:
- the name for column number
column
.
-
getColumnClass
public java.lang.Class<?> getColumnClass(int column)
Returns type of specified column number.- Parameters:
column
- the column number- Returns:
- the type for column number
column
.
-
getValueAt
public java.lang.Object getValueAt(java.lang.Object node, int column)
Returns the value to be displayed for node at column number.- Parameters:
node
- the nodecolumn
- the column number- Returns:
- the value to be displayed for node
node
, at column numbercolumn
.
-
getChild
public java.lang.Object getChild(java.lang.Object parent, int index)
- Specified by:
getChild
in interfacejavax.swing.tree.TreeModel
-
getChildCount
public int getChildCount(java.lang.Object parent)
- Specified by:
getChildCount
in interfacejavax.swing.tree.TreeModel
-
valueForPathChanged
public void valueForPathChanged(javax.swing.tree.TreePath path, java.lang.Object newValue)
- Specified by:
valueForPathChanged
in interfacejavax.swing.tree.TreeModel
-
getRoot
public java.lang.Object getRoot()
- Specified by:
getRoot
in interfacejavax.swing.tree.TreeModel
-
isLeaf
public boolean isLeaf(java.lang.Object node)
- Specified by:
isLeaf
in interfacejavax.swing.tree.TreeModel
-
getIndexOfChild
public int getIndexOfChild(java.lang.Object parent, java.lang.Object child)
- Specified by:
getIndexOfChild
in interfacejavax.swing.tree.TreeModel
-
addTreeModelListener
public void addTreeModelListener(javax.swing.event.TreeModelListener listener)
- Specified by:
addTreeModelListener
in interfacejavax.swing.tree.TreeModel
-
removeTreeModelListener
public void removeTreeModelListener(javax.swing.event.TreeModelListener listener)
- Specified by:
removeTreeModelListener
in interfacejavax.swing.tree.TreeModel
-
isCellEditable
public boolean isCellEditable(int column)
Indicates whether the the value for nodenode
, at column numbercolumn
is editable.- Parameters:
column
- the column number- Returns:
- true if editable
-
-