Author: ivaynberg
Date: Tue Mar  3 02:59:47 2009
New Revision: 749516

URL: http://svn.apache.org/viewvc?rev=749516&view=rev
Log:
WICKET-2090

Modified:
    
wicket/branches/wicket-1.3.x/jdk-1.4/wicket/src/main/java/org/apache/wicket/RequestCycle.java
    
wicket/branches/wicket-1.3.x/jdk-1.4/wicket/src/main/java/org/apache/wicket/util/collections/ArrayListStack.java

Modified: 
wicket/branches/wicket-1.3.x/jdk-1.4/wicket/src/main/java/org/apache/wicket/RequestCycle.java
URL: 
http://svn.apache.org/viewvc/wicket/branches/wicket-1.3.x/jdk-1.4/wicket/src/main/java/org/apache/wicket/RequestCycle.java?rev=749516&r1=749515&r2=749516&view=diff
==============================================================================
--- 
wicket/branches/wicket-1.3.x/jdk-1.4/wicket/src/main/java/org/apache/wicket/RequestCycle.java
 (original)
+++ 
wicket/branches/wicket-1.3.x/jdk-1.4/wicket/src/main/java/org/apache/wicket/RequestCycle.java
 Tue Mar  3 02:59:47 2009
@@ -17,6 +17,7 @@
 package org.apache.wicket;
 
 import java.io.Serializable;
+import java.util.Collection;
 import java.util.Iterator;
 import java.util.Map;
 import java.util.Map.Entry;
@@ -232,7 +233,42 @@
        private boolean redirect;
 
        /** holds the stack of set {...@link IRequestTarget}, the last set op 
top. */
-       private transient final ArrayListStack requestTargets = new 
ArrayListStack(3);
+       private transient final ArrayListStack requestTargets = new 
ArrayListStack(3)
+       {
+               private static final long serialVersionUID = 1L;
+
+               public void add(int arg0, Object arg1)
+               {
+                       onRequestTargetSet((IRequestTarget)arg1);
+                       super.add(arg0, arg1);
+               }
+
+               public boolean add(Object arg0)
+               {
+                       onRequestTargetSet((IRequestTarget)arg0);
+                       return super.add(arg0);
+               }
+
+               public boolean addAll(Collection arg0)
+               {
+                       Iterator it = arg0.iterator();
+                       while (it.hasNext())
+                       {
+                               onRequestTargetSet((IRequestTarget)it.next());
+                       }
+                       return super.addAll(arg0);
+               }
+
+               public boolean addAll(int arg0, Collection arg1)
+               {
+                       Iterator it = arg1.iterator();
+                       while (it.hasNext())
+                       {
+                               onRequestTargetSet((IRequestTarget)it.next());
+                       }
+                       return super.addAll(arg0, arg1);
+               }
+       };
 
        /**
         * Any page parameters. Only set when the request is resolving and the 
parameters are passed
@@ -615,6 +651,15 @@
        }
 
        /**
+        * Called when a request target is set on the request cycle
+        * 
+        * @param requestTarget
+        */
+       protected void onRequestTargetSet(IRequestTarget requestTarget)
+       {
+       }
+
+       /**
         * Sets response.
         * 
         * @param response
@@ -631,7 +676,7 @@
        /**
         * Attempts to return name of current page map
         * 
-        * @return
+        * @return name of current page map
         */
        private String getCurrentPageMap()
        {
@@ -1246,6 +1291,7 @@
                                        // on the stack before this. If that is 
the case, they
                                        // should be handled before this
                                        requestTargets.add(0, target);
+                                       onRequestTargetResolved(target);
                                        break;
                                }
                                case PROCESS_EVENTS : {
@@ -1312,6 +1358,15 @@
        }
 
        /**
+        * Called after request target is resolved by the request cycle 
processor
+        * 
+        * @param target
+        */
+       protected void onRequestTargetResolved(IRequestTarget target)
+       {
+       }
+
+       /**
         * INTERNAL. This method is not part of public Wicket Api. Do not call 
it. Returns whether
         * wicket handled this request or not (i.e. when no request target was 
found).
         * 

Modified: 
wicket/branches/wicket-1.3.x/jdk-1.4/wicket/src/main/java/org/apache/wicket/util/collections/ArrayListStack.java
URL: 
http://svn.apache.org/viewvc/wicket/branches/wicket-1.3.x/jdk-1.4/wicket/src/main/java/org/apache/wicket/util/collections/ArrayListStack.java?rev=749516&r1=749515&r2=749516&view=diff
==============================================================================
--- 
wicket/branches/wicket-1.3.x/jdk-1.4/wicket/src/main/java/org/apache/wicket/util/collections/ArrayListStack.java
 (original)
+++ 
wicket/branches/wicket-1.3.x/jdk-1.4/wicket/src/main/java/org/apache/wicket/util/collections/ArrayListStack.java
 Tue Mar  3 02:59:47 2009
@@ -27,7 +27,7 @@
  * 
  * @author Jonathan Locke
  */
-public final class ArrayListStack extends ArrayList
+public class ArrayListStack extends ArrayList
 {
        private static final long serialVersionUID = 1L;
 
@@ -118,8 +118,8 @@
         * Returns the 1-based position where an object is on this stack. If 
the object <tt>o</tt>
         * occurs as an item in this stack, this method returns the distance 
from the top of the stack
         * of the occurrence nearest the top of the stack; the topmost item on 
the stack is considered
-        * to be at distance <tt>1</tt>. The <tt>equals</tt> method is used to 
compare <tt>o</tt>
-        * to the items in this stack.
+        * to be at distance <tt>1</tt>. The <tt>equals</tt> method is used to 
compare <tt>o</tt> to the
+        * items in this stack.
         * 
         * @param o
         *            the desired object.


Reply via email to