[Httpunit-commit] CVS: httpunit/src/com/meterware/httpunit WebForm.java,1.47,1.48
Brought to you by:
russgold
|
From: Russell G. <rus...@us...> - 2002-03-14 22:18:29
|
Update of /cvsroot/httpunit/httpunit/src/com/meterware/httpunit
In directory usw-pr-cvs1:/tmp/cvs-serv9348/src/com/meterware/httpunit
Modified Files:
WebForm.java
Log Message:
Added support for changing the action of a form
Index: WebForm.java
===================================================================
RCS file: /cvsroot/httpunit/httpunit/src/com/meterware/httpunit/WebForm.java,v
retrieving revision 1.47
retrieving revision 1.48
diff -u -r1.47 -r1.48
--- WebForm.java 21 Feb 2002 21:13:32 -0000 1.47
+++ WebForm.java 14 Mar 2002 22:18:26 -0000 1.48
@@ -19,13 +19,16 @@
* DEALINGS IN THE SOFTWARE.
*
*******************************************************************************************************************/
+import java.io.IOException;
import java.net.URL;
-import java.util.*;
-import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Vector;
-import org.w3c.dom.Element;
-import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
@@ -51,7 +54,8 @@
* Returns the action defined for this form.
**/
public String getAction() {
- return getDestination();
+ if (_action == null) _action = getDestination();
+ return _action;
}
@@ -268,6 +272,14 @@
}
}
+
+ /**
+ * Returns an object which provides scripting access to this form.
+ **/
+ public ScriptableObject getScriptableObject() {
+ return new ScriptableObject();
+ }
+
//---------------------------------- WebRequestSource methods --------------------------------
/**
@@ -388,6 +400,12 @@
}
+ public class ScriptableObject {
+ public String getAction() { return WebForm.this.getAction(); }
+ public void setAction( String newAction ) { _action = newAction; }
+ }
+
+
//---------------------------------- package members --------------------------------
/**
@@ -420,6 +438,8 @@
private FormControl[] _presetParameters;
private ArrayList _presets;
+
+ private String _action;
private SubmitButton getDefaultButton() {
|