com.vaadin.client.ui.
Class VTabsheet
- java.lang.Object
-
- com.google.gwt.user.client.ui.UIObject
-
- com.google.gwt.user.client.ui.Widget
-
- com.google.gwt.user.client.ui.Panel
-
- com.google.gwt.user.client.ui.ComplexPanel
-
- com.vaadin.client.ui.VTabsheetBase
-
- com.vaadin.client.ui.VTabsheet
-
All Implemented Interfaces:
com.google.gwt.event.logical.shared.HasAttachHandlers
,com.google.gwt.event.shared.HasHandlers
,com.google.gwt.user.client.EventListener
,com.google.gwt.user.client.ui.HasEnabled
,com.google.gwt.user.client.ui.HasVisibility
,com.google.gwt.user.client.ui.HasWidgets
,com.google.gwt.user.client.ui.HasWidgets.ForIsWidget
,com.google.gwt.user.client.ui.IndexedPanel
,com.google.gwt.user.client.ui.IndexedPanel.ForIsWidget
,com.google.gwt.user.client.ui.IsWidget
,Focusable
,SubPartAware
,Iterable<com.google.gwt.user.client.ui.Widget>
public class VTabsheet extends VTabsheetBase implements Focusable, SubPartAware
Widget class for the TabSheet component. Displays one child item's contents at a time.
Author:
Vaadin Ltd
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
VTabsheet.PlaceHolder
Deprecated.
as of 7.1, VTabsheet only keeps the active tab in the DOM without any place holders.static class
VTabsheet.Tab
Representation of a single "tab" shown in the
VTabsheet.TabBar
.static class
VTabsheet.TabCaption
Caption implementation for a
VTabsheet.Tab
.-
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
Fields Modifier and Type Field Description static String
CLASSNAME
Default classname for this widget.
com.google.gwt.dom.client.Element
contentNode
For internal use only.
static String
SCROLLER_CLASSNAME
Default classname for the scroller element.
protected VTabsheetPanel
tabPanel
For internal use only.
com.google.gwt.dom.client.Element
tabs
For internal use only.
static String
TABS_CLASSNAME
Default classname for the element that contains tab bar and scroller.
boolean
waitingForResponse
For internal use only.
-
Fields inherited from class com.vaadin.client.ui.VTabsheetBase
activeTabIndex, client, connector, disabled, disabledTabKeys, readonly, tabKeys
-
-
Constructor Summary
Constructors Constructor Description VTabsheet()
Constructs a widget for a TabSheet component.
-
Method Summary
All Methods Modifier and Type Method Description void
blur()
Deprecated.
This method is not called by the framework code anymore.protected void
clearPaintables()
Deprecated.
This method is not called by the framework code anymore.void
focus()
Sets focus to this widget.
ApplicationConnection
getApplicationConnection()
Deprecated.
since 7.2 - use more specific methods instead (getRpcProxy(), getConnectorForWidget(Widget) etc.)protected int
getCloseTabKey()
Returns the key code of the keyboard shortcut that closes the currently focused tab (if closable) in a focused tabsheet.
int
getContentAreaBorderWidth()
For internal use only.
com.google.gwt.user.client.ui.Widget
getCurrentlyDisplayedWidget()
Returns the currently displayed widget in the tab panel.
protected int
getNextTabKey()
Returns the key code of the keyboard shortcut that focuses the next tab in a focused tabsheet.
protected int
getPreviousTabKey()
Returns the key code of the keyboard shortcut that focuses the previous tab in a focused tabsheet.
protected TabsheetServerRpc
getRpcProxy()
Returns the client to server RPC proxy for the tabsheet.
protected int
getSelectTabKey()
Gets the key to select the focused tab when navigating using previous/next (left/right) keys.
com.google.gwt.user.client.Element
getSubPartElement(String subPart)
Locates an element inside a component using the identifier provided in
subPart
.String
getSubPartName(com.google.gwt.user.client.Element subElement)
Provides an identifier that identifies the element within the component.
ComponentConnector
getTab(int index)
Implement in extending classes.
int
getTabCount()
Implement in extending classes.
Iterator<com.google.gwt.user.client.ui.Widget>
getWidgetIterator()
void
handleStyleNames(AbstractComponentState state)
For internal use only.
void
hideTabs()
Makes tab bar invisible.
void
iLayout()
Run internal layouting.
boolean
loadTabSheet(int tabIndex)
Begin loading of the content of a tab of the provided index.
void
onBrowserEvent(com.google.gwt.user.client.Event event)
void
removeTab(int index)
Implement in extending classes.
void
renderContent(com.google.gwt.user.client.ui.Widget newWidget)
Renders the widget content for a tab sheet.
void
renderTab(TabState tabState, int index)
Implement in extending classes.
void
selectTab(int index)
For internal use only.
void
setConnector(AbstractComponentConnector connector)
Sets the connector that should be notified of events etc.
void
setTabIndex(int tabIndex)
For internal use only.
void
showAllTabs()
For internal use only.
void
showTabs()
Makes tab bar visible.
void
tabSizeMightHaveChanged(VTabsheet.Tab tab)
This should be triggered from an onload event within the given tab's caption to signal that icon contents have finished loading.
void
updateContentNodeHeight()
For internal use only.
void
updateDynamicWidth()
For internal use only.
void
updateOpenTabSize()
Sets the size of the visible tab content (component).
-
Methods inherited from class com.vaadin.client.ui.VTabsheetBase
addTabKey, clearTabKeys, getConnectorForWidget, isDynamicHeight, isDynamicWidth, isEnabled, isTabCaptionsAsHtml, setActiveTabIndex, setClient, setEnabled, setReadonly, setTabCaptionsAsHtml
-
Methods inherited from class com.google.gwt.user.client.ui.ComplexPanel
add, add, adjustIndex, checkIndexBoundsForAccess, checkIndexBoundsForInsertion, getChildren, getWidget, getWidgetCount, getWidgetIndex, getWidgetIndex, insert, insert, iterator, remove, remove
-
Methods inherited from class com.google.gwt.user.client.ui.Panel
add, add, adopt, clear, doAttachChildren, doDetachChildren, orphan, remove
-
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, onAttach, onDetach, onLoad, onUnload, removeFromParent, setLayoutData, sinkEvents, unsinkEvents
-
Methods inherited from class com.google.gwt.user.client.ui.UIObject
addStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, getTitle, isVisible, isVisible, onEnsureDebugId, removeStyleDependentName, removeStyleName, resolvePotentialElement, setElement, setElement, setHeight, setPixelSize, setSize, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setTitle, setVisible, setVisible, setWidth, sinkBitlessEvent, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Field Detail
-
CLASSNAME
public static final String CLASSNAME
Default classname for this widget.
See Also:
-
TABS_CLASSNAME
public static final String TABS_CLASSNAME
Default classname for the element that contains tab bar and scroller.
See Also:
-
SCROLLER_CLASSNAME
public static final String SCROLLER_CLASSNAME
Default classname for the scroller element.
See Also:
-
tabs
public final com.google.gwt.dom.client.Element tabs
For internal use only. May be removed or replaced in the future.
Container element for tab bar and 'scroller'.
-
tabPanel
protected final VTabsheetPanel tabPanel
For internal use only. May be removed or replaced in the future.
The content panel that contains the widget of the content component that has been assigned to the selected tab. There should be at most one tab's content widget added to the panel at the same time.
-
contentNode
public final com.google.gwt.dom.client.Element contentNode
For internal use only. May be removed or replaced in the future.
The content wrapper element around the content panel.
-
waitingForResponse
public boolean waitingForResponse
For internal use only. May be removed or replaced in the future.
true
if waiting for a server roundtrip to return after requesting selection change,false
otherwise
-
-
Method Detail
-
setTabIndex
public void setTabIndex(int tabIndex)
For internal use only. May be renamed or removed in a future release.
Sets the tabulator index for the active tab of the tab sheet. The active tab represents the entire tab sheet in the browser's focus cycle (excluding any focusable elements within the content panel).
This value is delegated from the TabsheetState.
Parameters:
tabIndex
- tabulator index for the active tab of the tab sheetSince:
8.1.7
-
loadTabSheet
public boolean loadTabSheet(int tabIndex)
Begin loading of the content of a tab of the provided index. The actual content widget will only be available later, after a server round-trip confirms the selection and switches to send the required child connector. If the tab in the given index is already active, nothing is done.
Parameters:
tabIndex
- The index of the tab to loadReturns:
true
if loading of the specified sheet gets successfully initialized,false
otherwise.
-
getCurrentlyDisplayedWidget
public com.google.gwt.user.client.ui.Widget getCurrentlyDisplayedWidget()
Returns the currently displayed widget in the tab panel.
Returns:
currently displayed content widget
Since:
7.2
-
getRpcProxy
protected TabsheetServerRpc getRpcProxy()
Returns the client to server RPC proxy for the tabsheet.
Returns:
RPC proxy
Since:
7.2
-
getApplicationConnection
@Deprecated public ApplicationConnection getApplicationConnection()
Deprecated.since 7.2 - use more specific methods instead (getRpcProxy(), getConnectorForWidget(Widget) etc.)For internal use only. Avoid using this method directly and use appropriate superclass methods where applicable.
Returns:
ApplicationConnection
-
tabSizeMightHaveChanged
public void tabSizeMightHaveChanged(VTabsheet.Tab tab)
This should be triggered from an onload event within the given tab's caption to signal that icon contents have finished loading. The contents may have changed the tab's width. This might in turn require changes in the scroller (hidden tabs might need to be scrolled back into view), or even the width of the entire tab sheet if it has been configured to be dynamic.
Parameters:
tab
- the tab whose size may have changed
-
onBrowserEvent
public void onBrowserEvent(com.google.gwt.user.client.Event event)
Specified by:
onBrowserEvent
in interfacecom.google.gwt.user.client.EventListener
Overrides:
onBrowserEvent
in classcom.google.gwt.user.client.ui.Widget
-
handleStyleNames
public void handleStyleNames(AbstractComponentState state)
For internal use only. May be removed or replaced in the future.
Parameters:
state
- the state object for this component
-
updateDynamicWidth
public void updateDynamicWidth()
For internal use only. May be removed or replaced in the future.
See Also:
-
renderTab
public void renderTab(TabState tabState, int index)
Description copied from class:
VTabsheetBase
Implement in extending classes. This method should render needed elements and set the visibility of the tab according to the 'visible' parameter. This method should not update the selection, the connector should handle that separately.
Specified by:
renderTab
in classVTabsheetBase
Parameters:
tabState
- shared state of a single tabindex
- the index of that tab
-
renderContent
public void renderContent(com.google.gwt.user.client.ui.Widget newWidget)
Renders the widget content for a tab sheet.
Parameters:
newWidget
- the content widget ornull
if there is none
-
updateContentNodeHeight
public void updateContentNodeHeight()
For internal use only. May be removed or replaced in the future.
-
iLayout
public void iLayout()
Run internal layouting.
-
updateOpenTabSize
public void updateOpenTabSize()
Sets the size of the visible tab content (component). As the tab is set to position: absolute (to work around a firefox flickering bug) we must keep this up-to-date by hand.
For internal use only. May be removed or replaced in the future.
-
showAllTabs
public void showAllTabs()
For internal use only. May be removed or replaced in the future.
-
clearPaintables
@Deprecated protected void clearPaintables()
Deprecated.This method is not called by the framework code anymore.Clears current tabs and contents.
Specified by:
clearPaintables
in classVTabsheetBase
-
getWidgetIterator
public Iterator<com.google.gwt.user.client.ui.Widget> getWidgetIterator()
Specified by:
getWidgetIterator
in classVTabsheetBase
Returns:
a list of currently shown Widgets
-
getContentAreaBorderWidth
public int getContentAreaBorderWidth()
For internal use only. May be removed or replaced in the future.
Returns:
the horizontal width consumed by borders of the content area
-
getTabCount
public int getTabCount()
Description copied from class:
VTabsheetBase
Implement in extending classes. This method should return the number of tabs currently rendered.
Specified by:
getTabCount
in classVTabsheetBase
Returns:
the number of currently rendered tabs
-
getTab
public ComponentConnector getTab(int index)
Description copied from class:
VTabsheetBase
Implement in extending classes. This method should return the connector corresponding to the given index.
Specified by:
getTab
in classVTabsheetBase
Parameters:
index
- the index of the tab whose connector to findReturns:
the connector of the queried tab, or
null
if not found
-
removeTab
public void removeTab(int index)
Description copied from class:
VTabsheetBase
Implement in extending classes. This method should remove the rendered tab with the specified index.
Specified by:
removeTab
in classVTabsheetBase
Parameters:
index
- the index of the tab to remove
-
selectTab
public void selectTab(int index)
Description copied from class:
VTabsheetBase
For internal use only. May be removed or replaced in the future.
Specified by:
selectTab
in classVTabsheetBase
Parameters:
index
- the index of the tab to select
-
focus
public void focus()
Description copied from interface:
Focusable
Sets focus to this widget.
-
blur
@Deprecated public void blur()
Deprecated.This method is not called by the framework code anymore.Removes focus from the active tab.
-
setConnector
public void setConnector(AbstractComponentConnector connector)
Description copied from class:
VTabsheetBase
Sets the connector that should be notified of events etc. For internal use only. This method may be removed or replaced in the future.
Overrides:
setConnector
in classVTabsheetBase
Parameters:
connector
- the connector of this widget
-
getPreviousTabKey
protected int getPreviousTabKey()
Returns the key code of the keyboard shortcut that focuses the previous tab in a focused tabsheet.
Returns:
the key to move focus to the previous tab
-
getSelectTabKey
protected int getSelectTabKey()
Gets the key to select the focused tab when navigating using previous/next (left/right) keys.
Returns:
the key to select the focused tab.
See Also:
-
getNextTabKey
protected int getNextTabKey()
Returns the key code of the keyboard shortcut that focuses the next tab in a focused tabsheet.
Returns:
the key to move focus to the next tab
-
getCloseTabKey
protected int getCloseTabKey()
Returns the key code of the keyboard shortcut that closes the currently focused tab (if closable) in a focused tabsheet.
Returns:
the key to close the current tab
-
showTabs
public void showTabs()
Makes tab bar visible.
Since:
7.2
-
hideTabs
public void hideTabs()
Makes tab bar invisible.
Since:
7.2
-
getSubPartElement
public com.google.gwt.user.client.Element getSubPartElement(String subPart)
Description copied from interface:
SubPartAware
Locates an element inside a component using the identifier provided in
subPart
. ThesubPart
identifier is component specific and may be any string of characters, numbers, space characters and brackets.Specified by:
getSubPartElement
in interfaceSubPartAware
Parameters:
subPart
- The identifier for the element inside the componentReturns:
The element identified by subPart or null if the element could not be found.
-
getSubPartName
public String getSubPartName(com.google.gwt.user.client.Element subElement)
Description copied from interface:
SubPartAware
Provides an identifier that identifies the element within the component. The
subElement
is a part of the component and must never be null.Note!
getSubPartElement(getSubPartName(element)) == element
is not always true. A component can choose to provide a more generic identifier for any given element if the results of all interactions withsubElement
are the same as interactions with the element identified by the return value. For example a button can return an identifier for the root element even though a DIV inside the button was passed assubElement
because interactions with the DIV and the root button element produce the same result.Specified by:
getSubPartName
in interfaceSubPartAware
Parameters:
subElement
- The element the identifier string should uniquely identifyReturns:
An identifier that uniquely identifies
subElement
or null if no identifier could be provided.
-
-