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
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.FunctionsNested classes/interfaces inherited from interface com.foreach.across.modules.web.ui.MutableViewElement
com.foreach.across.modules.web.ui.MutableViewElement.FunctionsNested 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
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final StringThis should equal the defaultModelAttributename generated based on the class name.static final StringFields inherited from class com.foreach.across.modules.web.ui.elements.ContainerViewElement
ELEMENT_TYPE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddToFeedback(com.foreach.across.modules.web.ui.ViewElement element) Add an element directly to the feedback section.voidaddToFooter(com.foreach.across.modules.web.ui.ViewElement element) Add an element directly to the footer section.voidaddToHeader(com.foreach.across.modules.web.ui.ViewElement element) Add an element directly to the header section.voidaddToNav(com.foreach.across.modules.web.ui.ViewElement element) Add an element directly to the nav section.voidaddToPageTitle(com.foreach.across.modules.web.ui.ViewElement element) Add an element directly to the page title element.voidaddToPageTitleSubText(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.NodeViewElementcom.foreach.across.modules.web.ui.elements.NodeViewElementcom.foreach.across.modules.web.ui.elements.NodeViewElementcom.foreach.across.modules.web.ui.elements.NodeViewElementgetNav()Get the current page title text set.booleanvoidsetPageTitle(String pageTitle) Set the page title text directly.voidsetRenderAsTabs(boolean renderAsTabs) voidwithFeedback(Consumer<com.foreach.across.modules.web.ui.elements.NodeViewElement> consumer) Perform one or more actions with the feedback section element.voidwithFooter(Consumer<com.foreach.across.modules.web.ui.elements.NodeViewElement> consumer) Perform one or more actions with the footer element.voidwithHeader(Consumer<com.foreach.across.modules.web.ui.elements.NodeViewElement> consumer) Perform one or more actions with the header element.voidPerform one or more actions with the nav element.voidwithPageTitle(Consumer<com.foreach.across.modules.web.ui.elements.NodeViewElement> consumer) Perform one or more actions with the page title element.voidwithPageTitleSubText(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, setTagNameMethods 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, removeFromTreeMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.foreach.across.modules.web.ui.ViewElement
getCustomTemplate, getElementType, getName, matches
-
Field Details
-
MODEL_ATTRIBUTE
This should equal the defaultModelAttributename generated based on the class name.- See Also:
-
TEMPLATE
- See Also:
-
ELEMENT_PAGE_TITLE
- See Also:
-
ELEMENT_PAGE_TITLE_TEXT
- See Also:
-
ELEMENT_PAGE_TITLE_SUB_TEXT
- See Also:
-
ELEMENT_BODY_SECTION
- See Also:
-
CSS_PCS
- See Also:
-
CSS_HEADER
- See Also:
-
CSS_FOOTER
- See Also:
-
CSS_NAV
- See Also:
-
CSS_FEEDBACK_SECTION
- See Also:
-
CSS_BODY_SECTION
- See Also:
-
-
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 eitheraddToPageTitle(ViewElement)oraddToPageTitleSubText(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 thewithPageTitle(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
-
addToFeedback
public void addToFeedback(com.foreach.across.modules.web.ui.ViewElement element) Add an element directly to the feedback 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
-
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
Get the current page title text set. Retrieves the value from the child element namedELEMENT_PAGE_TITLE_TEXT, will returnnullif title not set or no page title element.- Returns:
- title text if could be found
-
setPageTitle
Set the page title text directly. Requires an element namedELEMENT_PAGE_TITLE_TEXTto 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 namedELEMENT_PAGE_TITLEinside 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 namedELEMENT_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
- Returns:
- list of elements that make up the actual content body
-
getChildren
- Overrides:
getChildrenin classcom.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() -
isRenderAsTabs
public boolean isRenderAsTabs() -
setRenderAsTabs
public void setRenderAsTabs(boolean renderAsTabs)
-