Package org.apache.wicket.resource

Examples of org.apache.wicket.resource.IPropertiesFactory


    {
      return null;
    }

    // Load the properties associated with the path
    IPropertiesFactory propertiesFactory = Application.get().getResourceSettings()
        .getPropertiesFactory();

    while (true)
    {
      // Create the base path
      String path = clazz.getName().replace('.', '/');

      // Iterator over all the combinations
      ResourceNameIterator iter = new ResourceNameIterator(path, style, locale,
          "properties,xml");
      while (iter.hasNext())
      {
        String newPath = (String)iter.next();

        final Properties props = propertiesFactory.load(clazz, newPath);
        if (props != null)
        {
          // Lookup the value
          String value = props.getString(key);
          if (value != null)
View Full Code Here


    if (clazz == null)
    {
      return null;
    }
    // Load the properties associated with the path
    IPropertiesFactory propertiesFactory = Application.get()
      .getResourceSettings()
      .getPropertiesFactory();

    while (true)
    {
      String packageName = clazz.getPackage().getName();
      packageName = packageName.replace('.', '/');

      while (packageName.length() > 0)
      {
        // Create the base path
        String path = packageName + "/" + filename;

        // Iterator over all the combinations
        ResourceNameIterator iter = new ResourceNameIterator(path, style, locale, null);
        while (iter.hasNext())
        {
          String newPath = iter.next();

          final Properties props = propertiesFactory.load(clazz, newPath);
          if (props != null)
          {
            // Lookup the value
            String value = props.getString(key);
            if (value != null)
View Full Code Here

      log.debug("key: '" + key + "'; class: '" + clazz.getName() + "'; locale: '" + locale +
        "'; Style: '" + style + "'");
    }

    // Load the properties associated with the path
    IPropertiesFactory propertiesFactory = getPropertiesFactory();
    while (true)
    {
      // Create the base path
      String path = clazz.getName().replace('.', '/');

      // Iterator over all the combinations
      ResourceNameIterator iter = new ResourceNameIterator(path, style, locale, null);
      while (iter.hasNext())
      {
        String newPath = iter.next();

        final Properties props = propertiesFactory.load(clazz, newPath);
        if (props != null)
        {
          // Lookup the value
          String value = props.getString(key);
          if (value != null)
View Full Code Here

    if (clazz == null || !IValidator.class.isAssignableFrom(clazz))
    {
      return null;
    }

    IPropertiesFactory propertiesFactory = Application.get()
      .getResourceSettings()
      .getPropertiesFactory();

    while (true)
    {
      // figure out the base path for the class
      String path = clazz.getName().replace('.', '/');

      // iterate over all the combinations
      ResourceNameIterator iter = new ResourceNameIterator(path, style, locale, null);
      while (iter.hasNext())
      {
        String newPath = iter.next();

        final Properties props = propertiesFactory.load(clazz, newPath);
        if (props != null)
        {
          // Lookup the value
          String value = props.getString(key);
          if (value != null)
View Full Code Here

   */
  public void testRenderHomePage_2() throws Exception
  {
    // Avoid the conflict by limiting the search for properties files
    // to *.properties
    IPropertiesFactory myFac = new MyPropertiesFactory(tester.getApplication());
    tester.getApplication().getResourceSettings().setPropertiesFactory(myFac);

    executeTest(TestPage_1.class, "TestPageExpectedResult_1.xml");
  }
View Full Code Here

    if (clazz == null)
    {
      return null;
    }
    // Load the properties associated with the path
    IPropertiesFactory propertiesFactory = Application.get()
      .getResourceSettings()
      .getPropertiesFactory();

    while (true)
    {
      Package pkg = clazz.getPackage();
      String packageName = (pkg == null) ? "" : pkg.getName();
      packageName = packageName.replace('.', '/');

      do
      {
        // Create the base path
        String path = filename;
        if (packageName.length() > 0)
        {
          path = packageName + "/" + path;
        }

        // Iterator over all the combinations
        ResourceNameIterator iter = new ResourceNameIterator(path, style, locale, null);
        while (iter.hasNext())
        {
          String newPath = iter.next();

          final Properties props = propertiesFactory.load(clazz, newPath);
          if (props != null)
          {
            // Lookup the value
            String value = props.getString(key);
            if (value != null)
View Full Code Here

    {
      return null;
    }

    // Load the properties associated with the path
    IPropertiesFactory propertiesFactory = Application.get().getResourceSettings()
        .getPropertiesFactory();

    while (true)
    {
      // Create the base path
      String path = clazz.getName().replace('.', '/');

      // Iterator over all the combinations
      ResourceNameIterator iter = new ResourceNameIterator(path, style, locale,
          "properties,xml");
      while (iter.hasNext())
      {
        String newPath = (String)iter.next();

        final Properties props = propertiesFactory.load(clazz, newPath);
        if (props != null)
        {
          // Lookup the value
          String value = props.getString(key);
          if (value != null)
View Full Code Here

  /**
   * @throws Exception
   */
  public void testRenderHomePage_2() throws Exception
  {
    IPropertiesFactory myFac = new MyPropertiesFactory(tester.getApplication());
    tester.getApplication().getResourceSettings().setPropertiesFactory(myFac);

    executeTest(XmlPage_2.class, "XmlPageExpectedResult_2.xml");
  }
View Full Code Here

  /**
   * @throws Exception
   */
  public void testRenderHomePage_3() throws Exception
  {
    IPropertiesFactory myFac = new MyPropertiesFactory(tester.getApplication());
    tester.getApplication().getResourceSettings().setPropertiesFactory(myFac);

    executeTest(XmlPage_3.class, "XmlPageExpectedResult_3.xml");
  }
View Full Code Here

   */
  public void testRenderHomePage_2() throws Exception
  {
    // Avoid the conflict by limiting the search for properties files
    // to *.properties
    IPropertiesFactory myFac = new MyPropertiesFactory(tester.getApplication());
    tester.getApplication().getResourceSettings().setPropertiesFactory(myFac);

    executeTest(TestPage_1.class, "TestPageExpectedResult_1.xml");
  }
View Full Code Here

TOP

Related Classes of org.apache.wicket.resource.IPropertiesFactory

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.