Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorspingel2011-03-02 23:13:15 +0000
committerspingel2011-03-02 23:13:15 +0000
commitd4ec53f9f4b7977fd909cf2423ad2a5bbc4a3209 (patch)
treef9b4b6492c2616edc93fe267a90559bd1879991b /org.eclipse.mylyn.tasks.ui
parent6b5c69178fe735e333ee8885725d9fe6d6d4c463 (diff)
downloadorg.eclipse.mylyn.tasks-d4ec53f9f4b7977fd909cf2423ad2a5bbc4a3209.tar.gz
org.eclipse.mylyn.tasks-d4ec53f9f4b7977fd909cf2423ad2a5bbc4a3209.tar.xz
org.eclipse.mylyn.tasks-d4ec53f9f4b7977fd909cf2423ad2a5bbc4a3209.zip
NEW - bug 286963: [api] add support for ignoring incoming notification on specified fields
https://bugs.eclipse.org/bugs/show_bug.cgi?id=286963
Diffstat (limited to 'org.eclipse.mylyn.tasks.ui')
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/AbstractTaskListFilter.java7
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/commands/GoToUnreadTaskHandler.java3
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/util/TasksUiInternal.java11
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListInterestFilter.java5
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListToolTip.java3
5 files changed, 21 insertions, 8 deletions
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 d84c53219..76f1d10e0 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
@@ -14,6 +14,7 @@ package org.eclipse.mylyn.internal.tasks.ui;
import java.util.Collection;
import org.eclipse.mylyn.internal.tasks.core.ITasksCoreConstants;
+import org.eclipse.mylyn.internal.tasks.ui.util.TasksUiInternal;
import org.eclipse.mylyn.tasks.core.ITask;
import org.eclipse.mylyn.tasks.core.ITaskContainer;
@@ -35,9 +36,7 @@ public abstract class AbstractTaskListFilter {
}
/**
- * NOTE: performance implication of looking down children
- *
- * TODO: Move to an internal utility class
+ * NOTE: performance implication of looking down children TODO: Move to an internal utility class
*/
public static boolean hasDescendantIncoming(ITaskContainer container) {
return hasDescendantIncoming(container, ITasksCoreConstants.MAX_SUBTASK_DEPTH);
@@ -56,7 +55,7 @@ public abstract class AbstractTaskListFilter {
for (ITask task : children) {
if (task != null) {
ITask containedRepositoryTask = task;
- if (containedRepositoryTask.getSynchronizationState().isIncoming()) {
+ if (TasksUiInternal.shouldShowIncoming(containedRepositoryTask)) {
return true;
} else if (TasksUiPlugin.getDefault().groupSubtasks(container) && task instanceof ITaskContainer
&& hasDescendantIncoming((ITaskContainer) task, depth - 1)) {
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 1723ac970..0e8f511cf 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
@@ -16,6 +16,7 @@ import org.eclipse.core.commands.ExecutionException;
import org.eclipse.jface.viewers.TreePath;
import org.eclipse.jface.viewers.TreeSelection;
import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.mylyn.internal.tasks.ui.util.TasksUiInternal;
import org.eclipse.mylyn.internal.tasks.ui.util.TreeWalker;
import org.eclipse.mylyn.internal.tasks.ui.util.TreeWalker.Direction;
import org.eclipse.mylyn.internal.tasks.ui.util.TreeWalker.TreeVisitor;
@@ -49,7 +50,7 @@ public abstract class GoToUnreadTaskHandler extends AbstractTaskListViewHandler
public boolean visit(Object object) {
if (object instanceof ITask) {
ITask task = (ITask) object;
- if (task.getSynchronizationState().isIncoming()) {
+ if (TasksUiInternal.shouldShowIncoming(task)) { // task.getSynchronizationState().isIncoming()
return true;
}
}
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 716fc7a92..44c60b881 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
@@ -69,6 +69,7 @@ import org.eclipse.mylyn.internal.tasks.core.AbstractTaskCategory;
import org.eclipse.mylyn.internal.tasks.core.AbstractTaskContainer;
import org.eclipse.mylyn.internal.tasks.core.ITaskJobFactory;
import org.eclipse.mylyn.internal.tasks.core.ITaskList;
+import org.eclipse.mylyn.internal.tasks.core.ITasksCoreConstants;
import org.eclipse.mylyn.internal.tasks.core.LocalRepositoryConnector;
import org.eclipse.mylyn.internal.tasks.core.LocalTask;
import org.eclipse.mylyn.internal.tasks.core.RepositoryQuery;
@@ -1357,4 +1358,14 @@ public class TasksUiInternal {
}
return tasks;
}
+
+ public static boolean shouldShowIncoming(ITask task) {
+ SynchronizationState state = task.getSynchronizationState();
+ if ((state == SynchronizationState.INCOMING && !Boolean.valueOf(task.getAttribute(ITasksCoreConstants.ATTRIBUTE_TASK_SUPPRESS_INCOMING)))
+ || state == SynchronizationState.INCOMING_NEW || state == SynchronizationState.CONFLICT) {
+ return true;
+ }
+ return false;
+ }
+
}
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 fabb1671a..c757f9780 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
@@ -23,6 +23,7 @@ import org.eclipse.mylyn.internal.tasks.core.ScheduledTaskContainer;
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.internal.tasks.ui.util.TasksUiInternal;
import org.eclipse.mylyn.internal.tasks.ui.views.TaskScheduleContentProvider.Completed;
import org.eclipse.mylyn.internal.tasks.ui.views.TaskScheduleContentProvider.Incoming;
import org.eclipse.mylyn.internal.tasks.ui.views.TaskScheduleContentProvider.Outgoing;
@@ -109,7 +110,7 @@ public class TaskListInterestFilter extends AbstractTaskListFilter {
|| (!task.isCompleted() && (LocalRepositoryConnector.DEFAULT_SUMMARY.equals(task.getSummary())
|| shouldShowInFocusedWorkweekDateContainer(parent, task)
|| TasksUiPlugin.getTaskActivityManager().isOverdue(task) || isInterestingForThisWeek(parent,
- task)));
+ task)));
}
private boolean hasInterestingSubTasks(Object parent, AbstractTask task, int depth) {
@@ -176,7 +177,7 @@ public class TaskListInterestFilter extends AbstractTaskListFilter {
private boolean hasChangesHelper(Object parent, ITask task) {
if (task.getSynchronizationState().isOutgoing()) {
return true;
- } else if (task.getSynchronizationState().isIncoming()) {
+ } else if (TasksUiInternal.shouldShowIncoming(task)) {
return true;
}
if (task instanceof ITaskContainer) {
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 4300edfd3..49aff359d 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
@@ -44,6 +44,7 @@ import org.eclipse.mylyn.internal.tasks.ui.TaskScalingHyperlink;
import org.eclipse.mylyn.internal.tasks.ui.TasksUiPlugin;
import org.eclipse.mylyn.internal.tasks.ui.notifications.TaskDiffUtil;
import org.eclipse.mylyn.internal.tasks.ui.notifications.TaskListNotifier;
+import org.eclipse.mylyn.internal.tasks.ui.util.TasksUiInternal;
import org.eclipse.mylyn.internal.tasks.ui.views.TaskScheduleContentProvider.StateTaskContainer;
import org.eclipse.mylyn.tasks.core.AbstractRepositoryConnector;
import org.eclipse.mylyn.tasks.core.IRepositoryElement;
@@ -557,7 +558,7 @@ public class TaskListToolTip extends GradientToolTip {
boolean hasIncoming = false;
for (Object child : children) {
if (child instanceof ITask) {
- if (((ITask) child).getSynchronizationState().isIncoming()) {
+ if (TasksUiInternal.shouldShowIncoming((ITask) child)) {
hasIncoming = true;
break;
}

Back to the top