E - the tab widget typepublic class CmsTabbedPanel<E extends com.google.gwt.user.client.ui.Widget>
extends com.google.gwt.user.client.ui.Composite
implements com.alkacon.geranium.client.I_DescendantResizeHandler, java.lang.Iterable<E>
Layout class for a panel with several tabs. The tabbed panel should be set inside a widget with given width and height. For table based layouts the height of the parent cell should be set explicitly. As layout options two height for the tabbar are provided: 32px("standard") and 25px("small").
| 限定符和类型 | 类和说明 |
|---|---|
static class |
CmsTabbedPanel.CmsTabbedPanelStyle
Enumeration with layout keys.
|
protected class |
CmsTabbedPanel.TabPanel
Extending the TabLayoutPanel class to allow height adjustments to the tab bar.
|
| 构造器和说明 |
|---|
CmsTabbedPanel()
The default constructor for an empty tabbed panel.
|
CmsTabbedPanel(CmsTabbedPanel.CmsTabbedPanelStyle tabbedPanelStyle)
The constructor for an empty tabbed panel.
|
| 限定符和类型 | 方法和说明 |
|---|---|
void |
add(E tabContent,
java.lang.String tabName)
Add a new tab with the provided name and content.
|
com.google.gwt.event.shared.HandlerRegistration |
addBeforeSelectionHandler(com.google.gwt.event.logical.shared.BeforeSelectionHandler<java.lang.Integer> handler)
Add the before selection handler to the tabbed panel.
|
void |
addNamed(E tabContent,
java.lang.String tabName,
java.lang.String tabId)
Adds a tab with a user-defined id.
|
com.google.gwt.event.shared.HandlerRegistration |
addSelectionHandler(com.google.gwt.event.logical.shared.SelectionHandler<java.lang.Integer> handler)
Adds a SelectionEvent handler to the tabbed panel.
|
void |
addWithLeftMargin(E tabContent,
java.lang.String tabName)
Add a new tab with the provided name and content and additional left margin.
|
void |
disableTab(E tabContent,
java.lang.String reason)
Disables the tab with the given index.
|
void |
enableTab(E tabContent)
Enables the tab with the given index.
|
int |
getSelectedIndex()
Gets the index of the currently-selected tab.
|
E |
getTabById(java.lang.String tabId)
Finds a tab with a given id.
|
int |
getTabCount()
Gets the number of child widgets in this panel.
|
protected com.google.gwt.user.client.ui.TabLayoutPanel |
getTabPanel()
Returns the tab layout panel.
|
java.lang.String |
getTabText(int pos)
Returns the tab text for a given tab.
|
E |
getWidget(int tabIndex)
Gets the child widget at the specified index.
|
void |
insert(E tabContent,
java.lang.String tabName,
int beforeIndex)
Inserts a widget into the panel.
|
boolean |
isDisabledTab(int tabIndex)
Returns
true if the tab with the given index is disabled, false otherwise. |
java.util.Iterator<E> |
iterator()
Returns an iterator over all tabs.
|
protected void |
onLoad() |
void |
onResizeDescendant() |
void |
removeTab(int tabIndex)
Removes the tab with the given index.
|
void |
selectTab(E tabWidget)
Delegate method.
|
void |
selectTab(E tabWidget,
boolean fireEvent)
Delegate method.
|
void |
selectTab(int tabIndex)
Delegate method.
|
void |
selectTab(int tabIndex,
boolean fireEvent)
Delegate method.
|
void |
setAutoResize(boolean autoResize)
Enables or disables auto-resizing.
|
void |
setAutoResizeHeightDelta(int heightDelta)
Sets a value which is added to the height of a tab content to change the tabbed panel height.
|
protected void |
setOverflowVisibleToContent()
Sets the overflow of the tab layout content's parent to visible.
|
void |
setTabText(int pos,
java.lang.String text)
Sets the text of a given tab.
|
claimElement, getWidget, initializeClaimedElement, initWidget, isAttached, onAttach, onBrowserEvent, onDetach, render, render, resolvePotentialElement, setWidgetaddAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, doAttachChildren, doDetachChildren, fireEvent, getHandlerCount, getLayoutData, getParent, isOrWasAttached, onUnload, removeFromParent, setLayoutData, sinkEventsaddStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, getTitle, isVisible, isVisible, onEnsureDebugId, removeStyleDependentName, removeStyleName, setElement, setElement, setHeight, setPixelSize, setSize, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setTitle, setVisible, setVisible, setWidth, sinkBitlessEvent, toString, unsinkEventspublic CmsTabbedPanel()
public CmsTabbedPanel(CmsTabbedPanel.CmsTabbedPanelStyle tabbedPanelStyle)
tabbedPanelStyle - the pre-defined height of the tabbar, can be "small" or "standard"public void add(E tabContent, java.lang.String tabName)
Wrapper function for TabLayoutPanel.add(Widget, String)
tabContent - the widget to add as a tabtabName - the name of the tab to display in the tabbarpublic com.google.gwt.event.shared.HandlerRegistration addBeforeSelectionHandler(com.google.gwt.event.logical.shared.BeforeSelectionHandler<java.lang.Integer> handler)
Wrapper function for TabLayoutPanel.addBeforeSelectionHandler(BeforeSelectionHandler)
handler - the before selection handlerpublic void addNamed(E tabContent, java.lang.String tabName, java.lang.String tabId)
tabContent - tabName - tabId - public com.google.gwt.event.shared.HandlerRegistration addSelectionHandler(com.google.gwt.event.logical.shared.SelectionHandler<java.lang.Integer> handler)
Wrapper function for TabLayoutPanel.addSelectionHandler(SelectionHandler)
handler - the selection handlerpublic void addWithLeftMargin(E tabContent, java.lang.String tabName)
tabContent - the widget to add as a tabtabName - the name of the tab to display in the tabbarpublic void disableTab(E tabContent, java.lang.String reason)
tabContent - the content of the tab that should be disabledreason - the reason why the tab is disabledpublic void enableTab(E tabContent)
tabContent - the content of the tab that should be enabledpublic int getSelectedIndex()
Wrapper function for TabLayoutPanel.getSelectedIndex()
public E getTabById(java.lang.String tabId)
tabId - a tab idpublic int getTabCount()
Wrapper function for TabLayoutPanel.getWidgetCount()
public java.lang.String getTabText(int pos)
pos - the index of the tabpublic E getWidget(int tabIndex)
Wrapper function for TabLayoutPanel.getWidget(int)
tabIndex - the child widget's indexpublic void insert(E tabContent, java.lang.String tabName, int beforeIndex)
Wrapper function for TabLayoutPanel.insert(Widget, String, int)
tabContent - the widget to be addedtabName - the text to be shown on its tabbeforeIndex - the index before which it will be insertedpublic boolean isDisabledTab(int tabIndex)
true if the tab with the given index is disabled, false otherwise.tabIndex - the tab indextrue if the tab with the given index is disabled, false otherwisepublic java.util.Iterator<E> iterator()
iterator 在接口中 java.lang.Iterable<E extends com.google.gwt.user.client.ui.Widget>public void onResizeDescendant()
onResizeDescendant 在接口中 com.alkacon.geranium.client.I_DescendantResizeHandlerI_DescendantResizeHandler.onResizeDescendant()public void removeTab(int tabIndex)
tabIndex - the index of the tab which should be removedpublic void selectTab(E tabWidget)
tabWidget - the tab widget to selectTabLayoutPanel.selectTab(Widget index)public void selectTab(E tabWidget, boolean fireEvent)
tabWidget - the tab widget to selectfireEvent - true to fire the tab eventTabLayoutPanel.selectTab(Widget index)public void selectTab(int tabIndex)
tabIndex - the index of the tab to be selectedTabLayoutPanel.selectTab(int index)public void selectTab(int tabIndex,
boolean fireEvent)
tabIndex - the index of the tab to be selectedfireEvent - true to fire the tab eventTabLayoutPanel.selectTab(int index)public void setAutoResize(boolean autoResize)
autoResize - the auto resize flag valuepublic void setAutoResizeHeightDelta(int heightDelta)
heightDelta - the height differencepublic void setTabText(int pos,
java.lang.String text)
pos - the index of the tabtext - the new text for the tabprotected com.google.gwt.user.client.ui.TabLayoutPanel getTabPanel()
protected void onLoad()
onLoad 在类中 com.google.gwt.user.client.ui.WidgetWidget.onLoad()protected void setOverflowVisibleToContent()