Package org.apache.wicket.request.resource

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


    private ResourceLink<?> createResourceLink(String id) {
        final T blob = getBlobOrClobFromModel();
        if(blob == null) {
            return null;
        }
        final IResource bar = newResource(blob);
        return new ResourceLink<Object>(id, bar);
    }
View Full Code Here


        if (application.getResourceReferenceRegistry().getResourceReference(
          Application.class, imageReferenceName, locale, style, variation, true, false) == null)
        {
          // Resource not available yet, so create it with factory and
          // share via Application
          final IResource imageResource = getResourceFactory(application, factoryName).newResource(
            specification, locale, style, variation);

          ResourceReference ref = new SimpleStaticResourceReference(Application.class,
            imageReferenceName, locale, style, variation, imageResource);
View Full Code Here

    final int lastSegmentAt = segments.size() - 1;
    final String filename = segments.get(lastSegmentAt);

    if (Strings.isEmpty(filename) == false)
    {
      final IResource resource = resourceReference.getResource();

      if (resource instanceof IStaticCacheableResource)
      {
        final IStaticCacheableResource cacheable = (IStaticCacheableResource)resource;
       
View Full Code Here

      String renderedUrl = getUrlRenderer().renderUrl(url);
      if (handler instanceof ResourceReferenceRequestHandler)
      {
        ResourceReferenceRequestHandler rrrh = (ResourceReferenceRequestHandler)handler;
        IResource resource = rrrh.getResource();
        if (resource != null && !(resource instanceof IStaticCacheableResource) ||
          shouldEncodeStaticResource)
        {
          renderedUrl = getOriginalResponse().encodeURL(renderedUrl);
        }
      }
      else if (handler instanceof ResourceRequestHandler)
      {
        ResourceRequestHandler rrh = (ResourceRequestHandler)handler;
        IResource resource = rrh.getResource();
        if (resource != null && !(resource instanceof IStaticCacheableResource) ||
          shouldEncodeStaticResource)
        {
          renderedUrl = getOriginalResponse().encodeURL(renderedUrl);
        }
View Full Code Here

        String token = tokens.nextToken();

        // on the last component of the resource path
        if (tokens.hasMoreTokens() == false && Strings.isEmpty(token) == false)
        {
          final IResource resource = reference.getResource();

          // is resource supposed to be cached?
          if (resource instanceof IStaticCacheableResource)
          {
            final IStaticCacheableResource cacheable = (IStaticCacheableResource)resource;
View Full Code Here

   * @throws Exception
   */
  @Test
  public void urlForResourceReferenceWithNonStaticResource() throws Exception
  {
    final IResource resource = mock(IResource.class);
    ResourceReference reference = new ResourceReference("dummy")
    {
      @Override
      public IResource getResource()
      {
View Full Code Here

  @Override
  protected void onComponentTag(final ComponentTag tag)
  {
    checkComponentTag(tag, "img");
    super.onComponentTag(tag);
    final IResource resource = getImageResource();
    if (resource != null)
    {
      localizedImageResource.setResource(resource);
    }
    final ResourceReference resourceReference = getImageResourceReference();
View Full Code Here

        if (application.getResourceReferenceRegistry().getResourceReference(
          Application.class, imageReferenceName, locale, style, variation, true, false) == null)
        {
          // Resource not available yet, so create it with factory and
          // share via Application
          final IResource imageResource = getResourceFactory(application, factoryName).newResource(
            specification, locale, style, variation);

          ResourceReference ref = new SimpleStaticResourceReference(Application.class,
            imageReferenceName, locale, style, variation, imageResource);
View Full Code Here

  protected final void onComponentTag(final ComponentTag tag)
  {
    checkComponentTag(tag, "input");
    checkComponentTagAttribute(tag, "type", "image");

    final IResource resource = getImageResource();
    if (resource != null)
    {
      localizedImageResource.setResource(resource);
    }
    final ResourceReference resourceReference = getImageResourceReference();
View Full Code Here

      String renderedUrl = getUrlRenderer().renderUrl(url);
      if (handler instanceof ResourceReferenceRequestHandler)
      {
        ResourceReferenceRequestHandler rrrh = (ResourceReferenceRequestHandler)handler;
        IResource resource = rrrh.getResource();
        if (resource != null && !(resource instanceof IStaticCacheableResource) || shouldEncodeStaticResource)
        {
          renderedUrl = getOriginalResponse().encodeURL(renderedUrl);
        }
      }
      else if (handler instanceof ResourceRequestHandler)
      {
        ResourceRequestHandler rrh = (ResourceRequestHandler)handler;
        IResource resource = rrh.getResource();
        if (resource != null && !(resource instanceof IStaticCacheableResource) || shouldEncodeStaticResource)
        {
          renderedUrl = getOriginalResponse().encodeURL(renderedUrl);
        }
      }
View Full Code Here

TOP

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

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.