Package com.oorian.html.layout
Class DocsLayout
java.lang.Object
- All Implemented Interfaces:
ClientEventListener,MouseClickListener,EventListener
A documentation-style layout with left navigation, main content, and right TOC.
DocsLayout provides the classic three-column documentation layout used by sites like Docusaurus, GitBook, and ReadTheDocs. The left column contains navigation, the center has the main content, and the right column shows a table of contents for the current page.
Structure:
┌────────┬─────────────────────────┬────────┐ │ │ │ │ │ Nav │ Content │ TOC │ │ │ │ │ │ (Left) │ (Center) │(Right) │ │ │ │ │ └────────┴─────────────────────────┴────────┘
Features:
- Sticky navigation and TOC columns
- Responsive: TOC hides on tablet, Nav hides on mobile
- Configurable column widths
- Optional header area for breadcrumbs or page title
- Scrollable content with fixed sidebars
Usage:
// Section-based docs (recommended) - nav items auto-generated
DocsLayout docs = new DocsLayout();
docs.addSection("Getting Started", gettingStartedContent)
.addSection("Installation", installationContent)
.addSection("API Reference", apiReferenceContent);
// With TOC
docs.toc(tableOfContents);
// Programmatic navigation
docs.showSection(1); // Show "Installation"
docs.showSection("api-reference"); // Show by ID
// Manual mode (for custom nav)
DocsLayout docs = new DocsLayout();
docs.nav(customNavigation)
.content(articleContent)
.toc(tableOfContents);
// With custom widths
DocsLayout docs = new DocsLayout();
docs.setNavWidth(280)
.setTocWidth(220);
// With header
docs.header(breadcrumbs);
- Since:
- 2025
- Version:
- 1.0
- Author:
- Marvin P. Warble Jr.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddSection(String label, Element<?> content) Adds a section with the specified label and content.addSection(String label, String id, Element<?> content) Adds a section with the specified label, ID, and content.addTocHeading(Element<?> heading, StyledContainerElement<?> container) Adds a heading to the specified container and creates a corresponding TOC link.addTocHeading(Element<?> heading, StyledContainerElement<?> container, String anchorId) Adds a heading to the specified container and creates a corresponding TOC link with a custom ID.clearToc()Clears the TOC and prepares for new TOC links.Sets the main content.intReturns the currently active section index.Returns the content deck for advanced customization.Returns the content pane for advanced customization.Returns the header pane for advanced customization.Returns the nav items container for customization.Returns the navigation pane for advanced customization.intReturns the number of sections.Returns the TOC items container for customization.Returns the TOC pane for advanced customization.Sets the header content (shown above the main content).protected voidBuilds the element tree for the layout.Sets the navigation (left sidebar) content.Disables sticky positioning for the nav column.Disables sticky positioning for the TOC column.voidonEvent(MouseClickedEvent event) Handles click events on nav items.setColumnGap(int gap) Sets the gap between columns.setColumnGap(String gap) Sets the gap between columns.setContentBackground(String color) Sets the content background color.setContentMaxWidth(String maxWidth) Sets a maximum width for the content area.setContentPadding(int padding) Sets padding for the content area.setContentPadding(String padding) Sets padding for the content area.setNavBackground(String color) Sets the navigation background color.setNavBorder(String border) Adds a border to the navigation column.setNavItemGap(int gap) Sets the gap between nav items.setNavItemGap(String gap) Sets the gap between nav items.setNavPadding(int padding) Sets padding for the navigation area.setNavPadding(String padding) Sets padding for the navigation area.setNavWidth(int width) Sets the navigation column width.setNavWidth(String width) Sets the navigation column width.setTocBackground(String color) Sets the TOC background color.setTocBorder(String border) Adds a border to the TOC column.setTocHeader(String text) Sets the TOC header text (e.g., "On this page").setTocPadding(int padding) Sets padding for the TOC area.setTocPadding(String padding) Sets padding for the TOC area.setTocWidth(int width) Sets the TOC column width.setTocWidth(String width) Sets the TOC column width.showSection(int index) Shows the section at the specified index.showSection(String id) Shows the section with the specified ID.Sets the table of contents (right sidebar) content.Methods inherited from class com.oorian.html.layout.PageLayout
createPane, createPane, fillParent, fillViewport, setBackgroundColor, setMinHeightMethods inherited from class com.oorian.html.StyledElement
addClass, addStyle, addStyle, addStyleAttribute, addTransition, animate, clearTransitions, getActiveStyle, getCssClass, getDisabledStyle, getFocusStyle, getFocusVisibleStyle, getHoverStyle, getHtml, getStyle, getStyleAttribute, hidden, hide, isDisplayed, isTransitionForwardActive, onHide, onRemovedFromPage, onShow, removeClass, setActiveStyle, setAlignContent, setAlignContent, setAlignItems, setAlignItems, setAlignSelf, setAlignSelf, setAnimation, setAnimationDelay, setAnimationDelay, setAnimationDelay, setAnimationDirection, setAnimationDirection, setAnimationDuration, setAnimationDuration, setAnimationDuration, setAnimationFillMode, setAnimationFillMode, setAnimationIterationCount, setAnimationIterationCount, setAnimationIterationCount, setAnimationName, setAnimationPlayState, setAnimationPlayState, setAnimationTimingFunction, setAnimationTimingFunction, setAnimationTimingFunction, setAnimationTimingFunction, setBackdropFilter, setBackdropFilter, setBackfaceVisibility, setBackfaceVisibility, setBackground, setBackground, setBackgroundAttachment, setBackgroundAttachment, setBackgroundBlendMode, setBackgroundBlendMode, setBackgroundClip, setBackgroundClip, setBackgroundColor, setBackgroundColor, setBackgroundImage, setBackgroundImage, setBackgroundOrigin, setBackgroundOrigin, setBackgroundPosition, setBackgroundPosition, setBackgroundPosition, setBackgroundPosition, setBackgroundPosition, setBackgroundRepeat, setBackgroundRepeat, setBackgroundSize, setBackgroundSize, setBackgroundSize, setBackgroundSize, setBackgroundSize, setBlur, setBorder, setBorder, setBorder, setBorder, setBorder, setBorder, setBorder, setBorder, setBorder, setBorderBottom, setBorderBottom, setBorderBottom, setBorderBottom, setBorderBottom, setBorderBottom, setBorderBottom, setBorderBottom, setBorderBottomColor, setBorderBottomColor, setBorderBottomLeftRadius, setBorderBottomLeftRadius, setBorderBottomLeftRadius, setBorderBottomRightRadius, setBorderBottomRightRadius, setBorderBottomRightRadius, setBorderBottomStyle, setBorderBottomStyle, setBorderBottomWidth, setBorderBottomWidth, setBorderBottomWidth, setBorderBottomWidth, setBorderColor, setBorderColor, setBorderColor, setBorderColor, setBorderImage, setBorderImage, setBorderImageOutset, setBorderImageRepeat, setBorderImageSlice, setBorderImageSource, setBorderImageWidth, setBorderLeft, setBorderLeft, setBorderLeft, setBorderLeft, setBorderLeft, setBorderLeft, setBorderLeft, setBorderLeft, setBorderLeftColor, setBorderLeftColor, setBorderLeftStyle, setBorderLeftStyle, setBorderLeftWidth, setBorderLeftWidth, setBorderLeftWidth, setBorderLeftWidth, setBorderRadius, setBorderRadius, setBorderRadius, setBorderRadius, setBorderRadius, setBorderRadius, setBorderRight, setBorderRight, setBorderRight, setBorderRight, setBorderRight, setBorderRight, setBorderRight, setBorderRight, setBorderRightColor, setBorderRightColor, setBorderRightStyle, setBorderRightStyle, setBorderRightWidth, setBorderRightWidth, setBorderRightWidth, setBorderRightWidth, setBorderStyle, setBorderStyle, setBorderTop, setBorderTop, setBorderTop, setBorderTop, setBorderTop, setBorderTop, setBorderTop, setBorderTop, setBorderTopColor, setBorderTopColor, setBorderTopLeftRadius, setBorderTopLeftRadius, setBorderTopLeftRadius, setBorderTopRightRadius, setBorderTopRightRadius, setBorderTopRightRadius, setBorderTopStyle, setBorderTopStyle, setBorderTopWidth, setBorderTopWidth, setBorderTopWidth, setBorderTopWidth, setBorderWidth, setBorderWidth, setBorderWidth, setBorderWidth, setBorderWidth, setBorderWidth, setBorderWidth, setBottom, setBottom, setBottom, setBoxShadow, setBoxShadow, setBoxShadow, setBoxShadow, setBoxShadow, setBoxSizing, setBoxSizing, setBreakAfter, setBreakBefore, setBreakInside, setBrightness, setClass, setClear, setClear, setClip, setClipPath, setClipPath, setColGap, setColGap, setColor, setColor, setColumnCount, setColumnCount, setColumnFill, setColumnFill, setColumnRule, setColumnRuleColor, setColumnRuleColor, setColumnRuleStyle, setColumnRuleStyle, setColumnRuleWidth, setColumnRuleWidth, setColumns, setColumns, setColumns, setColumnSpan, setColumnWidth, setColumnWidth, setColumnWidth, setContrast, setCounterIncrement, setCounterReset, setCursor, setCursor, setDirection, setDirection, setDisabledStyle, setDisplay, setDisplay, setFilter, setFilter, setFilterOpacity, setFlex, setFlexBasis, setFlexDirection, setFlexDirection, setFlexFlow, setFlexGrow, setFlexGrow, setFlexShrink, setFlexShrink, setFlexWrap, setFlexWrap, setFloat, setFloat, setFocusStyle, setFocusVisibleStyle, setFont, setFont, setFont, setFont, setFont, setFont, setFont, setFont, setFont, setFont, setFont, setFont, setFontFace, setFontFamily, setFontFamily, setFontFeatureSettings, setFontKerning, setFontLanguageOverride, setFontSize, setFontSize, setFontSize, setFontSizeAdjust, setFontStretch, setFontStretch, setFontStyle, setFontStyle, setFontSynthesis, setFontVariant, setFontVariant, setFontVariantAlternates, setFontVariantCaps, setFontVariantEastAsian, setFontVariantLigatures, setFontVariantNumeric, setFontVariantPosition, setFontWeight, setFontWeight, setGap, setGap, setGap, setGap, setGrayscale, setHangingPunctuation, setHangingPunctuation, setHeight, setHeight, setHeight, setHoverStyle, setHueRotate, setHyphens, setImageOrientation, setImageRendering, setImageResolution, setImeMode, setInvert, setJustifyContent, setJustifyContent, setKeyFrames, setLeft, setLeft, setLeft, setLetterSpacing, setLetterSpacing, setLetterSpacing, setLetterSpacing, setLineBreak, setLineHeight, setLineHeight, setLineHeight, setLineHeight, setMargin, setMargin, setMargin, setMargin, setMargin, setMarginBottom, setMarginBottom, setMarginBottom, setMarginLeft, setMarginLeft, setMarginLeft, setMarginRight, setMarginRight, setMarginRight, setMarginTop, setMarginTop, setMarginTop, setMark, setMarkAfter, setMarkBefore, setMarks, setMarqueeDirection, setMarqueePlayCount, setMarqueeSpeed, setMarqueeStyle, setMask, setMaskType, setMaxHeight, setMaxHeight, setMaxHeight, setMaxHeightToWindowHeight, setMaxWidth, setMaxWidth, setMaxWidth, setMaxWidthToWindowWidth, setMinHeight, setMinHeight, setMinHeightToWindowHeight, setMinWidth, setMinWidth, setMinWidth, setMinWidthToWindowWidth, setNavDown, setNavIndex, setNavIndex, setNavLeft, setNavRight, setNavUp, setObjectFit, setObjectPosition, setOnClickNavigateBack, setOnClickNavigateBack, setOnClickNavigateBack, setOnClickNavigateForward, setOnClickNavigateForward, setOnClickNavigateForward, setOnClickNavigateTo, setOnDblClick, setOnDblClickChange, setOpacity, setOpacity, setOrder, setOrder, setOrphans, setOutline, setOutline, setOutline, setOutline, setOutlineColor, setOutlineColor, setOutlineOffset, setOutlineOffset, setOutlineOffset, setOutlineStyle, setOutlineStyle, setOutlineWidth, setOutlineWidth, setOutlineWidth, setOutlineWidth, setOverflow, setOverflow, setOverflow, setOverflowWrap, setOverflowX, setOverflowX, setOverflowY, setOverflowY, setPadding, setPadding, setPadding, setPadding, setPadding, setPadding, setPadding, setPadding, setPaddingBottom, setPaddingBottom, setPaddingBottom, setPaddingLeft, setPaddingLeft, setPaddingLeft, setPaddingRight, setPaddingRight, setPaddingRight, setPaddingTop, setPaddingTop, setPaddingTop, setPageBreakAfter, setPageBreakAfter, setPageBreakBefore, setPageBreakBefore, setPageBreakInside, setPageBreakInside, setPerspective, setPerspective, setPerspective, setPerspectiveOrigin, setPerspectiveOrigin, setPerspectiveOrigin, setPerspectiveOrigin, setPhonemes, setPosition, setPosition, setPosition, setPosition, setPosition, setQuotes, setResize, setResize, setResizeToWindowHeight, setResizeToWindowHeight, setResizeToWindowWidth, setRest, setRestAfter, setRestBefore, setRight, setRight, setRight, setRotate, setRotate, setRowGap, setRowGap, setSaturate, setScale, setScale, setSepia, setShow, setSize, setSize, setSize, setSkewX, setSkewY, setStyle, setStyle, setTabSize, setTabSize, setTabSize, setTabSize, setTextAlign, setTextAlign, setTextAlignLast, setTextAlignLast, setTextCombineUpright, setTextCombineWeight, setTextDecoration, setTextDecoration, setTextDecorationColor, setTextDecorationColor, setTextDecorationLine, setTextDecorationLine, setTextDecorationStyle, setTextDecorationStyle, setTextIndent, setTextIndent, setTextIndent, setTextIndent, setTextJustify, setTextJustify, setTextOrientation, setTextOverflow, setTextOverflow, setTextSelectDisabled, setTextShadow, setTextShadow, setTextShadow, setTextShadow, setTextShadow, setTextTransform, setTextTransform, setTextUnderlinePosition, setTop, setTop, setTop, setTransform, setTransform, setTransformOrigin, setTransformOrigin, setTransformOrigin, setTransformOrigin, setTransformOrigin, setTransformStyle, setTransformStyle, setTransition, setTransitionDelay, setTransitionDelay, setTransitionDelay, setTransitionDuration, setTransitionDuration, setTransitionDuration, setTransitionProperty, setTransitionTimingFunction, setTransitionTimingFunction, setTransitionTimingFunction, setTransitionTimingFunction, setTranslateX, setTranslateY, setTranslateZ, setUnicodeBidi, setUnicodeBidi, setVerticalAlign, setVerticalAlign, setVisibility, setVisibility, setVoiceBalance, setVoiceDuration, setVoicePitch, setVoicePitchRange, setVoiceRate, setVoiceStress, setVoiceVolume, setWhiteSpace, setWhiteSpace, setWidows, setWidth, setWidth, setWidth, setWordBreak, setWordBreak, setWordSpacing, setWordSpacing, setWordSpacing, setWordSpacing, setWordWrap, setWordWrap, setWritingMode, setZIndex, setZIndex, show, shown, stopAnimation, transitionForward, transitionForward, transitionReverse, transitionReverse, updateStyle, updateStyle, updateStyleIfChangedMethods inherited from class com.oorian.html.VisualElement
clearOnClick, click, disable, enable, getAccessKey, getAutoCapitalize, getEnterKeyHint, getInputMode, getPopover, getRole, getTabIndex, getTitle, isAutoFocus, isContentEditable, isDisabled, isDraggable, isHidden, isInert, isSpellCheck, onDisabled, onEnabled, setAccessKey, setAriaAtomic, setAriaBusy, setAriaChecked, setAriaCheckedMixed, setAriaControls, setAriaCurrent, setAriaDescribedBy, setAriaDisabled, setAriaErrorMessage, setAriaExpanded, setAriaHasPopup, setAriaHasPopup, setAriaHidden, setAriaInvalid, setAriaLabel, setAriaLabelledBy, setAriaLevel, setAriaLive, setAriaModal, setAriaOwns, setAriaPressed, setAriaRequired, setAriaSelected, setAriaValueRange, setAriaValueText, setAutoCapitalize, setAutoFocus, setConsumeEvent, setContentEditable, setDisabled, setDraggable, setDropAllowed, setEnterKeyHint, setFocus, setHidden, setInert, setInputMode, setOnAnimationCancel, setOnAnimationEnd, setOnAnimationIteration, setOnAnimationStart, setOnAuxClick, setOnBeforeInput, setOnBeforeToggle, setOnBlur, setOnChange, setOnClick, setOnClickChange, setOnCompositionEnd, setOnCompositionStart, setOnCompositionUpdate, setOnContextMenu, setOnCopy, setOnCut, setOnDocumentResize, setOnFocus, setOnFocusIn, setOnFocusOut, setOnFormData, setOnGotPointerCapture, setOnInput, setOnInvalid, setOnKeyDown, setOnKeyPressed, setOnKeyUp, setOnLostPointerCapture, setOnMouseDown, setOnMouseEnter, setOnMouseLeave, setOnMouseMove, setOnMouseOut, setOnMouseOutChangeClass, setOnMouseOutChangeStyle, setOnMouseOutChangeStyle, setOnMouseOver, setOnMouseOverChangeClass, setOnMouseOverChangeStyle, setOnMouseOverChangeStyle, setOnMouseOverShow, setOnMouseUp, setOnPageLoad, setOnPaste, setOnPointerCancel, setOnPointerDown, setOnPointerEnter, setOnPointerLeave, setOnPointerMove, setOnPointerOut, setOnPointerOver, setOnPointerUp, setOnResize, setOnScroll, setOnScrollEnd, setOnSelect, setOnSelectionChange, setOnSelectStart, setOnToggle, setOnTouchCancel, setOnTouchEnd, setOnTouchMove, setOnTouchStart, setOnTransitionCancel, setOnTransitionEnd, setOnTransitionRun, setOnTransitionStart, setOnWheel, setOnWindowResize, setPopover, setRole, setRole, setSpellCheck, setTabIndex, setTitle, setTooltipMethods inherited from class com.oorian.html.Element
addAttribute, addAttribute, addAttribute, addAttribute, addElement, addLineBreak, addLineOfText, addLineOfText, addLineOfText, addParagraph, addParagraph, addSpacer, addText, addText, addText, addText, assignId, containsElement, containsElement, create, dispatchEvent, dispatchEvent, dispatchEvent, dispatchEvent, equals, excludeId, executeJs, executeJs, executeJs, getAccept, getAllElements, getAncestor, getAttribute, getAttributes, getComponent, getDir, getElement, getElementById, getElementCount, getElementCount, getElements, getElements, getElementsByComponentName, getElementsByTagName, getHtml, getId, getInnerHtml, getInnerHtml, getIs, getItemId, getItemProp, getItemRef, getItemType, getLang, getNextSibling, getPage, getParent, getPart, getPrevSibling, getSlot, getTagName, getTextContent, getUrl, hasAttribute, hasElements, insertElement, isChildOf, isClosedTag, isCreated, isDescendantOf, isDescendantOf, isInitialized, isItemScope, isTranslate, onCallback, onCreated, onElementAdded, onElementRemoved, onHashChange, onHidden, onInitialized, onJsReturn, onPageLoaded, onPageUnloaded, onRefresh, onShown, onUpdated, onUserEvent, prewrite, recreate, refresh, refresh, registerAddition, registerListener, registerListener, registerListener, registerListener, registerListener, registerListener, registerListener, registerSubtraction, registerUpdate, removeAllElements, removeAttribute, removeAttribute, removeElement, removeElement, removeFromParent, requestCallback, requestCallback, requestCallback, requestCallback, resetId, scrollTo, scrollToBottom, scrollToTop, self, sendCommand, sendUpdate, setAccept, setComponent, setDir, setDir, setElement, setId, setIs, setItemId, setItemProp, setItemRef, setItemScope, setItemType, setLang, setOnError, setOnLoad, setPage, setParent, setPart, setSlot, setTagName, setText, setText, setText, setText, setTranslate, toString, unregisterListener, update, updateAttributesMethods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.oorian.messaging.events.client.MouseClickListener
onEvent
-
Constructor Details
-
DocsLayout
public DocsLayout()Constructs a DocsLayout with default column widths.
-
-
Method Details
-
initialize
protected void initialize()Builds the element tree for the layout.- Overrides:
initializein classStyledElement<DocsLayout>
-
content
Sets the main content.- Parameters:
content- the content element- Returns:
- this DocsLayout for method chaining
-
toc
Sets the table of contents (right sidebar) content.- Parameters:
toc- the table of contents element- Returns:
- this DocsLayout for method chaining
-
header
Sets the header content (shown above the main content).- Parameters:
header- the header element (breadcrumbs, page title, etc.)- Returns:
- this DocsLayout for method chaining
-
setTocWidth
Sets the TOC column width.- Parameters:
width- the width in pixels- Returns:
- this DocsLayout for method chaining
-
setTocWidth
Sets the TOC column width.- Parameters:
width- the width value (e.g., "200px", "15%")- Returns:
- this DocsLayout for method chaining
-
noStickyToc
Disables sticky positioning for the TOC column.- Returns:
- this DocsLayout for method chaining
-
setContentBackground
Sets the content background color.- Parameters:
color- the background color- Returns:
- this DocsLayout for method chaining
-
setTocBackground
Sets the TOC background color.- Parameters:
color- the background color- Returns:
- this DocsLayout for method chaining
-
setContentPadding
Sets padding for the content area.- Parameters:
padding- the padding in pixels- Returns:
- this DocsLayout for method chaining
-
setContentPadding
Sets padding for the content area.- Parameters:
padding- the padding value (e.g., "2rem", "32px")- Returns:
- this DocsLayout for method chaining
-
setTocPadding
Sets padding for the TOC area.- Parameters:
padding- the padding in pixels- Returns:
- this DocsLayout for method chaining
-
setTocPadding
Sets padding for the TOC area.- Parameters:
padding- the padding value (e.g., "1rem", "16px")- Returns:
- this DocsLayout for method chaining
-
setContentMaxWidth
Sets a maximum width for the content area.- Parameters:
maxWidth- the maximum width (e.g., "800px", "60rem")- Returns:
- this DocsLayout for method chaining
-
setTocHeader
Sets the TOC header text (e.g., "On this page").Call this before adding TOC headings to set a title for the TOC section.
- Parameters:
text- the header text- Returns:
- this DocsLayout for method chaining
-
addTocHeading
Adds a heading to the specified container and creates a corresponding TOC link.This method automatically:
- Generates an anchor ID from the heading text
- Sets the ID on the heading element
- Adds the heading to the container
- Creates a TOC link that scrolls to the heading when clicked
Usage:
Div content = new Div(); docs.addTocHeading(new H2("Getting Started"), content); docs.addTocHeading(new H3("Installation"), content); docs.addTocHeading(new H3("Configuration"), content); docs.content(content);- Parameters:
heading- the heading element (H1, H2, H3, etc.)container- the container to add the heading to- Returns:
- this DocsLayout for method chaining
-
addTocHeading
public DocsLayout addTocHeading(Element<?> heading, StyledContainerElement<?> container, String anchorId) Adds a heading to the specified container and creates a corresponding TOC link with a custom ID.- Parameters:
heading- the heading element (H1, H2, H3, etc.)container- the container to add the heading toanchorId- optional custom anchor ID (if null, generated from heading text)- Returns:
- this DocsLayout for method chaining
-
clearToc
Clears the TOC and prepares for new TOC links.Call this when switching sections to reset the TOC for the new section's headings.
- Returns:
- this DocsLayout for method chaining
-
getTocItems
Returns the TOC items container for customization.- Returns:
- the TOC items VStack
-
setColumnGap
Sets the gap between columns.- Parameters:
gap- the gap in pixels- Returns:
- this DocsLayout for method chaining
-
setColumnGap
Sets the gap between columns.- Overrides:
setColumnGapin classStyledElement<DocsLayout>- Parameters:
gap- the gap value (e.g., "24px", "2rem")- Returns:
- this DocsLayout for method chaining
-
setTocBorder
Adds a border to the TOC column.- Parameters:
border- the border value (e.g., "1px solid #e0e0e0")- Returns:
- this DocsLayout for method chaining
-
getContentPane
Returns the content pane for advanced customization.- Returns:
- the content pane
-
getTocPane
Returns the TOC pane for advanced customization.- Returns:
- the TOC pane
-
getHeaderPane
Returns the header pane for advanced customization.- Returns:
- the header pane
-
addSection
Adds a section with the specified label and content.This creates a clickable nav item and adds the content to an internal Deck. Clicking the nav item will show the corresponding content.
- Parameters:
label- the nav label for this sectioncontent- the content to display when this section is selected- Returns:
- this DocsLayout for method chaining
-
addSection
Adds a section with the specified label, ID, and content.This creates a clickable nav item and adds the content to an internal Deck. Clicking the nav item will show the corresponding content.
- Parameters:
label- the nav label for this sectionid- optional ID for programmatic access (if null, generated from label)content- the content to display when this section is selected- Returns:
- this DocsLayout for method chaining
-
showSection
Shows the section at the specified index.- Parameters:
index- the section index (0-based)- Returns:
- this DocsLayout for method chaining
-
showSection
Shows the section with the specified ID.- Parameters:
id- the section ID- Returns:
- this DocsLayout for method chaining
-
getActiveSectionIndex
public int getActiveSectionIndex()Returns the currently active section index.- Returns:
- the active section index, or -1 if no section is active
-
getSectionCount
public int getSectionCount()Returns the number of sections.- Returns:
- the section count
-
onEvent
Handles click events on nav items.- Specified by:
onEventin interfaceMouseClickListener- Parameters:
event- the mouse click event
-
getContentDeck
Returns the content deck for advanced customization.- Returns:
- the content Deck
-