com.vaadin.flow.component.gridpro.
Class EditColumnConfigurator<T>
- java.lang.Object
-
- com.vaadin.flow.component.gridpro.EditColumnConfigurator<T>
-
Type Parameters:
T
- the grid bean typeAll Implemented Interfaces:
public class EditColumnConfigurator<T> extends Object implements Serializable
Configuration for the editor of an edit column.
Author:
Vaadin Ltd.
See Also:
-
-
Method Summary
All Methods Modifier and Type Method Description Grid.Column<T>
checkbox(ItemUpdater<T,Boolean> itemUpdater)
Configures the column to have a checkbox editor with the given item updater.
<V> Grid.Column<T>
custom(HasValueAndElement<?,V> component, ItemUpdater<T,V> itemUpdater)
Grid.Column<T>
getColumn()
Gets the column.
<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.
<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.
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.
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.
Grid.Column<T>
text(ItemUpdater<T,String> itemUpdater)
Configures the column to have a text editor with the given item updater.
-
-
-
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
-
custom
public <V> Grid.Column<T> custom(HasValueAndElement<?,V> component, ItemUpdater<T,V> itemUpdater)
-
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 editorReturns:
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 editorReturns:
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 typeParameters:
itemUpdater
- the callback function that is called when item is changed. It receives two arguments: item and newValue.enumType
- the enum classgetStringRepresentation
- 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 typeParameters:
itemUpdater
- the callback function that is called when item is changed. It receives two arguments: item and newValue.enumType
- the enum classReturns:
the configured column
-
-