Class Tab
- All Implemented Interfaces:
- HasHandlers,- HasTabDeselectedHandlers,- HasTabSelectedHandlers
- 
Field SummaryFields inherited from class com.smartgwt.client.core.RefDataClassidFields inherited from class com.smartgwt.client.core.DataClassfactoryCreated, factoryProperties
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionAdd a tabDeselected handler.addTabSelectedHandler(TabSelectedHandler handler) Add a tabSelected handler.If enabled, the tab will collapse to show just its icon when showing the title would cause overflow of a containingTabBar.Determines whether this tab should show a close icon allowing the user to dismiss the tab by clicking on the close icon directly.If specified, overrides theTabSet.canEditTabTitlessetting, for this one tab only.IfTabSet.canReorderTabsis set totrue, settingcanReorderexplicitly tofalsefor some tab will disallow drag-reordering of this tab.Custom src for the close icon for this tab to display if it is closeable.Size of thecloseIconfor this tab.Context menu to show for this object, an instance of the Menu widget.If specified, this tab will initially be rendered in a disabled state.Criteria to be evaluated to determine whether this Tab should be enabled.If specified this tab will be hidden by default.getIcon()If specified, this tab will show an icon next to the tab title.Ificonis specified, this property may be used to specify a height for the icon.Ificonis specified, this property may be used to specify a size for the icon.Ificonis specified, this property may be used to specify a width for the icon.getID()Optional ID for the tab, which can later be used to reference the tab.getName()Optional name for the tab, which can later be used to reference the tab.static TabgetOrCreateRef(JavaScriptObject jsObj) getPane()Specifies the pane associated with this tab.Space to leave around the pane within this Tab.IfTabSet.showTabPickeris true for this TabSet, if set this property will determine the title of the picker menu item for this tab.Specifies the prompt to be displayed when the mouse hovers over the tab.Returns the live Canvas used to represent this tab in a tabSet.getTitle()Specifies the title of the this tab.A separate style for the title text.Criteria to be evaluated to determine whether this Tab should be visible.intgetWidth()You can specify an explicit width for the tab using this property.setCanAdaptWidth(Boolean canAdaptWidth) If enabled, the tab will collapse to show just its icon when showing the title would cause overflow of a containingTabBar.voidsetCanClose(boolean canClose) SeesetCanClose().voidsetCanClose(Boolean canClose) Determines whether this tab should show a close icon allowing the user to dismiss the tab by clicking on the close icon directly.voidsetCanEditTitle(Boolean canEditTitle) If specified, overrides theTabSet.canEditTabTitlessetting, for this one tab only.setCanReorder(Boolean canReorder) IfTabSet.canReorderTabsis set totrue, settingcanReorderexplicitly tofalsefor some tab will disallow drag-reordering of this tab.voidsetCloseIcon(String closeIcon) Custom src for the close icon for this tab to display if it is closeable.voidsetCloseIconSize(Integer closeIconSize) Size of thecloseIconfor this tab.voidsetContextMenu(Menu contextMenu) Context menu to show for this tab.voidsetDisabled(boolean disabled) If specified, this tab will initially be rendered in a disabled state.setEnableWhen(Criteria enableWhen) Criteria to be evaluated to determine whether this Tab should be enabled.If specified this tab will be hidden by default.voidIf specified, this tab will show an icon next to the tab title.voidIf specified, this tab will show an icon next to the tab title.voidIf specified, this tab will show an icon next to the tab title.voidsetIconHeight(Integer iconHeight) Ificonis specified, this property may be used to specify a height for the icon.voidsetIconSize(Integer iconSize) Ificonis specified, this property may be used to specify a size for the icon.voidsetIconWidth(Integer iconWidth) Ificonis specified, this property may be used to specify a width for the icon.voidOptional ID for the tab, which can later be used to reference the tab.Optional name for the tab, which can later be used to reference the tab.voidSpecifies the pane associated with this tab.voidsetPaneMargin(Integer paneMargin) Space to leave around the pane within this Tab.voidsetPickerTitle(String pickerTitle) IfTabSet.showTabPickeris true for this TabSet, if set this property will determine the title of the picker menu item for this tab.voidSpecifies the prompt to be displayed when the mouse hovers over the tab.voidvoidSpecifies the title of the this tab.voidsetTitleStyle(String titleStyle) Provide a separate style for the title text.setVisibleWhen(Criteria visibleWhen) Criteria to be evaluated to determine whether this Tab should be visible.voidsetWidth(int width) You can specify an explicit width for the tab using this property.Methods inherited from class com.smartgwt.client.core.RefDataClassgetRef, getRef, internalSetIDMethods inherited from class com.smartgwt.client.core.DataClassapplyFactoryProperties, doAddHandler, fireEvent, getAttribute, getAttributeAsBoolean, getAttributeAsBoolean, getAttributeAsDate, getAttributeAsDouble, getAttributeAsDoubleArray, getAttributeAsElement, getAttributeAsFloat, getAttributeAsInt, getAttributeAsIntArray, getAttributeAsJavaScriptObject, getAttributeAsLong, getAttributeAsMap, getAttributeAsObject, getAttributeAsRecord, getAttributeAsString, getAttributeAsStringArray, getAttributes, getHandlerCount, isFactoryCreated, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttributeAsJavaObject, setFactoryCreatedMethods inherited from class com.smartgwt.client.core.JsObjectequals, getJsObj, hashCode, isCreated, setJavaScriptObject, setJsObjMethods inherited from class java.lang.Objectclone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.google.gwt.event.shared.HasHandlersfireEvent
- 
Constructor Details- 
Tabpublic Tab()
- 
Tab
- 
Tab
- 
Tab
 
