Class WebHeadingDepictor<C extends LabelComponent>

  • 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
    • 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

      • 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 HeadingComponent.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.