public class DatasourceOptions<E extends Entity<K>,K> extends java.lang.Object implements Options<E>, EntityOptions<E>
EntityOptions.ValueChangeEvent<T>Options.OptionsChangeEvent<T>DataUnit.StateChangeEvent| Modifier and Type | Field and Description |
|---|---|
protected CollectionDatasource<E,K> |
datasource |
protected EventHub |
events |
protected BindingState |
state |
| Constructor and Description |
|---|
DatasourceOptions(CollectionDatasource<E,K> datasource) |
protected CollectionDatasource<E extends Entity<K>,K> datasource
protected EventHub events
protected BindingState state
public DatasourceOptions(CollectionDatasource<E,K> datasource)
protected void datasourceCollectionChanged(CollectionDatasource.CollectionChangeEvent<E,K> e)
protected void datasourceItemPropertyChanged(Datasource.ItemPropertyChangeEvent<E> e)
protected void datasourceStateChanged(Datasource.StateChangeEvent<E> e)
public CollectionDatasource<E,K> getDatasource()
public java.util.stream.Stream<E> getOptions()
getOptions in interface Options<E extends Entity<K>>public BindingState getState()
protected void setState(BindingState state)
public boolean containsItem(E item)
containsItem in interface EntityOptions<E extends Entity<K>>public void updateItem(E item)
EntityOptionsupdateItem in interface EntityOptions<E extends Entity<K>>public void refresh()
EntityOptionsBindingState.ACTIVE staterefresh in interface EntityOptions<E extends Entity<K>>public Subscription addStateChangeListener(java.util.function.Consumer<DataUnit.StateChangeEvent> listener)
DataUnitaddStateChangeListener in interface DataUnitlistener - the listener to be addedpublic Subscription addValueChangeListener(java.util.function.Consumer<EntityOptions.ValueChangeEvent<E>> listener)
addValueChangeListener in interface EntityOptions<E extends Entity<K>>public Subscription addOptionsChangeListener(java.util.function.Consumer<Options.OptionsChangeEvent<E>> listener)
addOptionsChangeListener in interface Options<E extends Entity<K>>public MetaClass getEntityMetaClass()
getEntityMetaClass in interface EntityDataUnitMetaClass of an entity contained in the sourcepublic void setSelectedItem(E item)
EntityOptionssetSelectedItem in interface EntityOptions<E extends Entity<K>>item - the item to set