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

io.overcoded.vaadin.GridViewFactory Maven / Gradle / Ivy

The newest version!
package io.overcoded.vaadin;

import com.vaadin.flow.spring.annotation.SpringComponent;
import io.overcoded.grid.GridInfo;
import io.overcoded.grid.processor.GridInfoViewFactory;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.vaadin.crudui.crud.impl.GridCrud;

@Slf4j
@SpringComponent
@RequiredArgsConstructor
public class GridViewFactory {
    private final GridCrudFactory gridCrudFactory;
    private final ContextMenuConfigurer contextMenuConfigurer;
    private final GridInfoViewFactory gridInfoViewFactory;

    public  GridCrud create(Class type) {
        GridInfo gridInfo = gridInfoViewFactory.create(type);
        return create(gridInfo);
    }

    public  GridCrud create(GridInfo gridInfo) {
        GridCrud gridCrud = gridCrudFactory.create(gridInfo);
        contextMenuConfigurer.configure(gridCrud, gridInfo);
        return gridCrud;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy