de.ls10.jsf.components
Class HtmlTagCloud

java.lang.Object
  extended by javax.faces.component.UIComponent
      extended by javax.faces.component.UIComponentBase
          extended by de.ls10.jsf.components.UITagCloud
              extended by de.ls10.jsf.components.HtmlTagCloud
All Implemented Interfaces:
javax.faces.component.StateHolder

public class HtmlTagCloud
extends UITagCloud

Render specific subclass for the component UITagCloud.

Author:
Philip Gerlach , Oliver Horst
See Also:
UITagCloud

Field Summary
 
Fields inherited from class de.ls10.jsf.components.UITagCloud
COMPONENT_FAMILY, RENDERER_TYPE
 
Fields inherited from class javax.faces.component.UIComponent
bindings
 
Constructor Summary
HtmlTagCloud()
           
 
Method Summary
 java.lang.String getSeperatorWidth()
           
 java.lang.String getStyle()
           
 java.lang.String getStyleClass()
           
 java.lang.String getTagClasses()
           
 java.lang.String getTitle()
           
 java.lang.String getTitleClass()
           
 java.lang.String getTitleStyle()
           
 boolean isCentered()
           
 void restoreState(javax.faces.context.FacesContext context, java.lang.Object state)
          
 java.lang.Object saveState(javax.faces.context.FacesContext context)
          
 void setCentered(boolean centered)
          Should the content of the tag cloud be centered?
 void setSeperatorWidth(java.lang.String seperatorWidth)
          Width of the seperator between each tag/link in teh tagcloud.
 void setStyle(java.lang.String style)
          CSS style of the surrounding div tag.
 void setStyleClass(java.lang.String styleClass)
          CSS style class of the surrounding div tag.
 void setTagClasses(java.lang.String tagClasses)
          Comma seperated list of CSS styles that should be applied to the tags/links.
 void setTitle(java.lang.String title)
          Title that should be displayed above the tagcloud.
 void setTitleClass(java.lang.String titleClass)
          CSS styleClass that should be used for the formatting of the title.
 void setTitleStyle(java.lang.String titleStyle)
          CSS style that should be used for the formatting of the title.
 
Methods inherited from class de.ls10.jsf.components.UITagCloud
getFamily, getModel, setModel
 
Methods inherited from class javax.faces.component.UIComponentBase
addFacesListener, broadcast, decode, encodeBegin, encodeChildren, encodeEnd, findComponent, getAttributes, getChildCount, getChildren, getClientId, getFacesContext, getFacesListeners, getFacet, getFacetCount, getFacets, getFacetsAndChildren, getId, getParent, getRenderer, getRendererType, getRendersChildren, getValueBinding, getValueExpression, invokeOnComponent, isRendered, isTransient, processDecodes, processRestoreState, processSaveState, processUpdates, processValidators, queueEvent, removeFacesListener, restoreAttachedState, saveAttachedState, setId, setParent, setRendered, setRendererType, setTransient, setValueBinding, setValueExpression
 
Methods inherited from class javax.faces.component.UIComponent
encodeAll, getContainerClientId
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HtmlTagCloud

public HtmlTagCloud()
Method Detail

setStyle

public void setStyle(java.lang.String style)
CSS style of the surrounding div tag.

Parameters:
style - String that is copied 1:1 from this attribute to the value of the style attribute of the surrounding div tag.

getStyle

public java.lang.String getStyle()

setStyleClass

public void setStyleClass(java.lang.String styleClass)
CSS style class of the surrounding div tag.

Parameters:
styleClass - String that is copied 1:1 from this attribute to the value of the styleClass attribute of the surrounding div tag.

getStyleClass

public java.lang.String getStyleClass()

setTitle

public void setTitle(java.lang.String title)
Title that should be displayed above the tagcloud. (Optional)

For formatting issues see setTitleStyle(String) and setTitleClass(String).

Parameters:
title - If this isn't an null or null length value, this text is displayed as headline above the tagcloud.

getTitle

public java.lang.String getTitle()

setTitleStyle

public void setTitleStyle(java.lang.String titleStyle)
CSS style that should be used for the formatting of the title.

If this value or the value titleStyleClass is set a div tag is rendered around the specified title, otherwise it will be an h2 tag.

When title is null or not set at all this parameter is ignored.

Parameters:
titleStyle - String that is copied 1:1 from this attribute to the value of the style attribute of the div tag that surround the title line.

getTitleStyle

public java.lang.String getTitleStyle()

setTitleClass

public void setTitleClass(java.lang.String titleClass)
CSS styleClass that should be used for the formatting of the title.

If this value or the value titleStyle is set a div tag is rendered around the specified title, otherwise it will be an h2 tag.

When title is null or not set at all this parameter is ignored.

Parameters:
titleClass - String that is copied 1:1 from this attribute to the value of the styleClass attribute of the div tag that surround the title line.

getTitleClass

public java.lang.String getTitleClass()

setTagClasses

public void setTagClasses(java.lang.String tagClasses)
Comma seperated list of CSS styles that should be applied to the tags/links.

You can specify up to six different style classes that are used for the different levels of interest in the model. (TagCloudLink.setWeight(de.ls10.jsf.components.models.TagCloudLinkImportance) / TagCloudLinkImportance)

It is expected, that this 'list' of style classes starts with the style class for the tags/links with the lowest level of interest. When the list contains more than six style classes, than the surplus classes are simply ignored. In the other case, that to few style classes are given the missing ones will be replaced by the default style classes.
See the table below for clue of what the default style classes are.

Default CSS style classes:

TagCloudLinkImportance.NOT_IMPORTANT a.tagXS { font-size: 11px; }
TagCloudLinkImportance.LESS_IMPORTANT a.tagS { font-size: 15px; }
TagCloudLinkImportance.IMPORTANT a.tagM { font-size: 17px; }
TagCloudLinkImportance.MORE_IMPORTANT a.tagL { font-size: 21px; line-height: 120%; }
TagCloudLinkImportance.HIGHLY_IMPORTANT a.tagXL { font-size: 24px; }

Parameters:
tagClasses - The comma seperated list of CSS style classes.
Each entry in this list will be trimmed by preceding or trailing white spaces and then copied to the value of the styleClass attribute of each tag/link that has the associated level of interest.

getTagClasses

public java.lang.String getTagClasses()

setSeperatorWidth

public void setSeperatorWidth(java.lang.String seperatorWidth)
Width of the seperator between each tag/link in teh tagcloud.

Between each tag/link in the tagcloud a seperator is rendered in form of a span tag, in the style attribute of this tag the value of margin-left will be setted to the value given in this component attribute.

Parameters:
seperatorWidth - Valid values are e.g. '10px' or '10%'. In general all values are allowed that are allowed for the CSS style margin-left.

getSeperatorWidth

public java.lang.String getSeperatorWidth()

setCentered

public void setCentered(boolean centered)
Should the content of the tag cloud be centered? (Default: false)

If this attribute is true a center tag will be rendered before any of the other parts of the component.

Parameters:
centered - Set it to true if you want to center the whole 'content' of the tagcloud component. Otherwise don't specify it anyway or set it to false.

isCentered

public boolean isCentered()

saveState

public java.lang.Object saveState(javax.faces.context.FacesContext context)

Specified by:
saveState in interface javax.faces.component.StateHolder
Overrides:
saveState in class UITagCloud

restoreState

public void restoreState(javax.faces.context.FacesContext context,
                         java.lang.Object state)

Specified by:
restoreState in interface javax.faces.component.StateHolder
Overrides:
restoreState in class UITagCloud


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