- 
- 
Method Details- 
getOrCreateRef
- 
setCanAdaptWidthIf enabled, the tab will collapse to show just its icon when showing the title would cause overflow of a containingTabBar. While collapsed, the tab will show its title on hover, unless an explicit hover has been specified such as byprompt.- Parameters:
- canAdaptWidth- New canAdaptWidth value. Default value is false
- Returns:
- Tabinstance, for chaining setter calls
- See Also:
 
- 
getCanAdaptWidthIf enabled, the tab will collapse to show just its icon when showing the title would cause overflow of a containingTabBar. While collapsed, the tab will show its title on hover, unless an explicit hover has been specified such as byprompt.- Returns:
- Current canAdaptWidth value. Default value is false
- See Also:
 
- 
getCanCloseDetermines whether this tab should show a close icon allowing the user to dismiss the tab by clicking on the close icon directly. The URL for the close icon's image will be derived fromTabSet.closeTabIconby default, but may be overridden by explicitly specifyingcloseIcon.If unset or null, this property is derived from TabSet.canCloseTabs.Note that setting canClosemeans thaticoncannot be used, because it's used for thecloseIcon- seeTabSet.canCloseTabsfor a workaround.- Returns:
- Current canClose value. Default value is null
- See Also:
- 
- com.smartgwt.client.widgets.tab.TabSet#closeClick
- Closeable Tabs Example
 
 
- 
getCanEditTitleIf specified, overrides theTabSet.canEditTabTitlessetting, for this one tab only.Note that the TabSet's titleEditEventmust be set to a supportedTabTitleEditEventin order for users to be able to edit this tab's title.- Returns:
- Current canEditTitle value. Default value is null
- See Also:
 
- 
setCanReorderIfTabSet.canReorderTabsis set totrue, settingcanReorderexplicitly tofalsefor some tab will disallow drag-reordering of this tab. Has no effect ifcanReorderTabsis not true at the tabSet level.Note that this setting also disallows a reorder of another tab into the slot before or following this tab. This means for tabs located at the beginning or end of the tab-bar, users cannot changing the index of the tab by dropping another before or after it. However if you have a canReorder:falsetab which is not at the beginning or end of the tab bar, users can drag reorder other tabs around it which may ultimately change its position.- Parameters:
- canReorder- New canReorder value. Default value is null
- Returns:
- Tabinstance, for chaining setter calls
- See Also:
 
- 
getCanReorderIfTabSet.canReorderTabsis set totrue, settingcanReorderexplicitly tofalsefor some tab will disallow drag-reordering of this tab. Has no effect ifcanReorderTabsis not true at the tabSet level.Note that this setting also disallows a reorder of another tab into the slot before or following this tab. This means for tabs located at the beginning or end of the tab-bar, users cannot changing the index of the tab by dropping another before or after it. However if you have a canReorder:falsetab which is not at the beginning or end of the tab bar, users can drag reorder other tabs around it which may ultimately change its position.- Returns:
- Current canReorder value. Default value is null
- See Also:
 
- 
getCloseIconCustom src for the close icon for this tab to display if it is closeable. SeecanCloseandTabSet.canCloseTabs.- Returns:
- Current closeIcon value. Default value is null
- See Also:
 
