Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrsuen2007-12-24 13:07:53 +0000
committerrsuen2007-12-24 13:07:53 +0000
commit6815ea13e46e0fc5211bc6651e8c2cc51eb3b9ac (patch)
treed24799855e71fba68d3b7e78f19dbb6faee33355 /incubation
parente48390f075ba54a920bea96fd2822f334d66d21d (diff)
downloadorg.eclipse.ecf-6815ea13e46e0fc5211bc6651e8c2cc51eb3b9ac.tar.gz
org.eclipse.ecf-6815ea13e46e0fc5211bc6651e8c2cc51eb3b9ac.tar.xz
org.eclipse.ecf-6815ea13e46e0fc5211bc6651e8c2cc51eb3b9ac.zip
Use an ElementListSelectionDialog instead.
Diffstat (limited to 'incubation')
-rwxr-xr-xincubation/bundles/org.eclipse.ecf.mylyn.ui/src/org/eclipse/ecf/internal/mylyn/ui/ActivateReceivedContextHandler.java16
1 files changed, 12 insertions, 4 deletions
diff --git a/incubation/bundles/org.eclipse.ecf.mylyn.ui/src/org/eclipse/ecf/internal/mylyn/ui/ActivateReceivedContextHandler.java b/incubation/bundles/org.eclipse.ecf.mylyn.ui/src/org/eclipse/ecf/internal/mylyn/ui/ActivateReceivedContextHandler.java
index d26d76315..2b632132c 100755
--- a/incubation/bundles/org.eclipse.ecf.mylyn.ui/src/org/eclipse/ecf/internal/mylyn/ui/ActivateReceivedContextHandler.java
+++ b/incubation/bundles/org.eclipse.ecf.mylyn.ui/src/org/eclipse/ecf/internal/mylyn/ui/ActivateReceivedContextHandler.java
@@ -12,8 +12,11 @@ package org.eclipse.ecf.internal.mylyn.ui;
import org.eclipse.core.commands.*;
import org.eclipse.ecf.internal.mylyn.ui.CompoundContextActivationContributionItem.ActivateTaskAction;
+import org.eclipse.jface.viewers.LabelProvider;
import org.eclipse.jface.window.Window;
+import org.eclipse.mylyn.tasks.core.AbstractTask;
import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.dialogs.ElementListSelectionDialog;
import org.eclipse.ui.handlers.HandlerUtil;
public class ActivateReceivedContextHandler extends AbstractHandler {
@@ -27,11 +30,16 @@ public class ActivateReceivedContextHandler extends AbstractHandler {
}
static void open(Shell shell) {
- SelectTaskDialog dialog = new SelectTaskDialog(shell);
- dialog.setInput(CompoundContextActivationContributionItem.tasks);
- if (Window.OK == dialog.open()) {
+ ElementListSelectionDialog elsd = new ElementListSelectionDialog(shell, new LabelProvider() {
+ public String getText(Object element) {
+ String summary = ((AbstractTask) element).getSummary();
+ return summary;
+ }
+ });
+ elsd.setElements(CompoundContextActivationContributionItem.tasks.toArray());
+ if (Window.OK == elsd.open()) {
ActivateTaskAction action = new CompoundContextActivationContributionItem.ActivateTaskAction();
- action.setTask(dialog.getTask());
+ action.setTask((AbstractTask) elsd.getFirstResult());
action.run();
}
}

Back to the top