\ No newline at end of file
--===============2983524509024261660==--
From richfaces-svn-commits at lists.jboss.org Fri Mar 4 14:24:43 2011
Content-Type: multipart/mixed; boundary="===============5600605317508719087=="
MIME-Version: 1.0
From: richfaces-svn-commits at lists.jboss.org
To: richfaces-svn-commits at lists.jboss.org
Subject: [richfaces-svn-commits] JBoss Rich Faces SVN: r22065 -
branches/4.0.X/ui/core/ui/src/main/java/org/richfaces/component.
Date: Fri, 04 Mar 2011 14:24:41 -0500
Message-ID: <201103041924.p24JOf7H017104@svn01.web.mwc.hst.phx2.redhat.com>
--===============5600605317508719087==
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable
Author: nbelaevski
Date: 2011-03-04 14:24:40 -0500 (Fri, 04 Mar 2011)
New Revision: 22065
Modified:
branches/4.0.X/ui/core/ui/src/main/java/org/richfaces/component/Abstract=
CommandButton.java
Log:
https://issues.jboss.org/browse/RF-10702
Modified: branches/4.0.X/ui/core/ui/src/main/java/org/richfaces/component/A=
bstractCommandButton.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/4.0.X/ui/core/ui/src/main/java/org/richfaces/component/Abstrac=
tCommandButton.java 2011-03-04 14:45:44 UTC (rev 22064)
+++ branches/4.0.X/ui/core/ui/src/main/java/org/richfaces/component/Abstrac=
tCommandButton.java 2011-03-04 19:24:40 UTC (rev 22065)
@@ -25,6 +25,7 @@
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
=
+import org.richfaces.cdk.annotations.Attribute;
import org.richfaces.cdk.annotations.JsfComponent;
import org.richfaces.cdk.annotations.JsfRenderer;
import org.richfaces.cdk.annotations.Tag;
@@ -45,6 +46,9 @@
=
public static final String COMPONENT_FAMILY =3D UICommand.COMPONENT_FA=
MILY;
=
+ @Attribute
+ public abstract String getImage();
+ =
public String resolveClientId(FacesContext facesContext, UIComponent c=
ontextComponent, String metaComponentId) {
return null;
}
--===============5600605317508719087==--
From richfaces-svn-commits at lists.jboss.org Fri Mar 4 17:55:39 2011
Content-Type: multipart/mixed; boundary="===============3684406486611051737=="
MIME-Version: 1.0
From: richfaces-svn-commits at lists.jboss.org
To: richfaces-svn-commits at lists.jboss.org
Subject: [richfaces-svn-commits] JBoss Rich Faces SVN: r22066 - in
branches/4.0.X: examples/validator-demo/src/main/java/org/richfaces/example
and 12 other directories.
Date: Fri, 04 Mar 2011 17:55:39 -0500
Message-ID: <201103042255.p24Mtdkt023574@svn01.web.mwc.hst.phx2.redhat.com>
--===============3684406486611051737==
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable
Author: alexsmirnov
Date: 2011-03-04 17:55:38 -0500 (Fri, 04 Mar 2011)
New Revision: 22066
Added:
branches/4.0.X/examples/validator-demo/src/main/java/org/richfaces/examp=
le/PasswordValidationBean.java
branches/4.0.X/examples/validator-demo/src/main/webapp/examples/password=
Validation.xhtml
branches/4.0.X/examples/validator-demo/src/main/webapp/resources/org.ric=
hfaces.showcase/
branches/4.0.X/examples/validator-demo/src/main/webapp/resources/org.ric=
hfaces.showcase/test.xhtml
branches/4.0.X/examples/validator-demo/src/main/webapp/resources/org.ric=
hfaces.showcase/test1.xhtml
branches/4.0.X/examples/validator-demo/src/main/webapp/richfaces/
branches/4.0.X/examples/validator-demo/src/main/webapp/richfaces/graphVa=
lidator/
branches/4.0.X/examples/validator-demo/src/main/webapp/richfaces/graphVa=
lidator/samples/
Removed:
branches/4.0.X/ui/validator/ui/src/main/java/org/richfaces/validator/Clo=
nedObjectResolver.java
Modified:
branches/4.0.X/examples/template/src/main/webapp/layout/pagesList.xhtml
branches/4.0.X/ui/validator/api/src/main/java/org/richfaces/el/ValueDesc=
riptor.java
branches/4.0.X/ui/validator/api/src/main/java/org/richfaces/el/ValueExpr=
essionAnalayser.java
branches/4.0.X/ui/validator/api/src/main/java/org/richfaces/validator/Gr=
aphValidatorState.java
branches/4.0.X/ui/validator/ui/src/main/java/org/richfaces/component/Abs=
tractGraphValidator.java
branches/4.0.X/ui/validator/ui/src/main/java/org/richfaces/el/CapturingE=
LContext.java
branches/4.0.X/ui/validator/ui/src/main/java/org/richfaces/el/ValueExpre=
ssionAnalayserImpl.java
branches/4.0.X/ui/validator/ui/src/main/java/org/richfaces/validator/Bea=
nValidatorServiceImpl.java
branches/4.0.X/ui/validator/ui/src/test/java/org/richfaces/el/ELTestBase=
.java
branches/4.0.X/ui/validator/ui/src/test/java/org/richfaces/el/TestCaptur=
eEL.java
branches/4.0.X/ui/validator/ui/src/test/java/org/richfaces/el/ValueExpre=
ssionAnalayserTest.java
Log:
Nick's code reviewed. =
RESOLVED - issue RF-10610: BeanValidator ignores javax.faces.el.CompositeCo=
mponentExpressionHolder =
https://issues.jboss.org/browse/RF-10610
https://issues.jboss.org/browse/RF-10456
Modified: branches/4.0.X/examples/template/src/main/webapp/layout/pagesList=
.xhtml
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/4.0.X/examples/template/src/main/webapp/layout/pagesList.xhtml=
2011-03-04 19:24:40 UTC (rev 22065)
+++ branches/4.0.X/examples/template/src/main/webapp/layout/pagesList.xhtml=
2011-03-04 22:55:38 UTC (rev 22066)
@@ -8,7 +8,7 @@
- #{page.title}
+
Added: branches/4.0.X/examples/validator-demo/src/main/java/org/richfaces/e=
xample/PasswordValidationBean.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/4.0.X/examples/validator-demo/src/main/java/org/richfaces/exam=
ple/PasswordValidationBean.java (rev 0)
+++ branches/4.0.X/examples/validator-demo/src/main/java/org/richfaces/exam=
ple/PasswordValidationBean.java 2011-03-04 22:55:38 UTC (rev 22066)
@@ -0,0 +1,49 @@
+package org.richfaces.example;
+
+import java.io.Serializable;
+
+import javax.faces.application.FacesMessage;
+import javax.faces.bean.ManagedBean;
+import javax.faces.bean.SessionScoped;
+import javax.faces.context.FacesContext;
+import javax.validation.constraints.AssertTrue;
+import javax.validation.constraints.Size;
+
+(a)ManagedBean
+(a)SessionScoped
+public class PasswordValidationBean implements Cloneable, Serializable{
+ /**
+ * =
+ */
+ private static final long serialVersionUID =3D 1952428504080910113L;
+ @Size(min =3D 5, max =3D 15, message =3D "Wrong size for password")
+ private String password=3D"";
+ @Size(min =3D 5, max =3D 15, message =3D "Wrong size for confirmation")
+ private String confirm=3D"";
+
+ @AssertTrue(message =3D "Different passwords entered!")
+ public boolean isPasswordsEquals() {
+ return password.equals(confirm);
+ }
+
+ public void storeNewPassword() {
+ FacesContext.getCurrentInstance().addMessage(null,
+ new FacesMessage(FacesMessage.SEVERITY_INFO, "Succesfully chan=
ged!", "Succesfully changed!"));
+ }
+
+ public void setPassword(String password) {
+ this.password =3D password;
+ }
+
+ public void setConfirm(String confirm) {
+ this.confirm =3D confirm;
+ }
+
+ public String getPassword() {
+ return password;
+ }
+
+ public String getConfirm() {
+ return confirm;
+ } =
+}
Property changes on: branches/4.0.X/examples/validator-demo/src/main/java/o=
rg/richfaces/example/PasswordValidationBean.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: branches/4.0.X/examples/validator-demo/src/main/webapp/examples/pass=
wordValidation.xhtml
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/4.0.X/examples/validator-demo/src/main/webapp/examples/passwor=
dValidation.xhtml (rev 0)
+++ branches/4.0.X/examples/validator-demo/src/main/webapp/examples/passwor=
dValidation.xhtml 2011-03-04 22:55:38 UTC (rev 22066)
@@ -0,0 +1,91 @@
+
+
+
+
+
+
+ <csv:graphValidator> usage, password validation
+
+
+
+
+
+
+
+
+
+
+
+ Simple
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Test
+
+
+
+
+
+
+
+
+
+
+ Test A
+
+
+
+
+
+
+
+
+
+ Test1
+
+
+
+
+
+
+
+
\ No newline at end of file
Property changes on: branches/4.0.X/examples/validator-demo/src/main/webapp=
/examples/passwordValidation.xhtml
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: branches/4.0.X/examples/validator-demo/src/main/webapp/resources/org=
.richfaces.showcase/test.xhtml
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/4.0.X/examples/validator-demo/src/main/webapp/resources/org.ri=
chfaces.showcase/test.xhtml (rev 0)
+++ branches/4.0.X/examples/validator-demo/src/main/webapp/resources/org.ri=
chfaces.showcase/test.xhtml 2011-03-04 22:55:38 UTC (rev 22066)
@@ -0,0 +1,30 @@
+
+
+
+
panel
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Property changes on: branches/4.0.X/examples/validator-demo/src/main/webapp=
/resources/org.richfaces.showcase/test.xhtml
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: branches/4.0.X/examples/validator-demo/src/main/webapp/resources/org=
.richfaces.showcase/test1.xhtml
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/4.0.X/examples/validator-demo/src/main/webapp/resources/org.ri=
chfaces.showcase/test1.xhtml (rev 0)
+++ branches/4.0.X/examples/validator-demo/src/main/webapp/resources/org.ri=
chfaces.showcase/test1.xhtml 2011-03-04 22:55:38 UTC (rev 22066)
@@ -0,0 +1,40 @@
+
+
+
+
panel
+
+
+
+
+
+
+
+
+ #{cc.attrs.bean} a
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Property changes on: branches/4.0.X/examples/validator-demo/src/main/webapp=
/resources/org.richfaces.showcase/test1.xhtml
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: branches/4.0.X/ui/validator/api/src/main/java/org/richfaces/el/Va=
lueDescriptor.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/4.0.X/ui/validator/api/src/main/java/org/richfaces/el/ValueDes=
criptor.java 2011-03-04 19:24:40 UTC (rev 22065)
+++ branches/4.0.X/ui/validator/api/src/main/java/org/richfaces/el/ValueDes=
criptor.java 2011-03-04 22:55:38 UTC (rev 22066)
@@ -14,24 +14,17 @@
=
private final Class> beanType;
=
- private final Class> propertyType;
-
/**
* @param beanType
* @param name
* @param propertyType
* @param readOnly
*/
- public ValueDescriptor(Class> beanType, String name, Class> proper=
tyType) {
+ public ValueDescriptor(Class> beanType, String name) {
this.beanType =3D beanType;
this.name =3D name;
- this.propertyType =3D propertyType;
}
=
- public ValueDescriptor(Class> beanType, String name) {
- this(beanType,name,Object.class);
- }
-
/**
* @return the name
*/
@@ -47,13 +40,6 @@
return beanType;
}
=
- /**
- * @return the propertyType
- */
- public Class> getPropertyType() {
- return propertyType;
- }
-
/* (non-Javadoc)
* @see java.lang.Object#hashCode()
*/
Modified: branches/4.0.X/ui/validator/api/src/main/java/org/richfaces/el/Va=
lueExpressionAnalayser.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/4.0.X/ui/validator/api/src/main/java/org/richfaces/el/ValueExp=
ressionAnalayser.java 2011-03-04 19:24:40 UTC (rev 22065)
+++ branches/4.0.X/ui/validator/api/src/main/java/org/richfaces/el/ValueExp=
ressionAnalayser.java 2011-03-04 22:55:38 UTC (rev 22066)
@@ -3,6 +3,7 @@
*/
package org.richfaces.el;
=
+import javax.el.ELException;
import javax.el.ValueExpression;
import javax.faces.context.FacesContext;
=
@@ -13,6 +14,8 @@
*/
public interface ValueExpressionAnalayser {
=
- ValueDescriptor getPropertyDescriptor(FacesContext context, ValueExpre=
ssion expression);
+ ValueDescriptor getPropertyDescriptor(FacesContext context, ValueExpre=
ssion expression) throws ELException;
=
+ ValueDescriptor updateValueAndGetPropertyDescriptor(FacesContext conte=
xt, ValueExpression expression, Object newValue) throws ELException;
+ =
}
Modified: branches/4.0.X/ui/validator/api/src/main/java/org/richfaces/valid=
ator/GraphValidatorState.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/4.0.X/ui/validator/api/src/main/java/org/richfaces/validator/G=
raphValidatorState.java 2011-03-04 19:24:40 UTC (rev 22065)
+++ branches/4.0.X/ui/validator/api/src/main/java/org/richfaces/validator/G=
raphValidatorState.java 2011-03-04 22:55:38 UTC (rev 22066)
@@ -1,12 +1,21 @@
package org.richfaces.validator;
=
+import java.util.IdentityHashMap;
+import java.util.Map;
=
+import javax.faces.context.FacesContext;
+
+
public final class GraphValidatorState {
- public static final String STATE_ATTRIBUTE_PREFIX =3D "org.richfaces.G=
raphValidator:";
- boolean active =3D false;
- Object cloned;
- Object base;
- Object property;
+ public static final String STATE_ATTRIBUTE =3D "org.richfaces.GraphVal=
idator:";
+ private boolean active =3D false;
+ private final Object cloned;
+ =
+ =
+ public GraphValidatorState(Object cloned) {
+ this.cloned =3D cloned;
+ }
+ =
/**
* @return the active
*/
@@ -29,57 +38,28 @@
return cloned;
}
=
- /**
- * @param cloned
- * the cloned to set
- */
- public void setCloned(Object cloned) {
- this.cloned =3D cloned;
+ public static Object getActiveClone(FacesContext context,Object base){
+ GraphValidatorState state =3D getState(context, base);
+ if(null =3D=3D state || !state.isActive()){
+ return null;
+ }
+ return state.getCloned();
}
=
- /**
- * @return the base
- */
- public Object getBase() {
- return base;
+ public static GraphValidatorState getState(FacesContext context,Object=
base){
+ return getStateMap(context).get(base);
}
=
- /**
- * @param base
- * the base to set
- */
- public void setBase(Object base) {
- this.base =3D base;
+ public static void setState(FacesContext context,Object base,GraphVali=
datorState state){
+ getStateMap(context).put(base, state);
}
-
- /**
- * @return the property
- */
- public Object getProperty() {
- return property;
- }
-
- /**
- * @param property
- * the property to set
- */
- public void setProperty(Object property) {
- this.property =3D property;
- }
-
- public boolean isSameBase(Object base) {
- return (null =3D=3D base && null =3D=3D this.base) || (base =3D=3D=
this.base);
- }
-
- public boolean isSameProperty(Object property) {
- if (null =3D=3D this.property) {
- return null =3D=3D property;
- } else {
- return this.property.equals(property);
+ =
+ private static Map
getStateMap(FacesConte=
xt context){
+ IdentityHashMap statesMap =3D (Identi=
tyHashMap) context.getAttributes().get(STATE_A=
TTRIBUTE);
+ if(null =3D=3D statesMap){
+ statesMap =3D new IdentityHashMap=
();
+ context.getAttributes().put(STATE_ATTRIBUTE, statesMap);
}
+ return statesMap;
}
-
- public boolean isSame(Object base, Object property) {
- return isSameBase(base) && isSameProperty(property) && active;
- }
}
\ No newline at end of file
Modified: branches/4.0.X/ui/validator/ui/src/main/java/org/richfaces/compon=
ent/AbstractGraphValidator.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/4.0.X/ui/validator/ui/src/main/java/org/richfaces/component/Ab=
stractGraphValidator.java 2011-03-04 19:24:40 UTC (rev 22065)
+++ branches/4.0.X/ui/validator/ui/src/main/java/org/richfaces/component/Ab=
stractGraphValidator.java 2011-03-04 22:55:38 UTC (rev 22066)
@@ -25,7 +25,6 @@
import java.lang.reflect.Modifier;
import java.util.Collection;
=
-import javax.el.ELContext;
import javax.el.ValueExpression;
import javax.faces.FacesException;
import javax.faces.application.FacesMessage;
@@ -38,8 +37,6 @@
import org.richfaces.cdk.annotations.JsfComponent;
import org.richfaces.cdk.annotations.Tag;
import org.richfaces.cdk.annotations.TagType;
-import org.richfaces.el.CapturingELResolver;
-import org.richfaces.el.ELContextWrapper;
import org.richfaces.log.Logger;
import org.richfaces.log.RichfacesLogger;
import org.richfaces.validator.BeanValidatorService;
@@ -122,38 +119,26 @@
@Override
public void processDecodes(FacesContext context) {
GraphValidatorState validatorState =3D null;
- // Detect value EL-expression.
- ValueExpression valueExpression =3D getValueExpression("value");
- if (null !=3D valueExpression) {
-
- Object value =3D getValue();
- if (null !=3D value && value instanceof Cloneable) {
+ boolean wasActive =3D false;
+ Object value =3D getValue();
+ if (null !=3D value) {
+ validatorState =3D GraphValidatorState.getState(context, value=
);
+ if (null !=3D validatorState) {
+ // Reuse old value, if any.
+ wasActive =3D validatorState.isActive();
+ validatorState.setActive(true);
+ } else if (value instanceof Cloneable) {
try {
- ELContext initialELContext =3D context.getELContext();
-
- CapturingELResolver capturingELResolver =3D new Captur=
ingELResolver(initialELContext.getELResolver());
- Class> type =3D
- valueExpression.getType(new ELContextWrapper(initi=
alELContext, capturingELResolver));
- if (null !=3D type) {
- validatorState =3D new GraphValidatorState();
- Method method =3D getCloneMethod(value.getClass());
- if (!Modifier.isPublic(method.getModifiers())) {
- // Method Object#clone() is protected by defau=
lt. Make it public
- // unless developer did it.
- method.setAccessible(true);
- }
- validatorState.setCloned(method.invoke(value));
- validatorState.setBase(capturingELResolver.getBase=
());
- validatorState.setProperty(capturingELResolver.get=
Property());
- validatorState.setActive(true);
- context.getExternalContext().getRequestMap().put(g=
etStateId(context), validatorState);
- }
+ Method method =3D getCloneMethod(value.getClass());
+ validatorState =3D new GraphValidatorState(method.invo=
ke(value));
+ validatorState.setActive(true);
+ GraphValidatorState.setState(context, value, validator=
State);
} catch (NoSuchMethodException e) {
- // do nothing, that is really not possible.
+ // do nothing, that is really not possible - clone() i=
mpemented in Object.
} catch (InvocationTargetException e) {
throw new FacesException(e);
} catch (IllegalArgumentException e) {
- // do nothing, that is really not possible.
+ // do nothing, that is really not possible - method ha=
s no arguments.
} catch (IllegalAccessException e) {
throw new FacesException(e);
}
@@ -161,7 +146,7 @@
}
super.processDecodes(context);
if (null !=3D validatorState) {
- validatorState.setActive(false);
+ validatorState.setActive(wasActive);
}
}
=
@@ -170,41 +155,57 @@
return clazz.getDeclaredMethod("clone");
} catch (NoSuchMethodException e) {
if (null !=3D clazz.getSuperclass()) {
- return getCloneMethod(clazz.getSuperclass());
+ Method method =3D getCloneMethod(clazz.getSuperclass());
+ if (!Modifier.isPublic(method.getModifiers())) {
+ // Method Object#clone() is protected by default. Make=
it public
+ // unless developer did it.
+ method.setAccessible(true);
+ }
+ return method;
} else {
throw e;
}
}
}
=
- protected String getStateId(FacesContext context) {
- String stateId =3D GraphValidatorState.STATE_ATTRIBUTE_PREFIX + ge=
tClientId(context);
- return stateId;
- }
=
protected GraphValidatorState getValidatorState(FacesContext context) {
- return (GraphValidatorState) context.getExternalContext().getReque=
stMap().get(getStateId(context));
+ Object value =3D getValue();
+ if (null !=3D value) {
+ return GraphValidatorState.getState(context, value);
+ } else {
+ return null;
+ }
}
=
@Override
public void processValidators(FacesContext context) {
GraphValidatorState validatorState =3D getValidatorState(context);
if (null !=3D validatorState) {
+ boolean wasActive =3D validatorState.isActive();
validatorState.setActive(true);
+ super.processValidators(context);
+ validatorState.setActive(wasActive);
+ if(!context.isValidationFailed()){
+ validateObject(context, validatorState.getCloned());
+ }
+ } else {
+ super.processValidators(context);
}
- super.processValidators(context);
- if (null !=3D validatorState) {
- validatorState.setActive(false);
- validateObject(context, validatorState.getCloned());
- context.getExternalContext().getRequestMap().remove(getStateId=
(context));
- }
}
=
@Override
public void processUpdates(FacesContext context) {
super.processUpdates(context);
- Object value =3D getValue();
- validateObject(context, value);
+ // Validate updated object if it was not done on clone.
+ if (!context.isValidationFailed()) {
+ Object value =3D getValue();
+ if (null !=3D value) {
+ if (null =3D=3D GraphValidatorState.getState(context, valu=
e)) {
+ validateObject(context, value);
+ }
+ }
+ }
}
=
private void validateObject(FacesContext context, Object value) {
Modified: branches/4.0.X/ui/validator/ui/src/main/java/org/richfaces/el/Cap=
turingELContext.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/4.0.X/ui/validator/ui/src/main/java/org/richfaces/el/Capturing=
ELContext.java 2011-03-04 19:24:40 UTC (rev 22065)
+++ branches/4.0.X/ui/validator/ui/src/main/java/org/richfaces/el/Capturing=
ELContext.java 2011-03-04 22:55:38 UTC (rev 22066)
@@ -4,14 +4,21 @@
package org.richfaces.el;
=
import java.beans.FeatureDescriptor;
+import java.util.Collection;
import java.util.Iterator;
import java.util.Locale;
+import java.util.Map;
=
import javax.el.ELContext;
import javax.el.ELResolver;
import javax.el.FunctionMapper;
+import javax.el.ValueExpression;
import javax.el.VariableMapper;
+import javax.faces.context.FacesContext;
+import javax.faces.el.CompositeComponentExpressionHolder;
=
+import org.richfaces.validator.GraphValidatorState;
+
/**
* This class wraps original ELContext and capture whole call stack to the=
target object so it could be used to extract
* semantic information like annotations or Jena Model properties.
@@ -36,6 +43,37 @@
return reference;
}
=
+ private boolean isContainerObject(Object base) {
+ return base instanceof Collection || base instanceof Map || base.g=
etClass().isArray();
+ }
+
+ public boolean hasReferenceExpression() {
+ return reference !=3D null && reference.getBase() instanceof Compo=
siteComponentExpressionHolder;
+ }
+
+ public ValueExpression getReferenceExpression() {
+ CompositeComponentExpressionHolder expressionHolder =3D (Composite=
ComponentExpressionHolder) reference.getBase();
+ return expressionHolder.getExpression(reference.getProperty().toSt=
ring());
+ }
+
+ public ValueDescriptor getDescriptor() {
+ ValueReference localReference =3D reference;
+
+ while (true) {
+ if (localReference =3D=3D null || localReference.getBase() =3D=
=3D null || localReference.getProperty() =3D=3D null) {
+ return null;
+ }
+
+ Object base =3D localReference.getBase();
+
+ if (isContainerObject(base) && localReference.hasNext()) {
+ localReference =3D localReference.next();
+ } else {
+ return new ValueDescriptor(base.getClass(), localReference=
.getProperty().toString());
+ }
+ }
+ }
+
/*
* (non-Javadoc)
* =
@@ -88,6 +126,7 @@
private final class InterceptingResolver extends ELResolver {
=
private ELResolver delegate;
+ private boolean clonedObject;
=
public InterceptingResolver(ELResolver delegate) {
this.delegate =3D delegate;
@@ -97,6 +136,11 @@
@Override
public void setValue(ELContext context, Object base, Object proper=
ty, Object value) {
if (base !=3D null) {
+ // TODO - detect value object from inderect references ( e=
.g. data table variables ).
+ if (this.clonedObject) {
+ delegate.setValue(context, base, property, value);
+ }
+
context.setPropertyResolved(true);
reference =3D new ValueReference(base, property, reference=
);
}
@@ -107,7 +151,16 @@
@Override
public Object getValue(ELContext context, Object base, Object prop=
erty) {
reference =3D new ValueReference(base, property, reference);
- return delegate.getValue(context, base, property);
+ Object value =3D delegate.getValue(context, base, property);
+ if (null !=3D value && context.isPropertyResolved()) {
+ FacesContext facesContext =3D (FacesContext) context.getCo=
ntext(FacesContext.class);
+ Object clone =3D GraphValidatorState.getActiveClone(facesC=
ontext, value);
+ if (null !=3D clone) {
+ this.clonedObject =3D true;
+ return clone;
+ }
+ }
+ return value;
}
=
@Override
Modified: branches/4.0.X/ui/validator/ui/src/main/java/org/richfaces/el/Val=
ueExpressionAnalayserImpl.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/4.0.X/ui/validator/ui/src/main/java/org/richfaces/el/ValueExpr=
essionAnalayserImpl.java 2011-03-04 19:24:40 UTC (rev 22065)
+++ branches/4.0.X/ui/validator/ui/src/main/java/org/richfaces/el/ValueExpr=
essionAnalayserImpl.java 2011-03-04 22:55:38 UTC (rev 22066)
@@ -1,25 +1,96 @@
package org.richfaces.el;
=
+import javax.el.ELContext;
import javax.el.ELException;
import javax.el.ValueExpression;
import javax.faces.context.FacesContext;
=
public class ValueExpressionAnalayserImpl implements ValueExpressionAnalay=
ser {
=
- public ValueDescriptor getPropertyDescriptor(FacesContext context, Val=
ueExpression expression) throws ELException {
- if(null =3D=3D context || null =3D=3D expression){
- throw new NullPointerException();
+ private abstract static class ValueResolutionCommand {
+ =
+ private ValueDescriptor valueDescriptor;
+ =
+ public ValueDescriptor getValueDescriptor() {
+ return valueDescriptor;
}
- CapturingELContext capturingContext =3D new CapturingELContext(con=
text.getELContext());
- Class> type =3D expression.getType(capturingContext);
- ValueReference reference =3D capturingContext.getReference();
- if(null !=3D reference && null !=3D reference.getBase() && null !=
=3D reference.getProperty()){
- // TODO - detect arrays, maps and lists. Check JSF implementat=
ion code - seems that Mojarra dosn't validate such fields.
- ValueDescriptor descriptor =3D new ValueDescriptor(reference.g=
etBase().getClass(),reference.getProperty().toString(),type);
- return descriptor;
- } else {
- throw new ELException("Cannot determine property for expressio=
n "+expression.getExpressionString());
+
+ void setValueDescriptor(ValueDescriptor valueDescriptor) {
+ this.valueDescriptor =3D valueDescriptor;
}
+ =
+ public abstract void resolve(ValueExpression expression, ELContext=
context);
+ =
}
+ =
+ private static final class GetTypeCommand extends ValueResolutionComma=
nd {
=
+ @Override
+ public void resolve(ValueExpression expression, ELContext context)=
{
+ expression.getType(context);
+ }
+ }
+ =
+ private static final class SetValueCommand extends ValueResolutionComm=
and {
+
+ private Object value;
+ =
+ public SetValueCommand(Object value) {
+ super();
+ this.value =3D value;
+ }
+
+ @Override
+ public void resolve(ValueExpression expression, ELContext context)=
{
+ expression.setValue(context, value);
+ }
+ =
+ }
+ =
+ private void checkNotNull(FacesContext context, ValueExpression expres=
sion) {
+ if (context =3D=3D null) {
+ throw new NullPointerException("facesContext");
+ }
+ =
+ if (expression =3D=3D null) {
+ throw new NullPointerException("expression");
+ }
+ }
+ =
+ private void resolveValue(FacesContext context, ValueExpression initia=
lExpression, ValueResolutionCommand command) throws ELException {
+ checkNotNull(context, initialExpression);
+ =
+ ValueExpression expression =3D initialExpression;
+ =
+ while (expression !=3D null) {
+ CapturingELContext capturingContext =3D new CapturingELContext=
(context.getELContext());
+ command.resolve(expression, capturingContext);
+
+ if (capturingContext.hasReferenceExpression()) {
+ expression =3D capturingContext.getReferenceExpression();
+ } else {
+ ValueDescriptor result =3D capturingContext.getDescriptor(=
);
+
+ if (result =3D=3D null) {
+ throw new ELException("Cannot determine property for e=
xpression " + initialExpression.getExpressionString());
+ }
+ =
+ command.setValueDescriptor(result);
+ break;
+ }
+ }
+ }
+ =
+ public ValueDescriptor getPropertyDescriptor(FacesContext context, Val=
ueExpression expression) throws ELException {
+ ValueResolutionCommand command =3D new GetTypeCommand();
+ resolveValue(context, expression, command);
+ return command.getValueDescriptor();
+ }
+
+ public ValueDescriptor updateValueAndGetPropertyDescriptor(FacesContex=
t context, ValueExpression expression, Object newValue) throws ELException {
+ ValueResolutionCommand command =3D new SetValueCommand(newValue);
+ resolveValue(context, expression, command);
+ return command.getValueDescriptor();
+ }
+ =
}
Modified: branches/4.0.X/ui/validator/ui/src/main/java/org/richfaces/valida=
tor/BeanValidatorServiceImpl.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/4.0.X/ui/validator/ui/src/main/java/org/richfaces/validator/Be=
anValidatorServiceImpl.java 2011-03-04 19:24:40 UTC (rev 22065)
+++ branches/4.0.X/ui/validator/ui/src/main/java/org/richfaces/validator/Be=
anValidatorServiceImpl.java 2011-03-04 22:55:38 UTC (rev 22066)
@@ -3,23 +3,17 @@
*/
package org.richfaces.validator;
=
-import java.beans.FeatureDescriptor;
import java.lang.annotation.Annotation;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
-import java.util.EmptyStackException;
import java.util.HashSet;
-import java.util.Iterator;
import java.util.Locale;
import java.util.Map;
import java.util.Set;
-import java.util.Stack;
=
-import javax.el.ELContext;
import javax.el.ELException;
-import javax.el.ELResolver;
import javax.el.ValueExpression;
import javax.faces.FacesException;
import javax.faces.application.FacesMessage;
@@ -30,7 +24,6 @@
import javax.validation.metadata.ElementDescriptor.ConstraintFinder;
import javax.validation.metadata.PropertyDescriptor;
=
-import org.richfaces.el.ELContextWrapper;
import org.richfaces.el.ValueDescriptor;
import org.richfaces.el.ValueExpressionAnalayser;
=
@@ -64,6 +57,11 @@
Class>... groups) {
try {
ValueDescriptor propertyDescriptor =3D analayser.getPropertyDe=
scriptor(context, expression);
+ =
+ if (propertyDescriptor =3D=3D null) {
+ return Collections.emptySet();
+ }
+ =
return processBeanAttribute(context, propertyDescriptor, group=
s);
} catch (ELException e) {
return Collections.emptySet();
@@ -147,66 +145,36 @@
=
public Collection validateExpression(FacesContext context, Val=
ueExpression expression, Object newValue,
Class>... groups) {
+ =
if (null =3D=3D context) {
throw new FacesException(INPUT_PARAMETERS_IS_NOT_CORRECT);
}
- Collection validationMessages =3D Collections.emptySet();
+ =
+ Collection validationMessages =3D null;
if (null !=3D expression) {
- ELContext elContext =3D context.getELContext();
- ValidationResolver validationResolver =3D
- createValidationResolver(context, elContext.getELResolver(=
), groups);
- ELContextWrapper wrappedElContext =3D new ELContextWrapper(elC=
ontext, validationResolver);
+ ValueDescriptor valueDescriptor;
try {
- expression.setValue(wrappedElContext, newValue);
+ valueDescriptor =3D analayser.updateValueAndGetPropertyDes=
criptor(context, expression, newValue);
} catch (ELException e) {
throw new FacesException(e);
}
- if (!validationResolver.isValid()) {
- validationMessages =3D validationResolver.getValidationMes=
sages();
+
+ if (valueDescriptor !=3D null) {
+ validationMessages =3D validate(context, valueDescriptor.g=
etBeanType(), valueDescriptor.getName(), newValue, groups);
}
+ =
}
+ =
+ if (validationMessages =3D=3D null) {
+ validationMessages =3D Collections.emptySet();
+ }
+ =
return validationMessages;
}
=
=
- protected ValidationResolver createValidationResolver(FacesContext con=
text, ELResolver parent, Class>[] groups) {
- return new ValidationResolver(parent, context, groups);
- }
=
/**
- * @author asmirnov
- * =
- */
- protected static class BasePropertyPair {
- private final Object base;
- private final Object property;
-
- /**
- * @param base
- * @param property
- */
- public BasePropertyPair(Object base, Object property) {
- this.base =3D base;
- this.property =3D property;
- }
-
- /**
- * @return the base
- */
- public Object getBase() {
- return base;
- }
-
- /**
- * @return the property
- */
- public Object getProperty() {
- return property;
- }
-
- }
-
- /**
* Class for identify validator instance by locale
* =
* @author amarkhel
@@ -277,165 +245,13 @@
=
}
=
- /**
- * Wrapper class for a {@link ELResolver}. For a setValue method, perf=
orm validation instead of real assignment.
- * =
- * @author asmirnov
- * =
- */
- final class ValidationResolver extends ELResolver {
=
- /**
- * Original resolver.
- */
- private final ELResolver parent;
-
- private boolean valid =3D true;
-
- private Collection validationMessages =3D null;
-
- private Stack valuesStack;
-
- private Class>[] groups;
-
- private FacesContext facesContext;
-
- private boolean clonedObject =3D false;
-
- /**
- * @param parent
- * @param context
- */
- public ValidationResolver(ELResolver parent, FacesContext context,=
Class>[] groups) {
- this.parent =3D parent;
- this.valuesStack =3D new Stack();
- this.groups =3D groups;
- this.facesContext =3D context;
- }
-
- public boolean isValid() {
- return valid;
- }
-
- /**
- * @param context
- * @param base
- * @return
- * @see javax.el.ELResolver#getCommonPropertyType(javax.el.ELConte=
xt, java.lang.Object)
- */
- public Class> getCommonPropertyType(ELContext context, Object ba=
se) {
- return parent.getCommonPropertyType(context, base);
- }
-
- /**
- * @param context
- * @param base
- * @return
- * @see javax.el.ELResolver#getFeatureDescriptors(javax.el.ELConte=
xt, java.lang.Object)
- */
- public Iterator getFeatureDescriptors(ELContext=
context, Object base) {
- return parent.getFeatureDescriptors(context, base);
- }
-
- /**
- * @param context
- * @param base
- * @param property
- * @return
- * @see javax.el.ELResolver#getType(javax.el.ELContext, java.lang.=
Object, java.lang.Object)
- */
- public Class> getType(ELContext context, Object base, Object pro=
perty) {
- return parent.getType(context, base, property);
- }
-
- /**
- * @param context
- * @param base
- * @param property
- * @return
- * @see javax.el.ELResolver#getValue(javax.el.ELContext, java.lang=
.Object, java.lang.Object)
- */
- public Object getValue(ELContext context, Object base, Object prop=
erty) {
- Object value =3D ClonedObjectResolver.resolveCloned(context, b=
ase, property);
- if (null !=3D value) {
- this.clonedObject =3D true;
- context.setPropertyResolved(true);
- } else {
- value =3D parent.getValue(context, base, property);
- }
- valuesStack.push(new BasePropertyPair(base, property));
- return value;
- }
-
- /**
- * @param context
- * @param base
- * @param property
- * @return
- * @see javax.el.ELResolver#isReadOnly(javax.el.ELContext, java.la=
ng.Object, java.lang.Object)
- */
- public boolean isReadOnly(ELContext context, Object base, Object p=
roperty) {
- return parent.isReadOnly(context, base, property);
- }
-
- /**
- * @param context
- * @param base
- * @param property
- * @param value
- * @see javax.el.ELResolver#setValue(javax.el.ELContext, java.lang=
.Object, java.lang.Object, java.lang.Object)
- */
- public void setValue(ELContext context, Object base, Object proper=
ty, Object value) {
- if (null !=3D base && null !=3D property) {
- // TODO - detect value object from inderect references ( e=
.g. data table variables ).
- if (this.clonedObject) {
- parent.setValue(context, base, property, value);
- }
- context.setPropertyResolved(true);
- // For Arrays, Collection or Map use parent base and prope=
rty.
- BasePropertyPair basePropertyPair =3D lookupBeanProperty(n=
ew BasePropertyPair(base, property));
- base =3D basePropertyPair.getBase();
- property =3D basePropertyPair.getProperty();
- if (null !=3D base && null !=3D property) {
- // https://jira.jboss.org/jira/browse/RF-4034
- // apache el looses locale information during value
- // resolution,
- // so we use our own
- validationMessages =3D validate(facesContext, base, pr=
operty.toString(), value, groups);
- valid =3D null =3D=3D validationMessages || 0 =3D=3D v=
alidationMessages.size();
-
- }
- }
- }
-
- private BasePropertyPair lookupBeanProperty(BasePropertyPair pair)=
{
- Object base =3D pair.getBase();
- if (null !=3D base && (base instanceof Collection || base inst=
anceof Map || base.getClass().isArray())) {
- try {
- pair =3D lookupBeanProperty(valuesStack.pop());
- } catch (EmptyStackException e) {
- // Do nothing, this is a first item.
- }
- }
- return pair;
- }
-
- /**
- * @return the validationMessages
- */
- public Collection getValidationMessages() {
- return validationMessages;
- }
-
- }
-
- protected Collection validate(FacesContext facesContext, Objec=
t base, String property, Object value,
+ protected Collection validate(FacesContext facesContext, Class=
> beanType, String property, Object value,
Class>[] groups) {
- @SuppressWarnings("rawtypes")
- Class beanType =3D base.getClass();
+ =
@SuppressWarnings("unchecked")
Set> constrains =3D
- getValidator(facesContext).validateValue(beanType, property, v=
alue, getGroups(groups));
+ getValidator(facesContext).validateValue((Class) beanT=
ype, property, value, getGroups(groups));
return extractMessages(constrains);
}
=
Deleted: branches/4.0.X/ui/validator/ui/src/main/java/org/richfaces/validat=
or/ClonedObjectResolver.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/4.0.X/ui/validator/ui/src/main/java/org/richfaces/validator/Cl=
onedObjectResolver.java 2011-03-04 19:24:40 UTC (rev 22065)
+++ branches/4.0.X/ui/validator/ui/src/main/java/org/richfaces/validator/Cl=
onedObjectResolver.java 2011-03-04 22:55:38 UTC (rev 22066)
@@ -1,110 +0,0 @@
-/**
- * =
- */
-package org.richfaces.validator;
-
-import java.beans.FeatureDescriptor;
-import java.util.Iterator;
-import java.util.Map;
-
-import javax.el.ELContext;
-import javax.el.ELResolver;
-import javax.faces.context.FacesContext;
-
-
-
-/**
- * @author asmirnov
- * =
- */
-public class ClonedObjectResolver extends ELResolver {
-
- /*
- * (non-Javadoc)
- * =
- * @see javax.el.ELResolver#getCommonPropertyType(javax.el.ELContext, =
java.lang.Object)
- */
- @Override
- public Class> getCommonPropertyType(ELContext context, Object base) {
- // Do nothing
- return null;
- }
-
- /*
- * (non-Javadoc)
- * =
- * @see javax.el.ELResolver#getFeatureDescriptors(javax.el.ELContext, =
java.lang.Object)
- */
- @Override
- public Iterator getFeatureDescriptors(ELContext con=
text, Object base) {
- // do nothing
- return null;
- }
-
- /*
- * (non-Javadoc)
- * =
- * @see javax.el.ELResolver#getType(javax.el.ELContext, java.lang.Obje=
ct, java.lang.Object)
- */
- @Override
- public Class> getType(ELContext context, Object base, Object propert=
y) {
- Object cloned =3D resolveCloned(context, base, property);
- if (null !=3D cloned) {
- context.setPropertyResolved(true);
- return cloned.getClass();
- }
- return null;
- }
-
- /*
- * (non-Javadoc)
- * =
- * @see javax.el.ELResolver#getValue(javax.el.ELContext, java.lang.Obj=
ect, java.lang.Object)
- */
- @Override
- public Object getValue(ELContext context, Object base, Object property=
) {
- Object cloned =3D resolveCloned(context, base, property);
- if (null !=3D cloned) {
- context.setPropertyResolved(true);
- }
- return cloned;
- }
-
- /*
- * (non-Javadoc)
- * =
- * @see javax.el.ELResolver#isReadOnly(javax.el.ELContext, java.lang.O=
bject, java.lang.Object)
- */
- @Override
- public boolean isReadOnly(ELContext context, Object base, Object prope=
rty) {
- // TODO Auto-generated method stub
- return false;
- }
-
- /*
- * (non-Javadoc)
- * =
- * @see javax.el.ELResolver#setValue(javax.el.ELContext, java.lang.Obj=
ect, java.lang.Object, java.lang.Object)
- */
- @Override
- public void setValue(ELContext context, Object base, Object property, =
Object value) {
- // TODO Auto-generated method stub
-
- }
-
- public static Object resolveCloned(ELContext context, Object base, Obj=
ect property) {
- if (null !=3D base || null !=3D property) {
- FacesContext facesContext =3D FacesContext.getCurrentInstance(=
);
- Map requestMap =3D facesContext.getExternalCon=
text().getRequestMap();
- for (String key : requestMap.keySet()) {
- if (null !=3D key && key.startsWith(GraphValidatorState.ST=
ATE_ATTRIBUTE_PREFIX)) {
- GraphValidatorState state =3D (GraphValidatorState) re=
questMap.get(key);
- if (state.isSame(base, property)) {
- return state.getCloned();
- }
- }
- }
- }
- return null;
- }
-}
Modified: branches/4.0.X/ui/validator/ui/src/test/java/org/richfaces/el/ELT=
estBase.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/4.0.X/ui/validator/ui/src/test/java/org/richfaces/el/ELTestBas=
e.java 2011-03-04 19:24:40 UTC (rev 22065)
+++ branches/4.0.X/ui/validator/ui/src/test/java/org/richfaces/el/ELTestBas=
e.java 2011-03-04 22:55:38 UTC (rev 22066)
@@ -15,6 +15,7 @@
import javax.el.MapELResolver;
import javax.el.ValueExpression;
import javax.el.VariableMapper;
+import javax.faces.context.FacesContext;
=
import org.jboss.el.ExpressionFactoryImpl;
import org.junit.After;
@@ -89,6 +90,10 @@
=
class DummyELContext extends ELContext {
=
+ public DummyELContext() {
+ putContext(FacesContext.class, FacesContext.getCurrentInstance=
());
+ }
+ =
@Override
public ELResolver getELResolver() {
return elResolver;
Modified: branches/4.0.X/ui/validator/ui/src/test/java/org/richfaces/el/Tes=
tCaptureEL.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/4.0.X/ui/validator/ui/src/test/java/org/richfaces/el/TestCaptu=
reEL.java 2011-03-04 19:24:40 UTC (rev 22065)
+++ branches/4.0.X/ui/validator/ui/src/test/java/org/richfaces/el/TestCaptu=
reEL.java 2011-03-04 22:55:38 UTC (rev 22066)
@@ -1,16 +1,47 @@
package org.richfaces.el;
=
-import static org.junit.Assert.*;
+import static org.easymock.EasyMock.expect;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertSame;
=
import javax.el.ValueExpression;
=
+import org.jboss.test.faces.mock.Environment;
+import org.jboss.test.faces.mock.Environment.Feature;
+import org.jboss.test.faces.mock.FacesMock;
+import org.jboss.test.faces.mock.Mock;
+import org.jboss.test.faces.mock.MockFacesEnvironment;
import org.jboss.test.faces.mock.MockTestRunner;
+import org.junit.After;
+import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
=
+import com.google.common.collect.Maps;
+
@RunWith(MockTestRunner.class)
public class TestCaptureEL extends ELTestBase {
=
+ @Mock
+ @Environment(Feature.EXTERNAL_CONTEXT)
+ private MockFacesEnvironment facesEnvironment;
+
+ =
+ @Before
+ public void setUpEnvironment() throws Exception {
+ expect(facesEnvironment.getExternalContext().getRequestMap()).andS=
tubReturn(Maps.newHashMap());
+ expect(facesEnvironment.getFacesContext().getAttributes()).andStub=
Return(Maps.newHashMap());
+ FacesMock.replay(facesEnvironment);
+ }
+ =
+ @After
+ public void tearDownEnvironment() throws Exception {
+ FacesMock.verify(facesEnvironment);
+ facesEnvironment.release();
+ }
+ =
@Test
public void testDummyResolverString() throws Exception {
ValueExpression expression =3D parse("#{bean.string}");
Modified: branches/4.0.X/ui/validator/ui/src/test/java/org/richfaces/el/Val=
ueExpressionAnalayserTest.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/4.0.X/ui/validator/ui/src/test/java/org/richfaces/el/ValueExpr=
essionAnalayserTest.java 2011-03-04 19:24:40 UTC (rev 22065)
+++ branches/4.0.X/ui/validator/ui/src/test/java/org/richfaces/el/ValueExpr=
essionAnalayserTest.java 2011-03-04 22:55:38 UTC (rev 22066)
@@ -1,15 +1,18 @@
package org.richfaces.el;
=
=
-import static org.easymock.EasyMock.*;
-import static org.junit.Assert.*;
+import static org.easymock.EasyMock.expect;
+import static org.junit.Assert.assertEquals;
=
import javax.el.ELException;
import javax.el.ValueExpression;
import javax.faces.context.FacesContext;
=
+import org.jboss.test.faces.mock.Environment;
+import org.jboss.test.faces.mock.Environment.Feature;
import org.jboss.test.faces.mock.FacesMock;
import org.jboss.test.faces.mock.Mock;
+import org.jboss.test.faces.mock.MockFacesEnvironment;
import org.jboss.test.faces.mock.MockTestRunner;
import org.junit.After;
import org.junit.Before;
@@ -17,42 +20,48 @@
import org.junit.runner.RunWith;
import org.richfaces.el.model.Bean;
=
+import com.google.common.collect.Maps;
+
@RunWith(MockTestRunner.class)
public class ValueExpressionAnalayserTest extends ELTestBase {
=
- =
private ValueExpressionAnalayser analayser;
=
@Mock
+ @Environment(Feature.EXTERNAL_CONTEXT)
+ private MockFacesEnvironment facesEnvironment;
+
private FacesContext facesContext;
-
+ =
@Before
public void setUpAnalayser() throws Exception {
analayser =3D new ValueExpressionAnalayserImpl();
+ facesContext =3D facesEnvironment.getFacesContext();
+ expect(facesEnvironment.getExternalContext().getRequestMap()).andS=
tubReturn(Maps.newHashMap());
}
=
@After
public void tearDownAnalayser() throws Exception {
+ facesContext =3D null;
analayser =3D null;
- facesContext.release();
+ facesEnvironment.release();
}
@Test
public void testGetDescriptionPositive() throws Exception {
ValueExpression expression =3D parse("#{bean.string}");
expect(facesContext.getELContext()).andReturn(elContext);
- FacesMock.replay(facesContext);
+ FacesMock.replay(facesEnvironment);
ValueDescriptor propertyDescriptor =3D analayser.getPropertyDescri=
ptor(facesContext, expression);
assertEquals(Bean.class, propertyDescriptor.getBeanType());
assertEquals("string", propertyDescriptor.getName());
- assertEquals(String.class,propertyDescriptor.getPropertyType());
- FacesMock.verify(facesContext);
+ FacesMock.verify(facesEnvironment);
}
=
@Test(expected=3DELException.class)
public void testGetDescriptionNegative() throws Exception {
ValueExpression expression =3D parse("#{bean}");
expect(facesContext.getELContext()).andReturn(elContext);
- FacesMock.replay(facesContext);
+ FacesMock.replay(facesEnvironment);
ValueDescriptor propertyDescriptor =3D analayser.getPropertyDescri=
ptor(facesContext, expression);
}
}
--===============3684406486611051737==--
From richfaces-svn-commits at lists.jboss.org Mon Mar 7 01:44:46 2011
Content-Type: multipart/mixed; boundary="===============4889310130574486523=="
MIME-Version: 1.0
From: richfaces-svn-commits at lists.jboss.org
To: richfaces-svn-commits at lists.jboss.org
Subject: [richfaces-svn-commits] JBoss Rich Faces SVN: r22067 - in
modules/docs/trunk/Component_Reference/src/main/docbook/en-US: skinning and 1
other directory.
Date: Mon, 07 Mar 2011 01:44:45 -0500
Message-ID: <201103070644.p276ij8l013712@svn01.web.mwc.hst.phx2.redhat.com>
--===============4889310130574486523==
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable
Author: SeanRogers
Date: 2011-03-07 01:44:44 -0500 (Mon, 07 Mar 2011)
New Revision: 22067
Modified:
modules/docs/trunk/Component_Reference/src/main/docbook/en-US/chap-Compo=
nent_Reference-Tables_and_grids.xml
modules/docs/trunk/Component_Reference/src/main/docbook/en-US/skinning/t=
abl-richextendedDataTable.xml
Log:
Skinning reference for extendedDataTable
Modified: modules/docs/trunk/Component_Reference/src/main/docbook/en-US/cha=
p-Component_Reference-Tables_and_grids.xml
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- modules/docs/trunk/Component_Reference/src/main/docbook/en-US/chap-Comp=
onent_Reference-Tables_and_grids.xml 2011-03-04 22:55:38 UTC (rev 22066)
+++ modules/docs/trunk/Component_Reference/src/main/docbook/en-US/chap-Comp=
onent_Reference-Tables_and_grids.xml 2011-03-07 06:44:44 UTC (rev 22067)
@@ -1092,12 +1092,10 @@
=
-
=
Modified: modules/docs/trunk/Component_Reference/src/main/docbook/en-US/ski=
nning/tabl-richextendedDataTable.xml
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- modules/docs/trunk/Component_Reference/src/main/docbook/en-US/skinning/=
tabl-richextendedDataTable.xml 2011-03-04 22:55:38 UTC (rev 22066)
+++ modules/docs/trunk/Component_Reference/src/main/docbook/en-US/skinning/=
tabl-richextendedDataTable.xml 2011-03-07 06:44:44 UTC (rev 22067)
@@ -17,339 +17,175 @@
+
-
+
- .extdt-empty-cell
+ .rf-edt
- This class defines the styles for empty cells.
+ This class defines styles for the table.
- tableBorderWidth , tableBorderColor<=
/literal>
- border-bottom
+ tableBorderWidth , table=
BorderColor
+ border
- =
-
-
-
- .extdt-table-layout
-
-
- This class defines the styles for the table layout.
-
-
-
-
-
- tableBackgroundColor
- background-color
+ tableBackgroundColor
+ background-color
=
-
-
-
- .extdt-cell
-
-
- This class defines the styles for the table cells.
-
-
-
-
-
- tableBorderWidth , tableBorderColor<=
/literal>
- border-right, border-bottom
-
-
- generalSizeFont
- font-size
-
-
- generalTextColor
- color
-
-
- generalFamilyFont
- font-family
-
- =
-
- .extdt-header
+ .rich-edt-hdr
- This class defines the styles for a table header row.
+ This class defines styles for a header.
- headerBackgroundColor
- background-color
+ No skin parameters.
- =
+
-
-
-
- .extdt-header-continue
-
-
- This class defines the styles for all header lines after the firs=
t.
-
-
-
-
-
- headerBackgroundColor
- background-color
-
- =
-
- .extdt-headercell
+ .rf-edt-tbl-hdr
- This class defines the styles for the header cells.
+ This class defines styles for the table header.
- tableBorderWidth , tableBorderColor<=
/literal>
- border-right, border-bottom
+ tableBorderWidth , table=
BorderColor
+ border-bottom
- headerTextColor
- color
+ tableHeaderTextColor
+ color
- headerWeightFont
- font-weight
+ generalFamilyFont
+ font-family
- generalSizeFont
- font-size
+ generalSizeFont
+ font-size
- generalFamilyFont
- font-family
+ tableHeaderTextColor
+ color
=
- .extdt-subheader
+ .rich-edt-b
- This class defines the styles for a column sub-header.
+ This class defines styles for the body of the table.
- additionalBackgroundColor
- background-color
+ No skin parameters.
=
-
+
- .extdt-table-filterrow
+ .rich-edt-spcr
- This class defines the styles for the filter row.
+ This class defines a spacer for Internet Explorer 7<=
/productname> compatibility.
- additionalBackgroundColor
- background-color
+ No skin parameters.
-
- tableBorderWidth , tableBorderColor<=
/literal>
- border-top
-
=
-
+
- .extdt-subheadercell
+ .rich-edt-ftr
- This class defines the styles for a column sub-header cell.
+ This class defines styles for a footer.
- tableBorderWidth , tableBorderColor<=
/literal>
- border-right
+ tableBorderWidth , table=
BorderColor
+ border-top
- generalTextColor
- color
+ tableFooterBackgroundColor <=
/entry>
+ background-color
+
- generalSizeFont
- font-size
-
-
- generalFamilyFont
- font-family
-
- =
-
-
+
- .extdt-caption
+ .rf-edt-tbl-ftr
- This class defines styles for a table caption.
+ This class defines styles for the table footer.
- tableBorderWidth, tableBorderColor
- border-right, border-bottom
+ tableBorderWidth , table=
BorderColor
+ border-top
- generalTextColor
- color
+ tableFooterBackgroundColor <=
/entry>
+ background-color
-
- headerWeightFont
- font-weight
-
-
- generalSizeFont
- font-size
-
-
- generalFamilyFont
- font-family
-
-
- additionalBackgroundColor
- bakcground-color
-
=
-
+
- .extdt-footercell
+ .rich-edt-ftr-fzn
- This class defines styles for a footer cell.
+ This class defines styles for a frozen footer.
- tableBorderWidth, tableBorderColor
- border-right, border-bottom
+ No skin parameters.
-
- generalTextColor
- color
-
-
- headerWeightFont
- font-weight
-
-
- generalSizeFont
- font-size
-
-
- generalFamilyFont
- font-family
-
=
-
-
-
- .extdt-subfooter
-
-
- This class defines the styles for a column footer.
-
-
-
-
-
- tableBorderWidth , tableBorderColor<=
/literal>
- border-right , border-bottom
-
-
- generalTextColor
- color
-
-
- generalSizeFont
- font-size
-
-
- generalFamilyFont
- font-family
-
- =
-
-
-
-
- .extdt-subfootercell
-
-
- This class defines the styles for a column footer cell.
-
-
-
-
-
- tableBorderWidth , tableBorderColor<=
/literal>
- border-right , border-bottom
-
-
- generalTextColor
- color
-
-
- generalSizeFont
- font-size
-
-
- generalFamilyFont
- font-family
-
- =
-
- .rich-extdt
+ .rich-edt-cnt
- This class defines styles for the table.
+ This class defines styles for the table content.
@@ -362,10 +198,10 @@
- .rich-extdt-caption
+ .rich-edt-ftr-cnt
- This class defines styles for a "caption" facet element.
+ This class defines styles for the content of a footer.
@@ -378,10 +214,10 @@
- .rich-extdt-header
+ .rich-edt-rsz
- This class defines styles for a table header row.
+ This class defines styles for the table resizer.
@@ -394,10 +230,10 @@
- .rich-extdt-header-continue
+ .rich-edt-rsz-cntr
- This class defines styles for all header lines after the first.
+ This class defines styles for the resize container.
@@ -410,42 +246,48 @@
- .rich-extdt-subheader
+ .rich-edt-rsz-mkr
- This class defines styles for a column sub-header.
+ This class defines styles for the resize marker.
- No skin parameters.
+ generalTextColor
+ border-left
- =
+
-
+
- .rich-extdt-footer
+ .rf-edt-rord
- This class defines styles for a footer row.
+ This class defines styles for the re-order functionality.
- No skin parameters.
+ tableBorderWidth , table=
BorderColor
+ border
+
+ tableHeaderBackgroundColor / tableBackgroundColor
+ background-color
+
=
- .rich-extdt-footer-continue
+ .rich-edt-rord-mkr
- This class defines styles for all footer lines after the first.
+ This class defines styles for the re-order marker.
@@ -453,143 +295,183 @@
No skin parameters.
- =
+
-
+
- .rich-extdt-subfooter
+ .rf-edt-c
- This class defines styles for a column sub-footer.
+ This class defines styles for a table cell.
- No skin parameters.
+ tableBorderWidth , table=
BorderColor
+ border-bottom
- =
-
+ tableBorderWidth , table=
BorderColor
+ border-right
+
+
+
+
- .rich-extdt-headercell
+ .rf-edt-hdr-c
- This class defines styles for a header cell.
+ This class defines styles for a table header cell.
- No skin parameters.
+ tableBorderWidth , table=
BorderColor
+ border-bottom
- =
-
+ tableBorderWidth , table=
BorderColor
+ border-right
+
+
+
+
- .rich-extdt-subheadercell
+ .rf-edt-ftr-c
- This class defines styles for a sub-header cell.
+ This class defines styles for a table footer cell.
- No skin parameters.
+ tableBorderWidth , table=
BorderColor
+ border-bottom
- =
+ tableBorderWidth , table=
BorderColor
+ border-right
+
+
+
- .rich-extdt-cell
+ .rf-edt-ftr-emp
- This class defines styles for a table cell.
+ This class defines styles for an empty footer cell.
- No skin parameters.
+ tableBorderWidth , table=
BorderColor
+ border-right
- =
+
-
+
- .rich-extdt-row
+ .rf-edt-c-cnt
- This class defines styles for a table row.
+ This class defines styles for the contents of a cell.
- No skin parameters.
+ generalFamilyFont
+ font-family
- =
-
+ generalSizeFont
+ font-size
+
+
+
+
- .rich-extdt-firstrow
+ .rf-edt-hdr-c-cnt
- This class defines styles for a table's first row.
+ This class defines styles for the contents of a header cell.
- No skin parameters.
+ generalFamilyFont
+ font-family
- =
-
+ generalSizeFont
+ font-size
+
+
+ tableHeaderTextColor
+ color
+
+
+
+
- .rich-extdt-footercell
+ .rf-edt-ftr-c-cnt
- This class defines styles for a footer cell.
+ This class defines styles for the contents of a footer cell.
- No skin parameters.
+ generalFamilyFont
+ font-family
- =
+ generalSizeFont
+ font-size
+
+
+ generalTextColor
+ color
+
+
+
- .rich-extdt-subfootercell
+ .rf-edt-r-sel
- This class defines styles for a sub-footer cell.
+ This class defines styles for the selected row.
- No skin parameters.
+ tableBorderWidth , table=
BorderColor
+ border-right
=
- .rich-extdt-group-cell
+ .rich-edt-r-act
- This class defines styles for a grouping row cell.
+ This class defines styles for the active row.
@@ -597,6 +479,7 @@
No skin parameters.
+ =
--===============4889310130574486523==--
From richfaces-svn-commits at lists.jboss.org Mon Mar 7 07:09:28 2011
Content-Type: multipart/mixed; boundary="===============5652256100971721214=="
MIME-Version: 1.0
From: richfaces-svn-commits at lists.jboss.org
To: richfaces-svn-commits at lists.jboss.org
Subject: [richfaces-svn-commits] JBoss Rich Faces SVN: r22068 - in
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest:
richMenuGroup and 1 other directory.
Date: Mon, 07 Mar 2011 07:09:28 -0500
Message-ID: <201103071209.p27C9SZF016253@svn01.web.mwc.hst.phx2.redhat.com>
--===============5652256100971721214==
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable
Author: ppitonak(a)redhat.com
Date: 2011-03-07 07:09:27 -0500 (Mon, 07 Mar 2011)
New Revision: 22068
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tes=
ts/metamer/ftest/richDropDownMenu/TestRichDropDownMenu.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tes=
ts/metamer/ftest/richMenuGroup/TestRichMenuGroup.java
Log:
tests for drop down menu and menu group fixed
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfa=
ces/tests/metamer/ftest/richDropDownMenu/TestRichDropDownMenu.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/te=
sts/metamer/ftest/richDropDownMenu/TestRichDropDownMenu.java 2011-03-07 06:=
44:44 UTC (rev 22067)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/te=
sts/metamer/ftest/richDropDownMenu/TestRichDropDownMenu.java 2011-03-07 12:=
09:27 UTC (rev 22068)
@@ -34,6 +34,7 @@
=
import org.jboss.test.selenium.css.CssProperty;
import org.jboss.test.selenium.dom.Event;
+import org.jboss.test.selenium.encapsulated.JavaScript;
import org.jboss.test.selenium.locator.JQueryLocator;
import org.jboss.test.selenium.waiting.EventFiredCondition;
import org.richfaces.tests.metamer.ftest.AbstractMetamerTest;
@@ -82,7 +83,7 @@
assertFalse(selenium.isVisible(menuItem41), "Menu item \"Save\" sh=
ould not be visible on the page.");
=
assertFalse(selenium.isDisplayed(groupList), "Submenu should not b=
e expanded.");
- guardNoRequest(selenium).mouseOver(group);
+ guardNoRequest(selenium).getEval(new JavaScript("window.jQuery('" =
+ group.getRawLocator() + "').mouseenter()"));
assertTrue(selenium.isDisplayed(groupList), "Submenu should be exp=
anded.");
=
assertTrue(selenium.isElementPresent(menuItem41), "Menu item \"Sav=
e\" should be present on the page.");
@@ -119,7 +120,7 @@
selenium.waitForPageToLoad();
=
selenium.mouseOver(fileMenuLabel);
- selenium.mouseOut(fileMenuLabel);
+ selenium.getEval(new JavaScript("window.jQuery('" + fileMenuLabel.=
getRawLocator() + "').mouseleave()"));
assertTrue(selenium.isDisplayed(fileMenuList), "Menu should be exp=
anded.");
waitFor(3000);
assertFalse(selenium.isDisplayed(fileMenuList), "Menu should not b=
e expanded.");
@@ -181,9 +182,9 @@
selenium.waitForPageToLoad();
=
selenium.mouseOver(fileMenuLabel);
- selenium.mouseOver(group);
+ selenium.getEval(new JavaScript("window.jQuery('" + group.getRawLo=
cator() + "').mouseenter()"));
waitGui.interval(2000).withDelay(true).failWith("Menu group was no=
t opened.").until(isDisplayed.locator(groupList));
- selenium.mouseOut(group);
+ selenium.getEval(new JavaScript("window.jQuery('" + group.getRawLo=
cator() + "').mouseleave()"));
=
waitGui.failWith("Attribute ongrouphide does not work correctly").=
until(new EventFiredCondition(new Event("grouphide")));
}
@@ -194,7 +195,7 @@
selenium.waitForPageToLoad();
=
selenium.mouseOver(fileMenuLabel);
- selenium.mouseOver(group);
+ selenium.getEval(new JavaScript("window.jQuery('" + group.getRawLo=
cator() + "').mouseenter()"));
waitGui.interval(2000).withDelay(true).failWith("Menu group was no=
t opened.").until(isDisplayed.locator(group));
=
waitGui.failWith("Attribute ongroupshow does not work correctly").=
until(new EventFiredCondition(new Event("groupshow")));
@@ -206,7 +207,7 @@
selenium.waitForPageToLoad();
=
selenium.mouseOver(fileMenuLabel);
- selenium.mouseOut(fileMenuLabel);
+ selenium.getEval(new JavaScript("window.jQuery('" + fileMenuLabel.=
getRawLocator() + "').mouseleave()"));
=
waitGui.failWith("Attribute onhide does not work correctly").until=
(new EventFiredCondition(new Event("hide")));
}
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfa=
ces/tests/metamer/ftest/richMenuGroup/TestRichMenuGroup.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/te=
sts/metamer/ftest/richMenuGroup/TestRichMenuGroup.java 2011-03-07 06:44:44 =
UTC (rev 22067)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/te=
sts/metamer/ftest/richMenuGroup/TestRichMenuGroup.java 2011-03-07 12:09:27 =
UTC (rev 22068)
@@ -32,6 +32,7 @@
import java.net.URL;
=
import org.jboss.test.selenium.dom.Event;
+import org.jboss.test.selenium.encapsulated.JavaScript;
import org.jboss.test.selenium.locator.Attribute;
import org.jboss.test.selenium.locator.AttributeLocator;
import org.jboss.test.selenium.locator.JQueryLocator;
@@ -82,7 +83,7 @@
assertFalse(selenium.isVisible(menuItem41), "Menu item \"Save\" sh=
ould not be visible on the page.");
=
assertFalse(selenium.isDisplayed(groupList), "Submenu should not b=
e expanded.");
- guardNoRequest(selenium).mouseOver(group);
+ guardNoRequest(selenium).getEval(new JavaScript("window.jQuery('" =
+ group.getRawLocator() + "').mouseenter()"));
assertTrue(selenium.isDisplayed(groupList), "Submenu should be exp=
anded.");
=
assertTrue(selenium.isElementPresent(menuItem41), "Menu item \"Sav=
e\" should be present on the page.");
@@ -196,9 +197,9 @@
=
selenium.mouseOver(fileMenuLabel);
waitGui.failWith("Menu was not open.").until(isDisplayed.locator(f=
ileMenuList));
- selenium.mouseOver(group);
+ selenium.getEval(new JavaScript("window.jQuery('" + group.getRawLo=
cator() + "').mouseenter()"));
waitGui.failWith("Submenu was not open").until(isDisplayed.locator=
(groupList));
- selenium.mouseOut(group);
+ selenium.getEval(new JavaScript("window.jQuery('" + group.getRawLo=
cator() + "').mouseleave()"));
=
waitGui.failWith("Attribute onhide does not work correctly").until=
(new EventFiredCondition(new Event("hide")));
}
@@ -250,7 +251,7 @@
=
selenium.mouseOver(fileMenuLabel);
waitGui.failWith("Menu was not open.").until(isDisplayed.locator(f=
ileMenuList));
- selenium.mouseOver(group);
+ selenium.getEval(new JavaScript("window.jQuery('" + group.getRawLo=
cator() + "').mouseenter()"));
waitGui.failWith("Submenu was not open").until(isDisplayed.locator=
(groupList));
=
waitGui.failWith("Attribute onhide does not work correctly").until=
(new EventFiredCondition(new Event("show")));
--===============5652256100971721214==--
From richfaces-svn-commits at lists.jboss.org Mon Mar 7 07:26:25 2011
Content-Type: multipart/mixed; boundary="===============6386160416603426183=="
MIME-Version: 1.0
From: richfaces-svn-commits at lists.jboss.org
To: richfaces-svn-commits at lists.jboss.org
Subject: [richfaces-svn-commits] JBoss Rich Faces SVN: r22069 -
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTooltip.
Date: Mon, 07 Mar 2011 07:26:25 -0500
Message-ID: <201103071226.p27CQPx1018318@svn01.web.mwc.hst.phx2.redhat.com>
--===============6386160416603426183==
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable
Author: lfryc(a)redhat.com
Date: 2011-03-07 07:26:24 -0500 (Mon, 07 Mar 2011)
New Revision: 22069
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tes=
ts/metamer/ftest/richTooltip/TestTooltipSimple.java
Log:
tooltip tests - use mouseover/mouseout instead of mouseenter/mouseleave sin=
ce they dont work from selenium API (RFPL-1236)
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfa=
ces/tests/metamer/ftest/richTooltip/TestTooltipSimple.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/te=
sts/metamer/ftest/richTooltip/TestTooltipSimple.java 2011-03-07 12:09:27 UT=
C (rev 22068)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/te=
sts/metamer/ftest/richTooltip/TestTooltipSimple.java 2011-03-07 12:26:24 UT=
C (rev 22069)
@@ -53,6 +53,7 @@
import org.richfaces.tests.metamer.ftest.annotations.RegressionTest;
import org.richfaces.tests.metamer.ftest.annotations.Use;
import org.richfaces.tests.metamer.ftest.annotations.Uses;
+import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
=
/**
@@ -110,6 +111,12 @@
return buildUrl(contextPath, "faces/components/richTooltip/simple.=
xhtml");
}
=
+ @BeforeMethod
+ public void setupAttributes() {
+ attributes.setShowEvent("mouseover");
+ attributes.setHideEvent("mouseout");
+ }
+
@Test
public void testLifecycle() {
attributes.setMode(TooltipMode.ajax);
--===============6386160416603426183==--
From richfaces-svn-commits at lists.jboss.org Mon Mar 7 08:00:15 2011
Content-Type: multipart/mixed; boundary="===============2439951516667876785=="
MIME-Version: 1.0
From: richfaces-svn-commits at lists.jboss.org
To: richfaces-svn-commits at lists.jboss.org
Subject: [richfaces-svn-commits] JBoss Rich Faces SVN: r22070 -
modules/tests/metamer/trunk/ftest/src/test/resources.
Date: Mon, 07 Mar 2011 08:00:14 -0500
Message-ID: <201103071300.p27D0E0D021781@svn01.web.mwc.hst.phx2.redhat.com>
--===============2439951516667876785==
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable
Author: lfryc(a)redhat.com
Date: 2011-03-07 08:00:14 -0500 (Mon, 07 Mar 2011)
New Revision: 22070
Modified:
modules/tests/metamer/trunk/ftest/src/test/resources/testng-core.xml
modules/tests/metamer/trunk/ftest/src/test/resources/testng-input.xml
modules/tests/metamer/trunk/ftest/src/test/resources/testng-iteration.xml
modules/tests/metamer/trunk/ftest/src/test/resources/testng-misc.xml
modules/tests/metamer/trunk/ftest/src/test/resources/testng-output.xml
modules/tests/metamer/trunk/ftest/src/test/resources/testng.xml
Log:
removed test exclude on 4.0.0.Final group
Modified: modules/tests/metamer/trunk/ftest/src/test/resources/testng-core.=
xml
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- modules/tests/metamer/trunk/ftest/src/test/resources/testng-core.xml 20=
11-03-07 12:26:24 UTC (rev 22069)
+++ modules/tests/metamer/trunk/ftest/src/test/resources/testng-core.xml 20=
11-03-07 13:00:14 UTC (rev 22070)
@@ -4,7 +4,6 @@
-
Modified: modules/tests/metamer/trunk/ftest/src/test/resources/testng-input=
.xml
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- modules/tests/metamer/trunk/ftest/src/test/resources/testng-input.xml 2=
011-03-07 12:26:24 UTC (rev 22069)
+++ modules/tests/metamer/trunk/ftest/src/test/resources/testng-input.xml 2=
011-03-07 13:00:14 UTC (rev 22070)
@@ -4,7 +4,6 @@
-
Modified: modules/tests/metamer/trunk/ftest/src/test/resources/testng-itera=
tion.xml
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- modules/tests/metamer/trunk/ftest/src/test/resources/testng-iteration.x=
ml 2011-03-07 12:26:24 UTC (rev 22069)
+++ modules/tests/metamer/trunk/ftest/src/test/resources/testng-iteration.x=
ml 2011-03-07 13:00:14 UTC (rev 22070)
@@ -4,7 +4,6 @@
-
Modified: modules/tests/metamer/trunk/ftest/src/test/resources/testng-misc.=
xml
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- modules/tests/metamer/trunk/ftest/src/test/resources/testng-misc.xml 20=
11-03-07 12:26:24 UTC (rev 22069)
+++ modules/tests/metamer/trunk/ftest/src/test/resources/testng-misc.xml 20=
11-03-07 13:00:14 UTC (rev 22070)
@@ -4,7 +4,6 @@
-
Modified: modules/tests/metamer/trunk/ftest/src/test/resources/testng-outpu=
t.xml
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- modules/tests/metamer/trunk/ftest/src/test/resources/testng-output.xml =
2011-03-07 12:26:24 UTC (rev 22069)
+++ modules/tests/metamer/trunk/ftest/src/test/resources/testng-output.xml =
2011-03-07 13:00:14 UTC (rev 22070)
@@ -4,7 +4,6 @@
-
Modified: modules/tests/metamer/trunk/ftest/src/test/resources/testng.xml
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- modules/tests/metamer/trunk/ftest/src/test/resources/testng.xml 2011-03=
-07 12:26:24 UTC (rev 22069)
+++ modules/tests/metamer/trunk/ftest/src/test/resources/testng.xml 2011-03=
-07 13:00:14 UTC (rev 22070)
@@ -4,7 +4,6 @@
-
--===============2439951516667876785==--
From richfaces-svn-commits at lists.jboss.org Mon Mar 7 10:15:57 2011
Content-Type: multipart/mixed; boundary="===============3615201764927115935=="
MIME-Version: 1.0
From: richfaces-svn-commits at lists.jboss.org
To: richfaces-svn-commits at lists.jboss.org
Subject: [richfaces-svn-commits] JBoss Rich Faces SVN: r22071 - in
branches/4.0.X/examples/richfaces-showcase: src/main/webapp-gae/WEB-INF and 1
other directory.
Date: Mon, 07 Mar 2011 10:15:57 -0500
Message-ID: <201103071515.p27FFvfD020626@svn01.web.mwc.hst.phx2.redhat.com>
--===============3615201764927115935==
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable
Author: nbelaevski
Date: 2011-03-07 10:15:56 -0500 (Mon, 07 Mar 2011)
New Revision: 22071
Modified:
branches/4.0.X/examples/richfaces-showcase/pom.xml
branches/4.0.X/examples/richfaces-showcase/src/main/webapp-gae/WEB-INF/w=
eb.xml
Log:
https://issues.jboss.org/browse/RF-10681
Modified: branches/4.0.X/examples/richfaces-showcase/pom.xml
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/4.0.X/examples/richfaces-showcase/pom.xml 2011-03-07 13:00:14 =
UTC (rev 22070)
+++ branches/4.0.X/examples/richfaces-showcase/pom.xml 2011-03-07 15:15:56 =
UTC (rev 22071)
@@ -171,6 +171,16 @@
2.9.1
runtime
+
+ com.sun.faces
+ jsf-api
+ 2.0.3-b03
+
+
+ com.sun.faces
+ jsf-impl
+ 2.0.3-b03
+
Modified: branches/4.0.X/examples/richfaces-showcase/src/main/webapp-gae/WE=
B-INF/web.xml
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/4.0.X/examples/richfaces-showcase/src/main/webapp-gae/WEB-INF/=
web.xml 2011-03-07 13:00:14 UTC (rev 22070)
+++ branches/4.0.X/examples/richfaces-showcase/src/main/webapp-gae/WEB-INF/=
web.xml 2011-03-07 15:15:56 UTC (rev 22071)
@@ -45,29 +45,9 @@
client
- org.apache.myfaces.SECRET
- -- Insert some secret here --
-
-
- org.apache.myfaces.MAC_SECRET
- -- Insert some secret here --
-
-
- org.apache.myfaces.algorithm
- Blowfish
-
-
org.richfaces.staticResourceLocation
#{facesContext.externalContext.requestContextPath}/st=
atic-resources/#{resourceLocation}
- =
-
- org.apache.myfaces.config.annotation.LifecycleProvider=
- org.apache.myfaces.config.annotation.NoInjectionAnnot=
ationLifecycleProvider
-
=
org.ajax4jsf.cache.CACHE_MANAGER_FACTORY_CLASS
@@ -75,11 +55,34 @@
=
- org.apache.myfaces.EXPRESSION_FACTORY
- com.sun.el.ExpressionFactoryImpl
+
+ Set this flag to true if you want the JavaServer Faces
+ Reference Implementation to validate the XML in your
+ faces-config.xml resources against the DTD. Default
+ value is false.
+
+ com.sun.faces.validateXml
+ true
+
+
+
+ When enabled, the runtime initialization and default ResourceHandler
+ implementation will use threads to perform their functions. Set this =
+ value to false if threads aren't desired (as in the case of running =
+ within the Google Application Engine).
=
+ Note that when this option is disabled, the ResourceHandler will not =
+ pick up new versions of resources when ProjectStage is development.
+
+ com.sun.faces.enableThreading
+ false
+
+ com.sun.faces.expressionFactory
+ com.sun.el.ExpressionFactoryImpl
+
+
org.richfaces.executeAWTInitializer
false
--===============3615201764927115935==--
From richfaces-svn-commits at lists.jboss.org Mon Mar 7 11:57:45 2011
Content-Type: multipart/mixed; boundary="===============1235433752401263392=="
MIME-Version: 1.0
From: richfaces-svn-commits at lists.jboss.org
To: richfaces-svn-commits at lists.jboss.org
Subject: [richfaces-svn-commits] JBoss Rich Faces SVN: r22072 -
branches/4.0.X/ui/core/ui/src/main/java/org/richfaces/component.
Date: Mon, 07 Mar 2011 11:57:44 -0500
Message-ID: <201103071657.p27GvifB004227@svn01.web.mwc.hst.phx2.redhat.com>
--===============1235433752401263392==
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable
Author: nbelaevski
Date: 2011-03-07 11:57:44 -0500 (Mon, 07 Mar 2011)
New Revision: 22072
Modified:
branches/4.0.X/ui/core/ui/src/main/java/org/richfaces/component/Abstract=
AjaxStatus.java
Log:
https://issues.jboss.org/browse/RF-10709
Modified: branches/4.0.X/ui/core/ui/src/main/java/org/richfaces/component/A=
bstractAjaxStatus.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/4.0.X/ui/core/ui/src/main/java/org/richfaces/component/Abstrac=
tAjaxStatus.java 2011-03-07 15:15:56 UTC (rev 22071)
+++ branches/4.0.X/ui/core/ui/src/main/java/org/richfaces/component/Abstrac=
tAjaxStatus.java 2011-03-07 16:57:44 UTC (rev 22072)
@@ -23,7 +23,7 @@
=
package org.richfaces.component;
=
-import javax.faces.component.UIOutput;
+import javax.faces.component.UIComponentBase;
=
import org.richfaces.cdk.annotations.Attribute;
import org.richfaces.cdk.annotations.EventName;
@@ -37,7 +37,7 @@
*
*/
@JsfComponent(renderer =3D @JsfRenderer(type =3D "org.richfaces.StatusRend=
erer"), tag =3D @Tag(type =3D TagType.Facelets))
-public abstract class AbstractAjaxStatus extends UIOutput {
+public abstract class AbstractAjaxStatus extends UIComponentBase {
=
public static final String COMPONENT_TYPE =3D "org.richfaces.Status";
=
@@ -54,4 +54,35 @@
=
@Attribute(events =3D @EventName("success"))
public abstract String getOnsuccess();
+ =
+ @Attribute
+ public abstract String getName();
+
+ @Attribute
+ public abstract String getStartText();
+ =
+ @Attribute
+ public abstract String getStopText();
+ =
+ @Attribute
+ public abstract String getErrorText();
+ =
+ @Attribute
+ public abstract String getStartStyle();
+ =
+ @Attribute
+ public abstract String getStopStyle();
+ =
+ @Attribute
+ public abstract String getErrorStyle();
+ =
+ @Attribute
+ public abstract String getStartStyleClass();
+ =
+ @Attribute
+ public abstract String getStopStyleClass();
+ =
+ @Attribute
+ public abstract String getErrorStyleClass();
+ =
}
--===============1235433752401263392==--
From richfaces-svn-commits at lists.jboss.org Mon Mar 7 12:03:35 2011
Content-Type: multipart/mixed; boundary="===============3209492313784371820=="
MIME-Version: 1.0
From: richfaces-svn-commits at lists.jboss.org
To: richfaces-svn-commits at lists.jboss.org
Subject: [richfaces-svn-commits] JBoss Rich Faces SVN: r22073 - in
branches/4.0.X/ui/core/ui/src/main:
resources/META-INF/resources/org.richfaces and 1 other directory.
Date: Mon, 07 Mar 2011 12:03:35 -0500
Message-ID: <201103071703.p27H3ZPO010686@svn01.web.mwc.hst.phx2.redhat.com>
--===============3209492313784371820==
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable
Author: nbelaevski
Date: 2011-03-07 12:03:35 -0500 (Mon, 07 Mar 2011)
New Revision: 22073
Modified:
branches/4.0.X/ui/core/ui/src/main/java/org/richfaces/renderkit/html/Aja=
xStatusRenderer.java
branches/4.0.X/ui/core/ui/src/main/resources/META-INF/resources/org.rich=
faces/status.js
Log:
https://issues.jboss.org/browse/RF-10710
Modified: branches/4.0.X/ui/core/ui/src/main/java/org/richfaces/renderkit/h=
tml/AjaxStatusRenderer.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/4.0.X/ui/core/ui/src/main/java/org/richfaces/renderkit/html/Aj=
axStatusRenderer.java 2011-03-07 16:57:44 UTC (rev 22072)
+++ branches/4.0.X/ui/core/ui/src/main/java/org/richfaces/renderkit/html/Aj=
axStatusRenderer.java 2011-03-07 17:03:35 UTC (rev 22073)
@@ -93,7 +93,7 @@
this.styleAttributeName =3D stateName + "Style";
this.styleClassAttributeName =3D stateName + "StyleClass";
this.textAttributeName =3D stateName + "Text";
- this.defaultStyleClass =3D "rich-status-" + stateName;
+ this.defaultStyleClass =3D "rf-st-" + stateName;
}
=
public String getStyleAttributeName() {
Modified: branches/4.0.X/ui/core/ui/src/main/resources/META-INF/resources/o=
rg.richfaces/status.js
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/4.0.X/ui/core/ui/src/main/resources/META-INF/resources/org.ric=
hfaces/status.js 2011-03-07 16:57:44 UTC (rev 22072)
+++ branches/4.0.X/ui/core/ui/src/main/resources/META-INF/resources/org.ric=
hfaces/status.js 2011-03-07 17:03:35 UTC (rev 22073)
@@ -133,12 +133,12 @@
this.options.onstart.apply(this, arguments);
}
=
- return this.__showHide('.rich-status-start');
+ return this.__showHide('.rf-st-start');
},
=
stop: function() {
this.__stop();
- return this.__showHide('.rich-status-stop');
+ return this.__showHide('.rf-st-stop');
},
=
success: function() {
@@ -154,7 +154,7 @@
}
this.__stop();
=
- return this.__showHide(':not(.rich-status-error) + .rich-status-stop, .=
rich-status-error');
+ return this.__showHide(':not(.rf-st-error) + .rf-st-stop, .rf-st-error'=
);
},
=
__showHide: function(selector) {
--===============3209492313784371820==--
From richfaces-svn-commits at lists.jboss.org Mon Mar 7 12:16:11 2011
Content-Type: multipart/mixed; boundary="===============5426487181625452609=="
MIME-Version: 1.0
From: richfaces-svn-commits at lists.jboss.org
To: richfaces-svn-commits at lists.jboss.org
Subject: [richfaces-svn-commits] JBoss Rich Faces SVN: r22074 -
branches/4.0.X/ui/iteration/ui/src/main/resources/META-INF/resources/org.richfaces.
Date: Mon, 07 Mar 2011 12:16:10 -0500
Message-ID: <201103071716.p27HGANs012433@svn01.web.mwc.hst.phx2.redhat.com>
--===============5426487181625452609==
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable
Author: nbelaevski
Date: 2011-03-07 12:16:10 -0500 (Mon, 07 Mar 2011)
New Revision: 22074
Modified:
branches/4.0.X/ui/iteration/ui/src/main/resources/META-INF/resources/org=
.richfaces/datascroller.ecss
Log:
https://issues.jboss.org/browse/RF-10706
Modified: branches/4.0.X/ui/iteration/ui/src/main/resources/META-INF/resour=
ces/org.richfaces/datascroller.ecss
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/4.0.X/ui/iteration/ui/src/main/resources/META-INF/resources/or=
g.richfaces/datascroller.ecss 2011-03-07 17:03:35 UTC (rev 22073)
+++ branches/4.0.X/ui/iteration/ui/src/main/resources/META-INF/resources/or=
g.richfaces/datascroller.ecss 2011-03-07 17:16:10 UTC (rev 22074)
@@ -117,7 +117,7 @@
cursor: default;
font-weight: bold;
border-width: 1px;
- bordr-style: solid;
+ border-style: solid;
border-color: transparent;
border-bottom-width: 1px;
border-bottom-style: solid;
--===============5426487181625452609==--
From richfaces-svn-commits at lists.jboss.org Mon Mar 7 12:25:06 2011
Content-Type: multipart/mixed; boundary="===============2625761814971165558=="
MIME-Version: 1.0
From: richfaces-svn-commits at lists.jboss.org
To: richfaces-svn-commits at lists.jboss.org
Subject: [richfaces-svn-commits] JBoss Rich Faces SVN: r22075 - in
branches/4.0.X: parent and 1 other directory.
Date: Mon, 07 Mar 2011 12:25:05 -0500
Message-ID: <201103071725.p27HP5dq012947@svn01.web.mwc.hst.phx2.redhat.com>
--===============2625761814971165558==
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable
Author: nbelaevski
Date: 2011-03-07 12:25:05 -0500 (Mon, 07 Mar 2011)
New Revision: 22075
Modified:
branches/4.0.X/examples/parent/pom.xml
branches/4.0.X/parent/pom.xml
Log:
Updates to Mojarra 2.1.x profile:
- 2.1.0 upgraded to b11
- 2.1.0-SNAPSHOT changed to 2.1.1-SNAPSHOT
Modified: branches/4.0.X/examples/parent/pom.xml
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/4.0.X/examples/parent/pom.xml 2011-03-07 17:16:10 UTC (rev 220=
74)
+++ branches/4.0.X/examples/parent/pom.xml 2011-03-07 17:25:05 UTC (rev 220=
75)
@@ -209,12 +209,12 @@
com.sun.faces
jsf-api
- 2.1.0-SNAPSHOT
+ 2.1.1-SNAPSHOT
com.sun.faces
jsf-impl
- 2.1.0-SNAPSHOT
+ 2.1.1-SNAPSHOT
@@ -230,12 +230,12 @@
com.sun.faces
jsf-api
- 2.1.0-b09
+ 2.1.0-b11
com.sun.faces
jsf-impl
- 2.1.0-b09
+ 2.1.0-b11
Modified: branches/4.0.X/parent/pom.xml
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/4.0.X/parent/pom.xml 2011-03-07 17:16:10 UTC (rev 22074)
+++ branches/4.0.X/parent/pom.xml 2011-03-07 17:25:05 UTC (rev 22075)
@@ -337,13 +337,13 @@
com.sun.faces
jsf-api
- 2.1.0-SNAPSHOT
+ 2.1.1-SNAPSHOT
provided
com.sun.faces
jsf-impl
- 2.1.0-SNAPSHOT
+ 2.1.1-SNAPSHOT
test
@@ -360,13 +360,13 @@
com.sun.faces
jsf-api
- 2.1.0-b09
+ 2.1.0-b11
provided
com.sun.faces
jsf-impl
- 2.1.0-b09
+ 2.1.0-b11
test
--===============2625761814971165558==--
From richfaces-svn-commits at lists.jboss.org Mon Mar 7 12:31:11 2011
Content-Type: multipart/mixed; boundary="===============7265716699852599984=="
MIME-Version: 1.0
From: richfaces-svn-commits at lists.jboss.org
To: richfaces-svn-commits at lists.jboss.org
Subject: [richfaces-svn-commits] JBoss Rich Faces SVN: r22076 - in
branches/4.0.X/core/impl/src: test/java/org/richfaces/component/nsutils and 1
other directory.
Date: Mon, 07 Mar 2011 12:31:10 -0500
Message-ID: <201103071731.p27HVAak013732@svn01.web.mwc.hst.phx2.redhat.com>
--===============7265716699852599984==
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable
Author: nbelaevski
Date: 2011-03-07 12:31:10 -0500 (Mon, 07 Mar 2011)
New Revision: 22076
Removed:
branches/4.0.X/core/impl/src/main/java/org/richfaces/component/nsutils/N=
SUtils.java
branches/4.0.X/core/impl/src/main/java/org/richfaces/component/nsutils/p=
ackage-info.java
branches/4.0.X/core/impl/src/test/java/org/richfaces/component/nsutils/N=
SUtilsTest.java
Log:
Removal of legacy NSUtils class
Deleted: branches/4.0.X/core/impl/src/main/java/org/richfaces/component/nsu=
tils/NSUtils.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/4.0.X/core/impl/src/main/java/org/richfaces/component/nsutils/=
NSUtils.java 2011-03-07 17:25:05 UTC (rev 22075)
+++ branches/4.0.X/core/impl/src/main/java/org/richfaces/component/nsutils/=
NSUtils.java 2011-03-07 17:31:10 UTC (rev 22076)
@@ -1,43 +0,0 @@
-/**
- * License Agreement.
- *
- * JBoss RichFaces - Ajax4jsf Component Library
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-130=
1 USA
- */
-
-package org.richfaces.component.nsutils;
-
-import javax.faces.component.UIComponent;
-import javax.faces.context.FacesContext;
-import java.io.IOException;
-
-/**
- * @author Nick Belaevski - nbelaevski(a)exadel.com
- * created 21.12.2006
- */
-public final class NSUtils {
- public static final String XMLNS_PREFIX =3D "rich";
- public static final String XMLNS_URI =3D "http://richfaces.ajax4jsf.or=
g/rich";
- public static final String XMLNS_VALUE =3D "xmlns:" + XMLNS_PREFIX;
-
- private NSUtils() {
- }
-
- public static void writeNameSpace(FacesContext context, UIComponent co=
mponent) throws IOException {
- context.getResponseWriter().writeAttribute(NSUtils.XMLNS_VALUE, NS=
Utils.XMLNS_URI, null);
- }
-}
Deleted: branches/4.0.X/core/impl/src/main/java/org/richfaces/component/nsu=
tils/package-info.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/4.0.X/core/impl/src/main/java/org/richfaces/component/nsutils/=
package-info.java 2011-03-07 17:25:05 UTC (rev 22075)
+++ branches/4.0.X/core/impl/src/main/java/org/richfaces/component/nsutils/=
package-info.java 2011-03-07 17:31:10 UTC (rev 22076)
@@ -1,4 +0,0 @@
-/**
- * Custom XML namespace utility classes
- */
-package org.richfaces.component.nsutils;
Deleted: branches/4.0.X/core/impl/src/test/java/org/richfaces/component/nsu=
tils/NSUtilsTest.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/4.0.X/core/impl/src/test/java/org/richfaces/component/nsutils/=
NSUtilsTest.java 2011-03-07 17:25:05 UTC (rev 22075)
+++ branches/4.0.X/core/impl/src/test/java/org/richfaces/component/nsutils/=
NSUtilsTest.java 2011-03-07 17:31:10 UTC (rev 22076)
@@ -1,61 +0,0 @@
-/**
- * License Agreement.
- *
- * JBoss RichFaces - Ajax4jsf Component Library
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-130=
1 USA
- */
-
-
-
-package org.richfaces.component.nsutils;
-
-import java.io.StringWriter;
-
-import javax.faces.component.UIInput;
-import javax.faces.context.ResponseWriter;
-
-import org.jboss.test.faces.AbstractFacesTest;
-
-public class NSUtilsTest extends AbstractFacesTest {
- public void setUp() throws Exception {
- super.setUp();
- setupFacesRequest();
- }
-
- public void tearDown() throws Exception {
- super.tearDown();
- }
-
- public void testWriteNameSpace() throws Exception {
- final StringWriter stringWriter =3D new StringWriter();
- ResponseWriter writer =3D facesContext.getRenderKit().createRespon=
seWriter(stringWriter, "text/html", "UTF-8");
-
- facesContext.setResponseWriter(writer);
-
- UIInput input =3D new UIInput();
-
- writer.startDocument();
- writer.startElement("span", input);
- NSUtils.writeNameSpace(facesContext, input);
- writer.endElement("span");
- writer.endDocument();
-
- String result =3D stringWriter.getBuffer().toString();
-
- assertTrue(result.contains("span xmlns:rich=3D\"http://richfaces.a=
jax4jsf.org/rich\""));
- }
-}
--===============7265716699852599984==--
From richfaces-svn-commits at lists.jboss.org Mon Mar 7 15:14:45 2011
Content-Type: multipart/mixed; boundary="===============5035853760302984451=="
MIME-Version: 1.0
From: richfaces-svn-commits at lists.jboss.org
To: richfaces-svn-commits at lists.jboss.org
Subject: [richfaces-svn-commits] JBoss Rich Faces SVN: r22077 - in
trunk/ui/validator: api/src/main/java/org/richfaces/el and 17 other
directories.
Date: Mon, 07 Mar 2011 15:14:44 -0500
Message-ID: <201103072014.p27KEie6015240@svn01.web.mwc.hst.phx2.redhat.com>
--===============5035853760302984451==
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable
Author: alexsmirnov
Date: 2011-03-07 15:14:44 -0500 (Mon, 07 Mar 2011)
New Revision: 22077
Added:
trunk/ui/validator/ui/src/main/java/org/richfaces/component/behavior/Mes=
sageUpdateScript.java
trunk/ui/validator/ui/src/main/java/org/richfaces/view/facelets/html/Gra=
phValidatorHandler.java
Removed:
trunk/ui/validator/ui/src/main/java/org/richfaces/validator/ClonedObject=
Resolver.java
Modified:
trunk/ui/validator/
trunk/ui/validator/api/src/main/java/org/richfaces/el/ValueDescriptor.ja=
va
trunk/ui/validator/api/src/main/java/org/richfaces/el/ValueExpressionAna=
layser.java
trunk/ui/validator/api/src/main/java/org/richfaces/javascript/ScriptNotF=
oundException.java
trunk/ui/validator/api/src/main/java/org/richfaces/validator/FacesConver=
terService.java
trunk/ui/validator/api/src/main/java/org/richfaces/validator/FacesValida=
torService.java
trunk/ui/validator/api/src/main/java/org/richfaces/validator/GraphValida=
torState.java
trunk/ui/validator/ui/src/main/java/org/richfaces/component/AbstractGrap=
hValidator.java
trunk/ui/validator/ui/src/main/java/org/richfaces/component/behavior/Cli=
entValidatorImpl.java
trunk/ui/validator/ui/src/main/java/org/richfaces/el/CapturingELContext.=
java
trunk/ui/validator/ui/src/main/java/org/richfaces/el/ValueExpressionAnal=
ayserImpl.java
trunk/ui/validator/ui/src/main/java/org/richfaces/javascript/ClientScrip=
tServiceImpl.java
trunk/ui/validator/ui/src/main/java/org/richfaces/renderkit/html/AjaxOnl=
yScript.java
trunk/ui/validator/ui/src/main/java/org/richfaces/renderkit/html/ClientA=
ndAjaxScript.java
trunk/ui/validator/ui/src/main/java/org/richfaces/renderkit/html/ClientO=
nlyScript.java
trunk/ui/validator/ui/src/main/java/org/richfaces/validator/BeanValidato=
rServiceImpl.java
trunk/ui/validator/ui/src/main/java/org/richfaces/validator/ConverterSer=
viceImpl.java
trunk/ui/validator/ui/src/main/java/org/richfaces/validator/FacesBeanVal=
idator.java
trunk/ui/validator/ui/src/main/java/org/richfaces/validator/FacesService=
Base.java
trunk/ui/validator/ui/src/main/java/org/richfaces/validator/FacesValidat=
orServiceImpl.java
trunk/ui/validator/ui/src/main/resources/META-INF/csv.xml
trunk/ui/validator/ui/src/main/resources/META-INF/resources/org.richface=
s/richfaces-csv.js
trunk/ui/validator/ui/src/test/java/org/richfaces/component/behavior/Beh=
aviorGetConverterTest.java
trunk/ui/validator/ui/src/test/java/org/richfaces/component/behavior/Beh=
aviorGetValidatorTest.java
trunk/ui/validator/ui/src/test/java/org/richfaces/el/ELTestBase.java
trunk/ui/validator/ui/src/test/java/org/richfaces/el/TestCaptureEL.java
trunk/ui/validator/ui/src/test/java/org/richfaces/el/ValueExpressionAnal=
ayserTest.java
trunk/ui/validator/ui/src/test/java/org/richfaces/javascript/client/Mock=
TestBase.java
trunk/ui/validator/ui/src/test/java/org/richfaces/javascript/client/conv=
erter/BooleanConverterTest.java
trunk/ui/validator/ui/src/test/java/org/richfaces/javascript/client/conv=
erter/ByteConverterTest.java
trunk/ui/validator/ui/src/test/java/org/richfaces/javascript/client/conv=
erter/ConverterTestBase.java
trunk/ui/validator/ui/src/test/java/org/richfaces/javascript/client/conv=
erter/NumberConverterTest.java
trunk/ui/validator/ui/src/test/java/org/richfaces/javascript/client/conv=
erter/ShortConverterTest.java
trunk/ui/validator/ui/src/test/java/org/richfaces/javascript/client/vali=
dator/DoubleRangeValidatorTest.java
trunk/ui/validator/ui/src/test/java/org/richfaces/javascript/client/vali=
dator/LengthValidatorTest.java
trunk/ui/validator/ui/src/test/java/org/richfaces/javascript/client/vali=
dator/LongRangeValidatorTest.java
trunk/ui/validator/ui/src/test/java/org/richfaces/javascript/client/vali=
dator/MaxValidatorTest.java
trunk/ui/validator/ui/src/test/java/org/richfaces/javascript/client/vali=
dator/ValidatorTestBase.java
trunk/ui/validator/ui/src/test/java/org/richfaces/validator/FacesConvert=
erServiceTest.java
trunk/ui/validator/ui/src/test/java/org/richfaces/validator/FacesValidat=
orServiceTest.java
Log:
Merge changes from 4.0.x
Property changes on: trunk/ui/validator
___________________________________________________________________
Added: svn:mergeinfo
+ /branches/4.0.X/ui/validator:21810-22076
Modified: trunk/ui/validator/api/src/main/java/org/richfaces/el/ValueDescri=
ptor.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/ui/validator/api/src/main/java/org/richfaces/el/ValueDescriptor.j=
ava 2011-03-07 17:31:10 UTC (rev 22076)
+++ trunk/ui/validator/api/src/main/java/org/richfaces/el/ValueDescriptor.j=
ava 2011-03-07 20:14:44 UTC (rev 22077)
@@ -14,24 +14,17 @@
=
private final Class> beanType;
=
- private final Class> propertyType;
-
/**
* @param beanType
* @param name
* @param propertyType
* @param readOnly
*/
- public ValueDescriptor(Class> beanType, String name, Class> proper=
tyType) {
+ public ValueDescriptor(Class> beanType, String name) {
this.beanType =3D beanType;
this.name =3D name;
- this.propertyType =3D propertyType;
}
=
- public ValueDescriptor(Class> beanType, String name) {
- this(beanType,name,Object.class);
- }
-
/**
* @return the name
*/
@@ -47,13 +40,6 @@
return beanType;
}
=
- /**
- * @return the propertyType
- */
- public Class> getPropertyType() {
- return propertyType;
- }
-
/* (non-Javadoc)
* @see java.lang.Object#hashCode()
*/
Modified: trunk/ui/validator/api/src/main/java/org/richfaces/el/ValueExpres=
sionAnalayser.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/ui/validator/api/src/main/java/org/richfaces/el/ValueExpressionAn=
alayser.java 2011-03-07 17:31:10 UTC (rev 22076)
+++ trunk/ui/validator/api/src/main/java/org/richfaces/el/ValueExpressionAn=
alayser.java 2011-03-07 20:14:44 UTC (rev 22077)
@@ -3,6 +3,7 @@
*/
package org.richfaces.el;
=
+import javax.el.ELException;
import javax.el.ValueExpression;
import javax.faces.context.FacesContext;
=
@@ -13,6 +14,8 @@
*/
public interface ValueExpressionAnalayser {
=
- ValueDescriptor getPropertyDescriptor(FacesContext context, ValueExpre=
ssion expression);
+ ValueDescriptor getPropertyDescriptor(FacesContext context, ValueExpre=
ssion expression) throws ELException;
=
+ ValueDescriptor updateValueAndGetPropertyDescriptor(FacesContext conte=
xt, ValueExpression expression, Object newValue) throws ELException;
+ =
}
Modified: trunk/ui/validator/api/src/main/java/org/richfaces/javascript/Scr=
iptNotFoundException.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/ui/validator/api/src/main/java/org/richfaces/javascript/ScriptNot=
FoundException.java 2011-03-07 17:31:10 UTC (rev 22076)
+++ trunk/ui/validator/api/src/main/java/org/richfaces/javascript/ScriptNot=
FoundException.java 2011-03-07 20:14:44 UTC (rev 22077)
@@ -3,22 +3,19 @@
public class ScriptNotFoundException extends Exception {
=
public ScriptNotFoundException() {
- // TODO Auto-generated constructor stub
+ super();
}
=
public ScriptNotFoundException(String message) {
super(message);
- // TODO Auto-generated constructor stub
}
=
public ScriptNotFoundException(Throwable cause) {
super(cause);
- // TODO Auto-generated constructor stub
}
=
public ScriptNotFoundException(String message, Throwable cause) {
super(message, cause);
- // TODO Auto-generated constructor stub
}
=
}
Modified: trunk/ui/validator/api/src/main/java/org/richfaces/validator/Face=
sConverterService.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/ui/validator/api/src/main/java/org/richfaces/validator/FacesConve=
rterService.java 2011-03-07 17:31:10 UTC (rev 22076)
+++ trunk/ui/validator/api/src/main/java/org/richfaces/validator/FacesConve=
rterService.java 2011-03-07 20:14:44 UTC (rev 22077)
@@ -1,5 +1,6 @@
package org.richfaces.validator;
=
+import javax.faces.component.EditableValueHolder;
import javax.faces.context.FacesContext;
import javax.faces.convert.Converter;
=
@@ -11,6 +12,6 @@
*/
public interface FacesConverterService {
=
- ConverterDescriptor getConverterDescription(FacesContext context,Conve=
rter converter);
+ ConverterDescriptor getConverterDescription(FacesContext context,Edita=
bleValueHolder input, Converter converter);
=
}
Modified: trunk/ui/validator/api/src/main/java/org/richfaces/validator/Face=
sValidatorService.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/ui/validator/api/src/main/java/org/richfaces/validator/FacesValid=
atorService.java 2011-03-07 17:31:10 UTC (rev 22076)
+++ trunk/ui/validator/api/src/main/java/org/richfaces/validator/FacesValid=
atorService.java 2011-03-07 20:14:44 UTC (rev 22077)
@@ -1,10 +1,11 @@
package org.richfaces.validator;
=
+import javax.faces.component.EditableValueHolder;
import javax.faces.context.FacesContext;
import javax.faces.validator.Validator;
=
=
public interface FacesValidatorService {
=
- ValidatorDescriptor getValidatorDescription(FacesContext context,Valid=
ator validator);
+ ValidatorDescriptor getValidatorDescription(FacesContext context,Edita=
bleValueHolder component, Validator validator);
}
Modified: trunk/ui/validator/api/src/main/java/org/richfaces/validator/Grap=
hValidatorState.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/ui/validator/api/src/main/java/org/richfaces/validator/GraphValid=
atorState.java 2011-03-07 17:31:10 UTC (rev 22076)
+++ trunk/ui/validator/api/src/main/java/org/richfaces/validator/GraphValid=
atorState.java 2011-03-07 20:14:44 UTC (rev 22077)
@@ -1,12 +1,21 @@
package org.richfaces.validator;
=
+import java.util.IdentityHashMap;
+import java.util.Map;
=
+import javax.faces.context.FacesContext;
+
+
public final class GraphValidatorState {
- public static final String STATE_ATTRIBUTE_PREFIX =3D "org.richfaces.G=
raphValidator:";
- boolean active =3D false;
- Object cloned;
- Object base;
- Object property;
+ public static final String STATE_ATTRIBUTE =3D "org.richfaces.GraphVal=
idator:";
+ private boolean active =3D false;
+ private final Object cloned;
+ =
+ =
+ public GraphValidatorState(Object cloned) {
+ this.cloned =3D cloned;
+ }
+ =
/**
* @return the active
*/
@@ -29,57 +38,28 @@
return cloned;
}
=
- /**
- * @param cloned
- * the cloned to set
- */
- public void setCloned(Object cloned) {
- this.cloned =3D cloned;
+ public static Object getActiveClone(FacesContext context,Object base){
+ GraphValidatorState state =3D getState(context, base);
+ if(null =3D=3D state || !state.isActive()){
+ return null;
+ }
+ return state.getCloned();
}
=
- /**
- * @return the base
- */
- public Object getBase() {
- return base;
+ public static GraphValidatorState getState(FacesContext context,Object=
base){
+ return getStateMap(context).get(base);
}
=
- /**
- * @param base
- * the base to set
- */
- public void setBase(Object base) {
- this.base =3D base;
+ public static void setState(FacesContext context,Object base,GraphVali=
datorState state){
+ getStateMap(context).put(base, state);
}
-
- /**
- * @return the property
- */
- public Object getProperty() {
- return property;
- }
-
- /**
- * @param property
- * the property to set
- */
- public void setProperty(Object property) {
- this.property =3D property;
- }
-
- public boolean isSameBase(Object base) {
- return (null =3D=3D base && null =3D=3D this.base) || (base =3D=3D=
this.base);
- }
-
- public boolean isSameProperty(Object property) {
- if (null =3D=3D this.property) {
- return null =3D=3D property;
- } else {
- return this.property.equals(property);
+ =
+ private static Map getStateMap(FacesConte=
xt context){
+ IdentityHashMap statesMap =3D (Identi=
tyHashMap) context.getAttributes().get(STATE_A=
TTRIBUTE);
+ if(null =3D=3D statesMap){
+ statesMap =3D new IdentityHashMap=
();
+ context.getAttributes().put(STATE_ATTRIBUTE, statesMap);
}
+ return statesMap;
}
-
- public boolean isSame(Object base, Object property) {
- return isSameBase(base) && isSameProperty(property) && active;
- }
}
\ No newline at end of file
Modified: trunk/ui/validator/ui/src/main/java/org/richfaces/component/Abstr=
actGraphValidator.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/ui/validator/ui/src/main/java/org/richfaces/component/AbstractGra=
phValidator.java 2011-03-07 17:31:10 UTC (rev 22076)
+++ trunk/ui/validator/ui/src/main/java/org/richfaces/component/AbstractGra=
phValidator.java 2011-03-07 20:14:44 UTC (rev 22077)
@@ -20,43 +20,41 @@
*/
package org.richfaces.component;
=
-import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
import java.util.Collection;
-import java.util.Iterator;
=
-import javax.el.ELContext;
import javax.el.ValueExpression;
import javax.faces.FacesException;
import javax.faces.application.FacesMessage;
-import javax.faces.component.EditableValueHolder;
-import javax.faces.component.UIComponent;
import javax.faces.component.UIComponentBase;
import javax.faces.context.FacesContext;
import javax.faces.validator.Validator;
=
+import org.richfaces.application.ServiceTracker;
import org.richfaces.cdk.annotations.Attribute;
import org.richfaces.cdk.annotations.JsfComponent;
import org.richfaces.cdk.annotations.Tag;
import org.richfaces.cdk.annotations.TagType;
-import org.richfaces.el.CapturingELResolver;
-import org.richfaces.el.ELContextWrapper;
+import org.richfaces.log.Logger;
+import org.richfaces.log.RichfacesLogger;
+import org.richfaces.validator.BeanValidatorService;
import org.richfaces.validator.FacesBeanValidator;
-import org.richfaces.validator.GraphValidator;
import org.richfaces.validator.GraphValidatorState;
=
/**
* JSF component class
* =
*/
-(a)JsfComponent(tag=3D@Tag(name=3D"graphValidator",type=3DTagType.Facelets=
))
+(a)JsfComponent(tag=3D@Tag(name=3D"graphValidator",type=3DTagType.Facelets=
, handler =3D "org.richfaces.view.facelets.html.GraphValidatorHandler"))
public abstract class AbstractGraphValidator extends UIComponentBase {
=
public static final String COMPONENT_TYPE =3D "org.richfaces.GraphVali=
dator";
=
public static final String COMPONENT_FAMILY =3D "org.richfaces.GraphVa=
lidator";
+ =
+ private static final Logger LOG =3D RichfacesLogger.COMPONENTS.getLogg=
er();
=
/**
* Get object for validation
@@ -121,38 +119,26 @@
@Override
public void processDecodes(FacesContext context) {
GraphValidatorState validatorState =3D null;
- // Detect value EL-expression.
- ValueExpression valueExpression =3D getValueExpression("value");
- if (null !=3D valueExpression) {
-
- Object value =3D getValue();
- if (null !=3D value && value instanceof Cloneable) {
+ boolean wasActive =3D false;
+ Object value =3D getValue();
+ if (null !=3D value) {
+ validatorState =3D GraphValidatorState.getState(context, value=
);
+ if (null !=3D validatorState) {
+ // Reuse old value, if any.
+ wasActive =3D validatorState.isActive();
+ validatorState.setActive(true);
+ } else if (value instanceof Cloneable) {
try {
- ELContext initialELContext =3D context.getELContext();
-
- CapturingELResolver capturingELResolver =3D new Captur=
ingELResolver(initialELContext.getELResolver());
- Class> type =3D
- valueExpression.getType(new ELContextWrapper(initi=
alELContext, capturingELResolver));
- if (null !=3D type) {
- validatorState =3D new GraphValidatorState();
- Method method =3D getCloneMethod(value.getClass());
- if (!Modifier.isPublic(method.getModifiers())) {
- // Method Object#clone() is protected by defau=
lt. Make it public
- // unless developer did it.
- method.setAccessible(true);
- }
- validatorState.setCloned(method.invoke(value));
- validatorState.setBase(capturingELResolver.getBase=
());
- validatorState.setProperty(capturingELResolver.get=
Property());
- validatorState.setActive(true);
- context.getExternalContext().getRequestMap().put(g=
etStateId(context), validatorState);
- }
+ Method method =3D getCloneMethod(value.getClass());
+ validatorState =3D new GraphValidatorState(method.invo=
ke(value));
+ validatorState.setActive(true);
+ GraphValidatorState.setState(context, value, validator=
State);
} catch (NoSuchMethodException e) {
- // do nothing, that is really not possible.
+ // do nothing, that is really not possible - clone() i=
mpemented in Object.
} catch (InvocationTargetException e) {
throw new FacesException(e);
} catch (IllegalArgumentException e) {
- // do nothing, that is really not possible.
+ // do nothing, that is really not possible - method ha=
s no arguments.
} catch (IllegalAccessException e) {
throw new FacesException(e);
}
@@ -160,7 +146,7 @@
}
super.processDecodes(context);
if (null !=3D validatorState) {
- validatorState.setActive(false);
+ validatorState.setActive(wasActive);
}
}
=
@@ -169,71 +155,78 @@
return clazz.getDeclaredMethod("clone");
} catch (NoSuchMethodException e) {
if (null !=3D clazz.getSuperclass()) {
- return getCloneMethod(clazz.getSuperclass());
+ Method method =3D getCloneMethod(clazz.getSuperclass());
+ if (!Modifier.isPublic(method.getModifiers())) {
+ // Method Object#clone() is protected by default. Make=
it public
+ // unless developer did it.
+ method.setAccessible(true);
+ }
+ return method;
} else {
throw e;
}
}
}
=
- protected String getStateId(FacesContext context) {
- String stateId =3D GraphValidatorState.STATE_ATTRIBUTE_PREFIX + ge=
tClientId(context);
- return stateId;
- }
=
protected GraphValidatorState getValidatorState(FacesContext context) {
- return (GraphValidatorState) context.getExternalContext().getReque=
stMap().get(getStateId(context));
+ Object value =3D getValue();
+ if (null !=3D value) {
+ return GraphValidatorState.getState(context, value);
+ } else {
+ return null;
+ }
}
=
@Override
public void processValidators(FacesContext context) {
GraphValidatorState validatorState =3D getValidatorState(context);
if (null !=3D validatorState) {
+ boolean wasActive =3D validatorState.isActive();
validatorState.setActive(true);
+ super.processValidators(context);
+ validatorState.setActive(wasActive);
+ if(!context.isValidationFailed()){
+ validateObject(context, validatorState.getCloned());
+ }
+ } else {
+ super.processValidators(context);
}
- super.processValidators(context);
- if (null !=3D validatorState) {
- validatorState.setActive(false);
- validateObject(context, validatorState.getCloned());
- context.getExternalContext().getRequestMap().remove(getStateId=
(context));
- }
}
=
@Override
public void processUpdates(FacesContext context) {
super.processUpdates(context);
- Object value =3D getValue();
- validateObject(context, value);
+ // Validate updated object if it was not done on clone.
+ if (!context.isValidationFailed()) {
+ Object value =3D getValue();
+ if (null !=3D value) {
+ if (null =3D=3D GraphValidatorState.getState(context, valu=
e)) {
+ validateObject(context, value);
+ }
+ }
+ }
}
=
private void validateObject(FacesContext context, Object value) {
if (null !=3D value) {
- Validator validator =3D context.getApplication().createValidat=
or(getType());
- if (validator instanceof GraphValidator) {
- GraphValidator graphValidator =3D (GraphValidator) validat=
or;
- Collection messages =3D graphValidator.validateGra=
ph(context, this, value, getGroups());
- if (null !=3D messages) {
- context.renderResponse();
- // send all validation messages.
- String clientId =3D getClientId(context);
- for (String msg : messages) {
- // TODO - create Summary message ?
- String summary =3D null !=3D getSummary() ? getSum=
mary() + msg : msg;
- context.addMessage(clientId, new FacesMessage(Face=
sMessage.SEVERITY_ERROR, summary, msg));
- }
+ Collection messages;
+ BeanValidatorService validatorService =3D ServiceTracker.getSe=
rvice(BeanValidatorService.class);
+ messages =3D validatorService.validateObject(context, value, g=
etGroups());
+ if (!messages.isEmpty()) {
+ context.renderResponse();
+ // send all validation messages.
+ String clientId =3D getClientId(context);
+ for (String msg : messages) {
+ String summary =3D null !=3D getSummary() ? getSummary=
() : msg;
+ context.addMessage(clientId, new FacesMessage(FacesMes=
sage.SEVERITY_ERROR, summary, msg));
}
-
- } else {
- throw new FacesException("Validator " + FacesBeanValidator=
.BEAN_VALIDATOR_TYPE
- + " does not implement GraphValidator");
}
=
}
}
=
- @Override
- public void encodeBegin(FacesContext context) throws IOException {
- super.encodeBegin(context);
+ public Validator createChildrenValidator(FacesContext context) {
FacesBeanValidator validator =3D (FacesBeanValidator) context.getA=
pplication().createValidator(getType());
validator.setSummary(getSummary());
ValueExpression expression =3D getValueExpression("groups");
@@ -242,48 +235,7 @@
} else {
validator.setGroups(getGroups());
}
- setupValidators(this, validator);
+ return validator;
}
-
- @Override
- public void encodeChildren(FacesContext context) throws IOException {
- if (isRendered()) {
- for (UIComponent child : getChildren()) {
- if (child.isRendered()) {
- child.encodeAll(context);
- }
- }
- }
- }
-
- private void setupValidators(UIComponent component, Validator validato=
r) {
- Iterator facetsAndChildren =3D component.getFacetsAnd=
Children();
- while (facetsAndChildren.hasNext()) {
- UIComponent child =3D facetsAndChildren.next();
- if (child instanceof EditableValueHolder) {
- EditableValueHolder input =3D (EditableValueHolder) child;
- setupValidator(input, validator);
- }
- setupValidators(child, validator);
- }
- }
-
- /**
- * @param input
- */
- private void setupValidator(EditableValueHolder input, Validator valid=
ator) {
- Validator[] validators =3D input.getValidators();
- for (int i =3D 0; i < validators.length; i++) {
- if (validators[i].getClass().equals(validator.getClass())) {
- return;
- }
- }
- input.addValidator(validator);
- }
-
- @Override
- public boolean getRendersChildren() {
- return true;
- }
-
+ =
}
Modified: trunk/ui/validator/ui/src/main/java/org/richfaces/component/behav=
ior/ClientValidatorImpl.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/ui/validator/ui/src/main/java/org/richfaces/component/behavior/Cl=
ientValidatorImpl.java 2011-03-07 17:31:10 UTC (rev 22076)
+++ trunk/ui/validator/ui/src/main/java/org/richfaces/component/behavior/Cl=
ientValidatorImpl.java 2011-03-07 20:14:44 UTC (rev 22077)
@@ -31,6 +31,7 @@
import javax.el.ValueExpression;
import javax.faces.FacesException;
import javax.faces.application.Application;
+import javax.faces.application.FacesMessage;
import javax.faces.component.ActionSource;
import javax.faces.component.EditableValueHolder;
import javax.faces.component.NamingContainer;
@@ -54,6 +55,7 @@
import org.richfaces.cdk.annotations.Tag;
import org.richfaces.cdk.annotations.TagType;
import org.richfaces.component.ClientSideMessage;
+import org.richfaces.javascript.JavaScriptService;
import org.richfaces.log.Logger;
import org.richfaces.log.RichfacesLogger;
import org.richfaces.renderkit.html.ClientValidatorRenderer;
@@ -116,12 +118,10 @@
if(partialViewContext.isAjaxRequest()){
UIComponent component =3D event.getComponent();
if(component instanceof EditableValueHolder){
- EditableValueHolder input =3D (EditableValueHolder) compon=
ent;
- Set messages =3D getMessages(facesContext, co=
mponent);
- Collection renderIds =3D partialViewContext.getRen=
derIds();
- for (UIComponent uiComponent : messages) {
- renderIds.add(uiComponent.getClientId(facesContext));
- }
+ String clientId =3D component.getClientId(facesContext);
+ Iterator messages =3D facesContext.getMessag=
es(clientId);
+ JavaScriptService javaScriptService =3D ServiceTracker.get=
Service(JavaScriptService.class);
+ javaScriptService.addPageReadyScript(facesContext, new Mes=
sageUpdateScript(clientId,messages));
}
}
super.broadcast(event);
@@ -245,7 +245,7 @@
}
if(null !=3D converter){
FacesConverterService converterService =3D ServiceTracker.=
getService(facesContext, FacesConverterService.class);
- return converterService.getConverterDescription(facesConte=
xt, converter);
+ return converterService.getConverterDescription(facesConte=
xt, input, converter);
} else {
return null;
}
@@ -282,18 +282,20 @@
Validator[] facesValidators =3D input.getValidators();
FacesContext facesContext =3D context.getFacesContext();
if (facesValidators.length > 0) {
+ boolean beanValidatorsProcessed =3D false;
FacesValidatorService facesValidatorService =3D ServiceTra=
cker.getService(facesContext,
FacesValidatorService.class);
for (Validator validator : facesValidators) {
if (validator instanceof BeanValidator || validator in=
stanceof FacesBeanValidator) {
ValueExpression valueExpression =3D component.getV=
alueExpression(VALUE);
- if (null !=3D valueExpression) {
+ if (null !=3D valueExpression && !beanValidatorsPr=
ocessed) {
BeanValidatorService beanValidatorService =3D =
ServiceTracker.getService(facesContext,
BeanValidatorService.class);
validators.addAll(beanValidatorService.getCons=
trains(facesContext, valueExpression, getGroups()));
+ beanValidatorsProcessed =3D true;
}
} else {
- validators.add(facesValidatorService.getValidatorD=
escription(facesContext, validator));
+ validators.add(facesValidatorService.getValidatorD=
escription(facesContext, input, validator));
}
}
}
Copied: trunk/ui/validator/ui/src/main/java/org/richfaces/component/behavio=
r/MessageUpdateScript.java (from rev 22076, branches/4.0.X/ui/validator/ui/=
src/main/java/org/richfaces/component/behavior/MessageUpdateScript.java)
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/ui/validator/ui/src/main/java/org/richfaces/component/behavior/Me=
ssageUpdateScript.java (rev 0)
+++ trunk/ui/validator/ui/src/main/java/org/richfaces/component/behavior/Me=
ssageUpdateScript.java 2011-03-07 20:14:44 UTC (rev 22077)
@@ -0,0 +1,45 @@
+package org.richfaces.component.behavior;
+
+import java.io.IOException;
+import java.util.Iterator;
+
+import javax.faces.application.FacesMessage;
+
+
+import org.ajax4jsf.javascript.JSFunction;
+import org.ajax4jsf.javascript.ScriptString;
+import org.ajax4jsf.javascript.ScriptStringBase;
+import org.richfaces.javascript.Message;
+
+import com.google.common.base.Function;
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.Iterators;
+
+public class MessageUpdateScript extends ScriptStringBase implements Scrip=
tString {
+
+ private static final Function super FacesMessage, Message> MESSAGES_=
TRANSFORMER =3D new Function() {
+
+ public Message apply(FacesMessage msg) {
+ return new Message(msg);
+ }
+ };
+ private final ImmutableList messages;
+ private final String clientId;
+
+ public MessageUpdateScript(String clientId,Iterator mess=
ages) {
+ this.clientId =3D clientId;
+ this.messages =3D ImmutableList.copyOf(Iterators.transform(message=
s, MESSAGES_TRANSFORMER));
+ }
+
+ public void appendScript(Appendable target) throws IOException {
+ JSFunction resetMessages =3D new JSFunction("RichFaces.csv.clearMe=
ssage",clientId);
+ resetMessages.appendScript(target);
+ target.append(';');
+ for (Message message : messages) {
+ JSFunction sendMessage =3D new JSFunction("RichFaces.csv.sendM=
essage",clientId,message);
+ sendMessage.appendScript(target);
+ target.append(';');
+ }
+ }
+
+}
Modified: trunk/ui/validator/ui/src/main/java/org/richfaces/el/CapturingELC=
ontext.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/ui/validator/ui/src/main/java/org/richfaces/el/CapturingELContext=
.java 2011-03-07 17:31:10 UTC (rev 22076)
+++ trunk/ui/validator/ui/src/main/java/org/richfaces/el/CapturingELContext=
.java 2011-03-07 20:14:44 UTC (rev 22077)
@@ -4,14 +4,21 @@
package org.richfaces.el;
=
import java.beans.FeatureDescriptor;
+import java.util.Collection;
import java.util.Iterator;
import java.util.Locale;
+import java.util.Map;
=
import javax.el.ELContext;
import javax.el.ELResolver;
import javax.el.FunctionMapper;
+import javax.el.ValueExpression;
import javax.el.VariableMapper;
+import javax.faces.context.FacesContext;
+import javax.faces.el.CompositeComponentExpressionHolder;
=
+import org.richfaces.validator.GraphValidatorState;
+
/**
* This class wraps original ELContext and capture whole call stack to the=
target object so it could be used to extract
* semantic information like annotations or Jena Model properties.
@@ -36,6 +43,37 @@
return reference;
}
=
+ private boolean isContainerObject(Object base) {
+ return base instanceof Collection || base instanceof Map || base.g=
etClass().isArray();
+ }
+
+ public boolean hasReferenceExpression() {
+ return reference !=3D null && reference.getBase() instanceof Compo=
siteComponentExpressionHolder;
+ }
+
+ public ValueExpression getReferenceExpression() {
+ CompositeComponentExpressionHolder expressionHolder =3D (Composite=
ComponentExpressionHolder) reference.getBase();
+ return expressionHolder.getExpression(reference.getProperty().toSt=
ring());
+ }
+
+ public ValueDescriptor getDescriptor() {
+ ValueReference localReference =3D reference;
+
+ while (true) {
+ if (localReference =3D=3D null || localReference.getBase() =3D=
=3D null || localReference.getProperty() =3D=3D null) {
+ return null;
+ }
+
+ Object base =3D localReference.getBase();
+
+ if (isContainerObject(base) && localReference.hasNext()) {
+ localReference =3D localReference.next();
+ } else {
+ return new ValueDescriptor(base.getClass(), localReference=
.getProperty().toString());
+ }
+ }
+ }
+
/*
* (non-Javadoc)
* =
@@ -88,6 +126,7 @@
private final class InterceptingResolver extends ELResolver {
=
private ELResolver delegate;
+ private boolean clonedObject;
=
public InterceptingResolver(ELResolver delegate) {
this.delegate =3D delegate;
@@ -97,6 +136,11 @@
@Override
public void setValue(ELContext context, Object base, Object proper=
ty, Object value) {
if (base !=3D null) {
+ // TODO - detect value object from inderect references ( e=
.g. data table variables ).
+ if (this.clonedObject) {
+ delegate.setValue(context, base, property, value);
+ }
+
context.setPropertyResolved(true);
reference =3D new ValueReference(base, property, reference=
);
}
@@ -107,7 +151,16 @@
@Override
public Object getValue(ELContext context, Object base, Object prop=
erty) {
reference =3D new ValueReference(base, property, reference);
- return delegate.getValue(context, base, property);
+ Object value =3D delegate.getValue(context, base, property);
+ if (null !=3D value && context.isPropertyResolved()) {
+ FacesContext facesContext =3D (FacesContext) context.getCo=
ntext(FacesContext.class);
+ Object clone =3D GraphValidatorState.getActiveClone(facesC=
ontext, value);
+ if (null !=3D clone) {
+ this.clonedObject =3D true;
+ return clone;
+ }
+ }
+ return value;
}
=
@Override
Modified: trunk/ui/validator/ui/src/main/java/org/richfaces/el/ValueExpress=
ionAnalayserImpl.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/ui/validator/ui/src/main/java/org/richfaces/el/ValueExpressionAna=
layserImpl.java 2011-03-07 17:31:10 UTC (rev 22076)
+++ trunk/ui/validator/ui/src/main/java/org/richfaces/el/ValueExpressionAna=
layserImpl.java 2011-03-07 20:14:44 UTC (rev 22077)
@@ -1,25 +1,96 @@
package org.richfaces.el;
=
+import javax.el.ELContext;
import javax.el.ELException;
import javax.el.ValueExpression;
import javax.faces.context.FacesContext;
=
public class ValueExpressionAnalayserImpl implements ValueExpressionAnalay=
ser {
=
- public ValueDescriptor getPropertyDescriptor(FacesContext context, Val=
ueExpression expression) throws ELException {
- if(null =3D=3D context || null =3D=3D expression){
- throw new NullPointerException();
+ private abstract static class ValueResolutionCommand {
+ =
+ private ValueDescriptor valueDescriptor;
+ =
+ public ValueDescriptor getValueDescriptor() {
+ return valueDescriptor;
}
- CapturingELContext capturingContext =3D new CapturingELContext(con=
text.getELContext());
- Class> type =3D expression.getType(capturingContext);
- ValueReference reference =3D capturingContext.getReference();
- if(null !=3D reference && null !=3D reference.getBase() && null !=
=3D reference.getProperty()){
- // TODO - detect arrays, maps and lists. Check JSF implementat=
ion code - seems that Mojarra dosn't validate such fields.
- ValueDescriptor descriptor =3D new ValueDescriptor(reference.g=
etBase().getClass(),reference.getProperty().toString(),type);
- return descriptor;
- } else {
- throw new ELException("Cannot determine property for expressio=
n "+expression.getExpressionString());
+
+ void setValueDescriptor(ValueDescriptor valueDescriptor) {
+ this.valueDescriptor =3D valueDescriptor;
}
+ =
+ public abstract void resolve(ValueExpression expression, ELContext=
context);
+ =
}
+ =
+ private static final class GetTypeCommand extends ValueResolutionComma=
nd {
=
+ @Override
+ public void resolve(ValueExpression expression, ELContext context)=
{
+ expression.getType(context);
+ }
+ }
+ =
+ private static final class SetValueCommand extends ValueResolutionComm=
and {
+
+ private Object value;
+ =
+ public SetValueCommand(Object value) {
+ super();
+ this.value =3D value;
+ }
+
+ @Override
+ public void resolve(ValueExpression expression, ELContext context)=
{
+ expression.setValue(context, value);
+ }
+ =
+ }
+ =
+ private void checkNotNull(FacesContext context, ValueExpression expres=
sion) {
+ if (context =3D=3D null) {
+ throw new NullPointerException("facesContext");
+ }
+ =
+ if (expression =3D=3D null) {
+ throw new NullPointerException("expression");
+ }
+ }
+ =
+ private void resolveValue(FacesContext context, ValueExpression initia=
lExpression, ValueResolutionCommand command) throws ELException {
+ checkNotNull(context, initialExpression);
+ =
+ ValueExpression expression =3D initialExpression;
+ =
+ while (expression !=3D null) {
+ CapturingELContext capturingContext =3D new CapturingELContext=
(context.getELContext());
+ command.resolve(expression, capturingContext);
+
+ if (capturingContext.hasReferenceExpression()) {
+ expression =3D capturingContext.getReferenceExpression();
+ } else {
+ ValueDescriptor result =3D capturingContext.getDescriptor(=
);
+
+ if (result =3D=3D null) {
+ throw new ELException("Cannot determine property for e=
xpression " + initialExpression.getExpressionString());
+ }
+ =
+ command.setValueDescriptor(result);
+ break;
+ }
+ }
+ }
+ =
+ public ValueDescriptor getPropertyDescriptor(FacesContext context, Val=
ueExpression expression) throws ELException {
+ ValueResolutionCommand command =3D new GetTypeCommand();
+ resolveValue(context, expression, command);
+ return command.getValueDescriptor();
+ }
+
+ public ValueDescriptor updateValueAndGetPropertyDescriptor(FacesContex=
t context, ValueExpression expression, Object newValue) throws ELException {
+ ValueResolutionCommand command =3D new SetValueCommand(newValue);
+ resolveValue(context, expression, command);
+ return command.getValueDescriptor();
+ }
+ =
}
Modified: trunk/ui/validator/ui/src/main/java/org/richfaces/javascript/Clie=
ntScriptServiceImpl.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/ui/validator/ui/src/main/java/org/richfaces/javascript/ClientScri=
ptServiceImpl.java 2011-03-07 17:31:10 UTC (rev 22076)
+++ trunk/ui/validator/ui/src/main/java/org/richfaces/javascript/ClientScri=
ptServiceImpl.java 2011-03-07 20:14:44 UTC (rev 22077)
@@ -3,9 +3,12 @@
*/
package org.richfaces.javascript;
=
+import java.util.Collections;
import java.util.List;
import java.util.Map;
+import java.util.concurrent.ConcurrentMap;
=
+import javax.faces.FacesException;
import javax.faces.application.Resource;
import javax.faces.application.ResourceDependency;
import javax.faces.application.ResourceHandler;
@@ -14,7 +17,10 @@
import org.richfaces.component.util.Strings;
import org.richfaces.resource.ResourceKey;
=
+import com.google.common.base.Function;
+import com.google.common.collect.ComputationException;
import com.google.common.collect.Lists;
+import com.google.common.collect.MapMaker;
=
/**
* @author asmirnov
@@ -25,11 +31,42 @@
private static final String TEXT_JAVASCRIPT =3D "text/javascript";
=
private static final String ORG_RICHFACES_CSV =3D "org.richfaces.csv";
+ =
+ private static final LibraryFunction NO_SCRIPT =3D new LibraryFunction=
() {
+ =
+ public Iterable getResources() {
+ return Collections.emptySet();
+ }
+ =
+ public String getName() {
+ return null;
+ }
+ };
=
+ private static final Function, ? extends LibraryFunction> RES=
OURCE_SCRIPT_FUNCTION =3D new Function, LibraryFunction>() {
+
+ public LibraryFunction apply(Class> arg0) {
+ return getScriptResource(FacesContext.getCurrentInstance(), ar=
g0);
+ }
+ };
+ =
+ private static final Function, ? extends LibraryFunction> ANN=
OTATION_SCRIPT_FUNCTION =3D new Function, LibraryFunction>() {
+
+ public LibraryFunction apply(Class> arg0) {
+ return getScriptFromAnnotation(arg0);
+ }
+ };
+
+ private final ConcurrentMap, LibraryFunction> resourcesMappin=
g;
+
+ private final ConcurrentMap, LibraryFunction> annotationsMapp=
ing;
+
private final Map, LibraryFunction> defaultMapping;
=
public ClientScriptServiceImpl(Map, LibraryFunction> defaultM=
apping) {
this.defaultMapping =3D defaultMapping;
+ resourcesMapping =3D new MapMaker().initialCapacity(10).makeComput=
ingMap(RESOURCE_SCRIPT_FUNCTION);
+ annotationsMapping =3D new MapMaker().initialCapacity(10).makeComp=
utingMap(ANNOTATION_SCRIPT_FUNCTION);
}
=
/*
@@ -41,20 +78,30 @@
if (null =3D=3D facesContext || null =3D=3D javaClass) {
throw new NullPointerException();
}
- LibraryFunction function;
- try {
- function =3D getScriptResource(facesContext, javaClass);
- } catch (ScriptNotFoundException e) {
+ LibraryFunction function =3D getFromComputationMap(resourcesMappin=
g, javaClass);
+ if(NO_SCRIPT =3D=3D function) {
if (defaultMapping.containsKey(javaClass)) {
function =3D defaultMapping.get(javaClass);
} else {
- function =3D getScriptFromAnnotation(javaClass);
+ function =3D getFromComputationMap(annotationsMapping, jav=
aClass);
}
}
+ if(NO_SCRIPT =3D=3D function) {
+ throw new ScriptNotFoundException("No client-side script for c=
lass "+javaClass.getName());
+ }
return function;
}
+ =
+ private LibraryFunction getFromComputationMap(ConcurrentMap, =
LibraryFunction> map, Class> clazz){
+ try {
+ return map.get(clazz);
+ } catch (ComputationException e) {
+ Throwable cause =3D e.getCause();
+ throw new FacesException(cause);
+ }
+ }
=
- private LibraryFunction getScriptFromAnnotation(Class> javaClass) th=
rows ScriptNotFoundException {
+ private static LibraryFunction getScriptFromAnnotation(Class> javaCl=
ass) {
if (javaClass.isAnnotationPresent(ClientSideScript.class)) {
ClientSideScript clientSideScript =3D javaClass.getAnnotation(=
ClientSideScript.class);
List resources =3D Lists.newArrayList();
@@ -63,12 +110,11 @@
}
return new LibraryFunctionImplementation(clientSideScript.func=
tion(), resources);
} else {
- throw new ScriptNotFoundException();
+ return NO_SCRIPT;
}
}
=
- private LibraryFunction getScriptResource(FacesContext facesContext, C=
lass> javaClass)
- throws ScriptNotFoundException {
+ private static LibraryFunction getScriptResource(FacesContext facesCon=
text, Class> javaClass){
ResourceHandler resourceHandler =3D facesContext.getApplication().=
getResourceHandler();
String resourceName =3D javaClass.getSimpleName() + ".js";
Resource facesResource =3D resourceHandler.createResource(resource=
Name, ORG_RICHFACES_CSV, TEXT_JAVASCRIPT);
@@ -76,7 +122,7 @@
final String functionName =3D Strings.firstToLowerCase(javaCla=
ss.getSimpleName());
return new LibraryFunctionImplementation(functionName,resource=
Name, ORG_RICHFACES_CSV);
} else {
- throw new ScriptNotFoundException();
+ return NO_SCRIPT;
}
}
=
Modified: trunk/ui/validator/ui/src/main/java/org/richfaces/renderkit/html/=
AjaxOnlyScript.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/ui/validator/ui/src/main/java/org/richfaces/renderkit/html/AjaxOn=
lyScript.java 2011-03-07 17:31:10 UTC (rev 22076)
+++ trunk/ui/validator/ui/src/main/java/org/richfaces/renderkit/html/AjaxOn=
lyScript.java 2011-03-07 20:14:44 UTC (rev 22077)
@@ -1,15 +1,18 @@
package org.richfaces.renderkit.html;
=
import java.io.IOException;
-import java.util.Collections;
=
import org.richfaces.resource.ResourceKey;
=
+import com.google.common.collect.ImmutableSet;
+
public class AjaxOnlyScript extends ValidatorScriptBase {
=
- public static final Iterable AJAX_LIBRARIES =3D Collectio=
ns.singleton(ResourceKey.create("ajax.reslib",
- "org.richfaces"));
+ public static final ResourceKey AJAX_RESOURCE =3D ResourceKey.create("=
ajax.reslib",
+ "org.richfaces");
=
+ public static final Iterable AJAX_LIBRARIES =3D Immutable=
Set.of(AJAX_RESOURCE,ClientOnlyScript.CSV_RESOURCE);
+
private final String ajaxScript;
=
public AjaxOnlyScript(String ajaxScript) {
Modified: trunk/ui/validator/ui/src/main/java/org/richfaces/renderkit/html/=
ClientAndAjaxScript.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/ui/validator/ui/src/main/java/org/richfaces/renderkit/html/Client=
AndAjaxScript.java 2011-03-07 17:31:10 UTC (rev 22076)
+++ trunk/ui/validator/ui/src/main/java/org/richfaces/renderkit/html/Client=
AndAjaxScript.java 2011-03-07 20:14:44 UTC (rev 22077)
@@ -5,7 +5,8 @@
=
import org.richfaces.resource.ResourceKey;
=
-import com.google.common.collect.Iterables;
+import com.google.common.collect.ImmutableSet;
+import com.google.common.collect.ImmutableSet.Builder;
=
=
public class ClientAndAjaxScript extends ClientOnlyScript{
@@ -19,7 +20,10 @@
Collection extends LibraryScriptFunction> validatorScripts, Stri=
ng ajaxScript) {
super(clientSideConverterScript,validatorScripts);
this.ajaxScript =3D ajaxScript;
- resources =3D Iterables.concat(AjaxOnlyScript.AJAX_LIBRARIES,super=
.getResources());
+ Builder builder =3D ImmutableSet.builder=
();
+ builder.add(AjaxOnlyScript.AJAX_RESOURCE);
+ builder.addAll(super.getResources());
+ resources =3D builder.build();
}
=
=
Modified: trunk/ui/validator/ui/src/main/java/org/richfaces/renderkit/html/=
ClientOnlyScript.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/ui/validator/ui/src/main/java/org/richfaces/renderkit/html/Client=
OnlyScript.java 2011-03-07 17:31:10 UTC (rev 22076)
+++ trunk/ui/validator/ui/src/main/java/org/richfaces/renderkit/html/Client=
OnlyScript.java 2011-03-07 20:14:44 UTC (rev 22077)
@@ -15,7 +15,7 @@
=
public class ClientOnlyScript extends ValidatorScriptBase {
=
- private static final ResourceKey CSV_RESOURCE =3D ResourceKey.create("=
csv.reslib", "org.richfaces");
+ public static final ResourceKey CSV_RESOURCE =3D ResourceKey.create("c=
sv.reslib", "org.richfaces");
protected final LibraryScriptFunction converter;
protected final ImmutableList extends LibraryScriptFunction> validat=
ors;
private final ImmutableSet resources;
@@ -26,13 +26,13 @@
this.converter =3D clientSideConverterScript;
this.validators =3D ImmutableList.copyOf(validatorScripts);
LinkedHashSet resources =3D Sets.newLinkedHashSet();
+ resources.add(CSV_RESOURCE);
if (null !=3D converter) {
Iterables.addAll(resources, converter.getResources());
}
for (LibraryScriptFunction scriptString : validators) {
Iterables.addAll(resources, scriptString.getResources());
}
- resources.add(CSV_RESOURCE);
this.resources =3D ImmutableSet.copyOf(resources);
}
=
Modified: trunk/ui/validator/ui/src/main/java/org/richfaces/validator/BeanV=
alidatorServiceImpl.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/ui/validator/ui/src/main/java/org/richfaces/validator/BeanValidat=
orServiceImpl.java 2011-03-07 17:31:10 UTC (rev 22076)
+++ trunk/ui/validator/ui/src/main/java/org/richfaces/validator/BeanValidat=
orServiceImpl.java 2011-03-07 20:14:44 UTC (rev 22077)
@@ -3,23 +3,17 @@
*/
package org.richfaces.validator;
=
-import java.beans.FeatureDescriptor;
import java.lang.annotation.Annotation;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
-import java.util.EmptyStackException;
import java.util.HashSet;
-import java.util.Iterator;
import java.util.Locale;
import java.util.Map;
import java.util.Set;
-import java.util.Stack;
=
-import javax.el.ELContext;
import javax.el.ELException;
-import javax.el.ELResolver;
import javax.el.ValueExpression;
import javax.faces.FacesException;
import javax.faces.application.FacesMessage;
@@ -30,7 +24,6 @@
import javax.validation.metadata.ElementDescriptor.ConstraintFinder;
import javax.validation.metadata.PropertyDescriptor;
=
-import org.richfaces.el.ELContextWrapper;
import org.richfaces.el.ValueDescriptor;
import org.richfaces.el.ValueExpressionAnalayser;
=
@@ -64,6 +57,11 @@
Class>... groups) {
try {
ValueDescriptor propertyDescriptor =3D analayser.getPropertyDe=
scriptor(context, expression);
+ =
+ if (propertyDescriptor =3D=3D null) {
+ return Collections.emptySet();
+ }
+ =
return processBeanAttribute(context, propertyDescriptor, group=
s);
} catch (ELException e) {
return Collections.emptySet();
@@ -147,66 +145,36 @@
=
public Collection validateExpression(FacesContext context, Val=
ueExpression expression, Object newValue,
Class>... groups) {
+ =
if (null =3D=3D context) {
throw new FacesException(INPUT_PARAMETERS_IS_NOT_CORRECT);
}
- Collection validationMessages =3D Collections.emptySet();
+ =
+ Collection validationMessages =3D null;
if (null !=3D expression) {
- ELContext elContext =3D context.getELContext();
- ValidationResolver validationResolver =3D
- createValidationResolver(context, elContext.getELResolver(=
), groups);
- ELContextWrapper wrappedElContext =3D new ELContextWrapper(elC=
ontext, validationResolver);
+ ValueDescriptor valueDescriptor;
try {
- expression.setValue(wrappedElContext, newValue);
+ valueDescriptor =3D analayser.updateValueAndGetPropertyDes=
criptor(context, expression, newValue);
} catch (ELException e) {
throw new FacesException(e);
}
- if (!validationResolver.isValid()) {
- validationMessages =3D validationResolver.getValidationMes=
sages();
+
+ if (valueDescriptor !=3D null) {
+ validationMessages =3D validate(context, valueDescriptor.g=
etBeanType(), valueDescriptor.getName(), newValue, groups);
}
+ =
}
+ =
+ if (validationMessages =3D=3D null) {
+ validationMessages =3D Collections.emptySet();
+ }
+ =
return validationMessages;
}
=
=
- protected ValidationResolver createValidationResolver(FacesContext con=
text, ELResolver parent, Class>[] groups) {
- return new ValidationResolver(parent, context, groups);
- }
=
/**
- * @author asmirnov
- * =
- */
- protected static class BasePropertyPair {
- private final Object base;
- private final Object property;
-
- /**
- * @param base
- * @param property
- */
- public BasePropertyPair(Object base, Object property) {
- this.base =3D base;
- this.property =3D property;
- }
-
- /**
- * @return the base
- */
- public Object getBase() {
- return base;
- }
-
- /**
- * @return the property
- */
- public Object getProperty() {
- return property;
- }
-
- }
-
- /**
* Class for identify validator instance by locale
* =
* @author amarkhel
@@ -277,165 +245,13 @@
=
}
=
- /**
- * Wrapper class for a {@link ELResolver}. For a setValue method, perf=
orm validation instead of real assignment.
- * =
- * @author asmirnov
- * =
- */
- final class ValidationResolver extends ELResolver {
=
- /**
- * Original resolver.
- */
- private final ELResolver parent;
-
- private boolean valid =3D true;
-
- private Collection validationMessages =3D null;
-
- private Stack valuesStack;
-
- private Class>[] groups;
-
- private FacesContext facesContext;
-
- private boolean clonedObject =3D false;
-
- /**
- * @param parent
- * @param context
- */
- public ValidationResolver(ELResolver parent, FacesContext context,=
Class>[] groups) {
- this.parent =3D parent;
- this.valuesStack =3D new Stack();
- this.groups =3D groups;
- this.facesContext =3D context;
- }
-
- public boolean isValid() {
- return valid;
- }
-
- /**
- * @param context
- * @param base
- * @return
- * @see javax.el.ELResolver#getCommonPropertyType(javax.el.ELConte=
xt, java.lang.Object)
- */
- public Class> getCommonPropertyType(ELContext context, Object ba=
se) {
- return parent.getCommonPropertyType(context, base);
- }
-
- /**
- * @param context
- * @param base
- * @return
- * @see javax.el.ELResolver#getFeatureDescriptors(javax.el.ELConte=
xt, java.lang.Object)
- */
- public Iterator getFeatureDescriptors(ELContext=
context, Object base) {
- return parent.getFeatureDescriptors(context, base);
- }
-
- /**
- * @param context
- * @param base
- * @param property
- * @return
- * @see javax.el.ELResolver#getType(javax.el.ELContext, java.lang.=
Object, java.lang.Object)
- */
- public Class> getType(ELContext context, Object base, Object pro=
perty) {
- return parent.getType(context, base, property);
- }
-
- /**
- * @param context
- * @param base
- * @param property
- * @return
- * @see javax.el.ELResolver#getValue(javax.el.ELContext, java.lang=
.Object, java.lang.Object)
- */
- public Object getValue(ELContext context, Object base, Object prop=
erty) {
- Object value =3D ClonedObjectResolver.resolveCloned(context, b=
ase, property);
- if (null !=3D value) {
- this.clonedObject =3D true;
- context.setPropertyResolved(true);
- } else {
- value =3D parent.getValue(context, base, property);
- }
- valuesStack.push(new BasePropertyPair(base, property));
- return value;
- }
-
- /**
- * @param context
- * @param base
- * @param property
- * @return
- * @see javax.el.ELResolver#isReadOnly(javax.el.ELContext, java.la=
ng.Object, java.lang.Object)
- */
- public boolean isReadOnly(ELContext context, Object base, Object p=
roperty) {
- return parent.isReadOnly(context, base, property);
- }
-
- /**
- * @param context
- * @param base
- * @param property
- * @param value
- * @see javax.el.ELResolver#setValue(javax.el.ELContext, java.lang=
.Object, java.lang.Object, java.lang.Object)
- */
- public void setValue(ELContext context, Object base, Object proper=
ty, Object value) {
- if (null !=3D base && null !=3D property) {
- // TODO - detect value object from inderect references ( e=
.g. data table variables ).
- if (this.clonedObject) {
- parent.setValue(context, base, property, value);
- }
- context.setPropertyResolved(true);
- // For Arrays, Collection or Map use parent base and prope=
rty.
- BasePropertyPair basePropertyPair =3D lookupBeanProperty(n=
ew BasePropertyPair(base, property));
- base =3D basePropertyPair.getBase();
- property =3D basePropertyPair.getProperty();
- if (null !=3D base && null !=3D property) {
- // https://jira.jboss.org/jira/browse/RF-4034
- // apache el looses locale information during value
- // resolution,
- // so we use our own
- validationMessages =3D validate(facesContext, base, pr=
operty.toString(), value, groups);
- valid =3D null =3D=3D validationMessages || 0 =3D=3D v=
alidationMessages.size();
-
- }
- }
- }
-
- private BasePropertyPair lookupBeanProperty(BasePropertyPair pair)=
{
- Object base =3D pair.getBase();
- if (null !=3D base && (base instanceof Collection || base inst=
anceof Map || base.getClass().isArray())) {
- try {
- pair =3D lookupBeanProperty(valuesStack.pop());
- } catch (EmptyStackException e) {
- // Do nothing, this is a first item.
- }
- }
- return pair;
- }
-
- /**
- * @return the validationMessages
- */
- public Collection getValidationMessages() {
- return validationMessages;
- }
-
- }
-
- protected Collection validate(FacesContext facesContext, Objec=
t base, String property, Object value,
+ protected Collection validate(FacesContext facesContext, Class=
> beanType, String property, Object value,
Class>[] groups) {
- @SuppressWarnings("rawtypes")
- Class beanType =3D base.getClass();
+ =
@SuppressWarnings("unchecked")
Set> constrains =3D
- getValidator(facesContext).validateValue(beanType, property, v=
alue, getGroups(groups));
+ getValidator(facesContext).validateValue((Class) beanT=
ype, property, value, getGroups(groups));
return extractMessages(constrains);
}
=
@@ -450,13 +266,15 @@
}
=
private Collection extractMessages(Set> violations) {
- Collection messages =3D null;
+ Collection messages;
if (null !=3D violations && violations.size() > 0) {
messages =3D new ArrayList(violations.size());
for (ConstraintViolation extends Object> constraintViolation=
: violations) {
messages.add(constraintViolation.getMessage());
}
=
+ } else {
+ messages =3D Collections.emptySet();
}
return messages;
}
Deleted: trunk/ui/validator/ui/src/main/java/org/richfaces/validator/Cloned=
ObjectResolver.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/ui/validator/ui/src/main/java/org/richfaces/validator/ClonedObjec=
tResolver.java 2011-03-07 17:31:10 UTC (rev 22076)
+++ trunk/ui/validator/ui/src/main/java/org/richfaces/validator/ClonedObjec=
tResolver.java 2011-03-07 20:14:44 UTC (rev 22077)
@@ -1,110 +0,0 @@
-/**
- * =
- */
-package org.richfaces.validator;
-
-import java.beans.FeatureDescriptor;
-import java.util.Iterator;
-import java.util.Map;
-
-import javax.el.ELContext;
-import javax.el.ELResolver;
-import javax.faces.context.FacesContext;
-
-
-
-/**
- * @author asmirnov
- * =
- */
-public class ClonedObjectResolver extends ELResolver {
-
- /*
- * (non-Javadoc)
- * =
- * @see javax.el.ELResolver#getCommonPropertyType(javax.el.ELContext, =
java.lang.Object)
- */
- @Override
- public Class> getCommonPropertyType(ELContext context, Object base) {
- // Do nothing
- return null;
- }
-
- /*
- * (non-Javadoc)
- * =
- * @see javax.el.ELResolver#getFeatureDescriptors(javax.el.ELContext, =
java.lang.Object)
- */
- @Override
- public Iterator getFeatureDescriptors(ELContext con=
text, Object base) {
- // do nothing
- return null;
- }
-
- /*
- * (non-Javadoc)
- * =
- * @see javax.el.ELResolver#getType(javax.el.ELContext, java.lang.Obje=
ct, java.lang.Object)
- */
- @Override
- public Class> getType(ELContext context, Object base, Object propert=
y) {
- Object cloned =3D resolveCloned(context, base, property);
- if (null !=3D cloned) {
- context.setPropertyResolved(true);
- return cloned.getClass();
- }
- return null;
- }
-
- /*
- * (non-Javadoc)
- * =
- * @see javax.el.ELResolver#getValue(javax.el.ELContext, java.lang.Obj=
ect, java.lang.Object)
- */
- @Override
- public Object getValue(ELContext context, Object base, Object property=
) {
- Object cloned =3D resolveCloned(context, base, property);
- if (null !=3D cloned) {
- context.setPropertyResolved(true);
- }
- return cloned;
- }
-
- /*
- * (non-Javadoc)
- * =
- * @see javax.el.ELResolver#isReadOnly(javax.el.ELContext, java.lang.O=
bject, java.lang.Object)
- */
- @Override
- public boolean isReadOnly(ELContext context, Object base, Object prope=
rty) {
- // TODO Auto-generated method stub
- return false;
- }
-
- /*
- * (non-Javadoc)
- * =
- * @see javax.el.ELResolver#setValue(javax.el.ELContext, java.lang.Obj=
ect, java.lang.Object, java.lang.Object)
- */
- @Override
- public void setValue(ELContext context, Object base, Object property, =
Object value) {
- // TODO Auto-generated method stub
-
- }
-
- public static Object resolveCloned(ELContext context, Object base, Obj=
ect property) {
- if (null !=3D base || null !=3D property) {
- FacesContext facesContext =3D FacesContext.getCurrentInstance(=
);
- Map requestMap =3D facesContext.getExternalCon=
text().getRequestMap();
- for (String key : requestMap.keySet()) {
- if (null !=3D key && key.startsWith(GraphValidatorState.ST=
ATE_ATTRIBUTE_PREFIX)) {
- GraphValidatorState state =3D (GraphValidatorState) re=
questMap.get(key);
- if (state.isSame(base, property)) {
- return state.getCloned();
- }
- }
- }
- }
- return null;
- }
-}
Modified: trunk/ui/validator/ui/src/main/java/org/richfaces/validator/Conve=
rterServiceImpl.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/ui/validator/ui/src/main/java/org/richfaces/validator/ConverterSe=
rviceImpl.java 2011-03-07 17:31:10 UTC (rev 22076)
+++ trunk/ui/validator/ui/src/main/java/org/richfaces/validator/ConverterSe=
rviceImpl.java 2011-03-07 20:14:44 UTC (rev 22077)
@@ -5,6 +5,7 @@
=
=
import javax.faces.application.FacesMessage;
+import javax.faces.component.EditableValueHolder;
import javax.faces.component.UIInput;
import javax.faces.context.FacesContext;
import javax.faces.convert.BigDecimalConverter;
@@ -37,9 +38,9 @@
* @see org.richfaces.validator.FacesConverterService#getConverterDesc=
ription(javax.faces.context.FacesContext,
* javax.faces.convert.Converter)
*/
- public ConverterDescriptor getConverterDescription(FacesContext contex=
t, Converter converter) {
+ public ConverterDescriptor getConverterDescription(FacesContext contex=
t, EditableValueHolder input, Converter converter) {
// determine converter message.
- FacesMessage message =3D getMessage(context, converter);
+ FacesMessage message =3D getMessage(context, converter, input);
ConverterDescriptorImpl descriptor =3D new ConverterDescriptorImpl=
(converter.getClass(), message);
fillParameters(descriptor, converter);
descriptor.makeImmutable();
Modified: trunk/ui/validator/ui/src/main/java/org/richfaces/validator/Faces=
BeanValidator.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/ui/validator/ui/src/main/java/org/richfaces/validator/FacesBeanVa=
lidator.java 2011-03-07 17:31:10 UTC (rev 22076)
+++ trunk/ui/validator/ui/src/main/java/org/richfaces/validator/FacesBeanVa=
lidator.java 2011-03-07 20:14:44 UTC (rev 22077)
@@ -37,8 +37,6 @@
=
import org.richfaces.application.ServiceTracker;
import org.richfaces.cdk.annotations.JsfValidator;
-import org.richfaces.cdk.annotations.Tag;
-import org.richfaces.cdk.annotations.TagType;
=
import com.google.common.base.Strings;
=
@@ -48,7 +46,7 @@
* @author asmirnov
* =
*/
-(a)JsfValidator(id=3DFacesBeanValidator.BEAN_VALIDATOR_TYPE,tag=3D@Tag(nam=
e=3D"beanValidator",type=3DTagType.Facelets))
+(a)JsfValidator(id=3DFacesBeanValidator.BEAN_VALIDATOR_TYPE)
public class FacesBeanValidator implements Serializable, Validator, GraphV=
alidator {
=
public static final String BEAN_VALIDATOR_TYPE =3D "org.richfaces.Bean=
Validator";
Modified: trunk/ui/validator/ui/src/main/java/org/richfaces/validator/Faces=
ServiceBase.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/ui/validator/ui/src/main/java/org/richfaces/validator/FacesServic=
eBase.java 2011-03-07 17:31:10 UTC (rev 22076)
+++ trunk/ui/validator/ui/src/main/java/org/richfaces/validator/FacesServic=
eBase.java 2011-03-07 20:14:44 UTC (rev 22077)
@@ -7,6 +7,8 @@
import java.lang.reflect.InvocationTargetException;
=
import javax.faces.application.FacesMessage;
+import javax.faces.component.EditableValueHolder;
+import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
=
import com.google.common.collect.ImmutableSet;
@@ -50,11 +52,23 @@
* =
* @param context
* @param component
+ * @param input TODO
* @return
*/
- public FacesMessage getMessage(FacesContext context, T component) {
+ public FacesMessage getMessage(FacesContext context, T component, Edit=
ableValueHolder input) {
String messageId =3D getMessageId(component);
return MessageFactory.createMessage(context, messageId);
}
=
+
+ protected void setLabelParameter(EditableValueHolder input, FacesValid=
atorDescriptor descriptor) {
+ if (input instanceof UIComponent) {
+ UIComponent component =3D (UIComponent) input;
+ Object label =3D component.getAttributes().get("label");
+ if(null!=3Dlabel){
+ descriptor.addParameter("label", label);
+ }
+ }
+ }
+
}
\ No newline at end of file
Modified: trunk/ui/validator/ui/src/main/java/org/richfaces/validator/Faces=
ValidatorServiceImpl.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/ui/validator/ui/src/main/java/org/richfaces/validator/FacesValida=
torServiceImpl.java 2011-03-07 17:31:10 UTC (rev 22076)
+++ trunk/ui/validator/ui/src/main/java/org/richfaces/validator/FacesValida=
torServiceImpl.java 2011-03-07 20:14:44 UTC (rev 22077)
@@ -4,6 +4,7 @@
package org.richfaces.validator;
=
import javax.faces.application.FacesMessage;
+import javax.faces.component.EditableValueHolder;
import javax.faces.component.UIInput;
import javax.faces.context.FacesContext;
import javax.faces.validator.DoubleRangeValidator;
@@ -19,15 +20,20 @@
*/
public class FacesValidatorServiceImpl extends FacesServiceBase=
implements FacesValidatorService {
=
+ private static final String PATTERN =3D "pattern";
+ private static final String MINIMUM =3D "min";
+ private static final String MAXIMUM =3D "max";
+
/*
* (non-Javadoc)
* =
* @see org.richfaces.validator.FacesValidatorService#getValidatorDesc=
ription(javax.faces.context.FacesContext,
* javax.faces.validator.Validator)
*/
- public ValidatorDescriptor getValidatorDescription(FacesContext contex=
t, Validator validator) {
- FacesMessage message =3D getMessage(context, validator);
+ public ValidatorDescriptor getValidatorDescription(FacesContext contex=
t, EditableValueHolder input, Validator validator) {
+ FacesMessage message =3D getMessage(context, validator, input);
FacesValidatorDescriptor descriptor =3D new FacesValidatorDescript=
or(validator.getClass(), message);
+ setLabelParameter(input, descriptor);
fillParameters(descriptor, validator);
descriptor.makeImmutable();
return descriptor;
@@ -39,7 +45,7 @@
String messageId;
if (component instanceof DoubleRangeValidator) {
DoubleRangeValidator validator =3D (DoubleRangeValidator) comp=
onent;
- if(validator.getMaximum() > Double.MIN_VALUE){
+ if(validator.getMaximum() < Double.MAX_VALUE){
if(validator.getMinimum()> Double.MIN_VALUE){
messageId =3D DoubleRangeValidator.NOT_IN_RANGE_MESSAG=
E_ID;
} else {
@@ -65,13 +71,13 @@
}
} else if (component instanceof LongRangeValidator) {
LongRangeValidator validator =3D (LongRangeValidator) componen=
t;
- if(validator.getMaximum() >0){
- if(validator.getMinimum()>0){
+ if(validator.getMaximum() !=3D0){
+ if(validator.getMinimum()!=3D0){
messageId =3D DoubleRangeValidator.NOT_IN_RANGE_MESSAG=
E_ID;
} else {
messageId =3D LongRangeValidator.MAXIMUM_MESSAGE_ID;
}
- } else if( validator.getMinimum()>0){
+ } else if( validator.getMinimum()!=3D0){
messageId =3D LongRangeValidator.MINIMUM_MESSAGE_ID;
} else {
messageId =3D DoubleRangeValidator.NOT_IN_RANGE_MESSAGE_ID=
;// What to use for that case ( no min/max set, validator always pass ).
@@ -86,4 +92,40 @@
return messageId;
}
=
+ @Override
+ protected void fillParameters(BaseFacesObjectDescriptor des=
criptor, Validator component) {
+ if (component instanceof DoubleRangeValidator) {
+ DoubleRangeValidator validator =3D (DoubleRangeValidator) comp=
onent;
+ if(validator.getMaximum() < Double.MAX_VALUE){
+ descriptor.addParameter(MAXIMUM, validator.getMaximum());
+ }
+ if( validator.getMinimum()>Double.MIN_VALUE){
+ descriptor.addParameter(MINIMUM, validator.getMinimum());
+ }
+ } else if (component instanceof LengthValidator) {
+ LengthValidator validator =3D (LengthValidator) component;
+ if(validator.getMaximum() >0){
+ descriptor.addParameter(MAXIMUM, validator.getMaximum());
+ } =
+ if( validator.getMinimum()>0){
+ descriptor.addParameter(MINIMUM, validator.getMinimum());
+ }
+ } else if (component instanceof LongRangeValidator) {
+ LongRangeValidator validator =3D (LongRangeValidator) componen=
t;
+ if(validator.getMaximum() !=3D0){
+ descriptor.addParameter(MAXIMUM, validator.getMaximum());
+ } =
+ if( validator.getMinimum()!=3D0){
+ descriptor.addParameter(MINIMUM, validator.getMinimum());
+ }
+ } else if (component instanceof RegexValidator) {
+ RegexValidator validator =3D (RegexValidator) component;
+ descriptor.addParameter(PATTERN, validator.getPattern());
+ } else if (component instanceof RequiredValidator) {
+ // do nothing.
+ } else {
+ super.fillParameters(descriptor, component);
+ }
+
+ }
}
Copied: trunk/ui/validator/ui/src/main/java/org/richfaces/view/facelets/htm=
l/GraphValidatorHandler.java (from rev 22076, branches/4.0.X/ui/validator/u=
i/src/main/java/org/richfaces/view/facelets/html/GraphValidatorHandler.java)
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/ui/validator/ui/src/main/java/org/richfaces/view/facelets/html/Gr=
aphValidatorHandler.java (rev 0)
+++ trunk/ui/validator/ui/src/main/java/org/richfaces/view/facelets/html/Gr=
aphValidatorHandler.java 2011-03-07 20:14:44 UTC (rev 22077)
@@ -0,0 +1,162 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2011, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.richfaces.view.facelets.html;
+
+import java.io.IOException;
+import java.util.Iterator;
+
+import javax.el.ELException;
+import javax.faces.FacesException;
+import javax.faces.component.EditableValueHolder;
+import javax.faces.component.StateHolder;
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.event.AbortProcessingException;
+import javax.faces.event.ComponentSystemEvent;
+import javax.faces.event.ComponentSystemEventListener;
+import javax.faces.event.PostAddToViewEvent;
+import javax.faces.validator.BeanValidator;
+import javax.faces.validator.Validator;
+import javax.faces.view.facelets.ComponentConfig;
+import javax.faces.view.facelets.ComponentHandler;
+import javax.faces.view.facelets.FaceletContext;
+
+import org.richfaces.component.AbstractGraphValidator;
+
+/**
+ * @author Nick Belaevski
+ * =
+ */
+public class GraphValidatorHandler extends ComponentHandler {
+
+ private static final String BUILT_IN_BEAN_VALIDATOR_ATTRIBUTE_NAME =3D=
GraphValidatorHandler.class.getName() =
+ + ":BUILT_IN_BEAN_VALIDATOR_ATTRIBUTE_NAME";
+ =
+ private class FacesBeanValidatorAddListener implements ComponentSystem=
EventListener, StateHolder {
+
+ public void processEvent(ComponentSystemEvent event) throws AbortP=
rocessingException {
+ FacesContext context =3D FacesContext.getCurrentInstance();
+ Validator childrenValidator =3D createChildrenValidator(contex=
t, event.getComponent());
+ setupValidators(context, event.getComponent(), childrenValidat=
or);
+ }
+
+ public Object saveState(FacesContext context) {
+ throw new UnsupportedOperationException();
+ }
+
+ public void restoreState(FacesContext context, Object state) {
+ throw new UnsupportedOperationException();
+ }
+
+ public boolean isTransient() {
+ return true;
+ }
+
+ public void setTransient(boolean newTransientValue) {
+ throw new UnsupportedOperationException();
+ }
+ }
+ =
+ public GraphValidatorHandler(ComponentConfig config) {
+ super(config);
+ }
+
+ private Validator getBuiltInBeanValidator(FacesContext context) {
+ Validator result =3D (Validator) context.getAttributes().get(BUILT=
_IN_BEAN_VALIDATOR_ATTRIBUTE_NAME);
+
+ if (result =3D=3D null) {
+ result =3D context.getApplication().createValidator(BeanValida=
tor.VALIDATOR_ID);
+ context.getAttributes().put(BUILT_IN_BEAN_VALIDATOR_ATTRIBUTE_=
NAME, result);
+ }
+ =
+ return result;
+ }
+ =
+ private void setupValidators(FacesContext context, UIComponent compone=
nt, Validator validator) {
+ if (component.getChildCount() =3D=3D 0 && component.getFacetCount(=
) =3D=3D 0) {
+ return;
+ }
+ =
+ Iterator facetsAndChildren =3D component.getFacetsAnd=
Children();
+ while (facetsAndChildren.hasNext()) {
+ UIComponent child =3D facetsAndChildren.next();
+ if (child instanceof EditableValueHolder) {
+ EditableValueHolder input =3D (EditableValueHolder) child;
+ setupValidator(context, input, validator);
+ }
+ =
+ if (!(child instanceof AbstractGraphValidator)) {
+ //don't setup validators for nested GVs
+ setupValidators(context, child, validator);
+ }
+ =
+ }
+ }
+
+ /**
+ * @param context TODO
+ * @param input
+ */
+ private void setupValidator(FacesContext context, EditableValueHolder =
input, Validator beanValidator) {
+ boolean addBeanValidator =3D true;
+ Class> validatorToRemoveClass =3D getBuiltInBeanValidator(contex=
t).getClass();
+ Validator validatorToRemove =3D null;
+ =
+ Validator[] validators =3D input.getValidators();
+ for (int i =3D 0; i < validators.length; i++) {
+ Validator nextValidator =3D validators[i];
+ if (nextValidator.getClass().equals(beanValidator.getClass()))=
{
+ addBeanValidator =3D false;
+ continue;
+ }
+ =
+ if (nextValidator.getClass().equals(validatorToRemoveClass)) {
+ validatorToRemove =3D nextValidator;
+ }
+ }
+ =
+ if (validatorToRemove !=3D null) {
+ input.removeValidator(validatorToRemove);
+ }
+ =
+ if (addBeanValidator) {
+ input.addValidator(beanValidator);
+ }
+ }
+
+ private Validator createChildrenValidator(FacesContext context, UIComp=
onent c) {
+ AbstractGraphValidator graphValidator =3D (AbstractGraphValidator)=
c;
+ =
+ return graphValidator.createChildrenValidator(context);
+ } =
+ =
+ @Override
+ public void applyNextHandler(FaceletContext ctx, UIComponent c) throws=
IOException, FacesException, ELException {
+ super.applyNextHandler(ctx, c);
+ =
+ if (c.isInView()) {
+ setupValidators(ctx.getFacesContext(), c, createChildrenValida=
tor(ctx.getFacesContext(), c));
+ } else {
+ c.subscribeToEvent(PostAddToViewEvent.class, new FacesBeanVali=
datorAddListener());
+ }
+ }
+}
Modified: trunk/ui/validator/ui/src/main/resources/META-INF/csv.xml
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/ui/validator/ui/src/main/resources/META-INF/csv.xml 2011-03-07 17=
:31:10 UTC (rev 22076)
+++ trunk/ui/validator/ui/src/main/resources/META-INF/csv.xml 2011-03-07 20=
:14:44 UTC (rev 22077)
@@ -176,4 +176,20 @@
RichFaces.csv.validateMax
+
+ javax.validation.constraints.AssertTrue
+
+ csv.reslib
+ org.richfaces
+
+ RichFaces.csv.validateTrue
+
+
+ javax.validation.constraints.AssertFalse
+
+ csv.reslib
+ org.richfaces
+
+ RichFaces.csv.validateFalse
+
\ No newline at end of file
Modified: trunk/ui/validator/ui/src/main/resources/META-INF/resources/org.r=
ichfaces/richfaces-csv.js
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/ui/validator/ui/src/main/resources/META-INF/resources/org.richfac=
es/richfaces-csv.js 2011-03-07 17:31:10 UTC (rev 22076)
+++ trunk/ui/validator/ui/src/main/resources/META-INF/resources/org.richfac=
es/richfaces-csv.js 2011-03-07 20:14:44 UTC (rev 22077)
@@ -3,12 +3,10 @@
rf.csv =3D rf.csv || {};
=
var _messages =3D {};
- var _validators =3D {};
- var _converters =3D {};
=
var RE_MESSAGE_PATTERN =3D /\'?\{(\d+)\}\'?/g;
=
- var __interpolateMessage =3D function (message, values) {
+ var interpolateMessage =3D function (message, values) {
if (message) {
var msgObject =3D message.replace(RE_MESSAGE_PATTERN,"\n$1\n").split("\=
n");
var value;
@@ -21,21 +19,115 @@
return "";
}
}
- =
=
- var __getValue =3D function(id) {
+ var _value_query =3D function(control){
+ if(null !=3D=3D control.value && undefined !=3D control.value){
+ return control.value;
+ } else {
+ return "";
+ }
+ };
+ =
+ var _check_query =3D function(control){
+ if( control.checked ) {
+ return true;
+ } else {
+ return false;
+ }
+ };
+
+ var _addOption =3D function(value,option){
+ if ( option.selected ){
+ return value[value.length]=3Doption.value;
+ }
+ =
+ };
+
+ var valueExtractors =3D {
+ hidden : function(control){
+ return _value_query(control);
+ },
+ =
+ text : function(control){
+ return _value_query(control);
+ },
+
+ textarea : function(control){
+ return _value_query(control);
+ },
+
+ 'select-one' : function(control){
+ if (control.selectedIndex !=3D -1) {
+ return _value_query(control);
+ }
+ },
+
+ password : function(control){
+ return _value_query(control);
+ },
+
+ file : function(control){
+ return _value_query(control);
+ },
+
+ radio : function(control){
+ return _check_query(control);
+ },
+
+ checkbox : function(control){
+ return _check_query(control);
+ },
+
+ =
+ 'select-multiple' : function(control){
+ var cname =3D control.name;
+ var childs =3D control.childNodes;
+ var value =3D [];
+ for( var i=3D0 ;i< childs.length;i++ ){
+ var child=3Dchilds[i];
+ if( child.tagName =3D=3D=3D 'OPTGROUP' ){
+ var options =3D child.childNodes;
+ for(var j=3D0; j < options.length; j++){
+ value =3D _addOption(value, options[j]);
+ }
+ } else {
+ value =3D_addOption(value, child);
+ }
+ }
+ return value;
+ },
+ =
+ // command inputs
+
+ =
+ // same as link, but have additional field - control, for input
+ // submit.
+ input : function(control){
+ return _value_query(control);
+ } =
+ };
+
+ var getValue =3D function(id) {
var value;
var element =3D rf.getDomElement(id);
- if (element.value) {
+ if (valueExtractors[element.type]) {
+ value =3D valueExtractors[element.type](element);
+ } else if(undefined !=3D=3D element.value ){
value =3D element.value;
} else {
var component =3D rf.$(element);
// TODO: add getValue to baseComponent and change jsdocs
- value =3D component && typeof component["getValue"] =3D=3D "function" ?=
component.getValue() : "";
+ value =3D component && typeof component["getValue"] =3D=3D=3D "function=
" ? component.getValue() : "";
}
return value;
}
=
+ var getLabel =3D function(component,id){
+ if(component.p){
+ return component.p.label || id;
+ }
+ return id;
+ }
=
$.extend(rf.csv, {
RE_DIGITS: /^-?\d+$/,
@@ -46,10 +138,10 @@
},
getMessage: function(customMessage, messageId, values) {
var message =3D customMessage ? customMessage : _messages[messageId] ||=
{detail:"",summary:"",severity:0};
- return {detail:__interpolateMessage(message.detail,values),summary:__in=
terpolateMessage(message.summary,values),severity:message.severity};
+ return {detail:interpolateMessage(message.detail,values),summary:interp=
olateMessage(message.summary,values),severity:message.severity};
},
interpolateMessage: function(message,values){
- return {detail:__interpolateMessage(message.detail,values),summary:__in=
terpolateMessage(message.summary,values),severity:message.severity}; =
+ return {detail:interpolateMessage(message.detail,values),summary:interp=
olateMessage(message.summary,values),severity:message.severity}; =
},
sendMessage: function (componentId, message) {
rf.Event.fire(window.document, rf.Event.MESSAGE_EVENT_TYPE, {'sourceId'=
:componentId, 'message':message});
@@ -58,14 +150,15 @@
rf.Event.fire(window.document, rf.Event.MESSAGE_EVENT_TYPE, {'sourceId'=
:componentId });
},
validate: function (event, id, element, params) {
- var value =3D __getValue(element || id);
+ var value =3D getValue(element || id);
var convertedValue;
var converter =3D params.c;
rf.csv.clearMessage(id);
if (converter) {
+ var label=3DgetLabel(converter,id);
try {
if (converter.f)
- convertedValue =3D converter.f(value,id,converter.p,converter.m);
+ convertedValue =3D converter.f(value,id,getLabel(converter,id),conve=
rter.m);
} catch (e){
e.severity=3D2;
rf.csv.sendMessage(id, e);
@@ -74,30 +167,33 @@
} else {
convertedValue =3D value;
}
+ var result =3D true
var validators =3D params.v;
if (validators) {
- var validatorFunction;
- try {
+ var validatorFunction,validator;
for (i=3D0;i0;
- var isMaxSet =3D typeof params.maximum =3D=3D=3D "number" ;//&& params.m=
aximum >0;
+ var isMinSet =3D typeof params.min =3D=3D=3D "number" ;// && params.min =
>0;
+ var isMaxSet =3D typeof params.max =3D=3D=3D "number" ;// && params.max =
>0;
=
- if (isMaxSet && value > params.maximum) {
- throw rf.csv.interpolateMessage(msg,isMinSet?[params.minimum,params.max=
imum,label]:[params.maximum,label]);
+ if (isMaxSet && value > params.max) {
+ throw rf.csv.interpolateMessage(msg,isMinSet?[params.min,params.max,lab=
el]:[params.max,label]);
}
- if (isMinSet && value < params.minimum) {
- throw rf.csv.interpolateMessage(msg,isMaxSet?[params.minimum,params.max=
imum,label]:[params.minimum,label]);
+ if (isMinSet && value < params.min) {
+ throw rf.csv.interpolateMessage(msg,isMaxSet?[params.min,params.max,lab=
el]:[params.min,label]);
}
};
=
@@ -197,7 +298,7 @@
$.extend(rf.csv, { =
"validateLongRange": function (value,label,params,msg) {
var type =3D typeof value;
- if (type !=3D "number") {
+ if (type !=3D=3D "number") {
if (type !=3D "string") {
throw rf.csv.getMessage(msg, 'LONG_RANGE_VALIDATOR_TYPE', [componentI=
d, ""]);
} else {
@@ -212,8 +313,8 @@
},
"validateDoubleRange": function (value,label,params,msg) {
var type =3D typeof value;
- if (type !=3D "number") {
- if (type !=3D "string") {
+ if (type !=3D=3D "number") {
+ if (type !=3D=3D "string") {
throw rf.csv.getMessage(msg, 'DOUBLE_RANGE_VALIDATOR_TYPE', [componen=
tId, ""]);
} else {
value =3D $.trim(value);
@@ -231,7 +332,7 @@
},
"validateSize": function (value,label,params,msg) {
var length =3D value?value.length:0;
- validateRange(length,label,{maximum:params.max,minimum:params.min},msg);
+ validateRange(length,label,params,msg);
},
"validateRegex": function (value,label,params,msg) {
validateRegex(value,label,params.pattern,msg);
@@ -244,6 +345,16 @@
throw rf.csv.interpolateMessage(msg, [label]);
}
},
+ "validateTrue": function (value,label,params,msg) {
+ if ( value !=3D=3D true ) {
+ throw msg;
+ }
+ },
+ "validateFalse": function (value,label,params,msg) {
+ if (value !=3D=3D false) {
+ throw msg;
+ }
+ },
"validateMax": function (value,label,params,msg) {
if (value > params.value ) {
throw msg;
Modified: trunk/ui/validator/ui/src/test/java/org/richfaces/component/behav=
ior/BehaviorGetConverterTest.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/ui/validator/ui/src/test/java/org/richfaces/component/behavior/Be=
haviorGetConverterTest.java 2011-03-07 17:31:10 UTC (rev 22076)
+++ trunk/ui/validator/ui/src/test/java/org/richfaces/component/behavior/Be=
haviorGetConverterTest.java 2011-03-07 20:14:44 UTC (rev 22077)
@@ -45,7 +45,7 @@
public void setupService() {
expect(factory.getInstance(FacesConverterService.class)).andStubRe=
turn(converterService);
converterCapture =3D new Capture();
- expect(converterService.getConverterDescription(eq(environment.get=
FacesContext()), capture(converterCapture)))
+ expect(converterService.getConverterDescription(same(environment.g=
etFacesContext()), same(input), capture(converterCapture)))
.andStubReturn(descriptor);
ServiceTracker.setFactory(factory);
}
Modified: trunk/ui/validator/ui/src/test/java/org/richfaces/component/behav=
ior/BehaviorGetValidatorTest.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/ui/validator/ui/src/test/java/org/richfaces/component/behavior/Be=
haviorGetValidatorTest.java 2011-03-07 17:31:10 UTC (rev 22076)
+++ trunk/ui/validator/ui/src/test/java/org/richfaces/component/behavior/Be=
haviorGetValidatorTest.java 2011-03-07 20:14:44 UTC (rev 22077)
@@ -107,7 +107,7 @@
ValidatorDescriptor validatorDescriptor =3D environment.create=
Mock(ValidatorDescriptor.class);
expect((Class) validatorDescriptor.getImplementationClass()).a=
ndStubReturn(validator.getClass());
expect(validatorDescriptor.getMessage()).andStubReturn(VALIDAT=
ION_ERROR);
- expect(facesValidatorService.getValidatorDescription(environme=
nt.getFacesContext(), validator))
+ expect(facesValidatorService.getValidatorDescription(environme=
nt.getFacesContext(), input, validator))
.andStubReturn(validatorDescriptor);
}
}
Modified: trunk/ui/validator/ui/src/test/java/org/richfaces/el/ELTestBase.j=
ava
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/ui/validator/ui/src/test/java/org/richfaces/el/ELTestBase.java 20=
11-03-07 17:31:10 UTC (rev 22076)
+++ trunk/ui/validator/ui/src/test/java/org/richfaces/el/ELTestBase.java 20=
11-03-07 20:14:44 UTC (rev 22077)
@@ -15,6 +15,7 @@
import javax.el.MapELResolver;
import javax.el.ValueExpression;
import javax.el.VariableMapper;
+import javax.faces.context.FacesContext;
=
import org.jboss.el.ExpressionFactoryImpl;
import org.junit.After;
@@ -89,6 +90,10 @@
=
class DummyELContext extends ELContext {
=
+ public DummyELContext() {
+ putContext(FacesContext.class, FacesContext.getCurrentInstance=
());
+ }
+ =
@Override
public ELResolver getELResolver() {
return elResolver;
Modified: trunk/ui/validator/ui/src/test/java/org/richfaces/el/TestCaptureE=
L.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/ui/validator/ui/src/test/java/org/richfaces/el/TestCaptureEL.java=
2011-03-07 17:31:10 UTC (rev 22076)
+++ trunk/ui/validator/ui/src/test/java/org/richfaces/el/TestCaptureEL.java=
2011-03-07 20:14:44 UTC (rev 22077)
@@ -1,16 +1,47 @@
package org.richfaces.el;
=
-import static org.junit.Assert.*;
+import static org.easymock.EasyMock.expect;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertSame;
=
import javax.el.ValueExpression;
=
+import org.jboss.test.faces.mock.Environment;
+import org.jboss.test.faces.mock.Environment.Feature;
+import org.jboss.test.faces.mock.FacesMock;
+import org.jboss.test.faces.mock.Mock;
+import org.jboss.test.faces.mock.MockFacesEnvironment;
import org.jboss.test.faces.mock.MockTestRunner;
+import org.junit.After;
+import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
=
+import com.google.common.collect.Maps;
+
@RunWith(MockTestRunner.class)
public class TestCaptureEL extends ELTestBase {
=
+ @Mock
+ @Environment(Feature.EXTERNAL_CONTEXT)
+ private MockFacesEnvironment facesEnvironment;
+
+ =
+ @Before
+ public void setUpEnvironment() throws Exception {
+ expect(facesEnvironment.getExternalContext().getRequestMap()).andS=
tubReturn(Maps.newHashMap());
+ expect(facesEnvironment.getFacesContext().getAttributes()).andStub=
Return(Maps.newHashMap());
+ FacesMock.replay(facesEnvironment);
+ }
+ =
+ @After
+ public void tearDownEnvironment() throws Exception {
+ FacesMock.verify(facesEnvironment);
+ facesEnvironment.release();
+ }
+ =
@Test
public void testDummyResolverString() throws Exception {
ValueExpression expression =3D parse("#{bean.string}");
Modified: trunk/ui/validator/ui/src/test/java/org/richfaces/el/ValueExpress=
ionAnalayserTest.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/ui/validator/ui/src/test/java/org/richfaces/el/ValueExpressionAna=
layserTest.java 2011-03-07 17:31:10 UTC (rev 22076)
+++ trunk/ui/validator/ui/src/test/java/org/richfaces/el/ValueExpressionAna=
layserTest.java 2011-03-07 20:14:44 UTC (rev 22077)
@@ -1,15 +1,18 @@
package org.richfaces.el;
=
=
-import static org.easymock.EasyMock.*;
-import static org.junit.Assert.*;
+import static org.easymock.EasyMock.expect;
+import static org.junit.Assert.assertEquals;
=
import javax.el.ELException;
import javax.el.ValueExpression;
import javax.faces.context.FacesContext;
=
+import org.jboss.test.faces.mock.Environment;
+import org.jboss.test.faces.mock.Environment.Feature;
import org.jboss.test.faces.mock.FacesMock;
import org.jboss.test.faces.mock.Mock;
+import org.jboss.test.faces.mock.MockFacesEnvironment;
import org.jboss.test.faces.mock.MockTestRunner;
import org.junit.After;
import org.junit.Before;
@@ -17,42 +20,48 @@
import org.junit.runner.RunWith;
import org.richfaces.el.model.Bean;
=
+import com.google.common.collect.Maps;
+
@RunWith(MockTestRunner.class)
public class ValueExpressionAnalayserTest extends ELTestBase {
=
- =
private ValueExpressionAnalayser analayser;
=
@Mock
+ @Environment(Feature.EXTERNAL_CONTEXT)
+ private MockFacesEnvironment facesEnvironment;
+
private FacesContext facesContext;
-
+ =
@Before
public void setUpAnalayser() throws Exception {
analayser =3D new ValueExpressionAnalayserImpl();
+ facesContext =3D facesEnvironment.getFacesContext();
+ expect(facesEnvironment.getExternalContext().getRequestMap()).andS=
tubReturn(Maps.newHashMap());
}
=
@After
public void tearDownAnalayser() throws Exception {
+ facesContext =3D null;
analayser =3D null;
- facesContext.release();
+ facesEnvironment.release();
}
@Test
public void testGetDescriptionPositive() throws Exception {
ValueExpression expression =3D parse("#{bean.string}");
expect(facesContext.getELContext()).andReturn(elContext);
- FacesMock.replay(facesContext);
+ FacesMock.replay(facesEnvironment);
ValueDescriptor propertyDescriptor =3D analayser.getPropertyDescri=
ptor(facesContext, expression);
assertEquals(Bean.class, propertyDescriptor.getBeanType());
assertEquals("string", propertyDescriptor.getName());
- assertEquals(String.class,propertyDescriptor.getPropertyType());
- FacesMock.verify(facesContext);
+ FacesMock.verify(facesEnvironment);
}
=
@Test(expected=3DELException.class)
public void testGetDescriptionNegative() throws Exception {
ValueExpression expression =3D parse("#{bean}");
expect(facesContext.getELContext()).andReturn(elContext);
- FacesMock.replay(facesContext);
+ FacesMock.replay(facesEnvironment);
ValueDescriptor propertyDescriptor =3D analayser.getPropertyDescri=
ptor(facesContext, expression);
}
}
Modified: trunk/ui/validator/ui/src/test/java/org/richfaces/javascript/clie=
nt/MockTestBase.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/ui/validator/ui/src/test/java/org/richfaces/javascript/client/Moc=
kTestBase.java 2011-03-07 17:31:10 UTC (rev 22076)
+++ trunk/ui/validator/ui/src/test/java/org/richfaces/javascript/client/Moc=
kTestBase.java 2011-03-07 20:14:44 UTC (rev 22077)
@@ -7,7 +7,7 @@
import java.util.Locale;
import java.util.Map;
=
-import javax.faces.component.UIComponent;
+import javax.faces.component.UIInput;
import javax.faces.component.UIViewRoot;
=
import org.jboss.test.faces.mock.MockFacesEnvironment;
@@ -32,7 +32,7 @@
=
protected final RunParameters criteria;
protected MockFacesEnvironment facesEnvironment;
- protected UIComponent component;
+ protected UIInput input;
=
public MockTestBase(RunParameters criteria) {
this.criteria =3D criteria;
@@ -42,7 +42,7 @@
@Before
public void setUp() {
this.facesEnvironment =3D MockFacesEnvironment.createEnvironment()=
.withApplication().resetToNice(); =
- component =3D facesEnvironment.createMock(UIComponent.class);
+ input =3D facesEnvironment.createMock(UIInput.class);
recordMocks();
facesEnvironment.replay();
}
@@ -51,8 +51,8 @@
UIViewRoot viewRoot =3D facesEnvironment.createMock(UIViewRoot.cla=
ss);
expect(viewRoot.getLocale()).andStubReturn(Locale.ENGLISH);
expect(facesEnvironment.getFacesContext().getViewRoot()).andStubRe=
turn(viewRoot);
- expect(component.getAttributes()).andStubReturn(Collections.EMPTY_=
MAP);
- expect(component.getClientId(facesEnvironment.getFacesContext())).=
andStubReturn(TEST_COMPONENT_ID);
+ expect(input.getAttributes()).andStubReturn(Collections.EMPTY_MAP);
+ expect(input.getClientId(facesEnvironment.getFacesContext())).andS=
tubReturn(TEST_COMPONENT_ID);
}
=
@After
Modified: trunk/ui/validator/ui/src/test/java/org/richfaces/javascript/clie=
nt/converter/BooleanConverterTest.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/ui/validator/ui/src/test/java/org/richfaces/javascript/client/con=
verter/BooleanConverterTest.java 2011-03-07 17:31:10 UTC (rev 22076)
+++ trunk/ui/validator/ui/src/test/java/org/richfaces/javascript/client/con=
verter/BooleanConverterTest.java 2011-03-07 20:14:44 UTC (rev 22077)
@@ -26,6 +26,6 @@
=
@Parameters
public static List getRunParameterss() {
- return options(pass("true"), pass("ok"), pass("123"),pass("0"),pas=
s("1"));
+ return options(pass("true"), pass("ok"), pass("123"),pass("0"),pas=
s("1"),pass("no"));
}
}
Modified: trunk/ui/validator/ui/src/test/java/org/richfaces/javascript/clie=
nt/converter/ByteConverterTest.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/ui/validator/ui/src/test/java/org/richfaces/javascript/client/con=
verter/ByteConverterTest.java 2011-03-07 17:31:10 UTC (rev 22076)
+++ trunk/ui/validator/ui/src/test/java/org/richfaces/javascript/client/con=
verter/ByteConverterTest.java 2011-03-07 20:14:44 UTC (rev 22077)
@@ -5,7 +5,6 @@
=
import java.util.List;
=
-import javax.faces.convert.BooleanConverter;
import javax.faces.convert.ByteConverter;
import javax.faces.convert.Converter;
=
Modified: trunk/ui/validator/ui/src/test/java/org/richfaces/javascript/clie=
nt/converter/ConverterTestBase.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/ui/validator/ui/src/test/java/org/richfaces/javascript/client/con=
verter/ConverterTestBase.java 2011-03-07 17:31:10 UTC (rev 22076)
+++ trunk/ui/validator/ui/src/test/java/org/richfaces/javascript/client/con=
verter/ConverterTestBase.java 2011-03-07 20:14:44 UTC (rev 22077)
@@ -1,13 +1,10 @@
package org.richfaces.javascript.client.converter;
=
-import static junit.framework.Assert.assertEquals;
-import static junit.framework.Assert.assertTrue;
import static org.junit.Assert.*;
=
import javax.faces.application.FacesMessage;
import javax.faces.convert.Converter;
import javax.faces.convert.ConverterException;
-import javax.faces.validator.Validator;
=
import net.sourceforge.htmlunit.corejs.javascript.JavaScriptException;
import net.sourceforge.htmlunit.corejs.javascript.NativeObject;
@@ -33,7 +30,7 @@
Converter converter =3D createConverter();
try {
Object convertedValue =3D
- converter.getAsObject(facesEnvironment.getFacesContext(), =
component, criteria.getValue().toString());
+ converter.getAsObject(facesEnvironment.getFacesContext(), =
input, criteria.getValue().toString());
Object jsConvertedValue =3D
convertOnClient(converter);
if(null !=3D convertedValue || null !=3D jsConvertedValue){
@@ -66,7 +63,7 @@
=
private Object getErrorMessage(Converter converter) {
ConverterServiceImpl converterService =3D new ConverterServiceImpl=
();
- FacesMessage message =3D converterService.getMessage(facesEnvironm=
ent.getFacesContext(), converter);
+ FacesMessage message =3D converterService.getMessage(facesEnvironm=
ent.getFacesContext(), converter, input);
return new Message(message);
}
=
Modified: trunk/ui/validator/ui/src/test/java/org/richfaces/javascript/clie=
nt/converter/NumberConverterTest.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/ui/validator/ui/src/test/java/org/richfaces/javascript/client/con=
verter/NumberConverterTest.java 2011-03-07 17:31:10 UTC (rev 22076)
+++ trunk/ui/validator/ui/src/test/java/org/richfaces/javascript/client/con=
verter/NumberConverterTest.java 2011-03-07 20:14:44 UTC (rev 22077)
@@ -4,7 +4,6 @@
import java.util.List;
import java.util.Map;
=
-import javax.faces.convert.BooleanConverter;
import javax.faces.convert.NumberConverter;
import javax.faces.convert.Converter;
=
Modified: trunk/ui/validator/ui/src/test/java/org/richfaces/javascript/clie=
nt/converter/ShortConverterTest.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/ui/validator/ui/src/test/java/org/richfaces/javascript/client/con=
verter/ShortConverterTest.java 2011-03-07 17:31:10 UTC (rev 22076)
+++ trunk/ui/validator/ui/src/test/java/org/richfaces/javascript/client/con=
verter/ShortConverterTest.java 2011-03-07 20:14:44 UTC (rev 22077)
@@ -1,11 +1,8 @@
package org.richfaces.javascript.client.converter;
=
-import static junit.framework.Assert.assertEquals;
-import static junit.framework.Assert.assertTrue;
=
import java.util.List;
=
-import javax.faces.convert.BooleanConverter;
import javax.faces.convert.ShortConverter;
import javax.faces.convert.Converter;
=
Modified: trunk/ui/validator/ui/src/test/java/org/richfaces/javascript/clie=
nt/validator/DoubleRangeValidatorTest.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/ui/validator/ui/src/test/java/org/richfaces/javascript/client/val=
idator/DoubleRangeValidatorTest.java 2011-03-07 17:31:10 UTC (rev 22076)
+++ trunk/ui/validator/ui/src/test/java/org/richfaces/javascript/client/val=
idator/DoubleRangeValidatorTest.java 2011-03-07 20:14:44 UTC (rev 22077)
@@ -18,8 +18,8 @@
*/
public class DoubleRangeValidatorTest extends ValidatorTestBase {
=
- private static final String MINIMUM =3D "minimum";
- private static final String MAXIMUM =3D "maximum";
+ private static final String MINIMUM =3D "min";
+ private static final String MAXIMUM =3D "max";
/**
* @param criteria
*/
Modified: trunk/ui/validator/ui/src/test/java/org/richfaces/javascript/clie=
nt/validator/LengthValidatorTest.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/ui/validator/ui/src/test/java/org/richfaces/javascript/client/val=
idator/LengthValidatorTest.java 2011-03-07 17:31:10 UTC (rev 22076)
+++ trunk/ui/validator/ui/src/test/java/org/richfaces/javascript/client/val=
idator/LengthValidatorTest.java 2011-03-07 20:14:44 UTC (rev 22077)
@@ -18,8 +18,8 @@
*/
public class LengthValidatorTest extends ValidatorTestBase {
=
- private static final String MINIMUM =3D "minimum";
- private static final String MAXIMUM =3D "maximum";
+ private static final String MINIMUM =3D "min";
+ private static final String MAXIMUM =3D "max";
/**
* @param criteria
*/
Modified: trunk/ui/validator/ui/src/test/java/org/richfaces/javascript/clie=
nt/validator/LongRangeValidatorTest.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/ui/validator/ui/src/test/java/org/richfaces/javascript/client/val=
idator/LongRangeValidatorTest.java 2011-03-07 17:31:10 UTC (rev 22076)
+++ trunk/ui/validator/ui/src/test/java/org/richfaces/javascript/client/val=
idator/LongRangeValidatorTest.java 2011-03-07 20:14:44 UTC (rev 22077)
@@ -18,8 +18,8 @@
*/
public class LongRangeValidatorTest extends ValidatorTestBase {
=
- private static final String MINIMUM =3D "minimum";
- private static final String MAXIMUM =3D "maximum";
+ private static final String MINIMUM =3D "min";
+ private static final String MAXIMUM =3D "max";
/**
* @param criteria
*/
Modified: trunk/ui/validator/ui/src/test/java/org/richfaces/javascript/clie=
nt/validator/MaxValidatorTest.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/ui/validator/ui/src/test/java/org/richfaces/javascript/client/val=
idator/MaxValidatorTest.java 2011-03-07 17:31:10 UTC (rev 22076)
+++ trunk/ui/validator/ui/src/test/java/org/richfaces/javascript/client/val=
idator/MaxValidatorTest.java 2011-03-07 20:14:44 UTC (rev 22077)
@@ -4,10 +4,7 @@
package org.richfaces.javascript.client.validator;
=
import java.util.List;
-import java.util.Map;
=
-import javax.faces.validator.LengthValidator;
-import javax.faces.validator.Validator;
import javax.validation.constraints.Max;
=
import org.junit.runners.Parameterized.Parameters;
@@ -38,9 +35,8 @@
=
@Parameters
public static List parameters() {
- return options(
- pass(0,PROP,"number",MAXIMUM,2),pass(2,PROP,"number",MAXIMUM,2=
),pass(123,PROP,"number",MAXIMUM,2)
- );
+ return options(pass(0, PROP, "number", MAXIMUM, 2), pass(2, PROP, =
"number", MAXIMUM, 2),
+ pass(123, PROP, "number", MAXIMUM, 2));
}
=
public static final class Bean {
Modified: trunk/ui/validator/ui/src/test/java/org/richfaces/javascript/clie=
nt/validator/ValidatorTestBase.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/ui/validator/ui/src/test/java/org/richfaces/javascript/client/val=
idator/ValidatorTestBase.java 2011-03-07 17:31:10 UTC (rev 22076)
+++ trunk/ui/validator/ui/src/test/java/org/richfaces/javascript/client/val=
idator/ValidatorTestBase.java 2011-03-07 20:14:44 UTC (rev 22077)
@@ -49,7 +49,7 @@
public void testValidator() throws Exception {
Validator validator =3D createValidator();
try {
- validator.validate(facesEnvironment.getFacesContext(), compone=
nt, criteria.getValue());
+ validator.validate(facesEnvironment.getFacesContext(), input, =
criteria.getValue());
validateOnClient(validator);
} catch (ValidatorException e) {
// client-side script has to throw exception too.
@@ -80,7 +80,7 @@
=
private Object getErrorMessage(Validator validator) {
FacesValidatorServiceImpl validatorService =3D new FacesValidatorS=
erviceImpl();
- FacesMessage message =3D validatorService.getMessage(facesEnvironm=
ent.getFacesContext(), validator);
+ FacesMessage message =3D validatorService.getMessage(facesEnvironm=
ent.getFacesContext(), validator, input);
return new Message(message);
}
=
Modified: trunk/ui/validator/ui/src/test/java/org/richfaces/validator/Faces=
ConverterServiceTest.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/ui/validator/ui/src/test/java/org/richfaces/validator/FacesConver=
terServiceTest.java 2011-03-07 17:31:10 UTC (rev 22076)
+++ trunk/ui/validator/ui/src/test/java/org/richfaces/validator/FacesConver=
terServiceTest.java 2011-03-07 20:14:44 UTC (rev 22077)
@@ -70,7 +70,7 @@
public void getConverterClass() throws Exception {
converter =3D new BooleanConverter();
controller.replay();
- ConverterDescriptor converterDescription =3D serviceImpl.getConver=
terDescription(environment.getFacesContext(), converter);
+ ConverterDescriptor converterDescription =3D serviceImpl.getConver=
terDescription(environment.getFacesContext(), input, converter);
assertEquals(converter.getClass(), converterDescription.getImpleme=
ntationClass());
}
=
@@ -85,7 +85,7 @@
facesMessage =3D e.getFacesMessage();
}
assertNotNull(facesMessage);
- ConverterDescriptor converterDescription =3D serviceImpl.getConver=
terDescription(environment.getFacesContext(), converter);
+ ConverterDescriptor converterDescription =3D serviceImpl.getConver=
terDescription(environment.getFacesContext(), input, converter);
String summary =3D converterDescription.getMessage().getSummary();
summary =3D summary.replace("{2}", "foo");
summary =3D summary.replace("'{0}'", "abc");
@@ -102,7 +102,7 @@
converter.setType("both");
converter.setTimeZone(TimeZone.getTimeZone("EST"));
controller.replay();
- ConverterDescriptor converterDescription =3D serviceImpl.getConver=
terDescription(environment.getFacesContext(), converter);
+ ConverterDescriptor converterDescription =3D serviceImpl.getConver=
terDescription(environment.getFacesContext(), input, converter);
Map additionalParameters =3D converterDe=
scription.getAdditionalParameters();
assertEquals("short", additionalParameters.get("dateStyle"));
assertEquals("MM/DD/YYYY", additionalParameters.get("pattern"));
Modified: trunk/ui/validator/ui/src/test/java/org/richfaces/validator/Faces=
ValidatorServiceTest.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/ui/validator/ui/src/test/java/org/richfaces/validator/FacesValida=
torServiceTest.java 2011-03-07 17:31:10 UTC (rev 22076)
+++ trunk/ui/validator/ui/src/test/java/org/richfaces/validator/FacesValida=
torServiceTest.java 2011-03-07 20:14:44 UTC (rev 22077)
@@ -65,7 +65,7 @@
public void getConverterClass() throws Exception {
validator =3D new LengthValidator();
controller.replay();
- ValidatorDescriptor validatorDescription =3D serviceImpl.getValida=
torDescription(environment.getFacesContext(), validator);
+ ValidatorDescriptor validatorDescription =3D serviceImpl.getValida=
torDescription(environment.getFacesContext(), input, validator);
assertEquals(validator.getClass(), validatorDescription.getImpleme=
ntationClass());
}
=
@@ -80,7 +80,7 @@
facesMessage =3D e.getFacesMessage();
}
assertNotNull(facesMessage);
- ValidatorDescriptor validatorDescription =3D serviceImpl.getValida=
torDescription(environment.getFacesContext(), validator);
+ ValidatorDescriptor validatorDescription =3D serviceImpl.getValida=
torDescription(environment.getFacesContext(), input, validator);
String summary =3D validatorDescription.getMessage().getSummary();
summary =3D summary.replace("{0}", "foo");
assertEquals(facesMessage.getSummary(), summary);
--===============5035853760302984451==--
From richfaces-svn-commits at lists.jboss.org Mon Mar 7 15:17:44 2011
Content-Type: multipart/mixed; boundary="===============0468067442888700159=="
MIME-Version: 1.0
From: richfaces-svn-commits at lists.jboss.org
To: richfaces-svn-commits at lists.jboss.org
Subject: [richfaces-svn-commits] JBoss Rich Faces SVN: r22078 - in
trunk/examples/validator-demo: src/main/java/org/richfaces/example and 7
other directories.
Date: Mon, 07 Mar 2011 15:17:44 -0500
Message-ID: <201103072017.p27KHi6m015625@svn01.web.mwc.hst.phx2.redhat.com>
--===============0468067442888700159==
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable
Author: alexsmirnov
Date: 2011-03-07 15:17:43 -0500 (Mon, 07 Mar 2011)
New Revision: 22078
Added:
trunk/examples/validator-demo/src/main/java/org/richfaces/example/Boolea=
nBean.java
trunk/examples/validator-demo/src/main/java/org/richfaces/example/Passwo=
rdValidationBean.java
trunk/examples/validator-demo/src/main/webapp/examples/passwordValidatio=
n.xhtml
trunk/examples/validator-demo/src/main/webapp/resources/org.richfaces.sh=
owcase/
trunk/examples/validator-demo/src/main/webapp/resources/org.richfaces.sh=
owcase/test.xhtml
trunk/examples/validator-demo/src/main/webapp/resources/org.richfaces.sh=
owcase/test1.xhtml
trunk/examples/validator-demo/src/main/webapp/richfaces/
trunk/examples/validator-demo/src/main/webapp/richfaces/graphValidator/
trunk/examples/validator-demo/src/main/webapp/richfaces/graphValidator/s=
amples/
Removed:
trunk/examples/validator-demo/src/main/webapp/resources/org.richfaces.sh=
owcase/test.xhtml
trunk/examples/validator-demo/src/main/webapp/resources/org.richfaces.sh=
owcase/test1.xhtml
trunk/examples/validator-demo/src/main/webapp/richfaces/graphValidator/
trunk/examples/validator-demo/src/main/webapp/richfaces/graphValidator/s=
amples/
Modified:
trunk/examples/validator-demo/
trunk/examples/validator-demo/src/main/webapp/WEB-INF/faces-config.xml
trunk/examples/validator-demo/src/main/webapp/examples/beanValidation.xh=
tml
Log:
Merge changes from 4.0.x
Property changes on: trunk/examples/validator-demo
___________________________________________________________________
Added: svn:mergeinfo
+ /branches/4.0.X/examples/validator-demo:21810-22077
Copied: trunk/examples/validator-demo/src/main/java/org/richfaces/example/B=
ooleanBean.java (from rev 22077, branches/4.0.X/examples/validator-demo/src=
/main/java/org/richfaces/example/BooleanBean.java)
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/examples/validator-demo/src/main/java/org/richfaces/example/Boole=
anBean.java (rev 0)
+++ trunk/examples/validator-demo/src/main/java/org/richfaces/example/Boole=
anBean.java 2011-03-07 20:17:43 UTC (rev 22078)
@@ -0,0 +1,41 @@
+/**
+ * =
+ */
+package org.richfaces.example;
+
+import javax.validation.constraints.AssertTrue;
+
+
+/**
+ * @author asmirnov
+ *
+ */
+public class BooleanBean extends Validable {
+ =
+ @AssertTrue()
+ private Boolean value =3D false;
+
+ /**
+ * @return the intValue
+ */
+ public Boolean getValue() {
+ return value;
+ }
+
+ /**
+ * @param intValue the intValue to set
+ */
+ public void setValue(Boolean intValue) {
+ this.value =3D intValue;
+ }
+
+
+ public String getDescription() {
+ return "Boolean Value, should be true";
+ }
+
+ public String getLabel() {
+ return "assertTrue";
+ }
+
+}
Copied: trunk/examples/validator-demo/src/main/java/org/richfaces/example/P=
asswordValidationBean.java (from rev 22077, branches/4.0.X/examples/validat=
or-demo/src/main/java/org/richfaces/example/PasswordValidationBean.java)
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/examples/validator-demo/src/main/java/org/richfaces/example/Passw=
ordValidationBean.java (rev 0)
+++ trunk/examples/validator-demo/src/main/java/org/richfaces/example/Passw=
ordValidationBean.java 2011-03-07 20:17:43 UTC (rev 22078)
@@ -0,0 +1,49 @@
+package org.richfaces.example;
+
+import java.io.Serializable;
+
+import javax.faces.application.FacesMessage;
+import javax.faces.bean.ManagedBean;
+import javax.faces.bean.SessionScoped;
+import javax.faces.context.FacesContext;
+import javax.validation.constraints.AssertTrue;
+import javax.validation.constraints.Size;
+
+(a)ManagedBean
+(a)SessionScoped
+public class PasswordValidationBean implements Cloneable, Serializable{
+ /**
+ * =
+ */
+ private static final long serialVersionUID =3D 1952428504080910113L;
+ @Size(min =3D 5, max =3D 15, message =3D "Wrong size for password")
+ private String password=3D"";
+ @Size(min =3D 5, max =3D 15, message =3D "Wrong size for confirmation")
+ private String confirm=3D"";
+
+ @AssertTrue(message =3D "Different passwords entered!")
+ public boolean isPasswordsEquals() {
+ return password.equals(confirm);
+ }
+
+ public void storeNewPassword() {
+ FacesContext.getCurrentInstance().addMessage(null,
+ new FacesMessage(FacesMessage.SEVERITY_INFO, "Succesfully chan=
ged!", "Succesfully changed!"));
+ }
+
+ public void setPassword(String password) {
+ this.password =3D password;
+ }
+
+ public void setConfirm(String confirm) {
+ this.confirm =3D confirm;
+ }
+
+ public String getPassword() {
+ return password;
+ }
+
+ public String getConfirm() {
+ return confirm;
+ } =
+}
Modified: trunk/examples/validator-demo/src/main/webapp/WEB-INF/faces-confi=
g.xml
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/examples/validator-demo/src/main/webapp/WEB-INF/faces-config.xml =
2011-03-07 20:14:44 UTC (rev 22077)
+++ trunk/examples/validator-demo/src/main/webapp/WEB-INF/faces-config.xml =
2011-03-07 20:17:43 UTC (rev 22078)
@@ -16,6 +16,11 @@
org.richfaces.example.DataBean
session
+
+ booleanBean
+ org.richfaces.example.BooleanBean
+ request
+
custom
org.richfaces.example.CustomValidator
Modified: trunk/examples/validator-demo/src/main/webapp/examples/beanValida=
tion.xhtml
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/examples/validator-demo/src/main/webapp/examples/beanValidation.x=
html 2011-03-07 20:14:44 UTC (rev 22077)
+++ trunk/examples/validator-demo/src/main/webapp/examples/beanValidation.x=
html 2011-03-07 20:17:43 UTC (rev 22078)
@@ -15,12 +15,17 @@
-
-
+
+
-
+
+
+
+
+
+
Copied: trunk/examples/validator-demo/src/main/webapp/examples/passwordVali=
dation.xhtml (from rev 22077, branches/4.0.X/examples/validator-demo/src/ma=
in/webapp/examples/passwordValidation.xhtml)
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/examples/validator-demo/src/main/webapp/examples/passwordValidati=
on.xhtml (rev 0)
+++ trunk/examples/validator-demo/src/main/webapp/examples/passwordValidati=
on.xhtml 2011-03-07 20:17:43 UTC (rev 22078)
@@ -0,0 +1,91 @@
+
+
+
+
+
+
+ <csv:graphValidator> usage, password validation
+
+
+
+
+
+
+
+
+
+
+
+ Simple
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Test
+
+
+
+
+
+
+
+
+
+
+ Test A
+
+
+
+
+
+
+
+
+
+ Test1
+
+
+
+
+
+
+
+
\ No newline at end of file
Deleted: trunk/examples/validator-demo/src/main/webapp/resources/org.richfa=
ces.showcase/test.xhtml
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/4.0.X/examples/validator-demo/src/main/webapp/resources/org.ri=
chfaces.showcase/test.xhtml 2011-03-07 20:14:44 UTC (rev 22077)
+++ trunk/examples/validator-demo/src/main/webapp/resources/org.richfaces.s=
howcase/test.xhtml 2011-03-07 20:17:43 UTC (rev 22078)
@@ -1,30 +0,0 @@
-
-
-
-panel
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Copied: trunk/examples/validator-demo/src/main/webapp/resources/org.richfac=
es.showcase/test.xhtml (from rev 22077, branches/4.0.X/examples/validator-d=
emo/src/main/webapp/resources/org.richfaces.showcase/test.xhtml)
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/examples/validator-demo/src/main/webapp/resources/org.richfaces.s=
howcase/test.xhtml (rev 0)
+++ trunk/examples/validator-demo/src/main/webapp/resources/org.richfaces.s=
howcase/test.xhtml 2011-03-07 20:17:43 UTC (rev 22078)
@@ -0,0 +1,30 @@
+
+
+
+panel
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Deleted: trunk/examples/validator-demo/src/main/webapp/resources/org.richfa=
ces.showcase/test1.xhtml
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/4.0.X/examples/validator-demo/src/main/webapp/resources/org.ri=
chfaces.showcase/test1.xhtml 2011-03-07 20:14:44 UTC (rev 22077)
+++ trunk/examples/validator-demo/src/main/webapp/resources/org.richfaces.s=
howcase/test1.xhtml 2011-03-07 20:17:43 UTC (rev 22078)
@@ -1,40 +0,0 @@
-
-
-
-panel
-
-
-
-
-
-
-
-
- #{cc.attrs.bean} a
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Copied: trunk/examples/validator-demo/src/main/webapp/resources/org.richfac=
es.showcase/test1.xhtml (from rev 22077, branches/4.0.X/examples/validator-=
demo/src/main/webapp/resources/org.richfaces.showcase/test1.xhtml)
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/examples/validator-demo/src/main/webapp/resources/org.richfaces.s=
howcase/test1.xhtml (rev 0)
+++ trunk/examples/validator-demo/src/main/webapp/resources/org.richfaces.s=
howcase/test1.xhtml 2011-03-07 20:17:43 UTC (rev 22078)
@@ -0,0 +1,40 @@
+
+
+
+panel
+
+
+
+
+
+
+
+
+ #{cc.attrs.bean} a
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
--===============0468067442888700159==--
From richfaces-svn-commits at lists.jboss.org Mon Mar 7 15:29:38 2011
Content-Type: multipart/mixed; boundary="===============4611324316414695215=="
MIME-Version: 1.0
From: richfaces-svn-commits at lists.jboss.org
To: richfaces-svn-commits at lists.jboss.org
Subject: [richfaces-svn-commits] JBoss Rich Faces SVN: r22079 -
trunk/ui/validator/ui/src/main/resources/META-INF/resources/org.richfaces.
Date: Mon, 07 Mar 2011 15:29:38 -0500
Message-ID: <201103072029.p27KTcUD017021@svn01.web.mwc.hst.phx2.redhat.com>
--===============4611324316414695215==
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable
Author: alexsmirnov
Date: 2011-03-07 15:29:38 -0500 (Mon, 07 Mar 2011)
New Revision: 22079
Modified:
trunk/ui/validator/ui/src/main/resources/META-INF/resources/org.richface=
s/richfaces-csv.js
Log:
CODING IN PROGRESS - issue RF-10708: error in IE7 =
https://issues.jboss.org/browse/RF-10708
Modified: trunk/ui/validator/ui/src/main/resources/META-INF/resources/org.r=
ichfaces/richfaces-csv.js
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/ui/validator/ui/src/main/resources/META-INF/resources/org.richfac=
es/richfaces-csv.js 2011-03-07 20:17:43 UTC (rev 22078)
+++ trunk/ui/validator/ui/src/main/resources/META-INF/resources/org.richfac=
es/richfaces-csv.js 2011-03-07 20:29:38 UTC (rev 22079)
@@ -189,7 +189,7 @@
params.a.call(element,event,id);
}
return result;
- },
+ }
});
=
/*
--===============4611324316414695215==--
From richfaces-svn-commits at lists.jboss.org Tue Mar 8 00:52:01 2011
Content-Type: multipart/mixed; boundary="===============0029925059591489695=="
MIME-Version: 1.0
From: richfaces-svn-commits at lists.jboss.org
To: richfaces-svn-commits at lists.jboss.org
Subject: [richfaces-svn-commits] JBoss Rich Faces SVN: r22081 -
modules/docs/trunk/Component_Reference/src/main/docbook/en-US/skinning.
Date: Tue, 08 Mar 2011 00:52:01 -0500
Message-ID: <201103080552.p285q1Oa030442@svn01.web.mwc.hst.phx2.redhat.com>
--===============0029925059591489695==
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable
Author: SeanRogers
Date: 2011-03-08 00:52:00 -0500 (Tue, 08 Mar 2011)
New Revision: 22081
Modified:
modules/docs/trunk/Component_Reference/src/main/docbook/en-US/skinning/t=
abl-richdataTable.xml
modules/docs/trunk/Component_Reference/src/main/docbook/en-US/skinning/t=
abl-richextendedDataTable.xml
Log:
dataTable skinning reference
Modified: modules/docs/trunk/Component_Reference/src/main/docbook/en-US/ski=
nning/tabl-richdataTable.xml
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- modules/docs/trunk/Component_Reference/src/main/docbook/en-US/skinning/=
tabl-richdataTable.xml 2011-03-07 21:40:41 UTC (rev 22080)
+++ modules/docs/trunk/Component_Reference/src/main/docbook/en-US/skinning/=
tabl-richdataTable.xml 2011-03-08 05:52:00 UTC (rev 22081)
@@ -17,14 +17,15 @@
+ =
-
+
- .rich-table
+ .rf-dt
- This class defines the styles for a table.
+ This class defines styles for the table.
@@ -33,283 +34,348 @@
tableBackgroundColor
background-color
-
-
+ tableBorderWidth
+ border-left-width , border-top-width=
+
+
+ tableBorderColor
+ border-left-color , border-top-color=
+
+ =
+
+
- .rich-table-cell
+ .rich-dt-cap
- This class defines the styles for a table cell.
+ This class defines styles for the table caption.
- generalSizeFont
- font-size
+ No skin parameters.
-
- generalTextColor
- color
-
-
- generalFamilyFont
- font-family
-
=
- .rich-table-header
+ .rich-dt-r
- This class defines the styles for a table header row.
+ This class defines styles for a table row.
- headerBackgroundColor
- background-color
+ No skin parameters.
=
- .rich-table-header-continue
+ .rich-dt-fst-r
- This class defines the styles for all header lines after the firs=
t.
+ This class defines styles for the first row in a table.
- headerBackgroundColor
- background-color
+ No skin parameters.
- =
+ =
-
+
- .rich-table-headercell
+ .rf-dt-c
- This class defines the styles for a header cell.
+ This class defines styles for a table cell.
- tableBorderWidth , tableBorderColor<=
/literal>
- border-right, border-bottom
+ tableBackgroundColor
+ background-color
- headerTextColor
+ tableBorderWidth
+ border-bottom-width , border-right-w=
idth
+
+
+ tableBorderColor
+ border-bottom-color , border-right-c=
olor
+
+
+ generalTextColor
color
- headerWeightFont
- font-weight
+ generalFamilyFont
+ font-family
generalSizeFont
font-size
+ =
+
+
+
+ .rf-dt-nd
+
+
+ This class defines styles for a node.
+
+
+
+
+
+ tableBorderWidth
+ border-bottom-width , border-right-w=
idth
+
+
+ tableBorderColor
+ border-bottom-color , border-right-c=
olor
+
+
+ generalTextColor
+ color
+
+
generalFamilyFont
font-family
+
+ generalSizeFont
+ font-size
+
=
- .rich-table-subheader
+ .rich-dt-hdr
- This class defines the styles for a column sub-header.
+ This class defines styles for a table header.
- additionalBackgroundColor
- background-color
+ No skin parameters.
=
- .rich-table-thead
+ .rich-dt-hdr-fst
- This class defines the styles for the separator between the heade=
r and the rest of the table.
+ This class defines styles for the first header.
- tableBorderWidth , tableBorderColor<=
/literal>
- border-bottom
+ No skin parameters.
- =
+ =
-
+
- .rich-table-subheadercell
+ .rf-dt-hdr-c
- This class defines the styles for a column sub-header cell.
+ This class defines styles for a header cell.
- tableBorderWidth , tableBorderColor<=
/literal>
- border-right
+ tableHeaderBackgroundColor
+ background-color
- generalTextColor
- color
+ tableBorderWidth
+ border-bottom-width , border-right-w=
idth
- generalSizeFont
- font-size
+ tableBorderColor
+ border-bottom-color , border-right-c=
olor
+ tableHeaderTextColor
+ color
+
+
generalFamilyFont
font-family
+
+ generalSizeFont
+ font-size
+
=
- .rich-table-footer
+ .rich-dt-shdr
- This class defines the styles for a footer row.
+ This class defines styles for a table sub-header.
- tableFooterBackgroundColor
- background-color
+ No skin parameters.
=
- .rich-table-footer-continue
+ .rich-dt-shdr-fst
- This class defines the styles for all footer lines after the firs=
t.
+ This class defines styles for the first sub-header.
- tableFooterBackgroundColor
- background-color
+ No skin parameters.
- =
+ =
-
+
- .rich-table-footercell
+ .rf-dt-shdr-c
- This class defines styles for a footer cell.
+ This class defines styles for a sub-header cell.
- tableBorderWidth, tableBorderColor
- border-right, border-bottom
+ tableHeaderBackgroundColor
+ background-color
- generalTextColor
- color
+ tableBorderWidth
+ border-bottom-width , border-right-w=
idth
- headerWeightFont
- font-weight
+ tableBorderColor
+ border-bottom-color , border-right-c=
olor
- generalSizeFont
- font-size
+ tableHeaderTextColor
+ color
generalFamilyFont
font-family
+
+ generalSizeFont
+ font-size
+
=
- .rich-table-subfooter
+ .rich-dt-ftr
- This class defines the styles for a column footer.
+ This class defines styles for a table footer.
- tableSubfooterBackgroundColor
- background-color
+ No skin parameters.
=
-
+
- .rich-table-subfootercell
+ .rich-dt-ftr-fst
- This class defines the styles for a column footer cell.
+ This class defines styles for the first footer.
- tableBorderWidth , tableBorderColor<=
/literal>
- border-right , border-bottom
+ No skin parameters.
+ =
+
+
+
+ .rf-dt-ftr-c
+
+
+ This class defines styles for a footer cell.
+
+
+
+
+
+ tableFooterBackgroundColor
+ background-color
+
+
+ tableBorderWidth
+ border-bottom-width , border-right-w=
idth
+
+
+ tableBorderColor
+ border-bottom-color , border-right-c=
olor
+
+
generalTextColor
color
+ generalFamilyFont
+ font-family
+
+
generalSizeFont
font-size
-
- generalFamilyFont
- font-family
-
=
- .rich-table-row
+ .rich-dt-sftr
- This class defines styles for a table row.
+ This class defines styles for a table sub-footer.
@@ -322,10 +388,10 @@
- .rich-table-firstrow
+ .rich-dt-sftr-fst
- This class defines styles for a table's first row.
+ This class defines styles for the first sub-footer.
@@ -333,22 +399,44 @@
No skin parameters.
- =
+ =
-
+
- .rich-table-caption
+ .rf-dt-sftr-c
- This class defines styles for a "caption" facet element.
+ This class defines styles for a sub-footer cell.
- No skin parameters.
+ tableFooterBackgroundColor
+ background-color
+
+ tableBorderWidth
+ border-bottom-width , border-right-w=
idth
+
+
+ tableBorderColor
+ border-bottom-color , border-right-c=
olor
+
+
+ generalTextColor
+ color
+
+
+ generalFamilyFont
+ font-family
+
+
+ generalSizeFont
+ font-size
+
+ =
Modified: modules/docs/trunk/Component_Reference/src/main/docbook/en-US/ski=
nning/tabl-richextendedDataTable.xml
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- modules/docs/trunk/Component_Reference/src/main/docbook/en-US/skinning/=
tabl-richextendedDataTable.xml 2011-03-07 21:40:41 UTC (rev 22080)
+++ modules/docs/trunk/Component_Reference/src/main/docbook/en-US/skinning/=
tabl-richextendedDataTable.xml 2011-03-08 05:52:00 UTC (rev 22081)
@@ -43,10 +43,10 @@
- .rich-edt-hdr
+ .rich-edt-cnt
- This class defines styles for a header.
+ This class defines styles for the table content.
@@ -56,6 +56,48 @@
=
+
+
+
+ .rf-edt-c
+
+
+ This class defines styles for a table cell.
+
+
+
+
+
+ tableBorderWidth , table=
BorderColor
+ border-bottom
+
+
+ tableBorderWidth , table=
BorderColor
+ border-right
+
+
+
+
+
+
+ .rf-edt-c-cnt
+
+
+ This class defines styles for the contents of a cell.
+
+
+
+
+
+ generalFamilyFont
+ font-family
+
+
+ generalSizeFont
+ font-size
+
+
+
@@ -92,10 +134,10 @@
- .rich-edt-b
+ .rich-edt-hdr
- This class defines styles for the body of the table.
+ This class defines styles for a header.
@@ -103,43 +145,52 @@
No skin parameters.
- =
+
-
+
- .rich-edt-spcr
+ .rf-edt-hdr-c
- This class defines a spacer for Internet Explorer 7<=
/productname> compatibility.
+ This class defines styles for a table header cell.
- No skin parameters.
+ tableBorderWidth , table=
BorderColor
+ border-bottom
- =
-
+ tableBorderWidth , table=
BorderColor
+ border-right
+
+
+
+
- .rich-edt-ftr
+ .rf-edt-hdr-c-cnt
- This class defines styles for a footer.
+ This class defines styles for the contents of a header cell.
- tableBorderWidth , table=
BorderColor
- border-top
+ generalFamilyFont
+ font-family
- tableFooterBackgroundColor <=
/entry>
- background-color
+ generalSizeFont
+ font-size
+
+ tableHeaderTextColor
+ color
+
=
@@ -163,35 +214,24 @@
=
-
+
- .rich-edt-ftr-fzn
+ .rich-edt-ftr
- This class defines styles for a frozen footer.
+ This class defines styles for a footer.
- No skin parameters.
+ tableBorderWidth , table=
BorderColor
+ border-top
- =
-
-
-
- .rich-edt-cnt
-
-
- This class defines styles for the table content.
-
-
-
-
-
- No skin parameters.
+ tableFooterBackgroundColor <=
/entry>
+ background-color
=
@@ -209,85 +249,78 @@
No skin parameters.
- =
+
-
+
- .rich-edt-rsz
+ .rf-edt-ftr-c
- This class defines styles for the table resizer.
+ This class defines styles for a table footer cell.
- No skin parameters.
+ tableBorderWidth , table=
BorderColor
+ border-bottom
- =
-
+ tableBorderWidth , table=
BorderColor
+ border-right
+
+
+
+
- .rich-edt-rsz-cntr
+ .rf-edt-ftr-c-cnt
- This class defines styles for the resize container.
+ This class defines styles for the contents of a footer cell.
- No skin parameters.
+ generalFamilyFont
+ font-family
- =
-
-
-
- .rich-edt-rsz-mkr
-
-
- This class defines styles for the resize marker.
-
-
-
-
-
+ generalSizeFont
+ font-size
+
+
generalTextColor
- border-left
+ color
=
-
+
- .rf-edt-rord
+ .rf-edt-ftr-emp
- This class defines styles for the re-order functionality.
+ This class defines styles for an empty footer cell.
tableBorderWidth , table=
BorderColor
- border
+ border-right
-
- tableHeaderBackgroundColor / tableBackgroundColor
- background-color
-
=
- .rich-edt-rord-mkr
+ .rich-edt-ftr-fzn
- This class defines styles for the re-order marker.
+ This class defines styles for a frozen footer.
@@ -295,183 +328,150 @@
No skin parameters.
-
+ =
-
+
- .rf-edt-c
+ .rich-edt-b
- This class defines styles for a table cell.
+ This class defines styles for the body of the table.
- tableBorderWidth , table=
BorderColor
- border-bottom
+ No skin parameters.
-
- tableBorderWidth , table=
BorderColor
- border-right
-
=
-
+
- .rf-edt-hdr-c
+ .rf-edt-r-sel
- This class defines styles for a table header cell.
+ This class defines styles for the selected row.
tableBorderWidth , table=
BorderColor
- border-bottom
-
-
- tableBorderWidth , table=
BorderColor
border-right
-
+ =
-
+
- .rf-edt-ftr-c
+ .rich-edt-r-act
- This class defines styles for a table footer cell.
+ This class defines styles for the active row.
- tableBorderWidth , table=
BorderColor
- border-bottom
+ No skin parameters.
+ =
- tableBorderWidth , table=
BorderColor
- border-right
-
-
-
- .rf-edt-ftr-emp
+ .rich-edt-rsz
- This class defines styles for an empty footer cell.
+ This class defines styles for the table resizer.
- tableBorderWidth , table=
BorderColor
- border-right
+ No skin parameters.
-
+ =
-
+
- .rf-edt-c-cnt
+ .rich-edt-rsz-cntr
- This class defines styles for the contents of a cell.
+ This class defines styles for the resize container.
- generalFamilyFont
- font-family
+ No skin parameters.
+ =
- generalSizeFont
- font-size
-
-
-
-
+
- .rf-edt-hdr-c-cnt
+ .rich-edt-rsz-mkr
- This class defines styles for the contents of a header cell.
+ This class defines styles for the resize marker.
- generalFamilyFont
- font-family
+ generalTextColor
+ border-left
-
- generalSizeFont
- font-size
-
-
- tableHeaderTextColor
- color
-
=
-
+
- .rf-edt-ftr-c-cnt
+ .rf-edt-rord
- This class defines styles for the contents of a footer cell.
+ This class defines styles for the re-order functionality.
- generalFamilyFont
- font-family
+ tableBorderWidth , table=
BorderColor
+ border
- generalSizeFont
- font-size
+ tableHeaderBackgroundColor / tableBackgroundColor
+ background-color
+ =
- generalTextColor
- color
-
-
-
- .rf-edt-r-sel
+ .rich-edt-rord-mkr
- This class defines styles for the selected row.
+ This class defines styles for the re-order marker.
- tableBorderWidth , table=
BorderColor
- border-right
+ No skin parameters.
=
- .rich-edt-r-act
+ .rich-edt-spcr
- This class defines styles for the active row.
+ This class defines a spacer for Internet Explorer 7<=
/productname> compatibility.
--===============0029925059591489695==--
From richfaces-svn-commits at lists.jboss.org Tue Mar 8 04:19:59 2011
Content-Type: multipart/mixed; boundary="===============5502212041342769318=="
MIME-Version: 1.0
From: richfaces-svn-commits at lists.jboss.org
To: richfaces-svn-commits at lists.jboss.org
Subject: [richfaces-svn-commits] JBoss Rich Faces SVN: r22082 - in
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest:
richPanelMenuGroup and 1 other directory.
Date: Tue, 08 Mar 2011 04:19:59 -0500
Message-ID: <201103080919.p289Jxru010002@svn01.web.mwc.hst.phx2.redhat.com>
--===============5502212041342769318==
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable
Author: lfryc(a)redhat.com
Date: 2011-03-08 04:19:58 -0500 (Tue, 08 Mar 2011)
New Revision: 22082
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tes=
ts/metamer/ftest/AbstractMetamerTest.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tes=
ts/metamer/ftest/richPanelMenuGroup/TestPanelMenuGroupClientSideHandlers.ja=
va
Log:
fixed PanelMenuGroupClientSideEventHandlers (removed issue tracking: RF-105=
63, RFPL-1223)
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfa=
ces/tests/metamer/ftest/AbstractMetamerTest.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/te=
sts/metamer/ftest/AbstractMetamerTest.java 2011-03-08 05:52:00 UTC (rev 220=
81)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/te=
sts/metamer/ftest/AbstractMetamerTest.java 2011-03-08 09:19:58 UTC (rev 220=
82)
@@ -42,6 +42,8 @@
=
import java.net.URL;
import java.util.Arrays;
+import java.util.LinkedList;
+import java.util.List;
import java.util.Locale;
=
import javax.faces.event.PhaseId;
@@ -264,6 +266,15 @@
=
selenium.getEval(new JavaScript("window.metamerEvents =3D \"\";"));
}
+ =
+ public void testRequestEventsBeforeByAlert(String... events) {
+ for (String event : events) {
+ ReferencedLocator input =3D ref(attributesRoot,=
"input[type=3Dtext][id$=3Don{0}Input]");
+ input =3D input.format(event);
+ selenium.type(input, format("alert('{0}')", event));
+ selenium.waitForPageToLoad();
+ }
+ }
=
public void testRequestEventsAfter(String... events) {
String[] actualEvents =3D selenium.getEval(new JavaScript("window.=
metamerEvents")).split(" ");
@@ -273,6 +284,24 @@
format("The events ({0}) don't came in right order ({1})",=
Arrays.deepToString(actualEvents),
Arrays.deepToString(events)));
}
+ =
+ public void testRequestEventsAfterByAlert(String... events) {
+ List list =3D new LinkedList();
+ =
+ for (int i =3D 0; i < events.length; i++) {
+ waitGui.dontFail().until(alertPresent);
+ if (selenium.isAlertPresent()) {
+ list.add(selenium.getAlert());
+ }
+ }
+ =
+ String[] actualEvents =3D list.toArray(new String[list.size()]);
+ assertEquals(
+ actualEvents,
+ events,
+ format("The events ({0}) don't came in right order ({1})",=
Arrays.deepToString(actualEvents),
+ Arrays.deepToString(events)));
+ }
=
/**
* A helper method for testing attribute "dir". It tries null, ltr and=
rtl.
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfa=
ces/tests/metamer/ftest/richPanelMenuGroup/TestPanelMenuGroupClientSideHand=
lers.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/te=
sts/metamer/ftest/richPanelMenuGroup/TestPanelMenuGroupClientSideHandlers.j=
ava 2011-03-08 05:52:00 UTC (rev 22081)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/te=
sts/metamer/ftest/richPanelMenuGroup/TestPanelMenuGroupClientSideHandlers.j=
ava 2011-03-08 09:19:58 UTC (rev 22082)
@@ -28,28 +28,29 @@
=
import java.net.URL;
=
+import org.jboss.test.selenium.encapsulated.JavaScript;
import org.richfaces.tests.metamer.ftest.annotations.Inject;
import org.richfaces.tests.metamer.ftest.annotations.IssueTracking;
import org.richfaces.tests.metamer.ftest.annotations.Use;
+import org.richfaces.tests.metamer.ftest.model.PanelMenu;
import org.testng.annotations.Test;
=
/**
* @author Lukas Fryc
* @version $Revision$
*/
-(a)IssueTracking({ "https://issues.jboss.org/browse/RF-10564", "https://is=
sues.jboss.org/browse/RF-10563" })
public class TestPanelMenuGroupClientSideHandlers extends AbstractPanelMen=
uGroupTest {
=
@Inject
@Use(empty =3D true)
String event;
- String[] ajaxExpansionEvents =3D new String[] { "beforeswitch", "befor=
eexpand", "beforeselect", "begin",
+ String[] ajaxExpansionEvents =3D new String[] { "beforeselect", "befor=
eswitch", "beforeexpand", "begin",
"beforedomupdate", "select", "expand", "switch", "complete" };
- String[] ajaxCollapsionEvents =3D new String[] { "beforeswitch", "befo=
recollapse", "beforeselect", "begin",
+ String[] ajaxCollapsionEvents =3D new String[] { "beforeselect", "befo=
reswitch", "beforecollapse", "begin",
"beforedomupdate", "select", "collapse", "switch", "complete" };
- String[] clientExpansionEvents =3D new String[] { "beforeswitch", "bef=
oreexpand", "beforeselect", "select", "expand",
+ String[] clientExpansionEvents =3D new String[] { "beforeselect", "bef=
oreswitch", "beforeexpand", "select", "expand",
"switch" };
- String[] clientCollapsionEvents =3D new String[] { "beforeswitch", "be=
forecollapse", "beforeselect", "select",
+ String[] clientCollapsionEvents =3D new String[] { "beforeselect", "be=
foreswitch", "beforecollapse", "select",
"collapse", "switch" };
String[] serverExpansionEvents =3D new String[] { "beforeswitch", "bef=
oreexpand" };
String[] serverCollapsionEvents =3D new String[] { "beforeswitch", "be=
forecollapse" };
@@ -59,6 +60,8 @@
return buildUrl(contextPath, "faces/components/richPanelMenuGroup/=
simple.xhtml");
}
=
+ PanelMenu.Group group1 =3D menu.getGroupContains("Group 1");
+
@Test
@Use(field =3D "event", value =3D "ajaxCollapsionEvents")
public void testClientSideCollapsionEvent() {
@@ -84,12 +87,16 @@
public void testClientSideExpansionEventsOrderClient() {
attributes.setMode(client);
menu.setGroupMode(client);
- super.testRequestEventsBefore(serverExpansionEvents);
+ super.testRequestEventsBefore(clientExpansionEvents);
topGroup.toggle();
- super.testRequestEventsAfter(serverExpansionEvents);
+ group1.toggle();
+ selenium.getEval(new JavaScript("window.metamerEvents =3D \"\";"));
+ topGroup.toggle();
+ super.testRequestEventsAfter(clientExpansionEvents);
}
=
@Test
+ @IssueTracking("https://issues.jboss.org/browse/RF-10564")
public void testClientSideCollapsionEventsOrderClient() {
attributes.setMode(client);
menu.setGroupMode(client);
@@ -103,7 +110,9 @@
public void testClientSideExpansionEventsOrderAjax() {
attributes.setMode(ajax);
menu.setGroupMode(ajax);
+ topGroup.toggle();
super.testRequestEventsBefore(ajaxExpansionEvents);
+ selenium.getEval(new JavaScript("window.metamerEvents =3D \"\";"));
topGroup.toggle();
super.testRequestEventsAfter(ajaxExpansionEvents);
}
@@ -112,31 +121,30 @@
public void testClientSideCollapsionEventsOrderAjax() {
attributes.setMode(ajax);
menu.setGroupMode(ajax);
- topGroup.toggle();
super.testRequestEventsBefore(ajaxCollapsionEvents);
topGroup.toggle();
super.testRequestEventsAfter(ajaxCollapsionEvents);
}
=
- @Test(groups =3D "4.0.0.Final")
- @IssueTracking("https://issues.jboss.org/browse/RFPL-1223")
- public void testClientSideExpansionEventsOrderServer() {
+ @Test
+ @Use(field =3D "event", value =3D "serverExpansionEvents")
+ public void testClientSideExpansionEventsServer() {
attributes.setMode(server);
menu.setGroupMode(server);
topGroup.toggle();
- super.testRequestEventsBefore(serverExpansionEvents);
+ menu.setGroupMode(null);
+ testRequestEventsBeforeByAlert(event);
topGroup.toggle();
- super.testRequestEventsAfter(serverExpansionEvents);
+ testRequestEventsAfterByAlert(event);
}
=
- @Test(groups =3D "4.0.0.Final")
- @IssueTracking("https://issues.jboss.org/browse/RFPL-1223")
- public void testClientSideCollapsionEventsOrderServer() {
+ @Test
+ @Use(field =3D "event", value =3D "serverCollapsionEvents")
+ public void testClientSideCollapsionEventsServer() {
attributes.setMode(server);
- menu.setGroupMode(server);
+ menu.setGroupMode(null);
+ testRequestEventsBeforeByAlert(event);
topGroup.toggle();
- super.testRequestEventsBefore(serverCollapsionEvents);
- topGroup.toggle();
- super.testRequestEventsAfter(serverCollapsionEvents);
+ testRequestEventsAfterByAlert(event);
}
}
--===============5502212041342769318==--
From richfaces-svn-commits at lists.jboss.org Tue Mar 8 04:26:35 2011
Content-Type: multipart/mixed; boundary="===============3771003713543643452=="
MIME-Version: 1.0
From: richfaces-svn-commits at lists.jboss.org
To: richfaces-svn-commits at lists.jboss.org
Subject: [richfaces-svn-commits] JBoss Rich Faces SVN: r22083 -
modules/tests/metamer/trunk/application/src/main/webapp/components/a4jStatus.
Date: Tue, 08 Mar 2011 04:26:35 -0500
Message-ID: <201103080926.p289QZeN010807@svn01.web.mwc.hst.phx2.redhat.com>
--===============3771003713543643452==
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable
Author: lfryc(a)redhat.com
Date: 2011-03-08 04:26:35 -0500 (Tue, 08 Mar 2011)
New Revision: 22083
Modified:
modules/tests/metamer/trunk/application/src/main/webapp/components/a4jSt=
atus/referencedUsage.xhtml
Log:
fixed status tests - name referencing (RF-10709)
Modified: modules/tests/metamer/trunk/application/src/main/webapp/component=
s/a4jStatus/referencedUsage.xhtml
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- modules/tests/metamer/trunk/application/src/main/webapp/components/a4jS=
tatus/referencedUsage.xhtml 2011-03-08 09:19:58 UTC (rev 22082)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/a4jS=
tatus/referencedUsage.xhtml 2011-03-08 09:26:35 UTC (rev 22083)
@@ -42,7 +42,7 @@
=
-
+
@@ -57,7 +57,7 @@
=
-
+
--===============3771003713543643452==--
From richfaces-svn-commits at lists.jboss.org Tue Mar 8 05:01:32 2011
Content-Type: multipart/mixed; boundary="===============1255873956846934557=="
MIME-Version: 1.0
From: richfaces-svn-commits at lists.jboss.org
To: richfaces-svn-commits at lists.jboss.org
Subject: [richfaces-svn-commits] JBoss Rich Faces SVN: r22084 -
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/model.
Date: Tue, 08 Mar 2011 05:01:31 -0500
Message-ID: <201103081001.p28A1V5n014426@svn01.web.mwc.hst.phx2.redhat.com>
--===============1255873956846934557==
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable
Author: lfryc(a)redhat.com
Date: 2011-03-08 05:01:31 -0500 (Tue, 08 Mar 2011)
New Revision: 22084
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tes=
ts/metamer/ftest/model/CollapsibleSubTable.java
Log:
CST - fixed no data tests
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfa=
ces/tests/metamer/ftest/model/CollapsibleSubTable.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/te=
sts/metamer/ftest/model/CollapsibleSubTable.java 2011-03-08 09:26:35 UTC (r=
ev 22083)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/te=
sts/metamer/ftest/model/CollapsibleSubTable.java 2011-03-08 10:01:31 UTC (r=
ev 22084)
@@ -61,7 +61,14 @@
}
=
public boolean isNoData() {
- return selenium.isElementPresent(noData) && selenium.isVisible(noD=
ata);
+ if (!selenium.isElementPresent(noData)) {
+ return false;
+ }
+ if (selenium.isVisible(noData)) {
+ return !selenium.getText(noData).isEmpty();
+ } else {
+ return selenium.getText(noData).isEmpty();
+ }
}
=
public boolean isVisible() {
--===============1255873956846934557==--
From richfaces-svn-commits at lists.jboss.org Tue Mar 8 08:11:23 2011
Content-Type: multipart/mixed; boundary="===============0173152135537498809=="
MIME-Version: 1.0
From: richfaces-svn-commits at lists.jboss.org
To: richfaces-svn-commits at lists.jboss.org
Subject: [richfaces-svn-commits] JBoss Rich Faces SVN: r22085 -
trunk/examples/richfaces-showcase.
Date: Tue, 08 Mar 2011 08:11:23 -0500
Message-ID: <201103081311.p28DBNf3024238@svn01.web.mwc.hst.phx2.redhat.com>
--===============0173152135537498809==
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable
Author: juankprada
Date: 2011-03-08 08:11:23 -0500 (Tue, 08 Mar 2011)
New Revision: 22085
Modified:
trunk/examples/richfaces-showcase/readme.txt
Log:
RF-10583
Updated readme file for the Showcase application. =
The information about RF project was added along with setting up instructio=
ns and a new formatting that will be consistent accross all readme files wi=
thin the distribution package
Modified: trunk/examples/richfaces-showcase/readme.txt
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/examples/richfaces-showcase/readme.txt 2011-03-08 10:01:31 UTC (r=
ev 22084)
+++ trunk/examples/richfaces-showcase/readme.txt 2011-03-08 13:11:23 UTC (r=
ev 22085)
@@ -1,68 +1,170 @@
-RichFaces showcase is an application intended to show RichFaces components=
in action. It contains set of small use-cases implemented using RichFaces =
components. These use-cases for the demo are chosen from most popular ques=
tions on the user forums. You will be able to find a lot of useful informa=
tion and will be able to re-use some of it to implement the same cases for =
your applications. =
-
-1 Building and Running the application
-
-1.1. Requirements
-
-- Maven 2.1.0 or later
-- Servers: Apache Tomcat 6.0 or any JEE6 application server (e.g. JBoss AS=
6)
-- JDK 1.6
-
-1.2 Optional Additional Software
-- Eclipse IDE + JBoss Tools (to explore and run the application in IDE).
-- You're free to use any other IDE also but we haven't tested an applicati=
on in other environments. =
-
-1.3 Build/Deploy
-
-1.3.1) Tomcat =
-To build the project you need to navigate to the /examples/richfaces-showc=
ase and run
-
-mvn clean package
-
-When you see the BUILD SUCCESSFUL message you can deploy the application o=
n the server. You can deploy it on the server by copying .war file from 'ta=
rget' folder to =
-the TOMCAT_HOME/webapps folder. Then, launch the startup.sh or startup.bat=
script from TOMCAT_HOME/bin/ directory to start the server.
-
-1.3.2) JEE6 server(JBoss AS 6)
-To build the project you need to navigate to the /examples/richfaces-showc=
ase and run
-
-mvn clean package -Pjee6
-
-When you see the BUILD SUCCESSFUL message you can deploy the application o=
n the server. You can deploy it on the server by copying .war file from 'ta=
rget' folder to =
-the JBOSS_HOME/server/default/deploy folder(or change "default/" to used p=
rofile folder). Then, launch the run.sh or run.bat script from JBOSS_HOME/b=
in/ directory to start the server.
-
-2) Publishing to Google Application Engine
- =
-We have completed a resource plugin which generates static resources which=
allow us to create Google App Engine compatible applications using RichFac=
es. This means deploying to and working with GAE is a piece of cake. Here=
is how you can deploy your own RichFaces showcase example.
+=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
=
---) Update the GAE application name, and register it with google. Do this=
by updating the /webapp-gae/WEB-INF/appengine-web.xml following the GAE st=
andard documentation.
+ RichFaces - Ajax enabled JSF 2.0 component library
=
---) Only if using MyFaces: Configure the MyFaces encryption secret values =
in the /webapp-gae/WEB-INF/web.xml. Replace the "-- Insert some secret her=
e --" with a base64 encoded password. This is important because otherwise =
MyFaces will generate random keys, and this causes issues in a cluster envi=
ronment like GAE.
+ RichFaces 4.0.CR1 SHOWCASE
+ http://richfaces.org
+ March 2011
+ This software is distributed under the terms of the =
+ FSF Lesser Gnu Public License (see lgpl.txt)
=
-See below for more information:
- MyFaces - http://wiki.apache.org/myfaces/Secure_Your_Application
- Mojarra - http://wikis.sun.com/display/GlassFish/JavaServerFacesRI#JavaS=
erverFacesRI-HowcanIsecureviewstatewhenusingclientsidestatesaving%3F
+=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
=
---) Build using: =
+RichFaces showcase is an application created to show RichFaces components
+in action. It contains a set of small use-cases implemented using RichFaces
+components. =
=
-mvn clean package -Pgae
-
---) Use GAE SDK and the appcfg script just as you would for any other GAE =
application.
-
-There are some additional changes that were made in order to make richface=
s-showcase GAE compatible:
- * WebConfiguration class from com.sun.faces were patched removing code wh=
ich is not compatible with GAE
- * web.xml with additional properties for GAE created and placed at src\ma=
in\webapp-gae\WEB-INF\ (it replaces common one during build with GAE profil=
e)
- * check pom.xml GAE profile section in order to check additional dependen=
cies for that configuration.
-
-3) Working with the project in Eclipse IDE:
-In order to explore, run and deploy the application in Eclipse IDE you can=
use one of the following options:
-
- * Just import as maven project if using m2eclipse plugin.
- =
- * without m2eclipse - build it with the
-
- mvn clean install eclipse:clean eclipse:eclipse =
-
- comand and just import as existent project.
-
-You can find more details in the RichFaces Getting Started Guide (visit do=
cumentation page at http://jboss.org/richfaces)
-
+The examples shown in the application were chosen from the most popular
+questions at the user forum. You will find a lot of useful information on =
+how to implement RichFaces components and re-use the code to implement the =
+components in your own application.
+
+This file explains how to build and execute the showcase application on
+your own server.
+
+
+BUILDING AND RUNNING THE APPLICATION
+------------------------------------
+
+ 1. Requirements
+ =
+ In order to build the Showcase application you will need:
+
+ - Maven 2.1.0 or later
+ - Servers: Apache Tomcat 6.0 or any JEE6 application server =
+ (e.g. JBoss AS 6)
+ - JDK 1.6
+
+ Also optional Additional Software would make it easy for you to work =
+ with the sources of the application:
+ =
+ - Eclipse IDE + JBoss Tools (to explore and run the application =
+ in IDE). You're obviously free to use any other IDE you wish, but
+ JBoss Tools is recommended. =
+
+ 2. Build/Deploy
+
+ - Deploying on Tomcat
+
+ To build the project for Tomcat you need to navigate to the =
+ /examples/richfaces-showcase and run:
+ =
+ mvn clean package
+ =
+ When you see the BUILD SUCCESSFUL message you can deploy the =
+ application on the server. To deploy it on Tomcat, copy the .war =
+ file from 'target' folder to TOMCAT_HOME/webapps folder. Then, =
+ launch the startup.sh or startup.bat script from TOMCAT_HOME/bin/ =
+ directory to start the server.
+
+ - Deploying on JEE6 server (JBoss AS 6)
+ =
+ To build the project for a JEE6 server you need to navigate to the =
+ /examples/richfaces-showcase and run
+
+ mvn clean package -Pjee6
+
+ When you see the BUILD SUCCESSFUL message you can deploy the =
+ application on the server. To deploy it on the application server =
+ copy the .war file from 'target' folder to the JBOSS_HOME/server/default=
/deploy =
+ folder (or change "default/" to used profile folder). Then, launch =
+ the run.sh or run.bat script from JBOSS_HOME/bin/ directory to start =
+ the server.
+
+
+After deploying the examples to your server open a browser and type =
+http://localhost:8080/richfaces-showcase to view the examples.
+
+ - Publishing to Google Application Engine (GAE)
+ =
+ We have completed a resource plugin which generates static resources =
+ allowing us to create Google App Engine compatible applications =
+ using RichFaces. This means deploying to and working with GAE is =
+ a piece of cake. Here is how you can deploy your own RichFaces showcase =
+ example:
+
+ * Update the GAE application name, and register it with google. =
+ Do this by updating the /webapp-gae/WEB-INF/appengine-web.xml =
+ following the GAE standard documentation.
+
+ * if using MyFaces: Configure the MyFaces encryption secret values =
+ in the /webapp-gae/WEB-INF/web.xml. Replace the "-- Insert some se=
cret here --" =
+ with a base64 encoded password. This is important because =
+ otherwise MyFaces will generate random keys, and this causes =
+ issues in a cluster environment like GAE.
+ =
+ For more information on JSF encryption check:
+ MyFaces - http://wiki.apache.org/myfaces/Secure_Your_Applicatio
+ Mojarra - http://wikis.sun.com/display/GlassFish/JavaServerFacesRI#Ja=
vaServerFacesRI-HowcanIsecureviewstatewhenusingclientsidestatesaving%3F
+ =
+ * Build using: mvn clean package -Pgae
+
+ * Use GAE SDK and the appcfg script just as you would for any=
other =
+ GAE application.
+
+ There are some additional changes that were made in order to make =
+ richfaces-showcase GAE compatible:
+ =
+ * WebConfiguration class from com.sun.faces were patched removing =
+ code which is not compatible with GAE
+
+ * web.xml with additional properties for GAE created and placed =
+ at src\main\webapp-gae\WEB-INF\ (it replaces common one during =
+ build with GAE profile)
+
+ * check pom.xml GAE profile section in order to check additional =
+ dependencies for that configuration
+
+
+SETTING UP ECLIPSE TO WORK WITH THE SHOWCASE
+--------------------------------------------
+
+In order to explore, run and deploy the Showcase using Eclipse IDE you can=
use =
+one of the following options:
+
+ - You could use JBoss Tools with m2eclipse plugin and just import =
+ the examples as maven-based projects.
+ * Open Eclipse and go to File > Import
+ * Expand the project type named Maven and select Import Maven =
+ Project
+ * Browse the directory in which you placed the examples, select =
+ it and press OK.
+ * Press next on the import wizard to finish importing the =
+ examples.
+
+ - Or if you are not using m2eclipse execute use Maven to convert the =
+ project to an Eclipse project:
+ * Open a terminal inside the RichFaces examples directory
+ * execute mvn eclipse:ecllipse
+ * Open Eclipse and select File > Import
+ * Select Import as existing project into workspace after build =
+ is complete.
+ * Follow the instructions on the import wizard.
+
+You are now able to work with the Showcase within Eclipse.
+
+
+MORE INFORMATION AND RESOURCES
+------------------------------
+
+For more information on RichFaces 4, please visit RichFaces =
+website at:
+
+ - http://www.jboss.org/richfaces.
+
+Or check the Wiki for more information on build instructions for the examp=
les at:
+
+ - http://community.jboss.org/wiki/HowtoworkwithRichFaces4xexamplessour=
ces
+
+To report or check the status of issues related to RichFaces Examples =
+use the project's Jira at:
+ =
+ - https://issues.jboss.org/browse/RF
+
+Community support and help can be obtained from the RichFaces forums at:
+
+ - http://community.jboss.org/en/richfaces?view=3Ddiscussions
+
+
+
+###
--===============0173152135537498809==--
From richfaces-svn-commits at lists.jboss.org Tue Mar 8 10:49:09 2011
Content-Type: multipart/mixed; boundary="===============5482189006449996168=="
MIME-Version: 1.0
From: richfaces-svn-commits at lists.jboss.org
To: richfaces-svn-commits at lists.jboss.org
Subject: [richfaces-svn-commits] JBoss Rich Faces SVN: r22086 -
modules/tests/metamer/trunk/application.
Date: Tue, 08 Mar 2011 10:49:09 -0500
Message-ID: <201103081549.p28Fn9V9019323@svn01.web.mwc.hst.phx2.redhat.com>
--===============5482189006449996168==
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable
Author: lfryc(a)redhat.com
Date: 2011-03-08 10:49:08 -0500 (Tue, 08 Mar 2011)
New Revision: 22086
Modified:
modules/tests/metamer/trunk/application/pom.xml
Log:
removed download.java.net from maven repositories
Modified: modules/tests/metamer/trunk/application/pom.xml
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- modules/tests/metamer/trunk/application/pom.xml 2011-03-08 13:11:23 UTC=
(rev 22085)
+++ modules/tests/metamer/trunk/application/pom.xml 2011-03-08 15:49:08 UTC=
(rev 22086)
@@ -40,14 +40,6 @@
http://nexus.qa.jboss.com:8081/nexus/content/repositories=
/releases
- =
-
-
- maven-repository2.dev.java.net
- Java.net Repository for Maven 2
- http://download.java.net/maven/2
-
-
=
8080
--===============5482189006449996168==--
From richfaces-svn-commits at lists.jboss.org Tue Mar 8 14:31:02 2011
Content-Type: multipart/mixed; boundary="===============8750510140939324614=="
MIME-Version: 1.0
From: richfaces-svn-commits at lists.jboss.org
To: richfaces-svn-commits at lists.jboss.org
Subject: [richfaces-svn-commits] JBoss Rich Faces SVN: r22087 -
branches/4.0.X/ui/validator/ui/src/main/resources/META-INF/resources/org.richfaces.
Date: Tue, 08 Mar 2011 14:31:02 -0500
Message-ID: <201103081931.p28JV2H4001056@svn01.web.mwc.hst.phx2.redhat.com>
--===============8750510140939324614==
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable
Author: alexsmirnov
Date: 2011-03-08 14:31:01 -0500 (Tue, 08 Mar 2011)
New Revision: 22087
Modified:
branches/4.0.X/ui/validator/ui/src/main/resources/META-INF/resources/org=
.richfaces/richfaces-csv.js
Log:
RESOLVED - issue RF-10708: error in IE7 =
https://issues.jboss.org/browse/RF-10708, reviewed by Nick
Modified: branches/4.0.X/ui/validator/ui/src/main/resources/META-INF/resour=
ces/org.richfaces/richfaces-csv.js
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/4.0.X/ui/validator/ui/src/main/resources/META-INF/resources/or=
g.richfaces/richfaces-csv.js 2011-03-08 15:49:08 UTC (rev 22086)
+++ branches/4.0.X/ui/validator/ui/src/main/resources/META-INF/resources/or=
g.richfaces/richfaces-csv.js 2011-03-08 19:31:01 UTC (rev 22087)
@@ -189,7 +189,7 @@
params.a.call(element,event,id);
}
return result;
- },
+ }
});
=
/*
--===============8750510140939324614==--
From richfaces-svn-commits at lists.jboss.org Wed Mar 9 01:49:34 2011
Content-Type: multipart/mixed; boundary="===============6370694878896458960=="
MIME-Version: 1.0
From: richfaces-svn-commits at lists.jboss.org
To: richfaces-svn-commits at lists.jboss.org
Subject: [richfaces-svn-commits] JBoss Rich Faces SVN: r22088 - in
modules/docs/trunk/Component_Reference/src/main/docbook/en-US: extras and 1
other directories.
Date: Wed, 09 Mar 2011 01:49:33 -0500
Message-ID: <201103090649.p296nXZH005320@svn01.web.mwc.hst.phx2.redhat.com>
--===============6370694878896458960==
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable
Author: SeanRogers
Date: 2011-03-09 01:49:33 -0500 (Wed, 09 Mar 2011)
New Revision: 22088
Added:
modules/docs/trunk/Component_Reference/src/main/docbook/en-US/skinning/t=
abl-richcollapsibleSubTable.xml
modules/docs/trunk/Component_Reference/src/main/docbook/en-US/skinning/t=
abl-richcollapsibleSubTableToggler.xml
modules/docs/trunk/Component_Reference/src/main/docbook/en-US/skinning/t=
abl-richdataGrid.xml
modules/docs/trunk/Component_Reference/src/main/docbook/en-US/skinning/t=
abl-richdataScroller.xml
modules/docs/trunk/Component_Reference/src/main/docbook/en-US/skinning/t=
abl-richtree.xml
modules/docs/trunk/Component_Reference/src/main/docbook/en-US/skinning/t=
abl-richtreeNode.xml
Modified:
modules/docs/trunk/Component_Reference/src/main/docbook/en-US/chap-Compo=
nent_Reference-Common_Ajax_attributes.xml
modules/docs/trunk/Component_Reference/src/main/docbook/en-US/chap-Compo=
nent_Reference-Tables_and_grids.xml
modules/docs/trunk/Component_Reference/src/main/docbook/en-US/chap-Compo=
nent_Reference-Trees.xml
modules/docs/trunk/Component_Reference/src/main/docbook/en-US/extras/exa=
m-Component_Reference-data-Data_reference_example.xml_sample
modules/docs/trunk/Component_Reference/src/main/docbook/en-US/skinning/t=
abl-richdataTable.xml
modules/docs/trunk/Component_Reference/src/main/docbook/en-US/skinning/t=
abl-richlist.xml
Log:
Finished first round of skinning references
Modified: modules/docs/trunk/Component_Reference/src/main/docbook/en-US/cha=
p-Component_Reference-Common_Ajax_attributes.xml
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- modules/docs/trunk/Component_Reference/src/main/docbook/en-US/chap-Comp=
onent_Reference-Common_Ajax_attributes.xml 2011-03-08 19:31:01 UTC (rev 220=
87)
+++ modules/docs/trunk/Component_Reference/src/main/docbook/en-US/chap-Comp=
onent_Reference-Common_Ajax_attributes.xml 2011-03-09 06:49:33 UTC (rev 220=
88)
@@ -103,7 +103,7 @@
=
Modified: modules/docs/trunk/Component_Reference/src/main/docbook/en-US/cha=
p-Component_Reference-Tables_and_grids.xml
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- modules/docs/trunk/Component_Reference/src/main/docbook/en-US/chap-Comp=
onent_Reference-Tables_and_grids.xml 2011-03-08 19:31:01 UTC (rev 22087)
+++ modules/docs/trunk/Component_Reference/src/main/docbook/en-US/chap-Comp=
onent_Reference-Tables_and_grids.xml 2011-03-09 06:49:33 UTC (rev 22088)
@@ -283,12 +283,10 @@
=
-
=
=
@@ -660,6 +658,11 @@
=
+
+ Style classes and skin parameters
+
+
+
<rich:collapsibleSubTableToggler>
@@ -706,6 +709,11 @@
+
+
+ Style classes and skin parameters
+
+
=
@@ -1164,7 +1172,7 @@
-->
=
- Patial updates
+ Partial updates
As <rich:dataGrid> the component is based on =
the <a4j:repeat> component, it can be partially up=
dated with Ajax. Refer to for details on partially updating =
the <rich:dataGrid> component.
@@ -1201,14 +1209,10 @@
=
-
=
@@ -1454,12 +1458,11 @@
=
-
+ =
=
@@ -1635,6 +1638,11 @@
+ =
+
=
Modified: modules/docs/trunk/Component_Reference/src/main/docbook/en-US/cha=
p-Component_Reference-Trees.xml
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- modules/docs/trunk/Component_Reference/src/main/docbook/en-US/chap-Comp=
onent_Reference-Trees.xml 2011-03-08 19:31:01 UTC (rev 22087)
+++ modules/docs/trunk/Component_Reference/src/main/docbook/en-US/chap-Comp=
onent_Reference-Trees.xml 2011-03-09 06:49:33 UTC (rev 22088)
@@ -345,6 +345,14 @@
+
+
+ Style classes and skin parameters
+
+ Styling for the <rich:tree> component is most=
ly applied to the tree nodes. Refer to for details on sty=
ling tree nodes. In addition, the <rich:tree> comp=
onent can make use of the style classes outlined in .
+
+
+
=
<rich:treeNode>
@@ -422,6 +430,11 @@
+
+
+ Style classes and skin parameters
+
+
=
Modified: modules/docs/trunk/Component_Reference/src/main/docbook/en-US/ext=
ras/exam-Component_Reference-data-Data_reference_example.xml_sample
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- modules/docs/trunk/Component_Reference/src/main/docbook/en-US/extras/ex=
am-Component_Reference-data-Data_reference_example.xml_sample 2011-03-08 19=
:31:01 UTC (rev 22087)
+++ modules/docs/trunk/Component_Reference/src/main/docbook/en-US/extras/ex=
am-Component_Reference-data-Data_reference_example.xml_sample 2011-03-09 06=
:49:33 UTC (rev 22088)
@@ -1 +1 @@
-
+
Added: modules/docs/trunk/Component_Reference/src/main/docbook/en-US/skinni=
ng/tabl-richcollapsibleSubTable.xml
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- modules/docs/trunk/Component_Reference/src/main/docbook/en-US/skinning/=
tabl-richcollapsibleSubTable.xml (rev 0)
+++ modules/docs/trunk/Component_Reference/src/main/docbook/en-US/skinning/=
tabl-richcollapsibleSubTable.xml 2011-03-09 06:49:33 UTC (rev 22088)
@@ -0,0 +1,400 @@
+
+
+
+
+ Style classes (selectors) and corresponding skin parameters
+
+
+
+
+
+
+
+ Class (selector)
+ Skin Parameters
+ Mapped CSS properties
+
+
+
+ =
+
+
+
+
+ .rf-cst
+
+
+ This class defines styles for the table.
+
+
+
+
+
+ No skin parameters.
+
+ =
+
+
+
+
+ .rf-cst-r
+
+
+ This class defines styles for a table row.
+
+
+
+
+
+ No skin parameters.
+
+ =
+
+
+
+
+ .rf-cst-fst-r
+
+
+ This class defines styles for the first row in a table.
+
+
+
+
+
+ No skin parameters.
+
+ =
+
+
+
+
+ .rf-cst-c
+
+
+ This class defines styles for a table cell.
+
+
+
+
+
+ tableBackgroundColor
+ background-color
+
+
+ tableBorderWidth
+ border-bottom-width , border-right-w=
idth
+
+
+ tableBorderColor
+ border-bottom-color , border-right-c=
olor
+
+
+ generalTextColor
+ color
+
+
+ generalFamilyFont
+ font-family
+
+
+ generalSizeFont
+ font-size
+
+ =
+
+
+
+
+ .rf-cst-hdr
+
+
+ This class defines styles for a table header.
+
+
+
+
+
+ No skin parameters.
+
+ =
+
+
+
+
+ .rf-cst-hdr-fst
+
+
+ This class defines styles for the first header.
+
+
+
+
+
+ No skin parameters.
+
+ =
+
+
+
+
+ .rf-cst-hdr-fst-r
+
+
+ This class defines styles for the first row in the header.
+
+
+
+
+
+ No skin parameters.
+
+ =
+
+
+
+
+ .rf-cst-hdr-c
+
+
+ This class defines styles for a header cell.
+
+
+
+
+
+ tableSubHeaderBackgroundColor
+ background-color
+
+
+ tableBorderWidth
+ border-bottom-width , border-right-w=
idth
+
+
+ tableBorderColor
+ border-bottom-color , border-right-c=
olor
+
+
+ generalTextColor
+ color
+
+
+ generalFamilyFont
+ font-family
+
+
+ generalSizeFont
+ font-size
+
+ =
+
+
+
+
+ .rf-cst-shdr
+
+
+ This class defines styles for a table sub-header.
+
+
+
+
+
+ No skin parameters.
+
+ =
+
+
+
+
+ .rf-cst-shdr-fst
+
+
+ This class defines styles for the first sub-header.
+
+
+
+
+
+ No skin parameters.
+
+ =
+
+
+
+
+ .rf-cst-shdr-c
+
+
+ This class defines styles for a sub-header cell.
+
+
+
+
+
+ tableSubHeaderBackgroundColor
+ background-color
+
+
+ tableBorderWidth
+ border-bottom-width , border-right-w=
idth
+
+
+ tableBorderColor
+ border-bottom-color , border-right-c=
olor
+
+
+ generalTextColor
+ color
+
+
+ generalFamilyFont
+ font-family
+
+
+ generalSizeFont
+ font-size
+
+ =
+
+
+
+
+ .rf-cst-ftr
+
+
+ This class defines styles for a table footer.
+
+
+
+
+
+ No skin parameters.
+
+ =
+
+
+
+
+ .rf-cst-ftr-fst
+
+
+ This class defines styles for the first footer.
+
+
+
+
+
+ No skin parameters.
+
+ =
+
+
+
+
+ .rf-cst-ftr-c
+
+
+ This class defines styles for a footer cell.
+
+
+
+
+
+ tableSubFooterBackgroundColor
+ background-color
+
+
+ tableBorderWidth
+ border-bottom-width , border-right-w=
idth
+
+
+ tableBorderColor
+ border-bottom-color , border-right-c=
olor
+
+
+ generalTextColor
+ color
+
+
+ generalFamilyFont
+ font-family
+
+
+ generalSizeFont
+ font-size
+
+ =
+
+
+
+
+ .rf-cst-sftr
+
+
+ This class defines styles for a table sub-footer.
+
+
+
+
+
+ No skin parameters.
+
+ =
+
+
+
+
+ .rf-cst-sftr-fst
+
+
+ This class defines styles for the first sub-footer.
+
+
+
+
+
+ No skin parameters.
+
+ =
+
+
+
+
+ .rf-cst-sftr-c
+
+
+ This class defines styles for a sub-footer cell.
+
+
+
+
+
+ tableSubFooterBackgroundColor
+ background-color
+
+
+ tableBorderWidth
+ border-bottom-width , border-right-w=
idth
+
+
+ tableBorderColor
+ border-bottom-color , border-right-c=
olor
+
+
+ generalTextColor
+ color
+
+
+ generalFamilyFont
+ font-family
+
+
+ generalSizeFont
+ font-size
+
+ =
+
+
+
Added: modules/docs/trunk/Component_Reference/src/main/docbook/en-US/skinni=
ng/tabl-richcollapsibleSubTableToggler.xml
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- modules/docs/trunk/Component_Reference/src/main/docbook/en-US/skinning/=
tabl-richcollapsibleSubTableToggler.xml (rev 0)
+++ modules/docs/trunk/Component_Reference/src/main/docbook/en-US/skinning/=
tabl-richcollapsibleSubTableToggler.xml 2011-03-09 06:49:33 UTC (rev 22088)
@@ -0,0 +1,71 @@
+
+
+
+
+ Style classes (selectors) and corresponding skin parameters
+
+
+
+
+
+
+
+ Class (selector)
+ Skin Parameters
+ Mapped CSS properties
+
+
+
+ =
+
+
+
+
+ .rf-csttg
+
+
+ This class defines styles for toggle control.
+
+
+
+
+
+ No skin parameters.
+
+ =
+
+
+
+
+ .rf-csttg-exp
+
+
+ This class defines styles for toggle control which expands the su=
b-table.
+
+
+
+
+
+ No skin parameters.
+
+ =
+
+
+
+
+ .rf-csttg-colps
+
+
+ This class defines styles for toggle control which collapses the =
sub-table.
+
+
+
+
+
+ No skin parameters.
+
+ =
+
+
+
Added: modules/docs/trunk/Component_Reference/src/main/docbook/en-US/skinni=
ng/tabl-richdataGrid.xml
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- modules/docs/trunk/Component_Reference/src/main/docbook/en-US/skinning/=
tabl-richdataGrid.xml (rev 0)
+++ modules/docs/trunk/Component_Reference/src/main/docbook/en-US/skinning/=
tabl-richdataGrid.xml 2011-03-09 06:49:33 UTC (rev 22088)
@@ -0,0 +1,320 @@
+
+
+
+
+ Style classes (selectors) and corresponding skin parameters
+
+
+
+
+
+
+
+ Class (selector)
+ Skin Parameters
+ Mapped CSS properties
+
+
+
+ =
+
+
+
+
+ .rf-dg
+
+
+ This class defines styles for the grid.
+
+
+
+
+
+ tableBackgroundColor
+ background-color
+
+
+ tableBorderWidth
+ border-left-width , border-top-width=
+
+
+ tableBorderColor
+ border-left-color , border-top-color=
+
+ =
+
+
+
+
+ .rf-dg-cap
+
+
+ This class defines styles for the grid caption.
+
+
+
+
+
+ No skin parameters.
+
+ =
+
+
+
+
+ .rf-dg-r
+
+
+ This class defines styles for a grid row.
+
+
+
+
+
+ No skin parameters.
+
+ =
+
+
+
+
+ .rf-dg-c
+
+
+ This class defines styles for a grid cell.
+
+
+
+
+ tableBorderWidth
+ border-bottom-width , border-right-w=
idth
+
+
+ tableBorderColor
+ border-bottom-color , border-right-c=
olor
+
+
+ generalTextColor
+ color
+
+
+ generalFamilyFont
+ font-family
+
+
+ generalSizeFont
+ font-size
+
+ =
+
+
+
+
+ .rf-dg-nd-c
+
+
+ This class defines styles for a node cell.
+
+
+
+
+
+ tableBorderWidth
+ border-bottom-width , border-right-w=
idth
+
+
+ tableBorderColor
+ border-bottom-color , border-right-c=
olor
+
+
+ generalTextColor
+ color
+
+
+ generalFamilyFont
+ font-family
+
+
+ generalSizeFont
+ font-size
+
+ =
+
+
+
+
+ .rf-dg-th
+
+
+ This class defines styles for the grid header section.
+
+
+
+
+
+ tableBorderWidth
+ border-bottom-width
+
+
+ tableBorderColor
+ border-bottom-color
+
+ =
+
+
+
+
+ .rf-dg-h
+
+
+ This class defines styles for a grid header.
+
+
+
+
+
+ No skin parameters.
+
+ =
+
+
+
+
+ .rf-dg-h-f
+
+
+ This class defines styles for the first header.
+
+
+
+
+
+ No skin parameters.
+
+ =
+
+
+
+
+ .rf-dg-h-r
+
+
+ This class defines styles for a header row.
+
+
+
+
+
+ No skin parameters.
+
+ =
+
+
+
+
+ .rf-dg-h-c
+
+
+ This class defines styles for a header cell.
+
+
+
+
+
+ tableHeaderBackgroundColor
+ background-color
+
+
+ tableBorderWidth
+ border-bottom-width , border-right-w=
idth
+
+
+ tableBorderColor
+ border-bottom-color , border-right-c=
olor
+
+
+ tableHeaderTextColor
+ color
+
+
+ generalFamilyFont
+ font-family
+
+
+ generalSizeFont
+ font-size
+
+ =
+
+
+
+
+ .rf-dg-f
+
+
+ This class defines styles for a grid footer.
+
+
+
+
+
+ No skin parameters.
+
+ =
+
+
+
+
+ .rf-dg-f-f
+
+
+ This class defines styles for the first footer.
+
+
+
+
+
+ No skin parameters.
+
+ =
+
+
+
+
+ .rf-dg-f-c
+
+
+ This class defines styles for a footer cell.
+
+
+
+
+
+ tableFooterBackgroundColor
+ background-color
+
+
+ tableBorderWidth
+ border-bottom-width , border-right-w=
idth
+
+
+ tableBorderColor
+ border-bottom-color , border-right-c=
olor
+
+
+ generalTextColor
+ color
+
+
+ generalFamilyFont
+ font-family
+
+
+ generalSizeFont
+ font-size
+
+ =
+
+
+
Added: modules/docs/trunk/Component_Reference/src/main/docbook/en-US/skinni=
ng/tabl-richdataScroller.xml
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- modules/docs/trunk/Component_Reference/src/main/docbook/en-US/skinning/=
tabl-richdataScroller.xml (rev 0)
+++ modules/docs/trunk/Component_Reference/src/main/docbook/en-US/skinning/=
tabl-richdataScroller.xml 2011-03-09 06:49:33 UTC (rev 22088)
@@ -0,0 +1,265 @@
+
+
+
+
Modified: modules/docs/trunk/Component_Reference/src/main/docbook/en-US/ski=
nning/tabl-richdataTable.xml
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- modules/docs/trunk/Component_Reference/src/main/docbook/en-US/skinning/=
tabl-richdataTable.xml 2011-03-08 19:31:01 UTC (rev 22087)
+++ modules/docs/trunk/Component_Reference/src/main/docbook/en-US/skinning/=
tabl-richdataTable.xml 2011-03-09 06:49:33 UTC (rev 22088)
@@ -47,7 +47,7 @@
- .rich-dt-cap
+ .rf-dt-cap
This class defines styles for the table caption.
@@ -63,7 +63,7 @@
- .rich-dt-r
+ .rf-dt-r
This class defines styles for a table row.
@@ -79,7 +79,7 @@
- .rich-dt-fst-r
+ .rf-dt-fst-r
This class defines styles for the first row in a table.
@@ -165,7 +165,7 @@
- .rich-dt-hdr
+ .rf-dt-hdr
This class defines styles for a table header.
@@ -181,7 +181,7 @@
- .rich-dt-hdr-fst
+ .rf-dt-hdr-fst
This class defines styles for the first header.
@@ -234,7 +234,7 @@
- .rich-dt-shdr
+ .rf-dt-shdr
This class defines styles for a table sub-header.
@@ -250,7 +250,7 @@
- .rich-dt-shdr-fst
+ .rf-dt-shdr-fst
This class defines styles for the first sub-header.
@@ -303,7 +303,7 @@
- .rich-dt-ftr
+ .rf-dt-ftr
This class defines styles for a table footer.
@@ -319,7 +319,7 @@
- .rich-dt-ftr-fst
+ .rf-dt-ftr-fst
This class defines styles for the first footer.
@@ -372,7 +372,7 @@
- .rich-dt-sftr
+ .rf-dt-sftr
This class defines styles for a table sub-footer.
@@ -388,7 +388,7 @@
- .rich-dt-sftr-fst
+ .rf-dt-sftr-fst
This class defines styles for the first sub-footer.
Modified: modules/docs/trunk/Component_Reference/src/main/docbook/en-US/ski=
nning/tabl-richlist.xml
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- modules/docs/trunk/Component_Reference/src/main/docbook/en-US/skinning/=
tabl-richlist.xml 2011-03-08 19:31:01 UTC (rev 22087)
+++ modules/docs/trunk/Component_Reference/src/main/docbook/en-US/skinning/=
tabl-richlist.xml 2011-03-09 06:49:33 UTC (rev 22088)
@@ -17,37 +17,107 @@
+ =
-
+
- .rich-list
+ .rf-ulst-itm
- This class defines styles for an HTML <ul> element.
+ This class defines styles for an item in an unordered list.
- No skin parameters.
+ generalTextColor
+ color
- =
-
+ generalFamilyFont
+ font-family
+
+
+ generalSizeFont
+ font-size
+
+ =
+
+
- .rich-list-item
+ .rf-olst-itm
- This class defines styles for an HTML <il> element.
+ This class defines styles for an item in an unordered list.
- No skin parameters.
+ generalTextColor
+ color
+
+ generalFamilyFont
+ font-family
+
+
+ generalSizeFont
+ font-size
+
+ =
+
+
+
+
+ .rf-dlst-trm
+
+
+ This class defines styles for the term of an item in a definition=
list.
+
+
+
+
+
+ generalTextColor
+ color
+
+
+ generalFamilyFont
+ font-family
+
+
+ generalSizeFont
+ font-size
+
+ =
+
+
+
+
+ .rf-dlst-dfn
+
+
+ This class defines styles for the definition of an item in a defi=
nition list.
+
+
+
+
+
+ generalTextColor
+ color
+
+
+ generalFamilyFont
+ font-family
+
+
+ generalSizeFont
+ font-size
+
+ =
Added: modules/docs/trunk/Component_Reference/src/main/docbook/en-US/skinni=
ng/tabl-richtree.xml
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- modules/docs/trunk/Component_Reference/src/main/docbook/en-US/skinning/=
tabl-richtree.xml (rev 0)
+++ modules/docs/trunk/Component_Reference/src/main/docbook/en-US/skinning/=
tabl-richtree.xml 2011-03-09 06:49:33 UTC (rev 22088)
@@ -0,0 +1,87 @@
+
+
+
+
+ Style classes (selectors) and corresponding skin parameters
+
+
+
+
+
+
+
+ Class (selector)
+ Skin Parameters
+ Mapped CSS properties
+
+
+
+ =
+
+
+
+
+ .rf-tr-nd
+
+
+ This class defines styles for the nodes in a tree.
+
+
+
+
+
+ No skin parameters.
+
+ =
+
+
+
+
+ .rf-tr-nd-last
+
+
+ This class defines styles for last node in a tree.
+
+
+
+
+
+ No skin parameters.
+
+ =
+
+
+
+
+ .rf-tr-nd-colps
+
+
+ This class defines styles for a collapsed tree node.
+
+
+
+
+
+ No skin parameters.
+
+ =
+
+
+
+
+ .rf-tr-nd-exp
+
+
+ This class defines styles for an expanded tree node.
+
+
+
+
+
+ No skin parameters.
+
+ =
+
+
+
Added: modules/docs/trunk/Component_Reference/src/main/docbook/en-US/skinni=
ng/tabl-richtreeNode.xml
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- modules/docs/trunk/Component_Reference/src/main/docbook/en-US/skinning/=
tabl-richtreeNode.xml (rev 0)
+++ modules/docs/trunk/Component_Reference/src/main/docbook/en-US/skinning/=
tabl-richtreeNode.xml 2011-03-09 06:49:33 UTC (rev 22088)
@@ -0,0 +1,270 @@
+
+
+
+
+ Style classes (selectors) and corresponding skin parameters
+
+
+
+
+
+
+
+ Class (selector)
+ Skin Parameters
+ Mapped CSS properties
+
+
+
+ =
+
+
+
+
+ .rf-trn
+
+
+ This class defines styles for a tree node.
+
+
+
+
+
+ generalFamilyFont
+ font-family
+
+
+ generalSizeFont
+ font-size
+
+ =
+
+
+
+
+ .rf-trn-lbl
+
+
+ This class defines styles for a tree node label.
+
+
+
+
+
+ No skin parameters.
+
+ =
+
+
+
+
+ .rf-trn-cnt
+
+
+ This class defines styles for tree node content.
+
+
+
+
+
+ No skin parameters.
+
+ =
+
+
+
+
+ .rf-trn-sel
+
+
+ This class defines styles for a selected tree node.
+
+
+
+
+
+ additionalBackgroundColor
+ background
+
+ =
+
+
+
+
+ .rf-trn-ldn
+
+
+ This class defines styles for a tree node when it is loading.
+
+
+
+
+
+ additionalBackgroundColor
+ background
+
+ =
+
+
+
+
+ .rf-trn-hnd
+
+
+ This class defines styles for a tree node handle.
+
+
+
+
+
+ No skin parameters.
+
+ =
+
+
+
+
+ .rf-trn-hnd-lf
+
+
+ This class defines styles for the handle of a leaf node.
+
+
+
+
+
+ No skin parameters.
+
+ =
+
+
+
+
+ .rf-trn-hnd-colps
+
+
+ This class defines styles for the handle of a collapsed node.
+
+
+
+
+
+ No skin parameters.
+
+ =
+
+
+
+
+ .rf-trn-hnd-exp
+
+
+ This class defines styles for the handle of an expanded node.
+
+
+
+
+
+ No skin parameters.
+
+ =
+
+
+
+
+ .rf-trn-hnd-ldn-fct
+
+
+ This class defines styles for the loading facet of a tree node ha=
ndle.
+
+
+
+
+
+ No skin parameters.
+
+ =
+
+
+
+
+ .rf-trn-ico
+
+
+ This class defines styles for tree node icon.
+
+
+
+
+
+ No skin parameters.
+
+ =
+
+
+
+
+ .rf-trn-ico-lf
+
+
+ This class defines styles for the icon of a leaf node.
+
+
+
+
+
+ No skin parameters.
+
+ =
+
+
+
+
+ .rf-trn-ico-colps
+
+
+ This class defines styles for the icon of a collapsed node.
+
+
+
+
+
+ No skin parameters.
+
+ =
+
+
+
+
+ .rf-trn-ico-exp
+
+
+ This class defines styles for the icon of an expanded node.
+
+
+
+
+
+ No skin parameters.
+
+ =
+
+
+
+
+ .rf-trn-ico-cst
+
+
+ This class defines styles for a custom node icon.
+
+
+
+
+
+ No skin parameters.
+
+ =
+
+
+
--===============6370694878896458960==--
From richfaces-svn-commits at lists.jboss.org Wed Mar 9 04:24:26 2011
Content-Type: multipart/mixed; boundary="===============4646824153501214378=="
MIME-Version: 1.0
From: richfaces-svn-commits at lists.jboss.org
To: richfaces-svn-commits at lists.jboss.org
Subject: [richfaces-svn-commits] JBoss Rich Faces SVN: r22089 -
modules/tests/metamer/trunk/application/src/main/webapp/templates.
Date: Wed, 09 Mar 2011 04:24:26 -0500
Message-ID: <201103090924.p299OQco006689@svn01.web.mwc.hst.phx2.redhat.com>
--===============4646824153501214378==
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable
Author: lfryc(a)redhat.com
Date: 2011-03-09 04:24:26 -0500 (Wed, 09 Mar 2011)
New Revision: 22089
Modified:
modules/tests/metamer/trunk/application/src/main/webapp/templates/header=
.xhtml
Log:
disabled ui:debug due to MYFACES-3061 (RF-10668)
Modified: modules/tests/metamer/trunk/application/src/main/webapp/templates=
/header.xhtml
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- modules/tests/metamer/trunk/application/src/main/webapp/templates/heade=
r.xhtml 2011-03-09 06:49:33 UTC (rev 22088)
+++ modules/tests/metamer/trunk/application/src/main/webapp/templates/heade=
r.xhtml 2011-03-09 09:24:26 UTC (rev 22089)
@@ -65,9 +65,12 @@
=
-
+ =
+
=
@@ -90,8 +93,11 @@
updateStatusChecker();
-
-
+ =
+
=
=
--===============4646824153501214378==--
From richfaces-svn-commits at lists.jboss.org Wed Mar 9 04:24:56 2011
Content-Type: multipart/mixed; boundary="===============1674906983867125383=="
MIME-Version: 1.0
From: richfaces-svn-commits at lists.jboss.org
To: richfaces-svn-commits at lists.jboss.org
Subject: [richfaces-svn-commits] JBoss Rich Faces SVN: r22090 -
modules/tests/metamer/trunk/application/src/main/webapp/components/richDataScroller.
Date: Wed, 09 Mar 2011 04:24:55 -0500
Message-ID: <201103090924.p299OtTw006707@svn01.web.mwc.hst.phx2.redhat.com>
--===============1674906983867125383==
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable
Author: lfryc(a)redhat.com
Date: 2011-03-09 04:24:55 -0500 (Wed, 09 Mar 2011)
New Revision: 22090
Modified:
modules/tests/metamer/trunk/application/src/main/webapp/components/richD=
ataScroller/simple.xhtml
Log:
fixed nested rendering in data scroller sample
Modified: modules/tests/metamer/trunk/application/src/main/webapp/component=
s/richDataScroller/simple.xhtml
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- modules/tests/metamer/trunk/application/src/main/webapp/components/rich=
DataScroller/simple.xhtml 2011-03-09 09:24:26 UTC (rev 22089)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/rich=
DataScroller/simple.xhtml 2011-03-09 09:24:55 UTC (rev 22090)
@@ -46,7 +46,7 @@
=
-
+
--===============7520456050095321812==
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable
Author: lfryc(a)redhat.com
Date: 2011-03-09 04:25:27 -0500 (Wed, 09 Mar 2011)
New Revision: 22091
Modified:
modules/tests/metamer/trunk/application/src/main/webapp/components/richT=
ree/treeAdaptors.xhtml
Log:
added @for for all outputLabels in tree sample
Modified: modules/tests/metamer/trunk/application/src/main/webapp/component=
s/richTree/treeAdaptors.xhtml
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- modules/tests/metamer/trunk/application/src/main/webapp/components/rich=
Tree/treeAdaptors.xhtml 2011-03-09 09:24:55 UTC (rev 22090)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/rich=
Tree/treeAdaptors.xhtml 2011-03-09 09:25:27 UTC (rev 22091)
@@ -162,22 +162,22 @@
=
-
+
=
-
-
+
+
=
-
+
=
-
+
@@ -185,33 +185,33 @@
=
-
+
=
-
+
=
-
-
-
+
+
+
=
-
+
=
-
+
=
-
-
-
+
+
+
=
-
+
=
-
+
--===============7520456050095321812==--
From richfaces-svn-commits at lists.jboss.org Wed Mar 9 04:26:01 2011
Content-Type: multipart/mixed; boundary="===============3183480036628246811=="
MIME-Version: 1.0
From: richfaces-svn-commits at lists.jboss.org
To: richfaces-svn-commits at lists.jboss.org
Subject: [richfaces-svn-commits] JBoss Rich Faces SVN: r22092 -
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer.
Date: Wed, 09 Mar 2011 04:26:01 -0500
Message-ID: <201103090926.p299Q1x1006944@svn01.web.mwc.hst.phx2.redhat.com>
--===============3183480036628246811==
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable
Author: lfryc(a)redhat.com
Date: 2011-03-09 04:26:00 -0500 (Wed, 09 Mar 2011)
New Revision: 22092
Modified:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/test=
s/metamer/Attribute.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/test=
s/metamer/Extensions.java
Log:
updated Attribute and Extensions with equals, hashCode and toString
Modified: modules/tests/metamer/trunk/application/src/main/java/org/richfac=
es/tests/metamer/Attribute.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tes=
ts/metamer/Attribute.java 2011-03-09 09:25:27 UTC (rev 22091)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tes=
ts/metamer/Attribute.java 2011-03-09 09:26:00 UTC (rev 22092)
@@ -30,8 +30,10 @@
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
=
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.apache.commons.lang.builder.EqualsBuilder;
+import org.apache.commons.lang.builder.HashCodeBuilder;
+import org.apache.commons.lang.builder.ToStringBuilder;
+import org.apache.commons.lang.builder.ToStringStyle;
=
/**
* Representation an attribute of a JSF component.
@@ -41,9 +43,9 @@
*/
@XmlRootElement(name =3D "property", namespace =3D "http://java.sun.com/xm=
l/ns/javaee")
public class Attribute implements Serializable {
-
- private static final long serialVersionUID =3D -6716974687380275186L;
- private Logger logger;
+ =
+ private static final long serialVersionUID =3D 6142493504360646686L;
+ =
private String name;
private Object value;
private Class> type;
@@ -53,11 +55,9 @@
private Extensions extensions;
=
public Attribute() {
- logger =3D LoggerFactory.getLogger(getClass());
}
=
public Attribute(String name) {
- logger =3D LoggerFactory.getLogger(getClass());
this.name =3D name;
}
=
@@ -176,4 +176,19 @@
public boolean isRequired() {
return extensions.getRequired();
}
+ =
+ @Override
+ public boolean equals(Object obj) {
+ return EqualsBuilder.reflectionEquals(this, obj);
+ }
+ =
+ @Override
+ public int hashCode() {
+ return HashCodeBuilder.reflectionHashCode(this, true);
+ }
+ =
+ @Override
+ public String toString() {
+ return ToStringBuilder.reflectionToString(this, ToStringStyle.MULT=
I_LINE_STYLE);
+ }
}
Modified: modules/tests/metamer/trunk/application/src/main/java/org/richfac=
es/tests/metamer/Extensions.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tes=
ts/metamer/Extensions.java 2011-03-09 09:25:27 UTC (rev 22091)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tes=
ts/metamer/Extensions.java 2011-03-09 09:26:00 UTC (rev 22092)
@@ -26,6 +26,11 @@
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
=
+import org.apache.commons.lang.builder.EqualsBuilder;
+import org.apache.commons.lang.builder.HashCodeBuilder;
+import org.apache.commons.lang.builder.ToStringBuilder;
+import org.apache.commons.lang.builder.ToStringStyle;
+
/**
* Representation of CDK extension of a RichFaces component in faces-confi=
g.xml.
* =
@@ -97,4 +102,19 @@
public void setRequired(boolean required) {
this.required =3D required;
}
+ =
+ @Override
+ public boolean equals(Object obj) {
+ return EqualsBuilder.reflectionEquals(this, obj);
+ }
+ =
+ @Override
+ public int hashCode() {
+ return HashCodeBuilder.reflectionHashCode(this, true);
+ }
+ =
+ @Override
+ public String toString() {
+ return ToStringBuilder.reflectionToString(this, ToStringStyle.MULT=
I_LINE_STYLE);
+ }
}
--===============3183480036628246811==--
From richfaces-svn-commits at lists.jboss.org Wed Mar 9 04:27:34 2011
Content-Type: multipart/mixed; boundary="===============2824882190233890457=="
MIME-Version: 1.0
From: richfaces-svn-commits at lists.jboss.org
To: richfaces-svn-commits at lists.jboss.org
Subject: [richfaces-svn-commits] JBoss Rich Faces SVN: r22093 - in
modules/tests/metamer/trunk:
application/src/main/java/org/richfaces/tests/metamer/model/treeAdaptor and 2
other directories.
Date: Wed, 09 Mar 2011 04:27:34 -0500
Message-ID: <201103090927.p299RYu2007084@svn01.web.mwc.hst.phx2.redhat.com>
--===============2824882190233890457==
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable
Author: lfryc(a)redhat.com
Date: 2011-03-09 04:27:32 -0500 (Wed, 09 Mar 2011)
New Revision: 22093
Added:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/test=
s/metamer/model/treeAdaptor/AbstractNode.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/test=
s/metamer/model/treeAdaptor/LazyLoadable.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/test=
s/metamer/model/treeAdaptor/ModelNodeImpl.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/test=
s/metamer/model/treeAdaptor/RecursiveNodeImpl.java
modules/tests/metamer/trunk/application/src/test/java/org/richfaces/test=
s/metamer/TestRichTreeModelRecursiveAdaptorBeanSerialization.java
Removed:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/test=
s/metamer/model/treeAdaptor/LazyLoadingListener.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/test=
s/metamer/model/treeAdaptor/Reference.java
Modified:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/test=
s/metamer/bean/RichTreeModelRecursiveAdaptorBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/test=
s/metamer/model/treeAdaptor/KeyConverter.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/test=
s/metamer/model/treeAdaptor/LazyLoadingChecker.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/test=
s/metamer/model/treeAdaptor/ModelNode.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/test=
s/metamer/model/treeAdaptor/Node.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/test=
s/metamer/model/treeAdaptor/RecursiveNode.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tes=
ts/metamer/ftest/richTreeModelAdaptor/TestTreeModelAdaptorSelection.java
Log:
refactored tree to support serialization (needed for MyFaces) (RF-1224)
Modified: modules/tests/metamer/trunk/application/src/main/java/org/richfac=
es/tests/metamer/bean/RichTreeModelRecursiveAdaptorBean.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tes=
ts/metamer/bean/RichTreeModelRecursiveAdaptorBean.java 2011-03-09 09:26:00 =
UTC (rev 22092)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tes=
ts/metamer/bean/RichTreeModelRecursiveAdaptorBean.java 2011-03-09 09:27:32 =
UTC (rev 22093)
@@ -30,15 +30,15 @@
import java.util.concurrent.atomic.AtomicReference;
=
import javax.annotation.PostConstruct;
+import javax.el.ELContext;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.ViewScoped;
+import javax.faces.context.FacesContext;
=
import org.richfaces.component.UITreeModelRecursiveAdaptor;
import org.richfaces.tests.metamer.Attributes;
-import org.richfaces.tests.metamer.model.treeAdaptor.LazyLoadingListener;
-import org.richfaces.tests.metamer.model.treeAdaptor.Node;
import org.richfaces.tests.metamer.model.treeAdaptor.RecursiveNode;
-import org.richfaces.tests.metamer.model.treeAdaptor.Reference;
+import org.richfaces.tests.metamer.model.treeAdaptor.RecursiveNodeImpl;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
=
@@ -51,7 +51,7 @@
public class RichTreeModelRecursiveAdaptorBean implements Serializable {
=
=
- private static final long serialVersionUID =3D 4008175400649809L;
+ private static final long serialVersionUID =3D 1L;
private static Logger logger;
private static List rootNodes;
=
@@ -64,17 +64,9 @@
/*
* Nodes which was loaded lazily in the current request
*/
- private Set lazyInitializedNodes =3D new LinkedHashSet();
+ private Set lazyInitializedNodes =3D new LinkedHashSet=
();
=
- private LazyLoadingListener nodeLazyLoadingListener =3D new Lazy=
LoadingListener() {
- private static final long serialVersionUID =3D 1L;
-
- public void notify(Node node) {
- lazyInitializedNodes.add(node);
- };
- };
-
- public Set getLazyInitializedNodes() {
+ public Set getLazyInitializedNodes() {
return lazyInitializedNodes;
}
=
@@ -101,16 +93,7 @@
=
public List getRootNodes() {
if (!rootNodesInitialized) {
- rootNodes =3D RecursiveNode.createChildren(null, leafChildrenN=
ullable,
- new Reference>() {
- private static final long serialVersionUID =3D 1L;
-
- @Override
- public LazyLoadingListener get() {
- return nodeLazyLoadingListener;
- }
- });
- rootNodesInitialized =3D true;
+ rootNodes =3D RecursiveNodeImpl.createChildren(true, "", 1, fa=
lse);
}
return rootNodes;
}
@@ -138,4 +121,9 @@
public static List getRootNodesStatically() {
return rootNodes;
}
+ =
+ public static RichTreeModelRecursiveAdaptorBean getFacesContext() {
+ ELContext elContext =3D FacesContext.getCurrentInstance().getELCon=
text();
+ return (RichTreeModelRecursiveAdaptorBean) elContext.getELResolver=
().getValue(elContext, null, "richTreeModelRecursiveAdaptorBean");
+ }
}
Added: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/=
tests/metamer/model/treeAdaptor/AbstractNode.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tes=
ts/metamer/model/treeAdaptor/AbstractNode.java (rev=
0)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tes=
ts/metamer/model/treeAdaptor/AbstractNode.java 2011-03-09 09:27:32 UTC (rev=
22093)
@@ -0,0 +1,81 @@
+/*************************************************************************=
******
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010-2011, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ *************************************************************************=
******/
+package org.richfaces.tests.metamer.model.treeAdaptor;
+
+import java.io.Serializable;
+
+import org.richfaces.tests.metamer.bean.RichTreeModelRecursiveAdaptorBean;
+
+/**
+ * @author Lukas Fryc
+ * @version $Revision$
+ */
+public abstract class AbstractNode implements Serializable, LazyLoadable, =
Node {
+
+ private static final long serialVersionUID =3D 1L;
+
+ private boolean isRoot;
+ private int number;
+ private String parentLabel;
+
+ protected AbstractNode(boolean isRoot, int number, String parentLabel)=
{
+ this.number =3D number;
+ this.parentLabel =3D parentLabel;
+ this.isRoot =3D isRoot;
+ }
+
+ /* (non-Javadoc)
+ * @see org.richfaces.tests.metamer.model.treeAdaptor.INode#isRoot()
+ */
+ @Override
+ public boolean isRoot() {
+ return isRoot;
+ }
+
+ /* (non-Javadoc)
+ * @see org.richfaces.tests.metamer.model.treeAdaptor.INode#getNumber()
+ */
+ @Override
+ public int getNumber() {
+ return number;
+ }
+ =
+ /* (non-Javadoc)
+ * @see org.richfaces.tests.metamer.model.treeAdaptor.INode#getParentL=
abel()
+ */
+ @Override
+ public String getParentLabel() {
+ return parentLabel;
+ }
+
+ /* (non-Javadoc)
+ * @see org.richfaces.tests.metamer.model.treeAdaptor.INode#getLabel()
+ */
+ @Override
+ public abstract String getLabel();
+ =
+ @Override
+ public void notifyLoaded() {
+ RichTreeModelRecursiveAdaptorBean bean =3D RichTreeModelRecursiveA=
daptorBean.getFacesContext();
+ bean.getLazyInitializedNodes().add(this.getLabel());
+ }
+}
Modified: modules/tests/metamer/trunk/application/src/main/java/org/richfac=
es/tests/metamer/model/treeAdaptor/KeyConverter.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tes=
ts/metamer/model/treeAdaptor/KeyConverter.java 2011-03-09 09:26:00 UTC (rev=
22092)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tes=
ts/metamer/model/treeAdaptor/KeyConverter.java 2011-03-09 09:27:32 UTC (rev=
22093)
@@ -66,7 +66,7 @@
break;
=
case 'K':
- for (ModelNode.K key : model.getMap().keySet()) {
+ for (ModelNodeImpl.K key : model.getMap().keySet()=
) {
if (key.number =3D=3D num) {
return key;
}
@@ -85,8 +85,8 @@
}
=
public String getAsString(FacesContext context, UIComponent component,=
Object value) {
- if (value instanceof ModelNode.K) {
- ModelNode.K k =3D (ModelNode.K) value;
+ if (value instanceof ModelNodeImpl.K) {
+ ModelNodeImpl.K k =3D (ModelNodeImpl.K) value;
return k.getLabel();
}
=
Added: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/=
tests/metamer/model/treeAdaptor/LazyLoadable.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tes=
ts/metamer/model/treeAdaptor/LazyLoadable.java (rev=
0)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tes=
ts/metamer/model/treeAdaptor/LazyLoadable.java 2011-03-09 09:27:32 UTC (rev=
22093)
@@ -0,0 +1,38 @@
+/*************************************************************************=
******
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010-2011, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ *************************************************************************=
******/
+package org.richfaces.tests.metamer.model.treeAdaptor;
+
+/**
+ *
+ * Marks that given object can be checked for lazy loading.
+ *
+ * =
+ *
+ * Needs to implement {@link #notifyLoaded()} which performs notification =
about accessing object by external entity.
+ *
+ * =
+ * @author Lukas Fryc
+ * @version $Revision$
+ */
+public interface LazyLoadable {
+ void notifyLoaded();
+}
Modified: modules/tests/metamer/trunk/application/src/main/java/org/richfac=
es/tests/metamer/model/treeAdaptor/LazyLoadingChecker.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tes=
ts/metamer/model/treeAdaptor/LazyLoadingChecker.java 2011-03-09 09:26:00 UT=
C (rev 22092)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tes=
ts/metamer/model/treeAdaptor/LazyLoadingChecker.java 2011-03-09 09:27:32 UT=
C (rev 22093)
@@ -1,3 +1,24 @@
+/*************************************************************************=
******
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010-2011, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ *************************************************************************=
******/
package org.richfaces.tests.metamer.model.treeAdaptor;
=
import static java.lang.reflect.Modifier.isStatic;
@@ -3,52 +24,36 @@
=
import java.io.Serializable;
+import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;
+import java.lang.reflect.Proxy;
=
-import javassist.util.proxy.MethodHandler;
-import javassist.util.proxy.ProxyFactory;
-import javassist.util.proxy.ProxyObject;
+/**
+ *
+ * Wraps {@link LazyLoadable} entity with proxy which performs notificatio=
n by {@link LazyLoadable#notifyLoaded()} to
+ * let know about accessing methods of that wrapped instance.
+ *
+ * =
+ * @author Lukas Fryc
+ * @version $Revision$
+ */
+public final class LazyLoadingChecker implements InvocationHandler, Serializable {
+ private static final long serialVersionUID =3D 1L;
=
-import org.apache.commons.lang.Validate;
-
-public final class LazyLoadingChecker implements MethodHandler, Seriali=
zable {
- private static final long serialVersionUID =3D 1L;
- =
T instance;
- Reference> listenerReference =3D null;
=
- private LazyLoadingChecker(T instance, Reference> listenerReference) {
+ private LazyLoadingChecker(T instance) {
this.instance =3D instance;
- this.listenerReference =3D listenerReference;
}
=
@SuppressWarnings("unchecked")
- public static T wrapInstance(T instance, Reference> listenerReference) {
- Validate.notNull(listenerReference);
- ProxyFactory f =3D new ProxyFactory();
- f.setSuperclass(instance.getClass());
- Class> c =3D f.createClass();
-
- T proxy;
- try {
- proxy =3D (T) c.newInstance();
- } catch (InstantiationException e) {
- throw new IllegalStateException(e);
- } catch (IllegalAccessException e) {
- throw new IllegalStateException(e);
- }
-
- ((ProxyObject) proxy).setHandler(new LazyLoadingChecker(instanc=
e, listenerReference));
- return proxy;
+ public static T wrapInstance(T=
instance) {
+ return (T) Proxy.newProxyInstance(instance.getClass().getClassLoad=
er(), instance.getClass().getInterfaces(),
+ new LazyLoadingChecker(instance));
}
=
@Override
- public Object invoke(Object self, Method m, Method proceed, Object[] a=
rgs) throws Throwable {
+ public Object invoke(Object proxy, Method m, Object[] args) throws Thr=
owable {
if (!isStatic(m.getModifiers())) {
- LazyLoadingListener listener =3D listenerReference.get();
- if (listener !=3D null) {
- listener.notify(instance);
- } else {
- throw new IllegalStateException();
- }
+ instance.notifyLoaded();
}
Object result =3D m.invoke(instance, args);
Deleted: modules/tests/metamer/trunk/application/src/main/java/org/richface=
s/tests/metamer/model/treeAdaptor/LazyLoadingListener.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tes=
ts/metamer/model/treeAdaptor/LazyLoadingListener.java 2011-03-09 09:26:00 U=
TC (rev 22092)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tes=
ts/metamer/model/treeAdaptor/LazyLoadingListener.java 2011-03-09 09:27:32 U=
TC (rev 22093)
@@ -1,7 +0,0 @@
-package org.richfaces.tests.metamer.model.treeAdaptor;
-
-import java.io.Serializable;
-
-public interface LazyLoadingListener extends Serializable {
- void notify(T instance);
-}
Modified: modules/tests/metamer/trunk/application/src/main/java/org/richfac=
es/tests/metamer/model/treeAdaptor/ModelNode.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tes=
ts/metamer/model/treeAdaptor/ModelNode.java 2011-03-09 09:26:00 UTC (rev 22=
092)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tes=
ts/metamer/model/treeAdaptor/ModelNode.java 2011-03-09 09:27:32 UTC (rev 22=
093)
@@ -21,137 +21,24 @@
*************************************************************************=
******/
package org.richfaces.tests.metamer.model.treeAdaptor;
=
-import java.io.Serializable;
-import java.util.LinkedHashMap;
-import java.util.LinkedList;
import java.util.List;
import java.util.Map;
-import java.util.concurrent.atomic.AtomicReference;
=
+import org.richfaces.tests.metamer.model.treeAdaptor.ModelNodeImpl.A;
+import org.richfaces.tests.metamer.model.treeAdaptor.ModelNodeImpl.B;
+import org.richfaces.tests.metamer.model.treeAdaptor.ModelNodeImpl.K;
+import org.richfaces.tests.metamer.model.treeAdaptor.ModelNodeImpl.V;
+
/**
* @author Lukas Fryc
* @version $Revision$
*/
-public class ModelNode extends Node {
- private static final long serialVersionUID =3D 1L;
+public interface ModelNode extends Node {
+ A getValue();
=
- private static final int BS =3D 3;
- private static final int KS =3D 4;
- List bs;
- Map map;
- List rs;
+ List getList();
=
- public ModelNode() {
- super(null, null, null);
- }
+ Map getMap();
=
- protected ModelNode(Node parent, AtomicReference nullable,
- Reference> lazyLoadingListenerReference)=
{
- super(parent, nullable, lazyLoadingListenerReference);
- }
-
- public static ModelNode getInstance(Node parent, AtomicReference nullable,
- Reference> lazyLoadingListenerReference)=
{
- return lazyLoadingChecker(new ModelNode(parent, nullable, lazyLoad=
ingListenerReference));
- }
-
- public String getLabel() {
- return isRoot() ? "M" : getParent().getLabel() + "-M";
- }
-
- public A getValue() {
- return new A();
- }
-
- public List getList() {
- if (bs =3D=3D null) {
- bs =3D new LinkedList();
- for (int i =3D 0; i < BS; i++) {
- bs.add(new B(i));
- }
- }
- return bs;
- }
-
- public Map getMap() {
- if (map =3D=3D null) {
- map =3D new LinkedHashMap();
- for (int i =3D 0; i < KS; i++) {
- map.put(new K(i), new V(i));
- }
- }
- return map;
- }
-
- public List getRecursive() {
- if (rs =3D=3D null) {
- rs =3D RecursiveNode.createChildren(this, getNullable(), null);
- }
- return rs;
- }
-
- public class A implements Serializable {
- private static final long serialVersionUID =3D 1L;
-
- public String getLabel() {
- return ModelNode.this.getLabel() + "-A";
- }
- }
-
- public class B implements Serializable {
- private static final long serialVersionUID =3D 1L;
-
- int number;
-
- public B(int number) {
- this.number =3D number;
- }
-
- public String getLabel() {
- return ModelNode.this.getLabel() + "-B-" + number;
- }
- }
-
- public class K implements Serializable, Comparable {
- private static final long serialVersionUID =3D 1L;
-
- int number;
-
- public K(int number) {
- this.number =3D number;
- }
-
- public String getLabel() {
- return ModelNode.this.getLabel() + "-K-" + number;
- }
- =
- @Override
- public int compareTo(K o) {
- return this.number - o.number;
- }
- =
- @Override
- public String toString() {
- return Integer.toString(number);
- }
- }
-
- public class V implements Serializable {
- private static final long serialVersionUID =3D 1L;
-
- int number;
-
- public V(int number) {
- this.number =3D number;
- }
-
- public String getLabel() {
- return ModelNode.this.getLabel() + "-V-" + number;
- }
- }
-
- @Override
- public String toString() {
- return getLabel();
- }
-}
\ No newline at end of file
+ List getRecursive();
+}
Copied: modules/tests/metamer/trunk/application/src/main/java/org/richfaces=
/tests/metamer/model/treeAdaptor/ModelNodeImpl.java (from rev 22092, module=
s/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer=
/model/treeAdaptor/ModelNode.java)
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tes=
ts/metamer/model/treeAdaptor/ModelNodeImpl.java (re=
v 0)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tes=
ts/metamer/model/treeAdaptor/ModelNodeImpl.java 2011-03-09 09:27:32 UTC (re=
v 22093)
@@ -0,0 +1,217 @@
+/*************************************************************************=
******
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010-2011, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ *************************************************************************=
******/
+package org.richfaces.tests.metamer.model.treeAdaptor;
+
+import java.io.Serializable;
+import java.util.LinkedHashMap;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.commons.lang.builder.EqualsBuilder;
+import org.apache.commons.lang.builder.HashCodeBuilder;
+
+/**
+ * @author Lukas Fryc
+ * @version $Revision$
+ */
+public class ModelNodeImpl extends AbstractNode implements ModelNode {
+ private static final long serialVersionUID =3D 1L;
+
+ private static final int BS =3D 3;
+ private static final int KS =3D 4;
+ List bs;
+ Map map;
+ List rs;
+
+ protected ModelNodeImpl(boolean isRoot, int number, String parentLabel=
) {
+ super(isRoot, number, parentLabel);
+ }
+
+ public static ModelNode getInstance(boolean isRoot, int number, String=
parentLabel) {
+ ModelNodeImpl modelNode =3D new ModelNodeImpl(isRoot, number, pare=
ntLabel);
+ return LazyLoadingChecker.wrapInstance(modelNode);
+ }
+
+ /*
+ * (non-Javadoc)
+ * =
+ * @see org.richfaces.tests.metamer.model.treeAdaptor.IModelNode#getLa=
bel()
+ */
+ @Override
+ public String getLabel() {
+ return isRoot() ? "M" : getParentLabel() + "-M";
+ }
+
+ /*
+ * (non-Javadoc)
+ * =
+ * @see org.richfaces.tests.metamer.model.treeAdaptor.IModelNode#getVa=
lue()
+ */
+ @Override
+ public A getValue() {
+ return new A(getLabel());
+ }
+
+ /*
+ * (non-Javadoc)
+ * =
+ * @see org.richfaces.tests.metamer.model.treeAdaptor.IModelNode#getLi=
st()
+ */
+ @Override
+ public List getList() {
+ if (bs =3D=3D null) {
+ bs =3D new LinkedList();
+ for (int i =3D 0; i < BS; i++) {
+ bs.add(new B(getLabel(), i));
+ }
+ }
+ return bs;
+ }
+
+ /*
+ * (non-Javadoc)
+ * =
+ * @see org.richfaces.tests.metamer.model.treeAdaptor.IModelNode#getMa=
p()
+ */
+ @Override
+ public Map getMap() {
+ if (map =3D=3D null) {
+ map =3D new LinkedHashMap();
+ for (int i =3D 0; i < KS; i++) {
+ map.put(new K(getLabel(), i), new V(getLabel(), i));
+ }
+ }
+ return map;
+ }
+
+ /*
+ * (non-Javadoc)
+ * =
+ * @see org.richfaces.tests.metamer.model.treeAdaptor.IModelNode#getRe=
cursive()
+ */
+ @Override
+ public List getRecursive() {
+ if (rs =3D=3D null) {
+ rs =3D RecursiveNodeImpl.createChildren(false, getLabel(), 1, =
true);
+ }
+ return rs;
+ }
+
+ public static class A implements Serializable {
+ private static final long serialVersionUID =3D 1L;
+
+ String parentLabel;
+
+ public A(String parentLabel) {
+ this.parentLabel =3D parentLabel;
+ }
+
+ public String getLabel() {
+ return parentLabel + "-A";
+ }
+ }
+
+ public static class B implements Serializable {
+ private static final long serialVersionUID =3D 1L;
+
+ int number;
+ String parentLabel;
+ =
+ public B(String parentLabel, int number) {
+ this.parentLabel =3D parentLabel;
+ this.number =3D number;
+ }
+
+ public String getLabel() {
+ return parentLabel + "-B-" + number;
+ }
+ }
+
+ public static class K implements Serializable, Comparable {
+ private static final long serialVersionUID =3D 1L;
+
+ int number;
+ String parentLabel;
+
+ public K(String parentLabel, int number) {
+ this.parentLabel =3D parentLabel;
+ this.number =3D number;
+ }
+
+ public String getLabel() {
+ return parentLabel + "-K-" + number;
+ }
+
+ @Override
+ public int compareTo(K o) {
+ return this.getLabel().compareTo(o.getLabel());
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (obj =3D=3D null) {
+ return false;
+ }
+ if (obj =3D=3D this) {
+ return true;
+ }
+ if (obj.getClass() !=3D getClass()) {
+ return false;
+ }
+ K rhs =3D (K) obj;
+ return new EqualsBuilder().append(getLabel(), rhs.getLabel()).=
isEquals();
+ }
+
+ @Override
+ public int hashCode() {
+ return new HashCodeBuilder(17, 37).append(getLabel()).toHashCo=
de();
+
+ }
+
+ @Override
+ public String toString() {
+ return Integer.toString(number);
+ }
+ }
+
+ public static class V implements Serializable {
+ private static final long serialVersionUID =3D 1L;
+
+ int number;
+ String parentLabel;
+
+ public V(String parentLabel, int number) {
+ this.parentLabel =3D parentLabel;
+ this.number =3D number;
+ }
+
+ public String getLabel() {
+ return parentLabel + "-V-" + number;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getLabel();
+ }
+}
\ No newline at end of file
Modified: modules/tests/metamer/trunk/application/src/main/java/org/richfac=
es/tests/metamer/model/treeAdaptor/Node.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tes=
ts/metamer/model/treeAdaptor/Node.java 2011-03-09 09:26:00 UTC (rev 22092)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tes=
ts/metamer/model/treeAdaptor/Node.java 2011-03-09 09:27:32 UTC (rev 22093)
@@ -21,85 +21,18 @@
*************************************************************************=
******/
package org.richfaces.tests.metamer.model.treeAdaptor;
=
-import java.io.Serializable;
-import java.util.Deque;
-import java.util.LinkedList;
-import java.util.concurrent.atomic.AtomicReference;
-
/**
* @author Lukas Fryc
* @version $Revision$
*/
-public abstract class Node implements Serializable {
- =
- private static final long serialVersionUID =3D 1L;
- =
- private Node parent;
- private AtomicReference nullable;
- private Reference> lazyLoadingListenerRefere=
nce =3D new NodeReference();
+public interface Node {
=
- protected Node(Node parent, AtomicReference nullable,
- Reference> lazyLoadingListenerReference)=
{
- this.parent =3D parent;
- this.nullable =3D nullable;
- if (lazyLoadingListenerReference !=3D null) {
- this.lazyLoadingListenerReference =3D lazyLoadingListenerRefer=
ence;
- }
- }
+ public abstract boolean isRoot();
=
- public static T lazyLoadingChecker(T node) {
- return (T) LazyLoadingChecker.wrapInstance(node, node.getLazyLoadi=
ngListenerReference());
- }
+ public abstract int getNumber();
=
- public Node getParent() {
- return parent;
- }
+ public abstract String getParentLabel();
=
- public boolean isRoot() {
- return parent =3D=3D null;
- }
- =
- public AtomicReference getNullable() {
- return nullable;
- }
-
- public int getLevel() {
- return isRoot() ? 1 : parent.getLevel() + 1;
- }
-
- public Node getRoot() {
- return isRoot() ? this : parent.getRoot();
- }
-
- public Iterable getPredecessorsFromRoot() {
- Deque list =3D new LinkedList();
- list.addFirst(this);
-
- while (list.getFirst().parent !=3D null) {
- list.addFirst(list.getFirst().parent);
- }
-
- return list;
- }
-
public abstract String getLabel();
=
- public Reference> getLazyLoadingListenerRefe=
rence() {
- return lazyLoadingListenerReference;
- }
-
- public void setLazyLoadingListener(Reference=
> lazyLoadingListener) {
- this.lazyLoadingListenerReference =3D lazyLoadingListener;
- }
-
- public class NodeReference implements Reference> {
- @Override
- public LazyLoadingListener get() {
- Node root =3D getRoot();
- if (root =3D=3D Node.this) {
- return null;
- }
- return getRoot().getLazyLoadingListenerReference().get();
- }
- }
-}
+}
\ No newline at end of file
Modified: modules/tests/metamer/trunk/application/src/main/java/org/richfac=
es/tests/metamer/model/treeAdaptor/RecursiveNode.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tes=
ts/metamer/model/treeAdaptor/RecursiveNode.java 2011-03-09 09:26:00 UTC (re=
v 22092)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tes=
ts/metamer/model/treeAdaptor/RecursiveNode.java 2011-03-09 09:27:32 UTC (re=
v 22093)
@@ -21,244 +21,23 @@
*************************************************************************=
******/
package org.richfaces.tests.metamer.model.treeAdaptor;
=
-import java.io.Serializable;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.LinkedList;
import java.util.List;
import java.util.Map;
-import java.util.Set;
-import java.util.concurrent.atomic.AtomicReference;
=
/**
* @author Lukas Fryc
* @version $Revision$
*/
-public class RecursiveNode extends Node {
- private static final long serialVersionUID =3D 1L;
- =
- private static final int CHILDREN =3D 4;
- private static final int LEVELS =3D 2;
- private static final List EMPTY_LIST =3D new LinkedList=
();
- private static final Map EMPTY_MAP =3D new Has=
hMap();
+public interface RecursiveNode extends Node {
=
- int number;
- List children =3D null;
- NodeMap nodeMap =3D new NodeMap();
- ModelNode model;
+ public abstract ModelNode getModel();
=
- public RecursiveNode() {
- super(null, null, null);
- }
+ public abstract boolean isLeaf();
=
- protected RecursiveNode(Node parent, AtomicReference nullable=
, int number,
- Reference> lazyLoadingListenerReference)=
{
- super(parent, nullable, lazyLoadingListenerReference);
- this.number =3D number;
- }
+ public abstract List getRecursiveList();
=
- public static RecursiveNode getInstance(Node parent, AtomicReference nullable, int number,
- Reference> lazyLoadingListenerReference)=
{
- return lazyLoadingChecker(new RecursiveNode(parent, nullable, numb=
er, lazyLoadingListenerReference));
- }
+ public abstract Map getRecursiveMap();
=
- public int getNumber() {
- return number;
- }
+ public abstract int getRecursionLevel();
=
- public boolean isLeaf() {
- return getRecursionLevel() >=3D LEVELS + (isOddBranch() ? 0 : 1);
- }
-
- public List getRecursiveList() {
- if (isLeaf()) {
- return getEmptyList();
- }
- if (children =3D=3D null) {
- children =3D createChildren(this, getNullable(), null);
- }
- return children;
- }
-
- public Map getRecursiveMap() {
- if (isLeaf()) {
- return getEmptyMap();
- }
- return nodeMap;
- }
-
- private List getEmptyList() {
- return getNullable().get() ? null : EMPTY_LIST;
- }
-
- private Map getEmptyMap() {
- return getNullable().get() ? null : EMPTY_MAP;
- }
-
- public String getLabel() {
- String parentLabel =3D (isRoot() ? "" : getParent().getLabel() + "=
-") + "R-";
- String recursionLabel =3D (isRecursionRoot() ? parentLabel : getPa=
rent().getLabel() + ".") + number;
- return recursionLabel;
- }
-
- public ModelNode getModel() {
- if (isLeaf() && !isPreceededByModel()) {
- if (model =3D=3D null) {
- model =3D ModelNode.getInstance(this, getNullable(), null);
- }
- return model;
- }
- return null;
- }
-
- public int getRecursionLevel() {
- return isRecursionRoot() ? 1 : 1 + ((RecursiveNode) getParent()).g=
etRecursionLevel();
- }
-
- private boolean isRecursionRoot() {
- if (isRoot()) {
- return true;
- } else {
- return !(getParent() instanceof RecursiveNode);
- }
- }
-
- public static List createChildren(Node parent, AtomicRe=
ference nullable,
- Reference> lazyLoadingListenerReference)=
{
- List children =3D new LinkedList();
- for (int i =3D 0; i < CHILDREN; i++) {
- RecursiveNode node =3D RecursiveNode.getInstance(parent, nulla=
ble, i, lazyLoadingListenerReference);
- children.add(node);
- }
- return children;
- }
-
- private boolean isPreceededByModel() {
- for (Node predecessor : getPredecessorsFromRoot()) {
- if (predecessor instanceof ModelNode) {
- return true;
- }
- }
- return false;
- }
-
- private boolean isOddBranch() {
- for (Node predecessor : getPredecessorsFromRoot()) {
- if (predecessor instanceof RecursiveNode) {
- return ((RecursiveNode) predecessor).number % 2 =3D=3D 1;
- }
- }
- return this.number % 2 =3D=3D 1;
- }
-
- @Override
- public String toString() {
- return getLabel();
- }
-
- public class NodeMap implements Map, Serializa=
ble {
- =
- private static final long serialVersionUID =3D 1L;
-
- @Override
- public int size() {
- return getRecursiveList().size();
- }
-
- @Override
- public boolean isEmpty() {
- return getRecursiveList().isEmpty();
- }
-
- @Override
- public boolean containsKey(Object key) {
- throw new UnsupportedOperationException("not implemented");
- }
-
- @Override
- public boolean containsValue(Object value) {
- throw new UnsupportedOperationException("not implemented");
- }
-
- @Override
- public RecursiveNode get(Object key) {
- if (key instanceof Integer) {
- return getRecursiveList().get((Integer) key);
- }
- throw new IllegalStateException("there is no value for the key=
'" + key + "' (type "
- + key.getClass().getName() + ")");
- }
-
- @Override
- public RecursiveNode put(Integer key, RecursiveNode value) {
- throw new UnsupportedOperationException("not supported");
- }
-
- @Override
- public RecursiveNode remove(Object key) {
- throw new UnsupportedOperationException("not supported");
- }
-
- @Override
- public void putAll(Map extends Integer, ? extends RecursiveNode>=
m) {
- throw new UnsupportedOperationException("not supported");
- }
-
- @Override
- public void clear() {
- throw new UnsupportedOperationException("not supported");
- }
-
- @Override
- public Set keySet() {
- HashSet set =3D new HashSet();
- for (int i =3D 0; i < getRecursiveList().size(); i++) {
- set.add(i);
- }
- return set;
- }
-
- @Override
- public Collection values() {
- return getRecursiveList();
- }
-
- @Override
- public Set> entrySet()=
{
- HashSet> set =3D new HashSet=
>();
- int i =3D 0;
- for (RecursiveNode node : getRecursiveList()) {
- set.add(new MapEntry(i++, node));
- }
- return set;
- }
-
- }
-
- public class MapEntry implements Map.Entry {
-
- int key;
- RecursiveNode node;
-
- public MapEntry(int key, RecursiveNode node) {
- this.key =3D key;
- this.node =3D node;
- }
-
- @Override
- public Integer getKey() {
- return key;
- }
-
- @Override
- public RecursiveNode getValue() {
- return node;
- }
-
- @Override
- public RecursiveNode setValue(RecursiveNode value) {
- throw new UnsupportedOperationException("not supported");
- }
- }
}
\ No newline at end of file
Copied: modules/tests/metamer/trunk/application/src/main/java/org/richfaces=
/tests/metamer/model/treeAdaptor/RecursiveNodeImpl.java (from rev 22092, mo=
dules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/met=
amer/model/treeAdaptor/RecursiveNode.java)
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tes=
ts/metamer/model/treeAdaptor/RecursiveNodeImpl.java =
(rev 0)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tes=
ts/metamer/model/treeAdaptor/RecursiveNodeImpl.java 2011-03-09 09:27:32 UTC=
(rev 22093)
@@ -0,0 +1,264 @@
+/*************************************************************************=
******
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010-2011, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ *************************************************************************=
******/
+package org.richfaces.tests.metamer.model.treeAdaptor;
+
+import java.io.Serializable;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import org.richfaces.tests.metamer.bean.RichTreeModelRecursiveAdaptorBean;
+
+/**
+ * @author Lukas Fryc
+ * @version $Revision$
+ */
+public class RecursiveNodeImpl extends AbstractNode implements RecursiveNo=
de {
+ private static final long serialVersionUID =3D 1L;
+
+ private static final int CHILDREN =3D 4;
+ private static final int LEVELS =3D 2;
+ private static final List EMPTY_LIST =3D new LinkedList=
();
+ private static final Map EMPTY_MAP =3D new Has=
hMap();
+
+ int recursionLevel;
+ boolean oddBranch;
+ List children =3D null;
+ NodeMap nodeMap =3D new NodeMap();
+ ModelNode model;
+
+ protected RecursiveNodeImpl(boolean isRoot, int number, String parentL=
abel, int recursionLevel, boolean oddBranch) {
+ super(isRoot, number, parentLabel);
+ this.recursionLevel =3D recursionLevel;
+ this.oddBranch =3D oddBranch;
+ }
+
+ public static RecursiveNode getInstance(boolean isRoot, int number, St=
ring parentLabel, int recursionLevel, boolean oddBranch) {
+ RecursiveNodeImpl recursiveNode =3D new RecursiveNodeImpl(isRoot, =
number, parentLabel, recursionLevel, oddBranch);
+ return LazyLoadingChecker.wrapInstance(recursiveNode);
+ }
+
+ public static List createChildren(boolean createRoots, =
String parentLabel, int recursionLevel, boolean preferedOddBranch) {
+ List children =3D new LinkedList();
+ for (int i =3D 0; i < CHILDREN; i++) {
+ boolean oddBranch =3D preferedOddBranch;
+ if (createRoots) {
+ oddBranch =3D i % 2 =3D=3D 1;
+ }
+ RecursiveNode node =3D RecursiveNodeImpl.getInstance(createRoo=
ts, i, parentLabel, recursionLevel, oddBranch);
+ children.add(node);
+ }
+ return children;
+ }
+
+ /* (non-Javadoc)
+ * @see org.richfaces.tests.metamer.model.treeAdaptor.IRecursiveNode#g=
etModel()
+ */
+ @Override
+ public ModelNode getModel() {
+ if (isLeaf() && model =3D=3D null) {
+ model =3D ModelNodeImpl.getInstance(false, 1, getLabel());
+ }
+ return model;
+ }
+
+ /* (non-Javadoc)
+ * @see org.richfaces.tests.metamer.model.treeAdaptor.IRecursiveNode#i=
sLeaf()
+ */
+ @Override
+ public boolean isLeaf() {
+ return getRecursionLevel() >=3D LEVELS + (oddBranch ? 0 : 1);
+ }
+
+ /* (non-Javadoc)
+ * @see org.richfaces.tests.metamer.model.treeAdaptor.IRecursiveNode#g=
etRecursiveList()
+ */
+ @Override
+ public List getRecursiveList() {
+ if (isLeaf()) {
+ return getEmptyList();
+ }
+ if (children =3D=3D null) {
+ children =3D createChildren(false, getLabel(), recursionLevel =
+ 1, this.oddBranch);
+ }
+ return children;
+ }
+
+ /* (non-Javadoc)
+ * @see org.richfaces.tests.metamer.model.treeAdaptor.IRecursiveNode#g=
etRecursiveMap()
+ */
+ @Override
+ public Map getRecursiveMap() {
+ if (isLeaf()) {
+ return getEmptyMap();
+ }
+ return nodeMap;
+ }
+
+ private List getEmptyList() {
+ return isNullable() ? null : EMPTY_LIST;
+ }
+
+ private Map getEmptyMap() {
+ return isNullable() ? null : EMPTY_MAP;
+ }
+
+ private boolean isNullable() {
+ return RichTreeModelRecursiveAdaptorBean.getFacesContext().isLeafC=
hildrenNullable();
+ }
+
+ /* (non-Javadoc)
+ * @see org.richfaces.tests.metamer.model.treeAdaptor.IRecursiveNode#g=
etLabel()
+ */
+ @Override
+ public String getLabel() {
+ String parentLabel =3D (isRoot() ? "" : getParentLabel() + "-") + =
"R-";
+ String recursionLabel =3D (isRecursionRoot() ? parentLabel : getPa=
rentLabel() + ".") + getNumber();
+ return recursionLabel;
+ }
+
+ /* (non-Javadoc)
+ * @see org.richfaces.tests.metamer.model.treeAdaptor.IRecursiveNode#g=
etRecursionLevel()
+ */
+ @Override
+ public int getRecursionLevel() {
+ return recursionLevel;
+ }
+
+ private boolean isRecursionRoot() {
+ return recursionLevel =3D=3D 1;
+ }
+
+ @Override
+ public String toString() {
+ return getLabel();
+ }
+
+ public class NodeMap implements Map, Serializa=
ble {
+
+ private static final long serialVersionUID =3D 1L;
+
+ @Override
+ public int size() {
+ return getRecursiveList().size();
+ }
+
+ @Override
+ public boolean isEmpty() {
+ return getRecursiveList().isEmpty();
+ }
+
+ @Override
+ public boolean containsKey(Object key) {
+ throw new UnsupportedOperationException("not implemented");
+ }
+
+ @Override
+ public boolean containsValue(Object value) {
+ throw new UnsupportedOperationException("not implemented");
+ }
+
+ @Override
+ public RecursiveNode get(Object key) {
+ if (key instanceof Integer) {
+ return getRecursiveList().get((Integer) key);
+ }
+ throw new IllegalStateException("there is no value for the key=
'" + key + "' (type "
+ + key.getClass().getName() + ")");
+ }
+
+ @Override
+ public RecursiveNode put(Integer key, RecursiveNode value) {
+ throw new UnsupportedOperationException("not supported");
+ }
+
+ @Override
+ public RecursiveNode remove(Object key) {
+ throw new UnsupportedOperationException("not supported");
+ }
+
+ @Override
+ public void putAll(Map extends Integer, ? extends RecursiveNode>=
m) {
+ throw new UnsupportedOperationException("not supported");
+ }
+
+ @Override
+ public void clear() {
+ throw new UnsupportedOperationException("not supported");
+ }
+
+ @Override
+ public Set keySet() {
+ HashSet set =3D new HashSet();
+ for (int i =3D 0; i < getRecursiveList().size(); i++) {
+ set.add(i);
+ }
+ return set;
+ }
+
+ @Override
+ public Collection values() {
+ return getRecursiveList();
+ }
+
+ @Override
+ public Set> entrySet()=
{
+ HashSet> set =3D new HashSet=
>();
+ int i =3D 0;
+ for (RecursiveNode node : getRecursiveList()) {
+ set.add(new MapEntry(i++, node));
+ }
+ return set;
+ }
+
+ }
+
+ public class MapEntry implements Map.Entry {
+
+ int key;
+ RecursiveNode node;
+
+ public MapEntry(int key, RecursiveNode node) {
+ this.key =3D key;
+ this.node =3D node;
+ }
+
+ @Override
+ public Integer getKey() {
+ return key;
+ }
+
+ @Override
+ public RecursiveNode getValue() {
+ return node;
+ }
+
+ @Override
+ public RecursiveNode setValue(RecursiveNode value) {
+ throw new UnsupportedOperationException("not supported");
+ }
+ }
+}
\ No newline at end of file
Deleted: modules/tests/metamer/trunk/application/src/main/java/org/richface=
s/tests/metamer/model/treeAdaptor/Reference.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tes=
ts/metamer/model/treeAdaptor/Reference.java 2011-03-09 09:26:00 UTC (rev 22=
092)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tes=
ts/metamer/model/treeAdaptor/Reference.java 2011-03-09 09:27:32 UTC (rev 22=
093)
@@ -1,8 +0,0 @@
-package org.richfaces.tests.metamer.model.treeAdaptor;
-
-import java.io.Serializable;
-
-public interface Reference extends Serializable {
- =
- public T get();
-}
Added: modules/tests/metamer/trunk/application/src/test/java/org/richfaces/=
tests/metamer/TestRichTreeModelRecursiveAdaptorBeanSerialization.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- modules/tests/metamer/trunk/application/src/test/java/org/richfaces/tes=
ts/metamer/TestRichTreeModelRecursiveAdaptorBeanSerialization.java =
(rev 0)
+++ modules/tests/metamer/trunk/application/src/test/java/org/richfaces/tes=
ts/metamer/TestRichTreeModelRecursiveAdaptorBeanSerialization.java 2011-03-=
09 09:27:32 UTC (rev 22093)
@@ -0,0 +1,170 @@
+/*************************************************************************=
******
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010-2011, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ *************************************************************************=
******/
+package org.richfaces.tests.metamer;
+
+import static org.testng.Assert.assertEquals;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.io.PrintStream;
+import java.lang.reflect.Field;
+import java.lang.reflect.Modifier;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Comparator;
+import java.util.Map;
+import java.util.Set;
+import java.util.TreeSet;
+
+import org.richfaces.tests.metamer.bean.RichTreeModelRecursiveAdaptorBean;
+import org.testng.annotations.AfterClass;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.Test;
+
+import com.google.common.io.NullOutputStream;
+
+/**
+ * @author Lukas Fryc
+ * @version $Revision$
+ */
+public class TestRichTreeModelRecursiveAdaptorBeanSerialization {
+
+ private Set notEquals =3D new TreeSet();
+
+ PrintStream sysout;
+
+ @BeforeClass
+ public void redirectOut() {
+ sysout =3D System.out;
+ System.setOut(new PrintStream(new NullOutputStream()));
+ }
+
+ @AfterClass(alwaysRun =3D true)
+ public void returnOut() {
+ System.setOut(sysout);
+ }
+
+ @Test
+ public void testBeanSerialization() throws IOException, ClassNotFoundE=
xception, IllegalArgumentException,
+ IllegalAccessException {
+
+ RichTreeModelRecursiveAdaptorBean bean =3D new RichTreeModelRecurs=
iveAdaptorBean();
+ bean.init();
+
+ Object obj1 =3D bean;
+
+ ByteArrayOutputStream byteArrayOutputStream =3D new ByteArrayOutpu=
tStream();
+ ObjectOutputStream outputStream =3D new ObjectOutputStream(byteArr=
ayOutputStream);
+ outputStream.writeObject(obj1);
+
+ byte[] bytes =3D byteArrayOutputStream.toByteArray();
+
+ ObjectInputStream inputStream =3D new ObjectInputStream(new ByteAr=
rayInputStream(bytes));
+ Object obj2 =3D inputStream.readObject();
+
+ verifyEqualsDeeply(obj1, obj2);
+ }
+
+ public void verifyEqualsDeeply(Object obj1, Object obj2) throws Illega=
lArgumentException, IllegalAccessException {
+
+ if (obj1 =3D=3D null) {
+ if (obj2 =3D=3D null) {
+ return;
+ }
+ throw new AssertionError("obj1 is null, but obj2 is not null");
+ }
+
+ Class> classO =3D obj1.getClass();
+ assertEquals(obj2.getClass(), classO, "Both objects should be inst=
ances of the same class");
+
+ if (obj1.equals(obj2)) {
+ return;
+ }
+
+ int hash =3D cohash(obj1, obj2);
+ if (notEquals.contains(hash)) {
+ return;
+ }
+
+ notEquals.add(hash);
+
+ if (Collection.class.isAssignableFrom(classO)) {
+ Collection> col1 =3D (Collection>) obj1;
+ Collection> col2 =3D (Collection>) obj2;
+ assertEquals(col1.toArray(new Object[col1.size()]), col2.toArr=
ay(new Object[col2.size()]));
+ } else if (Map.class.isAssignableFrom(classO)) {
+ Map map1 =3D (Map) obj1;
+ Map map2 =3D (Map) obj2;
+
+ Object[] array1 =3D map1.keySet().toArray(new Object[map1.size=
()]);
+ Arrays.sort(array1, new HashCodeComparator());
+
+ Object[] array2 =3D map2.keySet().toArray(new Object[map2.size=
()]);
+ Arrays.sort(array2, new HashCodeComparator());
+
+ assertEquals(array1, array2);
+
+ array1 =3D map1.values().toArray(new Object[map1.size()]);
+ Arrays.sort(array1, new HashCodeComparator());
+
+ array2 =3D map2.values().toArray(new Object[map2.size()]);
+ Arrays.sort(array2, new HashCodeComparator());
+
+ assertEquals(array1, array2);
+ } else {
+ for (Field field : classO.getDeclaredFields()) {
+
+ if (Modifier.isStatic(field.getModifiers())) {
+ continue;
+ }
+ if (Modifier.isTransient(field.getModifiers())) {
+ continue;
+ }
+
+ boolean accessible =3D field.isAccessible();
+ if (!accessible) {
+ field.setAccessible(true);
+ }
+ Object nObj1 =3D field.get(obj1);
+ Object nObj2 =3D field.get(obj2);
+ if (!accessible) {
+ field.setAccessible(false);
+ }
+ verifyEqualsDeeply(nObj1, nObj2);
+ }
+ }
+ }
+
+ public int cohash(Object obj1, Object obj2) {
+ return 17 * obj1.hashCode() * obj2.hashCode() + obj2.hashCode() + =
11;
+ }
+
+ public class HashCodeComparator implements Comparator {
+ @Override
+ public int compare(Object o1, Object o2) {
+ return o1.hashCode() - o2.hashCode();
+ }
+ }
+}
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfa=
ces/tests/metamer/ftest/richTreeModelAdaptor/TestTreeModelAdaptorSelection.=
java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/te=
sts/metamer/ftest/richTreeModelAdaptor/TestTreeModelAdaptorSelection.java 2=
011-03-09 09:26:00 UTC (rev 22092)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/te=
sts/metamer/ftest/richTreeModelAdaptor/TestTreeModelAdaptorSelection.java 2=
011-03-09 09:27:32 UTC (rev 22093)
@@ -51,7 +51,7 @@
PathsCrate pathsForListModel =3D new PathsCrate("listModel", new Integ=
er[][] { { 2, 1, 3 }, { 3, 3, 2, 2 } });
PathsCrate pathsForMapModel =3D new PathsCrate("mapModel", new Integer=
[][] { { 2, 1, 5 }, { 3, 3, 2, 6 } });
PathsCrate pathsForRecursiveModel =3D new PathsCrate("recursiveModel",=
new Integer[][] { { 4, 1, 10, 2 },
- { 1, 4, 3, 11, 4, 1 } });
+ { 1, 4, 3, 11, 4 } });
=
@Inject
@Use(enumeration =3D true)
--===============2824882190233890457==--
From richfaces-svn-commits at lists.jboss.org Wed Mar 9 05:15:04 2011
Content-Type: multipart/mixed; boundary="===============5130392510021773758=="
MIME-Version: 1.0
From: richfaces-svn-commits at lists.jboss.org
To: richfaces-svn-commits at lists.jboss.org
Subject: [richfaces-svn-commits] JBoss Rich Faces SVN: r22094 - in
modules/tests/metamer/trunk/application/src/main:
java/org/richfaces/tests/metamer/bean and 4 other directories.
Date: Wed, 09 Mar 2011 05:15:03 -0500
Message-ID: <201103091015.p29AF3IN017535@svn01.web.mwc.hst.phx2.redhat.com>
--===============5130392510021773758==
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable
Author: ppitonak(a)redhat.com
Date: 2011-03-09 05:15:02 -0500 (Wed, 09 Mar 2011)
New Revision: 22094
Added:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/test=
s/metamer/bean/RichValidatorBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/test=
s/metamer/converter/
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/test=
s/metamer/converter/EmptyStringToNullConverter.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/test=
s/metamer/validation/
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/test=
s/metamer/validation/AssertFalseBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/test=
s/metamer/validation/AssertTrueBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/test=
s/metamer/validation/DecimalMinMaxBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/test=
s/metamer/validation/DigitsBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/test=
s/metamer/validation/FutureBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/test=
s/metamer/validation/MaxBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/test=
s/metamer/validation/MinBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/test=
s/metamer/validation/MinMaxBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/test=
s/metamer/validation/NotEmptyBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/test=
s/metamer/validation/NotNullBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/test=
s/metamer/validation/PastBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/test=
s/metamer/validation/PatternBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/test=
s/metamer/validation/SizeBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/test=
s/metamer/validation/Validable.java
modules/tests/metamer/trunk/application/src/main/webapp/components/richV=
alidator/
modules/tests/metamer/trunk/application/src/main/webapp/components/richV=
alidator/csv.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/components/richV=
alidator/jsr303.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/components/richV=
alidator/list.xhtml
Modified:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/test=
s/metamer/bean/RichBean.java
Log:
added 2 pages for testing validation
Modified: modules/tests/metamer/trunk/application/src/main/java/org/richfac=
es/tests/metamer/bean/RichBean.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tes=
ts/metamer/bean/RichBean.java 2011-03-09 09:27:32 UTC (rev 22093)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tes=
ts/metamer/bean/RichBean.java 2011-03-09 10:15:02 UTC (rev 22094)
@@ -161,6 +161,7 @@
components.put("richToolbarGroup", "Rich Toolbar Group");
components.put("richTooltip", "Rich Tooltip");
components.put("richTree", "Rich Tree");
+ components.put("richValidator", "Rich Validator");
}
=
private void createSkinList() {
Added: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/=
tests/metamer/bean/RichValidatorBean.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tes=
ts/metamer/bean/RichValidatorBean.java (rev 0)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tes=
ts/metamer/bean/RichValidatorBean.java 2011-03-09 10:15:02 UTC (rev 22094)
@@ -0,0 +1,68 @@
+/*************************************************************************=
******
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010-2011, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ *************************************************************************=
******/
+package org.richfaces.tests.metamer.bean;
+
+import java.io.Serializable;
+
+import javax.annotation.PostConstruct;
+import javax.faces.bean.ManagedBean;
+import javax.faces.bean.ViewScoped;
+
+import org.richfaces.component.behavior.ClientValidatorImpl;
+import org.richfaces.tests.metamer.Attributes;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Managed bean for rich:validator.
+ *
+ * @author Pavol Pitonak
+ * @version $Revision$
+ */
+(a)ManagedBean(name =3D "richValidatorBean")
+(a)ViewScoped
+public class RichValidatorBean implements Serializable {
+
+ private static final long serialVersionUID =3D -1L;
+ private static Logger logger;
+ private Attributes attributes;
+
+ /**
+ * Initializes the managed bean.
+ */
+ @PostConstruct
+ public void init() {
+ logger =3D LoggerFactory.getLogger(getClass());
+ logger.debug("initializing bean " + getClass().getName());
+
+ attributes =3D Attributes.getBehaviorAttributesFromFacesConfig(Cli=
entValidatorImpl.class, getClass());
+ }
+
+ public Attributes getAttributes() {
+ return attributes;
+ }
+
+ public void setAttributes(Attributes attributes) {
+ this.attributes =3D attributes;
+ }
+
+}
Added: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/=
tests/metamer/converter/EmptyStringToNullConverter.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tes=
ts/metamer/converter/EmptyStringToNullConverter.java =
(rev 0)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tes=
ts/metamer/converter/EmptyStringToNullConverter.java 2011-03-09 10:15:02 UT=
C (rev 22094)
@@ -0,0 +1,59 @@
+/*************************************************************************=
******
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010-2011, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ *************************************************************************=
******/
+package org.richfaces.tests.metamer.converter;
+
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.convert.Converter;
+import javax.faces.convert.FacesConverter;
+
+/**
+ * Converter used for converting empty strings to null.
+ * =
+ * @author Pavol Pitonak
+ * @version $Revision$
+ */
+(a)FacesConverter(value =3D "emptyStringToNullConverter")
+public class EmptyStringToNullConverter implements Converter {
+
+ /**
+ * {@inheritDoc}
+ */
+ public Object getAsObject(FacesContext context, UIComponent component,=
String value) {
+ if (value.isEmpty()) {
+ return null;
+ } else {
+ return value;
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public String getAsString(FacesContext context, UIComponent component,=
Object value) {
+ if (value =3D=3D null) {
+ return "";
+ }
+
+ return value.toString();
+ }
+}
Added: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/=
tests/metamer/validation/AssertFalseBean.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tes=
ts/metamer/validation/AssertFalseBean.java (rev 0)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tes=
ts/metamer/validation/AssertFalseBean.java 2011-03-09 10:15:02 UTC (rev 220=
94)
@@ -0,0 +1,60 @@
+/*************************************************************************=
******
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010-2011, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ *************************************************************************=
******/
+package org.richfaces.tests.metamer.validation;
+
+import javax.faces.bean.ManagedBean;
+import javax.validation.constraints.AssertFalse;
+
+/**
+ * Helper bean for testing JSR-303.
+ *
+ * @author asmirnov, Pavol Pitona=
k
+ * @version $Revision$
+ */
+(a)ManagedBean
+public class AssertFalseBean extends Validable {
+
+ public AssertFalseBean() {
+ value =3D false;
+ }
+
+ @AssertFalse
+ @Override
+ public Boolean getValue() {
+ return value;
+ }
+
+ @Override
+ public void setValue(Boolean intValue) {
+ this.value =3D intValue;
+ }
+
+ @Override
+ public String getDescription() {
+ return "Boolean, false";
+ }
+
+ @Override
+ public String getLabel() {
+ return "assertFalse";
+ }
+}
Added: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/=
tests/metamer/validation/AssertTrueBean.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tes=
ts/metamer/validation/AssertTrueBean.java (rev 0)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tes=
ts/metamer/validation/AssertTrueBean.java 2011-03-09 10:15:02 UTC (rev 2209=
4)
@@ -0,0 +1,60 @@
+/*************************************************************************=
******
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010-2011, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ *************************************************************************=
******/
+package org.richfaces.tests.metamer.validation;
+
+import javax.faces.bean.ManagedBean;
+import javax.validation.constraints.AssertTrue;
+
+/**
+ * Helper bean for testing JSR-303.
+ *
+ * @author asmirnov, Pavol Pitona=
k
+ * @version $Revision$
+ */
+(a)ManagedBean
+public class AssertTrueBean extends Validable {
+
+ public AssertTrueBean() {
+ value =3D true;
+ }
+
+ @AssertTrue
+ @Override
+ public Boolean getValue() {
+ return value;
+ }
+
+ @Override
+ public void setValue(Boolean intValue) {
+ this.value =3D intValue;
+ }
+
+ @Override
+ public String getDescription() {
+ return "Boolean, true";
+ }
+
+ @Override
+ public String getLabel() {
+ return "assertTrue";
+ }
+}
Added: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/=
tests/metamer/validation/DecimalMinMaxBean.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tes=
ts/metamer/validation/DecimalMinMaxBean.java (rev 0)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tes=
ts/metamer/validation/DecimalMinMaxBean.java 2011-03-09 10:15:02 UTC (rev 2=
2094)
@@ -0,0 +1,63 @@
+/*************************************************************************=
******
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010-2011, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ *************************************************************************=
******/
+package org.richfaces.tests.metamer.validation;
+
+import java.math.BigDecimal;
+import javax.faces.bean.ManagedBean;
+import javax.validation.constraints.DecimalMax;
+import javax.validation.constraints.DecimalMin;
+
+/**
+ * Helper bean for testing JSR-303.
+ *
+ * @author Pavol Pitonak
+ * @version $Revision$
+ */
+(a)ManagedBean
+public class DecimalMinMaxBean extends Validable {
+
+ public DecimalMinMaxBean() {
+ value =3D new BigDecimal(3);
+ }
+
+ @DecimalMin("2.5")
+ @DecimalMax("9.688")
+ @Override
+ public BigDecimal getValue() {
+ return value;
+ }
+
+ @Override
+ public void setValue(BigDecimal intValue) {
+ this.value =3D intValue;
+ }
+
+ @Override
+ public String getDescription() {
+ return "Decimal, from 2.5 to 9.688";
+ }
+
+ @Override
+ public String getLabel() {
+ return "decimalMinMax";
+ }
+}
Added: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/=
tests/metamer/validation/DigitsBean.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tes=
ts/metamer/validation/DigitsBean.java (rev 0)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tes=
ts/metamer/validation/DigitsBean.java 2011-03-09 10:15:02 UTC (rev 22094)
@@ -0,0 +1,62 @@
+/*************************************************************************=
******
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010-2011, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ *************************************************************************=
******/
+package org.richfaces.tests.metamer.validation;
+
+import java.math.BigDecimal;
+
+import javax.faces.bean.ManagedBean;
+import javax.validation.constraints.Digits;
+
+/**
+ * Helper bean for testing JSR-303.
+ *
+ * @author Pavol Pitonak
+ * @version $Revision$
+ */
+(a)ManagedBean
+public class DigitsBean extends Validable {
+
+ public DigitsBean() {
+ value =3D new BigDecimal("2.567");
+ }
+
+ @Digits(integer =3D 3, fraction =3D 4)
+ @Override
+ public BigDecimal getValue() {
+ return value;
+ }
+
+ @Override
+ public void setValue(BigDecimal intValue) {
+ this.value =3D intValue;
+ }
+
+ @Override
+ public String getDescription() {
+ return "Decimal, 3 digits integer and 4 fraction";
+ }
+
+ @Override
+ public String getLabel() {
+ return "digits";
+ }
+}
Added: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/=
tests/metamer/validation/FutureBean.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tes=
ts/metamer/validation/FutureBean.java (rev 0)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tes=
ts/metamer/validation/FutureBean.java 2011-03-09 10:15:02 UTC (rev 22094)
@@ -0,0 +1,62 @@
+/*************************************************************************=
******
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010-2011, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ *************************************************************************=
******/
+package org.richfaces.tests.metamer.validation;
+
+import java.util.Date;
+
+import javax.faces.bean.ManagedBean;
+import javax.validation.constraints.Future;
+
+/**
+ * Helper bean for testing JSR-303.
+ *
+ * @author Pavol Pitonak
+ * @version $Revision$
+ */
+(a)ManagedBean
+public class FutureBean extends Validable {
+
+ public FutureBean() {
+ value =3D new Date(System.currentTimeMillis() + 4 * 24 * 3600 * 10=
00);
+ }
+
+ @Future
+ @Override
+ public Date getValue() {
+ return value;
+ }
+
+ @Override
+ public void setValue(Date intValue) {
+ this.value =3D intValue;
+ }
+
+ @Override
+ public String getDescription() {
+ return "Date, future";
+ }
+
+ @Override
+ public String getLabel() {
+ return "future";
+ }
+}
Added: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/=
tests/metamer/validation/MaxBean.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tes=
ts/metamer/validation/MaxBean.java (rev 0)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tes=
ts/metamer/validation/MaxBean.java 2011-03-09 10:15:02 UTC (rev 22094)
@@ -0,0 +1,60 @@
+/*************************************************************************=
******
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010-2011, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ *************************************************************************=
******/
+package org.richfaces.tests.metamer.validation;
+
+import javax.faces.bean.ManagedBean;
+import javax.validation.constraints.Max;
+
+/**
+ * Helper bean for testing JSR-303.
+ *
+ * @author asmirnov, Pavol Pitona=
k
+ * @version $Revision$
+ */
+(a)ManagedBean
+public class MaxBean extends Validable {
+
+ public MaxBean() {
+ value =3D 9;
+ }
+
+ @Max(10)
+ @Override
+ public Integer getValue() {
+ return value;
+ }
+
+ @Override
+ public void setValue(Integer intValue) {
+ this.value =3D intValue;
+ }
+
+ @Override
+ public String getDescription() {
+ return "Integer, max 10";
+ }
+
+ @Override
+ public String getLabel() {
+ return "max";
+ }
+}
Added: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/=
tests/metamer/validation/MinBean.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tes=
ts/metamer/validation/MinBean.java (rev 0)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tes=
ts/metamer/validation/MinBean.java 2011-03-09 10:15:02 UTC (rev 22094)
@@ -0,0 +1,60 @@
+/*************************************************************************=
******
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010-2011, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ *************************************************************************=
******/
+package org.richfaces.tests.metamer.validation;
+
+import javax.faces.bean.ManagedBean;
+import javax.validation.constraints.Min;
+
+/**
+ * Helper bean for testing JSR-303.
+ *
+ * @author asmirnov, Pavol Pitona=
k
+ * @version $Revision$
+ */
+(a)ManagedBean
+public class MinBean extends Validable {
+
+ public MinBean() {
+ value =3D 4;
+ }
+
+ @Min(2)
+ @Override
+ public Integer getValue() {
+ return value;
+ }
+
+ @Override
+ public void setValue(Integer intValue) {
+ this.value =3D intValue;
+ }
+
+ @Override
+ public String getDescription() {
+ return "Integer, min 2";
+ }
+
+ @Override
+ public String getLabel() {
+ return "min";
+ }
+}
Added: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/=
tests/metamer/validation/MinMaxBean.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tes=
ts/metamer/validation/MinMaxBean.java (rev 0)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tes=
ts/metamer/validation/MinMaxBean.java 2011-03-09 10:15:02 UTC (rev 22094)
@@ -0,0 +1,62 @@
+/*************************************************************************=
******
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010-2011, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ *************************************************************************=
******/
+package org.richfaces.tests.metamer.validation;
+
+import javax.faces.bean.ManagedBean;
+import javax.validation.constraints.Max;
+import javax.validation.constraints.Min;
+
+/**
+ * Helper bean for testing JSR-303.
+ *
+ * @author asmirnov, Pavol Pitona=
k
+ * @version $Revision$
+ */
+(a)ManagedBean
+public class MinMaxBean extends Validable {
+
+ public MinMaxBean() {
+ value =3D 4;
+ }
+
+ @Min(2)
+ @Max(10)
+ @Override
+ public Integer getValue() {
+ return value;
+ }
+
+ @Override
+ public void setValue(Integer intValue) {
+ this.value =3D intValue;
+ }
+
+ @Override
+ public String getDescription() {
+ return "Integer, from 2 to 10";
+ }
+
+ @Override
+ public String getLabel() {
+ return "minMax";
+ }
+}
Added: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/=
tests/metamer/validation/NotEmptyBean.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tes=
ts/metamer/validation/NotEmptyBean.java (rev 0)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tes=
ts/metamer/validation/NotEmptyBean.java 2011-03-09 10:15:02 UTC (rev 22094)
@@ -0,0 +1,60 @@
+/*************************************************************************=
******
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010-2011, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ *************************************************************************=
******/
+package org.richfaces.tests.metamer.validation;
+
+import javax.faces.bean.ManagedBean;
+import org.hibernate.validator.constraints.NotEmpty;
+
+/**
+ * Helper bean for testing JSR-303.
+ *
+ * @author asmirnov, Pavol Pitona=
k
+ * @version $Revision$
+ */
+(a)ManagedBean
+public class NotEmptyBean extends Validable {
+
+ public NotEmptyBean() {
+ value =3D "RichFaces 4";
+ }
+
+ @NotEmpty
+ @Override
+ public String getValue() {
+ return value;
+ }
+
+ @Override
+ public void setValue(String text) {
+ this.value =3D text;
+ }
+
+ @Override
+ public String getDescription() {
+ return "Text, not empty";
+ }
+
+ @Override
+ public String getLabel() {
+ return "notEmpty";
+ }
+}
Added: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/=
tests/metamer/validation/NotNullBean.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tes=
ts/metamer/validation/NotNullBean.java (rev 0)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tes=
ts/metamer/validation/NotNullBean.java 2011-03-09 10:15:02 UTC (rev 22094)
@@ -0,0 +1,60 @@
+/*************************************************************************=
******
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010-2011, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ *************************************************************************=
******/
+package org.richfaces.tests.metamer.validation;
+
+import javax.faces.bean.ManagedBean;
+import javax.validation.constraints.NotNull;
+
+/**
+ * Helper bean for testing JSR-303.
+ *
+ * @author asmirnov, Pavol Pitona=
k
+ * @version $Revision$
+ */
+(a)ManagedBean
+public class NotNullBean extends Validable {
+
+ public NotNullBean() {
+ value =3D "RichFaces 4";
+ }
+
+ @NotNull
+ @Override
+ public String getValue() {
+ return value;
+ }
+
+ @Override
+ public void setValue(String text) {
+ this.value =3D text;
+ }
+
+ @Override
+ public String getDescription() {
+ return "Text value, not null";
+ }
+
+ @Override
+ public String getLabel() {
+ return "notNull";
+ }
+}
Added: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/=
tests/metamer/validation/PastBean.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tes=
ts/metamer/validation/PastBean.java (rev 0)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tes=
ts/metamer/validation/PastBean.java 2011-03-09 10:15:02 UTC (rev 22094)
@@ -0,0 +1,62 @@
+/*************************************************************************=
******
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010-2011, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ *************************************************************************=
******/
+package org.richfaces.tests.metamer.validation;
+
+import java.util.Date;
+
+import javax.faces.bean.ManagedBean;
+import javax.validation.constraints.Past;
+
+/**
+ * Helper bean for testing JSR-303.
+ *
+ * @author Pavol Pitonak
+ * @version $Revision$
+ */
+(a)ManagedBean
+public class PastBean extends Validable {
+
+ public PastBean() {
+ value =3D new Date(System.currentTimeMillis() - 4 * 24 * 3600 * 10=
00);
+ }
+
+ @Past
+ @Override
+ public Date getValue() {
+ return value;
+ }
+
+ @Override
+ public void setValue(Date intValue) {
+ this.value =3D intValue;
+ }
+
+ @Override
+ public String getDescription() {
+ return "Date, past";
+ }
+
+ @Override
+ public String getLabel() {
+ return "past";
+ }
+}
Added: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/=
tests/metamer/validation/PatternBean.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tes=
ts/metamer/validation/PatternBean.java (rev 0)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tes=
ts/metamer/validation/PatternBean.java 2011-03-09 10:15:02 UTC (rev 22094)
@@ -0,0 +1,60 @@
+/*************************************************************************=
******
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010-2011, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ *************************************************************************=
******/
+package org.richfaces.tests.metamer.validation;
+
+import javax.faces.bean.ManagedBean;
+import javax.validation.constraints.Pattern;
+
+/**
+ * Helper bean for testing JSR-303.
+ *
+ * @author asmirnov, Pavol Pitona=
k
+ * @version $Revision$
+ */
+(a)ManagedBean
+public class PatternBean extends Validable {
+
+ public PatternBean() {
+ value =3D "richFaces 4";
+ }
+
+ @Pattern(regexp =3D "[a-z].*")
+ @Override
+ public String getValue() {
+ return value;
+ }
+
+ @Override
+ public void setValue(String text) {
+ this.value =3D text;
+ }
+
+ @Override
+ public String getDescription() {
+ return "Text, pattern '[a-z].*'";
+ }
+
+ @Override
+ public String getLabel() {
+ return "pattern";
+ }
+}
Added: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/=
tests/metamer/validation/SizeBean.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tes=
ts/metamer/validation/SizeBean.java (rev 0)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tes=
ts/metamer/validation/SizeBean.java 2011-03-09 10:15:02 UTC (rev 22094)
@@ -0,0 +1,64 @@
+/*************************************************************************=
******
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010-2011, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ *************************************************************************=
******/
+package org.richfaces.tests.metamer.validation;
+
+import java.util.ArrayList;
+import java.util.List;
+import javax.faces.bean.ManagedBean;
+import javax.validation.constraints.Size;
+
+/**
+ * Helper bean for testing JSR-303.
+ *
+ * @author Pavol Pitonak
+ * @version $Revision$
+ */
+(a)ManagedBean
+public class SizeBean extends Validable> {
+
+ public SizeBean() {
+ value =3D new ArrayList();
+ value.add("A");
+ value.add("B");
+ }
+
+ @Size(min =3D 2, max =3D 4)
+ @Override
+ public List getValue() {
+ return value;
+ }
+
+ @Override
+ public void setValue(List intValue) {
+ this.value =3D intValue;
+ }
+
+ @Override
+ public String getDescription() {
+ return "Selection size, from 2 to 4";
+ }
+
+ @Override
+ public String getLabel() {
+ return "size";
+ }
+}
Added: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/=
tests/metamer/validation/Validable.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tes=
ts/metamer/validation/Validable.java (rev 0)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tes=
ts/metamer/validation/Validable.java 2011-03-09 10:15:02 UTC (rev 22094)
@@ -0,0 +1,55 @@
+/*************************************************************************=
******
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010-2011, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ *************************************************************************=
******/
+package org.richfaces.tests.metamer.validation;
+
+import java.lang.reflect.ParameterizedType;
+
+import javax.faces.context.FacesContext;
+import javax.faces.convert.Converter;
+
+/**
+ * Helper abstract class for testing JSR-303.
+ *
+ * @author asmirnov, Pavol Pitona=
k
+ * @version $Revision$
+ */
+public abstract class Validable {
+
+ T value;
+
+ public T getValue() {
+ return value;
+ }
+
+ public void setValue(T value) {
+ this.value =3D value;
+ }
+
+ public Converter getConverter() {
+ Class parameterType =3D (Class) ((ParameterizedType) getClas=
s().getGenericSuperclass()).getActualTypeArguments()[0];
+ return FacesContext.getCurrentInstance().getApplication().createCo=
nverter(parameterType);
+ }
+
+ public abstract String getDescription();
+
+ public abstract String getLabel();
+}
Added: modules/tests/metamer/trunk/application/src/main/webapp/components/r=
ichValidator/csv.xhtml
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- modules/tests/metamer/trunk/application/src/main/webapp/components/rich=
Validator/csv.xhtml (rev 0)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/rich=
Validator/csv.xhtml 2011-03-09 10:15:02 UTC (rev 22094)
@@ -0,0 +1,321 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Added: modules/tests/metamer/trunk/application/src/main/webapp/components/r=
ichValidator/jsr303.xhtml
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- modules/tests/metamer/trunk/application/src/main/webapp/components/rich=
Validator/jsr303.xhtml (rev 0)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/rich=
Validator/jsr303.xhtml 2011-03-09 10:15:02 UTC (rev 22094)
@@ -0,0 +1,178 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+