|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectwicket.behavior.AbstractBehavior
wicket.behavior.AbstractHeaderContributor
wicket.behavior.HeaderContributor
public class HeaderContributor
A AbstractHeaderContributor behavior that is
specialized on package resources. If you use this class, you have to
pre-register the resources you want to contribute. A shortcut for common
cases is to call forCss(Class, String) to contribute a package css
file or forJavaScript(Class, String) to contribute a packaged
javascript file. For instance:
add(HeaderContributor.forCss(MyPanel.class, "mystyle.css"));
| Nested Class Summary | |
|---|---|
static class |
HeaderContributor.CSSHeaderContributor
Contributes a reference to a css file relative to the context path. |
static class |
HeaderContributor.CSSReferenceHeaderContributor
prints a css resource reference. |
static class |
HeaderContributor.JavaScriptHeaderContributor
Contributes a reference to a javascript file relative to the context path. |
static class |
HeaderContributor.JavaScriptReferenceHeaderContributor
prints a javascript resource reference. |
static class |
HeaderContributor.ResourceReferenceHeaderContributor
Wraps a ResourceReference and knows how to print a header
statement based on that resource. |
| Constructor Summary | |
|---|---|
HeaderContributor()
Construct. |
|
HeaderContributor(IHeaderContributor headerContributor)
Construct with a single header contributor. |
|
| Method Summary | |
|---|---|
void |
addContributor(IHeaderContributor headerContributor)
Adds a custom header contributor. |
void |
addContributor(int index,
IHeaderContributor headerContributor)
Adds a custom header contributor at the given position. |
void |
addCssReference(java.lang.Class scope,
java.lang.String path)
Adds a reference to a css file that should be contributed to the page header. |
void |
addJavaScriptReference(java.lang.Class scope,
java.lang.String path)
Adds a reference to a javascript file that should be contributed to the page header. |
static HeaderContributor |
forCss(java.lang.Class scope)
Deprecated. Will be removed in 2.0; contribute resources one by one instead |
static HeaderContributor |
forCss(java.lang.Class scope,
java.util.regex.Pattern pattern)
Deprecated. Will be removed in 2.0; contribute resources one by one instead |
static HeaderContributor |
forCss(java.lang.Class scope,
java.util.regex.Pattern pattern,
boolean recurse)
Deprecated. Will be removed in 2.0; contribute resources one by one instead |
static HeaderContributor |
forCss(java.lang.Class scope,
java.lang.String path)
Returns a new instance of HeaderContributor.CSSHeaderContributor with a header
contributor that references a CSS file that lives in a package. |
static HeaderContributor |
forCss(ResourceReference reference)
Returns a new instance of HeaderContributor.CSSHeaderContributor with a header
contributor that references a CSS file that lives in a package. |
static HeaderContributor |
forCss(java.lang.String location)
Returns a new instance of HeaderContributor.CSSHeaderContributor with a header
contributor that references a CSS file that lives in the web application
directory and that is addressed relative to the context path. |
static HeaderContributor |
forJavaScript(java.lang.Class scope)
Deprecated. Will be removed in 2.0; contribute resources one by one instead |
static HeaderContributor |
forJavaScript(java.lang.Class scope,
java.util.regex.Pattern pattern)
Deprecated. Will be removed in 2.0; contribute resources one by one instead |
static HeaderContributor |
forJavaScript(java.lang.Class scope,
java.util.regex.Pattern pattern,
boolean recurse)
Deprecated. Will be removed in 2.0; contribute resources one by one instead |
static HeaderContributor |
forJavaScript(java.lang.Class scope,
java.lang.String path)
Returns a new instance of HeaderContributor.CSSHeaderContributor with a header
contributor that references a java script file that lives in a package. |
static HeaderContributor |
forJavaScript(ResourceReference reference)
Returns a new instance of HeaderContributor.CSSHeaderContributor with a header
contributor that references a java script file that lives in a package. |
static HeaderContributor |
forJavaScript(java.lang.String location)
Returns a new instance of HeaderContributor.CSSHeaderContributor with a header
contributor that references a JavaScript file that lives in the web
application directory and that is addressed relative to the context path. |
IHeaderContributor[] |
getHeaderContributors()
Gets the header contributors for this behavior. |
| Methods inherited from class wicket.behavior.AbstractHeaderContributor |
|---|
cleanup, renderHead |
| Methods inherited from class wicket.behavior.AbstractBehavior |
|---|
bind, detachModel, exception, onComponentTag, onException, onRendered, rendered |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public HeaderContributor()
public HeaderContributor(IHeaderContributor headerContributor)
headerContributor - the header contributor| Method Detail |
|---|
public static final HeaderContributor forCss(java.lang.Class scope)
HeaderContributor.CSSHeaderContributor with a set of header
contributors that reference all CSS files with extension 'css' that live
in a package.
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).
public static final HeaderContributor forJavaScript(java.lang.Class scope)
HeaderContributor.CSSHeaderContributor with a set of header
contributors that reference all javascript files with extension 'js' that
live in a package.
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).
public static final HeaderContributor forCss(java.lang.Class scope,
java.util.regex.Pattern pattern)
HeaderContributor.CSSHeaderContributor with a set of header
contributors that reference CSS files that match the pattern and that
live in a package.
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).pattern - The regexp pattern to match resources on
public static final HeaderContributor forCss(java.lang.Class scope,
java.util.regex.Pattern pattern,
boolean recurse)
HeaderContributor.CSSHeaderContributor with a set of header
contributors that reference CSS files that match the pattern and that
live in a package and its sub packages in case recurse is true.
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).pattern - The regexp pattern to match resources onrecurse - whether to recurse into sub packages
public static final HeaderContributor forJavaScript(java.lang.Class scope,
java.util.regex.Pattern pattern)
HeaderContributor.CSSHeaderContributor with a set of header
contributors that references java script files that match the pattern and
that live in a package.
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).pattern - The regexp pattern to match resources on
public static final HeaderContributor forJavaScript(java.lang.Class scope,
java.util.regex.Pattern pattern,
boolean recurse)
HeaderContributor.CSSHeaderContributor with a set of header
contributors that references java script files that match the pattern and
that live in a package and sub packages in case recurse is true.
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).pattern - The regexp pattern to match resources onrecurse - whether to recurse into sub packages
public static final HeaderContributor forCss(java.lang.Class scope,
java.lang.String path)
HeaderContributor.CSSHeaderContributor with a header
contributor that references a CSS file that lives in a package.
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
public static final HeaderContributor forCss(ResourceReference reference)
HeaderContributor.CSSHeaderContributor with a header
contributor that references a CSS file that lives in a package.
reference -
public static final HeaderContributor forCss(java.lang.String location)
HeaderContributor.CSSHeaderContributor with a header
contributor that references a CSS file that lives in the web application
directory and that is addressed relative to the context path.
location - The location of the css file relative to the context path
public static final HeaderContributor forJavaScript(java.lang.Class scope,
java.lang.String path)
HeaderContributor.CSSHeaderContributor with a header
contributor that references a java script file that lives in a package.
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
public static final HeaderContributor forJavaScript(ResourceReference reference)
HeaderContributor.CSSHeaderContributor with a header
contributor that references a java script file that lives in a package.
reference -
public static final HeaderContributor forJavaScript(java.lang.String location)
HeaderContributor.CSSHeaderContributor with a header
contributor that references a JavaScript file that lives in the web
application directory and that is addressed relative to the context path.
location - The location of the css file relative to the context path
public final void addContributor(IHeaderContributor headerContributor)
headerContributor - instance of IHeaderContributor
public final void addContributor(int index,
IHeaderContributor headerContributor)
index - the position where the contributor should be added (e.g. 0 to
put it in front of the rest).headerContributor - instance of IHeaderContributor
java.lang.IndexOutOfBoundsException - if the index is out of range (index < 0 || index >
size()).
public final void addCssReference(java.lang.Class scope,
java.lang.String path)
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
public final void addJavaScriptReference(java.lang.Class scope,
java.lang.String path)
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 pathpublic final IHeaderContributor[] getHeaderContributors()
AbstractHeaderContributor
getHeaderContributors in class AbstractHeaderContributorAbstractHeaderContributor.getHeaderContributors()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||