01: package com.meterware.httpunit;
02:
03: /********************************************************************************************************************
04: * $Id: TableRow.java,v 1.1 2006/03/09 01:52:28 russgold Exp $
05: *
06: * Copyright (c) 2005, Russell Gold
07: *
08: *******************************************************************************************************************/
09: import org.w3c.dom.Element;
10:
11: import java.util.ArrayList;
12:
13: import com.meterware.httpunit.scripting.ScriptableDelegate;
14:
15: /**
16: * @author <a href="mailto:russgold@gmail.com">Russell Gold</a>
17: */
18: public class TableRow extends HTMLElementBase {
19:
20: private ArrayList _cells = new ArrayList();
21: private WebTable _webTable;
22:
23: TableRow(WebTable webTable, Element rowNode) {
24: super (rowNode);
25: _webTable = webTable;
26: }
27:
28: TableCell[] getCells() {
29: return (TableCell[]) _cells
30: .toArray(new TableCell[_cells.size()]);
31: }
32:
33: TableCell newTableCell(Element element) {
34: return _webTable.newTableCell(element);
35: }
36:
37: void addTableCell(TableCell cell) {
38: _cells.add(cell);
39: }
40:
41: protected ScriptableDelegate newScriptable() {
42: return new HTMLElementScriptable(this );
43: }
44:
45: protected ScriptableDelegate getParentDelegate() {
46: return _webTable.getParentDelegate();
47: }
48: }
|