netbeans icon indicating copy to clipboard operation
netbeans copied to clipboard

Add code generation for property/getter/setter methods for JavaFX properties

Open PavelTurk opened this issue 9 months ago • 1 comments

Description

JavaFX has its own naming convention for working with properties. For example, for string property

private StringProperty test = new SimpleStringProperty();

the following methods are required:

public StringProperty testProperty() {
    return this.test;
}

public String getTest() {
    return this.test.get();
}

public void setTest(String test) {
     this.test.set(test);
}

As it is seen getters and setter are different from standard Java getters and setters. Besides, the type of them must be resolved from property (for example, from ReadOnlyObjectWrapper).

Currently NB doesn't support code generation for JavaFX properties (ALT+INS) so I suggest to add it.

Use case/motivation

It is very boring to write these methods manually for JavaFX projects.

Related issues

No response

Are you willing to submit a pull request?

No

PavelTurk avatar May 07 '24 14:05 PavelTurk

There is https://github.com/rterp/JavaFxPropertyHelperNBPlugin plugin with MIT license, but it is very old.

PavelTurk avatar Jun 06 '24 19:06 PavelTurk