swingx
Version 2005-08-19

org.jdesktop.swingx
Class JXTree.TreeAdapter

java.lang.Object
  extended by org.jdesktop.swingx.decorator.ComponentAdapter
      extended by org.jdesktop.swingx.JXTree.TreeAdapter
Enclosing class:
JXTree

protected static class JXTree.TreeAdapter
extends ComponentAdapter


Field Summary
 
Fields inherited from class org.jdesktop.swingx.decorator.ComponentAdapter
column, row, target
 
Constructor Summary
JXTree.TreeAdapter(JXTree component)
          Constructs a TableCellRenderContext for the specified target component.
 
Method Summary
 String getColumnIdentifier(int columnIndex)
          returns the logical name (== identifier) of the column at columnIndex in model coordinates.
 String getColumnName(int columnIndex)
          returns the column's label (= headerValue).
 Object getFilteredValueAt(int row, int column)
          returns the filtered value of the cell identified by the row in view coordinate and the column in model coordinates.
 JXTree getTree()
           
 Object getValueAt(int row, int column)
          Returns the value of the target component's cell identified by the specified row and column in model coordinates.
 boolean hasFocus()
          Returns true if the cell identified by this adapter currently has focus; Otherwise, it returns false.
 boolean isCellEditable(int row, int column)
           
 boolean isExpanded()
          Returns true if the cell identified by this adapter is currently expanded; Otherwise, it returns false.
 boolean isLeaf()
          Returns true if the cell identified by this adapter is a leaf node; Otherwise, it returns false.
 boolean isSelected()
          Returns true if the cell identified by this adapter is currently selected; Otherwise, it returns false.
 void setValueAt(Object aValue, int row, int column)
           
 
Methods inherited from class org.jdesktop.swingx.decorator.ComponentAdapter
getColumnCount, getComponent, getRowCount, getValue, isHierarchical, isTestable, modelToView, refresh, viewToModel
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JXTree.TreeAdapter

public JXTree.TreeAdapter(JXTree component)
Constructs a TableCellRenderContext for the specified target component.

Parameters:
component - the target component
Method Detail

getTree

public JXTree getTree()

hasFocus

public boolean hasFocus()
Description copied from class: ComponentAdapter
Returns true if the cell identified by this adapter currently has focus; Otherwise, it returns false.

Specified by:
hasFocus in class ComponentAdapter
Returns:
true if the cell identified by this adapter currently has focus; Otherwise, return false

getValueAt

public Object getValueAt(int row,
                         int column)
Description copied from class: ComponentAdapter
Returns the value of the target component's cell identified by the specified row and column in model coordinates.

Specified by:
getValueAt in class ComponentAdapter
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

getFilteredValueAt

public Object getFilteredValueAt(int row,
                                 int column)
Description copied from class: ComponentAdapter
returns 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.

Specified by:
getFilteredValueAt in class ComponentAdapter
Returns:
the filtered value of the cell identified by the row in view coordinate and the column in model coordiantes

isSelected

public boolean isSelected()
Description copied from class: ComponentAdapter
Returns true if the cell identified by this adapter is currently selected; Otherwise, it returns false.

Specified by:
isSelected in class ComponentAdapter
Returns:
true if the cell identified by this adapter is currently selected; Otherwise, return false

isExpanded

public boolean isExpanded()
Description copied from class: ComponentAdapter
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

isLeaf

public boolean isLeaf()
Description copied from class: ComponentAdapter
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

isCellEditable

public boolean isCellEditable(int row,
                              int column)
Specified by:
isCellEditable in class ComponentAdapter

setValueAt

public void setValueAt(Object aValue,
                       int row,
                       int column)
Specified by:
setValueAt in class ComponentAdapter

getColumnName

public String getColumnName(int columnIndex)
Description copied from class: ComponentAdapter
returns the column's label (= headerValue). Used f.i. in SearchPanel to fill the field with the column name. Note: it's up to the implementation to decide for which columns it returns a name - most will do so for the subset with isTestable = true.

Specified by:
getColumnName in class ComponentAdapter
Parameters:
columnIndex - in model coordinates
Returns:
column name or null if not found/not testable.

getColumnIdentifier

public String getColumnIdentifier(int columnIndex)
Description copied from class: ComponentAdapter
returns the logical name (== identifier) of the column at columnIndex in model coordinates. Used f.i. JNTable to store and apply column properties by identifier. Note: it's up to the implementation to decide for which columns it returns a name - most will do so for the subset with isTestable = true.

Specified by:
getColumnIdentifier in class ComponentAdapter
Parameters:
columnIndex - in model coordinates
Returns:
the String value of the column identifier at columnIndex or null if no identifier set

swingx
Version 2005-08-19