Java 类com.vaadin.server.SerializableFunction 实例源码

项目:vaadin-combobox-multiselect    文件:ComboBoxMultiselect.java   
@Override
public <C> void setDataProvider(final DataProvider<T, C> dataProvider, final SerializableFunction<String, C> filterConverter) {
    Objects.requireNonNull(dataProvider, "dataProvider cannot be null");
    Objects.requireNonNull(filterConverter, "filterConverter cannot be null");

    final SerializableFunction<String, C> convertOrNull = filterText -> {
        if (filterText == null || filterText.isEmpty()) {
            return null;
        }

        return filterConverter.apply(filterText);
    };

    final SerializableConsumer<C> providerFilterSlot = internalSetDataProvider(dataProvider, convertOrNull.apply(this.currentFilterText));

    this.filterSlot = filter -> providerFilterSlot.accept(convertOrNull.apply(filter));
}
项目:vaadin-combobox-multiselect    文件:ComboBoxMultiselect.java   
@Override
public <C> void setDataProvider(final DataProvider<T, C> dataProvider, final SerializableFunction<String, C> filterConverter) {
    Objects.requireNonNull(dataProvider, "dataProvider cannot be null");
    Objects.requireNonNull(filterConverter, "filterConverter cannot be null");

    final SerializableFunction<String, C> convertOrNull = filterText -> {
        if (filterText == null || filterText.isEmpty()) {
            return null;
        }

        return filterConverter.apply(filterText);
    };

    final SerializableConsumer<C> providerFilterSlot = internalSetDataProvider(dataProvider, convertOrNull.apply(this.currentFilterText));

    this.filterSlot = filter -> providerFilterSlot.accept(convertOrNull.apply(filter));
}
项目:holon-vaadin    文件:SingleSelectField.java   
@SuppressWarnings({ "unchecked", "rawtypes" })
@Override
public void setDataProvider(DataProvider<ITEM, ?> dataProvider, SerializableFunction<String, ?> filterConverter) {
    if (filterConverter != null && getInternalField() instanceof ComboBox) {
        ((ComboBox) getInternalField()).setDataProvider(dataProvider, filterConverter);
    } else {
        setDataProvider(dataProvider);
    }
}
项目:holon-vaadin    文件:SingleSelectField.java   
@Override
public B dataSource(ItemDataProvider<T> dataProvider,
        SerializableFunction<String, QueryFilter> filterProvider) {
    this.itemDataProvider = dataProvider;
    this.filterProvider = filterProvider;
    return builder();
}
项目:holon-vaadin    文件:SingleSelectField.java   
@Override
public <F> B dataSource(DataProvider<T, F> dataProvider, SerializableFunction<String, F> filterProvider) {
    this.dataProvider = dataProvider;
    this.filterProvider = filterProvider;
    return builder();
}
项目:holon-vaadin    文件:SingleSelectField.java   
@Override
public SelectModeSinglePropertySelectInputBuilder<T> captionQueryFilter(
        SerializableFunction<String, QueryFilter> filterProvider) {
    this.filterProvider = filterProvider;
    return this;
}
项目:holon-vaadin    文件:MultiSelectField.java   
@Override
public void setDataProvider(DataProvider<ITEM, ?> dataProvider, SerializableFunction<String, ?> filterConverter) {
    setDataProvider(dataProvider);
}
项目:holon-vaadin    文件:AbstractSelectField.java   
/**
 * Set the data source {@link DataProvider}.
 * @param dataProvider The data provider to set
 * @param filterConverter Optional caption filter converter
 */
public abstract void setDataProvider(DataProvider<ITEM, ?> dataProvider,
        SerializableFunction<String, ?> filterConverter);
项目:holon-vaadin    文件:BaseSelectModeSinglePropertySelectInputBuilder.java   
/**
 * Set the function to provide the {@link QueryFilter} to use with the data provider when user types a caption
 * filter String.
 * @param filterProvider caption {@link QueryFilter} provider
 * @return this
 */
SelectModeSinglePropertySelectInputBuilder<T> captionQueryFilter(
        SerializableFunction<String, QueryFilter> filterProvider);
项目:holon-vaadin    文件:SingleSelectInputBuilder.java   
/**
 * Set the selection items data provider.
 * @param dataProvider Items data provider (not null)
 * @param filterProvider Optional caption {@link QueryFilter} provider for {@link RenderingMode#SELECT} type inputs
 * @return this
 */
B dataSource(ItemDataProvider<T> dataProvider, SerializableFunction<String, QueryFilter> filterProvider);
项目:holon-vaadin    文件:SingleSelectInputBuilder.java   
/**
 * Set the selection items data provider.
 * @param <F> Caption filter type
 * @param dataProvider Items data provider (not null)
 * @param filterProvider Optional caption {@link QueryFilter} provider for {@link RenderingMode#SELECT} type inputs
 * @return this
 */
<F> B dataSource(DataProvider<T, F> dataProvider, SerializableFunction<String, F> filterProvider);
项目:vaadin-fluent-api    文件:FluentHasFilterableDataProvider.java   
/**
 * Sets the data provider and filter converter for this listing. The data
 * provider is queried for displayed items as needed.
 * @param <C> the listing type to convert to FILTER type
 *
 * @param dataProvider
 *            the data provider, not <code>null</code>
 * @param filterConverter
 *            a function that converts filter values produced by this
 *            listing into filter values expected by the provided data
 *            provider, not <code>null</code>
 * @return this for method chaining
 * @see HasFilterableDataProvider#setDataProvider(DataProvider, SerializableFunction)
 */
@SuppressWarnings("unchecked")
public default <C> THIS withDataProvider(DataProvider<ITEM, C> dataProvider, SerializableFunction<FILTER, C> filterConverter) {
    this.setDataProvider(dataProvider, filterConverter);
    return (THIS) this;
}