E
- entity typepublic class ContainerOptions<E> 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 io.jmix.core.common.event.EventHub |
events |
protected DataLoader |
loader |
Constructor and Description |
---|
ContainerOptions(CollectionContainer<E> container) |
Modifier and Type | Method and Description |
---|---|
io.jmix.core.common.event.Subscription |
addOptionsChangeListener(java.util.function.Consumer<Options.OptionsChangeEvent<E>> listener) |
io.jmix.core.common.event.Subscription |
addStateChangeListener(java.util.function.Consumer<DataUnit.StateChangeEvent> listener)
Registers a new state change listener.
|
io.jmix.core.common.event.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() |
io.jmix.core.metamodel.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> container
protected DataLoader loader
protected io.jmix.core.common.event.EventHub events
protected E deferredSelectedItem
public ContainerOptions(CollectionContainer<E> container)
protected void containerCollectionChanged(CollectionContainer.CollectionChangeEvent<E> e)
protected void containerItemPropertyChanged(InstanceContainer.ItemPropertyChangeEvent<E> e)
@Nullable public io.jmix.core.metamodel.model.MetaClass getEntityMetaClass()
getEntityMetaClass
in interface EntityDataUnit
MetaClass
of an entity contained in the sourcepublic void setSelectedItem(@Nullable E item)
EntityOptions
setSelectedItem
in interface EntityOptions<E>
item
- the item to setpublic boolean containsItem(@Nullable E item)
containsItem
in interface EntityOptions<E>
public void updateItem(E item)
EntityOptions
updateItem
in interface EntityOptions<E>
public void refresh()
EntityOptions
BindingState.ACTIVE
staterefresh
in interface EntityOptions<E>
public java.util.stream.Stream<E> getOptions()
getOptions
in interface Options<E>
public BindingState getState()
public io.jmix.core.common.event.Subscription addStateChangeListener(java.util.function.Consumer<DataUnit.StateChangeEvent> listener)
DataUnit
addStateChangeListener
in interface DataUnit
listener
- the listener to be addedpublic io.jmix.core.common.event.Subscription addValueChangeListener(java.util.function.Consumer<EntityOptions.ValueChangeEvent<E>> listener)
addValueChangeListener
in interface EntityOptions<E>
public io.jmix.core.common.event.Subscription addOptionsChangeListener(java.util.function.Consumer<Options.OptionsChangeEvent<E>> listener)
addOptionsChangeListener
in interface Options<E>
public CollectionContainer<E> getContainer()
getContainer
in interface ContainerDataUnit<E>