E
- entity typeK
- entity key typepublic class ContainerOptions<E extends Entity<K>,K> extends java.lang.Object implements Options<E>, EntityOptions<E>, ContainerDataUnit<E>
EntityOptions.ValueChangeEvent<T>
Options.OptionsChangeEvent<T>
DataUnit.StateChangeEvent
Modifier and Type | Field and Description |
---|---|
protected CollectionContainer<E> |
container |
protected E |
deferredSelectedItem |
protected com.haulmont.bali.events.EventHub |
events |
protected DataLoader |
loader |
Constructor and Description |
---|
ContainerOptions(CollectionContainer<E> container) |
Modifier and Type | Method and Description |
---|---|
com.haulmont.bali.events.Subscription |
addOptionsChangeListener(java.util.function.Consumer<Options.OptionsChangeEvent<E>> listener) |
com.haulmont.bali.events.Subscription |
addStateChangeListener(java.util.function.Consumer<DataUnit.StateChangeEvent> listener)
Registers a new state change listener.
|
com.haulmont.bali.events.Subscription |
addValueChangeListener(java.util.function.Consumer<EntityOptions.ValueChangeEvent<E>> listener) |
protected void |
containerCollectionChanged(CollectionContainer.CollectionChangeEvent<E> e) |
protected void |
containerItemPropertyChanged(InstanceContainer.ItemPropertyChangeEvent<E> e) |
boolean |
containsItem(E item) |
CollectionContainer<E> |
getContainer() |
com.haulmont.chile.core.model.MetaClass |
getEntityMetaClass() |
java.util.stream.Stream<E> |
getOptions() |
BindingState |
getState() |
void |
refresh()
Refreshes the source moving it to the
BindingState.ACTIVE state |
void |
setSelectedItem(E item)
Set current item in the source.
|
void |
updateItem(E item)
Update an item in the collection if it is already there.
|
protected CollectionContainer<E extends Entity<K>> container
protected DataLoader loader
protected com.haulmont.bali.events.EventHub events
public ContainerOptions(CollectionContainer<E> container)
protected void containerCollectionChanged(CollectionContainer.CollectionChangeEvent<E> e)
protected void containerItemPropertyChanged(InstanceContainer.ItemPropertyChangeEvent<E> e)
public com.haulmont.chile.core.model.MetaClass getEntityMetaClass()
getEntityMetaClass
in interface EntityDataUnit
MetaClass
of an entity contained in the sourcepublic void setSelectedItem(E item)
EntityOptions
setSelectedItem
in interface EntityOptions<E extends Entity<K>>
item
- the item to setpublic boolean containsItem(E item)
containsItem
in interface EntityOptions<E extends Entity<K>>
public void updateItem(E item)
EntityOptions
updateItem
in interface EntityOptions<E extends Entity<K>>
public void refresh()
EntityOptions
BindingState.ACTIVE
staterefresh
in interface EntityOptions<E extends Entity<K>>
public java.util.stream.Stream<E> getOptions()
getOptions
in interface Options<E extends Entity<K>>
public BindingState getState()
public com.haulmont.bali.events.Subscription addStateChangeListener(java.util.function.Consumer<DataUnit.StateChangeEvent> listener)
DataUnit
addStateChangeListener
in interface DataUnit
listener
- the listener to be addedpublic com.haulmont.bali.events.Subscription addValueChangeListener(java.util.function.Consumer<EntityOptions.ValueChangeEvent<E>> listener)
addValueChangeListener
in interface EntityOptions<E extends Entity<K>>
public com.haulmont.bali.events.Subscription addOptionsChangeListener(java.util.function.Consumer<Options.OptionsChangeEvent<E>> listener)
addOptionsChangeListener
in interface Options<E extends Entity<K>>
public CollectionContainer<E> getContainer()
getContainer
in interface ContainerDataUnit<E extends Entity<K>>