Class YuiContext
java.lang.Object
org.hippoecm.frontend.plugins.yui.header.YuiContext
- All Implemented Interfaces:
Serializable
,org.apache.wicket.markup.html.IHeaderContributor
,org.apache.wicket.util.io.IClusterable
,IYuiContext
The YuiContext uses the shared
YuiHeaderCache
service for loading/caching YUI-modules and header
contributions.
Note: the addModule(String module)
method will load the provided module within the
YahooNamespace
scope.
- See Also:
-
Constructor Summary
-
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 string) 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 string) 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) Add aDynamicTextTemplate
to the response.void
addTemplate
(FinalTextTemplate template) Add a static template to the response.org.apache.wicket.markup.head.HeaderItem
Return a header item for the modules and referencesvoid
renderHead
(org.apache.wicket.markup.head.IHeaderResponse response) void
renderOnloads
(Set<org.hippoecm.frontend.plugins.yui.header.YuiContext.Onload> _onloads, org.apache.wicket.markup.head.IHeaderResponse response)
-
Constructor Details
-
YuiContext
-
-
Method Details
-
addModule
Description copied from interface:IYuiContext
Load YUI module from theYahooNamespace
context- Specified by:
addModule
in interfaceIYuiContext
- Parameters:
module
- YUI module name
-
addModule
Description copied from interface:IYuiContext
Load YUI module from the specifiedYuiNamespace
context- Specified by:
addModule
in interfaceIYuiContext
- Parameters:
ns
-YuiNamespace
to use as context for modulemodule
- YUI module name
-
addTemplate
Description copied from interface:IYuiContext
Add a static template to the response.- Specified by:
addTemplate
in interfaceIYuiContext
- Parameters:
template
-TextTemplate
that will be added to the response.
-
addTemplate
Description copied from interface:IYuiContext
Add a staticTextTemplate
to the response. The model provided by the parametersMap
is final.- Specified by:
addTemplate
in interfaceIYuiContext
- Parameters:
clazz
- Class that acts as contextfilename
- Name of file relative to provided classparameters
- Parameters that will be interpolated with theTextTemplate
-
addTemplate
Description copied from interface:IYuiContext
Add aDynamicTextTemplate
to the response. The model will be refreshed upon every request.- Specified by:
addTemplate
in interfaceIYuiContext
- Parameters:
template
-DynamicTextTemplate
that will be added to the response.
-
addTemplate
public void addTemplate(org.apache.wicket.markup.html.IHeaderContributor template) Description copied from interface:IYuiContext
Add a generic template to the header response. This method should replace the other add*Template methods.- Specified by:
addTemplate
in interfaceIYuiContext
-
addCssReference
public void addCssReference(org.apache.wicket.request.resource.ResourceReference reference) Description copied from interface:IYuiContext
Helper method for adding css reference- Specified by:
addCssReference
in interfaceIYuiContext
- Parameters:
reference
-ResourceReference
that should be added to the head
-
addJavascriptReference
public void addJavascriptReference(org.apache.wicket.request.resource.ResourceReference reference) Description copied from interface:IYuiContext
Helper method for adding a javascript reference- Specified by:
addJavascriptReference
in interfaceIYuiContext
- Parameters:
reference
-ResourceReference
that should be added to the head
-
addOnDomLoad
Description copied from interface:IYuiContext
Add static javascriptString
that will be executed on the browsers' dom-ready event- Specified by:
addOnDomLoad
in interfaceIYuiContext
- Parameters:
string
-String
of javascript code that will be executed on the client.
-
addOnDomLoad
Description copied from interface:IYuiContext
Add dynamic javascript that will be executed on the browsers' dom-ready event.- Specified by:
addOnDomLoad
in interfaceIYuiContext
- Parameters:
model
-IModel
which returns javascript code that will be executed on the client.
-
addOnWinLoad
Description copied from interface:IYuiContext
Add static javascriptString
that will be executed on the browsers' window-load event- Specified by:
addOnWinLoad
in interfaceIYuiContext
- Parameters:
string
-String
of javascript code that will be executed on the client.
-
addOnWinLoad
Description copied from interface:IYuiContext
Add dynamic javascript that will be executed on the browsers' window-load event.- Specified by:
addOnWinLoad
in interfaceIYuiContext
- Parameters:
model
-IModel
which returns javascript code that will be executed on the client.
-
getHeaderItem
public org.apache.wicket.markup.head.HeaderItem getHeaderItem()Description copied from interface:IYuiContext
Return a header item for the modules and references- Specified by:
getHeaderItem
in interfaceIYuiContext
-
renderHead
public void renderHead(org.apache.wicket.markup.head.IHeaderResponse response) - Specified by:
renderHead
in interfaceorg.apache.wicket.markup.html.IHeaderContributor
-
renderOnloads
public void renderOnloads(Set<org.hippoecm.frontend.plugins.yui.header.YuiContext.Onload> _onloads, org.apache.wicket.markup.head.IHeaderResponse response)
-