JBoss Rich Faces SVN: r20757 - branches/RF-9323.
by richfaces-svn-commits@lists.jboss.org
Author: alexsmirnov
Date: 2010-12-22 18:25:25 -0500 (Wed, 22 Dec 2010)
New Revision: 20757
Modified:
branches/RF-9323/
Log:
Removed merge tracking for "svnmerge" for
https://svn.jboss.org/repos/richfaces/branches/RF-8742
Property changes on: branches/RF-9323
___________________________________________________________________
Name: svnmerge-integrated
- /branches/RF-8742:1-19867 /branches/RF-9309:1-19112,19378 /trunk:1-20592
+ /branches/RF-9309:1-19112,19378 /trunk:1-20592
14 years
JBoss Rich Faces SVN: r20756 - branches/RF-9323.
by richfaces-svn-commits@lists.jboss.org
Author: alexsmirnov
Date: 2010-12-22 18:25:18 -0500 (Wed, 22 Dec 2010)
New Revision: 20756
Modified:
branches/RF-9323/
Log:
Removed merge tracking for "svnmerge" for
https://svn.jboss.org/repos/richfaces/branches/RF-7817
Property changes on: branches/RF-9323
___________________________________________________________________
Name: svnmerge-integrated
- /branches/RF-7817:1-19154 /branches/RF-8742:1-19867 /branches/RF-9309:1-19112,19378 /trunk:1-20592
+ /branches/RF-8742:1-19867 /branches/RF-9309:1-19112,19378 /trunk:1-20592
14 years
JBoss Rich Faces SVN: r20755 - branches/RF-9323.
by richfaces-svn-commits@lists.jboss.org
Author: alexsmirnov
Date: 2010-12-22 18:24:41 -0500 (Wed, 22 Dec 2010)
New Revision: 20755
Modified:
branches/RF-9323/
Log:
Initialized merge tracking via "svnmerge" with revisions "1-20592" from
https://svn.jboss.org/repos/richfaces/trunk
Property changes on: branches/RF-9323
___________________________________________________________________
Name: svnmerge-integrated
- /branches/RF-7817:1-19154 /branches/RF-8742:1-19867 /branches/RF-9309:1-19112,19378
+ /branches/RF-7817:1-19154 /branches/RF-8742:1-19867 /branches/RF-9309:1-19112,19378 /trunk:1-20592
14 years
JBoss Rich Faces SVN: r20754 - trunk/examples/dnd-demo.
by richfaces-svn-commits@lists.jboss.org
Author: alexsmirnov
Date: 2010-12-22 17:39:10 -0500 (Wed, 22 Dec 2010)
New Revision: 20754
Modified:
trunk/examples/dnd-demo/
Log:
ignore working files
Property changes on: trunk/examples/dnd-demo
___________________________________________________________________
Name: svn:ignore
+ target
.settings
.project
.classpath
.clover
.externalToolBuilders
14 years
JBoss Rich Faces SVN: r20753 - in trunk/ui/validator/ui/src: main/java/org/richfaces/validator and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: alexsmirnov
Date: 2010-12-22 17:22:55 -0500 (Wed, 22 Dec 2010)
New Revision: 20753
Added:
trunk/ui/validator/ui/src/main/java/org/richfaces/validator/InitializationException.java
Modified:
trunk/ui/validator/ui/src/main/java/org/richfaces/application/ValidatorModule.java
trunk/ui/validator/ui/src/main/java/org/richfaces/validator/RichFacesBeanValidatorFactory.java
trunk/ui/validator/ui/src/test/java/org/richfaces/validator/BeanValidatorServiceConstrainsTest.java
Log:
RESOLVED - issue RF-10066: richfaces-showcase: can't be run under latest code.
Modified: trunk/ui/validator/ui/src/main/java/org/richfaces/application/ValidatorModule.java
===================================================================
--- trunk/ui/validator/ui/src/main/java/org/richfaces/application/ValidatorModule.java 2010-12-22 22:11:51 UTC (rev 20752)
+++ trunk/ui/validator/ui/src/main/java/org/richfaces/application/ValidatorModule.java 2010-12-22 22:22:55 UTC (rev 20753)
@@ -25,15 +25,12 @@
import java.util.Map;
-import javax.validation.ValidationException;
-
import org.richfaces.el.ValueExpressionAnalayserImpl;
import org.richfaces.javascript.ClientScriptService;
import org.richfaces.javascript.ClientScriptServiceImpl;
import org.richfaces.javascript.ClientServiceConfigParser;
import org.richfaces.javascript.LibraryFunction;
import org.richfaces.validator.BeanValidator;
-import org.richfaces.validator.BeanValidatorFactory;
import org.richfaces.validator.BeanValidatorService;
import org.richfaces.validator.BeanValidatorServiceImpl;
import org.richfaces.validator.ConverterServiceImpl;
@@ -41,6 +38,7 @@
import org.richfaces.validator.FacesConverterService;
import org.richfaces.validator.FacesValidatorService;
import org.richfaces.validator.FacesValidatorServiceImpl;
+import org.richfaces.validator.InitializationException;
import org.richfaces.validator.NullValidator;
import org.richfaces.validator.ObjectValidator;
import org.richfaces.validator.RichFacesBeanValidatorFactory;
@@ -80,10 +78,11 @@
BeanValidatorService service ;
ObjectValidator validator;
try {
- BeanValidatorFactory validatorFactory = new RichFacesBeanValidatorFactory();
+ RichFacesBeanValidatorFactory validatorFactory = new RichFacesBeanValidatorFactory();
+ validatorFactory.init();
service = new BeanValidatorServiceImpl(new ValueExpressionAnalayserImpl(), validatorFactory);
validator = new BeanValidator(validatorFactory);
- } catch (ValidationException e) {
+ } catch (InitializationException e) {
// JSR-303 is available but not initialised.
service = new DummyBeanValidatorService();
validator = new NullValidator();
Copied: trunk/ui/validator/ui/src/main/java/org/richfaces/validator/InitializationException.java (from rev 20751, branches/4.0.0.M5/ui/validator/ui/src/main/java/org/richfaces/validator/InitializationException.java)
===================================================================
--- trunk/ui/validator/ui/src/main/java/org/richfaces/validator/InitializationException.java (rev 0)
+++ trunk/ui/validator/ui/src/main/java/org/richfaces/validator/InitializationException.java 2010-12-22 22:22:55 UTC (rev 20753)
@@ -0,0 +1,65 @@
+/*
+ * $Id$
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, 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.validator;
+
+/**
+ * <p class="changed_added_4_0">Service initialization exception.</p>
+ * @author asmirnov(a)exadel.com
+ *
+ */
+@SuppressWarnings("serial")
+public class InitializationException extends Exception {
+
+ /**
+ * <p class="changed_added_4_0"></p>
+ */
+ public InitializationException() {
+ }
+
+ /**
+ * <p class="changed_added_4_0"></p>
+ * @param message
+ */
+ public InitializationException(String message) {
+ super(message);
+ }
+
+ /**
+ * <p class="changed_added_4_0"></p>
+ * @param cause
+ */
+ public InitializationException(Throwable cause) {
+ super(cause);
+ }
+
+ /**
+ * <p class="changed_added_4_0"></p>
+ * @param message
+ * @param cause
+ */
+ public InitializationException(String message, Throwable cause) {
+ super(message, cause);
+ }
+
+}
Modified: trunk/ui/validator/ui/src/main/java/org/richfaces/validator/RichFacesBeanValidatorFactory.java
===================================================================
--- trunk/ui/validator/ui/src/main/java/org/richfaces/validator/RichFacesBeanValidatorFactory.java 2010-12-22 22:11:51 UTC (rev 20752)
+++ trunk/ui/validator/ui/src/main/java/org/richfaces/validator/RichFacesBeanValidatorFactory.java 2010-12-22 22:22:55 UTC (rev 20753)
@@ -12,6 +12,7 @@
import javax.validation.MessageInterpolator;
import javax.validation.MessageInterpolator.Context;
import javax.validation.Validation;
+import javax.validation.ValidationException;
import javax.validation.Validator;
import javax.validation.ValidatorContext;
import javax.validation.ValidatorFactory;
@@ -19,46 +20,57 @@
/**
* @author asmirnov
- *
+ *
*/
public class RichFacesBeanValidatorFactory implements BeanValidatorFactory {
-
+
private ValidatorFactory validatorFactory;
private ValidatorContext validatorContext;
public RichFacesBeanValidatorFactory() {
// Enforce class to load
ValidatorFactory.class.getName();
+ }
+
+ public void init() throws InitializationException {
// Check Factory, to avoid instantiation errors
// https://jira.jboss.org/jira/browse/RF-7226
- validatorFactory = Validation.buildDefaultValidatorFactory();
- validatorContext = validatorFactory.usingContext();
- MessageInterpolator jsfMessageInterpolator =
- new JsfMessageInterpolator(validatorFactory.getMessageInterpolator());
- validatorContext.messageInterpolator(jsfMessageInterpolator);
+ try {
+ validatorFactory = Validation.buildDefaultValidatorFactory();
+ validatorContext = validatorFactory.usingContext();
+ MessageInterpolator jsfMessageInterpolator =
+ new JsfMessageInterpolator(validatorFactory.getMessageInterpolator());
+ validatorContext.messageInterpolator(jsfMessageInterpolator);
+ } catch (ValidationException e) {
+ throw new InitializationException(e);
+ }
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.richfaces.validator.BeanValidatorFactory#getValidator(javax.faces.context.FacesContext)
*/
public Validator getValidator(FacesContext context) {
return validatorContext.getValidator();
}
-
- public FacesMessage interpolateMessage(FacesContext context,final ConstraintDescriptor<? extends Annotation> constrain){
- if(constrain.getAttributes().containsKey("message")){
+
+ public FacesMessage interpolateMessage(FacesContext context,
+ final ConstraintDescriptor<? extends Annotation> constrain) {
+ if (constrain.getAttributes().containsKey("message")) {
Object object = constrain.getAttributes().get("message");
String interpolatedMessage;
- interpolatedMessage = validatorFactory.getMessageInterpolator().interpolate(object.toString(), new Context() {
-
- public Object getValidatedValue() {
- return "{0}";
- }
-
- public ConstraintDescriptor<?> getConstraintDescriptor() {
- return constrain;
- }
- }, MessageFactory.getCurrentLocale(context));
+ interpolatedMessage =
+ validatorFactory.getMessageInterpolator().interpolate(object.toString(), new Context() {
+
+ public Object getValidatedValue() {
+ return "{0}";
+ }
+
+ public ConstraintDescriptor<?> getConstraintDescriptor() {
+ return constrain;
+ }
+ }, MessageFactory.getCurrentLocale(context));
return new FacesMessage(interpolatedMessage);
} else {
return MessageFactory.createMessage(context, UIInput.UPDATE_MESSAGE_ID);
Modified: trunk/ui/validator/ui/src/test/java/org/richfaces/validator/BeanValidatorServiceConstrainsTest.java
===================================================================
--- trunk/ui/validator/ui/src/test/java/org/richfaces/validator/BeanValidatorServiceConstrainsTest.java 2010-12-22 22:11:51 UTC (rev 20752)
+++ trunk/ui/validator/ui/src/test/java/org/richfaces/validator/BeanValidatorServiceConstrainsTest.java 2010-12-22 22:22:55 UTC (rev 20753)
@@ -54,6 +54,7 @@
@Before
public void setUp() throws Exception {
RichFacesBeanValidatorFactory validatorFactory = new RichFacesBeanValidatorFactory();
+ validatorFactory.init();
validatorService = new BeanValidatorServiceImpl(analayser,validatorFactory);
expect(environment.getFacesContext().getViewRoot()).andStubReturn(viewRoot);
expect(viewRoot.getLocale()).andStubReturn(Locale.ENGLISH);
14 years
JBoss Rich Faces SVN: r20752 - trunk/core/impl/src/main/java/org/richfaces/context.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2010-12-22 17:11:51 -0500 (Wed, 22 Dec 2010)
New Revision: 20752
Modified:
trunk/core/impl/src/main/java/org/richfaces/context/PartialViewContextImpl.java
Log:
https://issues.jboss.org/browse/RF-9665
Modified: trunk/core/impl/src/main/java/org/richfaces/context/PartialViewContextImpl.java
===================================================================
--- trunk/core/impl/src/main/java/org/richfaces/context/PartialViewContextImpl.java 2010-12-22 22:10:33 UTC (rev 20751)
+++ trunk/core/impl/src/main/java/org/richfaces/context/PartialViewContextImpl.java 2010-12-22 22:11:51 UTC (rev 20752)
@@ -234,6 +234,10 @@
}
if (phaseId == PhaseId.APPLY_REQUEST_VALUES) {
+ //fix for MyFaces
+ ExternalContext externalContext = facesContext.getExternalContext();
+ externalContext.setResponseCharacterEncoding(externalContext.getRequestCharacterEncoding());
+
PartialResponseWriter writer = pvc.getPartialResponseWriter();
facesContext.setResponseWriter(writer);
}
14 years
JBoss Rich Faces SVN: r20751 - in branches/4.0.0.M5/ui/validator/ui/src: main/java/org/richfaces/validator and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: alexsmirnov
Date: 2010-12-22 17:10:33 -0500 (Wed, 22 Dec 2010)
New Revision: 20751
Added:
branches/4.0.0.M5/ui/validator/ui/src/main/java/org/richfaces/validator/InitializationException.java
Modified:
branches/4.0.0.M5/ui/validator/ui/src/main/java/org/richfaces/application/ValidatorModule.java
branches/4.0.0.M5/ui/validator/ui/src/main/java/org/richfaces/validator/RichFacesBeanValidatorFactory.java
branches/4.0.0.M5/ui/validator/ui/src/test/java/org/richfaces/validator/BeanValidatorServiceConstrainsTest.java
Log:
RESOLVED - issue RF-10066: richfaces-showcase: can't be run under latest code.
https://issues.jboss.org/browse/RF-10066
Modified: branches/4.0.0.M5/ui/validator/ui/src/main/java/org/richfaces/application/ValidatorModule.java
===================================================================
--- branches/4.0.0.M5/ui/validator/ui/src/main/java/org/richfaces/application/ValidatorModule.java 2010-12-22 19:25:18 UTC (rev 20750)
+++ branches/4.0.0.M5/ui/validator/ui/src/main/java/org/richfaces/application/ValidatorModule.java 2010-12-22 22:10:33 UTC (rev 20751)
@@ -25,15 +25,12 @@
import java.util.Map;
-import javax.validation.ValidationException;
-
import org.richfaces.el.ValueExpressionAnalayserImpl;
import org.richfaces.javascript.ClientScriptService;
import org.richfaces.javascript.ClientScriptServiceImpl;
import org.richfaces.javascript.ClientServiceConfigParser;
import org.richfaces.javascript.LibraryFunction;
import org.richfaces.validator.BeanValidator;
-import org.richfaces.validator.BeanValidatorFactory;
import org.richfaces.validator.BeanValidatorService;
import org.richfaces.validator.BeanValidatorServiceImpl;
import org.richfaces.validator.ConverterServiceImpl;
@@ -41,6 +38,7 @@
import org.richfaces.validator.FacesConverterService;
import org.richfaces.validator.FacesValidatorService;
import org.richfaces.validator.FacesValidatorServiceImpl;
+import org.richfaces.validator.InitializationException;
import org.richfaces.validator.NullValidator;
import org.richfaces.validator.ObjectValidator;
import org.richfaces.validator.RichFacesBeanValidatorFactory;
@@ -80,10 +78,11 @@
BeanValidatorService service ;
ObjectValidator validator;
try {
- BeanValidatorFactory validatorFactory = new RichFacesBeanValidatorFactory();
+ RichFacesBeanValidatorFactory validatorFactory = new RichFacesBeanValidatorFactory();
+ validatorFactory.init();
service = new BeanValidatorServiceImpl(new ValueExpressionAnalayserImpl(), validatorFactory);
validator = new BeanValidator(validatorFactory);
- } catch (ValidationException e) {
+ } catch (InitializationException e) {
// JSR-303 is available but not initialised.
service = new DummyBeanValidatorService();
validator = new NullValidator();
Added: branches/4.0.0.M5/ui/validator/ui/src/main/java/org/richfaces/validator/InitializationException.java
===================================================================
--- branches/4.0.0.M5/ui/validator/ui/src/main/java/org/richfaces/validator/InitializationException.java (rev 0)
+++ branches/4.0.0.M5/ui/validator/ui/src/main/java/org/richfaces/validator/InitializationException.java 2010-12-22 22:10:33 UTC (rev 20751)
@@ -0,0 +1,65 @@
+/*
+ * $Id$
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, 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.validator;
+
+/**
+ * <p class="changed_added_4_0">Service initialization exception.</p>
+ * @author asmirnov(a)exadel.com
+ *
+ */
+@SuppressWarnings("serial")
+public class InitializationException extends Exception {
+
+ /**
+ * <p class="changed_added_4_0"></p>
+ */
+ public InitializationException() {
+ }
+
+ /**
+ * <p class="changed_added_4_0"></p>
+ * @param message
+ */
+ public InitializationException(String message) {
+ super(message);
+ }
+
+ /**
+ * <p class="changed_added_4_0"></p>
+ * @param cause
+ */
+ public InitializationException(Throwable cause) {
+ super(cause);
+ }
+
+ /**
+ * <p class="changed_added_4_0"></p>
+ * @param message
+ * @param cause
+ */
+ public InitializationException(String message, Throwable cause) {
+ super(message, cause);
+ }
+
+}
Property changes on: branches/4.0.0.M5/ui/validator/ui/src/main/java/org/richfaces/validator/InitializationException.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: branches/4.0.0.M5/ui/validator/ui/src/main/java/org/richfaces/validator/RichFacesBeanValidatorFactory.java
===================================================================
--- branches/4.0.0.M5/ui/validator/ui/src/main/java/org/richfaces/validator/RichFacesBeanValidatorFactory.java 2010-12-22 19:25:18 UTC (rev 20750)
+++ branches/4.0.0.M5/ui/validator/ui/src/main/java/org/richfaces/validator/RichFacesBeanValidatorFactory.java 2010-12-22 22:10:33 UTC (rev 20751)
@@ -12,6 +12,7 @@
import javax.validation.MessageInterpolator;
import javax.validation.MessageInterpolator.Context;
import javax.validation.Validation;
+import javax.validation.ValidationException;
import javax.validation.Validator;
import javax.validation.ValidatorContext;
import javax.validation.ValidatorFactory;
@@ -19,46 +20,57 @@
/**
* @author asmirnov
- *
+ *
*/
public class RichFacesBeanValidatorFactory implements BeanValidatorFactory {
-
+
private ValidatorFactory validatorFactory;
private ValidatorContext validatorContext;
public RichFacesBeanValidatorFactory() {
// Enforce class to load
ValidatorFactory.class.getName();
+ }
+
+ public void init() throws InitializationException {
// Check Factory, to avoid instantiation errors
// https://jira.jboss.org/jira/browse/RF-7226
- validatorFactory = Validation.buildDefaultValidatorFactory();
- validatorContext = validatorFactory.usingContext();
- MessageInterpolator jsfMessageInterpolator =
- new JsfMessageInterpolator(validatorFactory.getMessageInterpolator());
- validatorContext.messageInterpolator(jsfMessageInterpolator);
+ try {
+ validatorFactory = Validation.buildDefaultValidatorFactory();
+ validatorContext = validatorFactory.usingContext();
+ MessageInterpolator jsfMessageInterpolator =
+ new JsfMessageInterpolator(validatorFactory.getMessageInterpolator());
+ validatorContext.messageInterpolator(jsfMessageInterpolator);
+ } catch (ValidationException e) {
+ throw new InitializationException(e);
+ }
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.richfaces.validator.BeanValidatorFactory#getValidator(javax.faces.context.FacesContext)
*/
public Validator getValidator(FacesContext context) {
return validatorContext.getValidator();
}
-
- public FacesMessage interpolateMessage(FacesContext context,final ConstraintDescriptor<? extends Annotation> constrain){
- if(constrain.getAttributes().containsKey("message")){
+
+ public FacesMessage interpolateMessage(FacesContext context,
+ final ConstraintDescriptor<? extends Annotation> constrain) {
+ if (constrain.getAttributes().containsKey("message")) {
Object object = constrain.getAttributes().get("message");
String interpolatedMessage;
- interpolatedMessage = validatorFactory.getMessageInterpolator().interpolate(object.toString(), new Context() {
-
- public Object getValidatedValue() {
- return "{0}";
- }
-
- public ConstraintDescriptor<?> getConstraintDescriptor() {
- return constrain;
- }
- }, MessageFactory.getCurrentLocale(context));
+ interpolatedMessage =
+ validatorFactory.getMessageInterpolator().interpolate(object.toString(), new Context() {
+
+ public Object getValidatedValue() {
+ return "{0}";
+ }
+
+ public ConstraintDescriptor<?> getConstraintDescriptor() {
+ return constrain;
+ }
+ }, MessageFactory.getCurrentLocale(context));
return new FacesMessage(interpolatedMessage);
} else {
return MessageFactory.createMessage(context, UIInput.UPDATE_MESSAGE_ID);
Modified: branches/4.0.0.M5/ui/validator/ui/src/test/java/org/richfaces/validator/BeanValidatorServiceConstrainsTest.java
===================================================================
--- branches/4.0.0.M5/ui/validator/ui/src/test/java/org/richfaces/validator/BeanValidatorServiceConstrainsTest.java 2010-12-22 19:25:18 UTC (rev 20750)
+++ branches/4.0.0.M5/ui/validator/ui/src/test/java/org/richfaces/validator/BeanValidatorServiceConstrainsTest.java 2010-12-22 22:10:33 UTC (rev 20751)
@@ -54,6 +54,7 @@
@Before
public void setUp() throws Exception {
RichFacesBeanValidatorFactory validatorFactory = new RichFacesBeanValidatorFactory();
+ validatorFactory.init();
validatorService = new BeanValidatorServiceImpl(analayser,validatorFactory);
expect(environment.getFacesContext().getViewRoot()).andStubReturn(viewRoot);
expect(viewRoot.getLocale()).andStubReturn(Locale.ENGLISH);
14 years
JBoss Rich Faces SVN: r20750 - in trunk/ui/iteration/ui/src/main/java/org/richfaces: view/facelets and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2010-12-22 14:25:18 -0500 (Wed, 22 Dec 2010)
New Revision: 20750
Modified:
trunk/ui/iteration/ui/src/main/java/org/richfaces/component/AbstractTree.java
trunk/ui/iteration/ui/src/main/java/org/richfaces/view/facelets/TreeHandler.java
Log:
https://issues.jboss.org/browse/RF-10059
Modified: trunk/ui/iteration/ui/src/main/java/org/richfaces/component/AbstractTree.java
===================================================================
--- trunk/ui/iteration/ui/src/main/java/org/richfaces/component/AbstractTree.java 2010-12-22 19:18:08 UTC (rev 20749)
+++ trunk/ui/iteration/ui/src/main/java/org/richfaces/component/AbstractTree.java 2010-12-22 19:25:18 UTC (rev 20750)
@@ -30,11 +30,9 @@
import javax.el.ELException;
import javax.el.MethodExpression;
import javax.el.ValueExpression;
-import javax.faces.application.Application;
import javax.faces.application.FacesMessage;
import javax.faces.component.UIComponent;
import javax.faces.component.UpdateModelException;
-import javax.faces.component.html.HtmlOutputText;
import javax.faces.component.visit.VisitCallback;
import javax.faces.component.visit.VisitContext;
import javax.faces.component.visit.VisitResult;
@@ -100,10 +98,10 @@
public static final String SELECTION_META_COMPONENT_ID = "selection";
- private static final String DEFAULT_TREE_NODE_CREATED = AbstractTree.class.getName() + ":DEFAULT_TREE_NODE_CREATED";
+ public static final String DEFAULT_TREE_NODE_ID = "__defaultTreeNode";
+
+ public static final String DEFAULT_TREE_NODE_FACET_NAME = DEFAULT_TREE_NODE_ID;
- private static final String DEFAULT_TREE_NODE_ID = "__defaultTreeNode";
-
private static final class MatchingTreeNodePredicate implements Predicate<UIComponent> {
private String type;
@@ -272,52 +270,22 @@
}
}
- private boolean isDefaultTreeNode(AbstractTreeNode node) {
- return DEFAULT_TREE_NODE_ID.equals(node.getId());
- }
-
public AbstractTreeNode findTreeNodeComponent() {
- FacesContext facesContext = getFacesContext();
-
String nodeType = getNodeType();
Iterator<UIComponent> nodesItr = findMatchingTreeNodeComponent(nodeType, currentComponent);
- boolean hasOnlyDefaultNodes = true;
- while (nodesItr.hasNext()) {
-
- AbstractTreeNode node = (AbstractTreeNode) nodesItr.next();
-
- if (!isDefaultTreeNode(node)) {
- hasOnlyDefaultNodes = false;
+ if (nodesItr.hasNext()) {
+ while (nodesItr.hasNext()) {
+
+ AbstractTreeNode node = (AbstractTreeNode) nodesItr.next();
+
+ if (node.isRendered()) {
+ return node;
+ }
}
-
- if (!node.isRendered()) {
- continue;
- }
-
- if (!isDefaultTreeNode(node) || hasOnlyDefaultNodes) {
- return node;
- }
- }
-
- if (Strings.isNullOrEmpty(nodeType)) {
- if (getAttributes().put(DEFAULT_TREE_NODE_CREATED, Boolean.TRUE) != null) {
- return null;
- }
- //TODO default TreeNode is created when getRowKey() == null but it's not used for presentational purposes
- Application application = facesContext.getApplication();
- AbstractTreeNode treeNode = (AbstractTreeNode) application.createComponent(AbstractTreeNode.COMPONENT_TYPE);
- treeNode.setId(DEFAULT_TREE_NODE_ID);
-
- getChildren().add(treeNode);
-
- UIComponent text = application.createComponent(HtmlOutputText.COMPONENT_TYPE);
- text.setValueExpression("value", application.getExpressionFactory().createValueExpression(facesContext.getELContext(),
- "#{" + getVar() + "}", String.class));
- treeNode.getChildren().add(text);
-
- return treeNode;
+ } else if (Strings.isNullOrEmpty(nodeType)) {
+ return (AbstractTreeNode) getFacet(DEFAULT_TREE_NODE_FACET_NAME);
}
return null;
@@ -601,5 +569,5 @@
setupCurrentComponent();
super.restoreChildState(facesContext);
}
-
+
}
Modified: trunk/ui/iteration/ui/src/main/java/org/richfaces/view/facelets/TreeHandler.java
===================================================================
--- trunk/ui/iteration/ui/src/main/java/org/richfaces/view/facelets/TreeHandler.java 2010-12-22 19:18:08 UTC (rev 20749)
+++ trunk/ui/iteration/ui/src/main/java/org/richfaces/view/facelets/TreeHandler.java 2010-12-22 19:25:18 UTC (rev 20750)
@@ -21,8 +21,16 @@
*/
package org.richfaces.view.facelets;
+import static org.richfaces.component.AbstractTree.DEFAULT_TREE_NODE_FACET_NAME;
+import static org.richfaces.component.AbstractTree.DEFAULT_TREE_NODE_ID;
+
+import javax.faces.application.Application;
+import javax.faces.component.UIComponent;
+import javax.faces.component.html.HtmlOutputText;
+import javax.faces.context.FacesContext;
import javax.faces.view.facelets.ComponentConfig;
import javax.faces.view.facelets.ComponentHandler;
+import javax.faces.view.facelets.FaceletContext;
import javax.faces.view.facelets.MetaRule;
import javax.faces.view.facelets.MetaRuleset;
import javax.faces.view.facelets.Metadata;
@@ -30,7 +38,10 @@
import javax.faces.view.facelets.TagAttribute;
import org.richfaces.component.AbstractTree;
+import org.richfaces.component.AbstractTreeNode;
+import com.google.common.base.Strings;
+
/**
* @author Nick Belaevski
*
@@ -63,4 +74,32 @@
metaRuleset.addRule(RULE);
return metaRuleset;
}
+
+ @Override
+ public void onComponentPopulated(FaceletContext ctx, UIComponent c, UIComponent parent) {
+ super.onComponentPopulated(ctx, c, parent);
+
+ UIComponent defaultTreeNode = c.getFacet(DEFAULT_TREE_NODE_FACET_NAME);
+ if (defaultTreeNode == null) {
+ String var = ((AbstractTree) c).getVar();
+
+ if (Strings.isNullOrEmpty(var)) {
+ return;
+ }
+
+ FacesContext facesContext = ctx.getFacesContext();
+ Application application = facesContext.getApplication();
+
+ AbstractTreeNode treeNode = (AbstractTreeNode) application.createComponent(AbstractTreeNode.COMPONENT_TYPE);
+ treeNode.setId(DEFAULT_TREE_NODE_ID);
+
+ c.getFacets().put(DEFAULT_TREE_NODE_FACET_NAME, treeNode);
+
+ UIComponent text = application.createComponent(HtmlOutputText.COMPONENT_TYPE);
+
+ text.setValueExpression("value", application.getExpressionFactory().createValueExpression(facesContext.getELContext(),
+ "#{" + var + "}", String.class));
+ treeNode.getChildren().add(text);
+ }
+ }
}
14 years
JBoss Rich Faces SVN: r20749 - branches/4.0.0.M5/examples/dnd-demo.
by richfaces-svn-commits@lists.jboss.org
Author: alexsmirnov
Date: 2010-12-22 14:18:08 -0500 (Wed, 22 Dec 2010)
New Revision: 20749
Modified:
branches/4.0.0.M5/examples/dnd-demo/
Log:
ignore working folders
Property changes on: branches/4.0.0.M5/examples/dnd-demo
___________________________________________________________________
Name: svn:ignore
+ target
.settings
.project
.classpath
.clover
.externalToolBuilders
14 years
JBoss Rich Faces SVN: r20748 - trunk/ui/input/ui/src/main/java/org/richfaces/renderkit.
by richfaces-svn-commits@lists.jboss.org
Author: amarkhel
Date: 2010-12-22 11:21:09 -0500 (Wed, 22 Dec 2010)
New Revision: 20748
Modified:
trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/CalendarRendererBase.java
Log:
RF-9646 Calendar: rendered wrong when firstWeekDay is not valid
Modified: trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/CalendarRendererBase.java
===================================================================
--- trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/CalendarRendererBase.java 2010-12-22 16:02:27 UTC (rev 20747)
+++ trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/CalendarRendererBase.java 2010-12-22 16:21:09 UTC (rev 20748)
@@ -492,10 +492,9 @@
if (0 <= day && day <= 6) {
RenderKitUtils.addToScriptHash(map, FIRST_DAY_WEEK, day);
- } else if (day != Integer.MIN_VALUE) {
- facesContext.getExternalContext().log(
- day + " value of firstWeekDay attribute is not a legal one for component: "
- + MessageUtil.getLabel(facesContext, calendarComponent) + ". Default value was applied.");
+ } else {
+ throw new IllegalArgumentException(day + " value of firstWeekDay attribute is not a legal one for component: "
+ + MessageUtil.getLabel(facesContext, calendarComponent));
}
return map;
}
14 years