/** * Creates a new select that is connected to a data-source. * * @param caption * the Caption of the component. * @param dataSource * the Container datasource to be selected from by this select. */ public AbstractSelect(String caption, Container dataSource) { setCaption(caption); setContainerDataSource(dataSource); }
/** * Creates an empty Select. The caption is not used. */ public AbstractSelect() { setContainerDataSource(new IndexedContainer()); }
/** * Creates an empty Select with caption. */ public AbstractSelect(String caption) { setContainerDataSource(new IndexedContainer()); setCaption(caption); }
super.setContainerDataSource(newDataSource); } else { super.setContainerDataSource( new ContainerHierarchicalWrapper(newDataSource));
/** * * @return the backing select instance, overriding this method may be * hazardous */ protected AbstractSelect getSelect() { if (select == null) { withSelectType(null); if (bic != null) { select.setContainerDataSource(bic); } } ensurePiggybackListener(); return select; }
private void ensureContainerSet() { if (bic != null && getSelect().getContainerDataSource() != bic) { getSelect().setContainerDataSource(bic); } }
public final TypedSelect<T> setOptions(Collection<T> options) { if (bic != null) { bic.setCollection(options); } else { bic = new ListContainer<>(options); } getSelect().setContainerDataSource(bic); return this; }
/** * 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); }
super.setContainerDataSource(newDataSource); } else { super.setContainerDataSource( new ContainerOrderedWrapper(newDataSource));
setBic(new DummyFilterableListContainer<T>(getType(), piggybackLazyList)); getSelect().setContainerDataSource(getBic());