public class Tab extends RefDataClass implements HasTabDeselectedHandlers, HasTabSelectedHandlers
TabSet.create({ tabs: [ {title: "tab1", pane: "pane1"}, {title: "tab2"} ] });And in XML:
<TabSet> <tabs> <Tab title="tab1" pane="pane1"/> <Tab title="tab2"/> </tabs> </TabSet>
id
Constructor and Description |
---|
Tab() |
Tab(com.google.gwt.core.client.JavaScriptObject jsObj) |
Tab(java.lang.String title) |
Tab(java.lang.String title,
java.lang.String icon) |
Modifier and Type | Method and Description |
---|---|
com.google.gwt.event.shared.HandlerRegistration |
addTabDeselectedHandler(TabDeselectedHandler handler)
Add a tabDeselected handler.
|
com.google.gwt.event.shared.HandlerRegistration |
addTabSelectedHandler(TabSelectedHandler handler)
Add a tabSelected handler.
|
java.lang.Boolean |
getCanClose()
Determines whether this tab should show a close icon allowing the user to dismiss the tab by clicking on the close icon
directly.
|
java.lang.Boolean |
getCanEditTitle()
If specified, overrides the
canEditTabTitles setting,
for this one tab only. |
java.lang.Boolean |
getCanReorder()
If
canReorderTabs is set to true , setting
canReorder explicitly to false for some tab will disallow drag-reordering of this tab. |
java.lang.String |
getCloseIcon()
Custom src for the close icon for this tab to display if it is closeable.
|
java.lang.Integer |
getCloseIconSize()
Size of the
closeIcon for this tab. |
Menu |
getContextMenu()
Context menu to show for this object, an instance of the Menu widget.
|
java.lang.Boolean |
getDisabled()
If specified, this tab will initially be rendered in a disabled state.
|
java.lang.String |
getIcon()
If specified, this tab will show an icon next to the tab title.
|
java.lang.Integer |
getIconHeight()
If
icon is specified, this property may be used to specify a size
for the icon |
java.lang.Integer |
getIconSize()
If
icon is specified, this property may be used to specify a size
for the icon. |
java.lang.Integer |
getIconWidth()
If
icon is specified, this property may be used to specify a size
for the icon |
java.lang.String |
getID()
Optional ID for the tab, which can later be used to reference the tab.
|
java.lang.String |
getName()
Optional name for the tab, which can later be used to reference the tab.
|
static Tab |
getOrCreateRef(com.google.gwt.core.client.JavaScriptObject jsObj) |
Canvas |
getPane()
The pane associated with the tab.
|
java.lang.Integer |
getPaneMargin()
Space to leave around the pane within this Tab.
|
java.lang.String |
getPickerTitle()
If
showTabPicker is true for this TabSet, if set this
property will determine the title of the picker menu item for this tab. |
java.lang.String |
getPrompt()
Specifies the prompt to be displayed when the mouse hovers over the tab.
|
StatefulCanvas |
getTabCanvas()
Returns the live Canvas used to represent this tab in a tabSet.
|
TabSet |
getTabSet() |
java.lang.String |
getTitle()
Specifies the title of the this tab.
|
java.lang.String |
getTitleStyle()
A separate style for the title text.
|
int |
getWidth()
You can specify an explicit width for the tab using this property.
|
void |
setCanClose(boolean canClose) |
void |
setCanClose(java.lang.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.
|
void |
setCanEditTitle(java.lang.Boolean canEditTitle)
If specified, overrides the
canEditTabTitles setting,
for this one tab only. |
void |
setCanReorder(java.lang.Boolean canReorder)
If
canReorderTabs is set to true , setting
canReorder explicitly to false for some tab will disallow drag-reordering of this tab. |
void |
setCloseIcon(java.lang.String closeIcon)
Custom src for the close icon for this tab to display if it is closeable.
|
void |
setCloseIconSize(java.lang.Integer closeIconSize)
Size of the
closeIcon for this tab. |
void |
setContextMenu(Menu contextMenu)
Context menu to show for this tab.
|
void |
setDisabled(boolean disabled)
If specified, this tab will initially be rendered in a disabled state.
|
void |
setIcon(java.lang.String icon)
If specified, this tab will show an icon next to the tab title.
|
void |
setIcon(java.lang.String icon,
int iconSize)
If specified, this tab will show an icon next to the tab title.
|
void |
setIcon(java.lang.String icon,
int iconWidth,
int iconHeight)
If specified, this tab will show an icon next to the tab title.
|
void |
setIconHeight(java.lang.Integer iconHeight)
If
icon is specified, this property may be used to specify a size
for the icon |
void |
setIconSize(java.lang.Integer iconSize)
If
icon is specified, this property may be used to specify a size
for the icon. |
void |
setIconWidth(java.lang.Integer iconWidth)
If
icon is specified, this property may be used to specify a size
for the icon |
void |
setID(java.lang.String ID)
Optional ID for the tab, which can later be used to reference the tab.
|
void |
setJavaScriptObject(com.google.gwt.core.client.JavaScriptObject jsObj) |
void |
setName(java.lang.String name)
Optional name for the tab, which can later be used to reference the tab.
|
void |
setPane(Canvas pane)
Specifies the pane associated with this tab.
|
void |
setPaneID(java.lang.String paneID) |
void |
setPaneMargin(java.lang.Integer paneMargin)
Space to leave around the pane within this Tab.
|
void |
setPickerTitle(java.lang.String pickerTitle)
If
showTabPicker is true for this TabSet, if set this
property will determine the title of the picker menu item for this tab. |
void |
setPrompt(java.lang.String prompt)
Specifies the prompt to be displayed when the mouse hovers over the tab.
|
void |
setTabSet(TabSet tabSet) |
void |
setTitle(java.lang.String title)
Specifies the title of the this tab.
|
void |
setTitleStyle(java.lang.String titleStyle)
Provide a separate style for the title text.
|
void |
setWidth(int width)
You can specify an explicit width for the tab using this property.
|
getRef, getRef, internalSetID
doAddHandler, fireEvent, getAttribute, getAttributeAsBoolean, getAttributeAsDate, getAttributeAsDouble, getAttributeAsDoubleArray, getAttributeAsFloat, getAttributeAsInt, getAttributeAsIntArray, getAttributeAsJavaScriptObject, getAttributeAsLong, getAttributeAsMap, getAttributeAsObject, getAttributeAsRecord, getAttributeAsString, getAttributeAsStringArray, getAttributes, getHandlerCount, getJsObj, 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
equals, hashCode, isCreated, setJsObj
public Tab()
public Tab(com.google.gwt.core.client.JavaScriptObject jsObj)
public Tab(java.lang.String title)
public Tab(java.lang.String title, java.lang.String icon)
public static Tab getOrCreateRef(com.google.gwt.core.client.JavaScriptObject jsObj)
public void setJavaScriptObject(com.google.gwt.core.client.JavaScriptObject jsObj)
public void setCanClose(java.lang.Boolean canClose)
closeTabIcon
by default, but may be overridden by explicitly
specifying closeIcon
. If unset or null, this property is
derived from canCloseTabs
.
After the TabSet has been
created, you can change a tab's canClose property by calling TabSet.setCanCloseTab
.
canClose
- canClose Default value is nullcom.smartgwt.client.widgets.tab.TabSet#closeClick
,
Closeable Tabs Examplepublic java.lang.Boolean getCanClose()
closeTabIcon
by default, but may be overridden by explicitly
specifying closeIcon
. If unset or null, this property is
derived from canCloseTabs
.
After the TabSet has been
created, you can change a tab's canClose property by calling TabSet.setCanCloseTab
.
com.smartgwt.client.widgets.tab.TabSet#closeClick
,
Closeable Tabs Examplepublic void setCanEditTitle(java.lang.Boolean canEditTitle)
canEditTabTitles
setting,
for this one tab only. Note that the TabSet's titleEditEvent
must be set to a supported TabTitleEditEvent
in order for users to be
able to edit this tab's title.
canEditTitle
- canEditTitle Default value is nullTabSet.setCanEditTabTitles(java.lang.Boolean)
,
User-Editable Titles Examplepublic java.lang.Boolean getCanEditTitle()
canEditTabTitles
setting,
for this one tab only. Note that the TabSet's titleEditEvent
must be set to a supported TabTitleEditEvent
in order for users to be
able to edit this tab's title.
TabSet.getCanEditTabTitles()
,
User-Editable Titles Examplepublic void setCanReorder(java.lang.Boolean canReorder)
canReorderTabs
is set to true
, setting
canReorder
explicitly to false
for some tab will disallow drag-reordering of this tab. Has no
effect if canReorderTabs
is 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:false
tab 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.
canReorder
- canReorder Default value is nullTabSet.setCanReorderTabs(java.lang.Boolean)
public java.lang.Boolean getCanReorder()
canReorderTabs
is set to true
, setting
canReorder
explicitly to false
for some tab will disallow drag-reordering of this tab. Has no
effect if canReorderTabs
is 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:false
tab 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.
TabSet.getCanReorderTabs()
public void setCloseIcon(java.lang.String closeIcon)
canClose
and canCloseTabs
.closeIcon
- . See SCImgURL
. Default value is nullpublic java.lang.String getCloseIcon()
canClose
and canCloseTabs
.SCImgURL
public void setCloseIconSize(java.lang.Integer closeIconSize)
closeIcon
for this tab. If unspecified the icon
will be sized according to closeTabIconSize
closeIconSize
- closeIconSize Default value is nullpublic java.lang.Integer getCloseIconSize()
closeIcon
for this tab. If unspecified the icon
will be sized according to closeTabIconSize
public void setIconHeight(java.lang.Integer iconHeight)
icon
is specified, this property may be used to specify a size
for the iconiconHeight
- iconHeight Default value is nullpublic java.lang.Integer getIconHeight()
icon
is specified, this property may be used to specify a size
for the iconpublic void setIconSize(java.lang.Integer iconSize)
icon
is specified, this property may be used to specify a size
for the icon. Per side sizing may be specified instead via iconWidth
and iconHeight
.iconSize
- iconSize Default value is nullpublic java.lang.Integer getIconSize()
icon
is specified, this property may be used to specify a size
for the icon. Per side sizing may be specified instead via iconWidth
and iconHeight
.public void setIconWidth(java.lang.Integer iconWidth)
icon
is specified, this property may be used to specify a size
for the iconiconWidth
- iconWidth Default value is nullpublic java.lang.Integer getIconWidth()
icon
is specified, this property may be used to specify a size
for the iconpublic void setName(java.lang.String name)
TabSet.selectTab
, TabSet.updateTab
, TabSet.removeTab
].TabSet.tabSelected
and TabSet.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 ID
instead.
name
- . See String
. Default value is nullpublic java.lang.String getName()
TabSet.selectTab
, TabSet.updateTab
, TabSet.removeTab
].TabSet.tabSelected
and TabSet.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 ID
instead.
String
public void setPaneMargin(java.lang.Integer paneMargin)
paneMargin
paneMargin
- paneMargin Default value is nullpublic java.lang.Integer getPaneMargin()
paneMargin
public void setPickerTitle(java.lang.String pickerTitle)
showTabPicker
is true for this TabSet, if set this
property will determine the title of the picker menu item for this tab. If unset, title
will be used insteadpickerTitle
- . See String
. Default value is nullTabSet.setShowTabPicker(java.lang.Boolean)
,
setTitle(java.lang.String)
public java.lang.String getPickerTitle()
showTabPicker
is true for this TabSet, if set this
property will determine the title of the picker menu item for this tab. If unset, title
will be used insteadString
TabSet.getShowTabPicker()
,
getTitle()
public void setPrompt(java.lang.String prompt)
prompt
- . See String
. Default value is nullpublic java.lang.String getPrompt()
String
public void setWidth(int width)
width
- width Default value is 100public int getWidth()
public com.google.gwt.event.shared.HandlerRegistration addTabDeselectedHandler(TabDeselectedHandler handler)
Optional handler to fire when a tab is deselected. Returning false will cancel the new selection, leaving this tab
selected. As with TabSet.tabSelected
this method
only fires when the tabset is drawn.
addTabDeselectedHandler
in interface HasTabDeselectedHandlers
handler
- the tabDeselected handlerHandlerRegistration
used to remove this handlerpublic com.google.gwt.event.shared.HandlerRegistration addTabSelectedHandler(TabSelectedHandler handler)
Optional handler to fire when a tab is selected. As with TabSet.tabSelected
this method only fires when the tabset
is drawn.
addTabSelectedHandler
in interface HasTabSelectedHandlers
handler
- the tabSelected handlerHandlerRegistration
used to remove this handlerpublic void setID(java.lang.String ID)
TabSet.selectTab
, TabSet.updateTab
, TabSet.removeTab
].TabSet.tabSelected
and TabSet.tabDeselected
handler functions, if specified.
Note that if you provide an ID, it must be globally unique.
ID
- ID Default value is nullpublic java.lang.String getID()
TabSet.selectTab
, TabSet.updateTab
, TabSet.removeTab
].TabSet.tabSelected
and TabSet.tabDeselected
handler functions, if specified.
Note that if you provide an ID, it must be globally unique.
public void setTitle(java.lang.String title)
TabSet.setTabTitle
.title
- title Default value is nullpublic java.lang.String getTitle()
public void setDisabled(boolean disabled)
disabled
- disabled Default value is nullpublic java.lang.Boolean getDisabled()
TabSet.enableTab
, and TabSet.disableTab
methods.public void setIcon(java.lang.String icon)
icon
, the URL of a tabs icon will be updated to reflect disabled state.tab
, a pointer to the tab object.icon
- icon Default value is nullpublic void setIcon(java.lang.String icon, int iconWidth, int iconHeight)
icon
, the URL of a tabs icon will be updated to reflect disabled state.tab
, a pointer to the tab object.icon
- icon Default value is nulliconWidth
- the icon widthiconHeight
- the icon heightpublic void setIcon(java.lang.String icon, int iconSize)
icon
, the URL of a tabs icon will be updated to reflect disabled state.tab
, a pointer to the tab object.icon
- icon Default value is nulliconSize
- the icon sizepublic java.lang.String getIcon()
icon
, the URL of a tabs icon will be updated to reflect disabled state.tab
, a pointer to the tab object.public void setCanClose(boolean canClose)
public void setPaneID(java.lang.String paneID)
public void setTitleStyle(java.lang.String titleStyle)
titleStyle
- the title stylepublic java.lang.String getTitleStyle()
public void setPane(Canvas pane)
TabSet.updateTab(int, com.smartgwt.client.widgets.Canvas)
pane
- the tab panepublic Canvas getPane()
public void setContextMenu(Menu contextMenu)
contextMenu
- contextMenu Default value is nullpublic Menu getContextMenu()
public TabSet getTabSet()
public void setTabSet(TabSet tabSet)
public StatefulCanvas getTabCanvas()
The underlying SmartClient class of the returned canvas depends on #getUseSimpleTabs
.
If this property is false, the returned canvas will be a ImgTab
instance. If true the canvas will be a com.smartgwt.client.widgets.tab.Button
instance.
Note that you can make use of ImgTab APIs by using the getJsObj()
and create()
APIs to "cast" to the appropriate type - for example:
ImgTab liveTab = ImgTab.create(myTabSet.getTabCanvas(2).getJsObj());