com.extjs.gxt.ui.client.widget
クラス TabPanel

java.lang.Object
  extended by com.google.gwt.user.client.ui.UIObject
      extended by com.google.gwt.user.client.ui.Widget
          extended by com.extjs.gxt.ui.client.widget.Component
              extended by com.extjs.gxt.ui.client.widget.BoxComponent
                  extended by com.extjs.gxt.ui.client.widget.Container<TabItem>
                      extended by com.extjs.gxt.ui.client.widget.TabPanel
すべての実装インターフェース:
Observable, com.google.gwt.user.client.EventListener

public class TabPanel
extends Container<TabItem>

A basic tab container.

Events:
BeforeSelect : TabPanelEvent(tabPanel, item)
Fires after an item is selected. Listeners can set the doit field to false to cancel the action.
Select : TabPanelEvent(tabPanel, item)
Fires after a item is selected.
BeforeAdd : TabPanelEvent(tabPanel, item, index)
Fires before a item is added or inserted. Listeners can set the doit field to false to cancel the action.
BeforeRemove : TabPanelEvent(tabPanel, item)
Fires before a item is removed. Listeners can set the doit field to false to cancel the action.
Add : TabPanelEvent(tabPanel, item, index)
Fires after a item has been added or inserted.
Remove : TabPanelEvent(tabPanel, item)
Fires after a item has been removed.

 TabPanel panel = new TabPanel();
 panel.resizeTabs = true;
 panel.enableTabScroll = true;
 panel.animScroll = true;

 TabItem item = new TabItem();
 item.closable = true;
 item.setText("Tab Item");

 item.setLayout(new FitLayout());
 item.add(new Label("Test Content"));

 panel.add(item);
 


入れ子クラス 概要
static class TabPanel.TabPosition
          Tab position enumeration.
 
クラス com.google.gwt.user.client.ui.UIObject から継承された 入れ子クラス/インターフェース
com.google.gwt.user.client.ui.UIObject.DebugIdImpl, com.google.gwt.user.client.ui.UIObject.DebugIdImplEnabled
 
Field 概要
static Template itemTemplate
          Default tab item template.
 
クラス com.google.gwt.user.client.ui.UIObject から継承されたフィールド(Fields)
DEBUG_ID_PREFIX
 
コンストラクタ 概要
TabPanel()
          Creates a new tab panel.
 
メソッド 概要
 boolean add(TabItem item)
          Adds a tab item.
 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.
 int getMinTabWidth()
          Returns the minimum tab width.
 boolean getResizeTabs()
          Returns true if tab resizing is enabled.
 int getScrollDuration()
          Returns the scroll duration in millseconds.
 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 isPlain()
          Returns true if the tab strip will be rendered without a background.
 void onComponentEvent(ComponentEvent ce)
          Any events a component receives will be forwarded to this method.
 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 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).
 
クラス com.extjs.gxt.ui.client.widget.Container から継承されたメソッド
findItem, getItem, getItemByItemId, getItemCount, getItems, getWidget, indexOf, iterator, scrollIntoView
 
クラス com.extjs.gxt.ui.client.widget.BoxComponent から継承されたメソッド
getBounds, getHeight, getHeight, getPosition, getShadow, getSize, getWidth, getWidth, isAutoHeight, isAutoWidth, isDeferHeight, isShim, setAutoWidth, setBounds, setBounds, setDeferHeight, setHeight, setHeight, setPagePosition, setPagePosition, setPixelSize, setPosition, setShadow, setShim, setSize, setSize, setWidth, setWidth
 
クラス com.extjs.gxt.ui.client.widget.Component から継承されたメソッド
addListener, addStyleName, addWidgetListener, disable, disableEvents, disableTextSelection, el, enable, enableEvents, fireEvent, fireEvent, fireEvent, fly, focus, getBaseStyle, getBorders, getData, getData, getElement, getId, getItemId, getModel, getState, getToolTip, hide, hideToolTip, isEnabled, isRendered, isVisible, onBrowserEvent, recalculate, removeAllListeners, removeFromParent, removeListener, removeStyleName, removeWidgetListener, render, render, saveState, setBorders, setData, setData, setElement, setEnabled, setEnableState, setId, setIntStyleAttribute, setItemId, setStyleAttribute, setStyleName, setTitle, setToolTip, setToolTip, setVisible, show, toString
 
クラス com.google.gwt.user.client.ui.Widget から継承されたメソッド
getParent, isAttached
 
クラス com.google.gwt.user.client.ui.UIObject から継承されたメソッド
addStyleDependentName, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getOffsetHeight, getOffsetWidth, getStyleName, getStylePrimaryName, getTitle, isVisible, removeStyleDependentName, setStylePrimaryName, setVisible, sinkEvents, unsinkEvents
 
クラス java.lang.Object から継承されたメソッド
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field 詳細

itemTemplate

public static Template itemTemplate
Default tab item template.

コンストラクタ 詳細

TabPanel

public TabPanel()
Creates a new tab panel.

メソッド 詳細

add

public boolean add(TabItem item)
Adds a tab item. Fires the BeforeAdd event before inserting, then fires the Add event after the widget has been inserted.

パラメータ:
item - the item to be added

findItem

public TabItem findItem(java.lang.String id,
                        boolean checkText)
Searches for an item based on its id and optionally the item's text.

パラメータ:
id - the item id
checkText - true to match the items id and text
戻り値:
the item

getAnimScroll

public boolean getAnimScroll()
Returns true if scrolling is animated.

