Search in sources :

Example 1 with ToDoItem

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);
}
Also used : ToDoItem(org.apache.tapestry5.integration.app1.data.ToDoItem)

Example 2 with ToDoItem

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);
    }
}
Also used : ToDoItem(org.apache.tapestry5.integration.app1.data.ToDoItem)

Example 3 with ToDoItem

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);
    }
}
Also used : ToDoItem(org.apache.tapestry5.integration.app1.data.ToDoItem)

Example 4 with ToDoItem

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);
    }
}
Also used : ToDoItem(org.apache.tapestry5.integration.app1.data.ToDoItem)

Example 5 with ToDoItem

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;
        }
    };
}
Also used : GridDataSource(org.apache.tapestry5.grid.GridDataSource) ToDoItem(org.apache.tapestry5.integration.app1.data.ToDoItem) List(java.util.List)

Aggregations

ToDoItem (org.apache.tapestry5.integration.app1.data.ToDoItem)11 Comparator (java.util.Comparator)1 List (java.util.List)1 ValueEncoder (org.apache.tapestry5.ValueEncoder)1 GridDataSource (org.apache.tapestry5.grid.GridDataSource)1 Entity (org.apache.tapestry5.integration.app1.data.Entity)1 Track (org.apache.tapestry5.integration.app1.data.Track)1 GenericValueEncoderFactory (org.apache.tapestry5.internal.services.GenericValueEncoderFactory)1 ValueEncoderFactory (org.apache.tapestry5.services.ValueEncoderFactory)1