public static class VTabsheet.Tab
extends com.google.gwt.user.client.ui.SimplePanel
implements com.google.gwt.event.dom.client.HasFocusHandlers, com.google.gwt.event.dom.client.HasBlurHandlers, com.google.gwt.event.dom.client.HasMouseDownHandlers, com.google.gwt.event.dom.client.HasKeyDownHandlers
TabBar.| Modifier and Type | Method and Description |
|---|---|
com.google.gwt.event.shared.HandlerRegistration |
addBlurHandler(com.google.gwt.event.dom.client.BlurHandler handler) |
void |
addClickHandler(com.google.gwt.event.dom.client.ClickHandler handler)
Adds a
ClickEvent handler to the tab caption. |
com.google.gwt.event.shared.HandlerRegistration |
addFocusHandler(com.google.gwt.event.dom.client.FocusHandler handler) |
com.google.gwt.event.shared.HandlerRegistration |
addKeyDownHandler(com.google.gwt.event.dom.client.KeyDownHandler handler) |
com.google.gwt.event.shared.HandlerRegistration |
addMouseDownHandler(com.google.gwt.event.dom.client.MouseDownHandler handler) |
void |
blur()
Removes focus from the tab.
|
void |
focus()
Scrolls the tab into view and focuses it.
|
protected com.google.gwt.user.client.Element |
getContainerElement() |
VTabsheet |
getTabsheet()
Returns the tab sheet instance where this tab is attached to.
|
TooltipInfo |
getTooltipInfo()
Returns the tab caption's tooltip info if it has been configured.
|
boolean |
hasTooltip()
Returns whether the tab caption has a configured tooltip or not.
|
boolean |
isClosable()
Returns whether the tab can be closed or not.
|
boolean |
isEnabledOnServer()
Returns whether the tab is enabled on server (there is no client-side
disabling, but the naming convention matches
isHiddenOnServer()). |
boolean |
isHiddenOnServer()
Returns whether the tab is hidden on server (as opposed to simply
hidden because it's scrolled out of view).
|
void |
onClose()
Handles a request to close this tab.
|
void |
recalculateCaptionWidth()
Recalculates the required caption width and sets it as the new width.
|
void |
removeAssistiveDescription()
Removes the
aria-describedby attribute from this tab element. |
void |
setAssistiveDescription(String descriptionId)
Sets the
aria-describedby attribute for this tab element to
the referenced id. |
void |
setCloseHandler(com.vaadin.client.ui.VTabsheet.VCloseHandler closeHandler)
Sets the close handler for this tab.
|
void |
setEnabledOnServer(boolean enabled)
Set tab enabled state on server (there is no client-side disabling,
but the naming convention matches
setHiddenOnServer(boolean)). |
void |
setHiddenOnServer(boolean hiddenOnServer)
Set tab hidden state on server (as opposed to simply hidden because
it's scrolled out of view).
|
void |
setStyleNames(boolean selected,
boolean first)
Toggles the style names for the Tab.
|
void |
setStyleNames(boolean selected,
boolean first,
boolean keyboardFocus)
Sets the style names for this tab according to the given parameters.
|
void |
setTabulatorIndex(int tabIndex)
Sets the index that represents the tab's position in the browser's
focus cycle.
|
add, getWidget, iterator, remove, setWidget, setWidgetadd, adopt, clear, doAttachChildren, doDetachChildren, orphan, removeaddAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, fireEvent, getHandlerCount, getLayoutData, getParent, isAttached, isOrWasAttached, onAttach, onBrowserEvent, onDetach, onLoad, onUnload, removeFromParent, setLayoutData, sinkEvents, unsinkEventsaddStyleDependentName, 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, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitforEach, spliteratorpublic boolean isHiddenOnServer()
true if hidden on server, false otherwisepublic void setHiddenOnServer(boolean hiddenOnServer)
hiddenOnServer - true if hidden on server, false otherwiseprotected com.google.gwt.user.client.Element getContainerElement()
getContainerElement in class com.google.gwt.user.client.ui.SimplePanelpublic boolean isEnabledOnServer()
isHiddenOnServer()).true if enabled on server, false otherwisepublic void setEnabledOnServer(boolean enabled)
setHiddenOnServer(boolean)).enabled - true if enabled on server, false otherwisepublic void addClickHandler(com.google.gwt.event.dom.client.ClickHandler handler)
ClickEvent handler to the tab caption.handler - the click handlerpublic void setCloseHandler(com.vaadin.client.ui.VTabsheet.VCloseHandler closeHandler)
closeHandler - the close handlerVTabsheet.getCloseTabKey()public void setStyleNames(boolean selected,
boolean first)
selected - true if the Tab is selected, false
otherwisefirst - true if the Tab is the first visible Tab,
false otherwisepublic void setStyleNames(boolean selected,
boolean first,
boolean keyboardFocus)
selected - true if the tab is selected, false
otherwisefirst - true if the tab is the first one from the left,
false otherwisekeyboardFocus - true if the tab should display keyboard navigation
focus styles, false otherwise -- the focus style
name is used by the compatibility themes like
reindeer (valo relies on :focus
pseudo-class)public void setTabulatorIndex(int tabIndex)
By default only the selected tab has a non-negative tabulator index, and represents the entire tab sheet. If there are any other navigable tabs in the same tab sheet those can be navigated into with next/previous buttons, which does not update the selection until confirmed with a selection key press.
tabIndex - the tabulator indexVTabsheet.getNextTabKey(),
VTabsheet.getPreviousTabKey(),
VTabsheet.getSelectTabKey()public boolean isClosable()
true if the tab is closable, false otherwiseVTabsheet.TabCaption.setClosable(boolean)public void onClose()
isClosable()public VTabsheet getTabsheet()
public void recalculateCaptionWidth()
public com.google.gwt.event.shared.HandlerRegistration addFocusHandler(com.google.gwt.event.dom.client.FocusHandler handler)
addFocusHandler in interface com.google.gwt.event.dom.client.HasFocusHandlerspublic com.google.gwt.event.shared.HandlerRegistration addBlurHandler(com.google.gwt.event.dom.client.BlurHandler handler)
addBlurHandler in interface com.google.gwt.event.dom.client.HasBlurHandlerspublic com.google.gwt.event.shared.HandlerRegistration addMouseDownHandler(com.google.gwt.event.dom.client.MouseDownHandler handler)
addMouseDownHandler in interface com.google.gwt.event.dom.client.HasMouseDownHandlerspublic com.google.gwt.event.shared.HandlerRegistration addKeyDownHandler(com.google.gwt.event.dom.client.KeyDownHandler handler)
addKeyDownHandler in interface com.google.gwt.event.dom.client.HasKeyDownHandlerspublic void focus()
public void blur()
public boolean hasTooltip()
true if the tab caption has a tooltip, false
otherwisepublic TooltipInfo getTooltipInfo()
null if no tooltip configuration
foundpublic void setAssistiveDescription(String descriptionId)
aria-describedby attribute for this tab element to
the referenced id. This should be called when this tab receives focus
and has a tooltip configured.descriptionId - the unique id of the tooltip elementpublic void removeAssistiveDescription()
aria-describedby attribute from this tab element.
This should be called when this tab loses focus.Copyright © 2023 Vaadin Ltd. All rights reserved.