You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by sv...@apache.org on 2011/11/23 09:24:29 UTC

svn commit: r1205321 - in /wicket/branches/wicket-1.5.x/wicket-core: ./ src/main/java/org/apache/wicket/ src/main/java/org/apache/wicket/resource/loader/ src/main/java/org/apache/wicket/settings/def/ src/test/java/ src/test/java/org/apache/wicket/ src/...

Author: svenmeier
Date: Wed Nov 23 08:24:27 2011
New Revision: 1205321

URL: http://svn.apache.org/viewvc?rev=1205321&view=rev
Log:
WICKET-4162 InitializerStringResourceLoader for default string resources

Added:
    wicket/branches/wicket-1.5.x/wicket-core/src/main/java/org/apache/wicket/resource/loader/InitializerStringResourceLoader.java
      - copied unchanged from r1204836, wicket/trunk/wicket-core/src/main/java/org/apache/wicket/resource/loader/InitializerStringResourceLoader.java
    wicket/branches/wicket-1.5.x/wicket-core/src/test/java/org/apache/wicket/resource/loader/FooInitializer.java
      - copied unchanged from r1204836, wicket/trunk/wicket-core/src/test/java/org/apache/wicket/resource/loader/FooInitializer.java
    wicket/branches/wicket-1.5.x/wicket-core/src/test/java/org/apache/wicket/resource/loader/FooInitializer.properties
      - copied unchanged from r1204836, wicket/trunk/wicket-core/src/test/java/org/apache/wicket/resource/loader/FooInitializer.properties
    wicket/branches/wicket-1.5.x/wicket-core/src/test/java/org/apache/wicket/resource/loader/FooInitializer_alt.properties
      - copied unchanged from r1204836, wicket/trunk/wicket-core/src/test/java/org/apache/wicket/resource/loader/FooInitializer_alt.properties
    wicket/branches/wicket-1.5.x/wicket-core/src/test/java/org/apache/wicket/resource/loader/FooInitializer_zz.properties
      - copied unchanged from r1204836, wicket/trunk/wicket-core/src/test/java/org/apache/wicket/resource/loader/FooInitializer_zz.properties
    wicket/branches/wicket-1.5.x/wicket-core/src/test/java/org/apache/wicket/resource/loader/InitializerStringResourceLoaderTest.java
      - copied unchanged from r1204836, wicket/trunk/wicket-core/src/test/java/org/apache/wicket/resource/loader/InitializerStringResourceLoaderTest.java
Removed:
    wicket/branches/wicket-1.5.x/wicket-core/src/main/java/org/apache/wicket/resource/loader/JarStringResourceLoader.java
    wicket/branches/wicket-1.5.x/wicket-core/src/test/java/org/apache/wicket/resource/loader/JarStringResourceLoaderTest.java
    wicket/branches/wicket-1.5.x/wicket-core/src/test/java/wicket-jar.properties
    wicket/branches/wicket-1.5.x/wicket-core/src/test/java/wicket-jar_fr.properties.xml
Modified:
    wicket/branches/wicket-1.5.x/wicket-core/   (props changed)
    wicket/branches/wicket-1.5.x/wicket-core/src/main/java/org/apache/wicket/Application.java
    wicket/branches/wicket-1.5.x/wicket-core/src/main/java/org/apache/wicket/settings/def/ResourceSettings.java
    wicket/branches/wicket-1.5.x/wicket-core/src/test/java/org/apache/wicket/ApplicationSettingsTest.java

Propchange: wicket/branches/wicket-1.5.x/wicket-core/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Nov 23 08:24:27 2011
@@ -2,4 +2,5 @@
 /wicket/branches/wicket-1.4.x/wicket:963681,998663,1005194-1005196,1005201,1005205,1024347,1027877
 /wicket/sandbox/jthomerson/experimental/wicket-devutils/wicket:760296-760351,760353-760355
 /wicket/trunk/wicket:1005201
+/wicket/trunk/wicket-core:1204836,1204865
 /wicket/trunk/wicket-devutils/wicket:760352

Modified: wicket/branches/wicket-1.5.x/wicket-core/src/main/java/org/apache/wicket/Application.java
URL: http://svn.apache.org/viewvc/wicket/branches/wicket-1.5.x/wicket-core/src/main/java/org/apache/wicket/Application.java?rev=1205321&r1=1205320&r2=1205321&view=diff
==============================================================================
--- wicket/branches/wicket-1.5.x/wicket-core/src/main/java/org/apache/wicket/Application.java (original)
+++ wicket/branches/wicket-1.5.x/wicket-core/src/main/java/org/apache/wicket/Application.java Wed Nov 23 08:24:27 2011
@@ -918,6 +918,14 @@ public abstract class Application implem
 	}
 
 	/**
+	 * @return collection of initializers
+	 */
+	public final List<IInitializer> getInitializers()
+	{
+		return Collections.unmodifiableList(initializers);
+	}
+
+	/**
 	 * @return collection of application listeners
 	 */
 	public final ApplicationListenerCollection getApplicationListeners()

