I want to create a class that is almost identical to the object returned by FXCollections.observableArrayList() , but with some additional functions. My first thought was something like
public class MyObservableList implements ObservableList { private ObservableList list = FXCollections.observableArrayList(); public functionWhatever() {
but that means overriding the 30 functions that come with the ObservableList (which seems like a hint that I'm doing something wrong).
FXCollections.observableArrayList() returns an object of type com.sun.javafx.collections.ObservableListWrapper , but when I extend ObservableListWrapper , I need to create a constructor of type
MyObservableList( List arg0 )
or
MyObservableList( List arg0, Callback arg1 )
which bothers me because FXCollections.observableArrayList() does not accept any arguments.
I donβt know how FXCollections creates an ObservableListWrapper object that it returns, but I want MyObservableList be identical to the object returned by FXCollections (plus a few extra features).
How to do it?
source share