Interface IYuiContext
- All Superinterfaces:
org.apache.wicket.util.io.IClusterable
,org.apache.wicket.markup.html.IHeaderContributor
,Serializable
- All Known Implementing Classes:
YuiContext
public interface IYuiContext
extends org.apache.wicket.markup.html.IHeaderContributor
This interface is used to render the following header elements: YUI-modules, javascript sources, css stylesheets,
on-dom-load/on-win-load scripts,
DynamicTextTemplate
s and FinalTextTemplate
s.
Implementations are responsible for loading YUI-modules and filtering static resources from subsequent requests, to
minimize the response footprint.-
Method Summary
Modifier and TypeMethodDescriptionvoid
addCssReference
(org.apache.wicket.request.resource.ResourceReference reference) Helper method for adding css referencevoid
addJavascriptReference
(org.apache.wicket.request.resource.ResourceReference reference) Helper method for adding a javascript referencevoid
Load YUI module from theYahooNamespace
contextvoid
Load YUI module from the specifiedYuiNamespace
contextvoid
addOnDomLoad
(String onload) Add static javascriptString
that will be executed on the browsers' dom-ready eventvoid
addOnDomLoad
(org.apache.wicket.model.IModel<String> model) Add dynamic javascript that will be executed on the browsers' dom-ready event.void
addOnWinLoad
(String onload) Add static javascriptString
that will be executed on the browsers' window-load eventvoid
addOnWinLoad
(org.apache.wicket.model.IModel<String> model) Add dynamic javascript that will be executed on the browsers' window-load event.void
Add a staticTextTemplate
to the response.void
addTemplate
(org.apache.wicket.markup.html.IHeaderContributor template) Add a generic template to the header response.void
addTemplate
(DynamicTextTemplate template) Deprecated.void
addTemplate
(FinalTextTemplate template) Deprecated.org.apache.wicket.markup.head.HeaderItem
Return a header item for the modules and referencesMethods inherited from interface org.apache.wicket.markup.html.IHeaderContributor
renderHead
-
Method Details
-
addModule
Load YUI module from theYahooNamespace
context- Parameters:
module
- YUI module name
-
addModule
Load YUI module from the specifiedYuiNamespace
context- Parameters:
module
- YUI module namenamespace
-YuiNamespace
to use as context for module
-
addTemplate
Add a staticTextTemplate
to the response. The model provided by the parametersMap
is final.- Parameters:
clazz
- Class that acts as contextfilename
- Name of file relative to provided classparameters
- Parameters that will be interpolated with theTextTemplate
-
addTemplate
Deprecated.Add a static template to the response.- Parameters:
template
-TextTemplate
that will be added to the response.
-
addTemplate
Deprecated.Add aDynamicTextTemplate
to the response. The model will be refreshed upon every request.- Parameters:
template
-DynamicTextTemplate
that will be added to the response.
-
addTemplate
void addTemplate(org.apache.wicket.markup.html.IHeaderContributor template) Add a generic template to the header response. This method should replace the other add*Template methods.- Parameters:
template
-
-
addOnWinLoad
Add static javascriptString
that will be executed on the browsers' window-load event- Parameters:
onload
-String
of javascript code that will be executed on the client.
-
addOnWinLoad
Add dynamic javascript that will be executed on the browsers' window-load event.- Parameters:
model
-IModel
which returns javascript code that will be executed on the client.
-
addOnDomLoad
Add static javascriptString
that will be executed on the browsers' dom-ready event- Parameters:
onload
-String
of javascript code that will be executed on the client.
-
addOnDomLoad
Add dynamic javascript that will be executed on the browsers' dom-ready event.- Parameters:
model
-IModel
which returns javascript code that will be executed on the client.
-
addJavascriptReference
void addJavascriptReference(org.apache.wicket.request.resource.ResourceReference reference) Helper method for adding a javascript reference- Parameters:
reference
-ResourceReference
that should be added to the head
-
addCssReference
void addCssReference(org.apache.wicket.request.resource.ResourceReference reference) Helper method for adding css reference- Parameters:
reference
-ResourceReference
that should be added to the head
-
getHeaderItem
org.apache.wicket.markup.head.HeaderItem getHeaderItem()Return a header item for the modules and references
-