- 
getCloseIconSizeSize of thecloseIconfor this tab. If unspecified the icon will be sized according toTabSet.closeTabIconSize- Returns:
- Current closeIconSize value. Default value is null
 
- 
getDisabledIf specified, this tab will initially be rendered in a disabled state. methods.- Returns:
- Current disabled value. Default value is null
 
- 
setEnableWhenCriteria to be evaluated to determine whether this Tab should be enabled.A basic criteria uses textMatchStyle:"exact". When specified in Component XMLthis property allowsshorthand formatsfor defining criteria.- Parameters:
- enableWhen- New enableWhen value. Default value is null
- Returns:
- Tabinstance, for chaining setter calls
- See Also:
 
- 
getEnableWhenCriteria to be evaluated to determine whether this Tab should be enabled.A basic criteria uses textMatchStyle:"exact". When specified in Component XMLthis property allowsshorthand formatsfor defining criteria.- Returns:
- Current enableWhen value. Default value is null
- See Also:
 
- 
setHiddenIf specified this tab will be hidden by default. To show and hide tabs at runtime useTabSet.showTab()andTabSet.hideTab()- Parameters:
- hidden- New hidden value. Default value is null
- Returns:
- Tabinstance, for chaining setter calls
 
- 
getHiddenIf specified this tab will be hidden by default. To show and hide tabs at runtime useTabSet.showTab()andTabSet.hideTab()- Returns:
- Current hidden value. Default value is null
 
- 
getIconIf specified, this tab will show an icon next to the tab title.NOTE: if you enable closeable tabs,tab.iconis used for the close icon.TabSet.canCloseTabsdescribes a workaround to enable both acloseIconand a second icon to be shown.Use TabSet.tabIconClick()to add an event handler specifically for clicks on the icon.If a tab becomes disabled, a different icon will be loaded by adding a suffix to the image name (seeButton.icon).You should specify a size for the icon via iconSizeoriconWidthandiconHeight. Without an explicitly specified size, tabs may be drawn overlapping or with gaps the first time a page is loaded, because the icon is not cached and therefore its size isn't known.- Returns:
- Current icon value. Default value is null
- See Also:
 
- 
getIconHeightIficonis specified, this property may be used to specify a height for the icon.- Returns:
- Current iconHeight value. Default value is null
 
- 
getIconSizeIficonis specified, this property may be used to specify a size for the icon. Per side sizing may be specified instead viaiconWidthandiconHeight.- Returns:
- Current iconSize value. Default value is 16
 
- 
getIconWidthIficonis specified, this property may be used to specify a width for the icon.- Returns:
- Current iconWidth value. Default value is null
 
- 
setNameOptional name for the tab, which can later be used to reference the tab. APIs requiring a reference to a tab will accept the tab's name [includingTabSet.selectTab(),TabSet.updateTab(),TabSet.removeTab()].
 This name will also be passed to theTabSet.tabSelected()andTabSet.tabDeselected()handler functions, if specified.This identifier is requred to be locally unique to the TabSet and cannot be used to get a global reference to the Tab. If you want a global reference, set IDinstead.
- 
getNameOptional name for the tab, which can later be used to reference the tab. APIs requiring a reference to a tab will accept the tab's name [includingTabSet.selectTab(),TabSet.updateTab(),TabSet.removeTab()].
 This name will also be passed to theTabSet.tabSelected()andTabSet.tabDeselected()handler functions, if specified.This identifier is requred to be locally unique to the TabSet and cannot be used to get a global reference to the Tab. If you want a global reference, set IDinstead.- Returns:
- Current name value. Default value is null
- See Also:
 
- 
getPaneSpecifies the pane associated with this tab. You have three options for the value of the pane attribute:- ID - The global ID of an already created Canvas (or subclass).
- Canvas - A live instance of a Canvas (or subclass).
- AutoChildShortcut - String with format "autoChild:autoChildName"
 - Returns:
- Current pane value. Default value is null
- See Also:
 
- 
setPaneMarginSpace to leave around the pane within this Tab. If specified, this property takes precedence overTabSet.paneMargin- Parameters:
- paneMargin- New paneMargin value. Default value is null
- Returns:
- Tabinstance, for chaining setter calls
 
- 
getPaneMarginSpace to leave around the pane within this Tab. If specified, this property takes precedence overTabSet.paneMargin- Returns:
- Current paneMargin value. Default value is null
 
