Reputation: 305
Given
public class Person {
public final StringProperty name = new SimpleStringProperty();
}
Is there any way to map an ObservableList<Person>
to an ObservableList<String>
without implementing a ListChangeListener<Person>
to manually update the required list?
Upvotes: 2
Views: 95
Reputation: 305
I've found a library which does the trick:
https://github.com/tobiasdiez/EasyBind
It provides EasyBind.map
with this exact functionality with a side note that the performed mapping function is executed on every get(int index), which decreases initial setup.
EasyBind.mapBacked
provides an ObservableList in which the mapping function is already applied to every item, which may be preferable for intensive mapping functions.
Upvotes: 1