diff options
author | rsuen | 2008-06-06 20:36:10 +0000 |
---|---|---|
committer | rsuen | 2008-06-06 20:36:10 +0000 |
commit | ffb0d5011cc7bf7bc117f3e396ce9ca59df59f22 (patch) | |
tree | 74d3ca9cd477075ea651de60e516110fd17216b1 | |
parent | 81e990922890a9d045d9ca8ce8b5dc9a31bfd7e1 (diff) | |
download | org.eclipse.ecf-ffb0d5011cc7bf7bc117f3e396ce9ca59df59f22.tar.gz org.eclipse.ecf-ffb0d5011cc7bf7bc117f3e396ce9ca59df59f22.tar.xz org.eclipse.ecf-ffb0d5011cc7bf7bc117f3e396ce9ca59df59f22.zip |
Fix bug 236066 - [ecf.mylyn] importing a received task to an empty task list generates NullPointerExcepiton
3 files changed, 16 insertions, 5 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 e1adbf079..6e25db366 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 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007 IBM Corporation and others. + * Copyright (c) 2007, 2008 IBM Corporation 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 @@ -39,6 +39,7 @@ public class ActivateReceivedContextHandler extends AbstractHandler { elsd.setElements(CompoundContextActivationContributionItem.tasks.toArray()); if (Window.OK == elsd.open()) { ActivateTaskAction action = new CompoundContextActivationContributionItem.ActivateTaskAction(); + action.setShell(shell); action.setTask((ITask) elsd.getFirstResult()); action.run(); } 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 c6e257cfb..96dcd40a5 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 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007 IBM Corporation and others. + * Copyright (c) 2007, 2008 IBM Corporation 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 @@ -36,7 +36,7 @@ public class CompoundContextActivationContributionItem extends CompoundContribut private static ActivateTaskAction[] actions = new ActivateTaskAction[5]; - private static Shell shell; + private Shell shell; static { for (int i = 0; i < 5; i++) { @@ -45,14 +45,15 @@ public class CompoundContextActivationContributionItem extends CompoundContribut } public void fill(Menu menu, int index) { - super.fill(menu, index); shell = menu.getShell(); + super.fill(menu, index); } protected IContributionItem[] getContributionItems() { int count = 0; for (Iterator it = tasks.iterator(); it.hasNext() && count != 5;) { ITask task = (ITask) it.next(); + actions[count].setShell(shell); actions[count].setTask(task); count++; } @@ -84,9 +85,16 @@ public class CompoundContextActivationContributionItem extends CompoundContribut } static class ActivateTaskAction extends Action { + private static final String TITLE_DIALOG = "Mylyn Information"; + + private Shell shell; private ITask task; + void setShell(Shell shell) { + this.shell = shell; + } + void setTask(ITask task) { this.task = task; setText(task.getSummary()); 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 128ec62a6..a5a5e958a 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 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2004, 2007 University Of British Columbia and others. + * Copyright (c) 2004, 2008 University Of British Columbia 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 @@ -8,6 +8,7 @@ * Contributors: * University Of British Columbia - initial API and implementation * Rob Elves - creator of the original TaskListNotificationPopup class + * Remy Chi Jian Suen <remy.suen@gmail.com> - Adapted for ECF/Mylyn bridge use * Red Hat - update to Mylyn 3.0 API *******************************************************************************/ @@ -62,6 +63,7 @@ class IncomingSharedTaskNotificationPopup extends AbstractNotificationPopup { itemLink.addHyperlinkListener(new HyperlinkAdapter() { public void linkActivated(HyperlinkEvent e) { ActivateTaskAction action = new CompoundContextActivationContributionItem.ActivateTaskAction(); + action.setShell(getParentShell()); action.setTask(task); action.run(); close(); |