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, DynamicTextTemplates and FinalTextTemplates. Implementations are responsible for loading YUI-modules and filtering static resources from subsequent requests, to minimize the response footprint.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addCssReference(org.apache.wicket.request.resource.ResourceReference reference)
    Helper method for adding css reference
    void
    addJavascriptReference(org.apache.wicket.request.resource.ResourceReference reference)
    Helper method for adding a javascript reference
    void
    addModule(String module)
    Load YUI module from the YahooNamespace context
    void
    addModule(org.onehippo.yui.YuiNamespace namespace, String module)
    Load YUI module from the specified YuiNamespace context
    void
    Add static javascript String that will be executed on the browsers' dom-ready event
    void
    addOnDomLoad(org.apache.wicket.model.IModel<String> model)
    Add dynamic javascript that will be executed on the browsers' dom-ready event.
    void
    Add static javascript String that will be executed on the browsers' window-load event
    void
    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 static TextTemplate to the response.
    void
    addTemplate(org.apache.wicket.markup.html.IHeaderContributor template)
    Add a generic template to the header response.
    void
    Deprecated.
    void
    Deprecated.
    org.apache.wicket.markup.head.HeaderItem
    Return a header item for the modules and references

    Methods inherited from interface org.apache.wicket.markup.html.IHeaderContributor

    renderHead
  • Method Details

    • addModule

      void addModule(String module)
      Load YUI module from the YahooNamespace context
      Parameters:
      module - YUI module name
    • addModule

      void addModule(org.onehippo.yui.YuiNamespace namespace, String module)
      Load YUI module from the specified YuiNamespace context
      Parameters:
      module - YUI module name
      namespace - YuiNamespace to use as context for module
    • addTemplate

      void addTemplate(Class<?> clazz, String filename, Map<String,Object> parameters)
      Add a static TextTemplate to the response. The model provided by the parameters Map is final.
      Parameters:
      clazz - Class that acts as context
      filename - Name of file relative to provided class
      parameters - Parameters that will be interpolated with the TextTemplate
    • 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 a DynamicTextTemplate 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 javascript String 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 javascript String 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