Class FTabSheet.TabSheetTabImpl

java.lang.Object
com.vaadin.flow.component.Component
com.vaadin.flow.component.tabs.Tab
com.vaadin.featurepack.ui.FTabSheet.TabSheetTabImpl
All Implemented Interfaces:
FTabSheet.Tab, com.vaadin.flow.component.AttachNotifier, com.vaadin.flow.component.DetachNotifier, com.vaadin.flow.component.HasAriaLabel, com.vaadin.flow.component.HasComponents, com.vaadin.flow.component.HasComponentsOfType<com.vaadin.flow.component.Component>, com.vaadin.flow.component.HasElement, com.vaadin.flow.component.HasEnabled, com.vaadin.flow.component.HasStyle, com.vaadin.flow.component.HasTheme, com.vaadin.flow.component.shared.HasThemeVariant<com.vaadin.flow.component.tabs.TabVariant>, com.vaadin.flow.component.shared.HasTooltip, Serializable
Enclosing class:
FTabSheet

public class FTabSheet.TabSheetTabImpl extends com.vaadin.flow.component.tabs.Tab implements FTabSheet.Tab
TabSheet's implementation of FTabSheet.Tab - tab metadata.
See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
    TabSheetTabImpl(String key, String caption, Resource icon)
     
    TabSheetTabImpl(String key, String caption, com.vaadin.flow.component.icon.Icon icon)
     
    TabSheetTabImpl(String key, String caption, com.vaadin.flow.component.icon.IconFactory iconFactory)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the tab caption.
    com.vaadin.flow.component.Component
    Get the component related to the Tab
    Gets 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.
    Gets currently set debug identifier.
    Gets the icon for the tab.
    Gets the icon alt text for the tab.
    Gets the user-defined CSS style name of the tab.
    boolean
    Returns the closability status for the tab.
    boolean
    Returns the enabled status for the tab.
    boolean
    Returns the visible status for the tab.
    void
    setCaption(String caption)
    Sets the caption for the tab.
    void
    setClosable(boolean closable)
    Sets the closability status for the tab.
    void
    Sets an error indicator to be shown in the tab.
    void
    setDefaultFocusComponent(com.vaadin.flow.component.Focusable<?> defaultFocus)
    Set the component that should automatically focused when the tab is selected.
    void
    setDescription(String description)
    Sets the description for the tab.
    void
    setDescription(String description, ContentMode mode)
    Sets the description for the tab.
    void
    setEnabled(boolean enabled)
    Sets the enabled status for the tab.
    void
    Sets the icon for the tab.
    void
    setIcon(Resource icon, String iconAltText)
    Sets the icon and alt text for the tab.
    void
    setIcon(com.vaadin.flow.component.icon.Icon icon)
    Sets the icon for the tab.
    void
    setIcon(com.vaadin.flow.component.icon.IconFactory icon)
    Sets the icon for the tab.
    void
    setIcon(com.vaadin.flow.component.icon.IconFactory iconFactory, String iconAltText)
    Sets the icon and alt text for the tab.
    void
    setIcon(com.vaadin.flow.component.icon.Icon icon, String iconAltText)
    Sets the icon and alt text for the tab.
    void
    Sets the icon alt text for the tab.
    void
    Adds an unique id for component that is used in the client-side for testing purposes.
    void
    setStyleName(String styleName)
    Sets a style name for the tab.
    void
    setVisible(boolean visible)
    Sets the visible status for the tab.

    Methods inherited from class com.vaadin.flow.component.tabs.Tab

    getFlexGrow, getLabel, isSelected, setFlexGrow, setLabel, setSelected, toString

    Methods inherited from class com.vaadin.flow.component.Component

    addListener, bindVisible, findAncestor, findAncestor, fireEvent, from, get, getChildren, getElement, getEventBus, getId, getListeners, getLocale, getParent, getTestId, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getUI, getUIOrThrow, hasListener, isAttached, isTemplateMapped, onAttach, onDetach, onEnabledStateChanged, removeFromParent, scrollIntoView, scrollIntoView, set, setElement, setTestId, whenAttached

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

    Methods inherited from interface com.vaadin.flow.component.AttachNotifier

    addAttachListener

    Methods inherited from interface com.vaadin.flow.component.DetachNotifier

    addDetachListener

    Methods inherited from interface com.vaadin.flow.component.HasAriaLabel

    getAriaLabel, getAriaLabelledBy, setAriaLabel, setAriaLabelledBy, setAriaLabelledBy

    Methods inherited from interface com.vaadin.flow.component.HasComponents

    add

    Methods inherited from interface com.vaadin.flow.component.HasComponentsOfType

    add, add, addComponentAsFirst, addComponentAtIndex, bindChildren, getChildren, getComponentAt, getComponentCount, indexOf, remove, remove, removeAll, replace

    Methods inherited from interface com.vaadin.flow.component.HasElement

    getElement

    Methods inherited from interface com.vaadin.flow.component.HasEnabled

    bindEnabled

    Methods inherited from interface com.vaadin.flow.component.HasStyle

    addClassName, addClassNames, bindClassName, bindClassNames, getClassName, getClassNames, getStyle, hasClassName, removeClassName, removeClassNames, setClassName, setClassName

    Methods inherited from interface com.vaadin.flow.component.HasTheme

    addThemeName, addThemeNames, bindThemeName, bindThemeNames, getThemeName, getThemeNames, hasThemeName, removeThemeName, removeThemeNames, setThemeName, setThemeName

    Methods inherited from interface com.vaadin.flow.component.shared.HasThemeVariant

    addThemeVariants, bindThemeVariant, bindThemeVariants, removeThemeVariants, setThemeVariant, setThemeVariants, setThemeVariants

    Methods inherited from interface com.vaadin.flow.component.shared.HasTooltip

    getTooltip, setTooltipMarkdown, setTooltipText
  • Constructor Details

    • TabSheetTabImpl

      public TabSheetTabImpl(String key, String caption, Resource icon)
    • TabSheetTabImpl

      public TabSheetTabImpl(String key, String caption, com.vaadin.flow.component.icon.Icon icon)
    • TabSheetTabImpl

      public TabSheetTabImpl(String key, String caption, com.vaadin.flow.component.icon.IconFactory iconFactory)
  • Method Details

    • getCaption

      public String getCaption()
      Returns the tab caption. Can never be null.
      Specified by:
      getCaption in interface FTabSheet.Tab
    • setCaption

      public void setCaption(String caption)
      Description copied from interface: FTabSheet.Tab
      Sets the caption for the tab.
      Specified by:
      setCaption in interface FTabSheet.Tab
      Parameters:
      caption - the caption to set
    • getIcon

      public Resource getIcon()
      Description copied from interface: FTabSheet.Tab
      Gets the icon for the tab.
      Specified by:
      getIcon in interface FTabSheet.Tab
    • setIcon

      public void setIcon(Resource icon)
      Description copied from interface: FTabSheet.Tab
      Sets the icon for the tab.
      Specified by:
      setIcon in interface FTabSheet.Tab
      Parameters:
      icon - the icon to set
    • setIcon

      public void setIcon(com.vaadin.flow.component.icon.Icon icon)
      Description copied from interface: FTabSheet.Tab
      Sets the icon for the tab.
      Specified by:
      setIcon in interface FTabSheet.Tab
      Parameters:
      icon - the Flow icon to set
    • setIcon

      public void setIcon(com.vaadin.flow.component.icon.IconFactory icon)
      Description copied from interface: FTabSheet.Tab
      Sets the icon for the tab.
      Specified by:
      setIcon in interface FTabSheet.Tab
      Parameters:
      icon - the icon factory to create the icon
    • getIconAlternateText

      public String getIconAlternateText()
      Description copied from interface: FTabSheet.Tab
      Gets the icon alt text for the tab.
      Specified by:
      getIconAlternateText in interface FTabSheet.Tab
    • setIconAlternateText

      public void setIconAlternateText(String iconAltText)
      Description copied from interface: FTabSheet.Tab
      Sets the icon alt text for the tab.
      Specified by:
      setIconAlternateText in interface FTabSheet.Tab
      Parameters:
      iconAltText - the icon to set
    • setDefaultFocusComponent

      public void setDefaultFocusComponent(com.vaadin.flow.component.Focusable<?> defaultFocus)
      Description copied from interface: FTabSheet.Tab
      Set the component that should automatically focused when the tab is selected.
      Specified by:
      setDefaultFocusComponent in interface FTabSheet.Tab
      Parameters:
      defaultFocus - the component to focus
    • getDefaultFocusComponent

      public com.vaadin.flow.component.Focusable<?> getDefaultFocusComponent()
      Description copied from interface: FTabSheet.Tab
      Get the component that should be automatically focused when the tab is selected.
      Specified by:
      getDefaultFocusComponent in interface FTabSheet.Tab
      Returns:
      the focusable component
    • isEnabled

      public boolean isEnabled()
      Description copied from interface: FTabSheet.Tab
      Returns the enabled status for the tab. A disabled tab is shown as such in the tab bar and cannot be selected.
      Specified by:
      isEnabled in interface FTabSheet.Tab
      Specified by:
      isEnabled in interface com.vaadin.flow.component.HasEnabled
      Returns:
      true for enabled, false for disabled
    • setEnabled

      public void setEnabled(boolean enabled)
      Description copied from interface: FTabSheet.Tab
      Sets the enabled status for the tab. A disabled tab is shown as such in the tab bar and cannot be selected.
      Specified by:
      setEnabled in interface FTabSheet.Tab
      Specified by:
      setEnabled in interface com.vaadin.flow.component.HasEnabled
      Parameters:
      enabled - true for enabled, false for disabled
    • isVisible

      public boolean isVisible()
      Description copied from interface: FTabSheet.Tab
      Returns the visible status for the tab. An invisible tab is not shown in the tab bar and cannot be selected.
      Specified by:
      isVisible in interface FTabSheet.Tab
      Overrides:
      isVisible in class com.vaadin.flow.component.Component
      Returns:
      true for visible, false for hidden
    • setVisible

      public void setVisible(boolean visible)
      Description copied from interface: FTabSheet.Tab
      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.
      Specified by:
      setVisible in interface FTabSheet.Tab
      Overrides:
      setVisible in class com.vaadin.flow.component.Component
      Parameters:
      visible - true for visible, false for hidden
    • isClosable

      public boolean isClosable()
      Description copied from interface: FTabSheet.Tab
      Returns the closability status for the tab.
      Specified by:
      isClosable in interface FTabSheet.Tab
      Returns:
      true if the tab is allowed to be closed by the end user, false for not allowing closing
    • setClosable

      public void setClosable(boolean closable)
      Description copied from interface: FTabSheet.Tab
      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.
      Specified by:
      setClosable in interface FTabSheet.Tab
      Parameters:
      closable - true if the end user is allowed to close the tab, false for not allowing to close. Should default to false.
    • getDescription

      public String getDescription()
      Description copied from interface: FTabSheet.Tab
      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.
      Specified by:
      getDescription in interface FTabSheet.Tab
      Returns:
      the description for the tab
    • setDescription

      public void setDescription(String description)
      Description copied from interface: FTabSheet.Tab
      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.
      Specified by:
      setDescription in interface FTabSheet.Tab
      Parameters:
      description - the new description string for the tab.
    • setDescription

      public void setDescription(String description, ContentMode mode)
      Description copied from interface: FTabSheet.Tab
      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.

      This method was introduced in Vaadin 8.

      Specified by:
      setDescription in interface FTabSheet.Tab
      Parameters:
      description - the new description string for the tab
      mode - content mode used to display the description
      See Also:
    • getComponentError

      public ErrorMessage getComponentError()
      Description copied from interface: FTabSheet.Tab
      Gets the current error message shown for the tab.
      Specified by:
      getComponentError in interface FTabSheet.Tab
      See Also:
    • setComponentError

      public void setComponentError(ErrorMessage componentError)
      Description copied from interface: FTabSheet.Tab
      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.
      Specified by:
      setComponentError in interface FTabSheet.Tab
      Parameters:
      componentError - error message or null for none
      See Also:
    • getComponent

      public com.vaadin.flow.component.Component getComponent()
      Description copied from interface: FTabSheet.Tab
      Get the component related to the Tab
      Specified by:
      getComponent in interface FTabSheet.Tab
    • setStyleName

      public void setStyleName(String styleName)
      Description copied from interface: FTabSheet.Tab
      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;}
       
      Specified by:
      setStyleName in interface FTabSheet.Tab
      Parameters:
      styleName - the new style to be set for tab
      See Also:
    • getStyleName

      public String getStyleName()
      Description copied from interface: FTabSheet.Tab
      Gets the user-defined CSS style name of the tab. Built-in style names defined in Vaadin are not returned.
      Specified by:
      getStyleName in interface FTabSheet.Tab
      Returns:
      the style name or of the tab
      See Also:
    • setId

      public void setId(String id)
      Description copied from interface: FTabSheet.Tab
      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.
      Specified by:
      setId in interface FTabSheet.Tab
      Overrides:
      setId in class com.vaadin.flow.component.Component
      Parameters:
      id - An alphanumeric id
    • getFId

      public String getFId()
      Description copied from interface: FTabSheet.Tab
      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.
      Specified by:
      getFId in interface FTabSheet.Tab
      Returns:
      current id, null if not set
    • setIcon

      public void setIcon(Resource icon, String iconAltText)
      Description copied from interface: FTabSheet.Tab
      Sets the icon and alt text for the tab.
      Specified by:
      setIcon in interface FTabSheet.Tab
      Parameters:
      icon - the icon to set
      iconAltText - the alt text
    • setIcon

      public void setIcon(com.vaadin.flow.component.icon.Icon icon, String iconAltText)
      Description copied from interface: FTabSheet.Tab
      Sets the icon and alt text for the tab.
      Specified by:
      setIcon in interface FTabSheet.Tab
      Parameters:
      icon - the Flow icon to set
      iconAltText - the alt text
    • setIcon

      public void setIcon(com.vaadin.flow.component.icon.IconFactory iconFactory, String iconAltText)
      Description copied from interface: FTabSheet.Tab
      Sets the icon and alt text for the tab.
      Specified by:
      setIcon in interface FTabSheet.Tab
      Parameters:
      iconFactory - the icon factory to create the icon
      iconAltText - the alt text