Package com.vaadin.ui

Class TabSheet.TabSheetTabImpl

    • Constructor Summary

      Constructors 
      Constructor Description
      TabSheetTabImpl​(java.lang.String key, java.lang.String caption, Resource icon)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String getCaption()
      Returns the tab caption.
      Component getComponent()
      Get the component related to the Tab.
      ErrorMessage getComponentError()
      Gets the current error message shown for the tab.
      Component.Focusable getDefaultFocusComponent()
      Get the component that should be automatically focused when the tab is selected.
      java.lang.String getDescription()
      Gets the description for the tab.
      Resource getIcon()
      Gets the icon for the tab.
      java.lang.String getIconAlternateText()
      Gets the icon alt text for the tab.
      java.lang.String getId()
      Gets currently set debug identifier.
      java.lang.String getStyleName()
      Gets the user-defined CSS style name of the tab.
      protected com.vaadin.shared.ui.tabsheet.TabState getTabState()  
      boolean isClosable()
      Returns the closability status for the tab.
      boolean isEnabled()
      Returns the enabled status for the tab.
      boolean isVisible()
      Returns the visible status for the tab.
      void setCaption​(java.lang.String caption)
      Sets the caption for the tab.
      void setClosable​(boolean closable)
      Sets the closability status for the tab.
      void setComponentError​(ErrorMessage componentError)
      Sets an error indicator to be shown in the tab.
      void setDefaultFocusComponent​(Component.Focusable defaultFocus)
      Set the component that should automatically focused when the tab is selected.
      void setDescription​(java.lang.String description)
      Sets the description for the tab.
      void setDescription​(java.lang.String description, com.vaadin.shared.ui.ContentMode mode)
      Sets the description for the tab.
      void setEnabled​(boolean enabled)
      Sets the enabled status for the tab.
      void setIcon​(Resource icon)
      Sets the icon for the tab.
      void setIcon​(Resource icon, java.lang.String iconAltText)
      Sets the icon and alt text for the tab.
      void setIconAlternateText​(java.lang.String iconAltText)
      Sets the icon alt text for the tab.
      void setId​(java.lang.String id)
      Adds an unique id for component that is used in the client-side for testing purposes.
      void setStyleName​(java.lang.String styleName)
      Sets a style name for the tab.
      void setVisible​(boolean visible)
      Sets the visible status for the tab.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • TabSheetTabImpl

        public TabSheetTabImpl​(java.lang.String key,
                               java.lang.String caption,
                               Resource icon)
    • Method Detail

      • getCaption

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

        public void setCaption​(java.lang.String caption)
        Description copied from interface: TabSheet.Tab
        Sets the caption for the tab.
        Specified by:
        setCaption in interface TabSheet.Tab
        Parameters:
        caption - the caption to set
      • setIcon

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

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

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

        public void setDefaultFocusComponent​(Component.Focusable defaultFocus)
        Description copied from interface: TabSheet.Tab
        Set the component that should automatically focused when the tab is selected.
        Specified by:
        setDefaultFocusComponent in interface TabSheet.Tab
        Parameters:
        defaultFocus - the component to focus
      • isEnabled

        public boolean isEnabled()
        Description copied from interface: TabSheet.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 TabSheet.Tab
        Returns:
        true for enabled, false for disabled
      • setEnabled

        public void setEnabled​(boolean enabled)
        Description copied from interface: TabSheet.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 TabSheet.Tab
        Parameters:
        enabled - true for enabled, false for disabled
      • isVisible

        public boolean isVisible()
        Description copied from interface: TabSheet.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 TabSheet.Tab
        Returns:
        true for visible, false for hidden
      • setVisible

        public void setVisible​(boolean visible)
        Description copied from interface: TabSheet.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 TabSheet.Tab
        Parameters:
        visible - true for visible, false for hidden
      • isClosable

        public boolean isClosable()
        Description copied from interface: TabSheet.Tab
        Returns the closability status for the tab.
        Specified by:
        isClosable in interface TabSheet.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: TabSheet.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.

        Note! Currently only supported by TabSheet, not Accordion.

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

        public void setDescription​(java.lang.String description)
        Description copied from interface: TabSheet.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.

        Setting a description through this method will additionally set the content mode of the description to preformatted. For setting a different content mode see the overload TabSheet.Tab.setDescription(String, ContentMode).

        Specified by:
        setDescription in interface TabSheet.Tab
        Parameters:
        description - the new description string for the tab.
      • setDescription

        public void setDescription​(java.lang.String description,
                                   com.vaadin.shared.ui.ContentMode mode)
        Description copied from interface: TabSheet.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 TabSheet.Tab
        Parameters:
        description - the new description string for the tab
        mode - content mode used to display the description
        See Also:
        ContentMode
      • setStyleName

        public void setStyleName​(java.lang.String styleName)
        Description copied from interface: TabSheet.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 TabSheet.Tab
        Parameters:
        styleName - the new style to be set for tab
        See Also:
        TabSheet.Tab.getStyleName()
      • getStyleName

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

        protected com.vaadin.shared.ui.tabsheet.TabState getTabState()
      • setId

        public void setId​(java.lang.String id)
        Description copied from interface: TabSheet.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 TabSheet.Tab
        Parameters:
        id - An alphanumeric id
      • getId

        public java.lang.String getId()
        Description copied from interface: TabSheet.Tab
        Gets currently set debug identifier.
        Specified by:
        getId in interface TabSheet.Tab
        Returns:
        current id, null if not set
      • setIcon

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