use of org.eclipse.scout.rt.client.ui.basic.table.TableListener in project scout.rt by eclipse.
the class OrganizeColumnsFormRegressionTest method givenAProfilesTable.
private void givenAProfilesTable() {
ITable table = mock(ITable.class);
OrganizeColumnsForm form = new OrganizeColumnsForm(table);
profilesTable = form.getProfilesTableField().getTable();
profilesTable.addTableListener(new TableListener() {
@Override
public void tableChangedBatch(List<? extends TableEvent> batch) {
for (TableEvent e : batch) {
tableChanged(e);
}
}
@Override
public void tableChanged(TableEvent e) {
if (e.getType() == TableEvent.TYPE_REQUEST_FOCUS_IN_CELL) {
IColumn focusedColumn = CollectionUtility.firstElement(e.getColumns());
ITableRow focusedRow = CollectionUtility.firstElement(e.getRows());
if (focusedColumn.equals(profilesTable.getConfigNameColumn())) {
lastFocusedRowIndex.setValue(focusedRow.getRowIndex());
}
}
}
});
profilesTable.deselectAllRows();
}
Aggregations