List of usage examples for com.google.gwt.user.cellview.client Column getCell
@Override
public Cell<C> getCell()
From source file:uk.ac.ebi.fg.annotare2.web.gwt.editor.client.view.experiment.design.GridView.java
License:Apache License
@SuppressWarnings("unchecked") public boolean importValuesToKeyboardSelectedColumn(List<String> values) { int colIndex = dataGrid.getKeyboardSelectedColumn(); int rowIndex = dataGrid.getKeyboardSelectedRow() + dataGrid.getPageStart(); if (null != values && !values.isEmpty()) { if (colIndex >= 1 && colIndex < dataGrid.getColumnCount() && rowIndex >= 0 && rowIndex < dataGrid.getRowCount()) { Column<R, ?> column = dataGrid.getColumn(colIndex); List<R> rows = dataProvider.getList(); if (isColumnEditable(column, rows.get(rowIndex))) { if (column instanceof SamplesViewImpl.SampleNameColumn) { for (int i = 0; i < values.size(); i++) { String value = values.get(i); for (int j = i + 1; j < values.size(); j++) { if (value.equalsIgnoreCase(values.get(j))) { NotificationPopupPanel .error("Please ensure all sample names are unique, duplicate name '" + values.get(j) + "'.", true, false); return false; }/*from ww w.j a v a2s . co m*/ } } } Cell<String> cell = (Cell<String>) column.getCell(); FieldUpdater<R, String> updater = (FieldUpdater<R, String>) column.getFieldUpdater(); for (int i = 0; i < Math.min(rows.size() - rowIndex, values.size()); i++) { int j = i + rowIndex; if (isColumnEditable(column, rows.get(j))) { updater.update(j, rows.get(j), values.get(i)); ((AbstractEditableCell) cell).clearViewData(rows.get(j)); } } dataProvider.refresh(); } } } return true; }