Search in sources :

Example 6 with GeneratedPropertyContainer

use of com.vaadin.data.util.GeneratedPropertyContainer in project VaadinUtils by rlsutton1.

the class SearchableGrid method init.

public void init(String uniqueId, Class<E> entityClazz) {
    if (!getSecurityManager().canUserView()) {
        this.setSizeFull();
        this.setCompositionRoot(new Label("Sorry, you do not have permission to access " + getTitle()));
        return;
    }
    container = getContainer();
    grid = new Grid(new GeneratedPropertyContainer(container));
    grid.setSizeFull();
    searchBar = buildSearchBar();
    mainLayout = new VerticalLayout();
    mainLayout.setSizeFull();
    addTitle(mainLayout);
    mainLayout.addComponent(searchBar);
    mainLayout.addComponent(grid);
    mainLayout.setExpandRatio(grid, 1);
    this.setCompositionRoot(mainLayout);
    headingPropertySet = getHeadingPropertySet();
    headingPropertySet.setDeferLoadSettings(true);
    headingPropertySet.applyToGrid(entityClazz, grid, uniqueId + entityClazz.getSimpleName());
}
Also used : GeneratedPropertyContainer(com.vaadin.data.util.GeneratedPropertyContainer) Grid(com.vaadin.ui.Grid) Label(com.vaadin.ui.Label) VerticalLayout(com.vaadin.ui.VerticalLayout)

Aggregations

GeneratedPropertyContainer (com.vaadin.data.util.GeneratedPropertyContainer)6 Entity (com.haulmont.cuba.core.entity.Entity)2 Indexed (com.vaadin.data.Container.Indexed)2 Component (com.vaadin.ui.Component)2 Grid (com.vaadin.ui.Grid)2 ImmutableMap (com.google.common.collect.ImmutableMap)1 EventRouter (com.haulmont.bali.events.EventRouter)1 Dom4j (com.haulmont.bali.util.Dom4j)1 Preconditions (com.haulmont.bali.util.Preconditions)1 Preconditions.checkNotNullArgument (com.haulmont.bali.util.Preconditions.checkNotNullArgument)1 MetaClass (com.haulmont.chile.core.model.MetaClass)1 MetaProperty (com.haulmont.chile.core.model.MetaProperty)1 MetaPropertyPath (com.haulmont.chile.core.model.MetaPropertyPath)1 ClientConfig (com.haulmont.cuba.client.ClientConfig)1 com.haulmont.cuba.core.global (com.haulmont.cuba.core.global)1 ComponentsHelper (com.haulmont.cuba.gui.ComponentsHelper)1 ComponentsHelper.findActionById (com.haulmont.cuba.gui.ComponentsHelper.findActionById)1 com.haulmont.cuba.gui.components (com.haulmont.cuba.gui.components)1 SecuredActionsHolder (com.haulmont.cuba.gui.components.Component.SecuredActionsHolder)1 Field (com.haulmont.cuba.gui.components.Field)1