/** * Deletes the cell at the specified index in the element's cells collection. If the index * is -1 (or while simulating IE, when there is no index specified), then the last cell is deleted. * @see <a href="http://msdn.microsoft.com/en-us/library/ms536406.aspx">MSDN Documentation</a> * @see <a href="http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html#ID-11738598">W3C DOM Level2</a> * @param index specifies the cell to delete. */ public void jsxFunction_deleteCell(final Object index) { int position = -1; if (index != Undefined.instance) { position = (int) Context.toNumber(index); } else if (getBrowserVersion().isFirefox()) { throw Context.reportRuntimeError("No enough arguments"); } final HtmlTableRow htmlRow = (HtmlTableRow) getDomNodeOrDie(); if (position == -1) { position = htmlRow.getCells().size() - 1; } final boolean indexValid = (position >= -1 && position <= htmlRow.getCells().size()); if (!indexValid) { throw Context.reportRuntimeError("Index or size is negative or greater than the allowed amount"); } htmlRow.getCell(position).remove(); } }
for(HtmlTableRow row : billsTable.getBodies().get(0).getRows()){ String label = row.getCell(1).asText(); Date date = new SimpleDateFormat("MMMM d, yyyy", Locale.ENGLISH).parse(row.getCell(0).asText()); BigDecimal amount =new BigDecimal(row.getCell(2).asText().replace("$", "")); String url = ((HtmlAnchor) row.getCell(3).getFirstChild()).getHrefAttribute();
/** * Deletes the cell at the specified index in the element's cells collection. If the index * is -1 (or while simulating IE, when there is no index specified), then the last cell is deleted. * @see <a href="http://msdn.microsoft.com/en-us/library/ms536406.aspx">MSDN Documentation</a> * @see <a href="http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html#ID-11738598">W3C DOM Level2</a> * @param index specifies the cell to delete. */ public void jsxFunction_deleteCell(final Object index) { int position = -1; if (index != Undefined.instance) { position = (int) Context.toNumber(index); } else if (getBrowserVersion().isFirefox()) { throw Context.reportRuntimeError("No enough arguments"); } final HtmlTableRow htmlRow = (HtmlTableRow) getDomNodeOrDie(); if (position == -1) { position = htmlRow.getCells().size() - 1; } final boolean indexValid = (position >= -1 && position <= htmlRow.getCells().size()); if (!indexValid) { throw Context.reportRuntimeError("Index or size is negative or greater than the allowed amount"); } htmlRow.getCell(position).remove(); } }
/** * Deletes the cell at the specified index in the element's cells collection. If the index * is -1 (or while simulating IE, when there is no index specified), then the last cell is deleted. * @see <a href="http://msdn.microsoft.com/en-us/library/ms536406.aspx">MSDN Documentation</a> * @see <a href="http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html#ID-11738598">W3C DOM Level2</a> * @param index specifies the cell to delete. */ public void jsxFunction_deleteCell(final Object index) { int position = -1; if (index != Undefined.instance) { position = (int) Context.toNumber(index); } else if (getBrowserVersion().isFirefox()) { throw Context.reportRuntimeError("No enough arguments"); } final HtmlTableRow htmlRow = (HtmlTableRow) getDomNodeOrDie(); if (position == -1) { position = htmlRow.getCells().size() - 1; } final boolean indexValid = (position >= -1 && position <= htmlRow.getCells().size()); if (!indexValid) { throw Context.reportRuntimeError("Index or size is negative or greater than the allowed amount"); } htmlRow.getCell(position).remove(); } }
/** * Deletes the cell at the specified index in the element's cells collection. If the index * is -1 (or while simulating IE, when there is no index specified), then the last cell is deleted. * @see <a href="http://msdn.microsoft.com/en-us/library/ms536406.aspx">MSDN Documentation</a> * @see <a href="http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html#ID-11738598">W3C DOM Level2</a> * @param index specifies the cell to delete. */ @JsxFunction public void deleteCell(final Object index) { int position = -1; if (index != Undefined.instance) { position = (int) Context.toNumber(index); } else if (getBrowserVersion().hasFeature(JS_TABLE_ROW_DELETE_CELL_REQUIRES_INDEX)) { throw Context.reportRuntimeError("No enough arguments"); } final HtmlTableRow htmlRow = (HtmlTableRow) getDomNodeOrDie(); if (position == -1) { position = htmlRow.getCells().size() - 1; } final boolean indexValid = position >= -1 && position <= htmlRow.getCells().size(); if (!indexValid) { throw Context.reportRuntimeError("Index or size is negative or greater than the allowed amount"); } htmlRow.getCell(position).remove(); }
/** * Inserts a new cell at the specified index in the element's cells collection. If the index * is -1 or there is no index specified, then the cell is appended at the end of the * element's cells collection. * @see <a href="http://msdn.microsoft.com/en-us/library/ms536455.aspx">MSDN Documentation</a> * @param index specifies where to insert the cell in the tr. * The default value is -1, which appends the new cell to the end of the cells collection * @return the newly-created cell */ public Object jsxFunction_insertCell(final Object index) { int position = -1; if (index != Undefined.instance) { position = (int) Context.toNumber(index); } final HtmlTableRow htmlRow = (HtmlTableRow) getDomNodeOrDie(); final boolean indexValid = (position >= -1 && position <= htmlRow.getCells().size()); if (indexValid) { final HtmlElement newCell = ((HtmlPage) htmlRow.getPage()).createElement("td"); if (position == -1 || position == htmlRow.getCells().size()) { htmlRow.appendChild(newCell); } else { htmlRow.getCell(position).insertBefore(newCell); } return getScriptableFor(newCell); } throw Context.reportRuntimeError("Index or size is negative or greater than the allowed amount"); }
/** * Inserts a new cell at the specified index in the element's cells collection. If the index * is -1 or there is no index specified, then the cell is appended at the end of the * element's cells collection. * @see <a href="http://msdn.microsoft.com/en-us/library/ms536455.aspx">MSDN Documentation</a> * @param index specifies where to insert the cell in the tr. * The default value is -1, which appends the new cell to the end of the cells collection * @return the newly-created cell */ public Object jsxFunction_insertCell(final Object index) { int position = -1; if (index != Undefined.instance) { position = (int) Context.toNumber(index); } final HtmlTableRow htmlRow = (HtmlTableRow) getDomNodeOrDie(); final boolean indexValid = (position >= -1 && position <= htmlRow.getCells().size()); if (indexValid) { final HtmlElement newCell = ((HtmlPage) htmlRow.getPage()).createElement("td"); if (position == -1 || position == htmlRow.getCells().size()) { htmlRow.appendChild(newCell); } else { htmlRow.getCell(position).insertBefore(newCell); } return getScriptableFor(newCell); } throw Context.reportRuntimeError("Index or size is negative or greater than the allowed amount"); }
/** * Inserts a new cell at the specified index in the element's cells collection. If the index * is -1 or there is no index specified, then the cell is appended at the end of the * element's cells collection. * @see <a href="http://msdn.microsoft.com/en-us/library/ms536455.aspx">MSDN Documentation</a> * @param index specifies where to insert the cell in the tr. * The default value is -1, which appends the new cell to the end of the cells collection * @return the newly-created cell */ public Object jsxFunction_insertCell(final Object index) { int position = -1; if (index != Undefined.instance) { position = (int) Context.toNumber(index); } final HtmlTableRow htmlRow = (HtmlTableRow) getDomNodeOrDie(); final boolean indexValid = (position >= -1 && position <= htmlRow.getCells().size()); if (indexValid) { final HtmlElement newCell = ((HtmlPage) htmlRow.getPage()).createElement("td"); if (position == -1 || position == htmlRow.getCells().size()) { htmlRow.appendChild(newCell); } else { htmlRow.getCell(position).insertBefore(newCell); } return getScriptableFor(newCell); } throw Context.reportRuntimeError("Index or size is negative or greater than the allowed amount"); }
/** * Deletes the cell at the specified index in the element's cells collection. If the index * is -1 (or while simulating IE, when there is no index specified), then the last cell is deleted. * @see <a href="http://msdn.microsoft.com/en-us/library/ms536406.aspx">MSDN Documentation</a> * @see <a href="http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html#ID-11738598">W3C DOM Level2</a> * @param index specifies the cell to delete. */ @JsxFunction public void deleteCell(final Object index) { int position = -1; if (index != Undefined.instance) { position = (int) Context.toNumber(index); } else if (getBrowserVersion().hasFeature(JS_TABLE_ROW_DELETE_CELL_REQUIRES_INDEX)) { throw Context.reportRuntimeError("No enough arguments"); } final HtmlTableRow htmlRow = (HtmlTableRow) getDomNodeOrDie(); if (position == -1) { position = htmlRow.getCells().size() - 1; } final boolean indexValid = position >= -1 && position <= htmlRow.getCells().size(); if (!indexValid) { throw Context.reportRuntimeError("Index or size is negative or greater than the allowed amount"); } htmlRow.getCell(position).remove(); }
/** * Inserts a new cell at the specified index in the element's cells collection. If the index * is -1 or there is no index specified, then the cell is appended at the end of the * element's cells collection. * @see <a href="http://msdn.microsoft.com/en-us/library/ms536455.aspx">MSDN Documentation</a> * @param index specifies where to insert the cell in the tr. * The default value is -1, which appends the new cell to the end of the cells collection * @return the newly-created cell */ @JsxFunction public Object insertCell(final Object index) { int position = -1; if (index != Undefined.instance) { position = (int) Context.toNumber(index); } final HtmlTableRow htmlRow = (HtmlTableRow) getDomNodeOrDie(); final boolean indexValid = position >= -1 && position <= htmlRow.getCells().size(); if (indexValid) { final DomElement newCell = ((HtmlPage) htmlRow.getPage()).createElement("td"); if (position == -1 || position == htmlRow.getCells().size()) { htmlRow.appendChild(newCell); } else { htmlRow.getCell(position).insertBefore(newCell); } return getScriptableFor(newCell); } throw Context.reportRuntimeError("Index or size is negative or greater than the allowed amount"); }
/** * Inserts a new cell at the specified index in the element's cells collection. If the index * is -1 or there is no index specified, then the cell is appended at the end of the * element's cells collection. * @see <a href="http://msdn.microsoft.com/en-us/library/ms536455.aspx">MSDN Documentation</a> * @param index specifies where to insert the cell in the tr. * The default value is -1, which appends the new cell to the end of the cells collection * @return the newly-created cell */ @JsxFunction public Object insertCell(final Object index) { int position = -1; if (index != Undefined.instance) { position = (int) Context.toNumber(index); } final HtmlTableRow htmlRow = (HtmlTableRow) getDomNodeOrDie(); final boolean indexValid = position >= -1 && position <= htmlRow.getCells().size(); if (indexValid) { final DomElement newCell = ((HtmlPage) htmlRow.getPage()).createElement("td"); if (position == -1 || position == htmlRow.getCells().size()) { htmlRow.appendChild(newCell); } else { htmlRow.getCell(position).insertBefore(newCell); } return getScriptableFor(newCell); } throw Context.reportRuntimeError("Index or size is negative or greater than the allowed amount"); }