Class TabsModule

All Implemented Interfaces:
Component

public class TabsModule extends Module
Module that renders tab navigation and tab panels.

Mutability and thread-safety: mutable and not thread-safe. Tab definitions and active state are mutable configuration data; mutate within a request-scoped flow. For reuse, stop mutating and render as a stable structure with per-request slot/context values.

  • Constructor Details

    • TabsModule

      public TabsModule()
  • Method Details

    • create

      public static TabsModule create()
    • withTitle

      public TabsModule withTitle(String title)
      Description copied from class: Module
      Sets optional title consumed by Module.buildContent() implementations.
      Overrides:
      withTitle in class Module
    • withModuleId

      public TabsModule withModuleId(String moduleId)
      Description copied from class: Module
      Sets module id and synchronizes the underlying id attribute.
      Overrides:
      withModuleId in class Module
    • addTab

      public TabsModule addTab(String label, String content)
      Adds a tab with label and text content.
      Parameters:
      label - the tab label
      content - the content to display in this tab
    • addTab

      public TabsModule addTab(String label, Component content)
      Adds a tab with label and custom component content.
      Parameters:
      label - the tab label
      content - custom component to display in this tab
    • withActiveTab

      public TabsModule withActiveTab(int index)
      Sets which tab is active by default.
      Parameters:
      index - zero-based index of the tab to activate
    • buildContent

      protected void buildContent()
      Description copied from class: Module
      Composes module structure.

      Called at most once by Module.build() unless Module.rebuildContent() is invoked. Do not rely on this method for per-request mutation.

      Specified by:
      buildContent in class Module