Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrsuen2008-06-06 20:10:55 +0000
committerrsuen2008-06-06 20:10:55 +0000
commit81e990922890a9d045d9ca8ce8b5dc9a31bfd7e1 (patch)
treef383b58493cd2da3eaf58b18a2b6627a9fc91c8f /incubation
parentc4886b4ff58f35896769a1e54d16630ce5e00d00 (diff)
downloadorg.eclipse.ecf-81e990922890a9d045d9ca8ce8b5dc9a31bfd7e1.tar.gz
org.eclipse.ecf-81e990922890a9d045d9ca8ce8b5dc9a31bfd7e1.tar.xz
org.eclipse.ecf-81e990922890a9d045d9ca8ce8b5dc9a31bfd7e1.zip
Fix bug 235930 - Updating org.eclipse.ecf.mylyn.ui to Mylyn 3.0 API
Diffstat (limited to 'incubation')
-rwxr-xr-xincubation/bundles/org.eclipse.ecf.mylyn.ui/src/org/eclipse/ecf/internal/mylyn/ui/Activator.java11
-rwxr-xr-xincubation/bundles/org.eclipse.ecf.mylyn.ui/src/org/eclipse/ecf/internal/mylyn/ui/CompoundContextActivationContributionItem.java29
-rwxr-xr-xincubation/bundles/org.eclipse.ecf.mylyn.ui/src/org/eclipse/ecf/internal/mylyn/ui/IncomingSharedTaskNotificationPopup.java5
3 files changed, 24 insertions, 21 deletions
diff --git a/incubation/bundles/org.eclipse.ecf.mylyn.ui/src/org/eclipse/ecf/internal/mylyn/ui/Activator.java b/incubation/bundles/org.eclipse.ecf.mylyn.ui/src/org/eclipse/ecf/internal/mylyn/ui/Activator.java
index 596fdcc09..0b5af324d 100755
--- a/incubation/bundles/org.eclipse.ecf.mylyn.ui/src/org/eclipse/ecf/internal/mylyn/ui/Activator.java
+++ b/incubation/bundles/org.eclipse.ecf.mylyn.ui/src/org/eclipse/ecf/internal/mylyn/ui/Activator.java
@@ -7,6 +7,7 @@
*
* Contributors:
* IBM Corporation - initial API and implementation
+ * Red Hat - update to Mylyn 3.0 API
*******************************************************************************/
package org.eclipse.ecf.internal.mylyn.ui;
@@ -21,10 +22,10 @@ import org.eclipse.ecf.datashare.events.IChannelEvent;
import org.eclipse.ecf.datashare.events.IChannelMessageEvent;
import org.eclipse.ecf.presence.service.IPresenceService;
import org.eclipse.jface.resource.ImageRegistry;
-import org.eclipse.mylyn.internal.context.core.ContextCorePlugin;
-import org.eclipse.mylyn.internal.context.core.InteractionContext;
-import org.eclipse.mylyn.internal.tasks.core.AbstractTask;
+import org.eclipse.mylyn.context.core.ContextCore;
+import org.eclipse.mylyn.context.core.IInteractionContext;
import org.eclipse.mylyn.internal.tasks.ui.TasksUiPlugin;
+import org.eclipse.mylyn.tasks.core.ITask;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.PlatformUI;
@@ -87,10 +88,10 @@ public class Activator extends AbstractUIPlugin implements IChannelListener, Ser
FileOutputStream fos = new FileOutputStream(file);
fos.write(data);
List tasks = TasksUiPlugin.getTaskListManager().getTaskListWriter().readTasks(file);
- final AbstractTask task = (AbstractTask) tasks.get(0);
+ final ITask task = (ITask) tasks.get(0);
Set repositories = TasksUiPlugin.getTaskListManager().getTaskListWriter().readRepositories(file);
TasksUiPlugin.getRepositoryManager().insertRepositories(repositories, TasksUiPlugin.getDefault().getRepositoriesFilePath());
- InteractionContext context = ContextCorePlugin.getContextManager().loadContext(task.getHandleIdentifier(), file);
+ IInteractionContext context = ContextCore.getContextStore().importContext(task.getHandleIdentifier(), file);
CompoundContextActivationContributionItem.enqueue(task, context);
IWorkbenchWindow[] windows = PlatformUI.getWorkbench().getWorkbenchWindows();
diff --git a/incubation/bundles/org.eclipse.ecf.mylyn.ui/src/org/eclipse/ecf/internal/mylyn/ui/CompoundContextActivationContributionItem.java b/incubation/bundles/org.eclipse.ecf.mylyn.ui/src/org/eclipse/ecf/internal/mylyn/ui/CompoundContextActivationContributionItem.java
index b92b508ab..c6e257cfb 100755
--- a/incubation/bundles/org.eclipse.ecf.mylyn.ui/src/org/eclipse/ecf/internal/mylyn/ui/CompoundContextActivationContributionItem.java
+++ b/incubation/bundles/org.eclipse.ecf.mylyn.ui/src/org/eclipse/ecf/internal/mylyn/ui/CompoundContextActivationContributionItem.java
@@ -7,6 +7,7 @@
*
* Contributors:
* IBM Corporation - initial API and implementation
+ * Red Hat - update to Mylyn 3.0 API
*******************************************************************************/
package org.eclipse.ecf.internal.mylyn.ui;
@@ -15,14 +16,13 @@ import org.eclipse.core.runtime.*;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.jface.action.*;
import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.mylyn.context.core.ContextCore;
import org.eclipse.mylyn.context.core.IInteractionContext;
-import org.eclipse.mylyn.internal.context.core.ContextCorePlugin;
-import org.eclipse.mylyn.internal.context.core.InteractionContext;
-import org.eclipse.mylyn.internal.tasks.core.AbstractTask;
-import org.eclipse.mylyn.internal.tasks.core.TaskList;
+import org.eclipse.mylyn.internal.context.core.LocalContextStore;
+import org.eclipse.mylyn.internal.tasks.core.ITaskList;
import org.eclipse.mylyn.internal.tasks.ui.TasksUiPlugin;
import org.eclipse.mylyn.tasks.core.ITask;
-import org.eclipse.mylyn.tasks.ui.ITasksUiConstants;
+import org.eclipse.mylyn.tasks.ui.TasksUi;
import org.eclipse.swt.widgets.Menu;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.actions.CompoundContributionItem;
@@ -52,7 +52,7 @@ public class CompoundContextActivationContributionItem extends CompoundContribut
protected IContributionItem[] getContributionItems() {
int count = 0;
for (Iterator it = tasks.iterator(); it.hasNext() && count != 5;) {
- AbstractTask task = (AbstractTask) it.next();
+ ITask task = (ITask) it.next();
actions[count].setTask(task);
count++;
}
@@ -84,6 +84,7 @@ public class CompoundContextActivationContributionItem extends CompoundContribut
}
static class ActivateTaskAction extends Action {
+ private static final String TITLE_DIALOG = "Mylyn Information";
private ITask task;
void setTask(ITask task) {
@@ -92,15 +93,15 @@ public class CompoundContextActivationContributionItem extends CompoundContribut
}
public void run() {
- final InteractionContext context = (InteractionContext) contexts.get(task);
+ final IInteractionContext context = (IInteractionContext) contexts.get(task);
- final TaskList taskList = TasksUiPlugin.getTaskList();
- if (taskList.getTask(task.getHandleIdentifier()) != null) {
- boolean confirmed = MessageDialog.openConfirm(shell, ITasksUiConstants.TITLE_DIALOG, "The task '" + task.getSummary() + "' already exists. Do you want to override its context with the source?");
+ final ITaskList taskList = TasksUiPlugin.getTaskList();
+ if (taskList.getTask(task.getRepositoryUrl(), task.getTaskId()) != null) {
+ boolean confirmed = MessageDialog.openConfirm(shell, TITLE_DIALOG, "The task '" + task.getSummary() + "' already exists. Do you want to override its context with the source?");
if (confirmed) {
Job job = new Job("Import context") {
protected IStatus run(IProgressMonitor monitor) {
- ContextCorePlugin.getContextManager().importContext(context);
+ ((LocalContextStore) ContextCore.getContextStore()).importContext(context);
scheduleTaskActivationJob();
return Status.OK_STATUS;
}
@@ -112,8 +113,8 @@ public class CompoundContextActivationContributionItem extends CompoundContribut
} else {
Job job = new Job("Import task") {
protected IStatus run(IProgressMonitor monitor) {
- ContextCorePlugin.getContextManager().importContext(context);
- taskList.insertTask(task, null, null);
+ ((LocalContextStore) ContextCore.getContextStore()).importContext(context);
+ taskList.addTask(task);
scheduleTaskActivationJob();
return Status.OK_STATUS;
}
@@ -127,7 +128,7 @@ public class CompoundContextActivationContributionItem extends CompoundContribut
private void scheduleTaskActivationJob() {
UIJob job = new UIJob(shell.getDisplay(), "Activate imported task") {
public IStatus runInUIThread(IProgressMonitor monitor) {
- TasksUiPlugin.getTaskListManager().activateTask((AbstractTask) task);
+ TasksUi.getTaskActivityManager().activateTask(task);
return Status.OK_STATUS;
}
};
diff --git a/incubation/bundles/org.eclipse.ecf.mylyn.ui/src/org/eclipse/ecf/internal/mylyn/ui/IncomingSharedTaskNotificationPopup.java b/incubation/bundles/org.eclipse.ecf.mylyn.ui/src/org/eclipse/ecf/internal/mylyn/ui/IncomingSharedTaskNotificationPopup.java
index 2fc1193bb..128ec62a6 100755
--- a/incubation/bundles/org.eclipse.ecf.mylyn.ui/src/org/eclipse/ecf/internal/mylyn/ui/IncomingSharedTaskNotificationPopup.java
+++ b/incubation/bundles/org.eclipse.ecf.mylyn.ui/src/org/eclipse/ecf/internal/mylyn/ui/IncomingSharedTaskNotificationPopup.java
@@ -8,6 +8,7 @@
* Contributors:
* University Of British Columbia - initial API and implementation
* Rob Elves - creator of the original TaskListNotificationPopup class
+ * Red Hat - update to Mylyn 3.0 API
*******************************************************************************/
package org.eclipse.ecf.internal.mylyn.ui;
@@ -16,10 +17,10 @@ import org.eclipse.ecf.internal.mylyn.ui.CompoundContextActivationContributionIt
import org.eclipse.jface.layout.GridDataFactory;
import org.eclipse.jface.viewers.DecoratingLabelProvider;
import org.eclipse.mylyn.internal.provisional.commons.ui.AbstractNotificationPopup;
+import org.eclipse.mylyn.internal.provisional.commons.ui.CommonImages;
import org.eclipse.mylyn.internal.tasks.ui.TaskListHyperlink;
import org.eclipse.mylyn.tasks.core.ITask;
import org.eclipse.mylyn.tasks.ui.TaskElementLabelProvider;
-import org.eclipse.mylyn.tasks.ui.TasksUiImages;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.*;
@@ -52,7 +53,7 @@ class IncomingSharedTaskNotificationPopup extends AbstractNotificationPopup {
final Label notificationLabelIcon = new Label(notificationComposite, SWT.LEAD);
notificationLabelIcon.setBackground(parent.getBackground());
- notificationLabelIcon.setImage(TasksUiImages.getImage(TasksUiImages.OVERLAY_INCOMMING));
+ notificationLabelIcon.setImage(CommonImages.getImage(CommonImages.OVERLAY_SYNC_INCOMMING_NEW));
final TaskListHyperlink itemLink = new TaskListHyperlink(notificationComposite, SWT.BEGINNING | SWT.WRAP | SWT.NO_FOCUS);
itemLink.setText(task.getTaskId());

Back to the top