- 
getPickerTitleIfTabSet.showTabPickeris true for this TabSet, if set this property will determine the title of the picker menu item for this tab. If unset,titlewill be used instead.- Returns:
- Current pickerTitle value. Default value is null
- See Also:
 
- 
getPromptSpecifies the prompt to be displayed when the mouse hovers over the tab.- Returns:
- Current prompt value. Default value is null
- See Also:
 
- 
getTitleSpecifies the title of the this tab.- Returns:
- Current title value. Default value is null
- See Also:
 
- 
setVisibleWhenCriteria to be evaluated to determine whether this Tab should be visible.A basic criteria uses textMatchStyle:"exact". When specified in Component XMLthis property allowsshorthand formatsfor defining criteria.- Parameters:
- visibleWhen- New visibleWhen value. Default value is null
- Returns:
- Tabinstance, for chaining setter calls
- See Also:
 
- 
getVisibleWhenCriteria to be evaluated to determine whether this Tab should be visible.A basic criteria uses textMatchStyle:"exact". When specified in Component XMLthis property allowsshorthand formatsfor defining criteria.- Returns:
- Current visibleWhen value. Default value is null
- See Also:
 
- 
getWidthpublic int getWidth()You can specify an explicit width for the tab using this property. Note that tabs automatically size to make room for the full title, but if you want to e.g. specify a uniform width for all tabs in a TabSet, this property enables you to do so.- Returns:
- Current width value. Default value is 100
 
- 
addTabDeselectedHandlerAdd a tabDeselected handler.Optional handler to fire when a tab is deselected. Calling TabDeselectedEvent.cancelwill cancel the new selection, leaving this tab selected. As withTabSet.tabSelected()this method only fires when the tabset is drawn.- Specified by:
- addTabDeselectedHandlerin interface- HasTabDeselectedHandlers
- Parameters:
- handler- the tabDeselected handler
- Returns:
- HandlerRegistrationused to remove this handler
 
- 
addTabSelectedHandlerAdd a tabSelected handler.Optional handler to fire when a tab is selected. As with TabSet.tabSelected()this method only fires when the tabset is drawn.- Specified by:
- addTabSelectedHandlerin interface- HasTabSelectedHandlers
- Parameters:
- handler- the tabSelected handler
- Returns:
- HandlerRegistrationused to remove this handler
 
- 
setIDOptional ID for the tab, which can later be used to reference the tab. APIs requiring a reference to a tab will accept the tabs ID [includingTabSet.selectTab,TabSet.updateTab,TabSet.removeTab].
 The ID will also be passed to theTabSet.tabSelectedandTabSet.tabDeselectedhandler functions, if specified.Note that if you provide an ID, it must be globally unique. - Parameters:
- ID- ID Default value is null
 
- 
getIDOptional ID for the tab, which can later be used to reference the tab. APIs requiring a reference to a tab will accept the tabs ID [includingTabSet.selectTab,TabSet.updateTab,TabSet.removeTab].
 The ID will also be passed to theTabSet.tabSelectedandTabSet.tabDeselectedhandler functions, if specified.Note that if you provide an ID, it must be globally unique. - Returns:
- String
 
- 
setTitleSpecifies the title of the this tab. To change the title after the TabSet has been created, callTabSet.setTabTitle.- Parameters:
- title- title Default value is null
 
- 
setDisabledpublic void setDisabled(boolean disabled) If specified, this tab will initially be rendered in a disabled state.- Parameters:
- disabled- disabled Default value is null
 
- 
setIconIf specified, this tab will show an icon next to the tab title. Note that as withicon, the URL of a tabs icon will be updated to reflect disabled state.
 If desired a click handler may be assigned to the icon, which will be fired when the user clicks the tab. This method takes a single parametertab, a pointer to the tab object.- Parameters:
- icon- icon Default value is null
- See Also:
 
- 
setIconIf specified, this tab will show an icon next to the tab title. Note that as withicon, the URL of a tabs icon will be updated to reflect disabled state.
 If desired a click handler may be assigned to the icon, which will be fired when the user clicks the tab. This method takes a single parametertab, a pointer to the tab object.- Parameters:
- icon- icon Default value is null
- iconWidth- the icon width
- iconHeight- the icon height
- See Also:
 
- 
setIconIf specified, this tab will show an icon next to the tab title. Note that as withicon, the URL of a tabs icon will be updated to reflect disabled state.
 If desired a click handler may be assigned to the icon, which will be fired when the user clicks the tab. This method takes a single parametertab, a pointer to the tab object.- Parameters:
