public MagnoliaTable() { this(new IndexedContainer()); }
/** * Creates an empty Select. The caption is not used. */ public AbstractSelect() { setContainerDataSource(new IndexedContainer()); }
private static Container createContainer(Collection<?> options) { final Container container = new IndexedContainer(); if (options != null) { for (final Iterator<?> i = options.iterator(); i.hasNext(); ) { container.addItem(i.next()); } } return container; }
@Override public void setContainerDataSource(Container newDataSource) { if (newDataSource == null || newDataSource instanceof IndexedContainer) { // if it is just created newDataSource = new NullGroupTableContainer(new IndexedContainer()); } else if (!(newDataSource instanceof GroupTableContainer)) { throw new IllegalArgumentException("CubaGroupTable supports only GroupTableContainer"); } super.setContainerDataSource(newDataSource); }
protected void setItemsToPresentation(Stream<I> options) { List<I> itemIds = options.collect(Collectors.toList()); component.setContainerDataSource(new IndexedContainer(itemIds)); }
protected void setItemsToPresentation(Stream<I> options) { List<I> itemIds = options.collect(Collectors.toList()); component.setContainerDataSource(new IndexedContainer(itemIds)); }
/** * Creates an empty Select with caption. */ public AbstractSelect(String caption) { setContainerDataSource(new IndexedContainer()); setCaption(caption); }
public void setContainerDataSource(Container newDataSource) { if (newDataSource == null) { newDataSource = new IndexedContainer();
/** * Creates a new select that is filled from a collection of option values. * * @param caption * the Caption of this field. * @param options * the Collection containing the options. */ public AbstractSelect(String caption, Collection<?> options) { // Creates the options container and add given options to it final Container c = new IndexedContainer(); if (options != null) { for (final Object item : options) { c.addItem(item); } } setCaption(caption); setContainerDataSource(c); }
protected void initComponent(CubaListSelect component) { component.setContainerDataSource(new IndexedContainer()); component.setItemCaptionGenerator(this::generateItemCaption); component.setRequiredError(null); attachListener(component); }
final IndexedContainer nc = new IndexedContainer();
public void createDataSource(ColumnDefinition ... columns) { this.columns = columns; dataSource = new IndexedContainer(); LinkedList<Object> columnList = new LinkedList<>(); LinkedList<Object> colapsedByDefault = new LinkedList<>(); for (ColumnDefinition column : columns) { dataSource.addContainerProperty(column.getId(), column.getType(), column.getDefaultValue()); setColumnHeader(column.getId(), column.getTitle()); if (!column.isShowByDefault()) colapsedByDefault.add(column.getId()); columnList.add(column.getId()); } setContainerDataSource(dataSource); setVisibleColumns(columnList.toArray(new Object[colapsedByDefault.size()])); for (Object col : colapsedByDefault) setColumnCollapsed(col, true); }
/** * Creates a new Grid with the given caption and data source. If the data * source is null, a new {@link IndexedContainer} will be used. * * @param caption * the caption of the grid * @param dataSource * the indexed container to use as a data source */ public Grid(String caption, Container.Indexed dataSource) { if (dataSource == null) { internalSetContainerDataSource(new IndexedContainer()); } else { setContainerDataSource(dataSource); } setCaption(caption); initGrid(); }
@Override protected Container initializeContainer() { IndexedContainer container = new IndexedContainer(); container.addContainerProperty("p1", String.class, ""); container.addContainerProperty("p2", String.class, ""); return container; } };
@SuppressWarnings("unchecked") public WebOptionsGroup() { component = createComponent(); component.setContainerDataSource(new IndexedContainer()); component.setItemCaptionGenerator(o -> generateItemCaption((I) o)); component.setRequiredError(null); attachListener(component); }
newDataSource = new IndexedContainer();
@Before public void setUp() throws Exception { // testing with a plain Vaadin Table listView = new ListViewImpl() { @Override protected Table createTable(Container container) { Table table = new Table(null, container); table.setSelectable(true); table.setMultiSelect(true); // use B as default selected value here table.setValue(Lists.newArrayList(B)); return table; } }; // #setContainer initializes Table and adds event listeners Container container = new IndexedContainer(Lists.newArrayList(A, B, C)); listView.setContainer(container); // mock listener (i.e. ListPresenter) for interactions listener = mock(ContentView.Listener.class); listView.setListener(listener); table = (Table) listView.asVaadinComponent(); }
public void setContainerDataSource(Container newDataSource) { if (newDataSource == null) { newDataSource = new IndexedContainer();