I'm working on developing an Vaadin application. When developing a Java desktop application I use AbstractAction to create the buttons of my GUI. How to do that using Vaadin
Here is how I do in Java Desktop application:
// In my view
JButton button = new JButton(new Action(BUTTON_NAME, presenter, "methodToInvoke", Object... arguments));
class Action extends AbstractAction {
public Action(ButtonName name, Presenter presenter, String method, Object... arguments) {
this.name = name;
this.presenter = presenter;
this.method = method;
this.arguments = arguments;
readButtonProperties();
}
public void actionPerformed(ActionEvent e) {
//Call method from presenter with arguments using reflection
}
}
Edit:
I already read this. It's not the way I'm asking for.