|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.smartgwt.client.core.JsObject
com.smartgwt.client.core.DataClass
com.smartgwt.client.core.RefDataClass
com.smartgwt.client.widgets.tab.Tab
public class Tab
Tabs are specified as objects, not class instances. For example, when developing in JavaScript, a typical initialization block for a TabSet would look like this:
TabSet.create({ tabs: [ {title: "tab1", pane: "pane1"}, {title: "tab2"} ] });And in XML:
<TabSet> <tabs> <Tab title="tab1" pane="pane1"/> <Tab title="tab2"/> </tabs> </TabSet>
Field Summary |
---|
Fields inherited from class com.smartgwt.client.core.JsObject |
---|
jsObj |
Constructor Summary | |
---|---|
Tab()
|
|
Tab(JavaScriptObject jsObj)
|
|
Tab(java.lang.String title)
|
|
Tab(java.lang.String title,
java.lang.String icon)
|
Method Summary | |
---|---|
HandlerRegistration |
addTabDeselectedHandler(TabDeselectedHandler handler)
Add a tabDeselected handler. |
HandlerRegistration |
addTabSelectedHandler(TabSelectedHandler handler)
Add a tabSelected handler. |
java.lang.Boolean |
getCanClose()
Determines whether this tab should show an icon allowing the user to dismiss the tab by clicking on it directly. |
java.lang.Boolean |
getCanEditTitle()
If specified, overrides the canEditTabTitles setting,
for this one tab only. |
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. |
static Tab |
getOrCreateRef(JavaScriptObject jsObj)
|
Canvas |
getPane()
The pane associated with the 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 an icon allowing the user to dismiss the tab by clicking on it directly. |
void |
setCanEditTitle(java.lang.Boolean canEditTitle)
If specified, overrides the canEditTabTitles setting,
for this one tab only. |
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 |
setPane(Canvas pane)
Specifies the pane associated with this tab. |
void |
setPaneID(java.lang.String paneID)
|
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. |
Methods inherited from class com.smartgwt.client.core.RefDataClass |
---|
getRef, getRef |
Methods inherited from class com.smartgwt.client.core.JsObject |
---|
isCreated, setJsObj |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.google.gwt.event.shared.HasHandlers |
---|
fireEvent |
Constructor Detail |
---|
public Tab()
public Tab(JavaScriptObject jsObj)
public Tab(java.lang.String title)
public Tab(java.lang.String title, java.lang.String icon)
Method Detail |
---|
public static Tab getOrCreateRef(JavaScriptObject jsObj)
public void setCanClose(java.lang.Boolean canClose)
closeTabIcon
by default, but may be overridden by explicitly specifying closeIcon
. If unset, this property is derived from canCloseTabs
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, this property is derived from canCloseTabs
com.smartgwt.client.widgets.tab.TabSet#closeClick
,
Closeable Tabs Examplepublic void setCanEditTitle(java.lang.Boolean canEditTitle)
canEditTabTitles
setting,
for this one tab only.
canEditTitle
- canEditTitle Default value is nullTabSet.setCanEditTabTitles(java.lang.Boolean)
public java.lang.Boolean getCanEditTitle()
canEditTabTitles
setting,
for this one tab only.
TabSet.getCanEditTabTitles()
public void setCloseIcon(java.lang.String closeIcon)
canClose
and canCloseTabs
.
closeIcon
- closeIcon Default value is nullpublic java.lang.String getCloseIcon()
canClose
and canCloseTabs
.
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 icon
iconHeight
- iconHeight Default value is nullpublic java.lang.Integer getIconHeight()
icon
is specified, this property may be used to specify a size
for the icon
public 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 icon
iconWidth
- iconWidth Default value is nullpublic java.lang.Integer getIconWidth()
icon
is specified, this property may be used to specify a size
for the icon
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 instead
pickerTitle
- pickerTitle 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 instead
TabSet.getShowTabPicker()
,
getTitle()
public void setPrompt(java.lang.String prompt)
prompt
- prompt Default value is nullpublic java.lang.String getPrompt()
public void setWidth(int width)
width
- width Default value is 100public int getWidth()
public 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 handler
HandlerRegistration
used to remove this handlerpublic 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 handler
HandlerRegistration
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());
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |