Search in sources :

Example 6 with Indexed

use of com.vaadin.data.Container.Indexed in project VaadinUtils by rlsutton1.

the class GridHeadingV2PropertySet method wrapGridContainer.

@SuppressWarnings("unchecked")
private GeneratedPropertyListContainer<E> wrapGridContainer(final Class<E> entityClass, final Grid grid) {
    final Indexed gridContainer = grid.getContainerDataSource();
    if (gridContainer instanceof GeneratedPropertyListContainer) {
        return (GeneratedPropertyListContainer<E>) gridContainer;
    }
    final GeneratedPropertyListContainer<E> gplc = new GeneratedPropertyListContainer<>(entityClass);
    gplc.setCollection((Collection<E>) gridContainer.getItemIds());
    final Collection<?> containerPropertyIds = gridContainer.getContainerPropertyIds();
    if (!containerPropertyIds.isEmpty()) {
        gplc.setContainerPropertyIds(containerPropertyIds.toArray(new String[containerPropertyIds.size()]));
    }
    grid.setContainerDataSource(gplc);
    return gplc;
}
Also used : Indexed(com.vaadin.data.Container.Indexed) GeneratedPropertyListContainer(org.vaadin.viritin.grid.GeneratedPropertyListContainer)

Aggregations

Indexed (com.vaadin.data.Container.Indexed)6 GeneratedPropertyContainer (com.vaadin.data.util.GeneratedPropertyContainer)2 Component (com.vaadin.ui.Component)2 Column (com.vaadin.ui.Grid.Column)2 HtmlRenderer (com.vaadin.ui.renderers.HtmlRenderer)2 TextRenderer (com.vaadin.ui.renderers.TextRenderer)2 ComponentRenderer (de.datenhahn.vaadin.componentrenderer.ComponentRenderer)2 LinkedList (java.util.LinkedList)2 CellFocusEvent (org.vaadin.patrik.events.CellFocusEvent)2 ClickOutEvent (org.vaadin.patrik.events.ClickOutEvent)2 EditorCloseEvent (org.vaadin.patrik.events.EditorCloseEvent)2 EditorOpenEvent (org.vaadin.patrik.events.EditorOpenEvent)2 RowEditEvent (org.vaadin.patrik.events.RowEditEvent)2 RowFocusEvent (org.vaadin.patrik.events.RowFocusEvent)2 GeneratedPropertyListContainer (org.vaadin.viritin.grid.GeneratedPropertyListContainer)2 StringToBooleanConverter (com.vaadin.data.util.converter.StringToBooleanConverter)1 Grid (com.vaadin.ui.Grid)1 ArrayList (java.util.ArrayList)1 AtomicBoolean (java.util.concurrent.atomic.AtomicBoolean)1 FastNavigation (org.vaadin.patrik.FastNavigation)1