Class PageContentStructure

java.lang.Object
com.foreach.across.modules.web.ui.elements.ContainerViewElement
com.foreach.across.modules.web.ui.elements.AbstractNodeViewElement
com.foreach.across.modules.adminweb.ui.PageContentStructure
All Implemented Interfaces:
com.foreach.across.modules.web.ui.elements.HtmlViewElement, com.foreach.across.modules.web.ui.MutableViewElement, com.foreach.across.modules.web.ui.ViewElement

public class PageContentStructure extends com.foreach.across.modules.web.ui.elements.AbstractNodeViewElement
Represents the content structure of a single page. A standard content structure has the following elements:
  • header
  • feedback section
  • nav
  • body section
  • footer
All elements have their own pcs-prefixed css class added, and everything will be wrapped in a single div with class pcs.

Children added directly to the PageContentStructure will be added to the body section when rendering. If rendered as a tab layout, this will be the active tab pane.

Request-bound bean: PageContentStructure is declared as an exposed request-bound bean. This means a controller can write a PageContentStructure that will be put on the request under the default attribute name. Any model attribute set directly will replace the bean structure!

Since:
2.0.0
Author:
Arne Vandamme
  • Nested Class Summary

    Nested classes/interfaces inherited from interface com.foreach.across.modules.web.ui.elements.HtmlViewElement

    com.foreach.across.modules.web.ui.elements.HtmlViewElement.Functions

    Nested classes/interfaces inherited from interface com.foreach.across.modules.web.ui.MutableViewElement

    com.foreach.across.modules.web.ui.MutableViewElement.Functions

    Nested classes/interfaces inherited from interface com.foreach.across.modules.web.ui.ViewElement

    com.foreach.across.modules.web.ui.ViewElement.Wither<T extends com.foreach.across.modules.web.ui.ViewElement>, com.foreach.across.modules.web.ui.ViewElement.WitherGetter<T extends com.foreach.across.modules.web.ui.ViewElement,U extends Object>, com.foreach.across.modules.web.ui.ViewElement.WitherRemover<T extends com.foreach.across.modules.web.ui.ViewElement>, com.foreach.across.modules.web.ui.ViewElement.WitherSetter<T extends com.foreach.across.modules.web.ui.ViewElement>
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
     
    static final String
     
    static final String
     
    static final String
     
    static final String
     
    static final String
     
    static final String
     
    static final String
     
    static final String
     
    static final String
     
    static final String
    This should equal the default ModelAttribute name generated based on the class name.
    static final String
     

    Fields inherited from class com.foreach.across.modules.web.ui.elements.ContainerViewElement

    ELEMENT_TYPE
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addToFeedback(com.foreach.across.modules.web.ui.ViewElement element)
    Add an element directly to the feedback section.
    void
    addToFooter(com.foreach.across.modules.web.ui.ViewElement element)
    Add an element directly to the footer section.
    void
    addToHeader(com.foreach.across.modules.web.ui.ViewElement element)
    Add an element directly to the header section.
    void
    addToNav(com.foreach.across.modules.web.ui.ViewElement element)
    Add an element directly to the nav section.
    void
    addToPageTitle(com.foreach.across.modules.web.ui.ViewElement element)
    Add an element directly to the page title element.
    void
    addToPageTitleSubText(com.foreach.across.modules.web.ui.ViewElement element)
    Add an element directly to the page title sub text element.
    List<com.foreach.across.modules.web.ui.ViewElement>
     
    List<com.foreach.across.modules.web.ui.ViewElement>
     
    com.foreach.across.modules.web.ui.elements.NodeViewElement
     
    com.foreach.across.modules.web.ui.elements.NodeViewElement
     
    com.foreach.across.modules.web.ui.elements.NodeViewElement
     
    com.foreach.across.modules.web.ui.elements.NodeViewElement
     
    Get the current page title text set.
    boolean
     
    void
    setPageTitle(String pageTitle)
    Set the page title text directly.
    void
    setRenderAsTabs(boolean renderAsTabs)
     
    void
    withFeedback(Consumer<com.foreach.across.modules.web.ui.elements.NodeViewElement> consumer)
    Perform one or more actions with the feedback section element.
    void
    withFooter(Consumer<com.foreach.across.modules.web.ui.elements.NodeViewElement> consumer)
    Perform one or more actions with the footer element.
    void
    withHeader(Consumer<com.foreach.across.modules.web.ui.elements.NodeViewElement> consumer)
    Perform one or more actions with the header element.
    void
    withNav(Consumer<com.foreach.across.modules.web.ui.elements.NodeViewElement> consumer)
    Perform one or more actions with the nav element.
    void
    withPageTitle(Consumer<com.foreach.across.modules.web.ui.elements.NodeViewElement> consumer)
    Perform one or more actions with the page title element.
    void
    withPageTitleSubText(Consumer<com.foreach.across.modules.web.ui.elements.NodeViewElement> consumer)
    Perform one or more actions with the page title subtext element.

    Methods inherited from class com.foreach.across.modules.web.ui.elements.AbstractNodeViewElement

    addAttributes, addChild, addChildren, addCssClass, addFirstChild, apply, applyUnsafe, clearChildren, get, getAttribute, getAttribute, getAttributes, getHtmlId, getTagName, hasAttribute, hasCssClass, remove, removeAttribute, removeCssClass, returnIfType, set, setAttribute, setAttributes, setCustomTemplate, setElementType, setHtmlId, setName, setTagName

    Methods inherited from class com.foreach.across.modules.web.ui.elements.ContainerViewElement

    elementStream, find, find, findAll, findAll, findAll, findOrSelf, findOrSelf, flatStream, getCustomTemplate, getElementType, getName, hasChildren, removeAllFromTree, removeChild, removeFromTree, removeFromTree

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface com.foreach.across.modules.web.ui.ViewElement

    getCustomTemplate, getElementType, getName, matches
  • Field Details

  • Constructor Details

    • PageContentStructure

      public PageContentStructure()
  • Method Details

    • addToHeader

      public void addToHeader(com.foreach.across.modules.web.ui.ViewElement element)
      Add an element directly to the header section. This will not create the default header content. If you want to alter the default page title text and sub text structure created, you should use either addToPageTitle(ViewElement) or addToPageTitleSubText(ViewElement).
      Parameters:
      element - to add
    • addToPageTitle

      public void addToPageTitle(com.foreach.across.modules.web.ui.ViewElement element)
      Add an element directly to the page title element. The element will be added after the sub text element. If you want to add an element before, you should use the withPageTitle(Consumer) method.

      Calling this method will create the default header if the header section is still empty.

      Parameters:
      element - to add
    • addToPageTitleSubText

      public void addToPageTitleSubText(com.foreach.across.modules.web.ui.ViewElement element)
      Add an element directly to the page title sub text element.

      Calling this method will create the default header if the header section is still empty.

      Parameters:
      element - to add
    • addToNav

      public void addToNav(com.foreach.across.modules.web.ui.ViewElement element)
      Add an element directly to the nav section.
      Parameters:
      element - to add
    • addToFeedback

      public void addToFeedback(com.foreach.across.modules.web.ui.ViewElement element)
      Add an element directly to the feedback section.
      Parameters:
      element - to add
    • addToFooter

      public void addToFooter(com.foreach.across.modules.web.ui.ViewElement element)
      Add an element directly to the footer section.
      Parameters:
      element - to add
    • withHeader

      public void withHeader(Consumer<com.foreach.across.modules.web.ui.elements.NodeViewElement> consumer)
      Perform one or more actions with the header element.
      Parameters:
      consumer - to execute
    • withFooter

      public void withFooter(Consumer<com.foreach.across.modules.web.ui.elements.NodeViewElement> consumer)
      Perform one or more actions with the footer element.
      Parameters:
      consumer - to execute
    • withNav

      public void withNav(Consumer<com.foreach.across.modules.web.ui.elements.NodeViewElement> consumer)
      Perform one or more actions with the nav element.
      Parameters:
      consumer - to execute
    • withFeedback

      public void withFeedback(Consumer<com.foreach.across.modules.web.ui.elements.NodeViewElement> consumer)
      Perform one or more actions with the feedback section element.
      Parameters:
      consumer - to execute
    • getPageTitle

      public String getPageTitle()
      Get the current page title text set. Retrieves the value from the child element named ELEMENT_PAGE_TITLE_TEXT, will return null if title not set or no page title element.
      Returns:
      title text if could be found
    • setPageTitle

      public void setPageTitle(String pageTitle)
      Set the page title text directly. Requires an element named ELEMENT_PAGE_TITLE_TEXT to be present, else this method will do nothing.

      Calling this method will create the default header if the header section if still empty.

      Parameters:
      pageTitle - text to set
    • withPageTitle

      public void withPageTitle(Consumer<com.foreach.across.modules.web.ui.elements.NodeViewElement> consumer)
      Perform one or more actions with the page title element. The page title is the element named ELEMENT_PAGE_TITLE inside the header section, it usually contains both the page title text and sub text elements.

      Calling this method will create the default header if the header section is still empty.

      Parameters:
      consumer - to execute
    • withPageTitleSubText

      public void withPageTitleSubText(Consumer<com.foreach.across.modules.web.ui.elements.NodeViewElement> consumer)
      Perform one or more actions with the page title subtext element. The page title subtext is the element named ELEMENT_PAGE_TITLE_SUB_TEXT, usually a <small> element inside of the page title element inside the header section.

      Calling this method will create the default header if the header section is still empty.

      Parameters:
      consumer - to execute
    • getContentChildren

      public List<com.foreach.across.modules.web.ui.ViewElement> getContentChildren()
      Returns:
      list of elements that make up the actual content body
    • getChildren

      public List<com.foreach.across.modules.web.ui.ViewElement> getChildren()
      Overrides:
      getChildren in class com.foreach.across.modules.web.ui.elements.ContainerViewElement
    • getHeader

      public com.foreach.across.modules.web.ui.elements.NodeViewElement getHeader()
    • getFeedback

      public com.foreach.across.modules.web.ui.elements.NodeViewElement getFeedback()
    • getFooter

      public com.foreach.across.modules.web.ui.elements.NodeViewElement getFooter()
    • getNav

      public com.foreach.across.modules.web.ui.elements.NodeViewElement getNav()
    • isRenderAsTabs

      public boolean isRenderAsTabs()
    • setRenderAsTabs

      public void setRenderAsTabs(boolean renderAsTabs)