private Map<String, String> buildStatusMap() {
Map<String, String> statusMap = null;
List<ITask> tasks = getSelectedTasks();
ITaskDataManager taskDataManager = TasksUi.getTaskDataManager();
try {
if (tasks.size()>0) {
ITask firstTask = tasks.get(0);
String repositoryUrl = firstTask.getRepositoryUrl();
if (repositoryUrl!=null && taskDataManager.hasTaskData(firstTask)) {
TaskData taskData = taskDataManager.getTaskData(firstTask);
TaskAttribute attribute = taskData.getRoot().getAttribute(RedmineAttribute.STATUS.getTaskKey());
Set<String> commonIds = new HashSet<String>(attribute.getOptions().keySet());
for (ITask task : tasks) {
if (task.getRepositoryUrl().equals(repositoryUrl)) { //Same-Repository-Policy
if (taskDataManager.hasTaskData(task)) {
taskData = taskDataManager.getTaskData(task);
attribute = taskData.getRoot().getAttribute(RedmineAttribute.STATUS.getTaskKey());
commonIds.retainAll(attribute.getOptions().keySet());
}
} else {
return null; //Same-Repository-Policy