Package com.stoyanr.todo.model

Examples of com.stoyanr.todo.model.Item


    public void addItem(String text) {
        assert (text != null);
        assert (!hasItemWithId(nextId));
        Date date = new Date();
        Item item = new Item(null, nextId, text, Priority.MEDIUM, Status.NEW,
            date, date);
        document.getItems().add(item);
        saveItemToStorage(item);
        nextId++;
        storage.setLongValue(getKey(NEXT_ID_KEY), nextId);
View Full Code Here


    }

    private void loadDocumentItemsFromStorage() {
        document.getItems().clear();
        for (long i = 0; i < nextId; i++) {
            Item item = loadItemFromStorage(i);
            if (item != null) {
                document.getItems().add(item);
            }
        }
    }
View Full Code Here

            }
        }
    }

    private Item loadItemFromStorage(long id) {
        Item item = null;
        String value = storage.getStringValue(getKey(ITEM_KEY) + id);
        if (!value.isEmpty()) {
            item = ser.getItem(value);
        }
        return item;
View Full Code Here

TOP

Related Classes of com.stoyanr.todo.model.Item

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.