private void doAdd() { Designer designer = Designer.theDesigner(); String headline = headLineTextField.getText(); int priority = ToDoItem.HIGH_PRIORITY; switch (priorityComboBox.getSelectedIndex()) { case 0: priority = ToDoItem.HIGH_PRIORITY; break; case 1: priority = ToDoItem.MED_PRIORITY; break; case 2: priority = ToDoItem.LOW_PRIORITY; break; } String desc = descriptionTextArea.getText(); String moreInfoURL = moreinfoTextField.getText(); ListSet newOffenders = new ListSet(); for (int i = 0; i < offenderList.getModel().getSize(); i++) { newOffenders.add(offenderList.getModel().getElementAt(i)); } ToDoItem item = new UMLToDoItem(designer, headline, priority, desc, moreInfoURL, newOffenders); designer.getToDoList().addElement(item); // ? inform() Designer.firePropertyChange(Designer.MODEL_TODOITEM_ADDED, null, item); }
/** * Internal method. * * @param e the element */ protected void handleTodoItemEnd(XMLElement e) { ToDoItem item; Designer dsgr; /* This is expected to be safe, don't add a try block here */ dsgr = Designer.theDesigner(); item = new ToDoItem(dsgr, headline, priority, description, moreinfourl, new ListSet()); dsgr.getToDoList().addElement(item); // cat.debug("Added ToDoItem: " + _headline); }
/** * Internal method. * * @param e the element */ protected void handleIssueEnd(XMLElement e) { Designer dsgr; ResolvedCritic item; if (critic == null) { return; } item = new ResolvedCritic(critic, offenders); dsgr = Designer.theDesigner(); dsgr.getToDoList().addResolvedCritic(item); }