Package org.apache.wicket.resource.loader

Examples of org.apache.wicket.resource.loader.ComponentStringResourceLoader


   *
   */
  public void testSearchClassHierarchyFromPage()
  {
    DummySubClassPage p = new DummySubClassPage();
    IStringResourceLoader loader = new ComponentStringResourceLoader();
    Assert.assertEquals("Valid resource string should be found", "SubClass Test String",
      loader.loadStringResource(p.getClass(), "subclass.test.string", Locale.getDefault(),
        null));
    Assert.assertEquals("Valid resource string should be found", "Another string",
      loader.loadStringResource(p.getClass(), "another.test.string", Locale.getDefault(),
        null));
  }
View Full Code Here


  {
    IResourceSettings settings = new ResourceSettings(new MockApplication());
    settings.getStringResourceLoaders().clear();
    settings.getStringResourceLoaders().add(
      new BundleStringResourceLoader("org.apache.wicket.resource.DummyResources"));
    settings.getStringResourceLoaders().add(new ComponentStringResourceLoader());
    List<IStringResourceLoader> loaders = settings.getStringResourceLoaders();
    Assert.assertEquals("There should be 2 overridden loaders", 2, loaders.size());
    Assert.assertTrue("First loader one should be the bundle one",
      loaders.get(0) instanceof BundleStringResourceLoader);
    Assert.assertTrue("Second loader should be the component one",
View Full Code Here

   *
   * @param application
   */
  public ResourceSettings(final Application application)
  {
    stringResourceLoaders.add(new ComponentStringResourceLoader());
    stringResourceLoaders.add(new PackageStringResourceLoader());
    stringResourceLoaders.add(new ClassStringResourceLoader(application.getClass()));
    stringResourceLoaders.add(new ValidatorStringResourceLoader());
  }
View Full Code Here

   * @param application
   */
  public ResourceSettings(final Application application)
  {
    this.application = application;
    stringResourceLoaders.add(new ComponentStringResourceLoader());
    stringResourceLoaders.add(new PackageStringResourceLoader());
    stringResourceLoaders.add(new ClassStringResourceLoader(application.getClass()));
    stringResourceLoaders.add(new ValidatorStringResourceLoader());
  }
View Full Code Here

   *            The application that these settings are for
   */
  public Settings(final Application application)
  {
    this.application = application;
    stringResourceLoaders.add(new ComponentStringResourceLoader());
    stringResourceLoaders.add(new ClassStringResourceLoader(this.application.getClass()));
  }
View Full Code Here

   * @param application
   */
  public ResourceSettings(final Application application)
  {
    this.application = application;
    stringResourceLoaders.add(new ComponentStringResourceLoader());
    stringResourceLoaders.add(new PackageStringResourceLoader());
    stringResourceLoaders.add(new ClassStringResourceLoader(application.getClass()));
    stringResourceLoaders.add(new ValidatorStringResourceLoader());
    stringResourceLoaders.add(new InitializerStringResourceLoader(application.getInitializers()));
  }
View Full Code Here

    Session.get().setLocale(Locale.ENGLISH);
    MyMockPage page = new MyMockPage();
    Application.get()
      .getResourceSettings()
      .getStringResourceLoaders()
      .add(new ComponentStringResourceLoader());

    Localizer localizer = Application.get().getResourceSettings().getLocalizer();
    assertEquals("value 1", localizer.getString("null", page.drop1));
    assertEquals("value 2", localizer.getString("null", page.drop2));
View Full Code Here

   *            The application that these settings are for
   */
  public Settings(final Application application)
  {
    this.application = application;
    stringResourceLoaders.add(new ComponentStringResourceLoader());
    stringResourceLoaders.add(new PackageStringResourceLoader());
    stringResourceLoaders.add(new ClassStringResourceLoader(this.application.getClass()));
    stringResourceLoaders.add(new ValidatorStringResourceLoader());
  }
View Full Code Here

   * @param application
   */
  public ResourceSettings(final Application application)
  {
    this.application = application;
    stringResourceLoaders.add(new ComponentStringResourceLoader());
    stringResourceLoaders.add(new PackageStringResourceLoader());
    stringResourceLoaders.add(new ClassStringResourceLoader(application.getClass()));
    stringResourceLoaders.add(new ValidatorStringResourceLoader());
    stringResourceLoaders.add(new InitializerStringResourceLoader(application.getInitializers()));
  }
View Full Code Here

   * @param application
   */
  public ResourceSettings(final Application application)
  {
    this.application = application;
    stringResourceLoaders.add(new ComponentStringResourceLoader());
    stringResourceLoaders.add(new PackageStringResourceLoader());
    stringResourceLoaders.add(new ClassStringResourceLoader(application.getClass()));
    stringResourceLoaders.add(new ValidatorStringResourceLoader());
    stringResourceLoaders.add(new InitializerStringResourceLoader(application.getInitializers()));
  }
View Full Code Here

TOP

Related Classes of org.apache.wicket.resource.loader.ComponentStringResourceLoader

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.