wicket.markup.html.internal
Class HtmlHeaderContainer

java.lang.Object
  extended by wicket.Component
      extended by wicket.MarkupContainer
          extended by wicket.markup.html.WebMarkupContainer
              extended by wicket.markup.html.internal.HtmlHeaderContainer
All Implemented Interfaces:
java.io.Serializable

public class HtmlHeaderContainer
extends WebMarkupContainer

The HtmlHeaderContainer is automatically created and added to the component hierarchy by a HtmlHeaderResolver instance. HtmlHeaderContainer tries to handle/render the >head> tag and its body. However depending on the parent component, the behavior must be different. E.g. if parent component is a Page all components of the page's hierarchy must be asked if they have something to contribute to the <head> section of the html response. If yes, it must immediately be rendered.

<head> regions may contain additional wicket components, which can be added by means of add(Component) as usual.

<wicket:head> tags are handled by simple WebMarkupContainers also created by a HtmlHeaderResolver.

Author:
Juergen Donnerstag
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class wicket.Component
Component.ComponentModelChange, Component.EnabledChange, Component.IVisitor, Component.VisibilityChange
 
Field Summary
 
Fields inherited from class wicket.Component
ENABLE, FLAG_RESERVED1, FLAG_RESERVED2, FLAG_RESERVED3, FLAG_RESERVED4, FLAG_RESERVED5, FLAG_RESERVED6, FLAG_RESERVED7, FLAG_RESERVED8, PATH_SEPARATOR, RENDER
 
Constructor Summary
HtmlHeaderContainer(java.lang.String id)
          Construct
 
Method Summary
 boolean isTransparentResolver()
          Some MarkupContainers (e.g.
 boolean okToRenderComponent(java.lang.String scope, java.lang.String id)
          Check if the header component is ok to render within the scope given.
protected  void onComponentTagBody(MarkupStream markupStream, ComponentTag openTag)
          First render the body of the component.
protected  void onDetach()
          Called to allow a component to detach resources after use.
 
Methods inherited from class wicket.markup.html.WebMarkupContainer
getMarkupType, getWebPage
 
Methods inherited from class wicket.MarkupContainer
add, autoAdd, contains, findMarkupStream, get, getAssociatedMarkupStream, getMarkupStream, internalAdd, internalAttach, internalDetach, iterator, iterator, newMarkupResourceStream, onRender, remove, remove, removeAll, renderAll, renderAssociatedMarkup, renderComponentTagBody, replace, setMarkupStream, setModel, size, toString, toString, visitChildren, visitChildren
 
Methods inherited from class wicket.Component
add, addStateChange, checkComponentTag, checkComponentTagAttribute, continueToOriginalDestination, debug, detachBehaviors, detachModel, detachModels, error, exceptionMessage, fatal, findPage, findParent, findParentWithAssociatedMarkup, getApplication, getApplicationPages, getApplicationSettings, getBehaviors, getBehaviors, getClassRelativePath, getConverter, getEscapeModelStrings, getFeedbackMessage, getFlag, getFlag, getId, getLocale, getLocalizer, getMarkupAttributes, getMarkupId, getMetaData, getModel, getModelComparator, getModelObject, getModelObjectAsString, getOutputMarkupId, getPage, getPageFactory, getPageRelativePath, getParent, getPath, getRenderBodyOnly, getRequest, getRequestCycle, getResponse, getSession, getSizeInBytes, getString, getString, getString, getStyle, getVariation, hasErrorMessage, hasFeedbackMessage, info, initModel, internalOnAttach, internalOnDetach, internalOnModelChanged, isActionAuthorized, isAncestorOf, isBehaviorAccepted, isEnableAllowed, isEnabled, isHeadRendered, isIgnoreAttributeModifier, isRenderAllowed, isVersioned, isVisible, isVisibleInHierarchy, modelChanged, modelChanging, newPage, newPage, onAfterRender, onAttach, onBeforeRender, onBeginRequest, onComponentTag, onEndRequest, onModelChanged, onModelChanging, onRender, redirectToInterceptPage, remove, render, render, renderComponent, renderComponent, renderComponentTag, rendered, renderedBehaviors, renderHead, replaceComponentTagBody, replaceWith, resetHeadRendered, sameRootModel, sameRootModel, setAuto, setEnabled, setEscapeModelStrings, setFlag, setFlag, setIgnoreAttributeModifier, setMetaData, setModelObject, setOutputMarkupId, setRedirect, setRenderBodyOnly, setResponsePage, setResponsePage, setResponsePage, setVersioned, setVisible, urlFor, urlFor, urlFor, urlFor, urlFor, visitParents, warn
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

HtmlHeaderContainer

public HtmlHeaderContainer(java.lang.String id)
Construct

See Also:
Component.Component(String)
Method Detail

onComponentTagBody

protected final void onComponentTagBody(MarkupStream markupStream,
                                        ComponentTag openTag)
First render the body of the component. And if it is the header component of a Page (compared to a Panel or Border), than get the header sections from all component in the hierachie and render them as well.

Overrides:
onComponentTagBody in class MarkupContainer
Parameters:
markupStream - The markup stream
openTag - The open tag for the body
See Also:
MarkupContainer.onComponentTagBody(wicket.markup.MarkupStream, wicket.markup.ComponentTag)

isTransparentResolver

public boolean isTransparentResolver()
Description copied from class: MarkupContainer
Some MarkupContainers (e.g. HtmlHeaderContainer, BodyOnLoadContainer) have to be transparent with respect to there child components. A transparent container gets its children from its parent container.

Overrides:
isTransparentResolver in class MarkupContainer
Returns:
false. By default a MarkupContainer is not transparent.
See Also:
MarkupContainer.isTransparentResolver()

okToRenderComponent

public final boolean okToRenderComponent(java.lang.String scope,
                                         java.lang.String id)
Check if the header component is ok to render within the scope given.

Parameters:
scope - The scope of the header component
id - The component's id
Returns:
true, if the component ok to render

onDetach

protected void onDetach()
Description copied from class: Component
Called to allow a component to detach resources after use. The semantics of this will be tightened in Wicket 1.3 when we will add the guarantee that onDetach() be called after all framework use of a Component (in the implementation of request targets).

Overrides:
onDetach in class Component


Copyright © 2004-2007 Wicket developers. All Rights Reserved.