[Httpunit-commit] CVS: httpunit/src/com/meterware/httpunit FormControl.java,1.34,1.35 FormParameter.
Brought to you by:
russgold
|
From: Russell G. <rus...@us...> - 2003-02-06 02:56:02
|
Update of /cvsroot/httpunit/httpunit/src/com/meterware/httpunit
In directory sc8-pr-cvs1:/tmp/cvs-serv23587/src/com/meterware/httpunit
Modified Files:
FormControl.java FormParameter.java WebForm.java
Log Message:
Added WebForm.isHiddenParameter
Index: FormControl.java
===================================================================
RCS file: /cvsroot/httpunit/httpunit/src/com/meterware/httpunit/FormControl.java,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -r1.34 -r1.35
--- FormControl.java 5 Feb 2003 16:07:38 -0000 1.34
+++ FormControl.java 6 Feb 2003 02:55:58 -0000 1.35
@@ -2,7 +2,7 @@
/********************************************************************************************************************
* $Id$
*
-* Copyright (c) 2001-2002, Russell Gold
+* Copyright (c) 2001-2003, Russell Gold
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation
@@ -133,6 +133,14 @@
/**
+ * Returns true if this control is hidden.
+ **/
+ boolean isHidden() {
+ return false;
+ }
+
+
+ /**
* Returns true if this control is disabled, meaning that it will not send a value to the server as part of a request.
**/
boolean isDisabled() {
@@ -698,6 +706,10 @@
void claimValue( List values ) {
}
+
+ boolean isHidden() {
+ return true;
+ }
}
Index: FormParameter.java
===================================================================
RCS file: /cvsroot/httpunit/httpunit/src/com/meterware/httpunit/FormParameter.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- FormParameter.java 26 Dec 2002 18:55:18 -0000 1.4
+++ FormParameter.java 6 Feb 2003 02:55:58 -0000 1.5
@@ -2,7 +2,7 @@
/********************************************************************************************************************
* $Id$
*
- * Copyright (c) 2002, Russell Gold
+ * Copyright (c) 2002-2003, Russell Gold
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation
@@ -171,6 +171,15 @@
FormControl[] controls = getControls();
for (int i = 0; i < controls.length; i++) {
if (!controls[i].isReadOnly()) return false;
+ }
+ return true;
+ }
+
+
+ public boolean isHiddenParameter() {
+ FormControl[] controls = getControls();
+ for (int i = 0; i < controls.length; i++) {
+ if (!controls[i].isHidden()) return false;
}
return true;
}
Index: WebForm.java
===================================================================
RCS file: /cvsroot/httpunit/httpunit/src/com/meterware/httpunit/WebForm.java,v
retrieving revision 1.75
retrieving revision 1.76
diff -u -r1.75 -r1.76
--- WebForm.java 30 Dec 2002 21:46:55 -0000 1.75
+++ WebForm.java 6 Feb 2003 02:55:58 -0000 1.76
@@ -2,7 +2,7 @@
/********************************************************************************************************************
* $Id$
*
-* Copyright (c) 2000-2002, Russell Gold
+* Copyright (c) 2000-2003, Russell Gold
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation
@@ -409,6 +409,15 @@
**/
public boolean isDisabledParameter( String name ) {
return getParameter( name ).isDisabledParameter();
+ }
+
+
+ /**
+ * Returns true if the named parameter is hidden. If more than one control exists with the same name,
+ * will return true only if all such controls are hidden.
+ **/
+ public boolean isHiddenParameter( String name ) {
+ return getParameter( name ).isHiddenParameter();
}
|