Package com.oorian.html.layout
Class Tab
java.lang.Object
com.oorian.html.layout.Tab
- All Implemented Interfaces:
ClientEventListener,MouseClickListener,EventListener
An individual tab within a
TabbedLayout.
Tab consists of two parts:
- Header - The clickable tab button/label
- Content - The panel content shown when this tab is active
Usage:
// Create a tab
Tab tab = new Tab("Settings", settingsPanel);
// Or with custom header
Tab tab = new Tab();
tab.setHeader(customHeader);
tab.setContent(content);
// Add to tabbed layout
tabbedLayout.addTab(tab);
- Since:
- 2025
- Version:
- 1.0
- Author:
- Marvin P. Warble Jr.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the content element.Returns the header element.booleanisActive()Checks if this tab is currently active.voidonEvent(MouseClickedEvent event) Handles click events on the tab header.setContent(Element<?> contentElement) Sets the tab content.setContentPadding(int padding) Sets padding for the content area.setContentPadding(String padding) Sets padding for the content area.Sets a custom header element.setHeaderPadding(int padding) Sets padding for the header.setHeaderPadding(String padding) Sets padding for the header.Sets the tab label text.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.oorian.messaging.events.client.MouseClickListener
onEvent
-
Constructor Details
-
Tab
public Tab()Constructs an empty Tab. -
Tab
Constructs a Tab with the specified label and content.- Parameters:
label- the tab labelcontentElement- the content element
-
-
Method Details
-
setLabel
Sets the tab label text.- Parameters:
label- the label text- Returns:
- this Tab for method chaining
-
setHeader
Sets a custom header element.- Parameters:
headerElement- the header element- Returns:
- this Tab for method chaining
-
setContent
Sets the tab content.- Parameters:
contentElement- the content element- Returns:
- this Tab for method chaining
-
isActive
public boolean isActive()Checks if this tab is currently active.- Returns:
- true if active, false otherwise
-
getHeader
Returns the header element.- Returns:
- the header div
-
getContent
Returns the content element.- Returns:
- the content div
-
onEvent
Handles click events on the tab header.- Specified by:
onEventin interfaceMouseClickListener- Parameters:
event- the mouse click event
-
setHeaderPadding
Sets padding for the header.- Parameters:
padding- the padding in pixels- Returns:
- this Tab for method chaining
-
setHeaderPadding
Sets padding for the header.- Parameters:
padding- the padding value (e.g., "0.75rem 1rem")- Returns:
- this Tab for method chaining
-
setContentPadding
Sets padding for the content area.- Parameters:
padding- the padding in pixels- Returns:
- this Tab for method chaining
-
setContentPadding
Sets padding for the content area.- Parameters:
padding- the padding value (e.g., "1rem")- Returns:
- this Tab for method chaining
-