Examples of TodoList


Examples of javax.microedition.pim.ToDoList

            if( _todo == null ) {
                throw new PIMException( "PIMItem not found." );
            }

            // open the handheld todos database for remove
            ToDoList todoList;
            if( _serviceName.length() == 0 ) {
                todoList = (ToDoList) BlackBerryPIM.getInstance().openPIMList( PIM.TODO_LIST, PIM.WRITE_ONLY );
            } else {
                todoList = (ToDoList) BlackBerryPIM.getInstance().openPIMList( PIM.TODO_LIST, PIM.WRITE_ONLY, _serviceName );
            }
            todoList.removeToDo( _todo );
            _todo = null;
            return UNDEFINED;
        }
View Full Code Here

Examples of javax.microedition.pim.ToDoList

            }
        }

        boolean isSorted = orderByField != null && orderByField.length() > 0 ? true : false;

        ToDoList taskList;
        try {
            taskList = (ToDoList) PIM.getInstance().openPIMList( PIM.TODO_LIST, PIM.READ_WRITE );
        } catch( PIMException pime ) {
            return tasksFound;
        }

        Vector found = new Vector();
        Enumeration e;
        int iElement = 0;
        try {
            e = taskList.items();
            while( e.hasMoreElements() ) {
                ToDo t = (ToDo) e.nextElement();
                TaskObject task = new TaskObject( t );
                if( testable != null ) {
                    if( testable.test( task ) ) {
View Full Code Here

Examples of org.apache.xmlbeans.samples.validation.todolist.TodolistDocument.Todolist

        System.out.println("Validating on-the-fly: \n");
        m_validationOptions = new XmlOptions();
        m_validationOptions.setValidateOnSet();
       
        TodolistDocument todoList = (TodolistDocument)parseXml(xmlPath, m_validationOptions);
        Todolist list = todoList.getTodolist();
        ItemType firstItem = list.getItemArray(0);

        // Schema defines the <id> element as allowing values up to 100. So
        // this line throws an exception because it invalidates the XML the
        // code is updating.
        firstItem.setId(8587);
View Full Code Here

Examples of org.prevayler.socketserver.example.server.TodoList

  /**
   * @see org.prevayler.socketserver.example.transactions.BeanSetter#lookup(Object)
   */
  protected Object lookup(Object prevalentSystem) throws Exception {
    TodoList todoList = (TodoList) prevalentSystem;
    return todoList.get(id);
  }
View Full Code Here

Examples of org.prevayler.socketserver.example.server.TodoList

  /**
   * @see org.prevayler.util.TransactionWithQuery#executeAndQuery(Object, Date)
   */
  public Object executeAndQuery(Object prevalentSystem, Date timestamp) throws Exception {
    TodoList todoList = (TodoList) prevalentSystem;
    Todo todo = todoList.newTodo();
    todo.setDesc(desc);

    // Notify interested clients that the list just changed
    // Note that much more complex notification schemes can be devised
    // than this.
View Full Code Here

Examples of org.prevayler.socketserver.example.server.TodoList

* @author djo
*/
public class Main {

  public static synchronized void printList(Object todoList) {
    TodoList theList = (TodoList) todoList;
    Todo[] items = theList.toArray();
    for (int i = 0; i < items.length; i++) {
      System.out.println(items[i].getId() + "\t" + items[i].getDesc());
    }
    System.out.println();
  }
View Full Code Here

Examples of se.ironic.modweb.domain.entity.TodoList

            userTransaction.begin();
            List all = crudService.findByNamedQuery(TodoList.ALL);
            assertEquals(0, all.size());

            String name = "Testlist";
            TodoList list = new TodoList(name);
            /* Test create */
            TodoList create = crudService.create(list);

            all = crudService.findByNamedQuery(TodoList.ALL);
            assertEquals(1, all.size());

            /* find flushes so after we should have id in "create" */
            assertNotNull(create.getId());
            assertNotNull(create.getVersion());

            assertEquals(name, create.getName());
            name = "Changed";
            create.setName(name);
            /* Test update */
            TodoList update = crudService.update(create);

            /* Test find (and that update worked) */
            TodoList find = crudService.find(TodoList.class, create.getId());
            assertNotNull(find);
            assertEquals(name, find.getName());

            /* Test delete */
            crudService.delete(find);

            all = crudService.findByNamedQuery(TodoList.ALL);
View Full Code Here

Examples of se.ironic.modweb.domain.entity.TodoList

    @Test(expected = OptimisticLockException.class)
    public void testFailVersion() throws Exception {
        try {
            userTransaction.begin();
            TodoList todoList = new TodoList("Testlist");
            TodoList create = crudService.create(todoList);

            crudService.flush();
            crudService.getEntityManager().detach(todoList);
            List all = crudService.findByNamedQuery(TodoList.ALL);
            assertEquals(1, all.size());
            TodoList find = crudService.find(TodoList.class, create.getId());

            find.setName("Changed");
            crudService.update(find);
            crudService.flush();

            find = crudService.find(TodoList.class, find.getId());
            assertNotSame(todoList.getVersion(), find.getVersion());

            crudService.update(todoList);
            fail("Should have gotten Optimistic lock Ex.");
        } finally {
            userTransaction.rollback();
View Full Code Here

Examples of se.ironic.modweb.domain.entity.TodoList

    @Test
    public void testListWithEntries() throws Exception {
        try {
            userTransaction.begin();
            TodoList todoList = new TodoList("Testlist");

            TodoEntry te1 = creteEntry("#1", "d:#1");
            todoList.getEntries().add(te1);
            TodoList create = crudService.create(todoList);
            crudService.flush();
            List<TodoList> all = crudService.findByNamedQuery(TodoList.ALL);
            assertEquals(1, all.size());
            assertEquals(1, all.iterator().next().getEntries().size());
           
            Long id = create.getId();
           
            crudService.flush();
            TodoList find = crudService.find(TodoList.class, id);
            TodoEntry te2 = creteEntry("#2", "d:#2");
            find.getEntries().add(te2);
           
            crudService.update(find);
            crudService.flush();
            crudService.getEntityManager().clear();
           
            find = crudService.find(TodoList.class, id);
            Iterator<TodoEntry> iterator = find.getEntries().iterator();
            iterator.next();
            iterator.remove();
           
            crudService.flush();
            crudService.getEntityManager().clear();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.