Window.alert("Could not retrieve notes: " + throwable.getMessage());
}
public void onSuccess(ArrayList<Note> notesList) {
for (int i = 0; i < notesList.size(); i++) {
final Note note = (Note) notesList.get(i);
final HorizontalPanel noteEntry = new HorizontalPanel();
noteEntry.setStyleName("noteEntry");
final HTML noteTitle = new HTML(note.getTitle());
noteTitle.setStyleName("noteTitle");
final HTML noteText = new HTML(note.getText());
noteText.setStyleName("noteText");
final Button delButton = new Button("Delete");
delButton.setStyleName("noteControls");
delButton.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
deleteNote(note.getPath());
}
});
noteEntry.add(noteTitle);
noteEntry.add(noteText);
noteEntry.add(delButton);