Class EditColumnConfigurator<T>

  • Type Parameters:
    T - the grid bean type
    All Implemented Interfaces:
    Serializable

    public class EditColumnConfigurator<T>
    extends Object
    implements Serializable
    Configuration for the editor of an edit column.
    Author:
    Vaadin Ltd.
    See Also:
    Serialized Form
    • Method Detail

      • getColumn

        public Grid.Column<T> getColumn()
        Gets the column.
        Returns:
        the configured column
      • text

        public Grid.Column<T> text​(ItemUpdater<T,​String> itemUpdater)
        Configures the column to have a text editor with the given item updater.
        Parameters:
        itemUpdater - the callback function that is called when item is changed. It receives two arguments: item, newValue.
        Returns:
        the configured column
      • checkbox

        public Grid.Column<T> checkbox​(ItemUpdater<T,​Boolean> itemUpdater)
        Configures the column to have a checkbox editor with the given item updater.
        Parameters:
        itemUpdater - the callback function that is called when item is changed. It receives two arguments: item, newValue.
        Returns:
        the configured column
      • select

        public Grid.Column<T> select​(ItemUpdater<T,​String> itemUpdater,
                                     List<String> options)
        Configures the column to have a select editor with the given item updater and options.
        Parameters:
        itemUpdater - the callback function that is called when item is changed. It receives two arguments: item, newValue.
        options - options provided for the select editor
        Returns:
        the configured column
      • select

        public Grid.Column<T> select​(ItemUpdater<T,​String> itemUpdater,
                                     String... options)
        Configures the column to have a select editor with the given item updater and options.
        Parameters:
        itemUpdater - the callback function that is called when item is changed. It receives two arguments: item, newValue.
        options - options provided for the select editor
        Returns:
        the configured column
      • select

        public <E extends Enum<E>> Grid.Column<T> select​(ItemUpdater<T,​E> itemUpdater,
                                                         Class<E> enumType,
                                                         SerializableFunction<E,​String> getStringRepresentation)
        Configures the column to have a select editor with the given item updater, enum type and string representation callback. All constants from the given enum will be used, in their natural order. To exclude some constants or use a different order, build the list of options manually and use select(ItemUpdater, String...).
        Type Parameters:
        E - the enum type
        Parameters:
        itemUpdater - the callback function that is called when item is changed. It receives two arguments: item and newValue.
        enumType - the enum class
        getStringRepresentation - callback used to get the string representation for each enum constant.
        Returns:
        the configured column
        Throws:
        IllegalArgumentException - if any of the enum constants have the same string representation
      • select

        public <E extends Enum<E>> Grid.Column<T> select​(ItemUpdater<T,​E> itemUpdater,
                                                         Class<E> enumType)
        Configures the column to have a select editor with the given item updater, enum type using toString() as the string representation. All constants from the given enum will be used, in their natural order. To exclude some constants or use a different order, build the list of options manually and use select(ItemUpdater, String...).
        Type Parameters:
        E - the enum type
        Parameters:
        itemUpdater - the callback function that is called when item is changed. It receives two arguments: item and newValue.
        enumType - the enum class
        Returns:
        the configured column