Package org.jdesktop.swingx
Class JXTree.TreeAdapter
java.lang.Object
org.jdesktop.swingx.decorator.ComponentAdapter
org.jdesktop.swingx.JXTree.TreeAdapter
- Enclosing class:
- JXTree
-
Field Summary
Fields inherited from class org.jdesktop.swingx.decorator.ComponentAdapter
column, DEFAULT_COLUMN_IDENTIFIER, row, target -
Constructor Summary
ConstructorsConstructorDescriptionTreeAdapter(JXTree component) Constructs aTableCellRenderContextfor the specified target component. -
Method Summary
Modifier and TypeMethodDescriptionReturns the bounds of the cell identified by this adapter.intgetDepth()Returns the depth of this row in the hierarchy where the root is 0.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.getTree()getValueAt(int row, int column) Returns the value of the target component's cell identified by the specified row and column in model coordinates.booleanhasFocus()Returns true if the cell identified by this adapter currently has focus.booleanisCellEditable(int row, int column) Determines whether this cell is editable.booleanReturnstrueif the cell identified by this adapter is editable,falseotherwise.booleanReturns true if the cell identified by this adapter is currently expanded.booleanReturns true if the cell identified by this adapter displays the hierarchical node.booleanisLeaf()Returns true if the cell identified by this adapter is a leaf node.booleanReturns true if the cell identified by this adapter is currently selected.Methods inherited from class org.jdesktop.swingx.decorator.ComponentAdapter
convertColumnIndexToModel, convertColumnIndexToView, convertRowIndexToModel, convertRowIndexToView, getColumnClass, getColumnClass, getColumnCount, getColumnIdentifierAt, getColumnIndex, getColumnName, getComponent, getFilteredStringAt, getFilteredValueAt, getRowCount, getString, getString, getValue, getValue, isTestable
-
Constructor Details
-
TreeAdapter
Constructs aTableCellRenderContextfor the specified target component.- Parameters:
component- the target component
-
-
Method Details
-
getTree
-
hasFocus
public boolean hasFocus()Returns true if the cell identified by this adapter currently has focus. Otherwise, it returns false.- Specified by:
hasFocusin classComponentAdapter- Returns:
- true if the cell identified by this adapter currently has focus; Otherwise, return false
-
getValueAt
Returns the value of the target component's cell identified by the specified row and column in model coordinates.- Specified by:
getValueAtin classComponentAdapter- Parameters:
row- in model coordinatescolumn- in model coordinates- Returns:
- the value of the target component's cell identified by the specified row and column
-
getStringAt
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.
- Overrides:
getStringAtin classComponentAdapter- Parameters:
row- in model coordinatescolumn- in model coordinates- Returns:
- the value of the target component's cell identified by the specified row and column
-
getCellBounds
Returns the bounds of the cell identified by this adapter.- Overrides:
getCellBoundsin classComponentAdapter- Returns:
- the bounds of the cell identified by this adapter
-
isEditable
public boolean isEditable()Returnstrueif the cell identified by this adapter is editable,falseotherwise.- Specified by:
isEditablein classComponentAdapter- Returns:
trueif the cell is editable,falseotherwise
-
isSelected
public boolean isSelected()Returns true if the cell identified by this adapter is currently selected. Otherwise, it returns false.- Specified by:
isSelectedin classComponentAdapter- Returns:
- true if the cell identified by this adapter is currently selected; Otherwise, return false
-
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:
isExpandedin classComponentAdapter- 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:
getDepthin classComponentAdapter- Returns:
- the depth for this adapter
-
isHierarchical
public boolean isHierarchical()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:
isHierarchicalin classComponentAdapter- Returns:
- true if the cell identified by this adapter displays the hierarchical node; Otherwise, return false
-
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:
isLeafin classComponentAdapter- Returns:
- true if the cell identified by this adapter is a leaf node; Otherwise, return false
-
isCellEditable
public boolean isCellEditable(int row, int column) Determines whether this cell is editable.- Specified by:
isCellEditablein classComponentAdapter- Parameters:
row- the row to query in model coordinatescolumn- the column to query in model coordinates- Returns:
trueif the cell is editable,falseotherwise
-