throw new CoreException(status);
}
}
private boolean initializeNewTaskData(Issue issue, TaskRepository repository, TaskData taskData, IProgressMonitor monitor) throws CoreException {
Configuration conf = connector.getRepositoryConfiguration(repository);
try {
createAttributes(repository, taskData, issue, conf);
createOperations(taskData, issue, conf);
/* Default-Values */
TaskAttribute root = taskData.getRoot();
root.getAttribute(RedmineAttribute.PROJECT.getTaskKey()).setValue(""+issue.getProjectId()); //$NON-NLS-1$
root.getAttribute(RedmineAttribute.TRACKER.getTaskKey()).setValue(""+issue.getTrackerId()); //$NON-NLS-1$
IssuePriority priority = conf.getIssuePriorities().getDefault();
if(priority!=null) {
root.getAttribute(RedmineAttribute.PRIORITY.getTaskKey()).setValue(""+priority.getId()); //$NON-NLS-1$
} else if(conf.getIssuePriorities().getAll().size()>0){
root.getAttribute(RedmineAttribute.PRIORITY.getTaskKey()).setValue(""+conf.getIssuePriorities().getAll().get(0)); //$NON-NLS-1$
}
IssueStatus status = conf.getIssueStatuses().getDefault();
if(status!=null) {
root.getAttribute(RedmineAttribute.STATUS.getTaskKey()).setValue(""+status.getId()); //$NON-NLS-1$
root.getAttribute(RedmineAttribute.STATUS_CHG.getTaskKey()).setValue(""+status.getId()); //$NON-NLS-1$
} else if(conf.getIssueStatuses().getAll().size()>0){
root.getAttribute(RedmineAttribute.STATUS.getTaskKey()).setValue(""+conf.getIssueStatuses().getAll().get(0)); //$NON-NLS-1$
root.getAttribute(RedmineAttribute.STATUS_CHG.getTaskKey()).setValue(""+conf.getIssueStatuses().getAll().get(0)); //$NON-NLS-1$
}
} catch (RedmineStatusException e) {
throw new CoreException(RedmineCorePlugin.toStatus(e, e.getMessage()));
}