com.guiseframework.platform.web
Class WebHeadingDepictor<C extends LabelComponent>

java.lang.Object
  extended by com.guiseframework.platform.AbstractDepictor<C>
      extended by com.guiseframework.platform.AbstractComponentDepictor<C>
          extended by com.guiseframework.platform.web.AbstractWebComponentDepictor<C>
              extended by com.guiseframework.platform.web.AbstractSimpleWebComponentDepictor<C>
                  extended by com.guiseframework.platform.web.WebLabelDepictor<C>
                      extended by com.guiseframework.platform.web.WebHeadingDepictor<C>
Type Parameters:
C - The type of component being depicted.
All Implemented Interfaces:
ComponentDepictor<C>, Depictor<C>, WebComponentDepictor<C>, WebDepictor<C>

public class WebHeadingDepictor<C extends LabelComponent>
extends WebLabelDepictor<C>

Strategy for rendering a label component as an XHTML h1, h2, etc. element. If a heading level corresponds to one of the XHTML heading element names, that name will be used for the element; otherwise, the span element will be used. If no style ID is provided, the default style ID will be used with the heading level, if given, appended.

Author:
Garret Wilson

Nested Class Summary
 
Nested classes/interfaces inherited from class com.guiseframework.platform.AbstractComponentDepictor
AbstractComponentDepictor.DepictedCompositeComponentListener
 
Nested classes/interfaces inherited from class com.guiseframework.platform.AbstractDepictor
AbstractDepictor.DepictedPropertyChangeListener
 
Field Summary
protected static java.lang.String[] HEADING_LOCAL_NAMES
          The array of XHTML heading element local names.
 
Fields inherited from class com.guiseframework.platform.web.AbstractWebComponentDepictor
BODY_END_PATTERN, BODY_START_PATTERN
 
Fields inherited from class com.guiseframework.platform.AbstractComponentDepictor
childPropertyChangeListener
 
Fields inherited from interface com.guiseframework.platform.Depictor
GENERAL_PROPERTY
 
Constructor Summary
WebHeadingDepictor()
           
 
Method Summary
static java.lang.String getHeadingLocalName(int headingLevel)
          Determines the local name to use for a heading based upon a heading level.
 java.lang.String getLocalName()
          Determines the local name of the component.
 
Methods inherited from class com.guiseframework.platform.web.WebLabelDepictor
depictBody
 
Methods inherited from class com.guiseframework.platform.web.AbstractSimpleWebComponentDepictor
depictBegin, getOuterStyles
 
Methods inherited from class com.guiseframework.platform.web.AbstractWebComponentDepictor
addFlowStyleIDs, decorateID, depict, depictEnd, getBackgroundColor, getBaseStyleIDs, getBodyStyleIDs, getBodyStyles, getColor, getDepictContext, getDepictName, getLabelStyles, getLabelStyles, getLabelStyles, getNamespaceURI, getPlatform, hasLabelContent, hasLabelContent, hasLabelContent, hasLabelContent, isEmptyElementAllowed, isMouseListener, writeBodyIDClassAttributes, writeClassAttribute, writeDirectionAttribute, writeDirectionAttribute, writeErrorMessage, writeFloatClear, writeIDAttribute, writeIDClassAttributes, writeLabel, writeLabelContent, writeLabelContent, writeLabelContent, writeLabelContent, writeLabelContent, writeLabelContent, writeParameterInputs, writeStyleAttribute, writeText
 
Methods inherited from class com.guiseframework.platform.AbstractComponentDepictor
depictChild, depictChildren, depictedObjectPropertyChange, getDepictedCompositeComponentListener, getErrorMessage, installed, processEvent, uninstalled
 
Methods inherited from class com.guiseframework.platform.AbstractDepictor
getDepictedObject, getDepictedPropertyChangeListener, getIgnoredProperties, getModifiedProperties, getSession, isDepicted, setDepicted, setPropertyModified
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.guiseframework.platform.Depictor
getDepictedObject, getSession, installed, isDepicted, processEvent, setDepicted, uninstalled
 

Field Detail

HEADING_LOCAL_NAMES

protected static final java.lang.String[] HEADING_LOCAL_NAMES
The array of XHTML heading element local names.

Constructor Detail

WebHeadingDepictor

public WebHeadingDepictor()
Method Detail

getLocalName

public java.lang.String getLocalName()
Determines the local name of the component. This version returns one of the XHTML heading element local names if the component is a HeadingComponent and a valid level is specified, otherwise the default local name is returned.

Overrides:
getLocalName in class AbstractWebComponentDepictor<C extends LabelComponent>
Returns:
The appropriate XHTML heading element name if a valie HeadingComponent level is specified, otherwise the default local name.
See Also:
Heading.getLevel(), getHeadingLocalName(int)

getHeadingLocalName

public static java.lang.String getHeadingLocalName(int headingLevel)
Determines the local name to use for a heading based upon a heading level. This method returns one of the XHTML heading element local names if a valid level is specified.

Parameters:
headingLevel - The zero-based level of the heading, or #NO_HEADING_LEVEL if no level is specified.
Returns:
The appropriate XHTML heading element name if a level is specified, or null if there is no heading local name for the given heading level.


Copyright © 2005-2010 GlobalMentor, Inc. All Rights Reserved.