org.apache.wicket.behavior
Class HeaderContributor

java.lang.Object
  extended by org.apache.wicket.behavior.HeaderContributor

public class HeaderContributor
extends java.lang.Object

A bunch of static helper methods to add CSS and Javascript to the markup headers

Author:
Eelco Hillenius, Matej Knopp

Method Summary
static AbstractHeaderContributor forCss(java.lang.Class<?> scope, java.lang.String path)
          Returns a new instance of HeaderContributor with a header contributor that references a CSS file that lives in a package.
static AbstractHeaderContributor forCss(java.lang.Class<?> scope, java.lang.String path, java.lang.String media)
          Returns a new instance of HeaderContributor with a header contributor that references a CSS file that lives in a package.
static AbstractHeaderContributor forCss(ResourceReference reference)
          Returns a new instance of HeaderContributor with a header contributor that references a CSS file that lives in a package.
static AbstractHeaderContributor forCss(ResourceReference reference, java.lang.String media)
          Returns a new instance of HeaderContributor with a header contributor that references a CSS file that lives in a package.
static AbstractHeaderContributor forCss(java.lang.String location)
          Returns a new instance of HeaderContributor with a header contributor referencing a CSS file using one of the following schemes: Starts with http:// or https:// for an external reference. Starts with "/" for an absolute reference that Wicket will not rewrite. Starts with anything else, which Wicket will automatically prepend to make relative to the context root of your web-app.
static AbstractHeaderContributor forCss(java.lang.String location, java.lang.String media)
          Returns a new instance of HeaderContributor with a header contributor referencing a CSS file using one of the following schemes: Starts with http:// or https:// for an external reference. Starts with "/" for an absolute reference that Wicket will not rewrite. Starts with anything else, which Wicket will automatically prepend to make relative to the context root of your web-app.
static AbstractHeaderContributor forJavaScript(java.lang.Class<?> scope, java.lang.String path)
          Returns a new instance of HeaderContributor with a header contributor that references a java script file that lives in a package.
static AbstractHeaderContributor forJavaScript(ResourceReference reference)
          Returns a new instance of HeaderContributor with a header contributor that references a java script file that lives in a package.
static AbstractHeaderContributor forJavaScript(java.lang.String location)
          Returns a new instance of HeaderContributor with a header contributor referencing a java script file using one of the following schemes: Starts with http:// or https:// for an external reference. Starts with "/" for an absolute reference that Wicket will not rewrite. Starts with anything else, which Wicket will automatically prepend to make relative to the context root of your web-app.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

forCss

public static final AbstractHeaderContributor forCss(java.lang.Class<?> scope,
                                                     java.lang.String path)
Returns a new instance of HeaderContributor with a header contributor that references a CSS file that lives in a package.

Parameters:
scope - The scope of the package resource (typically the class of the caller, or a class that lives in the package where the resource lives).
path - The path
Returns:
the new header contributor instance

forCss

public static final AbstractHeaderContributor forCss(java.lang.Class<?> scope,
                                                     java.lang.String path,
                                                     java.lang.String media)
Returns a new instance of HeaderContributor with a header contributor that references a CSS file that lives in a package.

Parameters:
scope - The scope of the package resource (typically the class of the caller, or a class that lives in the package where the resource lives).
path - The path
media - The media type for this CSS ("print", "screen", etc.)
Returns:
the new header contributor instance

forCss

public static final AbstractHeaderContributor forCss(ResourceReference reference)
Returns a new instance of HeaderContributor with a header contributor that references a CSS file that lives in a package.

Parameters:
reference -
Returns:
the new header contributor instance

forCss

public static final AbstractHeaderContributor forCss(ResourceReference reference,
                                                     java.lang.String media)
Returns a new instance of HeaderContributor with a header contributor that references a CSS file that lives in a package.

Parameters:
reference -
media - The media type for this CSS ("print", "screen", etc.)
Returns:
the new header contributor instance

forCss

public static final AbstractHeaderContributor forCss(java.lang.String location)
Returns a new instance of HeaderContributor with a header contributor referencing a CSS file using one of the following schemes:

Parameters:
location - The location of the css file.
Returns:
the new header contributor instance

forCss

public static final AbstractHeaderContributor forCss(java.lang.String location,
                                                     java.lang.String media)
Returns a new instance of HeaderContributor with a header contributor referencing a CSS file using one of the following schemes:

Parameters:
location - The location of the css.
media - The media type for this CSS ("print", "screen", etc.)
Returns:
the new header contributor instance

forJavaScript

public static final AbstractHeaderContributor forJavaScript(java.lang.Class<?> scope,
                                                            java.lang.String path)
Returns a new instance of HeaderContributor with a header contributor that references a java script file that lives in a package.

Parameters:
scope - The scope of the package resource (typically the class of the caller, or a class that lives in the package where the resource lives).
path - The path
Returns:
the new header contributor instance

forJavaScript

public static final AbstractHeaderContributor forJavaScript(ResourceReference reference)
Returns a new instance of HeaderContributor with a header contributor that references a java script file that lives in a package.

Parameters:
reference -
Returns:
the new header contributor instance

forJavaScript

public static final AbstractHeaderContributor forJavaScript(java.lang.String location)
Returns a new instance of HeaderContributor with a header contributor referencing a java script file using one of the following schemes:

Parameters:
location - The location of the java script file.
Returns:
the new header contributor instance


Copyright © 2004-2010 Apache Software Foundation. All Rights Reserved.