Package org.apache.wicket.request.resource

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


  @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

    private ResourceLink<?> createResourceLink(String id) {
        final T blob = getBlob(getModel());
        if(blob == null) {
            return null;
        }
        final IResource bar = newResource(blob);
        return new ResourceLink<Object>(id, bar);
    }
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();

          // apply caching if required
          if (resource instanceof IStaticCacheableResource)
          {
            // add caching related information to filename + query parameters
View Full Code Here

    {
      String renderedUrl = getUrlRenderer().renderUrl(url);
      if (handler instanceof ResourceReferenceRequestHandler)
      {
        ResourceReferenceRequestHandler rrrh = (ResourceReferenceRequestHandler) handler;
        IResource resource = rrrh.getResource();
        if (resource instanceof IStaticCacheableResource == false)
        {
          renderedUrl = getOriginalResponse().encodeURL(renderedUrl);
        }
      }
      else if (handler instanceof ResourceRequestHandler)
      {
        ResourceRequestHandler rrh = (ResourceRequestHandler) handler;
        IResource resource = rrh.getResource();
        if (resource instanceof IStaticCacheableResource == false)
        {
          renderedUrl = getOriginalResponse().encodeURL(renderedUrl);
        }
      }
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

   * @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

   
    protected String applyCachingStrategy(String fileName, PageParameters parameters)
    {
        ResourceUrl resourceUrl = new ResourceUrl(fileName, parameters);
        ResourceReference lastMod = getLastModifiedReference();
        IResource res = lastMod.getResource();
        if(res instanceof IStaticCacheableResource)
        {
            this.cachingStrategy.get().decorateUrl(resourceUrl, (IStaticCacheableResource) res);
        }
        return resourceUrl.getFileName();
View Full Code Here

     * De-reference the resource and open its stream to determine the last modified time.
     */
    protected Time getLastModifiedTime(ResourceReference ref)
    {
        Time modified = null;
        IResource res = ref.getResource();
        if(res instanceof IStaticCacheableResource)
        {
            IResourceStream stream = ((IStaticCacheableResource) res).getCacheableResourceStream();
            modified = stream.lastModifiedTime();
        }
View Full Code Here

   * Receives ajax events and delegates them to the page which where rendered previously.
   */
  @Override
  public IResource getResource()
  {
    return new IResource()
    {
      private static final long serialVersionUID = 3070290312369930992L;

      @Override
      public void respond(Attributes attributes)
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.