Package com.vaadin.featurepack.ui
Interface FTabSheet.Tab
- All Superinterfaces:
Serializable
- All Known Implementing Classes:
FTabSheet.TabSheetTabImpl
- Enclosing class:
FTabSheet
Tab meta-data for a component in a
FTabSheet.
The meta-data includes the tab caption, icon, visibility and enabledness,
closability, description (tooltip) and an optional component error shown
in the tab.
Tabs are identified by the component contained on them in most cases, and
the meta-data can be obtained with FTabSheet.getTab(Component).-
Method Summary
Modifier and TypeMethodDescriptionGets the caption for the tab.com.vaadin.flow.component.ComponentGet the component related to the TabGets the current error message shown for the tab.com.vaadin.flow.component.Focusable<?> Get the component that should be automatically focused when the tab is selected.Gets the description for the tab.getFId()Gets currently set debug identifier.getIcon()Gets the icon for the tab.Gets the icon alt text for the tab.Gets the user-defined CSS style name of the tab.booleanReturns the closability status for the tab.booleanReturns the enabled status for the tab.booleanReturns the visible status for the tab.voidsetCaption(String caption) Sets the caption for the tab.voidsetClosable(boolean closable) Sets the closability status for the tab.voidsetComponentError(ErrorMessage componentError) Sets an error indicator to be shown in the tab.voidsetDefaultFocusComponent(com.vaadin.flow.component.Focusable<?> component) Set the component that should automatically focused when the tab is selected.voidsetDescription(String description) Sets the description for the tab.voidsetDescription(String description, ContentMode mode) Sets the description for the tab.voidsetEnabled(boolean enabled) Sets the enabled status for the tab.voidSets the icon for the tab.voidSets the icon and alt text for the tab.voidsetIcon(com.vaadin.flow.component.icon.Icon icon) Sets the icon for the tab.voidsetIcon(com.vaadin.flow.component.icon.IconFactory iconFactory) Sets the icon for the tab.voidSets the icon and alt text for the tab.voidSets the icon and alt text for the tab.voidsetIconAlternateText(String iconAltText) Sets the icon alt text for the tab.voidAdds an unique id for component that is used in the client-side for testing purposes.voidsetStyleName(String styleName) Sets a style name for the tab.voidsetVisible(boolean visible) Sets the visible status for the tab.
-
Method Details
-
isVisible
boolean isVisible()Returns the visible status for the tab. An invisible tab is not shown in the tab bar and cannot be selected.- Returns:
- true for visible, false for hidden
-
setVisible
void setVisible(boolean visible) Sets the visible status for the tab. An invisible tab is not shown in the tab bar and cannot be selected, selection is changed automatically when there is an attempt to select an invisible tab.- Parameters:
visible- true for visible, false for hidden
-
isClosable
boolean isClosable()Returns the closability status for the tab.- Returns:
- true if the tab is allowed to be closed by the end user, false for not allowing closing
-
setClosable
void setClosable(boolean closable) Sets the closability status for the tab. A closable tab can be closed by the user through the user interface. This also controls if a close button is shown to the user or not.- Parameters:
closable- true if the end user is allowed to close the tab, false for not allowing to close. Should default to false.
-
setDefaultFocusComponent
void setDefaultFocusComponent(com.vaadin.flow.component.Focusable<?> component) Set the component that should automatically focused when the tab is selected.- Parameters:
component- the component to focus
-
getDefaultFocusComponent
com.vaadin.flow.component.Focusable<?> getDefaultFocusComponent()Get the component that should be automatically focused when the tab is selected.- Returns:
- the focusable component
-
isEnabled
boolean isEnabled()Returns the enabled status for the tab. A disabled tab is shown as such in the tab bar and cannot be selected.- Returns:
- true for enabled, false for disabled
-
setEnabled
void setEnabled(boolean enabled) Sets the enabled status for the tab. A disabled tab is shown as such in the tab bar and cannot be selected.- Parameters:
enabled- true for enabled, false for disabled
-
setCaption
Sets the caption for the tab.- Parameters:
caption- the caption to set
-
getCaption
String getCaption()Gets the caption for the tab. -
getIcon
Resource getIcon()Gets the icon for the tab. -
setIcon
Sets the icon for the tab.- Parameters:
icon- the icon to set
-
setIcon
void setIcon(com.vaadin.flow.component.icon.Icon icon) Sets the icon for the tab.- Parameters:
icon- the Flow icon to set
-
setIcon
void setIcon(com.vaadin.flow.component.icon.IconFactory iconFactory) Sets the icon for the tab.- Parameters:
iconFactory- the icon factory to create the icon
-
setIcon
Sets the icon and alt text for the tab.- Parameters:
icon- the Flow icon to seticonAltText- the alt text
-
setIcon
Sets the icon and alt text for the tab.- Parameters:
icon- the icon to seticonAltText- the alt text
-
setIcon
Sets the icon and alt text for the tab.- Parameters:
iconFactory- the icon factory to create the iconiconAltText- the alt text
-
getIconAlternateText
String getIconAlternateText()Gets the icon alt text for the tab. -
setIconAlternateText
Sets the icon alt text for the tab.- Parameters:
iconAltText- the icon to set
-
getDescription
String getDescription()Gets the description for the tab. The description can be used to briefly describe the state of the tab to the user, and is typically shown as a tooltip when hovering over the tab.- Returns:
- the description for the tab
-
setDescription
Sets the description for the tab. The description can be used to briefly describe the state of the tab to the user, and is typically shown as a tooltip when hovering over the tab.- Parameters:
description- the new description string for the tab.
-
setComponentError
Sets an error indicator to be shown in the tab. This can be used e.g. to communicate to the user that there is a problem in the contents of the tab.- Parameters:
componentError- error message or null for none- See Also:
-
getComponentError
ErrorMessage getComponentError()Gets the current error message shown for the tab.- See Also:
-
getComponent
com.vaadin.flow.component.Component getComponent()Get the component related to the Tab -
setStyleName
Sets a style name for the tab. The style name will be rendered as a HTML class name, which can be used in a CSS definition.Tab tab = tabsheet.addTab(tabContent, "Tab text"); tab.setStyleName("mystyle");The used style name will be prefixed with "
v-tabsheet-tabitemcell-". For example, if you give a tab the style "mystyle", the tab will get a "v-tabsheet-tabitemcell-mystyle" style. You could then style the component with:.v-tabsheet-tabitemcell-mystyle {font-style: italic;}- Parameters:
styleName- the new style to be set for tab- See Also:
-
getStyleName
String getStyleName()Gets the user-defined CSS style name of the tab. Built-in style names defined in Vaadin are not returned.- Returns:
- the style name or of the tab
- See Also:
-
setId
Adds an unique id for component that is used in the client-side for testing purposes. Keeping identifiers unique is the responsibility of the programmer.- Parameters:
id- An alphanumeric id
-
getFId
String getFId()Gets currently set debug identifier. In V7 this was getId(), but since Tab implementation overrides Flow's Tab component, it's renamed to getFId() to avoid conflicts.- Returns:
- current id, null if not set
-