Author: jdonnerstag
Date: Sat Mar 19 19:50:39 2011
New Revision: 1083269

URL: http://svn.apache.org/viewvc?rev=1083269&view=rev
Log:
introduce Markup.replace(MarkupElement)

Modified:
    wicket/trunk/wicket-core/src/main/java/org/apache/wicket/markup/Markup.java

Modified: 
wicket/trunk/wicket-core/src/main/java/org/apache/wicket/markup/Markup.java
URL: 
http://svn.apache.org/viewvc/wicket/trunk/wicket-core/src/main/java/org/apache/wicket/markup/Markup.java?rev=1083269&r1=1083268&r2=1083269&view=diff
==============================================================================
--- wicket/trunk/wicket-core/src/main/java/org/apache/wicket/markup/Markup.java 
(original)
+++ wicket/trunk/wicket-core/src/main/java/org/apache/wicket/markup/Markup.java 
Sat Mar 19 19:50:39 2011
@@ -20,6 +20,7 @@ import java.util.ArrayList;
 import java.util.Collections;
 import java.util.List;
 
+import org.apache.wicket.util.lang.Args;
 import org.apache.wicket.util.resource.StringResourceStream;
 import org.apache.wicket.util.string.AppendingStringBuffer;
 import org.apache.wicket.util.string.Strings;
@@ -98,6 +99,24 @@ public class Markup implements IMarkupFr
 
        /**
         * 
+        * @param index
+        * @param elem
+        */
+       public final void replace(final int index, final MarkupElement elem)
+       {
+               Args.notNull(elem, "elem");
+
+               if ((index < 0) || (index >= size()))
+               {
+                       throw new IndexOutOfBoundsException("'index' must be 
smaller than size(). Index:" +
+                               index + "; size:" + size());
+               }
+
+               markupElements.set(index, elem);
+       }
+
+       /**
+        * 
         * @return The fixed location as a string, e.g. the file name or the 
URL. Return null to avoid
         *         caching the markup.
         */


Reply via email to