|
|||||||||
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.extjs.gxt.ui.client.widget.Component
com.extjs.gxt.ui.client.widget.BoxComponent
com.extjs.gxt.ui.client.widget.Container<TabItem>
com.extjs.gxt.ui.client.widget.TabPanel
public class TabPanel
A basic tab container.
TabPanel panel = new TabPanel(); panel.setResizeTabs(true); panel.setEnableTabScroll(true); panel.setAnimScroll(true); TabItem item = new TabItem(); item.setClosable(true); item.setText("Tab Item"); item.setLayout(new FitLayout()); item.add(new Label("Test Content")); panel.add(item);
BaseEvent.setCancelled(boolean)
.BaseEvent.setCancelled(boolean)
.BaseEvent.setCancelled(boolean)
.
Nested Class Summary | |
---|---|
class |
TabPanel.TabPanelMessages
TabPanel messages. |
static class |
TabPanel.TabPosition
Tab position enumeration. |
Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.UIObject |
---|
com.google.gwt.user.client.ui.UIObject.DebugIdImpl, com.google.gwt.user.client.ui.UIObject.DebugIdImplEnabled |
Field Summary | |
---|---|
protected Menu |
closeContextMenu
|
static Template |
itemTemplate
Default tab item template. |
Fields inherited from class com.extjs.gxt.ui.client.widget.Container |
---|
attachChildren, enableLayout, layoutExecuted, layoutNeeded, layoutOnAttach, layoutOnChange |
Fields inherited from class com.extjs.gxt.ui.client.widget.BoxComponent |
---|
adjustSize, cacheSizes, ensureVisibilityOnSizing, height, lastSize, layer, shim, width |
Fields inherited from class com.extjs.gxt.ui.client.widget.Component |
---|
afterRender, attachables, baseStyle, disabled, disabledStyle, disableTextSelection, dummy, focusable, hidden, mask, maskMessage, maskMessageStyleName, monitorWindowResize, rendered, resizeHandler, setElementRender, stateId, swallowEvents, toolTip, windowResizeDelay, windowResizeTask |
Fields inherited from class com.google.gwt.user.client.ui.UIObject |
---|
DEBUG_ID_PREFIX |
Constructor Summary | |
---|---|
TabPanel()
Creates a new tab panel. |
Method Summary | |
---|---|
boolean |
add(TabItem item)
Adds a tab item. |
protected void |
close(TabItem item)
|
protected ComponentEvent |
createComponentEvent(com.google.gwt.user.client.Event event)
|
protected ContainerEvent |
createContainerEvent(TabItem item)
|
protected void |
doAttachChildren()
|
protected void |
doDetachChildren()
|
TabItem |
findItem(java.lang.String id,
boolean checkText)
Searches for an item based on its id and optionally the item's text. |
boolean |
getAnimScroll()
Returns true if scrolling is animated. |
boolean |
getBodyBorder()
Returns true if the body border is enabled. |
boolean |
getBorderStyle()
Returns true if the border style is enabled. |
CardLayout |
getLayout()
|
El |
getLayoutTarget()
Returns the container's layout target. |
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. |
TabItem |
getSelectedItem()
Returns the current selection tab item. |
int |
getTabMargin()
Returns the panel's tab margin. |
TabPanel.TabPosition |
getTabPosition()
Returns the tab position. |
boolean |
getTabScroll()
Returns true if tab scrolling is enabled. |
int |
getTabWidth()
Returns the default tab width. |
boolean |
insert(TabItem item,
int index)
Adds a tab item. |
boolean |
isAutoSelect()
Returns true if auto select is enabled. |
boolean |
isCloseContextMenu()
Returns true if close context menu is enabled. |
boolean |
isDeferredRender()
Returns true if children items are rendered when first accessed. |
boolean |
isPlain()
Returns true if the tab strip will be rendered without a background. |
protected void |
onAfterLayout()
|
protected void |
onAttach()
|
protected void |
onBlur(ComponentEvent ce)
|
void |
onComponentEvent(ComponentEvent ce)
Any events a component receives will be forwarded to this method. |
protected void |
onDetach()
|
protected void |
onFocus(ComponentEvent ce)
|
protected void |
onInsert(TabItem item,
int index)
|
protected void |
onItemContextMenu(TabItem item,
int x,
int y)
|
protected void |
onItemTextChange(TabItem tabItem,
java.lang.String oldText,
java.lang.String newText)
|
protected void |
onKeyPress(ComponentEvent ce)
|
protected void |
onLeft(ComponentEvent ce)
|
protected void |
onRemove(TabItem item)
|
protected void |
onRender(com.google.gwt.user.client.Element target,
int index)
Subclasses must override and ensure setElement is called for lazy rendered components. |
protected void |
onResize(int width,
int height)
Called after the component is resized, this method is empty by default but can be implemented by any subclass that needs to perform custom logic after a resize occurs. |
protected void |
onRight(ComponentEvent ce)
|
protected void |
onUnload()
|
boolean |
remove(TabItem item)
Removes the tab item. |
boolean |
removeAll()
Removes all the container's items. |
void |
scrollToTab(TabItem item,
boolean animate)
Scrolls to a particular tab if tab scrolling is enabled. |
void |
setAnimScroll(boolean animScroll)
True to animate tab scrolling so that hidden tabs slide smoothly into view (defaults to true). |
void |
setAutoHeight(boolean autoHeight)
Sets the component's auto height value (defaults to false). |
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 |
setBorderStyle(boolean border)
True to display a border around the tabs (defaults to true). |
void |
setCloseContextMenu(boolean closeMenu)
True to show the close context menu (defaults to false). |
void |
setDeferredRender(boolean deferredRender)
True to render each child tab item when it accessed, false to render all (defaults to true). |
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 |
setPlain(boolean plain)
True to render the tab strip without a background container image (defaults to false, pre-render). |
void |
setResizeTabs(boolean resizeTabs)
True to automatically resize each tab so that the tabs will completely fill the tab strip (defaults to false). |
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 |
setSelection(TabItem item)
Sets the selected tab item. |
void |
setTabMargin(int tabMargin)
The number of pixels of space to calculate into the sizing and scrolling of tabs (defaults to 2). |
void |
setTabPosition(TabPanel.TabPosition tabPosition)
Sets the position where the tab strip should be rendered (defaults to TOP, pre-render). |
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). |
Methods inherited from class com.extjs.gxt.ui.client.widget.Container |
---|
adjustIndex, adopt, disable, doLayout, doLayout, enable, findItem, getItem, getItemByItemId, getItemCount, getItems, getWidget, indexOf, isLayoutNeeded, iterator, layout, layout, notifyHide, notifyShow, onBeforeLayoutExcecuted, onLayoutExcecuted, orphan, remove, removeAll, scrollIntoView, setLayout, setLayoutNeeded, setLayoutOnChange, wrapWidget |
Methods inherited from class com.extjs.gxt.ui.client.widget.BoxComponent |
---|
adjustPosition, adjustSize, afterRender, getBounds, getHeight, getHeight, getPosition, getPositionEl, getResizeEl, getShadow, getShadowOffset, getShadowPosition, getSize, getWidth, getWidth, hideShadow, hideShim, hideUnders, isAutoHeight, isAutoWidth, isDeferHeight, isShim, onHide, onPosition, onShow, setAutoWidth, setBounds, setBounds, setDeferHeight, setHeight, setHeight, setPagePosition, setPagePosition, setPixelSize, setPosition, setShadow, setShadowOffset, setShadowPosition, setShim, setSize, setSize, setWidth, setWidth, sync, syncSize |
Methods inherited from class com.google.gwt.user.client.ui.Widget |
---|
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, fireEvent, getHandlerCount, getLayoutData, getParent, isAttached, isOrWasAttached, setLayoutData |
Methods inherited from class com.google.gwt.user.client.ui.UIObject |
---|
addStyleDependentName, ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getOffsetHeight, getOffsetWidth, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, isVisible, removeStyleDependentName, setElement, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setVisible, sinkBitlessEvent, unsinkEvents |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static Template itemTemplate
protected Menu closeContextMenu
Constructor Detail |
---|
public TabPanel()
Method Detail |
---|
public boolean add(TabItem item)
add
in class Container<TabItem>
item
- the item to be addedpublic TabItem findItem(java.lang.String id, boolean checkText)
id
- the item idcheckText
- true to match the items id and text
public boolean getAnimScroll()
public boolean getBodyBorder()
public boolean getBorderStyle()
public CardLayout getLayout()
getLayout
in class Container<TabItem>
public El getLayoutTarget()
Container
getLayoutTarget
in class Container<TabItem>
public TabPanel.TabPanelMessages getMessages()
public int getMinTabWidth()
public boolean getResizeTabs()
public int getScrollDuration()
public TabItem getSelectedItem()
public int getTabMargin()
public TabPanel.TabPosition getTabPosition()
public boolean getTabScroll()
public int getTabWidth()
public boolean insert(TabItem item, int index)
insert
in class Container<TabItem>
item
- the item to be insertedindex
- the insert positionpublic boolean isAutoSelect()
public boolean isCloseContextMenu()
public boolean isDeferredRender()
public boolean isPlain()
public void onComponentEvent(ComponentEvent ce)
Component
Component.onBrowserEvent(com.google.gwt.user.client.Event)
method
should not be overridden or modified.
onComponentEvent
in class Component
ce
- the base eventpublic boolean remove(TabItem item)
remove
in class Container<TabItem>
item
- the item to be removed
true
if the item was removedpublic boolean removeAll()
Container
removeAll
in class Container<TabItem>
public void scrollToTab(TabItem item, boolean animate)
item
- the item to scroll toanimate
- true to animate the scrollpublic void setAnimScroll(boolean animScroll)
tabScroll
= true.
animScroll
- the anim scroll statepublic void setAutoHeight(boolean autoHeight)
BoxComponent
setAutoHeight
in class BoxComponent
autoHeight
- true to enable auto heightpublic void setAutoSelect(boolean autoSelect)
autoSelect
- the auto select statepublic void setBodyBorder(boolean bodyBorder)
bodyBorder
- the body border stylepublic void setBorderStyle(boolean border)
border
- true for borderspublic void setCloseContextMenu(boolean closeMenu)
closeMenu
- true to show itpublic void setDeferredRender(boolean deferredRender)
deferredRender
- true to defer renderingpublic void setMessages(TabPanel.TabPanelMessages messages)
messages
- the messagespublic void setMinTabWidth(int minTabWidth)
resizeTabs
= true
(defaults to 30).
minTabWidth
- the minimum tab widthpublic void setPlain(boolean plain)
plain
- public void setResizeTabs(boolean resizeTabs)
minTabWidth
will always be honored).
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 setSelection(TabItem item)
item
- the item to be selectedpublic void setTabMargin(int tabMargin)
tabMargin
- the tab marginpublic void setTabPosition(TabPanel.TabPosition tabPosition)
tabPosition
- the tab positionpublic void setTabScroll(boolean tabScroll)
tabScroll
- true to enable tab scrollingpublic void setTabWidth(int tabWidth)
tabWidth
- protected void close(TabItem item)
protected ComponentEvent createComponentEvent(com.google.gwt.user.client.Event event)
createComponentEvent
in class BoxComponent
protected ContainerEvent createContainerEvent(TabItem item)
createContainerEvent
in class Container<TabItem>
protected void doAttachChildren()
doAttachChildren
in class Container<TabItem>
protected void doDetachChildren()
doDetachChildren
in class Container<TabItem>
protected void onAfterLayout()
onAfterLayout
in class Container<TabItem>
protected void onAttach()
onAttach
in class Container<TabItem>
protected void onBlur(ComponentEvent ce)
protected void onDetach()
onDetach
in class Component
protected void onFocus(ComponentEvent ce)
protected void onInsert(TabItem item, int index)
onInsert
in class Container<TabItem>
protected void onItemContextMenu(TabItem item, int x, int y)
protected void onItemTextChange(TabItem tabItem, java.lang.String oldText, java.lang.String newText)
protected void onKeyPress(ComponentEvent ce)
protected void onLeft(ComponentEvent ce)
protected void onRemove(TabItem item)
onRemove
in class Container<TabItem>
protected void onRender(com.google.gwt.user.client.Element target, int index)
Component
onRender
in class Component
target
- the target elementindex
- the insert locationprotected void onResize(int width, int height)
BoxComponent
onResize
in class BoxComponent
width
- the widthheight
- the heightprotected void onRight(ComponentEvent ce)
protected void onUnload()
onUnload
in class BoxComponent
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |