use of org.eclipse.mylyn.tasks.core.data.AbstractTaskDataHandler in project eclipse-integration-commons by spring-projects.
the class IdeUiUtils method createTaskData.
private static TaskData createTaskData(final TaskRepository taskRepository, final String projectKey) throws CoreException {
AbstractRepositoryConnector connector = TasksUi.getRepositoryConnector(JIRA_CONNECTOR_KIND);
final AbstractTaskDataHandler taskDataHandler = connector.getTaskDataHandler();
final TaskData taskData = new TaskData(taskDataHandler.getAttributeMapper(taskRepository), JIRA_CONNECTOR_KIND, taskRepository.getRepositoryUrl(), "");
ICoreRunnable runner = new ICoreRunnable() {
public void run(IProgressMonitor monitor) throws CoreException {
TaskMapping mapping = new TaskMapping() {
@Override
public String getProduct() {
return projectKey;
}
};
if (!taskDataHandler.initializeTaskData(taskRepository, taskData, mapping, monitor)) {
throw new CoreException(new Status(Status.ERROR, IdeUiPlugin.PLUGIN_ID, "The repository does not have a project with key: " + projectKey));
}
}
};
UiUtil.busyCursorWhile(runner);
return taskData;
}
Aggregations