Package com.vaadin.client.ui
Class VAccordion
- 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.VAccordion
-
- 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,Iterable<com.google.gwt.user.client.ui.Widget>
public class VAccordion extends VTabsheetBase
Widget class for the Accordion component. Displays one child item's contents at a time.- Author:
- Vaadin Ltd
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classVAccordion.StackItemA StackItem has always two children, Child 0 is a VCaption, Child 1 is the actual child widget.-
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 StringCLASSNAMEDefault classname for this widget.intselectedItemIndexFor internal use only.-
Fields inherited from class com.vaadin.client.ui.VTabsheetBase
activeTabIndex, client, connector, disabled, disabledTabKeys, readonly, tabKeys
-
-
Constructor Summary
Constructors Constructor Description VAccordion()Constructs a widget for an Accordion.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected voidclearPaintables()Deprecated.This method is not called by the framework code anymore.voidclose(VAccordion.StackItem item)For internal use only.VAccordion.StackItemgetOpenStackItem()Returns the currently open stack item.VAccordion.StackItemgetStackItem(int index)For internal use only.Iterable<VAccordion.StackItem>getStackItems()Returns an iterable over all the stack items.ComponentConnectorgetTab(int index)Implement in extending classes.intgetTabCount()Implement in extending classes.Iterator<com.google.gwt.user.client.ui.Widget>getWidgetIterator()voidonSelectTab(VAccordion.StackItem item)Handle stack item selection.voidopen(int itemIndex)For internal use only.voidremoveTab(int index)Implement in extending classes.voidrenderTab(TabState tabState, int index)Implement in extending classes.voidselectTab(int index)For internal use only.voidsetStyleName(String style)voidsetStylePrimaryName(String style)voidsetTabIndex(int tabIndex)For internal use only.protected voidupdateStyleNames(String primaryStyleName)Updates the primary style name base for all stack items.-
Methods inherited from class com.vaadin.client.ui.VTabsheetBase
addTabKey, clearTabKeys, getConnectorForWidget, isDynamicHeight, isDynamicWidth, isEnabled, isTabCaptionsAsHtml, setActiveTabIndex, setClient, setConnector, 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, onBrowserEvent, 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, 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:
- Constant Field Values
-
selectedItemIndex
public int selectedItemIndex
For internal use only. May be removed or replaced in the future.
-
-
Method Detail
-
renderTab
public void renderTab(TabState tabState, int index)
Description copied from class:VTabsheetBaseImplement 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:
renderTabin classVTabsheetBase- Parameters:
tabState- shared state of a single tabindex- the index of that tab
-
selectTab
public void selectTab(int index)
Description copied from class:VTabsheetBaseFor internal use only. May be removed or replaced in the future.- Specified by:
selectTabin classVTabsheetBase- Parameters:
index- the index of the tab to select
-
setStylePrimaryName
public void setStylePrimaryName(String style)
- Overrides:
setStylePrimaryNamein classcom.google.gwt.user.client.ui.UIObject
-
setStyleName
public void setStyleName(String style)
- Overrides:
setStyleNamein classcom.google.gwt.user.client.ui.UIObject
-
updateStyleNames
protected void updateStyleNames(String primaryStyleName)
Updates the primary style name base for all stack items.- Parameters:
primaryStyleName- the new primary style name base
-
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 stack item. The active stack item represents the entire accordion in the browser's focus cycle (excluding any focusable elements within the content panel).
This value is delegated from the TabsheetState via AccordionState.
- Parameters:
tabIndex- tabulator index for the open stack item- Since:
- 8.1.7
-
open
public void open(int itemIndex)
For internal use only. May be removed or replaced in the future.- Parameters:
itemIndex- the index of the stack item to open
-
close
public void close(VAccordion.StackItem item)
For internal use only. May be removed or replaced in the future.- Parameters:
item- the stack item to close
-
onSelectTab
public void onSelectTab(VAccordion.StackItem item)
Handle stack item selection.- Parameters:
item- the selected stack item
-
clearPaintables
@Deprecated protected void clearPaintables()
Deprecated.This method is not called by the framework code anymore.Clears current tabs and contents.- Specified by:
clearPaintablesin classVTabsheetBase
-
getWidgetIterator
public Iterator<com.google.gwt.user.client.ui.Widget> getWidgetIterator()
- Specified by:
getWidgetIteratorin classVTabsheetBase- Returns:
- a list of currently shown Widgets
-
getTabCount
public int getTabCount()
Description copied from class:VTabsheetBaseImplement in extending classes. This method should return the number of tabs currently rendered.- Specified by:
getTabCountin classVTabsheetBase- Returns:
- the number of currently rendered tabs
-
removeTab
public void removeTab(int index)
Description copied from class:VTabsheetBaseImplement in extending classes. This method should remove the rendered tab with the specified index.- Specified by:
removeTabin classVTabsheetBase- Parameters:
index- the index of the tab to remove
-
getTab
public ComponentConnector getTab(int index)
Description copied from class:VTabsheetBaseImplement in extending classes. This method should return the connector corresponding to the given index.- Specified by:
getTabin classVTabsheetBase- Parameters:
index- the index of the tab whose connector to find- Returns:
- the connector of the queried tab, or
nullif not found
-
getStackItem
public VAccordion.StackItem getStackItem(int index)
For internal use only. May be removed or replaced in the future.- Parameters:
index- the index of the stack item to get- Returns:
- the stack item
-
getStackItems
public Iterable<VAccordion.StackItem> getStackItems()
Returns an iterable over all the stack items.- Returns:
- the iterable
-
getOpenStackItem
public VAccordion.StackItem getOpenStackItem()
Returns the currently open stack item.- Returns:
- the open stack item, or
nullif one does not exist
-
-