Modified: wicket/branches/wicket-1.5.x/wicket-core/src/main/java/org/apache/wicket/settings/def/ResourceSettings.java
URL: http://svn.apache.org/viewvc/wicket/branches/wicket-1.5.x/wicket-core/src/main/java/org/apache/wicket/settings/def/ResourceSettings.java?rev=1205321&r1=1205320&r2=1205321&view=diff
==============================================================================
--- wicket/branches/wicket-1.5.x/wicket-core/src/main/java/org/apache/wicket/settings/def/ResourceSettings.java (original)
+++ wicket/branches/wicket-1.5.x/wicket-core/src/main/java/org/apache/wicket/settings/def/ResourceSettings.java Wed Nov 23 08:24:27 2011
@@ -40,7 +40,7 @@ import org.apache.wicket.resource.Proper
 import org.apache.wicket.resource.loader.ClassStringResourceLoader;
 import org.apache.wicket.resource.loader.ComponentStringResourceLoader;
 import org.apache.wicket.resource.loader.IStringResourceLoader;
-import org.apache.wicket.resource.loader.JarStringResourceLoader;
+import org.apache.wicket.resource.loader.InitializerStringResourceLoader;
 import org.apache.wicket.resource.loader.PackageStringResourceLoader;
 import org.apache.wicket.resource.loader.ValidatorStringResourceLoader;
 import org.apache.wicket.settings.IResourceSettings;
@@ -159,11 +159,10 @@ public class ResourceSettings implements
 	 * </ul>
 	 * </dd>
 	 * <dt>validator specific</dt>
-	 * <dt>jar specific</dt>
+	 * <dt>Initializer specific</dt>
 	 * <dd>
 	 * <ul>
-	 * <li>wicket-jar.properties (in jar containing Foo)</li>
-	 * <li>wicket-jar.properties (in jar containing Component)</li>
+	 * <li>bar.Foo.properties (Foo implementing IInitializer)</li>
 	 * </ul>
 	 * </dd>
 	 * </dl>
@@ -177,7 +176,7 @@ public class ResourceSettings implements
 		stringResourceLoaders.add(new PackageStringResourceLoader());
 		stringResourceLoaders.add(new ClassStringResourceLoader(application.getClass()));
 		stringResourceLoaders.add(new ValidatorStringResourceLoader());
-		stringResourceLoaders.add(new JarStringResourceLoader());
+		stringResourceLoaders.add(new InitializerStringResourceLoader(application.getInitializers()));
 	}
 
 	/**

Modified: wicket/branches/wicket-1.5.x/wicket-core/src/test/java/org/apache/wicket/ApplicationSettingsTest.java
URL: http://svn.apache.org/viewvc/wicket/branches/wicket-1.5.x/wicket-core/src/test/java/org/apache/wicket/ApplicationSettingsTest.java?rev=1205321&r1=1205320&r2=1205321&view=diff
==============================================================================
--- wicket/branches/wicket-1.5.x/wicket-core/src/test/java/org/apache/wicket/ApplicationSettingsTest.java (original)
+++ wicket/branches/wicket-1.5.x/wicket-core/src/test/java/org/apache/wicket/ApplicationSettingsTest.java Wed Nov 23 08:24:27 2011
@@ -28,7 +28,7 @@ import org.apache.wicket.resource.loader
 import org.apache.wicket.resource.loader.ClassStringResourceLoader;
 import org.apache.wicket.resource.loader.ComponentStringResourceLoader;
 import org.apache.wicket.resource.loader.IStringResourceLoader;
-import org.apache.wicket.resource.loader.JarStringResourceLoader;
+import org.apache.wicket.resource.loader.InitializerStringResourceLoader;
 import org.apache.wicket.resource.loader.PackageStringResourceLoader;
 import org.apache.wicket.resource.loader.ValidatorStringResourceLoader;
 import org.apache.wicket.settings.IFrameworkSettings;
@@ -128,8 +128,8 @@ public class ApplicationSettingsTest
 			loaders.get(2) instanceof ClassStringResourceLoader);
 		Assert.assertTrue("Fourth loader should be the validator one",
 			loaders.get(3) instanceof ValidatorStringResourceLoader);
-		Assert.assertTrue("Fifth should be the classpath one",
-			loaders.get(4) instanceof JarStringResourceLoader);
+		Assert.assertTrue("Fifth should be the initializer one",
+			loaders.get(4) instanceof InitializerStringResourceLoader);
 	}
 
 	/**