com.vaadin.client.connectors.

Interface AbstractMultiSelectConnector.MultiSelectWidget

  • All Known Implementing Classes:

    VListSelect, VTwinColSelect

    Enclosing class:

    AbstractMultiSelectConnector

    public static interface AbstractMultiSelectConnector.MultiSelectWidget

    Abstraction layer to help populate different multiselect widgets based on same JSON data.

    • Method Summary

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

      Adds a selection change listener the select.

      static String getCaption​(elemental.json.JsonObject item)

      Returns the caption for the given item.

      static Optional<String> getIconUrl​(elemental.json.JsonObject item)

      Returns the optional icon URL for the given item.

      static String getKey​(elemental.json.JsonObject item)

      Returns the key for the given item.

      static boolean isEnabled​(elemental.json.JsonObject item)

      Returns whether the given item is enabled or not.

      static boolean isSelected​(elemental.json.JsonObject item)

      Returns whether this item is selected or not.

      void setItems​(List<elemental.json.JsonObject> items)

      Sets the given items to the select.

    • Method Detail

      • setItems

        void setItems​(List<elemental.json.JsonObject> items)

        Sets the given items to the select.

        Parameters:

        items - the items for the select

      • addSelectionChangeListener

        Registration addSelectionChangeListener​(BiConsumer<Set<String>,​Set<String>> selectionChangeListener)

        Adds a selection change listener the select.

        Parameters:

        selectionChangeListener - the listener to add, not null

        Returns:

        a registration handle to remove the listener

      • getCaption

        static String getCaption​(elemental.json.JsonObject item)

        Returns the caption for the given item.

        Parameters:

        item - the item, not null

        Returns:

        caption of the item

      • getKey

        static String getKey​(elemental.json.JsonObject item)

        Returns the key for the given item.

        Parameters:

        item - the item, not null

        Returns:

        key of the item

      • isEnabled

        static boolean isEnabled​(elemental.json.JsonObject item)

        Returns whether the given item is enabled or not.

        Disabling items is not supported by all multiselects.

        Parameters:

        item - the item, not null

        Returns:

        true enabled, false if not

      • isSelected

        static boolean isSelected​(elemental.json.JsonObject item)

        Returns whether this item is selected or not.

        Parameters:

        item - the item, not null

        Returns:

        true is selected, false if not

      • getIconUrl

        static Optional<String> getIconUrl​(elemental.json.JsonObject item)

        Returns the optional icon URL for the given item.

        Item icons are not supported by all multiselects.

        Parameters:

        item - the item

        Returns:

        the optional icon URL, or an empty optional if none specified