|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.google.gwt.user.client.ui.UIObject
com.google.gwt.user.client.ui.Widget
com.sencha.gxt.widget.core.client.Component
com.sencha.gxt.widget.core.client.TabPanel
public class TabPanel
A basic tab container.
Code snippet:
TabPanel panel = new TabPanel();
panel.setTabScroll(true);
panel.setAnimScroll(true);
panel.add(new Label("Tab 1 Content"), new TabItemConfig("Tab 1", true));
panel.add(new Label("Tab 2 Content"), new TabItemConfig("Tab 2", true));
| Nested Class Summary | |
|---|---|
static interface |
TabPanel.TabPanelAppearance
|
static interface |
TabPanel.TabPanelMessages
|
| Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.UIObject |
|---|
UIObject.DebugIdImpl, UIObject.DebugIdImplEnabled |
| Nested classes/interfaces inherited from interface com.google.gwt.user.client.ui.IndexedPanel |
|---|
IndexedPanel.ForIsWidget |
| Nested classes/interfaces inherited from interface com.google.gwt.user.client.ui.HasWidgets |
|---|
HasWidgets.ForIsWidget |
| Field Summary |
|---|
| Fields inherited from class com.google.gwt.user.client.ui.UIObject |
|---|
DEBUG_ID_PREFIX |
| Constructor Summary | |
|---|---|
TabPanel()
Creates a new tab panel with the default appearance. |
|
TabPanel(TabPanel.TabPanelAppearance appearance)
Creates a new tab panel with the specified appearance. |
|
| Method Summary | |
|---|---|
void |
add(IsWidget widget,
TabItemConfig config)
Adds an item to the tab panel with the specified text. |
void |
add(Widget w)
|
void |
add(Widget widget,
java.lang.String text)
Adds an item to the tab panel with the specified text. |
void |
add(Widget widget,
TabItemConfig config)
Adds an item to the tab panel with the specified tab configuration. |
HandlerRegistration |
addBeforeCloseHandler(BeforeCloseEvent.BeforeCloseHandler<Widget> handler)
Adds a BeforeCloseEvent.BeforeCloseHandler handler for BeforeCloseEvent
events. |
HandlerRegistration |
addBeforeSelectionHandler(BeforeSelectionHandler<Widget> handler)
|
HandlerRegistration |
addCloseHandler(CloseEvent.CloseHandler<Widget> handler)
Adds a CloseEvent.CloseHandler handler for CloseEvent events. |
HandlerRegistration |
addSelectionHandler(SelectionHandler<Widget> handler)
|
void |
clear()
|
Widget |
findItem(java.lang.String id,
boolean checkText)
Searches for an item based on its id and optionally the item's text. |
void |
forceLayout()
Forces a class that implements HasLayout to lay out its child
widgets. |
Widget |
getActiveWidget()
Returns the active widget. |
boolean |
getAnimScroll()
Returns true if scrolling is animated. |
boolean |
getBodyBorder()
Returns true if the body border is enabled. |
TabItemConfig |
getConfig(Widget widget)
Returns the tab item config for the given widget. |
CardLayoutContainer |
getContainer()
Returns the internal card layout container. |
TabPanel.TabPanelMessages |
getMessages()
Returns the tab panel messages. |
int |
getMinTabWidth()
Returns the minimum tab width. |
boolean |
getResizeTabs()
Returns true if tab resizing is enabled. |
int |
getScrollDuration()
Returns the scroll duration in milliseconds. |
int |
getTabMargin()
Returns the panel's tab margin. |
boolean |
getTabScroll()
Returns true if tab scrolling is enabled. |
int |
getTabWidth()
Returns the default tab width. |
Widget |
getWidget(int index)
|
int |
getWidgetCount()
|
int |
getWidgetIndex(IsWidget child)
|
int |
getWidgetIndex(Widget widget)
|
void |
insert(Widget widget,
int index,
TabItemConfig config)
Inserts the specified item into the tab panel. |
boolean |
isAutoSelect()
Returns true if auto select is enabled. |
boolean |
isCloseContextMenu()
Returns true if close context menu is enabled. |
boolean |
isLayoutRunning()
Returns true if invoked when a class that implements HasLayout
is in the process of laying out it's children. |
boolean |
isOrWasLayoutRunning()
Returns true if invoked when a class that implements HasLayout
is in the process of laying out it's children or has performed a lay out in
the past. |
java.util.Iterator<Widget> |
iterator()
|
void |
onBrowserEvent(Event event)
|
boolean |
remove(int index)
|
boolean |
remove(Widget child)
|
void |
scrollToTab(Widget item,
boolean animate)
Scrolls to a particular tab if tab scrolling is enabled. |
void |
setActiveWidget(IsWidget widget)
Sets the active widget. |
void |
setActiveWidget(Widget item)
Sets the active widget. |
void |
setAnimScroll(boolean animScroll)
True to animate tab scrolling so that hidden tabs slide smoothly into view (defaults to true). |
void |
setAutoSelect(boolean autoSelect)
True to have the first item selected when the panel is displayed for the first time if there is not selection (defaults to true). |
void |
setBodyBorder(boolean bodyBorder)
True to display an interior border on the body element of the panel, false to hide it (defaults to true, pre-render). |
void |
setCloseContextMenu(boolean closeMenu)
True to show the close context menu (defaults to false). |
void |
setMessages(TabPanel.TabPanelMessages messages)
Sets the tab panel messages. |
void |
setMinTabWidth(int minTabWidth)
The minimum width in pixels for each tab when resizeTabs = true
(defaults to 30). |
void |
setResizeTabs(boolean resizeTabs)
True to automatically resize tabs. |
void |
setScrollDuration(int scrollDuration)
Sets the number of milliseconds that each scroll animation should last (defaults to 150). |
void |
setScrollIncrement(int scrollIncrement)
Sets the number of pixels to scroll each time a tab scroll button is pressed (defaults to 100, or if setResizeTabs(boolean) = true, the
calculated tab width). |
void |
setTabMargin(int tabMargin)
The number of pixels of space to calculate into the sizing and scrolling of tabs (defaults to 2). |
void |
setTabScroll(boolean tabScroll)
True to enable scrolling to tabs that may be invisible due to overflowing the overall TabPanel width. |
void |
setTabWidth(int tabWidth)
Sets the initial width in pixels of each new tab (defaults to 120). |
void |
update(Widget widget,
TabItemConfig config)
Updates the appearance of the specified tab item. |
| Methods inherited from class com.google.gwt.user.client.ui.Widget |
|---|
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, getLayoutData, getParent, isAttached, removeFromParent, setLayoutData, sinkEvents |
| Methods inherited from class com.google.gwt.user.client.ui.UIObject |
|---|
addStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getOffsetHeight, getOffsetWidth, getStyleName, getStylePrimaryName, getTitle, isVisible, removeStyleDependentName, removeStyleName, setStyleDependentName, setStyleName, setStyleName, setStylePrimaryName, setTitle, setVisible, sinkBitlessEvent, toString, unsinkEvents |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface com.google.gwt.event.shared.HasHandlers |
|---|
fireEvent |
| Constructor Detail |
|---|
public TabPanel()
public TabPanel(TabPanel.TabPanelAppearance appearance)
appearance - the appearance of the tab panel| Method Detail |
|---|
@UiChild(tagname="child")
public void add(IsWidget widget,
TabItemConfig config)
widget - config - the configuration of the tabpublic void add(Widget w)
add in interface HasWidgets
public void add(Widget widget,
java.lang.String text)
add(Widget, TabItemConfig).
widget - the widget to add to the tab paneltext - the text for the tab
public void add(Widget widget,
TabItemConfig config)
widget - the item to add to the tab panelconfig - the configuration of the tabpublic HandlerRegistration addBeforeCloseHandler(BeforeCloseEvent.BeforeCloseHandler<Widget> handler)
BeforeCloseEvent.HasBeforeCloseHandlersBeforeCloseEvent.BeforeCloseHandler handler for BeforeCloseEvent
events.
addBeforeCloseHandler in interface BeforeCloseEvent.HasBeforeCloseHandlers<Widget>handler - the handler
public HandlerRegistration addBeforeSelectionHandler(BeforeSelectionHandler<Widget> handler)
addBeforeSelectionHandler in interface HasBeforeSelectionHandlers<Widget>public HandlerRegistration addCloseHandler(CloseEvent.CloseHandler<Widget> handler)
CloseEvent.HasCloseHandlersCloseEvent.CloseHandler handler for CloseEvent events.
addCloseHandler in interface CloseEvent.HasCloseHandlers<Widget>handler - the handler
public HandlerRegistration addSelectionHandler(SelectionHandler<Widget> handler)
addSelectionHandler in interface HasSelectionHandlers<Widget>public void clear()
clear in interface HasWidgets
public Widget findItem(java.lang.String id,
boolean checkText)
id - the item idcheckText - true to match the items id and text
public void forceLayout()
HasLayoutHasLayout to lay out its child
widgets.
forceLayout in interface HasLayoutpublic Widget getActiveWidget()
HasActiveWidget
getActiveWidget in interface HasActiveWidgetpublic boolean getAnimScroll()
public boolean getBodyBorder()
public TabItemConfig getConfig(Widget widget)
widget - the widget
public CardLayoutContainer getContainer()
public TabPanel.TabPanelMessages getMessages()
public int getMinTabWidth()
public boolean getResizeTabs()
public int getScrollDuration()
public int getTabMargin()
public boolean getTabScroll()
public int getTabWidth()
public Widget getWidget(int index)
getWidget in interface IndexedPanelpublic int getWidgetCount()
getWidgetCount in interface IndexedPanelpublic int getWidgetIndex(IsWidget child)
getWidgetIndex in interface IndexedPanel.ForIsWidgetpublic int getWidgetIndex(Widget widget)
getWidgetIndex in interface IndexedPanel
public void insert(Widget widget,
int index,
TabItemConfig config)
widget - the item to insertindex - the insert indexconfig - the configuration of the tab itempublic boolean isAutoSelect()
public boolean isCloseContextMenu()
public boolean isLayoutRunning()
HasLayoutHasLayout
is in the process of laying out it's children. Useful in avoiding recursive
lay out operations.
isLayoutRunning in interface HasLayoutpublic boolean isOrWasLayoutRunning()
HasLayoutHasLayout
is in the process of laying out it's children or has performed a lay out in
the past.
isOrWasLayoutRunning in interface HasLayoutpublic java.util.Iterator<Widget> iterator()
iterator in interface HasWidgetsiterator in interface java.lang.Iterable<Widget>public void onBrowserEvent(Event event)
onBrowserEvent in interface EventListeneronBrowserEvent in class Componentpublic boolean remove(int index)
remove in interface IndexedPanelpublic boolean remove(Widget child)
remove in interface HasWidgets
public void scrollToTab(Widget item,
boolean animate)
item - the item to scroll toanimate - true to animate the scrollpublic void setActiveWidget(IsWidget widget)
widget - the widgetpublic void setActiveWidget(Widget item)
HasActiveWidget
setActiveWidget in interface HasActiveWidgetitem - the widgetpublic void setAnimScroll(boolean animScroll)
tabScroll = true.
animScroll - the animation scroll statepublic void setAutoSelect(boolean autoSelect)
autoSelect - the auto select statepublic void setBodyBorder(boolean bodyBorder)
bodyBorder - the body border stylepublic void setCloseContextMenu(boolean closeMenu)
closeMenu - true to show itpublic void setMessages(TabPanel.TabPanelMessages messages)
messages - the messagespublic void setMinTabWidth(int minTabWidth)
resizeTabs = true
(defaults to 30).
minTabWidth - the minimum tab widthpublic void setResizeTabs(boolean resizeTabs)
setTabWidth(int) and setMinTabWidth(int). The
resulting tab width will not be less than the value specified by
setMinTabWidth nor greater than the value specified by
setTabWidth. To automatically resize the tabs to completely
fill the tab strip, use setTabWidth(Integer.MAX_VALUE) and
setResizeTabs(true).
resizeTabs - true to enable tab resizingpublic void setScrollDuration(int scrollDuration)
scrollDuration - the scroll durationpublic void setScrollIncrement(int scrollIncrement)
setResizeTabs(boolean) = true, the
calculated tab width). Only applies when setTabScroll(boolean) =
true.
scrollIncrement - the scroll incrementpublic void setTabMargin(int tabMargin)
tabMargin - the tab marginpublic void setTabScroll(boolean tabScroll)
tabScroll - true to enable tab scrollingpublic void setTabWidth(int tabWidth)
tabWidth - the tab width
public void update(Widget widget,
TabItemConfig config)
widget - the widget for the tab to updateconfig - the new or updated tab item configuration
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||