public class Tab extends RefDataClass implements HasTabDeselectedHandlers, HasTabSelectedHandlers
id
factoryCreated, factoryProperties, readOnly
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
TabSet.canEditTabTitles
setting, for this one tab only. |
java.lang.Boolean |
getCanReorder()
If
TabSet.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
TabSet.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
TabSet.canEditTabTitles
setting, for this one tab only. |
void |
setCanReorder(java.lang.Boolean canReorder)
If
TabSet.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 |
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
TabSet.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
applyFactoryProperties, doAddHandler, fireEvent, getAttribute, getAttributeAsBoolean, getAttributeAsBoolean, getAttributeAsDate, getAttributeAsDouble, getAttributeAsDoubleArray, getAttributeAsFloat, getAttributeAsInt, getAttributeAsIntArray, getAttributeAsJavaScriptObject, getAttributeAsLong, getAttributeAsMap, getAttributeAsObject, getAttributeAsRecord, getAttributeAsString, getAttributeAsStringArray, getAttributes, getHandlerCount, getReadOnly, isFactoryCreated, logConfiguration, 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, setFactoryCreated, setReadOnly
equals, getJsObj, hashCode, isCreated, setJavaScriptObject, 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 setCanClose(java.lang.Boolean canClose)
TabSet.closeTabIcon
by default, but may be overridden by
explicitly specifying closeIcon
. If unset or null, this
property is derived from TabSet.canCloseTabs
.
Note
that setting canClose
means that icon
cannot be used,
because it's used for the closeIcon
- see TabSet.canCloseTabs
for a workaround.
After the TabSet has
been created, you can change a tab's canClose property by calling TabSet.setCanCloseTab()
.
canClose
- Default value is nullcom.smartgwt.client.widgets.tab.TabSet#closeClick
,
Closeable Tabs Examplepublic java.lang.Boolean getCanClose()
TabSet.closeTabIcon
by default, but may be overridden by
explicitly specifying closeIcon
. If unset or null, this
property is derived from TabSet.canCloseTabs
.
Note
that setting canClose
means that icon
cannot be used,
because it's used for the closeIcon
- see TabSet.canCloseTabs
for a workaround.
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)
TabSet.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
- Default value is nullTabSet.setCanEditTabTitles(java.lang.Boolean)
,
User-Editable Titles Examplepublic java.lang.Boolean getCanEditTitle()
TabSet.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)
TabSet.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
- Default value is nullTabSet.setCanReorderTabs(java.lang.Boolean)
public java.lang.Boolean getCanReorder()
TabSet.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 TabSet.canCloseTabs
.closeIcon
- See SCImgURL
. Default value is nullpublic java.lang.String getCloseIcon()
canClose
and TabSet.canCloseTabs
.SCImgURL
public void setCloseIconSize(java.lang.Integer closeIconSize)
closeIcon
for this tab. If unspecified the icon
will be sized according to TabSet.closeTabIconSize
closeIconSize
- Default value is nullpublic java.lang.Integer getCloseIconSize()
closeIcon
for this tab. If unspecified the icon
will be sized according to TabSet.closeTabIconSize
public void setIconHeight(java.lang.Integer iconHeight)
icon
is specified, this property may be used to specify a size
for the iconiconHeight
- 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
- Default value is 16public 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
- 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
- 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.
public void setPaneMargin(java.lang.Integer paneMargin)
TabSet.paneMargin
paneMargin
- Default value is nullpublic java.lang.Integer getPaneMargin()
TabSet.paneMargin
public void setPickerTitle(java.lang.String pickerTitle)
TabSet.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 HTMLString
. Default value is nullTabSet.setShowTabPicker(java.lang.Boolean)
,
setTitle(java.lang.String)
public java.lang.String getPickerTitle()
TabSet.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 insteadHTMLString
TabSet.getShowTabPicker()
,
getTitle()
public void setPrompt(java.lang.String prompt)
prompt
- See HTMLString
. Default value is nullpublic java.lang.String getPrompt()
HTMLString
public void setWidth(int 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());