Let's say I subclassed the TableView<T>default class provided by javafx and created the class PersonTableView extends TableView<Person>. This subclass exists in Java code and does not use fxml at all. It defines and encapsulates the behavior that I need specifically for my object Person.
Now I want to use an instance of my custom class inside the fxml file, as well as all the default controls. And this is exactly my problem, I do not know how I can do this, or even if it is even a good / general design solution.
I want to encapsulate the behavior for my particular TableView inside its own class, but the layout must be defined in fxml, since it has nothing to do with logic, this is just cosmetics.
I assume that such syntax and functionality can be found in .NET's WPF, where you can use your own classes in markup, like any other control, because xaml and C # are more closely connected than java and fxml.
From my current point of view, what I described cannot be done, and instead I would use only a very small amount of fxml and much more code, even for parts that are just layout. For example, I do not want to use this code:
AnchorPane.setRightAnchor(customControl, 65.0);
because I think it is a good idea to have this defined inside my fxml.
So my question is how do I implement what was described above; or, if it’s rare, what is the general, “best” way to get the same functionality that I just described?