com.vaadin.client.ui.

Class VListSelect

  • java.lang.Object
    • com.google.gwt.user.client.ui.UIObject
      • com.google.gwt.user.client.ui.Widget
        • com.google.gwt.user.client.ui.Composite
          • com.vaadin.client.ui.VListSelect
  • 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.IsRenderable, com.google.gwt.user.client.ui.IsWidget, AbstractMultiSelectConnector.MultiSelectWidget, Focusable, Field

    public class VListSelect
    extends com.google.gwt.user.client.ui.Composite
    implements Field, Focusable, com.google.gwt.user.client.ui.HasEnabled, AbstractMultiSelectConnector.MultiSelectWidget

    A simple list select for selecting multiple items.

    Author:

    Vaadin Ltd

    • Nested Class Summary

      • 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
      protected com.google.gwt.user.client.ui.FlowPanel container

      Container for select.

      protected com.google.gwt.user.client.ui.ListBox select

      The select component.

      • Fields inherited from class com.google.gwt.user.client.ui.UIObject

        DEBUG_ID_PREFIX
    • Constructor Summary

      Constructors
      Constructor Description
      VListSelect()

      Constructs a simple ListSelect widget in multiselect mode.

    • Method Summary

      All Methods
      Modifier and Type Method Description
      Registration addSelectionChangeListener​(BiConsumer<Set<String>,​Set<String>> listener)

      Adds a selection change listener the select.

      void focus()

      Sets focus to this widget.

      int getRows()

      Returns the number of visible items for the list select.

      protected FastStringSet getSelectedItems()

      Gets the currently selected item values.

      int getTabIndex()

      Gets the tab index.

      boolean isEnabled()  
      boolean isReadOnly()

      Returns true if this select is in read only mode, false if not.

      void setEnabled​(boolean enabled)  
      void setHeight​(String height)  
      void setItems​(List<elemental.json.JsonObject> items)

      Sets the given items to the select.

      void setReadOnly​(boolean readOnly)

      Sets this select as read only, meaning selection cannot be changed.

      void setRows​(int rows)

      Sets the number of visible items for the list select.

      void setStylePrimaryName​(String style)  
      void setTabIndex​(int tabIndex)

      Sets the tab index.

      void setWidth​(String width)  
      • Methods inherited from class com.google.gwt.user.client.ui.Composite

        claimElement, getWidget, initializeClaimedElement, initWidget, isAttached, onAttach, onBrowserEvent, onDetach, render, render, resolvePotentialElement, setWidget
      • Methods inherited from class com.google.gwt.user.client.ui.Widget

        addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, doAttachChildren, doDetachChildren, fireEvent, getHandlerCount, getLayoutData, getParent, isOrWasAttached, 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, setElement, setElement, setPixelSize, setSize, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setTitle, setVisible, setVisible, sinkBitlessEvent, toString
    • Field Detail

      • container

        protected final com.google.gwt.user.client.ui.FlowPanel container

        Container for select. Kept for DOM backwards compatibility.

      • select

        protected final com.google.gwt.user.client.ui.ListBox select

        The select component.

    • Constructor Detail

      • VListSelect

        public VListSelect()

        Constructs a simple ListSelect widget in multiselect mode.

    • Method Detail

      • setStylePrimaryName

        public void setStylePrimaryName​(String style)

        Overrides:

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

      • setRows

        public void setRows​(int rows)

        Sets the number of visible items for the list select.

        Parameters:

        rows - the number of items to show

        See Also:

        ListBox.setVisibleItemCount(int)

      • getRows

        public int getRows()

        Returns the number of visible items for the list select.

        Returns:

        the number of items to show

        See Also:

        ListBox.setVisibleItemCount(int)

      • getSelectedItems

        protected FastStringSet getSelectedItems()

        Gets the currently selected item values.

        Returns:

        the currently selected item keys

      • setHeight

        public void setHeight​(String height)

        Overrides:

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

      • setWidth

        public void setWidth​(String width)

        Overrides:

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

      • setTabIndex

        public void setTabIndex​(int tabIndex)

        Sets the tab index.

        Parameters:

        tabIndex - the tab index to set

      • getTabIndex

        public int getTabIndex()

        Gets the tab index.

        Returns:

        the tab index

      • setReadOnly

        public void setReadOnly​(boolean readOnly)

        Sets this select as read only, meaning selection cannot be changed.

        Parameters:

        readOnly - true for read only, false for not read only

      • isReadOnly

        public boolean isReadOnly()

        Returns true if this select is in read only mode, false if not.

        Returns:

        true for read only, false for not read only

      • setEnabled

        public void setEnabled​(boolean enabled)

        Specified by:

        setEnabled in interface com.google.gwt.user.client.ui.HasEnabled

      • isEnabled

        public boolean isEnabled()

        Specified by:

        isEnabled in interface com.google.gwt.user.client.ui.HasEnabled

      • focus

        public void focus()

        Description copied from interface: Focusable

        Sets focus to this widget.

        Specified by:

        focus in interface Focusable