io.overcoded.vaadin.GridViewFactory Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of dynamic-grid-vaadin-spring-boot-starter Show documentation
Show all versions of dynamic-grid-vaadin-spring-boot-starter Show documentation
Spring Boot Starter for Grid Annotation with Vaadin
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;
}
}