- icon- icon Default value is null
- iconSize- the icon size
- See Also:
 
- 
setIconSizeIficonis specified, this property may be used to specify a size for the icon. Per side sizing may be specified instead viaiconWidthandiconHeight.- Parameters:
- iconSize- New iconSize value. Default value is 16
 
- 
setIconWidthIficonis specified, this property may be used to specify a width for the icon.- Parameters:
- iconWidth- New iconWidth value. Default value is null
 
- 
setIconHeightIficonis specified, this property may be used to specify a height for the icon.- Parameters:
- iconHeight- New iconHeight value. Default value is null
 
- 
setPickerTitleIfTabSet.showTabPickeris true for this TabSet, if set this property will determine the title of the picker menu item for this tab. If unset,titlewill be used instead- Parameters:
- pickerTitle- New pickerTitle value. Default value is null
- See Also:
 
- 
setWidthpublic void setWidth(int width) You can specify an explicit width for the tab using this property. Note that tabs automatically size to make room for the full title, but if you want to e.g. specify a uniform width for all tabs in a TabSet, this property enables you to do so.- Parameters:
- width- New width value. Default value is 100
 
- 
setPromptSpecifies the prompt to be displayed when the mouse hovers over the tab.- Parameters:
- prompt- New prompt value. Default value is null
- See Also:
 
- 
setCanEditTitleIf specified, overrides theTabSet.canEditTabTitlessetting, for this one tab only.Note that the TabSet's titleEditEventmust be set to a supportedTabTitleEditEventin order for users to be able to edit this tab's title.- Parameters:
- canEditTitle- New canEditTitle value. Default value is null
- See Also:
 
- 
setCanCloseDetermines whether this tab should show a close icon allowing the user to dismiss the tab by clicking on the close icon directly. The URL for the close icon's image will be{M{ derived fromTabSet.closeTabIconby default, but may be overridden by explicitly specifyingcloseIcon.If unset or null, this property is derived from TabSet.canCloseTabs.Note that setting canClosemeans thaticoncannot be used, because it's used for thecloseIcon- seeTabSet.canCloseTabsfor a workaround.- Parameters:
- canClose- New canClose value. Default value is null
- See Also:
- 
- com.smartgwt.client.widgets.tab.TabSet#closeClick
- Closeable Tabs Example
 
 
- 
setCanClosepublic void setCanClose(boolean canClose) SeesetCanClose().- Parameters:
- canClose- New canClose value.
 
- 
setCloseIconCustom src for the close icon for this tab to display if it is closeable. SeecanCloseandTabSet.canCloseTabs.- Parameters:
- closeIcon- New closeIcon value. Default value is null
- See Also:
 
- 
setCloseIconSizeSize of thecloseIconfor this tab. If unspecified the icon will be sized according toTabSet.closeTabIconSize- Parameters:
- closeIconSize- New closeIconSize value. Default value is null
 
- 
setPaneID
- 
setTitleStyleProvide a separate style for the title text. If set and the ImgTab is vertical, a "v" will be automatically prepended to the style name (hence "tabTitle" -> "vtabTitle").- Parameters:
- titleStyle- the title style
 
- 
getTitleStyleA separate style for the title text. If set and the ImgTab is vertical, a "v" will be automatically prepended to the style name (hence "tabTitle" -> "vtabTitle").- Returns:
- the title style
 
- 
setPaneSpecifies the pane associated with this tab. You can change the pane associated with a given tab after the TabSet has been created by callingTabSet.updateTab(int, com.smartgwt.client.widgets.Canvas)- Parameters:
- pane- the tab pane
 
- 
getContextMenuContext menu to show for this object, an instance of the Menu widget.- Returns:
- Menu
 
- 
getTabSet
- 
setTabSet
- 
getTabCanvasReturns the live Canvas used to represent this tab in a tabSet. Will return null if this Tab has not been added to a TabSet or if the tabset is not yet drawn.The underlying SmartClient class of the returned canvas depends on #getUseSimpleTabs. If this property is false, the returned canvas will be aImgTabinstance. If true the canvas will be acom.smartgwt.client.widgets.tab.Buttoninstance. Note that you can make use of ImgTab APIs by using thegetJsObj()andcreate()APIs to "cast" to the appropriate type - for example:
 ImgTab liveTab = ImgTab.create(myTabSet.getTabCanvas(2).getJsObj());- Returns:
- live Canvas for this tab in a tabSet.
 
 
-