*
* TODO: Do some basic input verification
* @return the model represented by this view
*/
public Defect getEditedModel() {
Defect defect = new Defect();
defect.setId(model.getId());
defect.setTitle(txtTitle.getText());
defect.setDescription(txtDescription.getText());
defect.setStatus(DefectStatus.valueOf((String) cmbStatus.getSelectedItem()));
if (!(txtAssignee.getText().equals(""))) {
defect.setAssignee(new User("", txtAssignee.getText(), "", -1));
}
if (!(txtCreator.getText().equals(""))) {
defect.setCreator(new User("", txtCreator.getText(), "", -1));
}
HashSet<Tag> tags = new HashSet<Tag>();
for (int i = 0; i < tagPanel.lmTags.getSize(); i++) {
tags.add(new Tag((String)tagPanel.lmTags.get(i)));
}
defect.setTags(tags);
return defect;
}