Commit 7ab03499 authored by Duilio Protti's avatar Duilio Protti

gwt - trim item on update

parent 620ace71
......@@ -44,7 +44,13 @@ public class ToDoItem {
}
public void setTitle(String title) {
setTitle(title, true);
}
public void setTitle(String title, boolean notify) {
this.title = title;
presenter.itemStateChanged(this);
if (notify) {
presenter.itemStateChanged(this);
}
}
}
......@@ -202,8 +202,10 @@ public class ToDoPresenter {
return;
}
// if the item has become empty, remove it
if (toDoItem.getTitle().trim().equals("")) {
boolean notify = false;
toDoItem.setTitle(toDoItem.getTitle().trim(), notify);
if (toDoItem.getTitle().isEmpty()) {
todos.remove(toDoItem);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment