/* Ignore, table data model is not yet set */
} catch (ArrayIndexOutOfBoundsException ex) {
/* Ignore, table data model is not yet set */
}
} else if (e instanceof MapChangeEvent) {
MapChangeEvent event = (MapChangeEvent) e;
if (event.getKey() == null) {
reload();
} else if (event.getKey().equals(indexKey)) {
setSelectionIndices((int[]) ((MapChangeEvent) e).getNewValue());
try {
processEvents = false;
if (valueKey != null) {
int indices[] = table.getSelectedRows();
TableRow rows[] = new TableRow[indices.length];
for (int i = 0; i < indices.length; i++)
rows[i] = tableDataModel.getTableRow(sorter.getRowForSortedRow(indices[i]));
((MapDataModel) event.getModel()).setValue(Table.this, valueKey, rows);
}
} finally {
processEvents = true;
}
} else if (event.getKey().equals(valueKey)) {
setSelectionValues((TableRow[]) ((MapChangeEvent) e).getNewValue());
try {
processEvents = false;
if (indexKey != null) {
int indices[] = table.getSelectedRows();
for (int i = 0; i < indices.length; i++) {
indices[i] = sorter.getRowForSortedRow(indices[i]);
}
((MapDataModel) event.getModel()).setValue(Table.this, indexKey, indices);
}
} finally {
processEvents = true;
}
}