戻り値:
the anim scroll state

getBodyBorder

public boolean getBodyBorder()
Returns true if the body border is enabled.

戻り値:
the body border state

getBorderStyle

public boolean getBorderStyle()
Returns true if the border style is enabled.

戻り値:
the border style

getMinTabWidth

public int getMinTabWidth()
Returns the minimum tab width.

戻り値:
the minimum tab width

getResizeTabs

public boolean getResizeTabs()
Returns true if tab resizing is enabled.

戻り値:
the tab resizing state

getScrollDuration

public int getScrollDuration()
Returns the scroll duration in millseconds.

戻り値:
the duration

getSelectedItem

public TabItem getSelectedItem()
Returns the current selection tab item.

戻り値:
the selected item

getTabMargin

public int getTabMargin()
Returns the panel's tab margin.

戻り値:
the margin

getTabPosition

public TabPanel.TabPosition getTabPosition()
Returns the tab position.

戻り値:
the tab position

getTabScroll

public boolean getTabScroll()
Returns true if tab scrolling is enabled.

戻り値:
the tab scroll state

getTabWidth

public int getTabWidth()
Returns the default tab width.

戻り値:
the width

insert

public boolean insert(TabItem item,
                      int index)
Adds a tab item. Fires the BeforeAdd event before inserting, then fires the Add event after the widget has been inserted.

パラメータ:
item - the item to be inserted
index - the insert position

isAutoSelect

public boolean isAutoSelect()
Returns true if auto select is enabled.

戻り値:
the auto select state

isPlain

public boolean isPlain()
Returns true if the tab strip will be rendered without a background.

戻り値:
the plain state

onComponentEvent

public void onComponentEvent(ComponentEvent ce)
Description copied from class: Component
Any events a component receives will be forwarded to this method. Subclasses should override as needed. The Component.onBrowserEvent(com.google.gwt.user.client.Event) method should not be overridden or modified.

オーバーライド:
onComponentEvent in class Component
パラメータ:
ce - the base event

remove

public boolean remove(TabItem item)
Removes the tab item. Fires the BeforeRemove event before removing, then fires the Remove event after the widget has been removed.

パラメータ:
item - the item to be removed
戻り値:
true if the item was removed

removeAll

public boolean removeAll()
Description copied from class: Container
Removes all the container's items.

オーバーライド:
removeAll in class Container<TabItem>
戻り値:
true if all items where removed

scrollToTab

public void scrollToTab(TabItem item,
                        boolean animate)
Scrolls to a particular tab if tab scrolling is enabled.

パラメータ:
item - the item to scroll to
animate - true to animate the scroll

setAnimScroll

public void setAnimScroll(boolean animScroll)
True to animate tab scrolling so that hidden tabs slide smoothly into view (defaults to true). Only applies when tabScroll = true.

パラメータ:
animScroll - the anim scroll state

setAutoHeight

public void setAutoHeight(boolean autoHeight)
Description copied from class: BoxComponent
Sets the component's auto height value (defaults to false).

オーバーライド:
setAutoHeight in class BoxComponent
パラメータ:
autoHeight - true to enable auto height

setAutoSelect

public 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).

パラメータ:
autoSelect - the auto select state

setBodyBorder

public 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).

パラメータ:
bodyBorder - the body border style

setBorderStyle

public void setBorderStyle(boolean border)
True to display a border around the tabs (defaults to true).

パラメータ:
border - true for borders

setMinTabWidth

public void setMinTabWidth(int minTabWidth)
The minimum width in pixels for each tab when resizeTabs = true (defaults to 30).

パラメータ:
minTabWidth - the minimum tab width

setPlain

public void setPlain(boolean plain)
True to render the tab strip without a background container image (defaults to false, pre-render).

パラメータ:
plain -

setResizeTabs

public void setResizeTabs(boolean resizeTabs)
True to automatically resize each tab so that the tabs will completely fill the tab strip (defaults to false). Setting this to true may cause specific widths that might be set per tab to be overridden in order to fit them all into view (although minTabWidth will always be honored).

パラメータ:
resizeTabs - true to enable tab resizing

setScrollDuration

public void setScrollDuration(int scrollDuration)
Sets the number of milliseconds that each scroll animation should last (defaults to 150).

パラメータ:
scrollDuration - the scroll duration

setScrollIncrement

public 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). Only applies when setTabScroll(boolean) = true.

パラメータ:
scrollIncrement - the scroll increment

setSelection

public void setSelection(TabItem item)
Sets the selected tab item. Fires the BeforeSelect event before selecting, then fires the Select event after the widget has been selected.

パラメータ:
item - the item to be selected

setTabMargin

public void setTabMargin(int tabMargin)
The number of pixels of space to calculate into the sizing and scrolling of tabs (defaults to 2).

パラメータ:
tabMargin - the tab margin

setTabPosition

public void setTabPosition(TabPanel.TabPosition tabPosition)
Sets the position where the tab strip should be rendered (defaults to TOP, pre-render). The only other supported value is BOTTOM. Note that tab scrolling is only supported for position TOP.

パラメータ:
tabPosition - the tab position

setTabScroll

public void setTabScroll(boolean tabScroll)
True to enable scrolling to tabs that may be invisible due to overflowing the overall TabPanel width. Only available with tabs on top. (defaults to false).

パラメータ:
tabScroll - true to enable tab scrolling

setTabWidth

public void setTabWidth(int tabWidth)
Sets the initial width in pixels of each new tab (defaults to 120).

パラメータ:
tabWidth -