use of org.eclipse.scout.rt.client.ui.basic.table.ITableRow in project scout.rt by eclipse.
the class AbstractColumn method getSelectedDisplayTexts.
@Override
public List<String> getSelectedDisplayTexts() {
List<ITableRow> selectedRows = m_table.getSelectedRows();
List<String> values = new ArrayList<String>(selectedRows.size());
for (ITableRow row : selectedRows) {
values.add(getDisplayText(row));
}
return values;
}
use of org.eclipse.scout.rt.client.ui.basic.table.ITableRow in project scout.rt by eclipse.
the class AbstractColumn method getUpdatedValues.
@Override
public List<VALUE> getUpdatedValues() {
List<ITableRow> updatedRows = m_table.getUpdatedRows();
List<VALUE> values = new ArrayList<VALUE>(updatedRows.size());
for (ITableRow row : updatedRows) {
values.add(getValue(row));
}
return values;
}
use of org.eclipse.scout.rt.client.ui.basic.table.ITableRow in project scout.rt by eclipse.
the class AbstractColumn method getInsertedValues.
@Override
public List<VALUE> getInsertedValues() {
List<ITableRow> insertedRows = m_table.getInsertedRows();
List<VALUE> values = new ArrayList<VALUE>(insertedRows.size());
for (ITableRow row : insertedRows) {
values.add(getValue(row));
}
return values;
}
use of org.eclipse.scout.rt.client.ui.basic.table.ITableRow in project scout.rt by eclipse.
the class AbstractContentAssistColumn method updateDisplayTexts.
@Override
public void updateDisplayTexts(List<ITableRow> rows) {
try {
if (rows.size() > 0) {
BatchLookupCall batchCall = new BatchLookupCall();
ArrayList<ITableRow> batchRowList = new ArrayList<ITableRow>();
BatchLookupResultCache lookupResultCache = new BatchLookupResultCache();
for (ITableRow row : rows) {
ILookupCall<?> call = prepareLookupCall(row);
if (call != null && call.getKey() != null) {
// split: local vs remote
if (call instanceof LocalLookupCall) {
applyLookupResult(row, lookupResultCache.getDataByKey(call));
} else {
batchRowList.add(row);
batchCall.addLookupCall(call);
}
} else {
applyLookupResult(row, new ArrayList<ILookupRow<?>>(0));
}
}
//
if (!batchCall.isEmpty()) {
ITableRow[] tableRows = batchRowList.toArray(new ITableRow[batchRowList.size()]);
IBatchLookupService service = BEANS.get(IBatchLookupService.class);
List<List<ILookupRow<?>>> resultArray = service.getBatchDataByKey(batchCall);
for (int i = 0; i < tableRows.length; i++) {
applyLookupResult(tableRows[i], resultArray.get(i));
}
}
}
} catch (RuntimeException e) {
BEANS.get(ExceptionHandler.class).handle(e);
}
}
use of org.eclipse.scout.rt.client.ui.basic.table.ITableRow in project scout.rt by eclipse.
the class AbstractSmartColumn2 method updateDisplayTexts.
@Override
public void updateDisplayTexts(List<ITableRow> rows) {
try {
if (rows.size() > 0) {
BatchLookupCall batchCall = new BatchLookupCall();
ArrayList<ITableRow> batchRowList = new ArrayList<ITableRow>();
BatchLookupResultCache lookupResultCache = new BatchLookupResultCache();
for (ITableRow row : rows) {
ILookupCall<?> call = prepareLookupCall(row);
if (call != null && call.getKey() != null) {
// split: local vs remote
if (call instanceof LocalLookupCall) {
applyLookupResult(row, lookupResultCache.getDataByKey(call));
} else {
batchRowList.add(row);
batchCall.addLookupCall(call);
}
} else {
applyLookupResult(row, new ArrayList<ILookupRow<?>>(0));
}
}
//
if (!batchCall.isEmpty()) {
ITableRow[] tableRows = batchRowList.toArray(new ITableRow[batchRowList.size()]);
IBatchLookupService service = BEANS.get(IBatchLookupService.class);
List<List<ILookupRow<?>>> resultArray = service.getBatchDataByKey(batchCall);
for (int i = 0; i < tableRows.length; i++) {
applyLookupResult(tableRows[i], resultArray.get(i));
}
}
}
} catch (RuntimeException e) {
BEANS.get(ExceptionHandler.class).handle(e);
}
}
Aggregations