use of org.apache.tapestry5.integration.app1.data.ToDoItem in project tapestry-5 by apache.
the class ToDoDatabaseImpl method add.
private void add(String title, Urgency urgency, int order) {
ToDoItem item = new ToDoItem();
item.setTitle(title);
item.setUrgency(urgency);
item.setOrder(order);
add(item);
}
use of org.apache.tapestry5.integration.app1.data.ToDoItem in project tapestry-5 by apache.
the class ToDoList method onSuccess.
void onSuccess() {
int order = 0;
for (ToDoItem item : items) {
item.setOrder(order++);
database.update(item);
}
}
use of org.apache.tapestry5.integration.app1.data.ToDoItem in project tapestry-5 by apache.
the class ToDoListVolatile method onSelectedFromAddNew.
void onSelectedFromAddNew() {
if (form.isValid()) {
ToDoItem item = new ToDoItem();
item.setTitle("<New To Do>");
item.setOrder(items.size());
database.add(item);
}
}
use of org.apache.tapestry5.integration.app1.data.ToDoItem in project tapestry-5 by apache.
the class ToDoListVolatile method onSuccess.
void onSuccess() {
int order = 0;
for (ToDoItem item : items) {
item.setOrder(order++);
database.update(item);
}
}
use of org.apache.tapestry5.integration.app1.data.ToDoItem in project tapestry-5 by apache.
the class ShortGrid method getData.
public GridDataSource getData() {
return new GridDataSource() {
public int getAvailableRows() {
return 50;
}
public void prepare(int startIndex, int endIndex, List<SortConstraint> sortConstraints) {
}
public Object getRowValue(int index) {
if (index > 5)
return null;
ToDoItem item = new ToDoItem();
item.setTitle("Index #" + index);
return item;
}
public Class getRowType() {
return ToDoItem.class;
}
};
}
Aggregations