Package org.apache.wicket.resource.loader

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


   * @return this for chaining.
   */
  protected AbstractPlugin addResourceBundle(final String resourceBundleName)
  {
    this.resourceBundleName = resourceBundleName;
    resourceSettings.getStringResourceLoaders().add(new BundleStringResourceLoader(resourceBundleName));
    return this;
  }
View Full Code Here


    protected void init()
    {
      super.init();
      final ClassPathXmlApplicationContext context = getTestConfiguration().getApplicationContext();
      getComponentInstantiationListeners().add(new SpringComponentInjector(this, context, true));
      getResourceSettings().getStringResourceLoaders().add(new BundleStringResourceLoader(WicketApplication.RESOURCE_BUNDLE_NAME));
      final ConfigurableListableBeanFactory beanFactory = context.getBeanFactory();
      beanFactory.autowireBeanProperties(this, AutowireCapableBeanFactory.AUTOWIRE_BY_NAME, false);
      UserXmlPreferencesCache.setInternalInstance(userXmlPreferencesCache);
    }
View Full Code Here

  protected void setUp() throws Exception
  {
    tester = new WicketTester();
    tester.getApplication().getResourceSettings().addStringResourceLoader(
        new BundleStringResourceLoader("org.apache.wicket.model.StringResourceModelTest"));
    page = new MockPage();
    ws = new WeatherStation();
    wsModel = new Model(ws);
  }
View Full Code Here

  protected void setUp() throws Exception
  {
    tester = new WicketTester();
    tester.getApplication().getResourceSettings().addStringResourceLoader(
        new BundleStringResourceLoader("org.apache.wicket.model.StringResourceModelTest"));
    page = new MockPage();
    ws = new WeatherStation();
    wsModel = new Model(ws);
  }
View Full Code Here

   * Create and return the loader instance.
   * @return The loader instance to test
   */
  protected IStringResourceLoader createLoader()
  {
    return new BundleStringResourceLoader("org.apache.wicket.resource.DummyResources");
  }
View Full Code Here

  /**
   * @see org.apache.wicket.resource.StringResourceLoaderTestBase#testLoaderUnknownResources()
   */
  public void testLoaderUnknownResources()
  {
    IStringResourceLoader loader = new BundleStringResourceLoader("unknown.resource");
    Assert.assertNull("Unknown resource should return null", loader.loadStringResource(component.getClass(),
        "test.string", Locale.getDefault(), null));
  }
View Full Code Here

   */
  public void testOverrideStringResourceLoaderSetup()
  {
    Application dummy = tester.getApplication();
    Settings settings = new Settings(dummy);
    settings.addStringResourceLoader(new BundleStringResourceLoader(
        "org.apache.wicket.resource.DummyResources"));
    settings.addStringResourceLoader(new ComponentStringResourceLoader());
    List loaders = settings.getStringResourceLoaders();
    Assert.assertEquals("There should be 2 overridden loaders", 2, loaders.size());
    Assert.assertTrue("First loader one should be the bundle one",
View Full Code Here

TOP

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

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.