/** * Deletes a row and all its contents. * * <p>Rows below the given row are shifted up. */ public void deleteRow(int row) { if (this.rowsChanged_ != null) { this.rowsChanged_.remove(this.rows_.get(row)); if (this.rowsChanged_.isEmpty()) {; this.rowsChanged_ = null; } } for (int i = 0; i < this.getColumnCount(); ++i) { WTableCell cell = this.rows_.get(row).cells_.get(i).cell; if (cell != null) cell.remove(); } if (row >= (int) (this.getRowCount() - this.rowsAdded_)) { --this.rowsAdded_; } else { this.flags_.set(BIT_GRID_CHANGED); this.repaint(EnumSet.of(RepaintFlag.RepaintInnerHtml)); } ; this.rows_.remove(0 + row); }
/** * Deletes a table cell and its contents. * * <p>The table cell at that position is recreated. */ public void removeCell(WTableCell item) { this.removeCell(item.getRow(), item.getColumn()); }