Open sijskes opened 2 weeks ago
Please provide a sample to make this reproducible.
sample to reproduce.
remove .txt extension, github wouldn't attach without it.
looking at org.netbeans.modules.javafx2.editor.parser.processors.PropertyResolver and the behaviour in this case, it looks (a bit of a gamble) that the PropertyResolver gets confused due to KeyCodeCombination not having property setters for the properties report as in error.
i have not yet found a mechanism to scan for parameters in the constructors. if there are (it should be) then it is a case the wrong constructor was chosen. this is also supported by the fact that 'code' is not reported as an error. the other constructor had 'code' and 'modifiers' as NamedArg.
My reading of the BeanModelBuilder
is, that properties are reported when:
@NamedArg
parameter in the constructor with the most parametersFor KeyCodeCombination there are no getters for the individual keys and thus the third option does not match.
If I understand this correctly: https://github.com/openjdk/jfx/blob/6a586b662592be3eb81670f0c5ce48061c2fc07c/modules/javafx.fxml/src/main/java/com/sun/javafx/fxml/builder/ProxyBuilder.java#L248
I think the model needs to be updated to report the constructor parameters as a separate list and the use sited of the property need to take this into account.
The code for scanning the constructors with NamedArg
s:
looks like a good starting point. The name extraction is demonstrated there. The code in registerProperty
for normal setter can be a template for extracting the type information.
@sijskes will you look into this?
@matthiasblaesing ideally there should be an InfoProxy that is reusable in the BeanModelBuilder and the PropertyResolver. This InfoProxy could mimic the information/logic from the JavaFx ProxyBuilder. I have a hard time following the javax.lang.model stuff, just by code inspection alone. I would assign some meaning by wrapping it in this InfoProxy. This InfoProxy could deliver information in <Name,Type> pairs and support 'completion-path' matching? Later this could grow to provide information regarding child elements.
@errael any insights to share? it looks like you worked on the completion.
Maybe FxBean is already the InfoProxy i'm talking about. Have to look if it is usable without completion code plumbing.
Apache NetBeans version
Apache NetBeans 22
What happened
had scenebuilder create a fxml file. opened file in netbeans. netbeans indicated errors in file.
class 'javafx.scene.input.KeyCodeCombination' does not support property 'alt'. also for 'control' 'meta' 'shift' 'shortcut'.
Language / Project Type / NetBeans Component
javafx
How to reproduce
create stage with menubar with menuitem with shortcut in scenebuilder. open fxml file in netbeans.
Did this work correctly in an earlier version?
No / Don't know
Operating System
ubuntu linux mate hybrid
JDK
version "21.0.3" 2024-04-16 build 21.0.3+9-Ubuntu-1ubuntu122.04.1
Apache NetBeans packaging
Apache NetBeans binary zip
Anything else
always.
Are you willing to submit a pull request?
No
Used version scenebuilder
21.0.0
Used version javafx
javafx 21