de.ls10.jsf.renderer
Class HtmlTagCloudRenderer

java.lang.Object
  extended by javax.faces.render.Renderer
      extended by de.ls10.jsf.renderer.HtmlTagCloudRenderer

public class HtmlTagCloudRenderer
extends javax.faces.render.Renderer

HTML specific renderer for the TagCloud component.

Author:
Philip Gerlach , Oliver Horst

Field Summary
static java.lang.String SELECTED_TAG_PARAM_NAME
          In this constant the context parameter name is specified that is used to inform an action listener about the pressed tag/link.
 
Constructor Summary
HtmlTagCloudRenderer()
           
 
Method Summary
 void encodeBegin(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component)
          Starts the encoding of the tagcloud component.
 void encodeChildren(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component)
          This method is "verantwortlich" for the rendering of the tags/links in the tagcloud component.
 void encodeEnd(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component)
          Simply closes the tags that was opened by encodeBegin.
 boolean getRendersChildren()
          This method constantly true as this component shouldn't have children defined in the JSF page but must render child components acording to the given model.
 
Methods inherited from class javax.faces.render.Renderer
convertClientId, decode, getConvertedValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SELECTED_TAG_PARAM_NAME

public static java.lang.String SELECTED_TAG_PARAM_NAME
In this constant the context parameter name is specified that is used to inform an action listener about the pressed tag/link.

Constructor Detail

HtmlTagCloudRenderer

public HtmlTagCloudRenderer()
Method Detail

getRendersChildren

public boolean getRendersChildren()
This method constantly true as this component shouldn't have children defined in the JSF page but must render child components acording to the given model.

Overrides:
getRendersChildren in class javax.faces.render.Renderer
Returns:
constantly true
See Also:
Renderer.getRendersChildren()

encodeBegin

public void encodeBegin(javax.faces.context.FacesContext context,
                        javax.faces.component.UIComponent component)
                 throws java.io.IOException
Starts the encoding of the tagcloud component.

In this initializing phase the surounding div and center tag are rendered if nessecary. When the user specified a title for the component, this title gets also rendered by this method.

Additionally this method calls createChildren(FacesContext, UITagCloud) and encodeResources(FacesContext, UIComponent).

Overrides:
encodeBegin in class javax.faces.render.Renderer
Parameters:
context - FacesContext in which the component should be rendered
component - The component that should be renderd
Throws:
java.io.IOException
See Also:
createChildren(FacesContext, UITagCloud), encodeResources(FacesContext, UIComponent), Renderer.encodeBegin(FacesContext, UIComponent)

encodeChildren

public void encodeChildren(javax.faces.context.FacesContext context,
                           javax.faces.component.UIComponent component)
                    throws java.io.IOException
This method is "verantwortlich" for the rendering of the tags/links in the tagcloud component.

Therefor this method calls the encodeBegin, encodeChildren and endcodeEnd methods of each of the previously created child components.
Between each of those child components an seperator in form of an span tag is rendered to assure that some space is left between two tags/links in the tagcloud.

Overrides:
encodeChildren in class javax.faces.render.Renderer
Parameters:
context - FacesContext in which the component should be rendered
component - The component that should be renderd
Throws:
java.io.IOException
See Also:
Renderer.encodeChildren(FacesContext, UIComponent)

encodeEnd

public void encodeEnd(javax.faces.context.FacesContext context,
                      javax.faces.component.UIComponent component)
               throws java.io.IOException
Simply closes the tags that was opened by encodeBegin.

Overrides:
encodeEnd in class javax.faces.render.Renderer
Parameters:
context - FacesContext in which the component should be rendered
component - The component that should be renderd
Throws:
java.io.IOException
See Also:
Renderer.encodeEnd(FacesContext, UIComponent)


Copyright © 2007 University of Dortmund (FB4 / LS10). All Rights Reserved.