/** * This method deselects the specified cell. * * @param row is a row number in the grid. * @param column is a column number in the grid. */ public void deselectCell(int row, int column) { if (row >= 0 && row < getRowCount()) { getSelectionModel().remove(row); HTMLTable.RowFormatter rowFormatter = getRowFormatter(); rowFormatter.removeStyleName(row, "selected-row"); if (column >= 0 && column < getCellCount(row)) { getColumnFormatter().removeStyleName(column, "selected-column"); getCellFormatter().removeStyleName(row, column, "selected-cell"); this.currentColumn = -1; } } }
/** * This method drops cell selection. */ protected void dropSelection() { int oldRow = getCurrentRow(); int oldColumn = getCurrentColumn(); if (oldRow >= 0 && oldColumn >= 0 && oldRow < getRowCount() && oldColumn < getCellCount(oldRow)) { getColumnFormatter().removeStyleName(oldColumn, "selected-column"); getCellFormatter().removeStyleName(oldRow, oldColumn, "selected-cell"); this.currentColumn = -1; } }