Search in sources :

Example 6 with HierarchicalTestBean

use of com.vaadin.flow.data.bean.HierarchicalTestBean in project flow-components by vaadin.

the class TreeGridOrderColumnsPage method initializeDataProviders.

private void initializeDataProviders() {
    TreeData<HierarchicalTestBean> data = new TreeData<>();
    List<Integer> ints = Arrays.asList(0, 1, 2);
    ints.stream().forEach(index -> {
        HierarchicalTestBean bean = new HierarchicalTestBean(null, 0, index);
        data.addItem(null, bean);
        ints.stream().forEach(childIndex -> {
            HierarchicalTestBean childBean = new HierarchicalTestBean(bean.getId(), 1, childIndex);
            data.addItem(bean, childBean);
            ints.stream().forEach(grandChildIndex -> data.addItem(childBean, new HierarchicalTestBean(childBean.getId(), 2, grandChildIndex)));
        });
    });
}
Also used : HierarchicalTestBean(com.vaadin.flow.data.bean.HierarchicalTestBean) TreeData(com.vaadin.flow.data.provider.hierarchy.TreeData)

Aggregations

HierarchicalTestBean (com.vaadin.flow.data.bean.HierarchicalTestBean)6 TreeData (com.vaadin.flow.data.provider.hierarchy.TreeData)2 Stream (java.util.stream.Stream)2 Button (com.vaadin.flow.component.button.Button)1 Column (com.vaadin.flow.component.grid.Grid.Column)1 GridSortOrderBuilder (com.vaadin.flow.component.grid.GridSortOrderBuilder)1 HorizontalLayout (com.vaadin.flow.component.orderedlayout.HorizontalLayout)1 VerticalLayout (com.vaadin.flow.component.orderedlayout.VerticalLayout)1 TextArea (com.vaadin.flow.component.textfield.TextArea)1 TextField (com.vaadin.flow.component.textfield.TextField)1 TreeGrid (com.vaadin.flow.component.treegrid.TreeGrid)1 SortDirection (com.vaadin.flow.data.provider.SortDirection)1 HierarchicalQuery (com.vaadin.flow.data.provider.hierarchy.HierarchicalQuery)1 LitRenderer (com.vaadin.flow.data.renderer.LitRenderer)1 SerializablePredicate (com.vaadin.flow.function.SerializablePredicate)1 BeforeEvent (com.vaadin.flow.router.BeforeEvent)1 HasUrlParameter (com.vaadin.flow.router.HasUrlParameter)1 Location (com.vaadin.flow.router.Location)1 OptionalParameter (com.vaadin.flow.router.OptionalParameter)1 QueryParameters (com.vaadin.flow.router.QueryParameters)1