Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.jdesktop.swingx
Class JXTreeTable.TreeTableDataAdapter

    java.lang.Object
      org.jdesktop.swingx.decorator.ComponentAdapter
          org.jdesktop.swingx.JXTable.TableAdapter
              org.jdesktop.swingx.JXTreeTable.TreeTableDataAdapter

Enclosing class:
  JXTreeTable

    protected static class JXTreeTable.TreeTableDataAdapter

extends JXTable.TableAdapter

Field Summary

Fields inherited from class org.jdesktop.swingx.decorator.ComponentAdapter
`column, DEFAULT_COLUMN_IDENTIFIER, row, target`

Constructor Summary
`JXTreeTable.TreeTableDataAdapter(JXTreeTable component)` Constructs a `TreeTableDataAdapter` for the specified target component.

Method Summary
`int` | `getDepth()` Returns the depth of this row in the hierarchy where the root is 0.
`java.lang.String` | `getFilteredStringAt(int row, int column)` Returns the String representation of the filtered value of the cell identified by the row in view coordinate and the column in model coordinates.
`java.lang.String` | `getStringAt(int row, int column)` Returns the String representation of the value of the cell identified by the row specified row and column in model coordinates.
`JXTreeTable` | `getTreeTable()`
`boolean` | `isExpanded()` Returns true if the cell identified by this adapter is currently expanded.
`boolean` | `isHierarchical()` Returns true if the cell identified by this adapter displays the hierarchical node.
`boolean` | `isLeaf()` Returns true if the cell identified by this adapter is a leaf node.

Methods inherited from class org.jdesktop.swingx.JXTable.TableAdapter
`convertColumnIndexToModel, convertColumnIndexToView, convertRowIndexToModel, convertRowIndexToView, getCellBounds, getColumnByModelIndex, getColumnCount, getColumnIdentifierAt, getColumnIndex, getColumnName, getRowCount, getTable, getValueAt, hasFocus, isCellEditable, isEditable, isSelected, isTestable`

Methods inherited from class org.jdesktop.swingx.decorator.ComponentAdapter
`getComponent, getFilteredValueAt, getString, getString, getValue, getValue, refresh`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### JXTreeTable.TreeTableDataAdapter

    public JXTreeTable.TreeTableDataAdapter(JXTreeTable component)

  Constructs a `TreeTableDataAdapter` for the specified target component.

  Parameters:
    `component` - the target component

Method Detail

### getTreeTable

    public JXTreeTable getTreeTable()

### isExpanded

    public boolean isExpanded()

  Returns true if the cell identified by this adapter is currently expanded. Otherwise, it returns false. For components that do not support hierarchical data, this method always returns true because the cells in such components can never be collapsed.

  Overrides:
    `isExpanded` in class `ComponentAdapter`
  Returns:
    true if the cell identified by this adapter is currently expanded; Otherwise, return false

### getDepth

    public int getDepth()

  Returns the depth of this row in the hierarchy where the root is 0. For components that do not contain hierarchical data, this method returns 1.

  Overrides:
    `getDepth` in class `ComponentAdapter`
  Returns:
    the depth for this adapter

### isLeaf

    public boolean isLeaf()

  Returns true if the cell identified by this adapter is a leaf node. Otherwise, it returns false. For components that do not support hierarchical data, this method always returns true because the cells in such components can never have children.

  Overrides:
    `isLeaf` in class `ComponentAdapter`
  Returns:
    true if the cell identified by this adapter is a leaf node; Otherwise, return false

### isHierarchical

    public boolean isHierarchical()

  Description copied from class: `ComponentAdapter`
  Returns true if the cell identified by this adapter displays the hierarchical node. Otherwise, it returns false. For components that do not support hierarchical data, this method always returns false because the cells in such components can never have children.

  Overrides:
    `isHierarchical` in class `ComponentAdapter`
  Returns:
    true if the cell identified by this adapter displays hierarchical nodes; false otherwise

### getFilteredStringAt

    public java.lang.String getFilteredStringAt(int row,
                                                int column)

  Returns the String representation of the filtered value of the cell identified by the row in view coordinate and the column in model coordinates.

  Note: the asymetry of the coordinates is intentional - clients like Highlighters are interested in view values but might need to access non-visible columns for testing. While it is possible to access row coordinates different from the current (that is this.row) it is not safe to do so for row > this.row because the adapter doesn't allow to query the count of visible rows.

  This implementation messages the StringValue.TO_STRING with the filteredValue, subclasses should re-implement and use the API appropriate for the target component type.

  PENDING JW: what about null cell values? StringValue has a contract to return a empty string then, would that be okay here as well?

  Overridden to fix #821-swingx: string rep of hierarchical column incorrect. In this case we must delegate to the tree directly (via treetable.getHierarchicalString). PENDING JW: revisit once we switch to really using a table renderer.

  Overrides:
    `getFilteredStringAt` in class `ComponentAdapter`
  Parameters:
    `row` - the row of the cell in view coordinates
    `column` - the column of the cell in model coordinates.
  Returns:
    the String representation of the filtered value of the cell identified by the row in view coordinate and the column in model coordinates

### getStringAt

    public java.lang.String getStringAt(int row,
                                        int column)

  Returns the String representation of the value of the cell identified by the row specified row and column in model coordinates.

  This implementation messages the StringValue.TO_STRING with the valueAt, subclasses should re-implement and use the api appropriate for the target component type.

  This is implemented to query the table's StringValueRegistry for an appropriate StringValue and use that for getting the string representation.

  Overridden to fix #821-swingx: string rep of hierarchical column incorrect. In this case we must delegate to the tree directly (via treetable.getHierarchicalString). PENDING JW: revisit once we switch to really using a table renderer.

  Overrides:
    `getStringAt` in class `JXTable.TableAdapter`
  Parameters:
    `row` - in model coordinates
    `column` - in model coordinates
  Returns:
    the value of the target component's cell identified by the specified row and column

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2010. All Rights Reserved.