/** * Checks that the row is within the correct bounds. * * @param row row index to check * @throws IndexOutOfBoundsException */ protected void checkRowBounds(int row) { int rowSize = getRowCount(); if ((row >= rowSize) || (row < 0)) { throw new IndexOutOfBoundsException("Row index: " + row + ", Row size: " + rowSize); } }
/** * Determines whether the specified cell exists. * * @param row the cell's row * @param column the cell's column * @return <code>true</code> if the specified cell exists */ public boolean isCellPresent(int row, int column) { if ((row >= getRowCount()) || (row < 0)) { return false; } if ((column < 0) || (column >= getCellCount(row))) { return false; } else { return true; } }
/** * Removes all widgets from this table, optionally clearing the inner HTML of * each cell. Note that this method does not remove any cells or rows. * * @param clearInnerHTML should the cell's inner html be cleared? */ public void clear(boolean clearInnerHTML) { for (int row = 0; row < getRowCount(); ++row) { for (int col = 0; col < getCellCount(row); ++col) { cleanCell(row, col, clearInnerHTML); } } }
/** * Inserts a new row into the table. * * @param beforeRow the index before which the new row will be inserted * @return the index of the newly-created row * @throws IndexOutOfBoundsException */ protected int insertRow(int beforeRow) { // Specifically allow the row count as an insert position. if (beforeRow != getRowCount()) { checkRowBounds(beforeRow); } Element tr = DOM.createTR(); DOM.insertChild(bodyElem, tr, beforeRow); return beforeRow; }
/** * <b>Affected Elements:</b> * <ul> * <li>-(row)#-(cell)# = the cell at the given row and cell index.</li> * </ul> * * @see UIObject#onEnsureDebugId(String) */ @Override protected void onEnsureDebugId(String baseID) { super.onEnsureDebugId(baseID); int rowCount = getRowCount(); for (int row = 0; row < rowCount; row++) { int cellCount = getCellCount(row); for (int cell = 0; cell < cellCount; cell++) { Element cellElem = cellFormatter.getRawElement(row, cell); ensureDebugId(cellElem, baseID, row + "-" + cell); } } }
/** * Checks that the row is within the correct bounds. * * @param row row index to check * @throws IndexOutOfBoundsException */ protected void checkRowBounds(int row) { int rowSize = getRowCount(); if ((row >= rowSize) || (row < 0)) { throw new IndexOutOfBoundsException("Row index: " + row + ", Row size: " + rowSize); } }
/** * Checks that the row is within the correct bounds. * * @param row row index to check * @throws IndexOutOfBoundsException */ protected void checkRowBounds(int row) { int rowSize = getRowCount(); if ((row >= rowSize) || (row < 0)) { throw new IndexOutOfBoundsException("Row index: " + row + ", Row size: " + rowSize); } }
/** * Determines whether the specified cell exists. * * @param row the cell's row * @param column the cell's column * @return <code>true</code> if the specified cell exists */ public boolean isCellPresent(int row, int column) { if ((row >= getRowCount()) || (row < 0)) { return false; } if ((column < 0) || (column >= getCellCount(row))) { return false; } else { return true; } }
/** * Determines whether the specified cell exists. * * @param row the cell's row * @param column the cell's column * @return <code>true</code> if the specified cell exists */ public boolean isCellPresent(int row, int column) { if ((row >= getRowCount()) || (row < 0)) { return false; } if ((column < 0) || (column >= getCellCount(row))) { return false; } else { return true; } }
/** * Removes all widgets from this table, optionally clearing the inner HTML of * each cell. Note that this method does not remove any cells or rows. * * @param clearInnerHTML should the cell's inner html be cleared? */ public void clear(boolean clearInnerHTML) { for (int row = 0; row < getRowCount(); ++row) { for (int col = 0; col < getCellCount(row); ++col) { cleanCell(row, col, clearInnerHTML); } } }
/** * Removes all widgets from this table, optionally clearing the inner HTML of * each cell. Note that this method does not remove any cells or rows. * * @param clearInnerHTML should the cell's inner html be cleared? */ public void clear(boolean clearInnerHTML) { for (int row = 0; row < getRowCount(); ++row) { for (int col = 0; col < getCellCount(row); ++col) { cleanCell(row, col, clearInnerHTML); } } }
/** * Inserts a new row into the table. * * @param beforeRow the index before which the new row will be inserted * @return the index of the newly-created row * @throws IndexOutOfBoundsException */ protected int insertRow(int beforeRow) { // Specifically allow the row count as an insert position. if (beforeRow != getRowCount()) { checkRowBounds(beforeRow); } Element tr = DOM.createTR(); DOM.insertChild(bodyElem, tr, beforeRow); return beforeRow; }
/** * Inserts a new row into the table. * * @param beforeRow the index before which the new row will be inserted * @return the index of the newly-created row * @throws IndexOutOfBoundsException */ protected int insertRow(int beforeRow) { // Specifically allow the row count as an insert position. if (beforeRow != getRowCount()) { checkRowBounds(beforeRow); } Element tr = DOM.createTR(); DOM.insertChild(bodyElem, tr, beforeRow); return beforeRow; }
/** * <b>Affected Elements:</b> * <ul> * <li>-(row)#-(cell)# = the cell at the given row and cell index.</li> * </ul> * * @see UIObject#onEnsureDebugId(String) */ @Override protected void onEnsureDebugId(String baseID) { super.onEnsureDebugId(baseID); int rowCount = getRowCount(); for (int row = 0; row < rowCount; row++) { int cellCount = getCellCount(row); for (int cell = 0; cell < cellCount; cell++) { Element cellElem = cellFormatter.getRawElement(row, cell); ensureDebugId(cellElem, baseID, row + "-" + cell); } } }
/** * <b>Affected Elements:</b> * <ul> * <li>-(row)#-(cell)# = the cell at the given row and cell index.</li> * </ul> * * @see UIObject#onEnsureDebugId(String) */ @Override protected void onEnsureDebugId(String baseID) { super.onEnsureDebugId(baseID); int rowCount = getRowCount(); for (int row = 0; row < rowCount; row++) { int cellCount = getCellCount(row); for (int cell = 0; cell < cellCount; cell++) { Element cellElem = cellFormatter.getRawElement(row, cell); ensureDebugId(cellElem, baseID, row + "-" + cell); } } }