diff options
| author | Chris Burdess <dog@bluezoo.org> | 2005-03-14 21:10:55 +0000 |
|---|---|---|
| committer | Chris Burdess <dog@bluezoo.org> | 2005-03-14 21:10:55 +0000 |
| commit | 979240c8070a8c66ab7cea9af3c83e110f1cb183 (patch) | |
| tree | eb3d6c35c5896c24ba267c9d2ce57b44344ce20b /gnu/xml/dom/html2/DomHTMLTableSectionElement.java | |
| parent | f519552dd3a17e6c8896050a9e2c767db5f21734 (diff) | |
| download | classpath-979240c8070a8c66ab7cea9af3c83e110f1cb183.tar.gz | |
2005-03-14 Chris Burdess <dog@gnu.org>
* gnu/xml/dom/DomImpl.java,
gnu/xml/dom/html2/DomHTMLAnchorElement.java,
gnu/xml/dom/html2/DomHTMLDocument.java,
gnu/xml/dom/html2/DomHTMLElement.java,
gnu/xml/dom/html2/DomHTMLFormElement.java,
gnu/xml/dom/html2/DomHTMLFrameElement.java,
gnu/xml/dom/html2/DomHTMLIFrameElement.java,
gnu/xml/dom/html2/DomHTMLImpl.java,
gnu/xml/dom/html2/DomHTMLInputElement.java,
gnu/xml/dom/html2/DomHTMLObjectElement.java,
gnu/xml/dom/html2/DomHTMLOptionElement.java,
gnu/xml/dom/html2/DomHTMLSelectElement.java,
gnu/xml/dom/html2/DomHTMLTableCellElement.java,
gnu/xml/dom/html2/DomHTMLTableElement.java,
gnu/xml/dom/html2/DomHTMLTableRowElement.java,
gnu/xml/dom/html2/DomHTMLTableSectionElement.java,
gnu/xml/dom/html2/DomHTMLTextAreaElement.java: JAXP integration,
UI events, and tree utility functions.
Diffstat (limited to 'gnu/xml/dom/html2/DomHTMLTableSectionElement.java')
| -rw-r--r-- | gnu/xml/dom/html2/DomHTMLTableSectionElement.java | 42 |
1 files changed, 39 insertions, 3 deletions
diff --git a/gnu/xml/dom/html2/DomHTMLTableSectionElement.java b/gnu/xml/dom/html2/DomHTMLTableSectionElement.java index c2247dfb7..45dd67110 100644 --- a/gnu/xml/dom/html2/DomHTMLTableSectionElement.java +++ b/gnu/xml/dom/html2/DomHTMLTableSectionElement.java @@ -37,6 +37,9 @@ exception statement from your version. */ package gnu.xml.dom.html2; +import gnu.xml.dom.DomDOMException; +import org.w3c.dom.DOMException; +import org.w3c.dom.Node; import org.w3c.dom.html2.HTMLCollection; import org.w3c.dom.html2.HTMLElement; import org.w3c.dom.html2.HTMLTableSectionElement; @@ -109,13 +112,46 @@ public class DomHTMLTableSectionElement public HTMLElement insertRow(int index) { - // TODO - return null; + Node ref = getRow(index); + Node row = getOwnerDocument().createElement("tr"); + if (ref == null) + { + appendChild(row); + } + else + { + insertBefore(row, ref); + } + return (HTMLElement) row; } public void deleteRow(int index) { - // TODO + Node ref = getRow(index); + if (ref == null) + { + throw new DomDOMException(DOMException.INDEX_SIZE_ERR); + } + removeChild(ref); + } + + Node getRow(final int index) + { + int i = 0; + for (Node ctx = getFirstChild(); ctx != null; + ctx = ctx.getNextSibling()) + { + if (!"tr".equalsIgnoreCase(ctx.getLocalName())) + { + continue; + } + if (index == i) + { + return ctx; + } + i++; + } + return null; } } |
