Closed aalmiray closed 8 years ago
has a no-args constructor
I suppose you mean "has no no-args constructor".
Taking the content node as a constructor parameter ensures that any instance of VirtualizedScrollPane
is properly initialized. Splitting this initialization between a no-args constructor and, say, setContent
, opens room for initialization bugs. I don't like when tools, in this case FXML, force us to write less robust code. (Not to mention that a multi-step initialization complicates both the implementation and use.) Isn't it time to fix FXML?
I completely agree with you. I rather have a bullet-proof design rather than opening it up for the sake of convenience of a tool. Unfortunately we can't extend FXML and can't tweak FXMLLoader (it's riddled with lost of private API usages). So the current options are to support FXML or not.
I guess for now the only way to create instances of VirtualizedScrollPane
is through programmatic means
Could constructor be updated to leverage javafx.beans.NamedArg?
javafx.beans.DefaultProperty class annotation is also worthy of consideration. Would make FXML cleaner.
The current design of this class has a no-args constructor which hinders the ability to use
VirtualizedScrollPane
inside an FXML file.