org.wicketstuff.push.dojo
Class DojoPackagedTextTemplate

java.lang.Object
  extended by org.apache.wicket.util.resource.AbstractResourceStream
      extended by org.apache.wicket.util.resource.AbstractStringResourceStream
          extended by org.apache.wicket.util.template.TextTemplate
              extended by org.apache.wicket.util.template.PackagedTextTemplate
                  extended by org.wicketstuff.push.dojo.DojoPackagedTextTemplate
All Implemented Interfaces:
java.io.Closeable, java.io.Serializable, org.apache.wicket.IClusterable, org.apache.wicket.util.resource.IResourceStream, org.apache.wicket.util.resource.IStringResourceStream, org.apache.wicket.util.watch.IModifiable

public class DojoPackagedTextTemplate
extends org.apache.wicket.util.template.PackagedTextTemplate

Used to externalized js in templates

Author:
Vincent Demay
See Also:
Serialized Form

Constructor Summary
DojoPackagedTextTemplate(java.lang.Class<?> clazz, java.lang.String fileName)
          Constructor.
DojoPackagedTextTemplate(java.lang.Class<?> clazz, java.lang.String fileName, java.lang.String contentType)
          Constructor.
DojoPackagedTextTemplate(java.lang.Class<?> clazz, java.lang.String fileName, java.lang.String contentType, java.lang.String encoding)
          Constructor.
 
Method Summary
 java.lang.String getStaticKey()
          Return a key to use in renderJavascript.
 java.lang.String getWidgetUniqueKey(org.apache.wicket.Component component)
          Return a key to use in renderJavascript.
 
Methods inherited from class org.apache.wicket.util.template.PackagedTextTemplate
getString, interpolate
 
Methods inherited from class org.apache.wicket.util.template.TextTemplate
asString, asString
 
Methods inherited from class org.apache.wicket.util.resource.AbstractStringResourceStream
close, getContentType, getInputStream, lastModifiedTime, length, setLastModified
 
Methods inherited from class org.apache.wicket.util.resource.AbstractResourceStream
getCharset, getLocale, setCharset, setLocale
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DojoPackagedTextTemplate

public DojoPackagedTextTemplate(java.lang.Class<?> clazz,
                                java.lang.String fileName,
                                java.lang.String contentType,
                                java.lang.String encoding)
Constructor.

Parameters:
clazz - The clazz to be used for retrieving the classloader for loading the packaged template.
fileName - the name of the file, relative to the clazz position
contentType - The mime type of this resource, such as "image/jpeg" or "text/html"
encoding - The file's encoding, e.g. 'UTF-8'

DojoPackagedTextTemplate

public DojoPackagedTextTemplate(java.lang.Class<?> clazz,
                                java.lang.String fileName,
                                java.lang.String contentType)
Constructor.

Parameters:
clazz - The clazz to be used for retrieving the classloader for loading the packaged template.
fileName - the name of the file, relative to the clazz position
contentType - The mime type of this resource, such as "image/jpeg" or "text/html"

DojoPackagedTextTemplate

public DojoPackagedTextTemplate(java.lang.Class<?> clazz,
                                java.lang.String fileName)
Constructor.

Parameters:
component - The component to be used for retrieving the classloader for loading the packaged template.
fileName - The name of the file, relative to the clazz position
Method Detail

getStaticKey

public java.lang.String getStaticKey()
Return a key to use in renderJavascript. A Static Key is a Key Unique for all widget of the same class. So if there are n widget on the same page, a resource rendered with a StaticKey will be displayed once.

Returns:
a key to use in renderJavascript

getWidgetUniqueKey

public java.lang.String getWidgetUniqueKey(org.apache.wicket.Component component)
Return a key to use in renderJavascript. A WidgetUnique Key is a Key Unique for one widget of the class. So if there are n widget on the same page, a resource rendered with a WidgetUniqueKey will be displayed n times. But if a same widget is render m times, this resource wil render once

Parameters:
component - component for which the uniqueKey will be generated
Returns:
a key to use in renderJavascript


Copyright © 2010. All Rights Reserved.