Class TreeTable

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, EventListener, Accessible, CellEditorListener, ListSelectionListener, RowSorterListener, TableColumnModelListener, TableModelListener, Scrollable

public final class TreeTable extends JTable
This example shows how to create a simple TreeTable component, by using a JTree as a renderer (and editor) for the cells in a particular column in the JTable. Original Source Location
See Also:
  • Constructor Details

    • TreeTable

      public TreeTable(ParseTreeTableModel treeTableModel)
      Creates TreeTable base on TreeTableModel.
      Parameters:
      treeTableModel - Tree table model
  • Method Details

    • selectNodeByXpath

      public void selectNodeByXpath()
      Select Node by Xpath.
    • updateUI

      public void updateUI()
      Overridden to message super and forward the method to the tree. Since the tree is not actually in the component hierarchy it will never receive this unless we forward it in this manner.
      Overrides:
      updateUI in class JTable
    • getEditingRow

      public int getEditingRow()
      Overrides:
      getEditingRow in class JTable
    • setRowHeight

      public void setRowHeight(int newRowHeight)
      Overridden to pass the new rowHeight to the tree.
      Overrides:
      setRowHeight in class JTable
    • getTree

      public JTree getTree()
      Returns tree.
      Returns:
      the tree that is being shared between the model.
    • setEditor

      public void setEditor(JTextArea textArea)
      Sets text area editor.
      Parameters:
      textArea - JTextArea component.
    • setXpathEditor

      public void setXpathEditor(JTextArea xpathTextArea)
      Sets text area xpathEditor.
      Parameters:
      xpathTextArea - JTextArea component.
    • setLinePositionMap

      public void setLinePositionMap(List<Integer> linePositionMap)
      Sets line position map.
      Parameters:
      linePositionMap - Line position map.