Examples of IStringResourceLoader


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

   *
   */
  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, null));
    Assert.assertEquals("Valid resource string should be found", "Another string",
      loader.loadStringResource(p.getClass(), "another.test.string", Locale.getDefault(),
        null, null));
  }
View Full Code Here

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

    {
      private static final long serialVersionUID = 1L;
    };
    DummyPage page = new DummyPage();
    page.add(c);
    IStringResourceLoader loader = new ComponentStringResourceLoader();
    Assert.assertNull("Missing resource should return null", loader.loadStringResource(
      c.getClass(), "test.string.bad", Locale.getDefault(), null));
  }
View Full Code Here

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

    DummyPage p = new DummyPage();
    Panel panel = new Panel("panel");
    p.add(panel);
    DummyComponent c = new DummyComponent("hello", application);
    panel.add(c);
    IStringResourceLoader loader = new ComponentStringResourceLoader();
    Assert.assertEquals("Valid resourse string should be found", "Component string",
      loader.loadStringResource(c.getClass(), "component.string", Locale.getDefault(), null));
  }
View Full Code Here

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

   *
   */
  public void testLoadDirectFromPage()
  {
    DummyPage p = new DummyPage();
    IStringResourceLoader loader = new ComponentStringResourceLoader();
    Assert.assertEquals("Valid resourse string should be found", "Another string",
      loader.loadStringResource(p.getClass(), "another.test.string", Locale.getDefault(),
        null));
  }
View Full Code Here

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

   *
   */
  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

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

       
        /*
         * Delegate Wicket i18n support to spring i18n
         */
        getResourceSettings().addStringResourceLoader(
                new IStringResourceLoader() {
                    /* (non-Javadoc)
                     * @see org.apache.wicket.resource.loader.IStringResourceLoader#loadStringResource(java.lang.Class, java.lang.String, java.util.Locale, java.lang.String)
                     */
                    public String loadStringResource(Class clazz, String key,
                            Locale locale, String style) {
View Full Code Here

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

      // Iterate over all registered string resource loaders until the property has been found
      Iterator<IStringResourceLoader> iter = getStringResourceLoaders().iterator();
      value = null;
      while (iter.hasNext() && (value == null))
      {
        IStringResourceLoader loader = iter.next();
        value = loader.loadStringResource(component, key, locale, style, variation);
      }

      // Cache the result incl null if not found
      if (cacheKey != null)
      {
View Full Code Here

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

      // property has been found

      Iterator iter = resourceSettings.getStringResourceLoaders().iterator();
      while (iter.hasNext())
      {
        IStringResourceLoader loader = (IStringResourceLoader)iter.next();
        string = loader.loadStringResource(component, key);
        if (string != null)
        {
          break;
        }
      }
View Full Code Here

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

      // Iterate over all registered string resource loaders until the property has been found
      Iterator<IStringResourceLoader> iter = getStringResourceLoaders().iterator();
      value = null;
      while (iter.hasNext() && (value == null))
      {
        IStringResourceLoader loader = iter.next();
        value = loader.loadStringResource(component, key, locale, style, variation);
      }

      // Cache the result incl null if not found
      if (cacheKey != null)
      {
View Full Code Here

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

      // Iterate over all registered string resource loaders until the
      // property has been found
      Iterator<IStringResourceLoader> iter = getStringResourceLoaders();
      while (iter.hasNext())
      {
        IStringResourceLoader loader = iter.next();
        value = loader.loadStringResource(component, key);
        if (value != null)
        {
          break;
        }
      }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.