com.vaadin.client.ui.

Class 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
      class  VAccordion.StackItem

      A 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
      • Nested classes/interfaces inherited from interface com.google.gwt.user.client.ui.HasWidgets

        com.google.gwt.user.client.ui.HasWidgets.ForIsWidget
      • Nested classes/interfaces inherited from interface com.google.gwt.user.client.ui.IndexedPanel

        com.google.gwt.user.client.ui.IndexedPanel.ForIsWidget
    • Constructor Summary

      Constructors
      Constructor Description
      VAccordion()

      Constructs a widget for an Accordion.

    • Field Detail

      • selectedItemIndex

        public int selectedItemIndex

        For internal use only. May be removed or replaced in the future.

    • Constructor Detail

      • VAccordion

        public VAccordion()

        Constructs a widget for an Accordion.

    • Method Detail

      • 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 class VTabsheetBase

        Parameters:

        tabState - shared state of a single tab

        index - the index of that tab

      • 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 class VTabsheetBase

        Parameters:

        index - the index of the tab to select

      • setStylePrimaryName

        public void setStylePrimaryName​(String style)

        Overrides:

        setStylePrimaryName in class com.google.gwt.user.client.ui.UIObject

      • setStyleName

        public void setStyleName​(String style)

        Overrides:

        setStyleName in class com.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:

        clearPaintables in class VTabsheetBase

      • getWidgetIterator

        public Iterator<com.google.gwt.user.client.ui.Widget> getWidgetIterator()

        Specified by:

        getWidgetIterator in class VTabsheetBase

        Returns:

        a list of currently shown Widgets

      • 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 class VTabsheetBase

        Returns:

        the number of currently rendered tabs

      • 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 class VTabsheetBase

        Parameters:

        index - the index of the tab to remove

      • 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 class VTabsheetBase

        Parameters:

        index - the index of the tab whose connector to find

        Returns:

        the connector of the queried tab, or null if 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

      • getOpenStackItem

        public VAccordion.StackItem getOpenStackItem()

        Returns the currently open stack item.

        Returns:

        the open stack item, or null if one does not exist