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 271067 - Auto-generated parameterized JavaFX properties
Summary: Auto-generated parameterized JavaFX properties
Status: NEW
Alias: None
Product: javafx
Classification: Unclassified
Component: Editor (show other bugs)
Version: 8.1
Hardware: PC Linux
: P3 normal (vote)
Assignee: Svata Dedic
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-07-11 08:24 UTC by Richard-Degenne
Modified: 2017-07-11 08:24 UTC (History)
0 users

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments
Example 1 (13.75 KB, image/png)
2017-07-11 08:24 UTC, Richard-Degenne
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Richard-Degenne 2017-07-11 08:24:24 UTC
Created attachment 164736 [details]
Example 1

When adding a parameterized JavaFX property (such as `ObjectProperty<?>` or `ListProperty<?>`), the wizard should ask for the type(s) it is applied to, for better consistency in the generated code.

Example:

When filling the wizard as shown in `Example_1.png`, the generated code will look like this.

    private final ListProperty<?> users = new SimpleListProperty<>();

    public ObservableList getUsers() {
        return users.get();
    }

    public void setUsers(ObservableList value) {
        users.set(value);
    }

    public ListProperty usersProperty() {
        return users;
    }

Here, `getUsers()` will return an `ObservableList<Object>`, forcing a cast in the client code. Instead, the generated code should look like this.

    private final ListProperty<User> users = new SimpleListProperty<>();

    public ObservableList<User> getUsers() {
        return users.get();
    }

    public void setUsers(ObservableList<User> value) {
        users.set(value);
    }

    public ListProperty<User> usersProperty() {
        return users;
    }