Example usage for com.google.gwt.cell.client AbstractEditableCell clearViewData

List of usage examples for com.google.gwt.cell.client AbstractEditableCell clearViewData

Introduction

In this page you can find the example usage for com.google.gwt.cell.client AbstractEditableCell clearViewData.

Prototype

public void clearViewData(Object key) 

Source Link

Document

Clear the view data associated with the specified key.

Usage

From source file:uk.ac.ebi.fg.annotare2.web.gwt.editor.client.view.experiment.design.GridView.java

License:Apache License

@SuppressWarnings("unchecked")
public void fillDownKeyboardSelectedColumn() {
    int colIndex = dataGrid.getKeyboardSelectedColumn();
    int rowIndex = dataGrid.getKeyboardSelectedRow() + dataGrid.getPageStart();

    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))
                && !(column instanceof SamplesViewImpl.SampleNameColumn)) {
            AbstractEditableCell<R, String> cell = (AbstractEditableCell<R, String>) column.getCell();
            String value = (String) column.getValue(rows.get(rowIndex));
            FieldUpdater<R, String> updater = (FieldUpdater<R, String>) column.getFieldUpdater();

            for (int i = rowIndex + 1; i < rows.size(); i++) {
                if (isColumnEditable(column, rows.get(i))) {
                    updater.update(i, rows.get(i), value);
                    cell.clearViewData(rows.get(i));
                }/*from w  ww . ja  v  a2 s .  co m*/
            }
            dataProvider.refresh();
        } else {
            NotificationPopupPanel.warning("Fill-down function is not allowed for this column", true, false);
        }
    }
}