Usage example within a TabsPanel :
TabsPanel panel = new TabsPanel();
Tab exampleTab = Tab.create("Example");
panel.appendChild(exampleTab);
exampleTab.activate();
exampleTab.setClosable(true);
See also :
public void TabsPanel()
public TabsPanel insertAt(int index, Tab tab)
index
the index to insert the tab.
tab
the tab to be inserted.
the current TabsPanel instance.
@throws IndexOutOfBoundsException if the index is out of range.public TabsPanel appendChild(Tab tab)
tab
the tab to be appended.
the current TabsPanel instance.
public TabsPanel appendChild(FillItem fillItem)
fillItem
the fill item to be appended.
the current TabsPanel instance.
public void activateTab(int index)
index
the index of the tab to activate.
public HTMLDivElement element()
the root HTMLDivElement of this TabsPanel .
public TabsPanel setTransition(Transition transition)
transition
the transition to set.
the current TabsPanel instance.
public TabsPanel setContentContainer(Element contentContainer)
contentContainer
the new content container.
the current TabsPanel instance.
public TabsPanel setContentContainer(IsElement<?> contentContainer)
contentContainer
the new content container.
the current TabsPanel instance.
public DominoElement<Element> getTabsContent()
the DominoElement for the tabs' content.
public Tab getActiveTab()
public List<Tab> getTabs()
public void closeTab(Tab tab)
tab
the Tab to close.
public TabsPanel addCloseHandler(Consumer<Tab> closeHandler)
public TabsPanel removeCloseHandler(Consumer<Tab> closeHandler)
closeHandler
the close handler to remove.
the current TabsPanel instance.
public TabsPanel addActivationHandler(ActivationHandler activationHandler)
activationHandler
the handler to add.
the current TabsPanel instance.
public TabsPanel removeActivationHandler(ActivationHandler activationHandler)
activationHandler
the handler to remove.
the current TabsPanel instance.
public TabsPanel activateByKey(String key)
key
the unique identifier of the tab.
the current TabsPanel instance.
public TabsPanel activateByKey(String key, boolean silent)
key
the unique identifier of the tab.
silent
whether the activation should be silent.
the current TabsPanel instance.
public Optional<Tab> findByKey(String key)
key
The tab key
Optional of a tab.
public boolean isAutoActivate()
true if auto-activation is enabled, false otherwise.
public TabsPanel setAutoActivate(boolean autoActivate)
autoActivate
true to enable auto-activation, false to disable it.
the current TabsPanel instance for method chaining.
public TabsPanel setTabsAlign(TabsAlign align)
align
the desired alignment for the tabs.
the current TabsPanel instance.
public TabsPanel setTabsDirection(TabsDirection direction)
direction
the desired TabsDirection for the tabs.
the current TabsPanel instance for method chaining.
public TabsPanel setHeaderDirection(HeaderDirection direction)
direction
the desired HeaderDirection for the header.
the current TabsPanel instance for method chaining.
public TabsPanel setTabHeaderAlign(TabsHeaderAlign align)
align
the desired TabsHeaderAlign for the tab headers.
the current TabsPanel instance for method chaining.
public TabsPanel withTabsNav(ChildHandler<TabsPanel, UListElement> handler)
handler
the handler for customizing the tabs' navigation.
the current TabsPanel instance.
public UListElement getTabsNav()
public TabsPanel withTabsContent(ChildHandler<TabsPanel, DominoElement<Element>> handler)
handler
the handler for customizing the tabs' content.
the current TabsPanel instance.
public TabsPanel withMainNav(ChildHandler<TabsPanel, DivElement> handler)
handler
the handler for customizing the tabs' content.
the current TabsPanel instance.
public TabsPanel withNavLeadElement(ChildHandler<TabsPanel, DivElement> handler)
handler
the handler for customizing the tabs' content.
the current TabsPanel instance.
public TabsPanel withNavTailElement(ChildHandler<TabsPanel, DivElement> handler)
handler
the handler for customizing the tabs' content.
the current TabsPanel instance.
public TabsPanel withEachTab(ChildHandler<TabsPanel, Tab> handler)
handler
same tabs panel
public DivElement getMainNav()
The container that hosts the tabs nav element in addition to navigation leading element and navigation tail element used to implement navigation overflow behavior
public DivElement getLeadingNav()
The navigation leading element to the left of the tabs navigation elements
public DivElement getTailNav()
the navigation tail element to the right of the tabs navigation element.
public void Tab(String title)
title
The title of the tab.
public void Tab(Node title)
title
The title of the tab.
public void Tab(Icon<?> icon)
icon
The icon of the tab.
public void Tab(Icon<?> icon, String title, String key)
icon
The icon of the tab.
title
The title of the tab.
key
The key associated with the tab.
public void Tab(Icon<?> icon, Node title, String key)
icon
The icon of the tab.
title
The title of the tab.
key
The key associated with the tab.
public void Tab(Icon<?> icon, String title)
icon
The icon of the tab.
title
The title of the tab.
public void Tab(Icon<?> icon, Node title)
icon
The icon of the tab.
title
The title of the tab.
public static Tab create(String title)
title
The title of the tab.
The created tab.
public static Tab create(Node title)
title
The title of the tab.
The created tab.
public static Tab create(String key, String title)
public static Tab create(String key, Node title)
public static Tab create(Icon<?> icon)
public static Tab create(String key, Icon<?> icon)
public static Tab create(Icon<?> icon, String title)
public static Tab create(Icon<?> icon, Node title)
public static Tab create(String key, Icon<?> icon, String title)
public HTMLElement getAppendTarget()
The HTMLElement representing the content area of the tab.
public LIElement getTab()
public DivElement getTabPanel()
The DivElement representing the content area of the tab.
public Tab appendChild(Node content)
public Tab appendChild(IsElement<?> content)
public Tab setContent(IsElement<?> element)
public Tab setContent(Node content)
public Tab setTitle(String title)
public Tab setTitle(Node title)
public Tab setIcon(Icon<?> icon)
public Tab activate()
public Tab activate(boolean silent)
silent
If true, the activation event handlers will not be triggered.
The current Tab instance.
public Tab deActivate()
public Tab deActivate(boolean silent)
silent
If true, the deactivation event handlers will not be triggered.
The current Tab instance.
public Tab setClosable(boolean closable)
closable
If true, the tab becomes closable; otherwise, it's not closable.
The current Tab instance.
public Tab close()
public Tab closable()
public Tab notClosable()
public Tab setOnBeforeCloseHandler(CloseHandler closeHandler)
closeHandler
The CloseHandler instance that provides the close condition.
The current Tab instance.
public Tab addCloseHandler(Consumer<Tab> closeHandler)
closeHandler
The close handler to be added.
The current Tab instance.
public Tab removeCloseHandler(Consumer<Tab> closeHandler)
closeHandler
The close handler to be removed.
The current Tab instance.
public Tab addActivationHandler(ActivationHandler activationHandler)
activationHandler
The activation handler to be added.
The current Tab instance.
public Tab removeActivationHandler(ActivationHandler activationHandler)
activationHandler
The activation handler to be removed.
The current Tab instance.
public boolean isActive()
True if the tab is active, otherwise false.
public HTMLAnchorElement getClickableElement()
The HTMLAnchorElement which is the clickable element of the tab.
public HTMLLIElement element()
The HTMLLIElement which represents the tab.
public String getKey()
The key of the tab.
public Tab setKey(String key)
public void removeTab()
public Tab withHeader(ChildHandler<Tab, DivElement> handler)
handler
The ChildHandler which defines how child elements should be added to the tab's header.
The current Tab instance.
public Tab withContent(ChildHandler<Tab, DivElement> handler)
handler
The ChildHandler which defines how child elements should be added to the tab's content panel.
The current Tab instance.