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 andFinalTextTemplate
s. Implementations are responsible for loading YUI-modules and filtering static resources from subsequent requests, to minimize the response footprint.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description void
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
addModule(String module)
Load YUI module from theYahooNamespace
contextvoid
addModule(org.onehippo.yui.YuiNamespace namespace, String module)
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
addTemplate(Class<?> clazz, String filename, Map<String,Object> parameters)
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
getHeaderItem()
Return a header item for the modules and references
-
-
-
Method Detail
-
addModule
void addModule(String module)
Load YUI module from theYahooNamespace
context- Parameters:
module
- YUI module name
-
addModule
void addModule(org.onehippo.yui.YuiNamespace namespace, String module)
Load YUI module from the specifiedYuiNamespace
context- Parameters:
module
- YUI module namenamespace
-YuiNamespace
to use as context for module
-
addTemplate
void addTemplate(Class<?> clazz, String filename, Map<String,Object> parameters)
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 void addTemplate(FinalTextTemplate template)
Deprecated.Add a static template to the response.- Parameters:
template
-TextTemplate
that will be added to the response.
-
addTemplate
@Deprecated void addTemplate(DynamicTextTemplate template)
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
void addOnWinLoad(String onload)
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
void addOnWinLoad(org.apache.wicket.model.IModel<String> model)
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
void addOnDomLoad(String onload)
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
void addOnDomLoad(org.apache.wicket.model.IModel<String> model)
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
-
-