Package org.apache.wicket.request.resource

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


   * Relative ResourceReferences, WICKET-3514
   */
  @Test
  public void resourceReferenceWithModifiedSegments()
  {
    PackageResourceReference resource = new PackageResourceReference(getClass(),
      "crypt/crypt.txt");
    Url url = mapper.mapHandler(new ResourceReferenceRequestHandler(resource));
    url.getSegments().remove(url.getSegments().size() - 1);
    url.getSegments().add("modified-crypt.txt");

View Full Code Here


   * Relative ResourceReferences, WICKET-3514
   */
  @Test
  public void resourceReferenceWithMoreSegments()
  {
    PackageResourceReference resource = new PackageResourceReference(getClass(),
      "crypt/crypt.txt");
    Url url = mapper.mapHandler(new ResourceReferenceRequestHandler(resource));
    url.getSegments().remove(url.getSegments().size() - 1);
    url.getSegments().add("more");
    url.getSegments().add("more-crypt.txt");
View Full Code Here

   * Relative ResourceReferences, WICKET-3514
   */
  @Test
  public void resourceReferenceWithLessSegments()
  {
    PackageResourceReference resource = new PackageResourceReference(getClass(),
      "crypt/crypt.txt");
    Url url = mapper.mapHandler(new ResourceReferenceRequestHandler(resource));
    url.getSegments().remove(url.getSegments().size() - 1);
    url.getSegments().remove(url.getSegments().size() - 1);
    url.getSegments().add("less-crypt.txt");
View Full Code Here

   * Will let the wizard contribute a CSS include to the page's header. It will add Wizard.css
   * from this package. This method is typically called by the class that creates the wizard.
   */
  public void addDefaultCssStyle(final IHeaderResponse response)
  {
    response.renderCSSReference(new PackageResourceReference(Wizard.class, "Wizard.css"));
  }
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

        return new DecoratingHeaderResponse(response)
        {
          @Override
          public void renderJavaScriptReference(ResourceReference reference, String id)
          {
            super.renderJavaScriptReference(new PackageResourceReference("DECORATED-" +
              reference.getName()), id);
          }
        };
      }
    });
View Full Code Here

    @Override
    public void renderHead(IHeaderResponse response)
    {
      for (int i = 0; i < 10; i++)
      {
        response.renderJavaScriptReference(new PackageResourceReference("res" + i),
          Integer.toString(i));
      }
    }
View Full Code Here

{
  public final Image image;

  public AjaxyImagesPage()
  {
    image = new Image("image", new PackageResourceReference(AjaxyImagesPage.class, "Beer.gif"));
    image.setOutputMarkupId(true);

    add(image);

    AjaxLink<Void> link = new AjaxLink<Void>("link")
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

    @Override
    public void renderHead(IHeaderResponse response)
    {
      if (AjaxRequestTarget.get() != null)
      {
        response.renderCSSReference(new PackageResourceReference(HomePage.class, "ajax.css"));
        response.renderJavaScriptReference(new PackageResourceReference(HomePage.class,
          "ajax.js"));
        response.renderOnDomReadyJavaScript("updatePending();");
      }
    }
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.