Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--org.eclipse.mylyn.help.ui/src/org/eclipse/mylyn/internal/help/ui/dialogs/UiLegendDialog.java4
-rw-r--r--org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/AbstractTask.java4
-rw-r--r--org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/AbstractTaskContainer.java22
-rw-r--r--org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/ITaskList.java6
-rw-r--r--org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/ScheduledTaskContainer.java4
-rw-r--r--org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/TaskActivationHistory.java4
-rw-r--r--org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/TaskCategory.java4
-rw-r--r--org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/TaskContainerDelta.java15
-rw-r--r--org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/TaskList.java28
-rw-r--r--org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/externalization/DelegatingTaskExternalizer.java3
-rw-r--r--org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/externalization/TaskListExternalizer.java3
-rw-r--r--org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/sync/SynchronizeTasksJob.java5
-rw-r--r--org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/IRepositoryElement.java (renamed from org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/ITaskElement.java)12
-rw-r--r--org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/ITask.java2
-rw-r--r--org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/ITaskContainer.java29
-rw-r--r--org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/ITaskRepositoryListener.java2
-rw-r--r--org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/ITasksModel.java1
-rw-r--r--org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskDataImportTest.java2
-rw-r--r--org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskListManagerTest.java28
-rw-r--r--org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskListUiTest.java14
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/AbstractTaskListFilter.java16
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/IDynamicSubMenuContributor.java4
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/MoveToCategoryMenuContributor.java10
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/ScheduleDatePicker.java6
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/ScheduleTaskMenuContributor.java14
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TaskHistoryDropDown.java6
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TaskLabelDecorator.java8
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TaskPriorityFilter.java4
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TaskTrimWidget.java4
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TaskWorkingSetFilter.java21
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TasksUiPlugin.java12
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/AbstractChangeCompletionAction.java6
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/AbstractTaskAction.java19
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/ClearOutgoingAction.java6
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/CopyTaskDetailsAction.java6
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/DeleteAction.java6
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/MarkTaskCompleteAction.java6
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/MarkTaskIncompleteAction.java6
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/OpenTaskListElementAction.java3
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/OpenWithBrowserAction.java6
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/RenameAction.java6
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/TaskSelectionDialog.java4
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/commands/AbstractTaskListViewHandler.java8
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/commands/GoToUnreadTaskHandler.java4
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/commands/MarkTaskHandler.java6
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/commands/OpenSelectedTaskHandler.java4
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/commands/OpenTaskListElementPropertiesHandler.java4
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/commands/RemoteTaskSelectionDialog.java6
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/deprecated/AbstractNewRepositoryTaskEditor.java4
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/deprecated/AbstractRepositoryTaskEditor.java5
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorActionContributor.java4
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorActionPart.java4
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/search/SearchResultTreeContentProvider.java4
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/search/SearchScoreComputerAdapterFactory.java4
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/util/TaskDragSourceListener.java13
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/util/TaskListElementImporter.java3
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/util/TasksUiInternal.java17
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/CustomTaskListDecorationDrawer.java16
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TableDecoratingLabelProvider.java13
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListCellModifier.java23
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListContentProvider.java33
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListDropAdapter.java6
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListFilteredTree.java4
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListInterestFilter.java14
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListInterestSorter.java41
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListTableSorter.java42
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListToolTip.java58
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListView.java41
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskScheduleContentProvider.java6
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskTableLabelProvider.java8
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/workingsets/TaskWorkingSetAdapterFactory.java7
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/workingsets/TaskWorkingSetElementAdapter.java6
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/workingsets/TaskWorkingSetPage.java9
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/workingsets/TaskWorkingSetUpdater.java9
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/AbstractRepositoryConnectorUi.java4
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/TaskElementLabelProvider.java70
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/AbstractTaskEditorPage.java4
77 files changed, 443 insertions, 432 deletions
diff --git a/org.eclipse.mylyn.help.ui/src/org/eclipse/mylyn/internal/help/ui/dialogs/UiLegendDialog.java b/org.eclipse.mylyn.help.ui/src/org/eclipse/mylyn/internal/help/ui/dialogs/UiLegendDialog.java
index 891288a10..728c1845e 100644
--- a/org.eclipse.mylyn.help.ui/src/org/eclipse/mylyn/internal/help/ui/dialogs/UiLegendDialog.java
+++ b/org.eclipse.mylyn.help.ui/src/org/eclipse/mylyn/internal/help/ui/dialogs/UiLegendDialog.java
@@ -20,7 +20,7 @@ import org.eclipse.mylyn.internal.provisional.commons.ui.CommonImages;
import org.eclipse.mylyn.internal.provisional.commons.ui.CommonThemes;
import org.eclipse.mylyn.tasks.core.AbstractRepositoryConnector;
import org.eclipse.mylyn.tasks.core.ITask;
-import org.eclipse.mylyn.tasks.core.ITaskElement;
+import org.eclipse.mylyn.tasks.core.IRepositoryElement;
import org.eclipse.mylyn.tasks.core.ITask.PriorityLevel;
import org.eclipse.mylyn.tasks.ui.AbstractRepositoryConnectorUi;
import org.eclipse.mylyn.tasks.ui.LegendElement;
@@ -484,7 +484,7 @@ public class UiLegendDialog extends PopupDialog {
connectorSection.setClient(connectorClient);
Label imageLabel;
- for (ITaskElement taskListElement : elements) {
+ for (IRepositoryElement taskListElement : elements) {
imageLabel = toolkit.createLabel(connectorClient, "");
imageLabel.setImage(labelProvider.getImage(taskListElement));
toolkit.createLabel(connectorClient, taskListElement.getSummary());
diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/AbstractTask.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/AbstractTask.java
index a538f0505..044911525 100644
--- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/AbstractTask.java
+++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/AbstractTask.java
@@ -18,7 +18,7 @@ import java.util.Set;
import org.eclipse.core.runtime.Assert;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.mylyn.tasks.core.ITask;
-import org.eclipse.mylyn.tasks.core.ITaskElement;
+import org.eclipse.mylyn.tasks.core.IRepositoryElement;
/**
* Encapsulates tasks that reside on a repository or local computer and participate in synchronization with the source
@@ -381,7 +381,7 @@ public abstract class AbstractTask extends AbstractTaskContainer implements ITas
}
@Override
- public int compareTo(ITaskElement taskListElement) {
+ public int compareTo(IRepositoryElement taskListElement) {
return summary.compareTo(((AbstractTask) taskListElement).summary);
}
diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/AbstractTaskContainer.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/AbstractTaskContainer.java
index e253ebf88..a8118e03b 100644
--- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/AbstractTaskContainer.java
+++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/AbstractTaskContainer.java
@@ -15,8 +15,9 @@ import java.util.concurrent.CopyOnWriteArrayList;
import org.eclipse.core.runtime.Assert;
import org.eclipse.core.runtime.PlatformObject;
+import org.eclipse.mylyn.tasks.core.IRepositoryElement;
import org.eclipse.mylyn.tasks.core.ITask;
-import org.eclipse.mylyn.tasks.core.ITaskElement;
+import org.eclipse.mylyn.tasks.core.ITaskContainer;
import org.eclipse.mylyn.tasks.core.ITask.PriorityLevel;
/**
@@ -24,7 +25,7 @@ import org.eclipse.mylyn.tasks.core.ITask.PriorityLevel;
*
* @author Mik Kersten
*/
-public abstract class AbstractTaskContainer extends PlatformObject implements ITaskElement {
+public abstract class AbstractTaskContainer extends PlatformObject implements IRepositoryElement, ITaskContainer {
private String handleIdentifier = "";
@@ -76,19 +77,20 @@ public abstract class AbstractTaskContainer extends PlatformObject implements IT
*/
public boolean contains(String handle) {
Assert.isNotNull(handle);
- return containsHelper(children, handle, new HashSet<ITaskElement>());
+ return containsHelper(children, handle, new HashSet<IRepositoryElement>());
}
- private boolean containsHelper(Collection<ITask> children, String handle, Set<ITaskElement> visitedContainers) {
+ private boolean containsHelper(Collection<ITask> children, String handle, Set<IRepositoryElement> visitedContainers) {
for (ITask child : children) {
if (visitedContainers.contains(child)) {
continue;
}
visitedContainers.add(child);
-
- if (handle.equals(child.getHandleIdentifier())
- || containsHelper(child.getChildren(), handle, visitedContainers)) {
- return true;
+ if (child instanceof ITaskContainer) {
+ if (handle.equals(child.getHandleIdentifier())
+ || containsHelper(((ITaskContainer) child).getChildren(), handle, visitedContainers)) {
+ return true;
+ }
}
}
return false;
@@ -132,7 +134,7 @@ public abstract class AbstractTaskContainer extends PlatformObject implements IT
return false;
}
if (object instanceof AbstractTaskContainer) {
- ITaskElement compare = (ITaskElement) object;
+ IRepositoryElement compare = (IRepositoryElement) object;
return this.getHandleIdentifier().equals(compare.getHandleIdentifier());
} else {
return false;
@@ -161,7 +163,7 @@ public abstract class AbstractTaskContainer extends PlatformObject implements IT
/**
* The handle for most containers is their summary. Override to specify a different natural ordering.
*/
- public int compareTo(ITaskElement taskListElement) {
+ public int compareTo(IRepositoryElement taskListElement) {
return getHandleIdentifier().compareTo(taskListElement.getHandleIdentifier());
}
diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/ITaskList.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/ITaskList.java
index b2e78859b..d07909a32 100644
--- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/ITaskList.java
+++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/ITaskList.java
@@ -11,7 +11,7 @@ package org.eclipse.mylyn.internal.tasks.core;
import java.util.Set;
import org.eclipse.mylyn.tasks.core.ITask;
-import org.eclipse.mylyn.tasks.core.ITaskElement;
+import org.eclipse.mylyn.tasks.core.IRepositoryElement;
import org.eclipse.mylyn.tasks.core.ITaskListChangeListener;
/**
@@ -69,9 +69,9 @@ public interface ITaskList {
* @param task
* list element
*/
- public abstract void notifyElementChanged(ITaskElement element);
+ public abstract void notifyElementChanged(IRepositoryElement element);
- public abstract void notifySynchronizationStateChanged(ITaskElement element);
+ public abstract void notifySynchronizationStateChanged(IRepositoryElement element);
public abstract void removeChangeListener(ITaskListChangeListener listener);
diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/ScheduledTaskContainer.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/ScheduledTaskContainer.java
index 279d63429..702881a80 100644
--- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/ScheduledTaskContainer.java
+++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/ScheduledTaskContainer.java
@@ -14,7 +14,7 @@ import java.util.HashSet;
import java.util.Set;
import org.eclipse.mylyn.tasks.core.ITask;
-import org.eclipse.mylyn.tasks.core.ITaskElement;
+import org.eclipse.mylyn.tasks.core.IRepositoryElement;
/**
* @author Rob Elves
@@ -176,7 +176,7 @@ public class ScheduledTaskContainer extends AbstractTaskContainer {
}
@Override
- public int compareTo(ITaskElement element) {
+ public int compareTo(IRepositoryElement element) {
if (element instanceof ScheduledTaskContainer) {
ScheduledTaskContainer container = ((ScheduledTaskContainer) element);
return range.compareTo(container.getDateRange());
diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/TaskActivationHistory.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/TaskActivationHistory.java
index fb28f1502..de6d78417 100644
--- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/TaskActivationHistory.java
+++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/TaskActivationHistory.java
@@ -15,7 +15,7 @@ import java.util.List;
import java.util.Set;
import org.eclipse.mylyn.tasks.core.ITask;
-import org.eclipse.mylyn.tasks.core.ITaskElement;
+import org.eclipse.mylyn.tasks.core.ITaskContainer;
/**
* @author Ken Sueda (original prototype)
@@ -78,7 +78,7 @@ public class TaskActivationHistory {
return getPreviousTasks();
}
Set<ITask> allWorkingSetTasks = new HashSet<ITask>();
- for (ITaskElement container : containers) {
+ for (ITaskContainer container : containers) {
allWorkingSetTasks.addAll(container.getChildren());
}
List<AbstractTask> allScopedTasks = new ArrayList<AbstractTask>(getPreviousTasks());
diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/TaskCategory.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/TaskCategory.java
index 62c205e66..90d6e3a0f 100644
--- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/TaskCategory.java
+++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/TaskCategory.java
@@ -11,7 +11,7 @@
package org.eclipse.mylyn.internal.tasks.core;
import org.eclipse.mylyn.tasks.core.ITask;
-import org.eclipse.mylyn.tasks.core.ITaskElement;
+import org.eclipse.mylyn.tasks.core.ITaskContainer;
/**
* NOTE: this class is likely to change or become API for 3.0
@@ -30,7 +30,7 @@ public final class TaskCategory extends AbstractTaskCategory {
public static AbstractTaskCategory getParentTaskCategory(ITask task) {
AbstractTaskCategory category = null;
if (task != null) {
- for (ITaskElement container : ((AbstractTask) task).getParentContainers()) {
+ for (ITaskContainer container : ((AbstractTask) task).getParentContainers()) {
if (container instanceof AbstractTaskCategory) {
category = (AbstractTaskCategory) container;
}
diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/TaskContainerDelta.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/TaskContainerDelta.java
index 86be081b6..15030f604 100644
--- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/TaskContainerDelta.java
+++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/TaskContainerDelta.java
@@ -8,7 +8,8 @@
package org.eclipse.mylyn.internal.tasks.core;
-import org.eclipse.mylyn.tasks.core.ITaskElement;
+import org.eclipse.mylyn.tasks.core.ITaskContainer;
+import org.eclipse.mylyn.tasks.core.IRepositoryElement;
/**
* Immutable. Defines changes to Task List elements.
@@ -40,9 +41,9 @@ public final class TaskContainerDelta {
ROOT
}
- private final ITaskElement parent;
+ private final ITaskContainer parent;
- private final ITaskElement element;
+ private final IRepositoryElement element;
private final Kind kind;
@@ -53,7 +54,7 @@ public final class TaskContainerDelta {
* - object being moved/added/removed, source assumed to be root
* @since 3.0
*/
- public TaskContainerDelta(ITaskElement element, Kind kind) {
+ public TaskContainerDelta(IRepositoryElement element, Kind kind) {
this.element = element;
this.parent = null;
this.kind = kind;
@@ -62,7 +63,7 @@ public final class TaskContainerDelta {
/**
* @since 3.0
*/
- public TaskContainerDelta(ITaskElement element, ITaskElement parent, Kind kind) {
+ public TaskContainerDelta(IRepositoryElement element, ITaskContainer parent, Kind kind) {
this.element = element;
this.parent = parent;
this.kind = kind;
@@ -73,7 +74,7 @@ public final class TaskContainerDelta {
*
* @since 3.0
*/
- public ITaskElement getParent() {
+ public ITaskContainer getParent() {
return parent;
}
@@ -82,7 +83,7 @@ public final class TaskContainerDelta {
*
* @since 3.0
*/
- public ITaskElement getElement() {
+ public IRepositoryElement getElement() {
return element;
}
diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/TaskList.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/TaskList.java
index 56740e329..82689a16a 100644
--- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/TaskList.java
+++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/TaskList.java
@@ -27,9 +27,9 @@ import org.eclipse.core.runtime.jobs.ISchedulingRule;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.mylyn.commons.core.StatusHandler;
import org.eclipse.mylyn.commons.net.Policy;
+import org.eclipse.mylyn.tasks.core.IRepositoryElement;
import org.eclipse.mylyn.tasks.core.IRepositoryQuery;
import org.eclipse.mylyn.tasks.core.ITask;
-import org.eclipse.mylyn.tasks.core.ITaskElement;
import org.eclipse.mylyn.tasks.core.ITaskListChangeListener;
/**
@@ -39,7 +39,7 @@ import org.eclipse.mylyn.tasks.core.ITaskListChangeListener;
* @author Rob Elves
* @since 3.0
*/
-public class TaskList implements ISchedulingRule, ITaskList {
+public class TaskList implements ITaskList {
private static ILock lock = Job.getJobManager().newLock();
@@ -166,10 +166,6 @@ public class TaskList implements ISchedulingRule, ITaskList {
repositoryOrphansMap.put(orphanedTasksContainer.getRepositoryUrl(), orphanedTasksContainer);
}
- public boolean contains(ISchedulingRule rule) {
- return isConflicting(rule);
- }
-
public void deleteCategory(AbstractTaskCategory category) {
try {
lock();
@@ -366,7 +362,7 @@ public class TaskList implements ISchedulingRule, ITaskList {
return null;
}
- public Set<AbstractTaskCategory> getTaskContainers() {
+ public Set<AbstractTaskCategory> getTaskCategories() {
Set<AbstractTaskCategory> containers = new HashSet<AbstractTaskCategory>();
for (AbstractTaskCategory container : categories.values()) {
if (container instanceof TaskCategory) {
@@ -415,7 +411,7 @@ public class TaskList implements ISchedulingRule, ITaskList {
* if null argument passed or element does not exist in task list
* @return element as passed in or instance from task list with same handle if exists
*/
- private AbstractTaskContainer getValidElement(ITaskElement taskListElement) {
+ private AbstractTaskContainer getValidElement(IRepositoryElement taskListElement) {
AbstractTaskContainer result = null;
if (taskListElement instanceof ITask) {
result = tasks.get(taskListElement.getHandleIdentifier());
@@ -437,16 +433,12 @@ public class TaskList implements ISchedulingRule, ITaskList {
}
}
- public boolean isConflicting(ISchedulingRule rule) {
- return rule instanceof TaskList || rule instanceof ITaskElement;
- }
-
- public void notifyElementsChanged(Set<? extends ITaskElement> elements) {
+ public void notifyElementsChanged(Set<? extends IRepositoryElement> elements) {
HashSet<TaskContainerDelta> deltas = new HashSet<TaskContainerDelta>();
if (elements == null) {
deltas.add(new TaskContainerDelta(null, TaskContainerDelta.Kind.ROOT));
} else {
- for (ITaskElement element : elements) {
+ for (IRepositoryElement element : elements) {
deltas.add(new TaskContainerDelta(element, TaskContainerDelta.Kind.CONTENT));
}
}
@@ -454,9 +446,9 @@ public class TaskList implements ISchedulingRule, ITaskList {
fireDelta(deltas);
}
- public void notifySynchronizationStateChanged(Set<? extends ITaskElement> elements) {
+ public void notifySynchronizationStateChanged(Set<? extends IRepositoryElement> elements) {
HashSet<TaskContainerDelta> taskChangeDeltas = new HashSet<TaskContainerDelta>();
- for (ITaskElement abstractTaskContainer : elements) {
+ for (IRepositoryElement abstractTaskContainer : elements) {
TaskContainerDelta delta = new TaskContainerDelta(abstractTaskContainer, TaskContainerDelta.Kind.CONTENT);
delta.setTransient(true);
taskChangeDeltas.add(delta);
@@ -465,11 +457,11 @@ public class TaskList implements ISchedulingRule, ITaskList {
fireDelta(taskChangeDeltas);
}
- public void notifySynchronizationStateChanged(ITaskElement element) {
+ public void notifySynchronizationStateChanged(IRepositoryElement element) {
notifySynchronizationStateChanged(Collections.singleton(element));
}
- public void notifyElementChanged(ITaskElement element) {
+ public void notifyElementChanged(IRepositoryElement element) {
notifyElementsChanged(Collections.singleton(element));
}
diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/externalization/DelegatingTaskExternalizer.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/externalization/DelegatingTaskExternalizer.java
index 1f6427aeb..27d0b8aee 100644
--- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/externalization/DelegatingTaskExternalizer.java
+++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/externalization/DelegatingTaskExternalizer.java
@@ -45,7 +45,6 @@ import org.eclipse.mylyn.tasks.core.AbstractTaskListMigrator;
import org.eclipse.mylyn.tasks.core.IAttributeContainer;
import org.eclipse.mylyn.tasks.core.IRepositoryQuery;
import org.eclipse.mylyn.tasks.core.ITask;
-import org.eclipse.mylyn.tasks.core.ITaskElement;
import org.eclipse.mylyn.tasks.core.TaskRepository;
import org.eclipse.mylyn.tasks.core.ITask.PriorityLevel;
import org.eclipse.mylyn.tasks.core.ITask.SynchronizationState;
@@ -192,7 +191,7 @@ public final class DelegatingTaskExternalizer {
this.migrators = migrators;
}
- public Element createCategoryElement(ITaskElement category, Document doc, Element parent) {
+ public Element createCategoryElement(AbstractTaskCategory category, Document doc, Element parent) {
Element node = doc.createElement(getCategoryTagName());
node.setAttribute(DelegatingTaskExternalizer.KEY_NAME, category.getSummary());
parent.appendChild(node);
diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/externalization/TaskListExternalizer.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/externalization/TaskListExternalizer.java
index 6bb00be8e..440c8fd7a 100644
--- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/externalization/TaskListExternalizer.java
+++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/externalization/TaskListExternalizer.java
@@ -47,7 +47,6 @@ import org.eclipse.mylyn.internal.tasks.core.TaskList;
import org.eclipse.mylyn.internal.tasks.core.TasksModel;
import org.eclipse.mylyn.internal.tasks.core.deprecated.AbstractTaskListFactory;
import org.eclipse.mylyn.tasks.core.AbstractTaskListMigrator;
-import org.eclipse.mylyn.tasks.core.ITaskElement;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
@@ -121,7 +120,7 @@ public class TaskListExternalizer {
}
// create the category nodes...
- for (ITaskElement category : taskList.getCategories()) {
+ for (AbstractTaskCategory category : taskList.getCategories()) {
delagatingExternalizer.createCategoryElement(category, doc, root);
}
diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/sync/SynchronizeTasksJob.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/sync/SynchronizeTasksJob.java
index 6697bf6c4..daf3569dd 100644
--- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/sync/SynchronizeTasksJob.java
+++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/sync/SynchronizeTasksJob.java
@@ -35,6 +35,7 @@ import org.eclipse.mylyn.internal.tasks.core.deprecated.RepositoryTaskData;
import org.eclipse.mylyn.internal.tasks.core.deprecated.TaskFactory;
import org.eclipse.mylyn.tasks.core.AbstractRepositoryConnector;
import org.eclipse.mylyn.tasks.core.ITask;
+import org.eclipse.mylyn.tasks.core.ITaskContainer;
import org.eclipse.mylyn.tasks.core.ITaskRepositoryManager;
import org.eclipse.mylyn.tasks.core.ITasksModel;
import org.eclipse.mylyn.tasks.core.TaskRepository;
@@ -145,8 +146,8 @@ public class SynchronizeTasksJob extends SynchronizationJob {
updateRelations = false;
for (String taskId : relationsByTaskId.keySet()) {
ITask parentTask = taskList.getTask(taskRepository.getRepositoryUrl(), taskId);
- if (parentTask != null) {
- Set<ITask> removedChildTasks = new HashSet<ITask>(parentTask.getChildren());
+ if (parentTask instanceof ITaskContainer) {
+ Set<ITask> removedChildTasks = new HashSet<ITask>(((ITaskContainer) parentTask).getChildren());
TaskRelation[] relations = relationsByTaskId.get(taskId);
for (TaskRelation relation : relations) {
diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/ITaskElement.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/IRepositoryElement.java
index 519c200ba..45c64770a 100644
--- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/ITaskElement.java
+++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/IRepositoryElement.java
@@ -8,8 +8,6 @@
package org.eclipse.mylyn.tasks.core;
-import java.util.Collection;
-
import org.eclipse.core.runtime.IAdaptable;
/**
@@ -17,15 +15,7 @@ import org.eclipse.core.runtime.IAdaptable;
* @since 3.0
* @noimplement This interface is not intended to be implemented by clients.
*/
-public interface ITaskElement extends Comparable<ITaskElement>, IAdaptable {
-
- /**
- * Returns the children of this task, as defined by a containment hierarchy such as the Task List's categories,
- * queries and substasks. Never returns null.
- *
- * @since 3.0
- */
- public abstract Collection<ITask> getChildren();
+public interface IRepositoryElement extends Comparable<IRepositoryElement>, IAdaptable {
/**
* Returns a readable description of the element.
diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/ITask.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/ITask.java
index cfbf2e3bc..07a462ea3 100644
--- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/ITask.java
+++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/ITask.java
@@ -15,7 +15,7 @@ import java.util.Date;
* @author Steffen Pingel
* @since 3.0
*/
-public interface ITask extends ITaskElement, IAttributeContainer {
+public interface ITask extends IRepositoryElement, IAttributeContainer {
/**
* @since 3.0
diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/ITaskContainer.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/ITaskContainer.java
new file mode 100644
index 000000000..68a18925b
--- /dev/null
+++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/ITaskContainer.java
@@ -0,0 +1,29 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 Mylyn project committers and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *******************************************************************************/
+
+package org.eclipse.mylyn.tasks.core;
+
+import java.util.Collection;
+
+/**
+ * @author Mik Kersten
+ * @author Steffen Pingel
+ * @since 3.0
+ * @noimplement This interface is not intended to be implemented by clients.
+ */
+public interface ITaskContainer {
+
+ /**
+ * Returns the children of this task, as defined by a containment hierarchy such as the Task List's categories,
+ * queries and substasks. Never returns null.
+ *
+ * @since 3.0
+ */
+ public abstract Collection<ITask> getChildren();
+
+} \ No newline at end of file
diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/ITaskRepositoryListener.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/ITaskRepositoryListener.java
index 20599d049..020891d8d 100644
--- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/ITaskRepositoryListener.java
+++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/ITaskRepositoryListener.java
@@ -9,7 +9,7 @@
package org.eclipse.mylyn.tasks.core;
/**
- * Notified of change to task repositories.
+ * Notified of change to the lifecycle of task repositories.
*
* @author Mik Kersten
* @since 2.0
diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/ITasksModel.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/ITasksModel.java
index 7a18712c9..a501ee59b 100644
--- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/ITasksModel.java
+++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/ITasksModel.java
@@ -13,6 +13,7 @@ import org.eclipse.mylyn.tasks.core.data.TaskAttribute;
/**
* @since 3.0
* @author Steffen Pingel
+ * @noimplement This interface is not intended to be implemented by clients.
*/
public interface ITasksModel {
diff --git a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskDataImportTest.java b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskDataImportTest.java
index 55ae67f78..e9409731a 100644
--- a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskDataImportTest.java
+++ b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskDataImportTest.java
@@ -52,7 +52,7 @@ public class TaskDataImportTest extends AbstractContextTest {
assertTrue(sourceZipFile.exists());
// make correct number of categories exist prior to import tests
- assertEquals(1, manager.getTaskList().getTaskContainers().size());
+ assertEquals(1, manager.getTaskList().getTaskCategories().size());
ContextCorePlugin.getContextManager().getActivityMetaContext().reset();
}
diff --git a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskListManagerTest.java b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskListManagerTest.java
index 62b98698f..805260f5d 100644
--- a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskListManagerTest.java
+++ b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskListManagerTest.java
@@ -43,7 +43,7 @@ import org.eclipse.mylyn.internal.tasks.ui.util.TasksUiInternal;
import org.eclipse.mylyn.monitor.core.InteractionEvent;
import org.eclipse.mylyn.tasks.core.IRepositoryQuery;
import org.eclipse.mylyn.tasks.core.ITask;
-import org.eclipse.mylyn.tasks.core.ITaskElement;
+import org.eclipse.mylyn.tasks.core.ITaskContainer;
import org.eclipse.mylyn.tasks.core.TaskRepository;
import org.eclipse.mylyn.tasks.tests.connector.MockAttributeFactory;
import org.eclipse.mylyn.tasks.tests.connector.MockRepositoryConnector;
@@ -293,14 +293,14 @@ public class TaskListManagerTest extends TestCase {
ContextCorePlugin.getContextManager().processActivityMetaContextEvent(
new InteractionEvent(InteractionEvent.Kind.ATTENTION,
- InteractionContextManager.ACTIVITY_STRUCTUREKIND_TIMING, task1.getHandleIdentifier(),
- "origin", null, InteractionContextManager.ACTIVITY_DELTA_ADDED, 1f, startDate.getTime(),
+ InteractionContextManager.ACTIVITY_STRUCTUREKIND_TIMING, task1.getHandleIdentifier(), "origin",
+ null, InteractionContextManager.ACTIVITY_DELTA_ADDED, 1f, startDate.getTime(),
endDate.getTime()));
ContextCorePlugin.getContextManager().processActivityMetaContextEvent(
new InteractionEvent(InteractionEvent.Kind.ATTENTION,
- InteractionContextManager.ACTIVITY_STRUCTUREKIND_TIMING, task2.getHandleIdentifier(),
- "origin", null, InteractionContextManager.ACTIVITY_DELTA_ADDED, 1f, startDate2.getTime(),
+ InteractionContextManager.ACTIVITY_STRUCTUREKIND_TIMING, task2.getHandleIdentifier(), "origin",
+ null, InteractionContextManager.ACTIVITY_DELTA_ADDED, 1f, startDate2.getTime(),
endDate2.getTime()));
assertEquals(2, metaContext.getInteractionHistory().size());
@@ -496,7 +496,7 @@ public class TaskListManagerTest extends TestCase {
TaskCategory category2 = new TaskCategory("cat");
manager.getTaskList().addCategory(category2);
assertEquals(2, manager.getTaskList().getCategories().size());
- ITaskElement container = manager.getTaskList().getContainerForHandle("cat");
+ ITaskContainer container = manager.getTaskList().getContainerForHandle("cat");
assertEquals(container, category);
}
@@ -608,13 +608,13 @@ public class TaskListManagerTest extends TestCase {
manager.readExistingOrCreateNewList();
// read once
- Set<AbstractTaskCategory> readCats = manager.getTaskList().getTaskContainers();
+ Set<AbstractTaskCategory> readCats = manager.getTaskList().getTaskCategories();
assertTrue(manager.getTaskList().getCategories().contains(cat1));
Iterator<AbstractTaskCategory> iterator = readCats.iterator();
boolean found = false;
while (iterator.hasNext()) {
- ITaskElement readCat1 = iterator.next();
+ ITaskContainer readCat1 = iterator.next();
if (cat1.equals(readCat1)) {
found = true;
assertEquals(1, readCat1.getChildren().size());
@@ -630,13 +630,13 @@ public class TaskListManagerTest extends TestCase {
manager.readExistingOrCreateNewList();
// read again
- readCats = manager.getTaskList().getTaskContainers();
+ readCats = manager.getTaskList().getTaskCategories();
assertTrue(manager.getTaskList().getCategories().contains(cat1));
iterator = readCats.iterator();
found = false;
while (iterator.hasNext()) {
- ITaskElement readCat1 = iterator.next();
+ ITaskContainer readCat1 = iterator.next();
if (cat1.equals(readCat1)) {
found = true;
assertEquals(1, readCat1.getChildren().size());
@@ -673,7 +673,7 @@ public class TaskListManagerTest extends TestCase {
for (ITask task : readList) {
if (task.equals(task1)) {
assertEquals(task1.getSummary(), task.getSummary());
- assertEquals(1, task.getChildren().size());
+ assertEquals(1, ((ITaskContainer) task).getChildren().size());
}
}
}
@@ -731,16 +731,16 @@ public class TaskListManagerTest extends TestCase {
for (ITask task : readList) {
if (task.equals(task1)) {
assertEquals(task1.getSummary(), task.getSummary());
- assertEquals(1, task.getChildren().size());
+ assertEquals(1, ((AbstractTaskContainer) task).getChildren().size());
}
}
- Set<AbstractTaskCategory> readCats = manager.getTaskList().getTaskContainers();
+ Set<AbstractTaskCategory> readCats = manager.getTaskList().getTaskCategories();
assertTrue(manager.getTaskList().getCategories().contains(cat1));
Iterator<AbstractTaskCategory> iterator = readCats.iterator();
boolean found = false;
while (iterator.hasNext()) {
- ITaskElement readCat1 = iterator.next();
+ ITaskContainer readCat1 = iterator.next();
if (cat1.equals(readCat1)) {
found = true;
for (ITask task : readCat1.getChildren()) {
diff --git a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskListUiTest.java b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskListUiTest.java
index d79cc154c..844080de8 100644
--- a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskListUiTest.java
+++ b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskListUiTest.java
@@ -31,7 +31,7 @@ import org.eclipse.mylyn.internal.tasks.ui.util.TasksUiInternal;
import org.eclipse.mylyn.internal.tasks.ui.views.TaskListView;
import org.eclipse.mylyn.internal.web.tasks.WebTask;
import org.eclipse.mylyn.tasks.core.ITask;
-import org.eclipse.mylyn.tasks.core.ITaskElement;
+import org.eclipse.mylyn.tasks.core.IRepositoryElement;
import org.eclipse.mylyn.tasks.core.ITaskListChangeListener;
import org.eclipse.mylyn.tasks.core.ITask.PriorityLevel;
import org.eclipse.mylyn.tasks.tests.connector.MockRepositoryQuery;
@@ -171,7 +171,7 @@ public class TaskListUiTest extends TestCase {
view.getViewer().refresh();
// Arrays.asList(view.getViewer().getVisibleExpandedElements());
assertFalse(webTask.isCompleted());
- ArrayList<ITaskElement> tasks = new ArrayList<ITaskElement>();
+ ArrayList<IRepositoryElement> tasks = new ArrayList<IRepositoryElement>();
tasks.add(webTask);
new MarkTaskCompleteAction(tasks).run();
assertTrue(webTask.isCompleted());
@@ -232,7 +232,7 @@ public class TaskListUiTest extends TestCase {
public void testGetSubMenuManagerContainsAllCategoriesPlusNewCategory() {
// setup
MoveToCategoryMenuContributor moveToMenuContrib = new MoveToCategoryMenuContributor();
- List<ITaskElement> selectedElements = new Vector<ITaskElement>();
+ List<IRepositoryElement> selectedElements = new Vector<IRepositoryElement>();
selectedElements.add(cat1task1);
int numCategories = manager.getTaskList().getCategories().size();
int numSeparators = 1;
@@ -263,15 +263,15 @@ public class TaskListUiTest extends TestCase {
//setup
MoveToCategoryMenuContributor moveToMenuContrib = new MoveToCategoryMenuContributor();
MenuManager menuManager = null;
- List<ITaskElement> selectedElements = new Vector<ITaskElement>();
+ List<IRepositoryElement> selectedElements = new Vector<IRepositoryElement>();
selectedElements.add(cat1task1);
- List<ITaskElement> emptySelection = new Vector<ITaskElement>();
+ List<IRepositoryElement> emptySelection = new Vector<IRepositoryElement>();
- List<ITaskElement> categorySelection = new Vector<ITaskElement>();
+ List<IRepositoryElement> categorySelection = new Vector<IRepositoryElement>();
categorySelection.add(cat1);
- List<ITaskElement> querySelection = new Vector<ITaskElement>();
+ List<IRepositoryElement> querySelection = new Vector<IRepositoryElement>();
querySelection.add(new MockRepositoryQuery("query", null));
//execute system under test & assert
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/AbstractTaskListFilter.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/AbstractTaskListFilter.java
index 65f2f5563..2f060e28e 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/AbstractTaskListFilter.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/AbstractTaskListFilter.java
@@ -11,7 +11,7 @@ import java.util.Collection;
import org.eclipse.mylyn.internal.tasks.core.ITasksCoreConstants;
import org.eclipse.mylyn.tasks.core.ITask;
-import org.eclipse.mylyn.tasks.core.ITaskElement;
+import org.eclipse.mylyn.tasks.core.ITaskContainer;
import org.eclipse.mylyn.tasks.core.ITask.SynchronizationState;
/**
@@ -29,15 +29,15 @@ public abstract class AbstractTaskListFilter {
*
* TODO: Move to an internal utility class
*/
- public static boolean hasDescendantIncoming(ITaskElement container) {
+ public static boolean hasDescendantIncoming(ITaskContainer container) {
return hasDescendantIncoming(container, ITasksCoreConstants.MAX_SUBTASK_DEPTH);
}
- public static boolean hasIncompleteDescendant(ITaskElement container) {
+ public static boolean hasIncompleteDescendant(ITaskContainer container) {
return hasIncompleteDescendant(container, ITasksCoreConstants.MAX_SUBTASK_DEPTH);
}
- private static boolean hasDescendantIncoming(ITaskElement container, int depth) {
+ private static boolean hasDescendantIncoming(ITaskContainer container, int depth) {
Collection<ITask> children = container.getChildren();
if (children == null || depth <= 0) {
return false;
@@ -48,8 +48,8 @@ public abstract class AbstractTaskListFilter {
ITask containedRepositoryTask = task;
if (containedRepositoryTask.getSynchronizationState() == SynchronizationState.INCOMING) {
return true;
- } else if (TasksUiPlugin.getDefault().groupSubtasks(container)
- && hasDescendantIncoming(task, depth - 1)) {
+ } else if (TasksUiPlugin.getDefault().groupSubtasks(container) && task instanceof ITaskContainer
+ && hasDescendantIncoming((ITaskContainer) task, depth - 1)) {
return true;
}
}
@@ -57,7 +57,7 @@ public abstract class AbstractTaskListFilter {
return false;
}
- private static boolean hasIncompleteDescendant(ITaskElement container, int depth) {
+ private static boolean hasIncompleteDescendant(ITaskContainer container, int depth) {
Collection<ITask> children = container.getChildren();
if (children == null || depth <= 0) {
return false;
@@ -68,7 +68,7 @@ public abstract class AbstractTaskListFilter {
ITask containedRepositoryTask = task;
if (!containedRepositoryTask.isCompleted()) {
return true;
- } else if (hasIncompleteDescendant(task, depth - 1)) {
+ } else if (task instanceof ITaskContainer && hasIncompleteDescendant((ITaskContainer) task, depth - 1)) {
return true;
}
}
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/IDynamicSubMenuContributor.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/IDynamicSubMenuContributor.java
index 1ce4ca9f7..0906cd284 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/IDynamicSubMenuContributor.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/IDynamicSubMenuContributor.java
@@ -10,13 +10,13 @@ package org.eclipse.mylyn.internal.tasks.ui;
import java.util.List;
import org.eclipse.jface.action.MenuManager;
-import org.eclipse.mylyn.tasks.core.ITaskElement;
+import org.eclipse.mylyn.tasks.core.IRepositoryElement;
/**
* @author Mik Kersten
*/
public interface IDynamicSubMenuContributor {
- public abstract MenuManager getSubMenuManager(List<ITaskElement> selectedElements);
+ public abstract MenuManager getSubMenuManager(List<IRepositoryElement> selectedElements);
}
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/MoveToCategoryMenuContributor.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/MoveToCategoryMenuContributor.java
index 8fb65bf4e..15ca1f16d 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/MoveToCategoryMenuContributor.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/MoveToCategoryMenuContributor.java
@@ -21,8 +21,8 @@ import org.eclipse.mylyn.internal.tasks.core.AbstractTaskCategory;
import org.eclipse.mylyn.internal.tasks.core.UnmatchedTaskContainer;
import org.eclipse.mylyn.internal.tasks.ui.actions.NewCategoryAction;
import org.eclipse.mylyn.internal.tasks.ui.util.TasksUiInternal;
+import org.eclipse.mylyn.tasks.core.IRepositoryElement;
import org.eclipse.mylyn.tasks.core.ITask;
-import org.eclipse.mylyn.tasks.core.ITaskElement;
import org.eclipse.mylyn.tasks.ui.TasksUiImages;
/**
@@ -33,12 +33,12 @@ public class MoveToCategoryMenuContributor implements IDynamicSubMenuContributor
private static final String LABEL = "Move to";
- public MenuManager getSubMenuManager(final List<ITaskElement> selectedElements) {
+ public MenuManager getSubMenuManager(final List<IRepositoryElement> selectedElements) {
final MenuManager subMenuManager = new MenuManager(LABEL);
// Compute selected tasks
List<AbstractTask> selectedTasks = new ArrayList<AbstractTask>(selectedElements.size());
- for (ITaskElement element : selectedElements) {
+ for (IRepositoryElement element : selectedElements) {
if (element instanceof ITask) {
selectedTasks.add((AbstractTask) element);
}
@@ -108,8 +108,8 @@ public class MoveToCategoryMenuContributor implements IDynamicSubMenuContributor
* @param selectedElements
* @param category
*/
- private void moveToCategory(final List<ITaskElement> selectedElements, AbstractTaskCategory category) {
- for (ITaskElement element : selectedElements) {
+ private void moveToCategory(final List<IRepositoryElement> selectedElements, AbstractTaskCategory category) {
+ for (IRepositoryElement element : selectedElements) {
if (element instanceof ITask) {
TasksUiInternal.getTaskList().addTask((AbstractTask) element, category);
}
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/ScheduleDatePicker.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/ScheduleDatePicker.java
index f5475ec9e..110cbb1c7 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/ScheduleDatePicker.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/ScheduleDatePicker.java
@@ -18,7 +18,7 @@ import org.eclipse.jface.action.MenuManager;
import org.eclipse.mylyn.internal.provisional.commons.ui.DatePicker;
import org.eclipse.mylyn.internal.tasks.core.AbstractTask;
import org.eclipse.mylyn.internal.tasks.core.DateRange;
-import org.eclipse.mylyn.tasks.core.ITaskElement;
+import org.eclipse.mylyn.tasks.core.IRepositoryElement;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
@@ -46,7 +46,7 @@ public class ScheduleDatePicker extends Composite {
private final String initialText = DatePicker.LABEL_CHOOSE;
- private final List<ITaskElement> tasks;
+ private final List<IRepositoryElement> tasks;
private final ScheduleTaskMenuContributor contributor;
@@ -81,7 +81,7 @@ public class ScheduleDatePicker extends Composite {
notifyPickerListeners();
}
};
- tasks = new ArrayList<ITaskElement>();
+ tasks = new ArrayList<IRepositoryElement>();
tasks.add(task);
}
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/ScheduleTaskMenuContributor.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/ScheduleTaskMenuContributor.java
index 3648f5f2b..bb44f1c9b 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/ScheduleTaskMenuContributor.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/ScheduleTaskMenuContributor.java
@@ -24,8 +24,8 @@ import org.eclipse.mylyn.internal.tasks.core.AbstractTask;
import org.eclipse.mylyn.internal.tasks.core.DateRange;
import org.eclipse.mylyn.internal.tasks.core.TaskActivityUtil;
import org.eclipse.mylyn.internal.tasks.core.WeekDateRange;
+import org.eclipse.mylyn.tasks.core.IRepositoryElement;
import org.eclipse.mylyn.tasks.core.ITask;
-import org.eclipse.mylyn.tasks.core.ITaskElement;
import org.eclipse.ui.PlatformUI;
/**
@@ -44,16 +44,16 @@ public class ScheduleTaskMenuContributor implements IDynamicSubMenuContributor {
private AbstractTask singleTaskSelection;
- private final List<ITaskElement> taskListElementsToSchedule = new ArrayList<ITaskElement>();
+ private final List<IRepositoryElement> taskListElementsToSchedule = new ArrayList<IRepositoryElement>();
- public MenuManager getSubMenuManager(final List<ITaskElement> selectedElements) {
+ public MenuManager getSubMenuManager(final List<IRepositoryElement> selectedElements) {
taskListElementsToSchedule.clear();
final MenuManager subMenuManager = new MenuManager(LABEL_REMINDER);
if (selectedElements.size() == 1) {
- ITaskElement selectedElement = selectedElements.get(0);
+ IRepositoryElement selectedElement = selectedElements.get(0);
if (selectedElement instanceof ITask) {
singleTaskSelection = (AbstractTask) selectedElement;
if (singleTaskSelection.isCompleted()) {
@@ -71,7 +71,7 @@ public class ScheduleTaskMenuContributor implements IDynamicSubMenuContributor {
}
}
- for (ITaskElement selectedElement : selectedElements) {
+ for (IRepositoryElement selectedElement : selectedElements) {
if (selectedElement instanceof ITask) {
taskListElementsToSchedule.add(selectedElement);
}
@@ -219,7 +219,7 @@ public class ScheduleTaskMenuContributor implements IDynamicSubMenuContributor {
// }
protected void setScheduledDate(DateRange dateContainer) {
- for (ITaskElement element : taskListElementsToSchedule) {
+ for (IRepositoryElement element : taskListElementsToSchedule) {
AbstractTask task = getTaskForElement(element, true);
if (dateContainer != null) {
TasksUiPlugin.getTaskActivityManager().setScheduledFor(task, dateContainer);
@@ -244,7 +244,7 @@ public class ScheduleTaskMenuContributor implements IDynamicSubMenuContributor {
return TasksUiPlugin.getTaskActivityManager().isPastReminder(task);
}
- private AbstractTask getTaskForElement(ITaskElement element, boolean force) {
+ private AbstractTask getTaskForElement(IRepositoryElement element, boolean force) {
AbstractTask task = null;
if (element instanceof ITask) {
task = (AbstractTask) element;
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TaskHistoryDropDown.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TaskHistoryDropDown.java
index 078e5fafc..4b2351995 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TaskHistoryDropDown.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TaskHistoryDropDown.java
@@ -26,7 +26,7 @@ import org.eclipse.mylyn.internal.tasks.ui.actions.ActivateTaskDialogAction;
import org.eclipse.mylyn.internal.tasks.ui.actions.TaskActivateAction;
import org.eclipse.mylyn.internal.tasks.ui.views.TaskListView;
import org.eclipse.mylyn.tasks.core.ITask;
-import org.eclipse.mylyn.tasks.core.ITaskElement;
+import org.eclipse.mylyn.tasks.core.ITaskContainer;
import org.eclipse.mylyn.tasks.ui.TaskElementLabelProvider;
import org.eclipse.mylyn.tasks.ui.TasksUi;
import org.eclipse.mylyn.tasks.ui.TasksUiImages;
@@ -150,8 +150,8 @@ public class TaskHistoryDropDown extends CompoundContributionItem {
for (IWorkingSet workingSet : sets) {
IAdaptable[] elements = workingSet.getElements();
for (IAdaptable adaptable : elements) {
- if (adaptable instanceof ITaskElement) {
- allWorkingSetTasks.addAll(((ITaskElement) adaptable).getChildren());
+ if (adaptable instanceof ITaskContainer) {
+ allWorkingSetTasks.addAll(((ITaskContainer) adaptable).getChildren());
}
}
}
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TaskLabelDecorator.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TaskLabelDecorator.java
index 6ee311d8d..79a96ce8e 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TaskLabelDecorator.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TaskLabelDecorator.java
@@ -16,10 +16,8 @@ import org.eclipse.jface.viewers.IDecoration;
import org.eclipse.jface.viewers.ILabelProviderListener;
import org.eclipse.jface.viewers.ILightweightLabelDecorator;
import org.eclipse.mylyn.internal.provisional.commons.ui.CommonImages;
-import org.eclipse.mylyn.internal.tasks.ui.util.TasksUiInternal;
import org.eclipse.mylyn.tasks.core.IRepositoryQuery;
import org.eclipse.mylyn.tasks.core.ITask;
-import org.eclipse.mylyn.tasks.core.ITaskElement;
import org.eclipse.mylyn.tasks.core.TaskRepository;
import org.eclipse.mylyn.tasks.core.ITask.PriorityLevel;
import org.eclipse.mylyn.tasks.ui.AbstractRepositoryConnectorUi;
@@ -99,10 +97,8 @@ public class TaskLabelDecorator implements ILightweightLabelDecorator {
}
}
if (element instanceof ITask) {
- ITask task = TasksUiInternal.getCorrespondingTask((ITaskElement) element);
- if (task != null) {
- return TasksUiImages.getImageDescriptorForPriority(PriorityLevel.fromString(task.getPriority()));
- }
+ ITask task = (ITask) element;
+ return TasksUiImages.getImageDescriptorForPriority(PriorityLevel.fromString(task.getPriority()));
}
return null;
}
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TaskPriorityFilter.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TaskPriorityFilter.java
index 232ee825e..9eaca0159 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TaskPriorityFilter.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TaskPriorityFilter.java
@@ -9,7 +9,7 @@ package org.eclipse.mylyn.internal.tasks.ui;
import org.eclipse.mylyn.internal.tasks.core.AbstractTaskContainer;
import org.eclipse.mylyn.internal.tasks.ui.views.TaskListView;
-import org.eclipse.mylyn.tasks.core.ITaskElement;
+import org.eclipse.mylyn.tasks.core.IRepositoryElement;
import org.eclipse.mylyn.tasks.core.ITask.PriorityLevel;
/**
@@ -32,7 +32,7 @@ public class TaskPriorityFilter extends AbstractTaskListFilter {
@Override
public boolean select(Object parent, Object element) {
- if (element instanceof ITaskElement) {
+ if (element instanceof IRepositoryElement) {
String priority = ((AbstractTaskContainer) element).getPriority();
if (priority == null || !(priority.startsWith(PRIORITY_PREFIX))) {
return true;
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TaskTrimWidget.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TaskTrimWidget.java
index e21860c49..66cbe1382 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TaskTrimWidget.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TaskTrimWidget.java
@@ -32,7 +32,7 @@ import org.eclipse.mylyn.internal.tasks.ui.util.TasksUiInternal;
import org.eclipse.mylyn.internal.tasks.ui.views.TaskListView;
import org.eclipse.mylyn.tasks.core.ITask;
import org.eclipse.mylyn.tasks.core.ITaskActivationListener;
-import org.eclipse.mylyn.tasks.core.ITaskElement;
+import org.eclipse.mylyn.tasks.core.IRepositoryElement;
import org.eclipse.mylyn.tasks.core.TaskActivationAdapter;
import org.eclipse.mylyn.tasks.ui.TasksUi;
import org.eclipse.swt.SWT;
@@ -283,7 +283,7 @@ public class TaskTrimWidget extends WorkbenchWindowControlContribution {
for (String menuPath : TasksUiPlugin.getDefault().getDynamicMenuMap().keySet()) {
for (IDynamicSubMenuContributor contributor : TasksUiPlugin.getDefault().getDynamicMenuMap().get(
menuPath)) {
- List<ITaskElement> selectedElements = new ArrayList<ITaskElement>();
+ List<IRepositoryElement> selectedElements = new ArrayList<IRepositoryElement>();
selectedElements.add(activeTask);
MenuManager subMenuManager = contributor.getSubMenuManager(selectedElements);
if (subMenuManager != null) {
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TaskWorkingSetFilter.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TaskWorkingSetFilter.java
index ffa350548..eef1fcc82 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TaskWorkingSetFilter.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TaskWorkingSetFilter.java
@@ -13,8 +13,9 @@ import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.mylyn.internal.tasks.core.AbstractTask;
import org.eclipse.mylyn.internal.tasks.core.LocalTask;
import org.eclipse.mylyn.internal.tasks.core.ScheduledTaskContainer;
+import org.eclipse.mylyn.tasks.core.IRepositoryElement;
import org.eclipse.mylyn.tasks.core.ITask;
-import org.eclipse.mylyn.tasks.core.ITaskElement;
+import org.eclipse.mylyn.tasks.core.ITaskContainer;
import org.eclipse.ui.IWorkingSet;
/**
@@ -38,19 +39,19 @@ public class TaskWorkingSetFilter extends AbstractTaskListFilter {
return true;
}
- if (parent == null && element instanceof ITaskElement) {
- return isContainedInWorkingSet((ITaskElement) element);
+ if (parent == null && element instanceof IRepositoryElement) {
+ return isContainedInWorkingSet((IRepositoryElement) element);
}
- if (parent instanceof ITaskElement && !(parent instanceof ScheduledTaskContainer)) {
- return isContainedInWorkingSet((ITaskElement) parent);
+ if (parent instanceof ITaskContainer && !(parent instanceof ScheduledTaskContainer)) {
+ return isContainedInWorkingSet((IRepositoryElement) parent);
}
if (element instanceof LocalTask) {
- for (ITaskElement container : ((LocalTask) element).getParentContainers()) {
+ for (IRepositoryElement container : ((LocalTask) element).getParentContainers()) {
return isContainedInWorkingSet(container);
}
}
if (parent instanceof ScheduledTaskContainer && element instanceof ITask) {
- for (ITaskElement query : ((AbstractTask) element).getParentContainers()) {
+ for (IRepositoryElement query : ((AbstractTask) element).getParentContainers()) {
if (isContainedInWorkingSet(query)) {
return true;
}
@@ -60,7 +61,7 @@ public class TaskWorkingSetFilter extends AbstractTaskListFilter {
return true;
}
- private boolean isContainedInWorkingSet(ITaskElement container) {
+ private boolean isContainedInWorkingSet(IRepositoryElement container) {
if (elements == null) {
return true;
}
@@ -68,9 +69,9 @@ public class TaskWorkingSetFilter extends AbstractTaskListFilter {
boolean seenTaskWorkingSets = false;
String handleIdentifier = container.getHandleIdentifier();
for (IAdaptable adaptable : elements) {
- if (adaptable instanceof ITaskElement) {
+ if (adaptable instanceof IRepositoryElement) {
seenTaskWorkingSets = true;
- if (handleIdentifier.equals(((ITaskElement) adaptable).getHandleIdentifier())) {
+ if (handleIdentifier.equals(((IRepositoryElement) adaptable).getHandleIdentifier())) {
return true;
}
}
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TasksUiPlugin.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TasksUiPlugin.java
index 41e7219e9..152228230 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TasksUiPlugin.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TasksUiPlugin.java
@@ -83,7 +83,7 @@ import org.eclipse.mylyn.tasks.core.AbstractRepositoryConnector;
import org.eclipse.mylyn.tasks.core.IRepositoryQuery;
import org.eclipse.mylyn.tasks.core.ITask;
import org.eclipse.mylyn.tasks.core.ITaskActivationListener;
-import org.eclipse.mylyn.tasks.core.ITaskElement;
+import org.eclipse.mylyn.tasks.core.ITaskContainer;
import org.eclipse.mylyn.tasks.core.RepositoryTemplate;
import org.eclipse.mylyn.tasks.core.TaskActivationAdapter;
import org.eclipse.mylyn.tasks.core.TaskRepository;
@@ -856,12 +856,12 @@ public class TasksUiPlugin extends AbstractUIPlugin {
return INSTANCE;
}
- public boolean groupSubtasks(ITaskElement container) {
+ public boolean groupSubtasks(ITaskContainer element) {
boolean groupSubtasks = TasksUiPlugin.getDefault().getPreferenceStore().getBoolean(
ITasksUiPreferenceConstants.GROUP_SUBTASKS);
- if (container instanceof ITask) {
- AbstractRepositoryConnectorUi connectorUi = TasksUiPlugin.getConnectorUi(((ITask) container).getConnectorKind());
+ if (element instanceof ITask) {
+ AbstractRepositoryConnectorUi connectorUi = TasksUiPlugin.getConnectorUi(((ITask) element).getConnectorKind());
if (connectorUi != null) {
if (connectorUi.forceSubtaskHierarchy()) {
groupSubtasks = true;
@@ -869,8 +869,8 @@ public class TasksUiPlugin extends AbstractUIPlugin {
}
}
- if (container instanceof IRepositoryQuery) {
- AbstractRepositoryConnectorUi connectorUi = TasksUiPlugin.getConnectorUi(((IRepositoryQuery) container).getConnectorKind());
+ if (element instanceof IRepositoryQuery) {
+ AbstractRepositoryConnectorUi connectorUi = TasksUiPlugin.getConnectorUi(((IRepositoryQuery) element).getConnectorKind());
if (connectorUi != null) {
if (connectorUi.forceSubtaskHierarchy()) {
groupSubtasks = true;
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/AbstractChangeCompletionAction.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/AbstractChangeCompletionAction.java
index e4d25c47b..08714170f 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/AbstractChangeCompletionAction.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/AbstractChangeCompletionAction.java
@@ -12,17 +12,17 @@ import java.util.List;
import org.eclipse.jface.action.Action;
import org.eclipse.mylyn.internal.tasks.core.AbstractTask;
+import org.eclipse.mylyn.tasks.core.IRepositoryElement;
import org.eclipse.mylyn.tasks.core.ITask;
-import org.eclipse.mylyn.tasks.core.ITaskElement;
/**
* @author Mik Kersten
*/
public class AbstractChangeCompletionAction extends Action {
- protected boolean shouldEnable(List<ITaskElement> selectedElements) {
+ protected boolean shouldEnable(List<IRepositoryElement> selectedElements) {
boolean allLocalTasks = true;
- for (ITaskElement abstractTaskContainer : selectedElements) {
+ for (IRepositoryElement abstractTaskContainer : selectedElements) {
if (!(abstractTaskContainer instanceof ITask)) {
allLocalTasks = false;
break;
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/AbstractTaskAction.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/AbstractTaskAction.java
index 8886886a2..5a7bc456b 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/AbstractTaskAction.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/AbstractTaskAction.java
@@ -11,23 +11,24 @@ package org.eclipse.mylyn.internal.tasks.ui.actions;
import java.util.List;
import org.eclipse.jface.action.Action;
-import org.eclipse.mylyn.internal.tasks.core.RepositoryQuery;
import org.eclipse.mylyn.internal.tasks.core.AbstractTask;
import org.eclipse.mylyn.internal.tasks.core.AbstractTaskContainer;
+import org.eclipse.mylyn.internal.tasks.core.RepositoryQuery;
+import org.eclipse.mylyn.tasks.core.IRepositoryElement;
import org.eclipse.mylyn.tasks.core.IRepositoryQuery;
import org.eclipse.mylyn.tasks.core.ITask;
-import org.eclipse.mylyn.tasks.core.ITaskElement;
+import org.eclipse.mylyn.tasks.core.ITaskContainer;
/**
* @author Rob Elves
*/
public abstract class AbstractTaskAction extends Action {
- protected List<ITaskElement> selectedElements;
+ protected List<IRepositoryElement> selectedElements;
@Override
public void run() {
- for (ITaskElement element : selectedElements) {
+ for (IRepositoryElement element : selectedElements) {
if (element instanceof ITask) {
AbstractTask repositoryTask = (AbstractTask) element;
performActionOnTask(repositoryTask);
@@ -36,11 +37,11 @@ public abstract class AbstractTaskAction extends Action {
for (ITask queryHit : repositoryQuery.getChildren()) {
performActionOnTask(queryHit);
}
- } else if (element != null) {
- ITaskElement container = element;
- for (ITask iTask : container.getChildren()) {
- if (iTask != null) {
- ITask repositoryTask = iTask;
+ } else if (element instanceof ITaskContainer) {
+ ITaskContainer container = (ITaskContainer) element;
+ for (ITask task : container.getChildren()) {
+ if (task != null) {
+ ITask repositoryTask = task;
performActionOnTask(repositoryTask);
}
}
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/ClearOutgoingAction.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/ClearOutgoingAction.java
index 55c807dc4..f4e08f71c 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/ClearOutgoingAction.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/ClearOutgoingAction.java
@@ -19,7 +19,7 @@ import org.eclipse.mylyn.internal.tasks.core.AbstractTask;
import org.eclipse.mylyn.internal.tasks.ui.TasksUiPlugin;
import org.eclipse.mylyn.internal.tasks.ui.util.TasksUiInternal;
import org.eclipse.mylyn.tasks.core.ITask;
-import org.eclipse.mylyn.tasks.core.ITaskElement;
+import org.eclipse.mylyn.tasks.core.IRepositoryElement;
import org.eclipse.mylyn.tasks.core.ITask.SynchronizationState;
import org.eclipse.mylyn.tasks.ui.TasksUi;
@@ -34,9 +34,9 @@ public class ClearOutgoingAction extends Action {
public static final String ID = "org.eclipse.mylyn.tasklist.actions.mark.discard";
- private final List<ITaskElement> selectedElements;
+ private final List<IRepositoryElement> selectedElements;
- public ClearOutgoingAction(List<ITaskElement> selectedElements) {
+ public ClearOutgoingAction(List<IRepositoryElement> selectedElements) {
this.selectedElements = selectedElements;
setText(ACTION_NAME);
setToolTipText(ACTION_NAME);
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/CopyTaskDetailsAction.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/CopyTaskDetailsAction.java
index 1cd01ec18..02eaba55b 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/CopyTaskDetailsAction.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/CopyTaskDetailsAction.java
@@ -16,9 +16,9 @@ import org.eclipse.mylyn.internal.tasks.core.deprecated.RepositoryTaskData;
import org.eclipse.mylyn.internal.tasks.ui.editors.RepositoryTaskSelection;
import org.eclipse.mylyn.internal.tasks.ui.util.TasksUiInternal;
import org.eclipse.mylyn.tasks.core.AbstractRepositoryConnector;
+import org.eclipse.mylyn.tasks.core.IRepositoryElement;
import org.eclipse.mylyn.tasks.core.IRepositoryQuery;
import org.eclipse.mylyn.tasks.core.ITask;
-import org.eclipse.mylyn.tasks.core.ITaskElement;
import org.eclipse.mylyn.tasks.ui.TasksUi;
import org.eclipse.swt.dnd.Clipboard;
import org.eclipse.swt.dnd.TextTransfer;
@@ -94,8 +94,8 @@ public class CopyTaskDetailsAction extends BaseSelectionListenerAction {
RepositoryQuery query = (RepositoryQuery) object;
text += query.getSummary();
text += "\n" + query.getUrl();
- } else if (object instanceof ITaskElement) {
- ITaskElement element = (ITaskElement) object;
+ } else if (object instanceof IRepositoryElement) {
+ IRepositoryElement element = (IRepositoryElement) object;
text = element.getSummary();
} else if (object instanceof RepositoryTaskSelection) {
RepositoryTaskSelection selection = (RepositoryTaskSelection) object;
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/DeleteAction.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/DeleteAction.java
index 51e6dd1ba..bc9a90e61 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/DeleteAction.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/DeleteAction.java
@@ -21,9 +21,9 @@ import org.eclipse.mylyn.internal.tasks.core.TaskCategory;
import org.eclipse.mylyn.internal.tasks.core.UnmatchedTaskContainer;
import org.eclipse.mylyn.internal.tasks.ui.util.TasksUiInternal;
import org.eclipse.mylyn.internal.tasks.ui.views.TaskListView;
+import org.eclipse.mylyn.tasks.core.IRepositoryElement;
import org.eclipse.mylyn.tasks.core.IRepositoryQuery;
import org.eclipse.mylyn.tasks.core.ITask;
-import org.eclipse.mylyn.tasks.core.ITaskElement;
import org.eclipse.mylyn.tasks.ui.TasksUi;
import org.eclipse.ui.ISharedImages;
import org.eclipse.ui.PlatformUI;
@@ -60,8 +60,8 @@ public class DeleteAction extends Action {
i++;
if (i < 20) {
// TODO this action should be based on the action enablement and check if the container is user managed or not
- if (object instanceof ITaskElement) {
- elements += " " + ((ITaskElement) object).getSummary() + "\n";
+ if (object instanceof IRepositoryElement) {
+ elements += " " + ((IRepositoryElement) object).getSummary() + "\n";
}
} else {
elements += "...";
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/MarkTaskCompleteAction.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/MarkTaskCompleteAction.java
index c05be24d5..ef1be7b2a 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/MarkTaskCompleteAction.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/MarkTaskCompleteAction.java
@@ -17,7 +17,7 @@ import org.eclipse.mylyn.internal.tasks.core.AbstractTask;
import org.eclipse.mylyn.internal.tasks.core.ITaskList;
import org.eclipse.mylyn.internal.tasks.ui.util.TasksUiInternal;
import org.eclipse.mylyn.tasks.core.ITask;
-import org.eclipse.mylyn.tasks.core.ITaskElement;
+import org.eclipse.mylyn.tasks.core.IRepositoryElement;
import org.eclipse.mylyn.tasks.ui.TasksUiImages;
import org.eclipse.ui.PlatformUI;
@@ -31,9 +31,9 @@ public class MarkTaskCompleteAction extends AbstractChangeCompletionAction {
private static final String ACTION_NAME = "Complete";
- private final List<ITaskElement> selectedElements;
+ private final List<IRepositoryElement> selectedElements;
- public MarkTaskCompleteAction(List<ITaskElement> selectedElements) {
+ public MarkTaskCompleteAction(List<IRepositoryElement> selectedElements) {
this.selectedElements = selectedElements;
setText(ACTION_NAME);
setToolTipText("Mark " + ACTION_NAME);
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/MarkTaskIncompleteAction.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/MarkTaskIncompleteAction.java
index d31decc9d..ec05e54ba 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/MarkTaskIncompleteAction.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/MarkTaskIncompleteAction.java
@@ -16,7 +16,7 @@ import org.eclipse.mylyn.internal.tasks.core.AbstractTask;
import org.eclipse.mylyn.internal.tasks.core.ITaskList;
import org.eclipse.mylyn.internal.tasks.ui.util.TasksUiInternal;
import org.eclipse.mylyn.tasks.core.ITask;
-import org.eclipse.mylyn.tasks.core.ITaskElement;
+import org.eclipse.mylyn.tasks.core.IRepositoryElement;
import org.eclipse.mylyn.tasks.ui.TasksUiImages;
import org.eclipse.ui.PlatformUI;
@@ -31,9 +31,9 @@ public class MarkTaskIncompleteAction extends AbstractChangeCompletionAction {
public static final String ID = "org.eclipse.mylyn.tasklist.actions.mark.incomplete";
- private final List<ITaskElement> selectedElements;
+ private final List<IRepositoryElement> selectedElements;
- public MarkTaskIncompleteAction(List<ITaskElement> selectedElements) {
+ public MarkTaskIncompleteAction(List<IRepositoryElement> selectedElements) {
this.selectedElements = selectedElements;
setText(ACTION_NAME);
setToolTipText("Mark " + ACTION_NAME);
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/OpenTaskListElementAction.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/OpenTaskListElementAction.java
index b166664ee..50876f5c7 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/OpenTaskListElementAction.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/OpenTaskListElementAction.java
@@ -17,7 +17,6 @@ import org.eclipse.jface.viewers.TreeViewer;
import org.eclipse.mylyn.internal.tasks.core.AbstractTask;
import org.eclipse.mylyn.internal.tasks.ui.util.TasksUiInternal;
import org.eclipse.mylyn.tasks.core.ITask;
-import org.eclipse.mylyn.tasks.core.ITaskElement;
import org.eclipse.mylyn.tasks.ui.TasksUiUtil;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Event;
@@ -51,7 +50,7 @@ public class OpenTaskListElementAction extends Action {
if (element instanceof ITask && event != null && (event.keyCode & SWT.MOD1) != 0) {
TasksUiUtil.openTaskInBackground((AbstractTask) element, true);
} else if (element instanceof ITask) {
- TasksUiInternal.refreshAndOpenTaskListElement((ITaskElement) element);
+ TasksUiInternal.refreshAndOpenTaskListElement((ITask) element);
} else {
if (viewer.getExpandedState(element)) {
viewer.collapseToLevel(element, 1);
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/OpenWithBrowserAction.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/OpenWithBrowserAction.java
index bf649619e..929fae60b 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/OpenWithBrowserAction.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/OpenWithBrowserAction.java
@@ -12,8 +12,8 @@ import java.util.Iterator;
import org.eclipse.mylyn.internal.tasks.core.AbstractTask;
import org.eclipse.mylyn.internal.tasks.ui.util.TasksUiInternal;
+import org.eclipse.mylyn.tasks.core.IRepositoryElement;
import org.eclipse.mylyn.tasks.core.ITask;
-import org.eclipse.mylyn.tasks.core.ITaskElement;
import org.eclipse.mylyn.tasks.ui.TasksUiUtil;
import org.eclipse.ui.actions.BaseSelectionListenerAction;
@@ -50,8 +50,8 @@ public class OpenWithBrowserAction extends BaseSelectionListenerAction {
if (TasksUiInternal.isValidUrl(task.getUrl())) {
urlString = task.getUrl();
}
- } else if (selectedObject instanceof ITaskElement) {
- ITaskElement query = (ITaskElement) selectedObject;
+ } else if (selectedObject instanceof IRepositoryElement) {
+ IRepositoryElement query = (IRepositoryElement) selectedObject;
urlString = query.getUrl();
}
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/RenameAction.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/RenameAction.java
index 030130789..956f3dc1d 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/RenameAction.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/RenameAction.java
@@ -11,8 +11,8 @@ import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.mylyn.internal.tasks.core.AbstractTaskCategory;
import org.eclipse.mylyn.internal.tasks.core.LocalTask;
import org.eclipse.mylyn.internal.tasks.ui.views.TaskListView;
+import org.eclipse.mylyn.tasks.core.IRepositoryElement;
import org.eclipse.mylyn.tasks.core.IRepositoryQuery;
-import org.eclipse.mylyn.tasks.core.ITaskElement;
import org.eclipse.swt.SWT;
import org.eclipse.ui.actions.BaseSelectionListenerAction;
@@ -37,8 +37,8 @@ public class RenameAction extends BaseSelectionListenerAction {
@Override
public void run() {
Object selectedObject = ((IStructuredSelection) this.view.getViewer().getSelection()).getFirstElement();
- if (selectedObject instanceof ITaskElement) {
- ITaskElement element = (ITaskElement) selectedObject;
+ if (selectedObject instanceof IRepositoryElement) {
+ IRepositoryElement element = (IRepositoryElement) selectedObject;
view.setInRenameAction(true);
view.getViewer().editElement(element, 0);
view.setInRenameAction(false);
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/TaskSelectionDialog.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/TaskSelectionDialog.java
index 346091dba..91ad43f08 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/TaskSelectionDialog.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/TaskSelectionDialog.java
@@ -52,7 +52,7 @@ import org.eclipse.mylyn.internal.tasks.ui.views.TaskListView;
import org.eclipse.mylyn.internal.tasks.ui.workingsets.TaskWorkingSetUpdater;
import org.eclipse.mylyn.internal.tasks.ui.workingsets.WorkingSetLabelComparator;
import org.eclipse.mylyn.tasks.core.ITask;
-import org.eclipse.mylyn.tasks.core.ITaskElement;
+import org.eclipse.mylyn.tasks.core.ITaskContainer;
import org.eclipse.mylyn.tasks.ui.TaskElementLabelProvider;
import org.eclipse.search.internal.ui.SearchDialog;
import org.eclipse.swt.SWT;
@@ -346,7 +346,7 @@ public class TaskSelectionDialog extends FilteredItemsSelectionDialog {
private void populateTasksFromWorkingSets() {
allTasksFromWorkingSets = new HashSet<ITask>(1000);
- for (ITaskElement container : elements) {
+ for (ITaskContainer container : elements) {
allTasksFromWorkingSets.addAll(container.getChildren());
}
}
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/commands/AbstractTaskListViewHandler.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/commands/AbstractTaskListViewHandler.java
index 76d476d31..378ceb3a1 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/commands/AbstractTaskListViewHandler.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/commands/AbstractTaskListViewHandler.java
@@ -15,7 +15,7 @@ import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.jface.viewers.ITreeSelection;
import org.eclipse.mylyn.internal.tasks.ui.views.TaskListView;
-import org.eclipse.mylyn.tasks.core.ITaskElement;
+import org.eclipse.mylyn.tasks.core.IRepositoryElement;
import org.eclipse.ui.IViewSite;
import org.eclipse.ui.IWorkbenchPart;
import org.eclipse.ui.IWorkbenchSite;
@@ -43,13 +43,13 @@ public abstract class AbstractTaskListViewHandler extends AbstractHandler {
ITreeSelection selection = (ITreeSelection) taskListView.getViewer().getSelection();
for (Iterator<?> it = selection.iterator(); it.hasNext();) {
Object item = it.next();
- if (item instanceof ITaskElement) {
- execute(event, taskListView, (ITaskElement) item);
+ if (item instanceof IRepositoryElement) {
+ execute(event, taskListView, (IRepositoryElement) item);
}
}
}
- protected void execute(ExecutionEvent event, TaskListView taskListView, ITaskElement item)
+ protected void execute(ExecutionEvent event, TaskListView taskListView, IRepositoryElement item)
throws ExecutionException {
}
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/commands/GoToUnreadTaskHandler.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/commands/GoToUnreadTaskHandler.java
index b00b1f873..80d782b30 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/commands/GoToUnreadTaskHandler.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/commands/GoToUnreadTaskHandler.java
@@ -17,8 +17,8 @@ import org.eclipse.mylyn.internal.commons.ui.TreeWalker;
import org.eclipse.mylyn.internal.commons.ui.TreeWalker.Direction;
import org.eclipse.mylyn.internal.commons.ui.TreeWalker.TreeVisitor;
import org.eclipse.mylyn.internal.tasks.ui.views.TaskListView;
+import org.eclipse.mylyn.tasks.core.IRepositoryElement;
import org.eclipse.mylyn.tasks.core.ITask;
-import org.eclipse.mylyn.tasks.core.ITaskElement;
import org.eclipse.mylyn.tasks.core.ITask.SynchronizationState;
import org.eclipse.swt.widgets.Tree;
import org.eclipse.swt.widgets.TreeItem;
@@ -62,7 +62,7 @@ public abstract class GoToUnreadTaskHandler extends AbstractTaskListViewHandler
}
@Override
- protected void execute(ExecutionEvent event, TaskListView taskListView, ITaskElement item) {
+ protected void execute(ExecutionEvent event, TaskListView taskListView, IRepositoryElement item) {
TreeViewer treeViewer = taskListView.getViewer();
Tree tree = treeViewer.getTree();
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/commands/MarkTaskHandler.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/commands/MarkTaskHandler.java
index 3d1fcbe00..b857a3f2e 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/commands/MarkTaskHandler.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/commands/MarkTaskHandler.java
@@ -16,8 +16,8 @@ import org.eclipse.mylyn.internal.commons.ui.TreeWalker.Direction;
import org.eclipse.mylyn.internal.tasks.ui.TasksUiPlugin;
import org.eclipse.mylyn.internal.tasks.ui.util.TasksUiInternal;
import org.eclipse.mylyn.internal.tasks.ui.views.TaskListView;
+import org.eclipse.mylyn.tasks.core.IRepositoryElement;
import org.eclipse.mylyn.tasks.core.ITask;
-import org.eclipse.mylyn.tasks.core.ITaskElement;
import org.eclipse.mylyn.tasks.core.AbstractRepositoryConnector.Capability;
/**
@@ -61,7 +61,7 @@ public abstract class MarkTaskHandler extends AbstractTaskHandler {
public static class MarkTaskReadGoToNextUnreadTaskHandler extends AbstractTaskListViewHandler {
@Override
- protected void execute(ExecutionEvent event, TaskListView taskListView, ITaskElement item)
+ protected void execute(ExecutionEvent event, TaskListView taskListView, IRepositoryElement item)
throws ExecutionException {
if (item instanceof ITask) {
ITask task = (ITask) item;
@@ -73,7 +73,7 @@ public abstract class MarkTaskHandler extends AbstractTaskHandler {
public static class MarkTaskReadGoToPreviousUnreadTaskHandler extends AbstractTaskListViewHandler {
@Override
- protected void execute(ExecutionEvent event, TaskListView taskListView, ITaskElement item)
+ protected void execute(ExecutionEvent event, TaskListView taskListView, IRepositoryElement item)
throws ExecutionException {
if (item instanceof ITask) {
ITask task = (ITask) item;
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/commands/OpenSelectedTaskHandler.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/commands/OpenSelectedTaskHandler.java
index f5e9b4be1..093a5e305 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/commands/OpenSelectedTaskHandler.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/commands/OpenSelectedTaskHandler.java
@@ -11,8 +11,8 @@ package org.eclipse.mylyn.internal.tasks.ui.commands;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.mylyn.internal.tasks.core.AbstractTask;
import org.eclipse.mylyn.internal.tasks.ui.views.TaskListView;
+import org.eclipse.mylyn.tasks.core.IRepositoryElement;
import org.eclipse.mylyn.tasks.core.ITask;
-import org.eclipse.mylyn.tasks.core.ITaskElement;
import org.eclipse.mylyn.tasks.ui.TasksUiUtil;
/**
@@ -21,7 +21,7 @@ import org.eclipse.mylyn.tasks.ui.TasksUiUtil;
public class OpenSelectedTaskHandler extends AbstractTaskListViewHandler {
@Override
- protected void execute(ExecutionEvent event, TaskListView taskListView, ITaskElement item) {
+ protected void execute(ExecutionEvent event, TaskListView taskListView, IRepositoryElement item) {
if (item instanceof ITask) {
TasksUiUtil.openTaskInBackground((AbstractTask) item, true);
}
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/commands/OpenTaskListElementPropertiesHandler.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/commands/OpenTaskListElementPropertiesHandler.java
index f0a2abe38..055d16068 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/commands/OpenTaskListElementPropertiesHandler.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/commands/OpenTaskListElementPropertiesHandler.java
@@ -12,8 +12,8 @@ import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.mylyn.internal.tasks.core.TaskCategory;
import org.eclipse.mylyn.internal.tasks.ui.util.TasksUiInternal;
import org.eclipse.mylyn.internal.tasks.ui.views.TaskListView;
+import org.eclipse.mylyn.tasks.core.IRepositoryElement;
import org.eclipse.mylyn.tasks.core.IRepositoryQuery;
-import org.eclipse.mylyn.tasks.core.ITaskElement;
/**
* @author Steffen Pingel
@@ -21,7 +21,7 @@ import org.eclipse.mylyn.tasks.core.ITaskElement;
public class OpenTaskListElementPropertiesHandler extends AbstractTaskListViewHandler {
@Override
- protected void execute(ExecutionEvent event, TaskListView taskListView, ITaskElement item) {
+ protected void execute(ExecutionEvent event, TaskListView taskListView, IRepositoryElement item) {
if (item instanceof TaskCategory || item instanceof IRepositoryQuery) {
TasksUiInternal.refreshAndOpenTaskListElement(item);
}
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/commands/RemoteTaskSelectionDialog.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/commands/RemoteTaskSelectionDialog.java
index 91dabce65..096d3f5ec 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/commands/RemoteTaskSelectionDialog.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/commands/RemoteTaskSelectionDialog.java
@@ -43,8 +43,8 @@ import org.eclipse.mylyn.internal.tasks.ui.ITaskCommandIds;
import org.eclipse.mylyn.internal.tasks.ui.TasksUiPlugin;
import org.eclipse.mylyn.internal.tasks.ui.views.TaskRepositoryLabelProvider;
import org.eclipse.mylyn.tasks.core.AbstractRepositoryConnector;
+import org.eclipse.mylyn.tasks.core.IRepositoryElement;
import org.eclipse.mylyn.tasks.core.ITask;
-import org.eclipse.mylyn.tasks.core.ITaskElement;
import org.eclipse.mylyn.tasks.core.TaskRepository;
import org.eclipse.mylyn.tasks.ui.TaskElementLabelProvider;
import org.eclipse.mylyn.tasks.ui.TasksUiUtil;
@@ -228,8 +228,8 @@ public class RemoteTaskSelectionDialog extends SelectionStatusDialog {
@Override
public String getText(Object element) {
- if (element instanceof ITaskElement) {
- return ((ITaskElement) element).getSummary();
+ if (element instanceof IRepositoryElement) {
+ return ((IRepositoryElement) element).getSummary();
}
return super.getText(element);
}
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/deprecated/AbstractNewRepositoryTaskEditor.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/deprecated/AbstractNewRepositoryTaskEditor.java
index d9cfd0b89..59a575075 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/deprecated/AbstractNewRepositoryTaskEditor.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/deprecated/AbstractNewRepositoryTaskEditor.java
@@ -34,7 +34,7 @@ import org.eclipse.mylyn.internal.tasks.ui.editors.RepositoryTaskOutlineNode;
import org.eclipse.mylyn.internal.tasks.ui.editors.RepositoryTaskSelection;
import org.eclipse.mylyn.internal.tasks.ui.util.TasksUiInternal;
import org.eclipse.mylyn.internal.tasks.ui.views.TaskListView;
-import org.eclipse.mylyn.tasks.core.ITaskElement;
+import org.eclipse.mylyn.tasks.core.IRepositoryElement;
import org.eclipse.mylyn.tasks.ui.TasksUiImages;
import org.eclipse.mylyn.tasks.ui.editors.TaskEditorInput;
import org.eclipse.swt.SWT;
@@ -379,7 +379,7 @@ public abstract class AbstractNewRepositoryTaskEditor extends AbstractRepository
});
- for (ITaskElement category : categories) {
+ for (IRepositoryElement category : categories) {
categoryChooser.add(category.getSummary());
}
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/deprecated/AbstractRepositoryTaskEditor.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/deprecated/AbstractRepositoryTaskEditor.java
index 7063890df..c2c55cee1 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/deprecated/AbstractRepositoryTaskEditor.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/deprecated/AbstractRepositoryTaskEditor.java
@@ -118,9 +118,9 @@ import org.eclipse.mylyn.internal.tasks.ui.util.TasksUiInternal;
import org.eclipse.mylyn.internal.tasks.ui.views.UpdateRepositoryConfigurationAction;
import org.eclipse.mylyn.tasks.core.AbstractDuplicateDetector;
import org.eclipse.mylyn.tasks.core.AbstractRepositoryConnector;
+import org.eclipse.mylyn.tasks.core.IRepositoryElement;
import org.eclipse.mylyn.tasks.core.ITask;
import org.eclipse.mylyn.tasks.core.ITaskAttachment;
-import org.eclipse.mylyn.tasks.core.ITaskElement;
import org.eclipse.mylyn.tasks.core.ITaskListChangeListener;
import org.eclipse.mylyn.tasks.core.RepositoryStatus;
import org.eclipse.mylyn.tasks.core.TaskRepository;
@@ -716,7 +716,8 @@ public abstract class AbstractRepositoryTaskEditor extends TaskFormPage {
if (taskData != null && !taskData.isNew()) {
if (repositoryTask != null) {
- clearOutgoingAction = new ClearOutgoingAction(Collections.singletonList((ITaskElement) repositoryTask));
+ clearOutgoingAction = new ClearOutgoingAction(
+ Collections.singletonList((IRepositoryElement) repositoryTask));
if (clearOutgoingAction.isEnabled()) {
toolBarManager.add(clearOutgoingAction);
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorActionContributor.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorActionContributor.java
index 2556e881a..1ff506f08 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorActionContributor.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorActionContributor.java
@@ -47,7 +47,7 @@ import org.eclipse.mylyn.internal.tasks.ui.deprecated.TaskFormPage;
import org.eclipse.mylyn.internal.tasks.ui.util.TasksUiInternal;
import org.eclipse.mylyn.internal.tasks.ui.views.TaskListView;
import org.eclipse.mylyn.tasks.core.ITask;
-import org.eclipse.mylyn.tasks.core.ITaskElement;
+import org.eclipse.mylyn.tasks.core.IRepositoryElement;
import org.eclipse.mylyn.tasks.ui.TasksUiImages;
import org.eclipse.mylyn.tasks.ui.editors.AbstractTaskEditorPage;
import org.eclipse.mylyn.tasks.ui.editors.TaskEditor;
@@ -236,7 +236,7 @@ public class TaskEditorActionContributor extends MultiPageEditorActionBarContrib
for (IDynamicSubMenuContributor contributor : TasksUiPlugin.getDefault().getDynamicMenuMap().get(
menuPath)) {
if (TaskListView.ID_SEPARATOR_TASKS.equals(menuPath)) {
- List<ITaskElement> selectedElements = new ArrayList<ITaskElement>();
+ List<IRepositoryElement> selectedElements = new ArrayList<IRepositoryElement>();
selectedElements.add(task);
MenuManager subMenuManager = contributor.getSubMenuManager(selectedElements);
if (subMenuManager != null) {
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorActionPart.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorActionPart.java
index 163846ce4..2dcfd8466 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorActionPart.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorActionPart.java
@@ -20,7 +20,7 @@ import org.eclipse.mylyn.internal.tasks.core.AbstractTaskContainer;
import org.eclipse.mylyn.internal.tasks.core.ITaskList;
import org.eclipse.mylyn.internal.tasks.ui.TasksUiPlugin;
import org.eclipse.mylyn.internal.tasks.ui.util.TasksUiInternal;
-import org.eclipse.mylyn.tasks.core.ITaskElement;
+import org.eclipse.mylyn.tasks.core.IRepositoryElement;
import org.eclipse.mylyn.tasks.core.data.TaskAttribute;
import org.eclipse.mylyn.tasks.core.data.TaskOperation;
import org.eclipse.mylyn.tasks.ui.TasksUiImages;
@@ -159,7 +159,7 @@ public class TaskEditorActionPart extends AbstractTaskEditorPart {
}
});
- for (ITaskElement category : categories) {
+ for (IRepositoryElement category : categories) {
categoryChooser.add(category.getSummary());
}
categoryChooser.select(0);
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/search/SearchResultTreeContentProvider.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/search/SearchResultTreeContentProvider.java
index 114262bb5..6ba1a0f33 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/search/SearchResultTreeContentProvider.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/search/SearchResultTreeContentProvider.java
@@ -18,7 +18,7 @@ import org.eclipse.mylyn.internal.tasks.core.AbstractTask;
import org.eclipse.mylyn.internal.tasks.core.Person;
import org.eclipse.mylyn.internal.tasks.core.TaskGroup;
import org.eclipse.mylyn.tasks.core.ITask;
-import org.eclipse.mylyn.tasks.core.ITaskElement;
+import org.eclipse.mylyn.tasks.core.ITaskContainer;
/**
* This implementation of <code>SearchResultContentProvider</code> is used for the table view of a Bugzilla search
@@ -73,7 +73,7 @@ public class SearchResultTreeContentProvider extends SearchResultContentProvider
public Object[] getChildren(Object parent) {
if (parent instanceof TaskGroup || parent instanceof Person) {
- return ((ITaskElement) parent).getChildren().toArray();
+ return ((ITaskContainer) parent).getChildren().toArray();
} else {
return EMPTY_ARR;
}
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/search/SearchScoreComputerAdapterFactory.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/search/SearchScoreComputerAdapterFactory.java
index 4442dfef4..60548f8b7 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/search/SearchScoreComputerAdapterFactory.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/search/SearchScoreComputerAdapterFactory.java
@@ -11,7 +11,7 @@ package org.eclipse.mylyn.internal.tasks.ui.search;
import org.eclipse.core.runtime.IAdapterFactory;
import org.eclipse.mylyn.internal.tasks.core.AbstractTaskContainer;
import org.eclipse.mylyn.internal.tasks.ui.TaskSearchPage;
-import org.eclipse.mylyn.tasks.core.ITaskElement;
+import org.eclipse.mylyn.tasks.core.IRepositoryElement;
import org.eclipse.search.ui.ISearchPageScoreComputer;
/**
@@ -28,7 +28,7 @@ public class SearchScoreComputerAdapterFactory implements IAdapterFactory {
if (!TaskSearchPage.ID.equals(pageId)) {
return ISearchPageScoreComputer.UNKNOWN;
}
- if (input instanceof ITaskElement) {
+ if (input instanceof IRepositoryElement) {
return 100;
}
return ISearchPageScoreComputer.LOWEST;
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/util/TaskDragSourceListener.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/util/TaskDragSourceListener.java
index 6ee1fd686..49791f8bb 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/util/TaskDragSourceListener.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/util/TaskDragSourceListener.java
@@ -21,9 +21,9 @@ import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.ISelectionProvider;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.mylyn.commons.core.StatusHandler;
-import org.eclipse.mylyn.internal.tasks.core.RepositoryQuery;
import org.eclipse.mylyn.internal.tasks.core.AbstractTask;
import org.eclipse.mylyn.internal.tasks.core.ITasksCoreConstants;
+import org.eclipse.mylyn.internal.tasks.core.RepositoryQuery;
import org.eclipse.mylyn.internal.tasks.core.deprecated.RepositoryTaskData;
import org.eclipse.mylyn.internal.tasks.ui.TaskTransfer;
import org.eclipse.mylyn.internal.tasks.ui.TasksUiPlugin;
@@ -31,7 +31,6 @@ import org.eclipse.mylyn.internal.tasks.ui.actions.CopyTaskDetailsAction;
import org.eclipse.mylyn.tasks.core.AbstractRepositoryConnector;
import org.eclipse.mylyn.tasks.core.IRepositoryQuery;
import org.eclipse.mylyn.tasks.core.ITask;
-import org.eclipse.mylyn.tasks.core.ITaskElement;
import org.eclipse.mylyn.tasks.ui.TasksUi;
import org.eclipse.swt.dnd.DragSourceAdapter;
import org.eclipse.swt.dnd.DragSourceEvent;
@@ -89,7 +88,8 @@ public class TaskDragSourceListener extends DragSourceAdapter {
List<File> taskFiles = new ArrayList<File>(queries.size() + tasks.size());
try {
for (RepositoryQuery query : queries) {
- String encodedName = URLEncoder.encode(query.getHandleIdentifier(), ITasksCoreConstants.FILENAME_ENCODING);
+ String encodedName = URLEncoder.encode(query.getHandleIdentifier(),
+ ITasksCoreConstants.FILENAME_ENCODING);
File file = File.createTempFile(encodedName, ITasksCoreConstants.FILE_EXTENSION, tempDir);
file.deleteOnExit();
@@ -99,7 +99,8 @@ public class TaskDragSourceListener extends DragSourceAdapter {
}
for (AbstractTask task : tasks) {
- String encodedName = URLEncoder.encode(task.getHandleIdentifier(), ITasksCoreConstants.FILENAME_ENCODING);
+ String encodedName = URLEncoder.encode(task.getHandleIdentifier(),
+ ITasksCoreConstants.FILENAME_ENCODING);
File file = File.createTempFile(encodedName, ITasksCoreConstants.FILE_EXTENSION, tempDir);
file.deleteOnExit();
@@ -124,8 +125,8 @@ public class TaskDragSourceListener extends DragSourceAdapter {
if (TaskTransfer.getInstance().isSupportedType(event.dataType)) {
List<AbstractTask> tasks = new ArrayList<AbstractTask>();
for (Iterator<?> it = selection.iterator(); it.hasNext();) {
- ITaskElement element = (ITaskElement) it.next();
- if (element instanceof ITask) {
+ Object element = it.next();
+ if (element instanceof AbstractTask) {
tasks.add((AbstractTask) element);
}
}
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/util/TaskListElementImporter.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/util/TaskListElementImporter.java
index 2ff685e25..bde8681f5 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/util/TaskListElementImporter.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/util/TaskListElementImporter.java
@@ -59,7 +59,6 @@ import org.eclipse.mylyn.internal.tasks.core.externalization.DelegatingTaskExter
import org.eclipse.mylyn.internal.tasks.ui.TasksUiPlugin;
import org.eclipse.mylyn.tasks.core.AbstractTaskListMigrator;
import org.eclipse.mylyn.tasks.core.IRepositoryQuery;
-import org.eclipse.mylyn.tasks.core.ITaskElement;
import org.eclipse.mylyn.tasks.core.TaskRepository;
import org.eclipse.mylyn.tasks.ui.ITasksUiConstants;
import org.eclipse.mylyn.tasks.ui.TasksUi;
@@ -166,7 +165,7 @@ public class TaskListElementImporter {
}
// create the categorie nodes...
- for (ITaskElement category : taskList.getCategories()) {
+ for (AbstractTaskCategory category : taskList.getCategories()) {
delagatingExternalizer.createCategoryElement(category, doc, root);
}
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/util/TasksUiInternal.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/util/TasksUiInternal.java
index acc3ac97f..8ce58d960 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/util/TasksUiInternal.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/util/TasksUiInternal.java
@@ -63,9 +63,9 @@ import org.eclipse.mylyn.internal.tasks.ui.wizards.NewAttachmentWizardDialog;
import org.eclipse.mylyn.internal.tasks.ui.wizards.NewTaskWizard;
import org.eclipse.mylyn.internal.tasks.ui.wizards.TaskAttachmentWizard;
import org.eclipse.mylyn.tasks.core.AbstractRepositoryConnector;
+import org.eclipse.mylyn.tasks.core.IRepositoryElement;
import org.eclipse.mylyn.tasks.core.IRepositoryQuery;
import org.eclipse.mylyn.tasks.core.ITask;
-import org.eclipse.mylyn.tasks.core.ITaskElement;
import org.eclipse.mylyn.tasks.core.ITaskMapping;
import org.eclipse.mylyn.tasks.core.RepositoryStatus;
import org.eclipse.mylyn.tasks.core.TaskRepository;
@@ -185,7 +185,7 @@ public class TasksUiInternal {
});
}
- public static void refreshAndOpenTaskListElement(ITaskElement element) {
+ public static void refreshAndOpenTaskListElement(IRepositoryElement element) {
if (element instanceof ITask) {
final AbstractTask task = (AbstractTask) element;
@@ -302,8 +302,7 @@ public class TasksUiInternal {
@Override
public void done(IJobChangeEvent event) {
if (query.getStatus() != null) {
- TasksUiInternal.asyncDisplayStatus("Query Synchronization Failed",
- query.getStatus());
+ TasksUiInternal.asyncDisplayStatus("Query Synchronization Failed", query.getStatus());
}
}
});
@@ -508,7 +507,7 @@ public class TasksUiInternal {
for (IWorkingSet workingSet : containers) {
IAdaptable[] elements = workingSet.getElements();
for (IAdaptable adaptable : elements) {
- if (adaptable instanceof ITaskElement) {
+ if (adaptable instanceof AbstractTaskContainer) {
allTaskContainersInWorkingSets.add(((AbstractTaskContainer) adaptable));
}
}
@@ -681,14 +680,6 @@ public class TasksUiInternal {
return task;
}
- public static AbstractTask getCorrespondingTask(ITaskElement element) {
- if (element instanceof ITask) {
- return (AbstractTask) element;
- } else {
- return null;
- }
- }
-
public static void importTasks(Collection<AbstractTask> tasks, Set<TaskRepository> repositories, File zipFile,
Shell shell) {
TasksUiPlugin.getRepositoryManager().insertRepositories(repositories,
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/CustomTaskListDecorationDrawer.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/CustomTaskListDecorationDrawer.java
index 8ac624e5b..a97df26a2 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/CustomTaskListDecorationDrawer.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/CustomTaskListDecorationDrawer.java
@@ -20,7 +20,7 @@ import org.eclipse.mylyn.internal.tasks.ui.ITasksUiPreferenceConstants;
import org.eclipse.mylyn.internal.tasks.ui.TasksUiPlugin;
import org.eclipse.mylyn.tasks.core.IRepositoryQuery;
import org.eclipse.mylyn.tasks.core.ITask;
-import org.eclipse.mylyn.tasks.core.ITaskElement;
+import org.eclipse.mylyn.tasks.core.ITaskContainer;
import org.eclipse.mylyn.tasks.core.ITask.SynchronizationState;
import org.eclipse.mylyn.tasks.ui.TasksUiImages;
import org.eclipse.swt.SWT;
@@ -88,15 +88,15 @@ class CustomTaskListDecorationDrawer implements Listener {
activationImage = taskInactive;
}
}
- if (data instanceof ITaskElement) {
+ if (data instanceof ITaskContainer) {
switch (event.type) {
case SWT.EraseItem: {
if (activationImage != null) {
drawActivationImage(activationImageOffset, event, activationImage);
}
if (!this.taskListView.synchronizationOverlaid) {
- if (data instanceof ITaskElement) {
- drawSyncronizationImage((ITaskElement) data, event);
+ if (data instanceof ITaskContainer) {
+ drawSyncronizationImage((ITaskContainer) data, event);
}
}
@@ -123,8 +123,8 @@ class CustomTaskListDecorationDrawer implements Listener {
if (activationImage != null) {
drawActivationImage(activationImageOffset, event, activationImage);
}
- if (data instanceof ITaskElement) {
- drawSyncronizationImage((ITaskElement) data, event);
+ if (data instanceof ITaskContainer) {
+ drawSyncronizationImage((ITaskContainer) data, event);
}
if (tweakClipping) {
event.gc.setClipping(clipping);
@@ -135,7 +135,7 @@ class CustomTaskListDecorationDrawer implements Listener {
}
}
- private void drawSyncronizationImage(ITaskElement element, Event event) {
+ private void drawSyncronizationImage(ITaskContainer element, Event event) {
Image image = null;
int offsetX = 6;
int offsetY = (event.height / 2) - 5;
@@ -187,7 +187,7 @@ class CustomTaskListDecorationDrawer implements Listener {
}
}
- private boolean hideDecorationOnContainer(ITaskElement element, TreeItem treeItem) {
+ private boolean hideDecorationOnContainer(ITaskContainer element, TreeItem treeItem) {
if (element instanceof UnmatchedTaskContainer) {
if (!taskListView.isFocusedMode()) {
return false;
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TableDecoratingLabelProvider.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TableDecoratingLabelProvider.java
index 8745d580d..2f5b941a7 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TableDecoratingLabelProvider.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TableDecoratingLabelProvider.java
@@ -15,10 +15,9 @@ import org.eclipse.jface.viewers.ITableLabelProvider;
import org.eclipse.mylyn.context.core.ContextCore;
import org.eclipse.mylyn.internal.provisional.commons.ui.CommonImages;
import org.eclipse.mylyn.internal.tasks.core.AbstractTask;
-import org.eclipse.mylyn.internal.tasks.ui.util.TasksUiInternal;
import org.eclipse.mylyn.tasks.core.IRepositoryQuery;
import org.eclipse.mylyn.tasks.core.ITask;
-import org.eclipse.mylyn.tasks.core.ITaskElement;
+import org.eclipse.mylyn.tasks.core.ITaskContainer;
import org.eclipse.mylyn.tasks.ui.TasksUiImages;
import org.eclipse.swt.graphics.Image;
@@ -32,15 +31,15 @@ public class TableDecoratingLabelProvider extends DecoratingLabelProvider implem
}
public Image getColumnImage(Object element, int columnIndex) {
- if (!(element instanceof ITaskElement)) {
+ if (!(element instanceof ITaskContainer)) {
return null;
}
if (columnIndex == 0) {
- if (element instanceof ITaskElement && !(element instanceof ITask)) {
+ if (element instanceof ITaskContainer && !(element instanceof ITask)) {
return super.getImage(element);
} else {
- AbstractTask task = TasksUiInternal.getCorrespondingTask((ITaskElement) element);
- if (task != null) {
+ if (element instanceof AbstractTask) {
+ AbstractTask task = (AbstractTask) element;
if (task.isActive()) {
return CommonImages.getImage(TasksUiImages.CONTEXT_ACTIVE);
} else {
@@ -55,7 +54,7 @@ public class TableDecoratingLabelProvider extends DecoratingLabelProvider implem
}
}
} else if (columnIndex == 1) {
- if (element instanceof ITaskElement || element instanceof IRepositoryQuery) {
+ if (element instanceof ITaskContainer || element instanceof IRepositoryQuery) {
return null;
}
return super.getImage(element);
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListCellModifier.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListCellModifier.java
index 738369f5a..e56d7e0ce 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListCellModifier.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListCellModifier.java
@@ -20,9 +20,8 @@ import org.eclipse.mylyn.internal.tasks.core.AbstractTaskContainer;
import org.eclipse.mylyn.internal.tasks.ui.TasksUiPlugin;
import org.eclipse.mylyn.internal.tasks.ui.actions.TaskActivateAction;
import org.eclipse.mylyn.internal.tasks.ui.actions.TaskDeactivateAction;
+import org.eclipse.mylyn.tasks.core.IRepositoryElement;
import org.eclipse.mylyn.tasks.core.IRepositoryQuery;
-import org.eclipse.mylyn.tasks.core.ITask;
-import org.eclipse.mylyn.tasks.core.ITaskElement;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.TreeItem;
@@ -50,8 +49,8 @@ class TaskListCellModifier implements ICellModifier {
public Object getValue(Object element, String property) {
try {
int columnIndex = Arrays.asList(this.taskListView.columnNames).indexOf(property);
- if (element instanceof ITaskElement) {
- final ITaskElement taskListElement = (ITaskElement) element;
+ if (element instanceof IRepositoryElement) {
+ final IRepositoryElement taskListElement = (IRepositoryElement) element;
switch (columnIndex) {
case 0:
return taskListElement.getSummary();
@@ -74,9 +73,8 @@ class TaskListCellModifier implements ICellModifier {
return;
}
columnIndex = Arrays.asList(this.taskListView.columnNames).indexOf(property);
- if (((TreeItem) element).getData() instanceof ITask) {
- final ITaskElement taskListElement = (ITaskElement) ((TreeItem) element).getData();
- AbstractTask task = (AbstractTask) taskListElement;
+ if (((TreeItem) element).getData() instanceof AbstractTask) {
+ AbstractTask task = (AbstractTask) ((TreeItem) element).getData();
switch (columnIndex) {
case 0:
if (task != null) {
@@ -111,14 +109,10 @@ class TaskListCellModifier implements ICellModifier {
}
public void toggleTaskActivation(TreeItem element) {
- ITaskElement taskListElement = (ITaskElement) element.getData();
-
AbstractTask task = null;
- if (taskListElement instanceof ITask) {
- task = (AbstractTask) taskListElement;
- }
+ if (element.getData() instanceof AbstractTask) {
+ task = (AbstractTask) element.getData();
- if (task != null) {
if (disableActivateForParentTasks) {
// check if activation column overlaps with tree expander control: element is on second hierarchy level and has children
TreeItem parent = element.getParentItem();
@@ -131,11 +125,8 @@ class TaskListCellModifier implements ICellModifier {
if (task.isActive()) {
new TaskDeactivateAction().run(task);
-// this.taskListView.previousTaskAction.setButtonStatus();
} else {
new TaskActivateAction().run(task);
-// this.taskListView.addTaskToHistory(task);
-// this.taskListView.previousTaskAction.setButtonStatus();
}
}
}
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListContentProvider.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListContentProvider.java
index 7ca265593..82d1aafbc 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListContentProvider.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListContentProvider.java
@@ -23,8 +23,9 @@ import org.eclipse.mylyn.internal.tasks.core.AbstractTaskContainer;
import org.eclipse.mylyn.internal.tasks.core.TaskCategory;
import org.eclipse.mylyn.internal.tasks.ui.AbstractTaskListFilter;
import org.eclipse.mylyn.internal.tasks.ui.TasksUiPlugin;
+import org.eclipse.mylyn.tasks.core.IRepositoryElement;
import org.eclipse.mylyn.tasks.core.ITask;
-import org.eclipse.mylyn.tasks.core.ITaskElement;
+import org.eclipse.mylyn.tasks.core.ITaskContainer;
/**
* Provides custom content for the task list, e.g. guaranteed visibility of some elements, ability to suppress
@@ -120,7 +121,7 @@ public class TaskListContentProvider extends AbstractTaskListContentProvider {
return filterText == null || filterText.length() == 0;
}
- private boolean selectContainer(ITaskElement container) {
+ private boolean selectContainer(ITaskContainer container) {
// if (container instanceof ScheduledTaskContainer) {
// ScheduledTaskContainer scheduleContainer = (ScheduledTaskContainer) container;
// if (TasksUiPlugin.getTaskActivityManager().isWeekDay(scheduleContainer)
@@ -137,9 +138,9 @@ public class TaskListContentProvider extends AbstractTaskListContentProvider {
return true;
}
- private List<ITaskElement> getFilteredChildrenFor(Object parent) {
+ private List<IRepositoryElement> getFilteredChildrenFor(Object parent) {
if (containsNoFilterText((this.taskListView.getFilteredTree().getFilterControl()).getText())) {
- List<ITaskElement> children = new ArrayList<ITaskElement>();
+ List<IRepositoryElement> children = new ArrayList<IRepositoryElement>();
if (parent instanceof ITask) {
Collection<ITask> subTasks = ((AbstractTask) parent).getChildren();
for (ITask task : subTasks) {
@@ -148,13 +149,13 @@ public class TaskListContentProvider extends AbstractTaskListContentProvider {
}
}
return children;
- } else if (parent instanceof ITaskElement) {
- return getFilteredRootChildren((ITaskElement) parent);
+ } else if (parent instanceof ITaskContainer) {
+ return getFilteredRootChildren((ITaskContainer) parent);
}
} else {
- List<ITaskElement> children = new ArrayList<ITaskElement>();
- if (parent instanceof ITaskElement) {
- children.addAll(((ITaskElement) parent).getChildren());
+ List<IRepositoryElement> children = new ArrayList<IRepositoryElement>();
+ if (parent instanceof ITaskContainer) {
+ children.addAll(((ITaskContainer) parent).getChildren());
return children;
}
}
@@ -164,16 +165,18 @@ public class TaskListContentProvider extends AbstractTaskListContentProvider {
/**
* @return all children who aren't already revealed as a sub task
*/
- private List<ITaskElement> getFilteredRootChildren(ITaskElement parent) {
- List<ITaskElement> result = new ArrayList<ITaskElement>();
+ private List<IRepositoryElement> getFilteredRootChildren(ITaskContainer parent) {
+ List<IRepositoryElement> result = new ArrayList<IRepositoryElement>();
if (TasksUiPlugin.getDefault().groupSubtasks(parent)) {
Collection<ITask> parentTasks = parent.getChildren();
- Set<ITaskElement> parents = new HashSet<ITaskElement>();
+ Set<IRepositoryElement> parents = new HashSet<IRepositoryElement>();
Set<ITask> children = new HashSet<ITask>();
// get all children
for (ITask element : parentTasks) {
- for (ITask abstractTask : element.getChildren()) {
- children.add(abstractTask);
+ if (element instanceof ITaskContainer) {
+ for (ITask abstractTask : ((ITaskContainer) element).getChildren()) {
+ children.add(abstractTask);
+ }
}
}
for (ITask task : parentTasks) {
@@ -183,7 +186,7 @@ public class TaskListContentProvider extends AbstractTaskListContentProvider {
}
result.addAll(parents);
} else {
- for (ITaskElement element : parent.getChildren()) {
+ for (IRepositoryElement element : parent.getChildren()) {
if (!filter(parent, element)) {
result.add(element);
}
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListDropAdapter.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListDropAdapter.java
index 2f18277e9..7c6bd794e 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListDropAdapter.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListDropAdapter.java
@@ -43,7 +43,7 @@ import org.eclipse.mylyn.internal.tasks.ui.actions.QueryImportAction;
import org.eclipse.mylyn.internal.tasks.ui.util.TasksUiInternal;
import org.eclipse.mylyn.tasks.core.AbstractRepositoryConnector;
import org.eclipse.mylyn.tasks.core.ITask;
-import org.eclipse.mylyn.tasks.core.ITaskElement;
+import org.eclipse.mylyn.tasks.core.ITaskContainer;
import org.eclipse.mylyn.tasks.core.TaskRepository;
import org.eclipse.mylyn.tasks.ui.TasksUi;
import org.eclipse.mylyn.tasks.ui.TasksUiUtil;
@@ -201,7 +201,7 @@ public class TaskListDropAdapter extends ViewerDropAdapter {
ITask targetTask = (ITask) currentTarget;
AbstractTaskCategory targetCategory = null;
// TODO: TaskCategory only used what about AbstractTaskCategory descendants?
- ITaskElement container = TaskCategory.getParentTaskCategory(targetTask);
+ ITaskContainer container = TaskCategory.getParentTaskCategory(targetTask);
if (container instanceof TaskCategory || container instanceof UncategorizedTaskContainer) {
targetCategory = (AbstractTaskCategory) container;
} else if (container instanceof UnmatchedTaskContainer) {
@@ -362,7 +362,7 @@ public class TaskListDropAdapter extends ViewerDropAdapter {
|| getCurrentTarget() instanceof UnmatchedTaskContainer
|| getCurrentTarget() instanceof ScheduledTaskContainer) {
return true;
- } else if (getCurrentTarget() instanceof ITaskElement
+ } else if (getCurrentTarget() instanceof ITaskContainer
&& (getCurrentLocation() == ViewerDropAdapter.LOCATION_AFTER || getCurrentLocation() == ViewerDropAdapter.LOCATION_BEFORE)) {
return true;
} else if (getCurrentTarget() instanceof LocalTask
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListFilteredTree.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListFilteredTree.java
index cbf61a358..19f84a3fc 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListFilteredTree.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListFilteredTree.java
@@ -42,7 +42,7 @@ import org.eclipse.mylyn.internal.tasks.ui.actions.TaskWorkingSetAction;
import org.eclipse.mylyn.internal.tasks.ui.editors.TaskListChangeAdapter;
import org.eclipse.mylyn.internal.tasks.ui.util.TasksUiInternal;
import org.eclipse.mylyn.tasks.core.ITask;
-import org.eclipse.mylyn.tasks.core.ITaskElement;
+import org.eclipse.mylyn.tasks.core.IRepositoryElement;
import org.eclipse.mylyn.tasks.core.ITaskListChangeListener;
import org.eclipse.mylyn.tasks.core.TaskActivityAdapter;
import org.eclipse.mylyn.tasks.ui.TasksUi;
@@ -533,7 +533,7 @@ public class TaskListFilteredTree extends AbstractFilteredTree {
for (IDynamicSubMenuContributor contributor : TasksUiPlugin.getDefault().getDynamicMenuMap().get(
menuPath)) {
if (TaskListView.ID_SEPARATOR_TASKS.equals(menuPath)) {
- List<ITaskElement> selectedElements = new ArrayList<ITaskElement>();
+ List<IRepositoryElement> selectedElements = new ArrayList<IRepositoryElement>();
selectedElements.add(activeTask);
MenuManager subMenuManager = contributor.getSubMenuManager(selectedElements);
if (subMenuManager != null) {
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListInterestFilter.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListInterestFilter.java
index f90d6a782..597fc6cee 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListInterestFilter.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListInterestFilter.java
@@ -21,7 +21,7 @@ import org.eclipse.mylyn.internal.tasks.core.TaskActivityUtil;
import org.eclipse.mylyn.internal.tasks.ui.AbstractTaskListFilter;
import org.eclipse.mylyn.internal.tasks.ui.TasksUiPlugin;
import org.eclipse.mylyn.tasks.core.ITask;
-import org.eclipse.mylyn.tasks.core.ITaskElement;
+import org.eclipse.mylyn.tasks.core.ITaskContainer;
/**
* Goal is to have this reuse as much of the super as possible.
@@ -50,8 +50,8 @@ public class TaskListInterestFilter extends AbstractTaskListFilter {
return false;
}
}
- } else if (child instanceof ITaskElement) {
- Collection<ITask> children = ((ITaskElement) child).getChildren();
+ } else if (child instanceof ITaskContainer) {
+ Collection<ITask> children = ((ITaskContainer) child).getChildren();
// Always display empty containers
if (children.size() == 0) {
return false;
@@ -160,9 +160,11 @@ public class TaskListInterestFilter extends AbstractTaskListFilter {
} else if (task.getSynchronizationState().isIncoming()) {
return true;
}
- for (ITask child : task.getChildren()) {
- if (hasChangesHelper(parent, child)) {
- return true;
+ if (task instanceof ITaskContainer) {
+ for (ITask child : ((ITaskContainer) task).getChildren()) {
+ if (hasChangesHelper(parent, child)) {
+ return true;
+ }
}
}
return false;
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListInterestSorter.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListInterestSorter.java
index afa6835d5..1e7ef091c 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListInterestSorter.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListInterestSorter.java
@@ -16,8 +16,9 @@ import org.eclipse.mylyn.internal.tasks.core.ScheduledTaskContainer;
import org.eclipse.mylyn.internal.tasks.core.UncategorizedTaskContainer;
import org.eclipse.mylyn.internal.tasks.core.UnmatchedTaskContainer;
import org.eclipse.mylyn.internal.tasks.ui.TasksUiPlugin;
+import org.eclipse.mylyn.tasks.core.IRepositoryElement;
import org.eclipse.mylyn.tasks.core.ITask;
-import org.eclipse.mylyn.tasks.core.ITaskElement;
+import org.eclipse.mylyn.tasks.core.ITaskContainer;
/**
* @author Mik Kersten
@@ -29,9 +30,9 @@ public class TaskListInterestSorter extends ViewerSorter {
@Override
public int compare(Viewer compareViewer, Object o1, Object o2) {
- if (o1 instanceof ITaskElement && o2 instanceof UnmatchedTaskContainer) {
+ if (o1 instanceof ITaskContainer && o2 instanceof UnmatchedTaskContainer) {
return -1;
- } else if (o2 instanceof ITaskElement && o1 instanceof UnmatchedTaskContainer) {
+ } else if (o2 instanceof ITaskContainer && o1 instanceof UnmatchedTaskContainer) {
return 1;
}
//
@@ -53,15 +54,15 @@ public class TaskListInterestSorter extends ViewerSorter {
// } else if (!dateRangeTaskContainer1.isCaptureFloating() && dateRangeTaskContainer2.isCaptureFloating()) {
// return -1;
// }
- } else if (o1 instanceof ITaskElement && o2 instanceof ScheduledTaskContainer) {
+ } else if (o1 instanceof ITaskContainer && o2 instanceof ScheduledTaskContainer) {
return -1;
- } else if (o1 instanceof ScheduledTaskContainer && o2 instanceof ITaskElement) {
+ } else if (o1 instanceof ScheduledTaskContainer && o2 instanceof ITaskContainer) {
return 1;
}
- if (o1 instanceof UncategorizedTaskContainer && o2 instanceof ITaskElement) {
+ if (o1 instanceof UncategorizedTaskContainer && o2 instanceof ITaskContainer) {
return -1;
- } else if (o1 instanceof ITaskElement && o2 instanceof UncategorizedTaskContainer) {
+ } else if (o1 instanceof ITaskContainer && o2 instanceof UncategorizedTaskContainer) {
return 1;
}
@@ -71,16 +72,17 @@ public class TaskListInterestSorter extends ViewerSorter {
if (!(o1 instanceof ITask)) {//o1 instanceof AbstractTaskContainer || o1 instanceof AbstractRepositoryQuery) {
if (!(o2 instanceof ITask)) {//o2 instanceof AbstractTaskContainer || o2 instanceof AbstractRepositoryQuery) {
- return ((ITaskElement) o1).getSummary().compareToIgnoreCase(((ITaskElement) o2).getSummary());
+ return ((IRepositoryElement) o1).getSummary().compareToIgnoreCase(
+ ((IRepositoryElement) o2).getSummary());
} else {
return -1;
}
- } else if (o1 instanceof ITaskElement) {
+ } else if (o1 instanceof ITaskContainer) {
if (!(o2 instanceof ITask)) {//o2 instanceof AbstractTaskContainer || o2 instanceof AbstractRepositoryQuery) {
return -1;
- } else if (o2 instanceof ITaskElement) {
- ITaskElement element1 = (ITaskElement) o1;
- ITaskElement element2 = (ITaskElement) o2;
+ } else if (o2 instanceof ITaskContainer) {
+ IRepositoryElement element1 = (IRepositoryElement) o1;
+ IRepositoryElement element2 = (IRepositoryElement) o2;
AbstractTask task1 = null;
AbstractTask task2 = null;
@@ -211,7 +213,7 @@ public class TaskListInterestSorter extends ViewerSorter {
// }
// }
- private int comparePrioritiesAndKeys(ITaskElement element1, ITaskElement element2) {
+ private int comparePrioritiesAndKeys(IRepositoryElement element1, IRepositoryElement element2) {
int priority = comparePriorities(element1, element2);
if (priority != 0) {
return priority;
@@ -224,14 +226,19 @@ public class TaskListInterestSorter extends ViewerSorter {
return 0;
}
- private int compareKeys(ITaskElement element1, ITaskElement element2) {
+ private int compareKeys(IRepositoryElement element1, IRepositoryElement element2) {
return taskKeyComparator.compare(TaskListTableSorter.getSortableFromElement(element1),
TaskListTableSorter.getSortableFromElement(element2));
}
- private int comparePriorities(ITaskElement element1, ITaskElement element2) {
- return ((AbstractTaskContainer) element1).getPriority().compareTo(
- ((AbstractTaskContainer) element2).getPriority());
+ private int comparePriorities(IRepositoryElement element1, IRepositoryElement element2) {
+ if (element1 instanceof AbstractTaskContainer && element2 instanceof AbstractTaskContainer) {
+ return ((AbstractTaskContainer) element1).getPriority().compareTo(
+ ((AbstractTaskContainer) element2).getPriority());
+ } else {
+ // TODO: consider implementing
+ return -1;
+ }
}
}
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListTableSorter.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListTableSorter.java
index 094a5fb76..3afc9f7fe 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListTableSorter.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListTableSorter.java
@@ -16,9 +16,10 @@ import org.eclipse.mylyn.internal.tasks.core.AbstractTaskContainer;
import org.eclipse.mylyn.internal.tasks.core.ScheduledTaskContainer;
import org.eclipse.mylyn.internal.tasks.core.UncategorizedTaskContainer;
import org.eclipse.mylyn.internal.tasks.core.UnmatchedTaskContainer;
+import org.eclipse.mylyn.tasks.core.IRepositoryElement;
import org.eclipse.mylyn.tasks.core.IRepositoryQuery;
import org.eclipse.mylyn.tasks.core.ITask;
-import org.eclipse.mylyn.tasks.core.ITaskElement;
+import org.eclipse.mylyn.tasks.core.ITaskContainer;
import org.eclipse.mylyn.tasks.ui.ITasksUiConstants;
import org.eclipse.ui.PlatformUI;
@@ -80,21 +81,21 @@ public class TaskListTableSorter extends ViewerSorter {
// return -1;
// }
// return -1 * dateRangeTaskContainer2.getStart().compareTo(dateRangeTaskContainer1.getStart());
- } else if (o1 instanceof ITaskElement && o2 instanceof ScheduledTaskContainer) {
+ } else if (o1 instanceof ITaskContainer && o2 instanceof ScheduledTaskContainer) {
return -1;
- } else if (o1 instanceof ScheduledTaskContainer && o2 instanceof ITaskElement) {
+ } else if (o1 instanceof ScheduledTaskContainer && o2 instanceof ITaskContainer) {
return 1;
}
- if (o1 instanceof ITaskElement && o2 instanceof UncategorizedTaskContainer) {
+ if (o1 instanceof ITaskContainer && o2 instanceof UncategorizedTaskContainer) {
return 1;
- } else if (o2 instanceof ITaskElement && o1 instanceof UncategorizedTaskContainer) {
+ } else if (o2 instanceof ITaskContainer && o1 instanceof UncategorizedTaskContainer) {
return -1;
}
- if (o1 instanceof ITaskElement && o2 instanceof UnmatchedTaskContainer) {
+ if (o1 instanceof ITaskContainer && o2 instanceof UnmatchedTaskContainer) {
return -1;
- } else if (o2 instanceof ITaskElement && o1 instanceof UnmatchedTaskContainer) {
+ } else if (o2 instanceof ITaskContainer && o1 instanceof UnmatchedTaskContainer) {
return 1;
}
@@ -102,26 +103,27 @@ public class TaskListTableSorter extends ViewerSorter {
return 1;
}
- if (o1 instanceof ITask && !(o2 instanceof ITaskElement)) {
+ if (o1 instanceof ITask && !(o2 instanceof ITaskContainer)) {
return -1;
}
// if (o1 instanceof AbstractTaskContainer || o1 instanceof
// AbstractRepositoryQuery) {
if (!(o1 instanceof ITask)) {
- if (o2 instanceof ITaskElement || o2 instanceof IRepositoryQuery) {
+ if (o2 instanceof ITaskContainer || o2 instanceof IRepositoryQuery) {
return this.sortDirection
- * ((ITaskElement) o1).getSummary().compareToIgnoreCase(((ITaskElement) o2).getSummary());
+ * ((IRepositoryElement) o1).getSummary().compareToIgnoreCase(
+ ((IRepositoryElement) o2).getSummary());
} else {
return -1;
}
- } else if (o1 instanceof ITaskElement) {
+ } else if (o1 instanceof ITaskContainer) {
if (!(o2 instanceof ITask)) {
return -1;
- } else if (o2 instanceof ITaskElement) {
- ITaskElement element1 = (ITaskElement) o1;
- ITaskElement element2 = (ITaskElement) o2;
+ } else if (o2 instanceof ITaskContainer) {
+ IRepositoryElement element1 = (IRepositoryElement) o1;
+ IRepositoryElement element2 = (IRepositoryElement) o2;
return compareElements(element1, element2);
}
@@ -131,7 +133,7 @@ public class TaskListTableSorter extends ViewerSorter {
return 0;
}
- private int compareElements(ITaskElement element1, ITaskElement element2) {
+ private int compareElements(IRepositoryElement element1, IRepositoryElement element2) {
if (SortByIndex.PRIORITY.equals(sortByIndex)) {
int result = sortByPriority(element1, element2, sortDirection);
if (result != 0) {
@@ -185,7 +187,7 @@ public class TaskListTableSorter extends ViewerSorter {
* @param element2
* @return sort order
*/
- private int sortBySummary(ITaskElement element1, ITaskElement element2, int sortDirection) {
+ private int sortBySummary(IRepositoryElement element1, IRepositoryElement element2, int sortDirection) {
return sortDirection
* taskKeyComparator.compare(getSortableFromElement(element1), getSortableFromElement(element2));
}
@@ -197,7 +199,7 @@ public class TaskListTableSorter extends ViewerSorter {
* @param element2
* @return sort order
*/
- private int sortByPriority(ITaskElement element1, ITaskElement element2, int sortDirection) {
+ private int sortByPriority(IRepositoryElement element1, IRepositoryElement element2, int sortDirection) {
return sortDirection
* ((AbstractTaskContainer) element1).getPriority().compareTo(
((AbstractTaskContainer) element2).getPriority());
@@ -210,7 +212,7 @@ public class TaskListTableSorter extends ViewerSorter {
* @param element2
* @return sort order
*/
- private int sortByDate(ITaskElement element1, ITaskElement element2, int sortDirection) {
+ private int sortByDate(IRepositoryElement element1, IRepositoryElement element2, int sortDirection) {
AbstractTask t1 = null;
AbstractTask t2 = null;
if (element1 instanceof AbstractTask) {
@@ -235,7 +237,7 @@ public class TaskListTableSorter extends ViewerSorter {
* @deprecated Use getSortableFromElement()
*/
@Deprecated
- public static String getSortableSummaryFromElement(ITaskElement element) {
+ public static String getSortableSummaryFromElement(IRepositoryElement element) {
String summary = element.getSummary();
if (element instanceof ITask) {
@@ -253,7 +255,7 @@ public class TaskListTableSorter extends ViewerSorter {
* @param element
* @return String array[component, taskId, summary]
*/
- public static String[] getSortableFromElement(ITaskElement element) {
+ public static String[] getSortableFromElement(IRepositoryElement element) {
final String a[] = new String[] { "", null, element.getSummary() };
if (element instanceof ITask) {
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListToolTip.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListToolTip.java
index 0c9aee893..363df1f9d 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListToolTip.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListToolTip.java
@@ -39,9 +39,10 @@ import org.eclipse.mylyn.internal.tasks.ui.LegacyChangeManager;
import org.eclipse.mylyn.internal.tasks.ui.TaskListHyperlink;
import org.eclipse.mylyn.internal.tasks.ui.TasksUiPlugin;
import org.eclipse.mylyn.tasks.core.AbstractRepositoryConnector;
+import org.eclipse.mylyn.tasks.core.IRepositoryElement;
import org.eclipse.mylyn.tasks.core.IRepositoryQuery;
import org.eclipse.mylyn.tasks.core.ITask;
-import org.eclipse.mylyn.tasks.core.ITaskElement;
+import org.eclipse.mylyn.tasks.core.ITaskContainer;
import org.eclipse.mylyn.tasks.core.RepositoryStatus;
import org.eclipse.mylyn.tasks.core.TaskRepository;
import org.eclipse.mylyn.tasks.ui.AbstractRepositoryConnectorUi;
@@ -86,7 +87,7 @@ public class TaskListToolTip extends ToolTip {
private final static int Y_SHIFT = 1;
- private ITaskElement currentTipElement;
+ private IRepositoryElement currentTipElement;
private final List<TaskListToolTipListener> listeners = new ArrayList<TaskListToolTipListener>();
@@ -124,24 +125,24 @@ public class TaskListToolTip extends ToolTip {
listeners.remove(listener);
}
- private ITaskElement getTaskListElement(Object hoverObject) {
+ private IRepositoryElement getTaskListElement(Object hoverObject) {
if (hoverObject instanceof TaskListHyperlink) {
TaskListHyperlink hyperlink = (TaskListHyperlink) hoverObject;
return hyperlink.getTask();
} else if (hoverObject instanceof Widget) {
Object data = ((Widget) hoverObject).getData();
if (data != null) {
- if (data instanceof ITaskElement) {
- return (ITaskElement) data;
+ if (data instanceof ITaskContainer) {
+ return (IRepositoryElement) data;
} else if (data instanceof IAdaptable) {
- return (ITaskElement) ((IAdaptable) data).getAdapter(AbstractTaskContainer.class);
+ return (IRepositoryElement) ((IAdaptable) data).getAdapter(AbstractTaskContainer.class);
}
}
}
return null;
}
- private String getTitleText(ITaskElement element) {
+ private String getTitleText(IRepositoryElement element) {
if (element instanceof ScheduledTaskContainer) {
StringBuilder sb = new StringBuilder();
sb.append(element.getSummary());
@@ -163,7 +164,7 @@ public class TaskListToolTip extends ToolTip {
}
}
- private String getDetailsText(ITaskElement element) {
+ private String getDetailsText(IRepositoryElement element) {
if (element instanceof ScheduledTaskContainer) {
ScheduledTaskContainer container = (ScheduledTaskContainer) element;
int estimateTotal = 0;
@@ -218,7 +219,7 @@ public class TaskListToolTip extends ToolTip {
return "";
}
- private String getActivityText(ITaskElement element) {
+ private String getActivityText(IRepositoryElement element) {
// if (element instanceof ScheduledTaskDelegate) {
// ScheduledTaskDelegate task = (ScheduledTaskDelegate) element;
//
@@ -275,7 +276,7 @@ public class TaskListToolTip extends ToolTip {
return null;
}
- private String getIncommingText(ITaskElement element) {
+ private String getIncommingText(IRepositoryElement element) {
if (element instanceof ITask) {
ITask task = (ITask) element;
if (task.getSynchronizationState().isIncoming()) {
@@ -305,7 +306,7 @@ public class TaskListToolTip extends ToolTip {
return null;
}
- private String getStatusText(ITaskElement element) {
+ private String getStatusText(IRepositoryElement element) {
IStatus status = null;
if (element instanceof AbstractTask) {
AbstractTask task = (AbstractTask) element;
@@ -339,27 +340,30 @@ public class TaskListToolTip extends ToolTip {
return super.getLocation(tipSize, event);//control.toDisplay(event.x + xShift, event.y + yShift);
}
- private ProgressData getProgressData(ITaskElement element) {
+ private ProgressData getProgressData(IRepositoryElement element) {
if (element instanceof ITask) {
return null;
- }
- Object[] children = new Object[0];
+ } else if (element instanceof ITaskContainer) {
+ Object[] children = new Object[0];
- children = element.getChildren().toArray();
+ children = ((ITaskContainer) element).getChildren().toArray();
- int total = children.length;
- int completed = 0;
- for (ITask task : element.getChildren()) {
- if (task.isCompleted()) {
- completed++;
+ int total = children.length;
+ int completed = 0;
+ for (ITask task : ((ITaskContainer) element).getChildren()) {
+ if (task.isCompleted()) {
+ completed++;
+ }
}
- }
- String text = "Total: " + total + " (Complete: " + completed + ", Incomplete: " + (total - completed) + ")";
- return new ProgressData(completed, total, text);
+ String text = "Total: " + total + " (Complete: " + completed + ", Incomplete: " + (total - completed) + ")";
+ return new ProgressData(completed, total, text);
+ } else {
+ return null;
+ }
}
- private Image getImage(ITaskElement element) {
+ private Image getImage(IRepositoryElement element) {
if (element instanceof IRepositoryQuery) {
IRepositoryQuery query = (IRepositoryQuery) element;
AbstractRepositoryConnector connector = TasksUi.getRepositoryManager().getRepositoryConnector(
@@ -522,9 +526,9 @@ public class TaskListToolTip extends ToolTip {
return composite;
}
- private String getHelpText(ITaskElement element) {
+ private String getHelpText(IRepositoryElement element) {
if (element instanceof TaskCategory || element instanceof IRepositoryQuery) {
- if (AbstractTaskListFilter.hasDescendantIncoming(element)) {
+ if (AbstractTaskListFilter.hasDescendantIncoming((ITaskContainer) element)) {
TaskListView taskListView = TaskListView.getFromActivePerspective();
if (taskListView != null) {
@@ -568,7 +572,7 @@ public class TaskListToolTip extends ToolTip {
return composite;
}
- private String getSynchText(ITaskElement element) {
+ private String getSynchText(IRepositoryElement element) {
if (element instanceof IRepositoryQuery) {
String syncStamp = ((RepositoryQuery) element).getLastSynchronizedTimeStamp();
if (syncStamp != null) {
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListView.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListView.java
index b0390ac32..0de307e8e 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListView.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListView.java
@@ -108,7 +108,8 @@ import org.eclipse.mylyn.tasks.core.IRepositoryQuery;
import org.eclipse.mylyn.tasks.core.ITask;
import org.eclipse.mylyn.tasks.core.ITaskActivationListener;
import org.eclipse.mylyn.tasks.core.ITaskActivityListener;
-import org.eclipse.mylyn.tasks.core.ITaskElement;
+import org.eclipse.mylyn.tasks.core.ITaskContainer;
+import org.eclipse.mylyn.tasks.core.IRepositoryElement;
import org.eclipse.mylyn.tasks.core.ITaskListChangeListener;
import org.eclipse.mylyn.tasks.core.TaskActivationAdapter;
import org.eclipse.mylyn.tasks.core.TaskActivityAdapter;
@@ -423,7 +424,7 @@ public class TaskListView extends ViewPart implements IPropertyChangeListener {
private final Listener CATEGORY_GRADIENT_DRAWER = new Listener() {
public void handleEvent(Event event) {
- if (event.item.getData() instanceof ITaskElement && !(event.item.getData() instanceof ITask)) {
+ if (event.item.getData() instanceof ITaskContainer && !(event.item.getData() instanceof ITask)) {
Scrollable scrollable = (Scrollable) event.widget;
GC gc = event.gc;
@@ -950,9 +951,9 @@ public class TaskListView extends ViewPart implements IPropertyChangeListener {
getViewer().addSelectionChangedListener(new ISelectionChangedListener() {
public void selectionChanged(SelectionChangedEvent event) {
Object selectedObject = ((IStructuredSelection) getViewer().getSelection()).getFirstElement();
- if (selectedObject instanceof ITaskElement) {
- updateActionEnablement(renameAction, (ITaskElement) selectedObject);
- updateActionEnablement(deleteAction, (ITaskElement) selectedObject);
+ if (selectedObject instanceof ITaskContainer) {
+ updateActionEnablement(renameAction, (ITaskContainer) selectedObject);
+ updateActionEnablement(deleteAction, (ITaskContainer) selectedObject);
}
}
});
@@ -1206,15 +1207,15 @@ public class TaskListView extends ViewPart implements IPropertyChangeListener {
*/
private void fillContextMenu(final IMenuManager manager) {
updateDrillDownActions();
- final ITaskElement element;
+ final ITaskContainer element;
final Object firstSelectedObject = ((IStructuredSelection) getViewer().getSelection()).getFirstElement();
- if (firstSelectedObject instanceof ITaskElement) {
- element = (ITaskElement) firstSelectedObject;
+ if (firstSelectedObject instanceof ITaskContainer) {
+ element = (ITaskContainer) firstSelectedObject;
} else {
element = null;
}
- final List<ITaskElement> selectedElements = getSelectedTaskContainers();
+ final List<IRepositoryElement> selectedElements = getSelectedTaskContainers();
AbstractTask task = null;
if (element instanceof ITask) {
task = (AbstractTask) element;
@@ -1315,24 +1316,24 @@ public class TaskListView extends ViewPart implements IPropertyChangeListener {
manager.add(new Separator(ID_SEPARATOR_PROPERTIES));
}
- public List<ITaskElement> getSelectedTaskContainers() {
- List<ITaskElement> selectedElements = new ArrayList<ITaskElement>();
+ public List<IRepositoryElement> getSelectedTaskContainers() {
+ List<IRepositoryElement> selectedElements = new ArrayList<IRepositoryElement>();
for (Iterator<?> i = ((IStructuredSelection) getViewer().getSelection()).iterator(); i.hasNext();) {
Object object = i.next();
- if (object instanceof ITaskElement) {
- selectedElements.add((ITaskElement) object);
+ if (object instanceof ITaskContainer) {
+ selectedElements.add((IRepositoryElement) object);
}
}
return selectedElements;
}
- private void addMenuManager(IMenuManager menuToAdd, IMenuManager manager, ITaskElement element) {
+ private void addMenuManager(IMenuManager menuToAdd, IMenuManager manager, ITaskContainer element) {
if ((element instanceof ITask) || element instanceof IRepositoryQuery) {
manager.add(menuToAdd);
}
}
- private void addAction(Action action, IMenuManager manager, ITaskElement element) {
+ private void addAction(Action action, IMenuManager manager, ITaskContainer element) {
manager.add(action);
if (element != null) {
updateActionEnablement(action, element);
@@ -1340,7 +1341,7 @@ public class TaskListView extends ViewPart implements IPropertyChangeListener {
}
// FIXME move the enablement to the action classes
- private void updateActionEnablement(Action action, ITaskElement element) {
+ private void updateActionEnablement(Action action, ITaskContainer element) {
if (element instanceof ITask) {
if (action instanceof OpenWithBrowserAction) {
if (TasksUiInternal.isValidUrl(((ITask) element).getUrl())) {
@@ -1542,7 +1543,7 @@ public class TaskListView extends ViewPart implements IPropertyChangeListener {
if (selection instanceof StructuredSelection) {
StructuredSelection structuredSelection = (StructuredSelection) selection;
Object element = structuredSelection.getFirstElement();
- if (element instanceof ITaskElement) {
+ if (element instanceof ITaskContainer) {
drilledIntoCategory = (AbstractTaskContainer) element;
drillDownAdapter.goInto();
IActionBars bars = getViewSite().getActionBars();
@@ -1626,10 +1627,10 @@ public class TaskListView extends ViewPart implements IPropertyChangeListener {
private void saveSelection() {
IStructuredSelection selection = (IStructuredSelection) getViewer().getSelection();
if (!selection.isEmpty()) {
- if (selection.getFirstElement() instanceof ITaskElement) {
+ if (selection.getFirstElement() instanceof ITaskContainer) {
// make sure the new selection is inserted at the end of the
// list
- String handle = ((ITaskElement) selection.getFirstElement()).getHandleIdentifier();
+ String handle = ((IRepositoryElement) selection.getFirstElement()).getHandleIdentifier();
lastSelectionByTaskHandle.remove(handle);
lastSelectionByTaskHandle.put(handle, selection);
@@ -1642,7 +1643,7 @@ public class TaskListView extends ViewPart implements IPropertyChangeListener {
}
}
- private IStructuredSelection restoreSelection(ITaskElement task) {
+ private IStructuredSelection restoreSelection(IRepositoryElement task) {
IStructuredSelection selection = lastSelectionByTaskHandle.get(task.getHandleIdentifier());
if (selection != null) {
return selection;
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskScheduleContentProvider.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskScheduleContentProvider.java
index ce90d7338..40d29f2e9 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskScheduleContentProvider.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskScheduleContentProvider.java
@@ -25,7 +25,7 @@ import org.eclipse.mylyn.internal.tasks.core.WeekDateRange;
import org.eclipse.mylyn.internal.tasks.ui.TasksUiPlugin;
import org.eclipse.mylyn.tasks.core.ITask;
import org.eclipse.mylyn.tasks.core.ITaskActivityListener;
-import org.eclipse.mylyn.tasks.core.ITaskElement;
+import org.eclipse.mylyn.tasks.core.ITaskContainer;
import org.eclipse.ui.PlatformUI;
/**
@@ -107,8 +107,8 @@ public class TaskScheduleContentProvider extends TaskListContentProvider impleme
}
}
- } else if (parent instanceof ITaskElement) {
- for (ITask child : ((ITaskElement) parent).getChildren()) {
+ } else if (parent instanceof ITaskContainer) {
+ for (ITask child : ((ITaskContainer) parent).getChildren()) {
result.add(child);
}
}
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskTableLabelProvider.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskTableLabelProvider.java
index f7294c99c..684fe38b5 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskTableLabelProvider.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskTableLabelProvider.java
@@ -18,7 +18,7 @@ import org.eclipse.jface.viewers.ITableFontProvider;
import org.eclipse.jface.viewers.ITableLabelProvider;
import org.eclipse.mylyn.tasks.core.IRepositoryQuery;
import org.eclipse.mylyn.tasks.core.ITask;
-import org.eclipse.mylyn.tasks.core.ITaskElement;
+import org.eclipse.mylyn.tasks.core.ITaskContainer;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.Font;
import org.eclipse.swt.graphics.Image;
@@ -41,7 +41,7 @@ public class TaskTableLabelProvider extends DecoratingLabelProvider implements I
}
public String getColumnText(Object obj, int columnIndex) {
- if (obj instanceof ITaskElement) {
+ if (obj instanceof ITaskContainer) {
switch (columnIndex) {
case 0:
// if (obj instanceof ScheduledTaskContainer) {
@@ -58,7 +58,7 @@ public class TaskTableLabelProvider extends DecoratingLabelProvider implements I
}
public Image getColumnImage(Object element, int columnIndex) {
- if (!(element instanceof ITaskElement)) {
+ if (!(element instanceof ITaskContainer)) {
return null;
}
if (columnIndex == 0) {
@@ -76,7 +76,7 @@ public class TaskTableLabelProvider extends DecoratingLabelProvider implements I
}
public Color getBackground(Object element, int columnIndex) {
- if (element instanceof ITaskElement && !(element instanceof ITask)) {
+ if (element instanceof ITaskContainer && !(element instanceof ITask)) {
return categoryBackgroundColor;
} else if (element instanceof IRepositoryQuery) {
return categoryBackgroundColor;
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/workingsets/TaskWorkingSetAdapterFactory.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/workingsets/TaskWorkingSetAdapterFactory.java
index 0ed9a4852..66aa6079b 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/workingsets/TaskWorkingSetAdapterFactory.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/workingsets/TaskWorkingSetAdapterFactory.java
@@ -10,7 +10,8 @@ package org.eclipse.mylyn.internal.tasks.ui.workingsets;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.IAdapterFactory;
-import org.eclipse.mylyn.tasks.core.ITaskElement;
+import org.eclipse.mylyn.internal.tasks.core.AbstractTaskContainer;
+import org.eclipse.mylyn.tasks.core.IRepositoryElement;
import org.eclipse.ui.IMemento;
import org.eclipse.ui.IPersistableElement;
@@ -32,10 +33,10 @@ public class TaskWorkingSetAdapterFactory implements IAdapterFactory {
}
public Object getAdapter(final Object adaptableObject, @SuppressWarnings("unchecked") Class adapterType) {
- if (adapterType == IPersistableElement.class && adaptableObject instanceof ITaskElement) {
+ if (adapterType == IPersistableElement.class && adaptableObject instanceof AbstractTaskContainer) {
return new IPersistableElement() {
public void saveState(IMemento memento) {
- ITaskElement container = (ITaskElement) adaptableObject;
+ IRepositoryElement container = (IRepositoryElement) adaptableObject;
memento.putString(TaskWorkingSetElementFactory.HANDLE_TASK, container.getHandleIdentifier());
}
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/workingsets/TaskWorkingSetElementAdapter.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/workingsets/TaskWorkingSetElementAdapter.java
index 236d88c62..9fe517525 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/workingsets/TaskWorkingSetElementAdapter.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/workingsets/TaskWorkingSetElementAdapter.java
@@ -13,7 +13,7 @@ import java.util.List;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.mylyn.tasks.core.ITaskElement;
+import org.eclipse.mylyn.internal.tasks.core.AbstractTaskContainer;
import org.eclipse.ui.IWorkingSet;
import org.eclipse.ui.IWorkingSetElementAdapter;
@@ -25,7 +25,7 @@ public class TaskWorkingSetElementAdapter implements IWorkingSetElementAdapter {
public IAdaptable[] adaptElements(IWorkingSet workingSet, IAdaptable[] elements) {
for (IAdaptable adaptable : elements) {
- if (!(adaptable instanceof ITaskElement)) {
+ if (!(adaptable instanceof AbstractTaskContainer)) {
return selectContainers(elements);
}
}
@@ -35,7 +35,7 @@ public class TaskWorkingSetElementAdapter implements IWorkingSetElementAdapter {
private IAdaptable[] selectContainers(IAdaptable[] elements) {
List<IAdaptable> containers = new ArrayList<IAdaptable>(elements.length);
for (IAdaptable adaptable : elements) {
- if (adaptable instanceof ITaskElement) {
+ if (adaptable instanceof AbstractTaskContainer) {
containers.add(adaptable);
} else if (adaptable instanceof IProject) {
containers.add(adaptable);
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/workingsets/TaskWorkingSetPage.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/workingsets/TaskWorkingSetPage.java
index 5064da0c3..261c5913b 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/workingsets/TaskWorkingSetPage.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/workingsets/TaskWorkingSetPage.java
@@ -36,7 +36,6 @@ import org.eclipse.mylyn.internal.tasks.ui.TasksUiPlugin;
import org.eclipse.mylyn.internal.tasks.ui.util.TasksUiInternal;
import org.eclipse.mylyn.internal.tasks.ui.views.TaskRepositoryLabelProvider;
import org.eclipse.mylyn.tasks.core.IRepositoryQuery;
-import org.eclipse.mylyn.tasks.core.ITaskElement;
import org.eclipse.mylyn.tasks.core.TaskRepository;
import org.eclipse.mylyn.tasks.ui.TaskElementLabelProvider;
import org.eclipse.mylyn.tasks.ui.TasksUi;
@@ -226,7 +225,7 @@ public class TaskWorkingSetPage extends WizardPage implements IWorkingSetPage {
private final WorkbenchLabelProvider workbenchLabelProvider = new WorkbenchLabelProvider();
public Image getImage(Object element) {
- if (element instanceof ITaskElement) {
+ if (element instanceof AbstractTaskContainer) {
return taskLabelProvider.getImage(element);
} else if (element instanceof TaskRepository) {
return taskRepositoryLabelProvider.getImage(element);
@@ -238,7 +237,7 @@ public class TaskWorkingSetPage extends WizardPage implements IWorkingSetPage {
}
public String getText(Object element) {
- if (element instanceof ITaskElement) {
+ if (element instanceof AbstractTaskContainer) {
return taskLabelProvider.getText(element);
} else if (element instanceof TaskRepository) {
return taskRepositoryLabelProvider.getText(element);
@@ -292,7 +291,7 @@ public class TaskWorkingSetPage extends WizardPage implements IWorkingSetPage {
Object[] elements = treeViewer.getCheckedElements();
Set<IAdaptable> validElements = new HashSet<IAdaptable>();
for (Object element : elements) {
- if (element instanceof ITaskElement || element instanceof IProject) {
+ if (element instanceof AbstractTaskContainer || element instanceof IProject) {
validElements.add((IAdaptable) element);
}
}
@@ -501,7 +500,7 @@ public class TaskWorkingSetPage extends WizardPage implements IWorkingSetPage {
BusyIndicator.showWhile(getShell().getDisplay(), new Runnable() {
public void run() {
IAdaptable element = (IAdaptable) event.getElement();
- if (element instanceof ITaskElement || element instanceof IProject) {
+ if (element instanceof AbstractTaskContainer || element instanceof IProject) {
treeViewer.setGrayed(element, false);
} else if (element instanceof ElementCategory) {
for (Object child : ((ElementCategory) element).getChildren(null)) {
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/workingsets/TaskWorkingSetUpdater.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/workingsets/TaskWorkingSetUpdater.java
index 34fb95145..7519e5361 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/workingsets/TaskWorkingSetUpdater.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/workingsets/TaskWorkingSetUpdater.java
@@ -21,12 +21,13 @@ import org.eclipse.core.resources.IResourceChangeListener;
import org.eclipse.core.resources.IResourceDelta;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.mylyn.internal.tasks.core.AbstractTaskContainer;
import org.eclipse.mylyn.internal.tasks.core.TaskCategory;
import org.eclipse.mylyn.internal.tasks.core.TaskContainerDelta;
import org.eclipse.mylyn.internal.tasks.ui.TasksUiPlugin;
import org.eclipse.mylyn.internal.tasks.ui.util.TasksUiInternal;
+import org.eclipse.mylyn.tasks.core.IRepositoryElement;
import org.eclipse.mylyn.tasks.core.IRepositoryQuery;
-import org.eclipse.mylyn.tasks.core.ITaskElement;
import org.eclipse.mylyn.tasks.core.ITaskListChangeListener;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.IWorkbenchWindow;
@@ -99,9 +100,9 @@ public class TaskWorkingSetUpdater implements IWorkingSetUpdater, ITaskListChang
private void checkElementExistence(IWorkingSet workingSet) {
ArrayList<IAdaptable> list = new ArrayList<IAdaptable>();
for (IAdaptable adaptable : workingSet.getElements()) {
- if (adaptable instanceof ITaskElement) {
- String handle = ((ITaskElement) adaptable).getHandleIdentifier();
- for (ITaskElement element : TasksUiPlugin.getTaskList().getRootElements()) {
+ if (adaptable instanceof AbstractTaskContainer) {
+ String handle = ((AbstractTaskContainer) adaptable).getHandleIdentifier();
+ for (IRepositoryElement element : TasksUiPlugin.getTaskList().getRootElements()) {
if (element != null && element.getHandleIdentifier().equals(handle)) {
list.add(adaptable);
}
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/AbstractRepositoryConnectorUi.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/AbstractRepositoryConnectorUi.java
index 27c6f3deb..6fb38396c 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/AbstractRepositoryConnectorUi.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/AbstractRepositoryConnectorUi.java
@@ -19,10 +19,10 @@ import org.eclipse.jface.wizard.IWizardPage;
import org.eclipse.mylyn.internal.tasks.ui.OpenRepositoryTaskJob;
import org.eclipse.mylyn.internal.tasks.ui.wizards.CommonAddExistingTaskWizard;
import org.eclipse.mylyn.tasks.core.AbstractRepositoryConnector;
+import org.eclipse.mylyn.tasks.core.IRepositoryElement;
import org.eclipse.mylyn.tasks.core.IRepositoryQuery;
import org.eclipse.mylyn.tasks.core.ITask;
import org.eclipse.mylyn.tasks.core.ITaskComment;
-import org.eclipse.mylyn.tasks.core.ITaskElement;
import org.eclipse.mylyn.tasks.core.ITaskMapping;
import org.eclipse.mylyn.tasks.core.ITaskRepositoryManager;
import org.eclipse.mylyn.tasks.core.TaskRepository;
@@ -123,7 +123,7 @@ public abstract class AbstractRepositoryConnectorUi {
*
* @since 3.0
*/
- public ImageDescriptor getTaskListElementIcon(ITaskElement element) {
+ public ImageDescriptor getTaskListElementIcon(IRepositoryElement element) {
if (element instanceof IRepositoryQuery) {
return TasksUiImages.QUERY;
} else if (element instanceof ITask) {
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/TaskElementLabelProvider.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/TaskElementLabelProvider.java
index 0d951588b..ebacc887b 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/TaskElementLabelProvider.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/TaskElementLabelProvider.java
@@ -30,10 +30,10 @@ import org.eclipse.mylyn.internal.tasks.core.UncategorizedTaskContainer;
import org.eclipse.mylyn.internal.tasks.core.UnmatchedTaskContainer;
import org.eclipse.mylyn.internal.tasks.ui.ITaskHighlighter;
import org.eclipse.mylyn.internal.tasks.ui.TasksUiPlugin;
-import org.eclipse.mylyn.internal.tasks.ui.util.TasksUiInternal;
+import org.eclipse.mylyn.tasks.core.IRepositoryElement;
import org.eclipse.mylyn.tasks.core.IRepositoryQuery;
import org.eclipse.mylyn.tasks.core.ITask;
-import org.eclipse.mylyn.tasks.core.ITaskElement;
+import org.eclipse.mylyn.tasks.core.ITaskContainer;
import org.eclipse.mylyn.tasks.core.TaskRepository;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.Font;
@@ -81,7 +81,7 @@ public class TaskElementLabelProvider extends LabelProvider implements IColorPro
}
return CommonImages.getCompositeTaskImage(compositeDescriptor.icon, compositeDescriptor.overlayKind,
wideImages);
- } else if (element instanceof ITaskElement) {
+ } else if (element instanceof ITaskContainer) {
return CommonImages.getCompositeTaskImage(compositeDescriptor.icon, CommonImages.OVERLAY_CLEAR, wideImages);
} else {
return CommonImages.getCompositeTaskImage(compositeDescriptor.icon, null, wideImages);
@@ -99,8 +99,8 @@ public class TaskElementLabelProvider extends LabelProvider implements IColorPro
compositeDescriptor.icon = CommonImages.GROUPING;
}
- if (object instanceof ITaskElement) {
- ITaskElement element = (ITaskElement) object;
+ if (object instanceof ITaskContainer) {
+ IRepositoryElement element = (IRepositoryElement) object;
AbstractRepositoryConnectorUi connectorUi = null;
if (element instanceof ITask) {
@@ -179,8 +179,8 @@ public class TaskElementLabelProvider extends LabelProvider implements IColorPro
return result;
- } else if (object instanceof ITaskElement) {
- ITaskElement element = (ITaskElement) object;
+ } else if (object instanceof ITaskContainer) {
+ IRepositoryElement element = (IRepositoryElement) object;
return element.getSummary();
} else {
return super.getText(object);
@@ -188,8 +188,8 @@ public class TaskElementLabelProvider extends LabelProvider implements IColorPro
}
public Color getForeground(Object object) {
- if (object instanceof ITaskElement && object instanceof ITask) {
- AbstractTask task = TasksUiInternal.getCorrespondingTask((ITaskElement) object);
+ if (object instanceof AbstractTask) {
+ AbstractTask task = (AbstractTask) object;
if (task != null) {
if (TasksUiPlugin.getTaskActivityManager().isCompletedToday(task)) {
return themeManager.getCurrentTheme().getColorRegistry().get(CommonThemes.COLOR_COMPLETED_TODAY);
@@ -212,9 +212,9 @@ public class TaskElementLabelProvider extends LabelProvider implements IColorPro
.get(CommonThemes.COLOR_SCHEDULED_THIS_WEEK);
}
}
- } else if (object instanceof ITaskElement) {
- for (ITask child : ((ITaskElement) object).getChildren()) {
- if (child.isActive() || showHasActiveChild(child)) {
+ } else if (object instanceof ITaskContainer) {
+ for (ITask child : ((ITaskContainer) object).getChildren()) {
+ if (child.isActive() || (child instanceof ITaskContainer && showHasActiveChild((ITaskContainer) child))) {
return CommonColors.CONTEXT_ACTIVE;
} else if (TasksUiPlugin.getTaskActivityManager().isOverdue(child)) {
// } else if ((child.isPastReminder() && !child.isCompleted()) || showHasChildrenPastDue(child)) {
@@ -237,36 +237,34 @@ public class TaskElementLabelProvider extends LabelProvider implements IColorPro
}
public Font getFont(Object element) {
- if (!(element instanceof ITaskElement)) {
- return null;
- }
- AbstractTask task = TasksUiInternal.getCorrespondingTask((ITaskElement) element);
- if (task != null) {
- if (task.isSynchronizing()) {
+ if (element instanceof AbstractTask) {
+ if (((AbstractTask) element).isSynchronizing()) {
return CommonFonts.ITALIC;
}
}
- if (element instanceof ITaskElement) {
- if (element instanceof IRepositoryQuery) {
- if (((RepositoryQuery) element).isSynchronizing()) {
- return CommonFonts.ITALIC;
- }
+
+ if (element instanceof IRepositoryQuery) {
+ if (((RepositoryQuery) element).isSynchronizing()) {
+ return CommonFonts.ITALIC;
}
+ }
- for (ITask child : ((ITaskElement) element).getChildren()) {
- if (child.isActive() || showHasActiveChild(child)) {
+ if (element instanceof ITaskContainer) {
+ for (ITask child : ((ITaskContainer) element).getChildren()) {
+ if (child.isActive() || (child instanceof ITaskContainer && showHasActiveChild((ITaskContainer) child))) {
return CommonFonts.BOLD;
}
}
}
- if (task != null) {
- if (task.isActive()) {
+
+ if (element instanceof AbstractTask) {
+ if (((AbstractTask) element).isActive()) {
return CommonFonts.BOLD;
- } else if (task.isCompleted()) {
+ } else if (((AbstractTask) element).isCompleted()) {
return CommonFonts.STRIKETHROUGH;
}
- for (ITask child : ((ITaskElement) element).getChildren()) {
- if (child.isActive() || showHasActiveChild(child)) {
+ for (ITask child : ((ITaskContainer) element).getChildren()) {
+ if (child.isActive() || (child instanceof ITaskContainer && showHasActiveChild((ITaskContainer) child))) {
return CommonFonts.BOLD;
}
}
@@ -274,24 +272,24 @@ public class TaskElementLabelProvider extends LabelProvider implements IColorPro
return null;
}
- private boolean showHasActiveChild(ITaskElement container) {
+ private boolean showHasActiveChild(ITaskContainer container) {
if (!TasksUiPlugin.getDefault().groupSubtasks(container)) {
return false;
}
- return showHasActiveChildHelper(container, new HashSet<ITaskElement>());
+ return showHasActiveChildHelper(container, new HashSet<IRepositoryElement>());
}
- private boolean showHasActiveChildHelper(ITaskElement container, Set<ITaskElement> visitedContainers) {
- for (ITaskElement child : container.getChildren()) {
+ private boolean showHasActiveChildHelper(ITaskContainer container, Set<IRepositoryElement> visitedContainers) {
+ for (IRepositoryElement child : container.getChildren()) {
if (visitedContainers.contains(child)) {
continue;
}
visitedContainers.add(child);
if (child instanceof ITask && ((AbstractTask) child).isActive()) {
return true;
- } else {
- if (showHasActiveChildHelper(child, visitedContainers)) {
+ } else if (child instanceof ITaskContainer) {
+ if (showHasActiveChildHelper((ITaskContainer) child, visitedContainers)) {
return true;
}
}
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/AbstractTaskEditorPage.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/AbstractTaskEditorPage.java
index 0495735d5..b03121329 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/AbstractTaskEditorPage.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/AbstractTaskEditorPage.java
@@ -64,7 +64,7 @@ import org.eclipse.mylyn.internal.tasks.ui.editors.TaskListChangeAdapter;
import org.eclipse.mylyn.internal.tasks.ui.util.TasksUiInternal;
import org.eclipse.mylyn.tasks.core.AbstractRepositoryConnector;
import org.eclipse.mylyn.tasks.core.ITask;
-import org.eclipse.mylyn.tasks.core.ITaskElement;
+import org.eclipse.mylyn.tasks.core.IRepositoryElement;
import org.eclipse.mylyn.tasks.core.ITaskListChangeListener;
import org.eclipse.mylyn.tasks.core.RepositoryStatus;
import org.eclipse.mylyn.tasks.core.TaskRepository;
@@ -659,7 +659,7 @@ public abstract class AbstractTaskEditorPage extends FormPage implements ISelect
toolBarManager.add(synchronizeEditorAction);
if (taskRepository != null && !taskData.isNew()) {
- clearOutgoingAction = new ClearOutgoingAction(Collections.singletonList((ITaskElement) task));
+ clearOutgoingAction = new ClearOutgoingAction(Collections.singletonList((IRepositoryElement) task));
if (clearOutgoingAction.isEnabled()) {
toolBarManager.add(clearOutgoingAction);
}

Back to the top