Class JmixTabSheet
java.lang.Object
com.vaadin.flow.component.Component
io.jmix.flowui.component.tabsheet.JmixTabSheet
- All Implemented Interfaces:
- com.vaadin.flow.component.AttachNotifier,- com.vaadin.flow.component.DetachNotifier,- com.vaadin.flow.component.HasElement,- com.vaadin.flow.component.HasSize,- com.vaadin.flow.component.HasStyle,- com.vaadin.flow.component.HasTheme,- com.vaadin.flow.component.shared.HasThemeVariant<com.vaadin.flow.component.tabs.TabSheetVariant>,- ComponentContainer,- Serializable
@Tag("jmix-tabsheet")
@JsModule("./src/tabsheet/jmix-tabsheet.js")
public class JmixTabSheet
extends com.vaadin.flow.component.Component
implements com.vaadin.flow.component.HasStyle, com.vaadin.flow.component.HasSize, com.vaadin.flow.component.shared.HasThemeVariant<com.vaadin.flow.component.tabs.TabSheetVariant>, ComponentContainer
- See Also:
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionstatic classAn event to mark that the selected tab has changed.
- 
Field SummaryFields
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptioncom.vaadin.flow.component.tabs.Tabadd(com.vaadin.flow.component.Component tabContent, com.vaadin.flow.component.Component content) Adds a tab created from the given tab content and content.com.vaadin.flow.component.tabs.Tabadd(com.vaadin.flow.component.tabs.Tab tab, com.vaadin.flow.component.Component content) Adds a tab with the given content.com.vaadin.flow.component.tabs.Tabadd(com.vaadin.flow.component.tabs.Tab tab, com.vaadin.flow.component.Component content, int position) com.vaadin.flow.component.tabs.TabAdds a tab created from the given text and content.com.vaadin.flow.shared.RegistrationaddSelectedChangeListener(com.vaadin.flow.component.ComponentEventListener<JmixTabSheet.SelectedChangeEvent> listener) Adds a listener forJmixTabSheet.SelectedChangeEvent.Optional<com.vaadin.flow.component.Component>protected StringStream<com.vaadin.flow.component.Component>Gets the child components of tab sheet inElementtree.com.vaadin.flow.component.ComponentgetContentByTab(com.vaadin.flow.component.tabs.Tab tab) intgetIndexOf(com.vaadin.flow.component.tabs.Tab tab) Returns the index of the given tab.Collection<com.vaadin.flow.component.Component>com.vaadin.flow.component.ComponentGets the component in the prefix slot of this component.intGets the zero-based index of the currently selected tab.com.vaadin.flow.component.tabs.TabGets the currently selected tab.com.vaadin.flow.component.ComponentGets the component in the suffix slot of this component.com.vaadin.flow.component.tabs.TabgetTabAt(int position) Returns the tab at the given position.protected voidvoidremove(int position) Removes the tab at the given position.voidremove(com.vaadin.flow.component.Component content) Removes a tab based on the contentvoidremove(com.vaadin.flow.component.tabs.Tab tab) Removes a tab.voidsetPrefixComponent(com.vaadin.flow.component.Component component) Adds the given component as the prefix of this component, replacing any existing prefix component.voidsetSelectedIndex(int selectedIndex) Selects a tab based on its zero-based index.voidsetSelectedTab(com.vaadin.flow.component.tabs.Tab selectedTab) Selects the given tab.voidsetSuffixComponent(com.vaadin.flow.component.Component component) Adds the given component as the suffix of this component, replacing any existing suffix component.protected voidMarks the content related to the selected tab as enabled and adds it to the component if it is not already added.Methods inherited from class com.vaadin.flow.component.ComponentaddListener, findAncestor, fireEvent, from, get, getElement, getEventBus, getId, getListeners, getLocale, getParent, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getUI, hasListener, isAttached, isTemplateMapped, isVisible, onAttach, onDetach, onEnabledStateChanged, scrollIntoView, set, setElement, setId, setVisibleMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.vaadin.flow.component.AttachNotifieraddAttachListenerMethods inherited from interface io.jmix.flowui.component.ComponentContainerfindComponent, getComponent, getComponents, getOwnComponentMethods inherited from interface com.vaadin.flow.component.DetachNotifieraddDetachListenerMethods inherited from interface com.vaadin.flow.component.HasElementgetElementMethods inherited from interface com.vaadin.flow.component.HasSizegetHeight, getHeightUnit, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getWidth, getWidthUnit, setHeight, setHeight, setHeightFull, setMaxHeight, setMaxHeight, setMaxWidth, setMaxWidth, setMinHeight, setMinHeight, setMinWidth, setMinWidth, setSizeFull, setSizeUndefined, setWidth, setWidth, setWidthFullMethods inherited from interface com.vaadin.flow.component.HasStyleaddClassName, addClassNames, getClassName, getClassNames, getStyle, hasClassName, removeClassName, removeClassNames, setClassName, setClassNameMethods inherited from interface com.vaadin.flow.component.HasThemeaddThemeName, addThemeNames, getThemeName, getThemeNames, hasThemeName, removeThemeName, removeThemeNames, setThemeName, setThemeNameMethods inherited from interface com.vaadin.flow.component.shared.HasThemeVariantaddThemeVariants, removeThemeVariants
- 
Field Details- 
GENERATED_TAB_ID_PREFIX- See Also:
 
