Klasse UiWebPage

java.lang.Object
org.obrel.core.RelatedObject
Alle implementierten Schnittstellen:
org.obrel.core.Relatable

public class UiWebPage extends UiComposite<UiWebPage>
A UI composite that provides the framework to render and manage a web page. The page will typically consist of header, footer, content, and optionally navigation menus which are added by this class in the required order. Menus are added by overriding the methods addTopMenu(Collection) and addSideMenu(Collection).

By default the component itself is rendered with an inline layout, i.e. it doesn't have a DOM representation and only the mentioned child components are added to the DOM as direct children of the page's parent.

This component can also be used to manage a full website by replacing or switching the page content depending on the context. Content switching can be achieved by embedding different pages a deck or tab panel, for example.

  • Konstruktordetails

    • UiWebPage

      public UiWebPage(UiContainer<?> parent, Consumer<UiWebPage> initPage)
      Creates a new instance for direct usage, i.e. without subclassing. The argument function will be invoked from within the buildContent(UiBuilder) method with this instance as the argument after the page structure has been created.
      Parameter:
      parent - The parent container (typically a root view)
      initPage - A function that initializes the page after it's structure has been created
    • UiWebPage

      protected UiWebPage(UiContainer<?> parent)
      Constructor for subclassing.
      Parameter:
      parent - The parent container (typically a root view)
  • Methodendetails

    • addSideMenu

      public <T> UiSideMenu<T> addSideMenu()
      Adds an empty side menu to this page.
      Siehe auch:
    • addSideMenu

      public <T> UiSideMenu<T> addSideMenu(Collection<T> menuItems)
      Adds a side navigation menu to this page. The actual menu creation is done by invoking createSideMenu(UiContainer, Collection). Because menus depend on other page components this call must be performed after the page structure has been fully created (typically by extending the method buildStructure()).
      Parameter:
      menuItems - The initial menu items to display
      Gibt zurück:
      The new top menu
    • addTopMenu

      public <T> UiTopMenu<T> addTopMenu()
      Adds an empty top menu to this page.
      Siehe auch:
    • addTopMenu

      public <T> UiTopMenu<T> addTopMenu(Collection<T> menuItems)
      Adds a top navigation menu to this page. The actual menu creation is done by invoking createTopMenu(UiContainer, Collection). Because menus depend on other page components this call must be performed after the page structure has been fully created (typically by extending the method buildStructure()).
      Parameter:
      menuItems - The initial menu items to display
      Gibt zurück:
      The new top menu
    • getContent

      public UiWebPageContent getContent()
      Returns the content container.
      Gibt zurück:
      The content container
    • getFooter

      public UiWebPageFooter getFooter()
      Returns the footer of this page.
      Gibt zurück:
      The page footer
    • getHeader

      public UiWebPageHeader getHeader()
      Returns the header of this page.
      Gibt zurück:
      The page header
    • getSideMenu

      public UiSideMenu<?> getSideMenu()
      Returns the side menu of this page. If no menu has been created by overriding addSideMenu(Collection) this method will return NULL.
      Gibt zurück:
      The side menu or NULL for none
    • getTopMenu

      public UiTopMenu<?> getTopMenu()
      Returns the top menu of this page. If no menu has been created by overriding addTopMenu(Collection) this method will return NULL.
      Gibt zurück:
      The top menu or NULL for none
    • buildContent

      protected void buildContent(UiBuilder<?> builder)
      Builds and configures the website elements. Subclasses should typically not override this but instead append additional site building code to the buildStructure() method or perform additional initializations (after building) by overridinginitPage().
      Setzt außer Kraft:
      buildContent in Klasse UiContainer<UiWebPage>
      Parameter:
      builder - The parent container builder
    • buildStructure

      protected void buildStructure()
      Builds the site structure.
    • createContent

      protected UiWebPageContent createContent(UiContainer<?> parent)
      Creates the page content container. Subclasses can override this to return a subclass of UiWebPageContent if necessary.
      Parameter:
      parent - The parent container to create the content in
      Gibt zurück:
      The page header
    • createFooter

      protected UiWebPageFooter createFooter(UiContainer<?> parent)
      Create the page footer. Subclasses can override this to return a subclass of UiWebPageFooter if necessary.
      Parameter:
      parent - The parent container to create the footer in
      Gibt zurück:
      The page header
    • createHeader

      protected UiWebPageHeader createHeader(UiContainer<?> parent)
      Creates the page header. Subclasses can override this to return a subclass of UiWebPageHeader if necessary.
      Parameter:
      parent - The parent container to create the header in
      Gibt zurück:
      The page header
    • createSideMenu

      protected <T> UiSideMenu<T> createSideMenu(UiContainer<?> parent, Collection<T> menuItems)
      Creates the side menu of this page. Will be invoked from addTopMenu(Collection) and can be overridden to create a menu subclass if necessary.
      Parameter:
      parent - The parent container of the menu
      menuItems - The initial menu items
      Gibt zurück:
      the new menu
    • createTopMenu

      protected <T> UiTopMenu<T> createTopMenu(UiContainer<?> parent, Collection<T> menuItems)
      Creates the top menu of this page. Will be invoked from addTopMenu(Collection) and can be overridden to create a menu subclass if necessary.
      Parameter:
      parent - The parent container of the menu
      menuItems - The initial menu items
      Gibt zurück:
      the new menu
    • initPage

      protected void initPage()
      Initializes the page content after it has been created by buildStructure(). The default implementation invokes the initialization function if such has been provided at construction. When subclassing this method can be overridden to replace the super version with the page initialization code. Especially menus should be added here by means of addTopMenu(Collection) and addSideMenu(Collection).