Package org.apache.wicket.resource.loader

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


   *            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)
  {
    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 PackageStringResourceLoader());
    stringResourceLoaders.add(new ClassStringResourceLoader(this.application.getClass()));
  }
View Full Code Here

  public void testTwoComponents()
  {
    Session.get().setLocale(Locale.ENGLISH);
    MyMockPage page = new MyMockPage();
    Application.get().getResourceSettings().addStringResourceLoader(
      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

   * @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)
  {
    stringResourceLoaders.add(new ComponentStringResourceLoader());
    stringResourceLoaders.add(new PackageStringResourceLoader());
    stringResourceLoaders.add(new ClassStringResourceLoader(application.getClass()));
    stringResourceLoaders.add(new ValidatorStringResourceLoader());
  }
View Full Code Here

  public void testTwoComponents()
  {
    Session.get().setLocale(Locale.ENGLISH);
    MyMockPage page = new MyMockPage();
    Application.get().getResourceSettings().addStringResourceLoader(
        new ComponentStringResourceLoader());

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

    @SuppressWarnings({ "unchecked", "rawtypes" })
    public void addMenuItem(String index, Class<? extends WebPage> linkClass, String langKey, String langDescKey,
            ResourceReference icon, String... authority) {

        ComponentStringResourceLoader csrl = new ComponentStringResourceLoader();
        String label =
            csrl.loadStringResource(linkClass, langKey, getSession().getLocale(), getSession().getStyle(), "");
        String description =
            csrl.loadStringResource(linkClass, langDescKey, getSession().getLocale(), getSession().getStyle(), "");
        BookmarkablePageLabelLink pageLabelLink = new BookmarkablePageLabelLink("link", linkClass, label);
        addAuthorizationRoles(pageLabelLink, authority);

        if (icon == null) {
            menuItems.add(new MenuItem(index, pageLabelLink, description));
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

   *            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

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.