Package org.apache.wicket.request.resource

Examples of org.apache.wicket.request.resource.PackageResourceReference


        setResponsePage(new BookDetails(new Book("Inside The Matrix")));
      }
    });

    // Image map link example
    Image imageForMap = new Image("imageForMap", new PackageResourceReference(Home.class,
      "ImageMap.gif"));
    add(imageForMap);
    add(new ClientSideImageMap("imageMap", imageForMap).addRectangleArea(
      new BookmarkablePageLink<Page1>("page1", Page1.class), 0, 0, 100, 100)
      .addCircleArea(new BookmarkablePageLink<Page2>("page2", Page2.class), 160, 50, 35)
View Full Code Here


      this.attribute = attribute;
      // Check whether it is a valid resource reference
      if (PackageResource.exists(clazz, href, getLocale(), getStyle(), getVariation()))
      {
        // Create the component implementing the link
        resourceReference = new PackageResourceReference(clazz, href, getLocale(),
          getStyle(), getVariation());
      }
      else
      {
        // The resource does not exist. Set to null and ignore when
View Full Code Here

    resourceUrlGeneratedByResourceReference();
  }

  private void resourceUrlGeneratedByResourceReference()
  {
    final ResourceReference ref = new PackageResourceReference(
      ParentResourceEscapePathTestPage.class, "../../../ParentResourceTest.js");

    assertContains(tester.getRequestCycle().mapUrlFor(ref, null).toString(),
      expectedResourceUrl());
  }
View Full Code Here

  {
    ResourceReference rr = new SharedResourceReference("test");
    CharSequence url = tester.getRequestCycle().mapUrlFor(rr, null).toString();
    assertEquals("wicket/resource/org.apache.wicket.Application/test", url);

    rr = new PackageResourceReference(SharedResourceUrlTest.class, "test");
    url = tester.getRequestCycle().mapUrlFor(rr, null).toString();
    assertEquals("wicket/resource/org.apache.wicket.SharedResourceUrlTest/test", url);
  }
View Full Code Here

    CharSequence url = tester.getRequestCycle()
      .mapUrlFor(rr, new PageParameters().set("param", "value"))
      .toString();
    assertEquals("wicket/resource/org.apache.wicket.Application/test?param=value", url);

    rr = new PackageResourceReference(SharedResourceUrlTest.class, "test");
    url = tester.getRequestCycle()
      .mapUrlFor(rr, new PageParameters().set("param", "value"))
      .toString();
    assertEquals("wicket/resource/org.apache.wicket.SharedResourceUrlTest/test?param=value",
      url);
View Full Code Here

  }

  @Override
  public void renderHead(IHeaderResponse response)
  {
    response.renderCSSReference(new PackageResourceReference(PanelWithHeaderPart.class,
      "test.css"));
    response.renderJavascriptReference(new JavascriptResourceReference(
      PanelWithHeaderPart.class, "test.js"));
  }
View Full Code Here

    resourceUrlGeneratedByResourceReference();
  }

  private void resourceUrlGeneratedByResourceReference()
  {
    final ResourceReference ref = new PackageResourceReference(
      ParentResourceEscapePathTestPage.class, "../../../ParentResourceTest.js");

    assertContains(tester.getRequestCycle().mapUrlFor(ref, null).toString(),
      expectedResourceUrl());
  }
View Full Code Here

   * @throws Exception
   */
  @Test
  public void lenientPackageResourceMatching() throws Exception
  {
    ResourceReference invalidResource = new PackageResourceReference(PackageResourceTest.class,
      "i_do_not_exist.txt", Locale.ENGLISH, null, null);
    assertNotNull(
      "resource i_do_not_exist.txt SHOULD be available as a packaged resource even if it doesn't exist",
      invalidResource.getResource());

    assertTrue(PackageResource.exists(PackageResourceTest.class, "packaged1.txt", null, null,
      null));
    assertTrue(PackageResource.exists(PackageResourceTest.class, "packaged1.txt", Locale.CHINA,
      null, null));
View Full Code Here

  @Override
  public void renderHead(final IHeaderResponse response)
  {
    super.renderHead(response);

    response.renderCSSReference(new PackageResourceReference(
      DefaultCssAutoCompleteTextField.class, "DefaultCssAutoCompleteTextField.css"));
  }
View Full Code Here

        return "wicketDebugBar" + (DebugBar.this.hasErrorMessage() ? "Error" : "");
      }

    }));

    add(new Image("logo", new PackageResourceReference(DebugBar.class, "wicket.png")));
    add(new Image("removeImg", new PackageResourceReference(DebugBar.class, "remove.png")));
    List<IDebugBarContributor> contributors = getContributors();

    add(new ListView<IDebugBarContributor>("contributors", contributors)
    {
      private static final long serialVersionUID = 1L;
View Full Code Here

TOP

Related Classes of org.apache.wicket.request.resource.PackageResourceReference

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.