-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Let DecoratorPane be used with FXML #30
Comments
You may take a look and see if it is possible to make it FXML friendly. I thought about it too but I felt it is not that critical. I can still design the panel using FXML. When I add the FXML designed panel to its parent using code, I can then wrap it in a DecorationPane. I know it is not perfect but probably enough to cover most cases. |
Indeed. The design of
The two innermost |
I see. What exactly need to be done? A default constructor and being able to set the content on fly? |
Yes. The current constructor defines lifecycle methods that must be called when content is added. I believe the following measures are needed to make
|
Thanks for the explanation. It'd be possible although needs some work. Let me see if I can find time for it next week. |
Actually the current constructor must stay in place, otherwise it breaks compatibility. The no-args constructor must be added; then rhe content wiring/unwiring. Next week there is a 2 day @hackergarten at Javaland. I hope to get some people interested in jidefx and improvs 😄 |
Cool! |
The current design of
DecoratorPane
assumes that setting the content is an immutable operation, this it forces the content to be set on the constructor. HoweverDecoratorPane
may have its children rearranged at any time, thus the immutable condition is rendered moot. Providing an explicit no-args constructor hinders the usage ofDecoratorPane
with FXML.Given that immutability of content cannot be enforced I say it's best to remove the explicit constructor and handle registration/deregistration of listeners whenever child content occurs. It could be the case that
DecoratorPane
enforces a single child in in it lists of children.The text was updated successfully, but these errors were encountered: