Class JTreeTable

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

public class JTreeTable extends JTable
original JTreeTable component taken from: Sun Microsystems, Inc. Copyright 1997, 1998 by Sun Microsystems, Inc.
Version:
%version: 3 % %date_modified: Sat May 05 10:25:23 2001 %
Author:
lruslen
See Also:
  • Field Details

  • Constructor Details

    • JTreeTable

      public JTreeTable(TreeTableModel treeTableModel)
      Creates a new JTreeTable.
      Type Parameters:
      em - treeTableModel data that will be used for component
      See Also:
  • Method Details

    • setHandleVisibility

      public void setHandleVisibility(boolean b)
      Sets the handles on the tree visible, or not. Not visible by default.
      Parameters:
      vis - - set to true to display handles; false for no handles
    • expandAll

      public void expandAll()
    • collapseAll

      public void collapseAll()
    • setTreeRenderer

      public void setTreeRenderer(TreeCellRenderer r)
    • setModel

      public void setModel(TreeTableModel newModel)
      Sets the data model for this component to newModel.
      Type Parameters:
      em - newModel data that will be used for component
      See Also:
    • updateUI

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

      public int getEditingRow()
      Workaround for BasicTableUI anomaly. Make sure the UI never tries to paint the editor. The UI currently uses different techniques to paint the renderers and editors and overriding setBounds() below is not the right thing to do for an editor. Returning -1 for the editing row in this case, ensures the editor is never painted.
      Overrides:
      getEditingRow in class JTable
    • setRowHeight

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

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