I have a model with the following structure (specified here in Xcore):
class Network {
contains Master[] masters
}
class Master {
contains Slave[] slaves
}
class Slave {}
I want to use EMF databinding to create an observable list of all slave objects in all masters in the network.
How can this be done?
Alternatively: Can I create a observable list of observable lists of slaves? That is, a structure of the type IObservableList<IObservableList<Slave>>
.
The following, for example, does not work:
Network network = ...
IObservableList allSlaves = EMFProperties
.list(Literals.NETWORK__MASTERS)
.values(Literals.MASTER__SLAVES)
.observe(network);
The resulting list seem to be of type IObservableList<EList<Slave>>
instead of the desired type. The problem is that the resulting IObservableList
has elements of the class EObjectContainmentEList
, which is not an IObservableList
.