Skip to content
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

Feature Request JavaFX8 Properties #1162

Closed
GfOP-MHA opened this issue Jul 27, 2016 · 3 comments
Closed

Feature Request JavaFX8 Properties #1162

GfOP-MHA opened this issue Jul 27, 2016 · 3 comments

Comments

@GfOP-MHA
Copy link

Hello I would like to have some additional Annotations for JavaFX8 Properties.

Something like

@PropertyGetter
@PropertySetter
@Property
private StringProperty test;

which generates

public String getTest(){
    return test.get();
}
public void setTest(String test){
    test.set(test);
}
public StringProperty testProperty(){
    return test;
}

it would be nice to have that for all implementors of the Property Interface
An additionaly usefull thing would be to combine these three Annotations in @properties

I hope you could do that. I love lombok and don't want to go back to writing all my getters & setters by hand just because of using Properties.

@danilov0x33
Copy link

danilov0x33 commented Apr 3, 2017

Actually many people asked to create various annotation like Getter/Setter, but more functional. May be make any opportunity describe how to do it get or set? something like this :

enum MyEnum {A, B, C}

public class Test {
    @Setter(MyEnumSetter.class)
    private MyEnum myEnum;

    public static void main(String[] args) {
        new Test().setMyEnum("A");
    }
}

public class MyEnumSetter implements SetterHandle<Test, String> {
    public void handleSetter(Test obj, Field myEnum, String arg) {
        myEnum.set(obj, MyEnum.valueOf(arg));
    }
}

interface SetterHandle<O, A> {
    void handleSetter(O obj, Field field, A arg);
}

@omega09
Copy link

omega09 commented Apr 3, 2017

Duplicate of #1222

@rspilker
Copy link
Collaborator

Duplicate

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants