myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From arobinso...@apache.org
Subject svn commit: r571517 - in /myfaces/trinidad/trunk/trinidad: trinidad-api/src/main/java/org/apache/myfaces/trinidad/context/ trinidad-api/src/test/java/org/apache/myfaces/trinidad/context/ trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/c...
Date Fri, 31 Aug 2007 16:43:53 GMT
Author: arobinson74
Date: Fri Aug 31 09:43:52 2007
New Revision: 571517

URL: http://svn.apache.org/viewvc?rev=571517&view=rev
Log:
TRINIDAD-669 - Add new method on RequestContext to be able to add multiple targets relative
to a given component at a time

Modified:
    myfaces/trinidad/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/context/RequestContext.java
    myfaces/trinidad/trunk/trinidad/trinidad-api/src/test/java/org/apache/myfaces/trinidad/context/MockRequestContext.java
    myfaces/trinidad/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/context/RequestContextImpl.java
    myfaces/trinidad/trunk/trinidad/trinidad-impl/src/test/java/org/apache/myfaces/trinidadinternal/renderkit/MRequestContext.java

Modified: myfaces/trinidad/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/context/RequestContext.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/context/RequestContext.java?rev=571517&r1=571516&r2=571517&view=diff
==============================================================================
--- myfaces/trinidad/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/context/RequestContext.java
(original)
+++ myfaces/trinidad/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/context/RequestContext.java
Fri Aug 31 09:43:52 2007
@@ -31,6 +31,7 @@
 import org.apache.myfaces.trinidad.change.ChangeManager;
 import org.apache.myfaces.trinidad.config.RegionManager;
 import org.apache.myfaces.trinidad.logging.TrinidadLogger;
+import org.apache.myfaces.trinidad.util.ComponentUtils;
 import org.apache.myfaces.trinidad.webapp.UploadedFileProcessor;
 
 /**
@@ -386,6 +387,19 @@
    */
   public abstract void addPartialTarget(UIComponent newTarget);
 
+  /**
+   * Add components relative to the given component as partial targets.
+   * <p> 
+   * See {@link #addPartialTarget(UIComponent)} for more information.
+   * </p>
+   * @param from the component to use as a relative reference for any
+   * relative IDs in the list of targets
+   * @param targets array of targets relative to the from component that
+   * should be added as targets.
+   * @see ComponentUtils#findRelativeComponent(UIComponent, String)
+   */
+  public abstract void addPartialTargets(UIComponent from, String... targets);
+  
   /**
    * Adds a listener on a set of particular triggering components. If one of
    * the named components gets updated in response to a partial event, then

Modified: myfaces/trinidad/trunk/trinidad/trinidad-api/src/test/java/org/apache/myfaces/trinidad/context/MockRequestContext.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/trunk/trinidad/trinidad-api/src/test/java/org/apache/myfaces/trinidad/context/MockRequestContext.java?rev=571517&r1=571516&r2=571517&view=diff
==============================================================================
--- myfaces/trinidad/trunk/trinidad/trinidad-api/src/test/java/org/apache/myfaces/trinidad/context/MockRequestContext.java
(original)
+++ myfaces/trinidad/trunk/trinidad/trinidad-api/src/test/java/org/apache/myfaces/trinidad/context/MockRequestContext.java
Fri Aug 31 09:43:52 2007
@@ -23,17 +23,13 @@
 import java.util.Locale;
 import java.util.Map;
 import java.util.TimeZone;
+
 import javax.faces.component.UIComponent;
 import javax.faces.component.UIViewRoot;
 import javax.faces.context.FacesContext;
 
 import org.apache.myfaces.trinidad.change.ChangeManager;
 import org.apache.myfaces.trinidad.config.RegionManager;
-import org.apache.myfaces.trinidad.context.RequestContext;
-import org.apache.myfaces.trinidad.context.Agent;
-import org.apache.myfaces.trinidad.context.DialogService;
-import org.apache.myfaces.trinidad.context.PageFlowScopeProvider;
-import org.apache.myfaces.trinidad.context.PageResolver;
 import org.apache.myfaces.trinidad.webapp.UploadedFileProcessor;
 
 
@@ -256,6 +252,15 @@
   public void addPartialTarget(UIComponent newTarget)
   {
     // throw new UnsupportedOperationException("Not implemented yet");
+  }
+  
+  /**
+   * @see org.apache.myfaces.trinidad.context.RequestContext#addPartialTargets(javax.faces.component.UIComponent,
java.lang.String[])
+   */
+  @Override
+  public void addPartialTargets(UIComponent from, String... targets)
+  {
+    
   }
 
   @Override

Modified: myfaces/trinidad/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/context/RequestContextImpl.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/context/RequestContextImpl.java?rev=571517&r1=571516&r2=571517&view=diff
==============================================================================
--- myfaces/trinidad/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/context/RequestContextImpl.java
(original)
+++ myfaces/trinidad/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/context/RequestContextImpl.java
Fri Aug 31 09:43:52 2007
@@ -498,6 +498,26 @@
       _partialTargets.add(clientId);
     }
   }
+  
+  /**
+   * @see org.apache.myfaces.trinidad.context.RequestContext#addPartialTargets(javax.faces.component.UIComponent,
java.lang.String[])
+   */
+  @Override
+  public void addPartialTargets(UIComponent from, String... targets)
+  {
+    if (targets == null)
+    {
+      return;
+    }
+    for (String target : targets)
+    {
+      UIComponent component = ComponentUtils.findRelativeComponent(from, target);
+      if (component != null)
+      {
+        addPartialTarget(component);
+      }
+    }
+  }
 
   @Override
   public void addPartialTriggerListeners

Modified: myfaces/trinidad/trunk/trinidad/trinidad-impl/src/test/java/org/apache/myfaces/trinidadinternal/renderkit/MRequestContext.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/trunk/trinidad/trinidad-impl/src/test/java/org/apache/myfaces/trinidadinternal/renderkit/MRequestContext.java?rev=571517&r1=571516&r2=571517&view=diff
==============================================================================
--- myfaces/trinidad/trunk/trinidad/trinidad-impl/src/test/java/org/apache/myfaces/trinidadinternal/renderkit/MRequestContext.java
(original)
+++ myfaces/trinidad/trunk/trinidad/trinidad-impl/src/test/java/org/apache/myfaces/trinidadinternal/renderkit/MRequestContext.java
Fri Aug 31 09:43:52 2007
@@ -238,6 +238,15 @@
   {
     // throw new UnsupportedOperationException("Not implemented yet");
   }
+  
+  /**
+   * @see org.apache.myfaces.trinidad.context.RequestContext#addPartialTargets(javax.faces.component.UIComponent,
java.lang.String[])
+   */
+  @Override
+  public void addPartialTargets(UIComponent from, String... targets)
+  {
+    
+  }
 
   @Override
   public void addPartialTriggerListeners(UIComponent listener, String[] trigger)



Mime
View raw message