Package com.vaadin.ui
Class TabSheet.TabSheetTabImpl
- java.lang.Object
-
- com.vaadin.ui.TabSheet.TabSheetTabImpl
-
- All Implemented Interfaces:
TabSheet.Tab,Serializable
- Enclosing class:
- TabSheet
public class TabSheet.TabSheetTabImpl extends Object implements TabSheet.Tab
TabSheet's implementation ofTabSheet.Tab- tab metadata.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description TabSheetTabImpl(String key, String caption, Resource icon)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetCaption()Returns the tab caption.ComponentgetComponent()Get the component related to the TabErrorMessagegetComponentError()Gets the current error message shown for the tab.Component.FocusablegetDefaultFocusComponent()Get the component that should be automatically focused when the tab is selected.StringgetDescription()Gets the description for the tab.ResourcegetIcon()Gets the icon for the tab.StringgetIconAlternateText()Gets the icon alt text for the tab.StringgetId()Gets currently set debug identifierStringgetStyleName()Gets the user-defined CSS style name of the tab.protected TabStategetTabState()booleanisClosable()Returns the closability status for the tab.booleanisEnabled()Returns the enabled status for the tab.booleanisVisible()Returns 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(Component.Focusable defaultFocus)Set the component that should automatically focused when the tab is selected.voidsetDescription(String description)Sets the description for the tab.voidsetEnabled(boolean enabled)Sets the enabled status for the tab.voidsetIcon(Resource icon)Sets the icon for the tab.voidsetIcon(Resource icon, String iconAltText)Sets the icon and alt text for the tab.voidsetIconAlternateText(String iconAltText)Sets the icon alt text for the tab.voidsetId(String id)Adds 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 Detail
-
getCaption
public String getCaption()
Returns the tab caption. Can never be null.- Specified by:
getCaptionin interfaceTabSheet.Tab
-
setCaption
public void setCaption(String caption)
Description copied from interface:TabSheet.TabSets the caption for the tab.- Specified by:
setCaptionin interfaceTabSheet.Tab- Parameters:
caption- the caption to set
-
getIcon
public Resource getIcon()
Description copied from interface:TabSheet.TabGets the icon for the tab.- Specified by:
getIconin interfaceTabSheet.Tab
-
setIcon
public void setIcon(Resource icon)
Description copied from interface:TabSheet.TabSets the icon for the tab.- Specified by:
setIconin interfaceTabSheet.Tab- Parameters:
icon- the icon to set
-
getIconAlternateText
public String getIconAlternateText()
Description copied from interface:TabSheet.TabGets the icon alt text for the tab.- Specified by:
getIconAlternateTextin interfaceTabSheet.Tab
-
setIconAlternateText
public void setIconAlternateText(String iconAltText)
Description copied from interface:TabSheet.TabSets the icon alt text for the tab.- Specified by:
setIconAlternateTextin interfaceTabSheet.Tab- Parameters:
iconAltText- the icon to set
-
setDefaultFocusComponent
public void setDefaultFocusComponent(Component.Focusable defaultFocus)
Description copied from interface:TabSheet.TabSet the component that should automatically focused when the tab is selected.- Specified by:
setDefaultFocusComponentin interfaceTabSheet.Tab- Parameters:
defaultFocus- the component to focus
-
getDefaultFocusComponent
public Component.Focusable getDefaultFocusComponent()
Description copied from interface:TabSheet.TabGet the component that should be automatically focused when the tab is selected.- Specified by:
getDefaultFocusComponentin interfaceTabSheet.Tab- Returns:
- the focusable component
-
isEnabled
public boolean isEnabled()
Description copied from interface:TabSheet.TabReturns the enabled status for the tab. A disabled tab is shown as such in the tab bar and cannot be selected.- Specified by:
isEnabledin interfaceTabSheet.Tab- Returns:
- true for enabled, false for disabled
-
setEnabled
public void setEnabled(boolean enabled)
Description copied from interface:TabSheet.TabSets the enabled status for the tab. A disabled tab is shown as such in the tab bar and cannot be selected.- Specified by:
setEnabledin interfaceTabSheet.Tab- Parameters:
enabled- true for enabled, false for disabled
-
isVisible
public boolean isVisible()
Description copied from interface:TabSheet.TabReturns the visible status for the tab. An invisible tab is not shown in the tab bar and cannot be selected.- Specified by:
isVisiblein interfaceTabSheet.Tab- Returns:
- true for visible, false for hidden
-
setVisible
public void setVisible(boolean visible)
Description copied from interface:TabSheet.TabSets 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:
setVisiblein interfaceTabSheet.Tab- Parameters:
visible- true for visible, false for hidden
-
isClosable
public boolean isClosable()
Description copied from interface:TabSheet.TabReturns the closability status for the tab.- Specified by:
isClosablein interfaceTabSheet.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.TabSets 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:
setClosablein interfaceTabSheet.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:TabSheet.TabGets 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:
getDescriptionin interfaceTabSheet.Tab- Returns:
- the description for the tab
-
setDescription
public void setDescription(String description)
Description copied from interface:TabSheet.TabSets 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:
setDescriptionin interfaceTabSheet.Tab- Parameters:
description- the new description string for the tab.
-
getComponentError
public ErrorMessage getComponentError()
Description copied from interface:TabSheet.TabGets the current error message shown for the tab. TODO currently not sent to the client- Specified by:
getComponentErrorin interfaceTabSheet.Tab- See Also:
AbstractComponent.setComponentError(ErrorMessage)
-
setComponentError
public void setComponentError(ErrorMessage componentError)
Description copied from interface:TabSheet.TabSets 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:
setComponentErrorin interfaceTabSheet.Tab- Parameters:
componentError- error message or null for none- See Also:
AbstractComponent.setComponentError(ErrorMessage)
-
getComponent
public Component getComponent()
Description copied from interface:TabSheet.TabGet the component related to the Tab- Specified by:
getComponentin interfaceTabSheet.Tab
-
setStyleName
public void setStyleName(String styleName)
Description copied from interface:TabSheet.TabSets 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;}This method will trigger a
RepaintRequestEventon the TabSheet to which the Tab belongs.- Specified by:
setStyleNamein interfaceTabSheet.Tab- Parameters:
styleName- the new style to be set for tab- See Also:
TabSheet.Tab.getStyleName()
-
getStyleName
public String getStyleName()
Description copied from interface:TabSheet.TabGets the user-defined CSS style name of the tab. Built-in style names defined in Vaadin or GWT are not returned.- Specified by:
getStyleNamein interfaceTabSheet.Tab- Returns:
- the style name or of the tab
- See Also:
TabSheet.Tab.setStyleName(String)
-
getTabState
protected TabState getTabState()
-
setId
public void setId(String id)
Description copied from interface:TabSheet.TabAdds 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:
setIdin interfaceTabSheet.Tab- Parameters:
id- An alphanumeric id
-
getId
public String getId()
Description copied from interface:TabSheet.TabGets currently set debug identifier- Specified by:
getIdin interfaceTabSheet.Tab- Returns:
- current id, null if not set
-
setIcon
public void setIcon(Resource icon, String iconAltText)
Description copied from interface:TabSheet.TabSets the icon and alt text for the tab.- Specified by:
setIconin interfaceTabSheet.Tab- Parameters:
icon- the icon to set
-
-