Component result = super.getTableCellEditorComponent(table, value, isSelected, row, column);
// AD:26/6/2008 Change JComboBox to AutoResizingComboBox to reduce casting later
if (result instanceof AutoResizingComboBox) {
AutoResizingComboBox cb = (AutoResizingComboBox)result;
if (cb.getModel() instanceof DropListModel){
DropListModel model = (DropListModel)cb.getModel();
Array_Of_ListElement<ListElement> elements = null;
if (rowElements != null){
//PM:10/8/07
/*
* customize the element list per row, if there is
* no customisation for the row
* use the default
*/
elements = rowElements.get(row);
}
if (elements == null){
//PM:17/7/07 add a DropListModel with the correct data
elements = this.defaultElements;
}
cb.setModel(new DropListModel(elements, cb));
if (value instanceof Integer) {
model.setIntegerValue(((Integer)value).intValue());
}
else if (value instanceof IntegerData) {
model.setIntegerValue(((IntegerData)value).intValue());
}
else if (value instanceof TextData) {
model.setTextValue((TextData)value);
}
else if (value instanceof String) {
model.setTextValue(new TextData((String)value));
}
else {
model.setObjectValue(value);
}
}
}
return result;
}