Class WebPanelDepictor<C extends Panel>

Type Parameters:
C - The type of component being depicted.
All Implemented Interfaces:
ComponentDepictor<C>, Depictor<C>, WebComponentDepictor<C>, WebDepictor<C>

public class WebPanelDepictor<C extends Panel> extends WebLayoutComponentDepictor<C>
Strategy for rendering a panel as an XHTML <div> element.

This implementation recognizes panels that are also SectionComponents, and uses the appropriate XHTML element for the SectionComponent.getSectionType() indicated. A utility method is also provided for other depictors wishing to determine the appropriate XHTML element for a SectionComponent.SectionType.

Changes to LabelModel.LABEL_PROPERTY are ignored.

Author:
Garret Wilson
  • Constructor Details

    • WebPanelDepictor

      public WebPanelDepictor()
      Default constructor.
  • Method Details

    • getLocalName

      public String getLocalName()
      Determines the local name of the XML element.

      This version returns special section elements if the component is a SectionComponent with a non-null section type.

      Overrides:
      getLocalName in class AbstractWebComponentDepictor<C extends Panel>
      Returns:
      The local name of the element with no prefix, or null if this component should not be rendered as an element.
    • getLocalName

      @Nonnull public static String getLocalName(@Nonnull SectionComponent.SectionType sectionType)
      Determines the appropriate XHTML element local name (e.g. <section>) for the given section type. If there is no specific XHTML element appropriate for the given section type, "div" will be returned.
      Parameters:
      sectionType - The type of section indicated.
      Returns:
      The XHTML element local name for the indicated section type.
      Throws:
      NullPointerException - if the given section type is null.