Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomasz Zarna2013-08-29 06:47:40 -0400
committerTomasz Zarna2013-08-29 06:48:36 -0400
commit0ec9ad415a5605216ac532ab1afd2fe1085ade96 (patch)
treed0b01fb213705ac856234c49a2930213686dd5c7 /org.eclipse.mylyn.tasks.ui
parenta9e5559103c66f88e7201426ffb1fb49466d1905 (diff)
downloadorg.eclipse.mylyn.tasks-0ec9ad415a5605216ac532ab1afd2fe1085ade96.tar.gz
org.eclipse.mylyn.tasks-0ec9ad415a5605216ac532ab1afd2fe1085ade96.tar.xz
org.eclipse.mylyn.tasks-0ec9ad415a5605216ac532ab1afd2fe1085ade96.zip
337999: move getUndoContext() from TasksUiUtil (API) to TasksUiInternal
Bug: 337999 Change-Id: Ia01d857a8d0abe7c2503d96598ece23d5603f23d Task-Url: https://bugs.eclipse.org/bugs/show_bug.cgi?id=337999 Signed-off-by: Tomasz Zarna <tomasz.zarna@tasktop.com>
Diffstat (limited to 'org.eclipse.mylyn.tasks.ui')
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/TaskListViewActionGroup.java4
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/commands/MarkTaskHandler.java3
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/util/TasksUiInternal.java10
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/TasksUiUtil.java11
4 files changed, 13 insertions, 15 deletions
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/TaskListViewActionGroup.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/TaskListViewActionGroup.java
index d141fa4cd..76653fd3c 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/TaskListViewActionGroup.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/TaskListViewActionGroup.java
@@ -16,11 +16,11 @@ import org.eclipse.jface.action.IAction;
import org.eclipse.jface.action.IMenuManager;
import org.eclipse.jface.action.Separator;
import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.mylyn.internal.tasks.ui.util.TasksUiInternal;
import org.eclipse.mylyn.internal.tasks.ui.views.PresentationFilter;
import org.eclipse.mylyn.internal.tasks.ui.views.TaskListView;
import org.eclipse.mylyn.tasks.core.ITask;
import org.eclipse.mylyn.tasks.core.ITaskContainer;
-import org.eclipse.mylyn.tasks.ui.TasksUiUtil;
import org.eclipse.ui.operations.RedoActionHandler;
import org.eclipse.ui.operations.UndoActionHandler;
import org.eclipse.ui.part.DrillDownAdapter;
@@ -55,7 +55,7 @@ public class TaskListViewActionGroup extends RepositoryElementActionGroup {
renameAction = add(new RenameAction(view));
hideQueryAction = add(new HideQueryAction());
- IUndoContext undoContext = TasksUiUtil.getUndoContext();
+ IUndoContext undoContext = TasksUiInternal.getUndoContext();
undoAction = new UndoActionHandler(view.getSite(), undoContext);
redoAction = new RedoActionHandler(view.getSite(), undoContext);
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 24b9a9107..fbb57dd11 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
@@ -35,7 +35,6 @@ import org.eclipse.mylyn.internal.tasks.ui.views.TaskListView;
import org.eclipse.mylyn.monitor.ui.MonitorUi;
import org.eclipse.mylyn.tasks.core.IRepositoryElement;
import org.eclipse.mylyn.tasks.core.ITask;
-import org.eclipse.mylyn.tasks.ui.TasksUiUtil;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.handlers.HandlerUtil;
@@ -157,7 +156,7 @@ public abstract class MarkTaskHandler extends AbstractTaskHandler {
this.shell = shell;
this.markRead = markRead;
this.tasks = Arrays.asList(tasks);
- addContext(TasksUiUtil.getUndoContext());
+ addContext(TasksUiInternal.getUndoContext());
}
private void execute() throws ExecutionException {
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 c68636eda..fe5ac0977 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
@@ -30,6 +30,8 @@ import org.eclipse.core.commands.NotEnabledException;
import org.eclipse.core.commands.NotHandledException;
import org.eclipse.core.commands.ParameterizedCommand;
import org.eclipse.core.commands.common.NotDefinedException;
+import org.eclipse.core.commands.operations.IUndoContext;
+import org.eclipse.core.commands.operations.ObjectUndoContext;
import org.eclipse.core.expressions.EvaluationContext;
import org.eclipse.core.expressions.IEvaluationContext;
import org.eclipse.core.runtime.Assert;
@@ -157,6 +159,8 @@ public class TasksUiInternal {
public static final String ID_MENU_ACTIVE_TASK = "org.eclipse.mylyn.tasks.ui.menus.activeTask"; //$NON-NLS-1$
+ private static ObjectUndoContext undoContext;
+
public static MultiRepositoryAwareWizard createNewTaskWizard(ITaskMapping taskSelection) {
return new NewTaskWizardInternal(taskSelection);
}
@@ -1472,4 +1476,10 @@ public class TasksUiInternal {
return image;
}
+ public static synchronized IUndoContext getUndoContext() {
+ if (undoContext == null) {
+ undoContext = new ObjectUndoContext(new Object(), "Tasks Context"); //$NON-NLS-1$
+ }
+ return undoContext;
+ }
}
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/TasksUiUtil.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/TasksUiUtil.java
index 3d2ffe554..1e3a0b099 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/TasksUiUtil.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/TasksUiUtil.java
@@ -11,8 +11,6 @@
package org.eclipse.mylyn.tasks.ui;
-import org.eclipse.core.commands.operations.IUndoContext;
-import org.eclipse.core.commands.operations.ObjectUndoContext;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.Assert;
import org.eclipse.core.runtime.IAdaptable;
@@ -78,8 +76,6 @@ public class TasksUiUtil {
@Deprecated
public static final int FLAG_NO_RICH_EDITOR = 1 << 17;
- private static ObjectUndoContext undoContext;
-
/**
* @since 3.0
*/
@@ -452,11 +448,4 @@ public class TasksUiUtil {
.getPreferenceStore()
.getBoolean(ITasksUiPreferenceConstants.EDITOR_CURRENT_LINE_HIGHLIGHT);
}
-
- public static synchronized IUndoContext getUndoContext() {
- if (undoContext == null) {
- undoContext = new ObjectUndoContext(new Object(), "Tasks Context"); //$NON-NLS-1$
- }
- return undoContext;
- }
}

Back to the top