- 
tabsprotected com.vaadin.flow.component.tabs.Tabs tabs
- 
tabToContent
 
- 
- 
Constructor Details- 
JmixTabSheetpublic JmixTabSheet()
 
- 
- 
Method Details- 
initComponentprotected void initComponent()
- 
addpublic com.vaadin.flow.component.tabs.Tab add(String tabText, com.vaadin.flow.component.Component content) Adds a tab created from the given text and content.- Parameters:
- tabText- the text of the tab
- content- the content related to the tab
- Returns:
- the created tab
 
- 
addpublic com.vaadin.flow.component.tabs.Tab add(com.vaadin.flow.component.Component tabContent, com.vaadin.flow.component.Component content) Adds a tab created from the given tab content and content.- Parameters:
- tabContent- the content of the tab
- content- the content related to the tab
- Returns:
- the created tab
 
- 
addpublic com.vaadin.flow.component.tabs.Tab add(com.vaadin.flow.component.tabs.Tab tab, com.vaadin.flow.component.Component content) Adds a tab with the given content.- Parameters:
- tab- the tab
- content- the content related to the tab
- Returns:
- the added tab
 
- 
addpublic com.vaadin.flow.component.tabs.Tab add(com.vaadin.flow.component.tabs.Tab tab, com.vaadin.flow.component.Component content, int position) 
- 
removepublic void remove(com.vaadin.flow.component.tabs.Tab tab) Removes a tab.- Parameters:
- tab- the non-null tab to be removed
 
- 
removepublic void remove(com.vaadin.flow.component.Component content) Removes a tab based on the content- Parameters:
- content- the non-null content related to the tab to be removed
 
- 
removepublic void remove(int position) Removes the tab at the given position.- Parameters:
- position- the position of the tab to be removed
 
- 
getContentByTabpublic com.vaadin.flow.component.Component getContentByTab(com.vaadin.flow.component.tabs.Tab tab) 
- 
findOwnComponent- Specified by:
- findOwnComponentin interface- ComponentContainer
 
- 
getOwnComponents- Specified by:
- getOwnComponentsin interface- ComponentContainer
 
- 
getChildrenGets the child components of tab sheet inElementtree.- Overrides:
- getChildrenin class- com.vaadin.flow.component.Component
- Returns:
- the stream of tab sheet tab
 
- 
getSelectedIndexpublic int getSelectedIndex()Gets the zero-based index of the currently selected tab.- Returns:
- the zero-based index of the selected tab, or -1 if none of the tabs is selected
 
- 
setSelectedIndexpublic void setSelectedIndex(int selectedIndex) Selects a tab based on its zero-based index.- Parameters:
- selectedIndex- the zero-based index of the selected tab, -1 to unselect all
 
- 
getSelectedTabpublic com.vaadin.flow.component.tabs.Tab getSelectedTab()Gets the currently selected tab.- Returns:
- the selected tab, or nullif none is selected
 
- 
setSelectedTabpublic void setSelectedTab(com.vaadin.flow.component.tabs.Tab selectedTab) Selects the given tab.- Parameters:
- selectedTab- the tab to select,- nullto unselect all
- Throws:
- IllegalArgumentException- if- selectedTabis not a child of this component
 
- 
getTabAtpublic com.vaadin.flow.component.tabs.Tab getTabAt(int position) Returns the tab at the given position.- Parameters:
- position- the position of the tab, must be greater than or equals to 0 and less than the number of tabs
- Returns:
- The tab at the given index
- Throws:
- IllegalArgumentException- if the index is less than 0 or greater than or equals to the number of tabs
 
- 
getIndexOfpublic int getIndexOf(com.vaadin.flow.component.tabs.Tab tab) Returns the index of the given tab.- Parameters:
- tab- the tab to look up, can not be- null
- Returns:
- the index of the tab or -1 if the tab is not added
 
- 
addSelectedChangeListenerpublic com.vaadin.flow.shared.Registration addSelectedChangeListener(com.vaadin.flow.component.ComponentEventListener<JmixTabSheet.SelectedChangeEvent> listener) Adds a listener forJmixTabSheet.SelectedChangeEvent.- Parameters:
- listener- the listener to add, not- null
- Returns:
- a handle that can be used for removing the listener
 
- 
setPrefixComponentpublic void setPrefixComponent(@Nullable com.vaadin.flow.component.Component component) Adds the given component as the prefix of this component, replacing any existing prefix component.- Parameters:
- component- the component to set, can be- nullto remove existing prefix component
 
- 
getPrefixComponent@Nullable public com.vaadin.flow.component.Component getPrefixComponent()Gets the component in the prefix slot of this component.- Returns:
- the prefix component of this component, or nullif no prefix component has been set
- See Also:
 
- 
setSuffixComponentpublic void setSuffixComponent(@Nullable com.vaadin.flow.component.Component component) Adds the given component as the suffix of this component, replacing any existing suffix component.This is most commonly used to add a simple icon or static text into the component. - Parameters:
- component- the component to set, can be- nullto remove existing suffix component
 
- 
getSuffixComponent@Nullable public com.vaadin.flow.component.Component getSuffixComponent()Gets the component in the suffix slot of this component.- Returns:
- the suffix component of this component, or nullif no suffix component has been set
- See Also:
 
- 
updateContentprotected void updateContent()Marks the content related to the selected tab as enabled and adds it to the component if it is not already added. All the other content panels are disabled so they can't be interacted with.
- 
generateTabId
 
-