public class IlvBasicTableModelPropertyDescriptor extends Object implements IlvTableModelPropertyDescriptor
IlvTableModelPropertyDescriptor
that lookup for value at a particular column index.Constructor and Description |
---|
IlvBasicTableModelPropertyDescriptor(int lookupColumn)
Creates an
IlvBasicPropertyDescriptor that will lookup at the given
column index to return the property value and will set it back to this index when
asked. |
IlvBasicTableModelPropertyDescriptor(String lookupColumn)
Creates an
IlvBasicPropertyDescriptor that will lookup at the index
of the given column name to return the property value and will set it back to
this index when asked. |
Modifier and Type | Method and Description |
---|---|
static int |
getColumnIndex(TableModel model,
String columnName)
Returns the index of columns with the given name in the given model.
|
int[] |
getColumns(TableModel model)
Returns an array with a single values which is the
lookupColumn . |
Object |
getProperty(TableModel model,
int rowIndex)
Returns the value of
model.getValueAt(rowIndex, lookupColumn) . |
void |
setProperty(TableModel model,
int rowIndex,
Object propertyValue)
Calls
model.setValueAt(propertyValue, rowIndex, lookupColumn) . |
public IlvBasicTableModelPropertyDescriptor(int lookupColumn)
IlvBasicPropertyDescriptor
that will lookup at the given
column index to return the property value and will set it back to this index when
asked.public IlvBasicTableModelPropertyDescriptor(String lookupColumn)
IlvBasicPropertyDescriptor
that will lookup at the index
of the given column name to return the property value and will set it back to
this index when asked.public Object getProperty(TableModel model, int rowIndex)
model.getValueAt(rowIndex, lookupColumn)
.getProperty
in interface IlvTableModelPropertyDescriptor
model
- The table model.rowIndex
- The row index.public void setProperty(TableModel model, int rowIndex, Object propertyValue) throws IlvConvertException
model.setValueAt(propertyValue, rowIndex, lookupColumn)
.
Tries before to convert the propertyValue
to the Class
required by TableModel.getColumnClass(lookupColumn)
using the
IlvConvert
class.setProperty
in interface IlvTableModelPropertyDescriptor
model
- The table model.rowIndex
- The row index.propertyValue
- The property value.IlvConvertException
public final int[] getColumns(TableModel model)
lookupColumn
.getColumns
in interface IlvTableModelPropertyDescriptor
model
- The table model.public static int getColumnIndex(TableModel model, String columnName)
IllegalArgumentException
- if the name is unknown© Copyright 2024 Rogue Wave Software, Inc., a Perforce company.. All Rights Reserved.