Package com.oorian.html.layout
Class MasterDetailLayout
java.lang.Object
- All Implemented Interfaces:
ClientEventListener,MouseClickListener,EventListener
public class MasterDetailLayout
extends PageLayout<MasterDetailLayout>
implements MouseClickListener
A two-pane layout with a master list/tree and a detail view.
MasterDetailLayout implements the classic master-detail pattern used in CRUD screens, email clients, file managers, and record browsers. The master pane typically shows a list or tree, and selecting an item updates the detail pane.
Structure:
┌──────────────┬────────────────────────┐ │ │ │ │ Master │ Detail │ │ (List) │ (View) │ │ │ │ │ │ │ └──────────────┴────────────────────────┘
Features:
- Horizontal or vertical split
- Configurable master pane width/height
- Master on left, right, top, or bottom
- Optional border/divider between panes
- Responsive collapse on mobile
Usage:
// Basic master-detail (master on left)
MasterDetailLayout layout = new MasterDetailLayout();
layout.master(studentList)
.detail(studentDetails);
// Custom master width
MasterDetailLayout layout = new MasterDetailLayout();
layout.setMasterWidth(350)
.master(recordList)
.detail(recordForm);
// Master on right
MasterDetailLayout rightMaster = MasterDetailLayout.withMasterOnRight();
rightMaster.master(propertiesPanel)
.detail(editor);
// Vertical split (master on top)
MasterDetailLayout vertical = MasterDetailLayout.vertical();
vertical.setMasterHeight(200)
.master(messageList)
.detail(messagePreview);
// With divider
layout.showDivider()
.setDividerColor("#e0e0e0");
- Since:
- 2025
- Version:
- 1.0
- Author:
- Marvin P. Warble Jr.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumstatic enum -
Constructor Summary
ConstructorsConstructorDescriptionConstructs a horizontal MasterDetailLayout with master on left.MasterDetailLayout(MasterDetailLayout.Orientation orientation, MasterDetailLayout.MasterPosition masterPosition) Constructs a MasterDetailLayout with the specified configuration. -
Method Summary
Modifier and TypeMethodDescriptionAdds an item with the specified label and detail content.Adds an item with the specified label, ID, and detail content.Sets the detail pane content.Returns the detail deck for advanced customization.Returns the detail pane for advanced customization.Returns the divider element for customization.intReturns the number of items.Returns the master items container for customization.Returns the master pane for advanced customization.intReturns the currently selected item index.Hides the divider between panes.protected voidBuilds the element tree for the layout.Sets the master pane content.voidonEvent(MouseClickedEvent event) Handles click events on master items.selectItem(int index) Selects the item at the specified index.selectItem(String id) Selects the item with the specified ID.setDetailBackground(String color) Sets the detail pane background color.setDetailPadding(int padding) Sets padding for the detail pane.setDetailPadding(String padding) Sets padding for the detail pane.setDividerColor(String color) Sets the divider color.setDividerThickness(int thickness) Sets the divider thickness.setGap(int gap) Sets the gap between master and detail (alternative to divider).Sets the gap between master and detail.setItemGap(int gap) Sets the gap between items in the master pane.setItemGap(String gap) Sets the gap between items in the master pane.setMasterBackground(String color) Sets the master pane background color.setMasterHeight(int height) Sets the master pane height (for vertical layout).setMasterHeight(String height) Sets the master pane height (for vertical layout).setMasterPadding(int padding) Sets padding for the master pane.setMasterPadding(String padding) Sets padding for the master pane.setMasterWidth(int width) Sets the master pane width (for horizontal layout).setMasterWidth(String width) Sets the master pane width (for horizontal layout).Shows the divider between master and detail panes.static MasterDetailLayoutvertical()Creates a vertical MasterDetailLayout with master pane on top.static MasterDetailLayoutCreates a vertical MasterDetailLayout with master pane on bottom.static MasterDetailLayoutCreates a MasterDetailLayout with master pane on the right.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, setColumnGap, 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, 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
-
MasterDetailLayout
public MasterDetailLayout()Constructs a horizontal MasterDetailLayout with master on left. -
MasterDetailLayout
public MasterDetailLayout(MasterDetailLayout.Orientation orientation, MasterDetailLayout.MasterPosition masterPosition) Constructs a MasterDetailLayout with the specified configuration.- Parameters:
orientation- the layout orientation (HORIZONTAL or VERTICAL)masterPosition- where the master pane is positioned (START or END)
-
-
Method Details
-
initialize
protected void initialize()Builds the element tree for the layout.- Overrides:
initializein classStyledElement<MasterDetailLayout>
-
withMasterOnRight
Creates a MasterDetailLayout with master pane on the right.- Returns:
- a new MasterDetailLayout with master on right
-
vertical
Creates a vertical MasterDetailLayout with master pane on top.- Returns:
- a new vertical MasterDetailLayout
-
verticalMasterOnBottom
Creates a vertical MasterDetailLayout with master pane on bottom.- Returns:
- a new vertical MasterDetailLayout with master on bottom
-
master
Sets the master pane content.- Parameters:
content- the master content element (list, tree, etc.)- Returns:
- this MasterDetailLayout for method chaining
-
detail
Sets the detail pane content.- Parameters:
content- the detail content element- Returns:
- this MasterDetailLayout for method chaining
-
setMasterWidth
Sets the master pane width (for horizontal layout).- Parameters:
width- the width in pixels- Returns:
- this MasterDetailLayout for method chaining
-
setMasterWidth
Sets the master pane width (for horizontal layout).- Parameters:
width- the width value (e.g., "300px", "30%", "20rem")- Returns:
- this MasterDetailLayout for method chaining
-
setMasterHeight
Sets the master pane height (for vertical layout).- Parameters:
height- the height in pixels- Returns:
- this MasterDetailLayout for method chaining
-
setMasterHeight
Sets the master pane height (for vertical layout).- Parameters:
height- the height value (e.g., "250px", "40%")- Returns:
- this MasterDetailLayout for method chaining
-
showDivider
Shows the divider between master and detail panes.- Returns:
- this MasterDetailLayout for method chaining
-
hideDivider
Hides the divider between panes.- Returns:
- this MasterDetailLayout for method chaining
-
setDividerColor
Sets the divider color.- Parameters:
color- the divider color- Returns:
- this MasterDetailLayout for method chaining
-
setDividerThickness
Sets the divider thickness.- Parameters:
thickness- the thickness in pixels- Returns:
- this MasterDetailLayout for method chaining
-
setGap
Sets the gap between master and detail (alternative to divider).- Overrides:
setGapin classStyledElement<MasterDetailLayout>- Parameters:
gap- the gap in pixels- Returns:
- this MasterDetailLayout for method chaining
-
setGap
Sets the gap between master and detail.- Overrides:
setGapin classStyledElement<MasterDetailLayout>- Parameters:
gap- the gap value (e.g., "16px", "1rem")- Returns:
- this MasterDetailLayout for method chaining
-
setMasterBackground
Sets the master pane background color.- Parameters:
color- the background color- Returns:
- this MasterDetailLayout for method chaining
-
setDetailBackground
Sets the detail pane background color.- Parameters:
color- the background color- Returns:
- this MasterDetailLayout for method chaining
-
setMasterPadding
Sets padding for the master pane.- Parameters:
padding- the padding in pixels- Returns:
- this MasterDetailLayout for method chaining
-
setMasterPadding
Sets padding for the master pane.- Parameters:
padding- the padding value (e.g., "1rem", "16px")- Returns:
- this MasterDetailLayout for method chaining
-
setDetailPadding
Sets padding for the detail pane.- Parameters:
padding- the padding in pixels- Returns:
- this MasterDetailLayout for method chaining
-
setDetailPadding
Sets padding for the detail pane.- Parameters:
padding- the padding value (e.g., "1rem", "24px")- Returns:
- this MasterDetailLayout for method chaining
-
getMasterPane
Returns the master pane for advanced customization.- Returns:
- the master pane
-
getDetailPane
Returns the detail pane for advanced customization.- Returns:
- the detail pane
-
getDivider
Returns the divider element for customization.- Returns:
- the divider element
-
addItem
Adds an item with the specified label and detail content.This creates a clickable item in the master pane and adds the detail content to an internal Deck. Clicking the item will show the corresponding detail view.
- Parameters:
label- the label for this itemdetail- the detail content to display when this item is selected- Returns:
- this MasterDetailLayout for method chaining
-
addItem
Adds an item with the specified label, ID, and detail content.This creates a clickable item in the master pane and adds the detail content to an internal Deck. Clicking the item will show the corresponding detail view.
- Parameters:
label- the label for this itemid- optional ID for programmatic access (if null, generated from label)detail- the detail content to display when this item is selected- Returns:
- this MasterDetailLayout for method chaining
-
selectItem
Selects the item at the specified index.- Parameters:
index- the item index (0-based)- Returns:
- this MasterDetailLayout for method chaining
-
selectItem
Selects the item with the specified ID.- Parameters:
id- the item ID- Returns:
- this MasterDetailLayout for method chaining
-
getSelectedItemIndex
public int getSelectedItemIndex()Returns the currently selected item index.- Returns:
- the selected item index, or -1 if no item is selected
-
getItemCount
public int getItemCount()Returns the number of items.- Returns:
- the item count
-
onEvent
Handles click events on master items.- Specified by:
onEventin interfaceMouseClickListener- Parameters:
event- the mouse click event
-
setItemGap
Sets the gap between items in the master pane.- Parameters:
gap- the gap in pixels- Returns:
- this MasterDetailLayout for method chaining
-
setItemGap
Sets the gap between items in the master pane.- Parameters:
gap- the gap value (e.g., "8px", "0.5rem")- Returns:
- this MasterDetailLayout for method chaining
-
getMasterItems
Returns the master items container for customization.- Returns:
- the master items VStack
-
getDetailDeck
Returns the detail deck for advanced customization.- Returns:
- the detail Deck
-