Package org.jdesktop.swingx
Class JXList.ListAdapter
java.lang.Object
org.jdesktop.swingx.decorator.ComponentAdapter
org.jdesktop.swingx.JXList.ListAdapter
- Enclosing class:
JXList
A component adapter targeted at a JXList.
-
Field Summary
FieldsFields inherited from class org.jdesktop.swingx.decorator.ComponentAdapter
column, DEFAULT_COLUMN_IDENTIFIER, row, target
-
Constructor Summary
ConstructorsConstructorDescriptionListAdapter
(JXList component) Constructs aListAdapter
for the specified target JXList. -
Method Summary
Modifier and TypeMethodDescriptionint
convertRowIndexToModel
(int rowViewIndex) Converts a row index in view coordinates to an index in model coordinates.int
convertRowIndexToView
(int rowModelIndex) Converts a row index in model coordinates to an index in view coordinates.Returns the bounds of the cell identified by this adapter.getList()
Typesafe accessor for the target component.int
Returns the number of rows in the target's data model.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.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.boolean
isCellEditable
(int row, int column) Determines whether this cell is editable.boolean
Returnstrue
if the cell identified by this adapter is editable,false
otherwise.boolean
Returns true if the cell identified by this adapter is currently selected.Methods inherited from class org.jdesktop.swingx.decorator.ComponentAdapter
convertColumnIndexToModel, convertColumnIndexToView, getColumnClass, getColumnClass, getColumnCount, getColumnIdentifierAt, getColumnIndex, getColumnName, getComponent, getDepth, getFilteredStringAt, getFilteredValueAt, getString, getString, getValue, getValue, isExpanded, isHierarchical, isLeaf, isTestable
-
Field Details
-
list
-
-
Constructor Details
-
ListAdapter
Constructs aListAdapter
for the specified target JXList.- Parameters:
component
- the target list.
-
-
Method Details
-
getList
Typesafe accessor for the target component.- Returns:
- the target component as a
JXList
-
hasFocus
public boolean hasFocus()Returns true if the cell identified by this adapter currently has focus. Otherwise, it returns false.- Specified by:
hasFocus
in classComponentAdapter
- Returns:
- true if the cell identified by this adapter currently has focus; Otherwise, return false
-
getRowCount
public int getRowCount()Returns the number of rows in the target's data model.- Overrides:
getRowCount
in classComponentAdapter
- Returns:
- the number of rows in the target's data model.
-
getValueAt
Returns the value of the target component's cell identified by the specified row and column in model coordinates.- Specified by:
getValueAt
in 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.
This is implemented to query the table's StringValueRegistry for an appropriate StringValue and use that for getting the string representation.
- Overrides:
getStringAt
in 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:
getCellBounds
in classComponentAdapter
- Returns:
- the bounds of the cell identified by this adapter
-
isCellEditable
public boolean isCellEditable(int row, int column) Determines whether this cell is editable.- Specified by:
isCellEditable
in classComponentAdapter
- Parameters:
row
- the row to query in model coordinatescolumn
- the column to query in model coordinates- Returns:
true
if the cell is editable,false
otherwise
-
isEditable
public boolean isEditable()Returnstrue
if the cell identified by this adapter is editable,false
otherwise.- Specified by:
isEditable
in classComponentAdapter
- Returns:
true
if the cell is editable,false
otherwise
-
isSelected
public boolean isSelected()Returns true if the cell identified by this adapter is currently selected. Otherwise, it returns false.- Specified by:
isSelected
in classComponentAdapter
- Returns:
- true if the cell identified by this adapter is currently selected; Otherwise, return false
-
convertRowIndexToView
public int convertRowIndexToView(int rowModelIndex) Converts a row index in model coordinates to an index in view coordinates.- Overrides:
convertRowIndexToView
in classComponentAdapter
- Parameters:
rowModelIndex
- index of a row in model coordinates- Returns:
- index of the specified row in view coordinates
-
convertRowIndexToModel
public int convertRowIndexToModel(int rowViewIndex) Converts a row index in view coordinates to an index in model coordinates.- Overrides:
convertRowIndexToModel
in classComponentAdapter
- Parameters:
rowViewIndex
- index of a row in view coordinates- Returns:
- index of the specified row in model coordinates
-