All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.bklab.flow.base.HasHierarchicalDataProviderFactory Maven / Gradle / Ivy

There is a newer version: 22.0.1
Show newest version
package org.bklab.flow.base;

import com.vaadin.flow.component.Component;
import com.vaadin.flow.data.provider.hierarchy.HasHierarchicalDataProvider;
import com.vaadin.flow.data.provider.hierarchy.TreeData;
import com.vaadin.flow.function.ValueProvider;
import org.bklab.flow.IFlowFactory;

import java.util.Collection;
import java.util.stream.Stream;

@SuppressWarnings("unchecked")
public interface HasHierarchicalDataProviderFactory<
        T,
        C extends Component & HasHierarchicalDataProvider,
        E extends HasHierarchicalDataProviderFactory
        > extends IFlowFactory {

    default E items(Collection rootItems, ValueProvider> childItemProvider) {
        get().setItems(rootItems, childItemProvider);
        return (E) this;
    }

    default E items(Stream rootItems, ValueProvider> childItemProvider) {
        get().setItems(rootItems, childItemProvider);
        return (E) this;
    }

    default E treeData(TreeData treeData) {
        get().setTreeData(treeData);
        return (E) this;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy