This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 241724 - InsertCode -> Add Property should be JavaFX aware
Summary: InsertCode -> Add Property should be JavaFX aware
Status: NEW
Alias: None
Product: javafx
Classification: Unclassified
Component: Editor (show other bugs)
Version: 8.0
Hardware: PC Windows 7
: P3 normal (vote)
Assignee: Svata Dedic
Depends on:
Reported: 2014-02-11 21:40 UTC by swpalmer
Modified: 2014-09-14 13:01 UTC (History)
1 user (show)

See Also:
Exception Reporter:


Note You need to log in before you can comment on or make changes to this bug.
Description swpalmer 2014-02-11 21:40:25 UTC

Comment 1 swpalmer 2014-02-11 21:44:13 UTC
Source -> Insert Code... -> Add Property...

This dialog should have the option of adding an Observable Property as per the JavaFX convention.  E.g. getters and setters delegating to an ObservableXXX member, adding the XXXXProperty() method, etc.
Comment 2 Tomas Zezula 2014-02-12 19:37:47 UTC
Currently it's not possible to change the impl of Insert Code depending on project settings.
Either an API allowing the change of the Inserted Code has to be added or we can add a new Add JavaFx Property (maybe makes more sense as even in JFX project you may want to create J2SE property).
Comment 3 swpalmer 2014-02-13 01:31:03 UTC
I agree that "Add new JavaFX Property..." makes sense.  

However, the general scope of the issue is greater. 
Auto-complete hints and "encapsulate fields" refactoring will currently do questionable things.  E.g. they make getters and setters that act on the property object, not the property value.  It can be argued that it is correct, but it is probably not what should be done.

Autocomplete is actually broken, see Bug 241669.
Comment 4 JNetBeansIDE 2014-09-14 13:01:02 UTC
Looks like you need to use 'javafxpackager' in order for "Add Java FX Property" to appear in "insert code" list. However, if the project is compiled with jdk, you get the following message:

--- exec-maven-plugin:1.2.1:exec (unpack-dependencies) @ QT-Visual ---
javafxpackager.exe has been renamed javapackager.exe.
The original file may be removed in a future release in lieu of javapackager.
Please update your scripts.

Not sure where this leads us to.