You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by sc...@apache.org on 2006/02/28 04:41:25 UTC
svn commit: r381548 - in /myfaces/shared/trunk: ./ shared-impl/
shared-tomahawk/ src/main/java/org/apache/myfaces/shared/component/
src/main/java/org/apache/myfaces/shared/util/
Author: schof
Date: Mon Feb 27 19:41:21 2006
New Revision: 381548
URL: http://svn.apache.org/viewcvs?rev=381548&view=rev
Log:
added stuff that was added to commons after the svn copy that was used to create the shared project
Added:
myfaces/shared/trunk/src/main/java/org/apache/myfaces/shared/component/BindingAware.java
myfaces/shared/trunk/src/main/java/org/apache/myfaces/shared/util/RestoreStateUtils.java
Modified:
myfaces/shared/trunk/pom.xml
myfaces/shared/trunk/shared-impl/ (props changed)
myfaces/shared/trunk/shared-impl/pom.xml
myfaces/shared/trunk/shared-tomahawk/ (props changed)
myfaces/shared/trunk/shared-tomahawk/pom.xml
Modified: myfaces/shared/trunk/pom.xml
URL: http://svn.apache.org/viewcvs/myfaces/shared/trunk/pom.xml?rev=381548&r1=381547&r2=381548&view=diff
==============================================================================
--- myfaces/shared/trunk/pom.xml (original)
+++ myfaces/shared/trunk/pom.xml Mon Feb 27 19:41:21 2006
@@ -17,7 +17,7 @@
<parent>
<artifactId>myfaces-master</artifactId>
<groupId>org.apache.myfaces.maven</groupId>
- <version>1.0.0-SNAPSHOT</version>
+ <version>1.0.1-SNAPSHOT</version>
</parent>
<modules>
Propchange: myfaces/shared/trunk/shared-impl/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Mon Feb 27 19:41:21 2006
@@ -0,0 +1 @@
+target
Modified: myfaces/shared/trunk/shared-impl/pom.xml
URL: http://svn.apache.org/viewcvs/myfaces/shared/trunk/shared-impl/pom.xml?rev=381548&r1=381547&r2=381548&view=diff
==============================================================================
--- myfaces/shared/trunk/shared-impl/pom.xml (original)
+++ myfaces/shared/trunk/shared-impl/pom.xml Mon Feb 27 19:41:21 2006
@@ -16,6 +16,12 @@
<version>2.0.0-SNAPSHOT</version>
</parent>
+ <scm>
+ <connection>scm:svn:http://svn.apache.org/repos/asf/myfaces/shared/trunk/shared-impl</connection>
+ <developerConnection>scm:svn:https://svn.apache.org/repos/asf/myfaces/shared/trunk/shared-impl</developerConnection>
+ <url>http://svn.apache.org/viewcvs.cgi/myfaces/shared/trunk/shared-impl</url>
+ </scm>
+
<url>http://myfaces.apache.org</url>
<build>
Propchange: myfaces/shared/trunk/shared-tomahawk/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Mon Feb 27 19:41:21 2006
@@ -0,0 +1 @@
+target
Modified: myfaces/shared/trunk/shared-tomahawk/pom.xml
URL: http://svn.apache.org/viewcvs/myfaces/shared/trunk/shared-tomahawk/pom.xml?rev=381548&r1=381547&r2=381548&view=diff
==============================================================================
--- myfaces/shared/trunk/shared-tomahawk/pom.xml (original)
+++ myfaces/shared/trunk/shared-tomahawk/pom.xml Mon Feb 27 19:41:21 2006
@@ -16,6 +16,12 @@
<version>2.0.0-SNAPSHOT</version>
</parent>
+ <scm>
+ <connection>scm:svn:http://svn.apache.org/repos/asf/myfaces/shared/trunk/shared-tomahawk</connection>
+ <developerConnection>scm:svn:https://svn.apache.org/repos/asf/myfaces/shared/trunk/shared-tomahawk</developerConnection>
+ <url>http://svn.apache.org/viewcvs.cgi/myfaces/shared/trunk/shared-tomahawk</url>
+ </scm>
+
<url>http://myfaces.apache.org</url>
<build>
Added: myfaces/shared/trunk/src/main/java/org/apache/myfaces/shared/component/BindingAware.java
URL: http://svn.apache.org/viewcvs/myfaces/shared/trunk/src/main/java/org/apache/myfaces/shared/component/BindingAware.java?rev=381548&view=auto
==============================================================================
--- myfaces/shared/trunk/src/main/java/org/apache/myfaces/shared/component/BindingAware.java (added)
+++ myfaces/shared/trunk/src/main/java/org/apache/myfaces/shared/component/BindingAware.java Mon Feb 27 19:41:21 2006
@@ -0,0 +1,6 @@
+package org.apache.myfaces.shared.component;
+
+public interface BindingAware
+{
+ public void handleBindings();
+}
Added: myfaces/shared/trunk/src/main/java/org/apache/myfaces/shared/util/RestoreStateUtils.java
URL: http://svn.apache.org/viewcvs/myfaces/shared/trunk/src/main/java/org/apache/myfaces/shared/util/RestoreStateUtils.java?rev=381548&view=auto
==============================================================================
--- myfaces/shared/trunk/src/main/java/org/apache/myfaces/shared/util/RestoreStateUtils.java (added)
+++ myfaces/shared/trunk/src/main/java/org/apache/myfaces/shared/util/RestoreStateUtils.java Mon Feb 27 19:41:21 2006
@@ -0,0 +1,65 @@
+package org.apache.myfaces.shared.util;
+
+import org.apache.myfaces.shared.component.BindingAware;
+
+import javax.faces.context.FacesContext;
+import javax.faces.component.UIComponent;
+import javax.faces.component.UIInput;
+import javax.faces.el.ValueBinding;
+import java.util.Iterator;
+
+/**
+ * @author Martin Marinschek (latest modification by $Author: grantsmith $)
+ * @version $Revision: 169655 $ $Date: 2005-05-11 18:45:06 +0200 (Mi, 11 Mai 2005) $
+ */
+public class RestoreStateUtils
+{
+ /**
+ * Walk the component tree, executing any component-bindings to reattach
+ * components to their backing beans. Also, any UIInput component is
+ * marked as Valid.
+ * <p>
+ * Note that this method effectively breaks encapsulation; instead of
+ * asking each component to update itself and its children, this
+ * method just reaches into each component. That makes it impossible
+ * for any component to customise its behaviour at this point.
+ * <p>
+ * This has been filed as an issue against the spec. Until this
+ * issue is resolved, we'll add a new marker-interface for components
+ * to allow them to define their interest in handling children bindings themselves.
+ */
+ public static void recursivelyHandleComponentReferencesAndSetValid(FacesContext facesContext,
+ UIComponent parent)
+ {
+ recursivelyHandleComponentReferencesAndSetValid(facesContext, parent, false);
+ }
+
+ public static void recursivelyHandleComponentReferencesAndSetValid(FacesContext facesContext,
+ UIComponent parent, boolean forceHandle)
+ {
+ if(parent instanceof BindingAware && !forceHandle)
+ {
+ ((BindingAware) parent).handleBindings();
+ }
+ else
+ {
+ for (Iterator it = parent.getFacetsAndChildren(); it.hasNext(); )
+ {
+ UIComponent component = (UIComponent)it.next();
+
+ ValueBinding binding = component.getValueBinding("binding"); //TODO: constant
+ if (binding != null && !binding.isReadOnly(facesContext))
+ {
+ binding.setValue(facesContext, component);
+ }
+
+ if (component instanceof UIInput)
+ {
+ ((UIInput)component).setValid(true);
+ }
+
+ recursivelyHandleComponentReferencesAndSetValid(facesContext, component);
+ }
+ }
+ }
+}