@Override
public void onSuccess(String s) {
dispatcher.dispatch(
new SaveTodo(
new Todo(s)
)
);
}
});
}
});
removeButton = new Button("Remove", new ClickHandler() {
@Override
public void onClick(ClickEvent clickEvent) {
dispatcher.dispatch(new RemoveTodo(selectionModel.getSelectedObject()));
}
});
removeButton.setEnabled(false); // enabled by selection
doneButton = new Button("Done", new ClickHandler() {
@Override
public void onClick(ClickEvent clickEvent) {
Todo todo = selectionModel.getSelectedObject();
todo.setDone(true);
dispatcher.dispatch(new ResolveTodo(todo));
}
});
doneButton.setEnabled(false); // enabled by selection