rCellFormatter.removeStyleName(nRow, nCol, sStyle);
/*************************************** * Clears a certain row. If the row doesn't exist it will be added to the * table. * * @param nRow The table row to clear */ private void clearRow(int nRow) { CellFormatter rCellFormatter = aDataTable.getCellFormatter(); int nColumns = aHeader.getColumnCount(); for (int nColumn = 0; nColumn < nColumns; nColumn++) { aDataTable.setHTML(nRow, nColumn, " "); rCellFormatter.removeStyleName(nRow, nColumn, aHeader.getColumnStyle(nColumn)); } setEmptyRowStyle(nRow); }
private void updateTableStructure() { int columnCount = tableModel.getColumnCount(); for (int i = 0; i < columnCount; i++) { Column col = tableModel.getColumn(i); header.setWidget(0, i, col.getColumnTitleWidget()); } for (int i = 0; i < columnCount - 1; i++) { Column col = tableModel.getColumn(i); header.getColumnFormatter().setWidth(i, col.getWidth()); } for (int i = 0; i < columnCount; i++) { Column col = tableModel.getColumn(i); header.getCellFormatter().removeStyleName(0, i, selectionStyle.columnAscending()); header.getCellFormatter().removeStyleName(0, i, selectionStyle.columnDescending()); if (col.getSortDirection() == Column.Ascending) { header.getCellFormatter().addStyleName(0, i, selectionStyle.columnAscending()); } else if (col.getSortDirection() == Column.Descending) { header.getCellFormatter().addStyleName(0, i, selectionStyle.columnDescending()); } } }
/** * 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; } } }
private void processKeyLeftRight(TablePredicateFactory.Predicate tablePredicate) { if (tablePredicate.indexCondition(headerSelectedCellIndex, tableModel.getColumnCount())) { header.getCellFormatter().removeStyleName(0, headerSelectedCellIndex, selectionStyle.selectedHeaderCell()); headerSelectedCellIndex = tablePredicate.nextIndex(headerSelectedCellIndex); header.getCellFormatter().addStyleName(0, headerSelectedCellIndex, selectionStyle.selectedHeaderCell()); } }
/** * 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; } }
private void removeHeaderSelection() { if (headerSelectedCellIndex >= 0) { header.getCellFormatter().removeStyleName(0, headerSelectedCellIndex, selectionStyle.selectedHeaderCell()); headerSelectedCellIndex = -1; } }