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.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
Modifier and TypeFieldDescriptionstatic 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 defaultModelAttribute
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
-
Method Summary
Modifier and TypeMethodDescriptionvoid
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
getNav()
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
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
-
MODEL_ATTRIBUTE
This should equal the defaultModelAttribute
name 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 returnnull
if 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_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 namedELEMENT_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 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:
getChildren
in 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)
-