/[classpath]/classpath/gnu/xml/dom/html2/DomHTMLTableSectionElement.java
ViewVC logotype

Diff of /classpath/gnu/xml/dom/html2/DomHTMLTableSectionElement.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1.2.1 by gnu_andrew, Sun Mar 13 14:38:33 2005 UTC revision 1.1.2.2 by gnu_andrew, Wed Mar 23 21:00:04 2005 UTC
# Line 37  exception statement from your version. * Line 37  exception statement from your version. *
37    
38  package gnu.xml.dom.html2;  package gnu.xml.dom.html2;
39    
40    import gnu.xml.dom.DomDOMException;
41    import org.w3c.dom.DOMException;
42    import org.w3c.dom.Node;
43  import org.w3c.dom.html2.HTMLCollection;  import org.w3c.dom.html2.HTMLCollection;
44  import org.w3c.dom.html2.HTMLElement;  import org.w3c.dom.html2.HTMLElement;
45  import org.w3c.dom.html2.HTMLTableSectionElement;  import org.w3c.dom.html2.HTMLTableSectionElement;
# Line 109  public class DomHTMLTableSectionElement Line 112  public class DomHTMLTableSectionElement
112    
113    public HTMLElement insertRow(int index)    public HTMLElement insertRow(int index)
114    {    {
115      // TODO      Node ref = getRow(index);
116      return null;      Node row = getOwnerDocument().createElement("tr");
117        if (ref == null)
118          {
119            appendChild(row);
120          }
121        else
122          {
123            insertBefore(row, ref);
124          }
125        return (HTMLElement) row;
126    }    }
127    
128    public void deleteRow(int index)    public void deleteRow(int index)
129    {    {
130      // TODO      Node ref = getRow(index);
131        if (ref == null)
132          {
133            throw new DomDOMException(DOMException.INDEX_SIZE_ERR);
134          }
135        removeChild(ref);
136      }
137      
138      Node getRow(final int index)
139      {
140        int i = 0;
141        for (Node ctx = getFirstChild(); ctx != null;
142             ctx = ctx.getNextSibling())
143          {
144            if (!"tr".equalsIgnoreCase(ctx.getLocalName()))
145              {
146                continue;
147              }
148            if (index == i)
149              {
150                return ctx;
151              }
152            i++;
153          }
154        return null;
155    }    }
156        
157  }  }

Legend:
Removed from v.1.1.2.1  
changed lines
  Added in v.1.1.2.2

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26