if (dataCol == null) {
return emptyList();
}
List<TreePath> result = newArrayList();
IRepositoryModel repository = TasksUi.getRepositoryModel();
for (ITaskData data : dataCol) {
IFile file = data.get(ITaskData.FILE);
List<Object> segments = newArrayList();
for (ICategory c : provider.getSelected()) {
if (!(c instanceof Category)) {
continue;
}
switch ((Category) c) {
case WORKSPACE:
segments.add(data.get(ITaskData.WORKSPACE));
break;
case DATE:
segments.add(data.get(ITaskData.DATE));
break;
case TASK:
TaskId id = data.get(ITaskData.TASK_ID);
ITask task = repository.getTask(id.getHandleIdentifier());
if (task == null
|| !Objects.equal(id.getCreationDate(), TasksContract.getCreationDate(task))) {
task = new UnrecognizedTask(id);
}
segments.add(task);