Package org.apache.wicket.request.resource

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


    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


  {
    super.setUp();

    resource = new TestResource();
    tester.getApplication().getSharedResources().add(SHARED_NAME, resource);
    ResourceReference resourceReference = new SharedResourceReference(SHARED_NAME);
    mapper = new ResourceMapper("/test/resource", resourceReference);
    mapperWithPlaceholder = new ResourceMapper("/test2/${name}/resource", resourceReference);
    tester.getApplication().getRootRequestMapperAsCompound().add(mapper);
  }
View Full Code Here

   *            the resource to test
   * @return the used {@link ResourceReference} for the simulation
   */
  public ResourceReference startResource(final IResource resource)
  {
    return startResourceReference(new ResourceReference("testResourceReference")
    {
      private static final long serialVersionUID = 1L;

      @Override
      public IResource getResource()
View Full Code Here

   */
  @Override
  public void renderHead(final IHeaderResponse response)
  {
    response.renderJavaScriptReference(JAVASCRIPT);
    ResourceReference css = getCSS();
    if (css != null)
    {
      response.renderCSSReference(css);
    }
  }
View Full Code Here

   *            the resource to test
   * @return the used {@link ResourceReference} for the simulation
   */
  public ResourceReference startResource(final IResource resource)
  {
    return startResourceReference(new ResourceReference("testResourceReference")
    {
      private static final long serialVersionUID = 1L;

      @Override
      public IResource getResource()
View Full Code Here

  /* check if all provided resources are package resources */
  private void checkProvidedResources()
  {
    for (T curProvidedResource : providedResources)
    {
      ResourceReference reference = curProvidedResource.getReference();
      if (!(reference instanceof CssResourceReference || reference instanceof JavaScriptResourceReference))
      {
        throw new IllegalArgumentException(
          "ConcatResourceBundleReference only works with CssResourceReference and JavaScriptResourceReference, " +
            curProvidedResource + " provides a " +
            reference.getClass().getSimpleName());
      }
    }
  }
View Full Code Here

    super.renderHead(response);

    CoreLibrariesContributor.contributeAjax(getApplication(), response);
    response.render(JavaScriptHeaderItem.forReference(JAVASCRIPT));

    ResourceReference cssResource = newCssResource();
    if (cssResource != null)
    {
      response.render(CssHeaderItem.forReference(cssResource));
    }
  }
View Full Code Here

        if (pageId != NO_PAGE_ID)
        {
          page.send(application, Broadcast.BREADTH, payload);
        } else
        {
          ResourceReference reference = new SharedResourceReference(resourceName);
          IResource resource = reference.getResource();
          if (resource instanceof WebSocketResource)
          {
            WebSocketResource wsResource = (WebSocketResource) resource;
            wsResource.onPayload(payload);
          } else
View Full Code Here

  }

  @Override
  public List<HeaderItem> getDependencies()
  {
    final ResourceReference wicketAjaxReference;
    if (Application.exists())
    {
      wicketAjaxReference = Application.get().getJavaScriptLibrarySettings().getWicketAjaxReference();
    }
    else
View Full Code Here

  protected void onInitialize()
  {
    super.onInitialize();
    BookmarkablePageLink<Void> link = createLink("link");
    add(link);
    ResourceReference img = getImageResourceReference();
    if (img == null)
    {
      link.add(new WebMarkupContainer("img").setVisibilityAllowed(false));
    }
    else
View Full Code Here

TOP

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

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.