Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorspingel2009-06-13 05:48:42 +0000
committerspingel2009-06-13 05:48:42 +0000
commit835e522a4e7c4d4876c529127ed73c422a469747 (patch)
tree399236736efd21dd200d99b028da1d8fbb741f17 /org.eclipse.mylyn.trac.ui/src/org/eclipse/mylyn/internal
parent6abb20f30ade073a0d90ebad312136ce1d509375 (diff)
downloadorg.eclipse.mylyn.tasks-835e522a4e7c4d4876c529127ed73c422a469747.tar.gz
org.eclipse.mylyn.tasks-835e522a4e7c4d4876c529127ed73c422a469747.tar.xz
org.eclipse.mylyn.tasks-835e522a4e7c4d4876c529127ed73c422a469747.zip
NEW - bug 275507: exception when canceling query synchronization
https://bugs.eclipse.org/bugs/show_bug.cgi?id=275507
Diffstat (limited to 'org.eclipse.mylyn.trac.ui/src/org/eclipse/mylyn/internal')
-rw-r--r--org.eclipse.mylyn.trac.ui/src/org/eclipse/mylyn/internal/trac/ui/wizard/TracQueryPage.java45
1 files changed, 23 insertions, 22 deletions
diff --git a/org.eclipse.mylyn.trac.ui/src/org/eclipse/mylyn/internal/trac/ui/wizard/TracQueryPage.java b/org.eclipse.mylyn.trac.ui/src/org/eclipse/mylyn/internal/trac/ui/wizard/TracQueryPage.java
index ebdbf9444..181f6196e 100644
--- a/org.eclipse.mylyn.trac.ui/src/org/eclipse/mylyn/internal/trac/ui/wizard/TracQueryPage.java
+++ b/org.eclipse.mylyn.trac.ui/src/org/eclipse/mylyn/internal/trac/ui/wizard/TracQueryPage.java
@@ -11,18 +11,20 @@
package org.eclipse.mylyn.internal.trac.ui.wizard;
-import java.lang.reflect.InvocationTargetException;
import java.util.HashMap;
import java.util.Map;
+import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.OperationCanceledException;
import org.eclipse.core.runtime.Status;
import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.dialogs.IDialogSettings;
import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.operation.IRunnableWithProgress;
import org.eclipse.mylyn.commons.core.StatusHandler;
+import org.eclipse.mylyn.internal.provisional.commons.ui.CommonUiUtil;
+import org.eclipse.mylyn.internal.provisional.commons.ui.ICoreRunnable;
import org.eclipse.mylyn.internal.trac.core.TracCorePlugin;
import org.eclipse.mylyn.internal.trac.core.TracRepositoryConnector;
import org.eclipse.mylyn.internal.trac.core.client.ITracClient;
@@ -53,7 +55,6 @@ import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.List;
import org.eclipse.swt.widgets.Text;
import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.progress.IProgressService;
/**
* Trac search page. Provides a form similar to the one the Bugzilla connector uses.
@@ -370,28 +371,28 @@ public class TracQueryPage extends AbstractRepositoryQueryPage {
if (!client.hasAttributes() || force) {
try {
- IRunnableWithProgress runnable = new IRunnableWithProgress() {
- public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
+ ICoreRunnable runnable = new ICoreRunnable() {
+
+ public void run(IProgressMonitor monitor) throws CoreException {
try {
client.updateAttributes(monitor, force);
} catch (TracException e) {
- throw new InvocationTargetException(e);
+ throw new CoreException(TracCorePlugin.toStatus(e, getTaskRepository()));
}
}
};
if (getContainer() != null) {
- getContainer().run(true, true, runnable);
+ CommonUiUtil.run(getContainer(), runnable);
} else if (getSearchContainer() != null) {
- getSearchContainer().getRunnableContext().run(true, true, runnable);
+ CommonUiUtil.run(getSearchContainer().getRunnableContext(), runnable);
} else {
- IProgressService service = PlatformUI.getWorkbench().getProgressService();
- service.busyCursorWhile(runnable);
+ CommonUiUtil.run(PlatformUI.getWorkbench().getProgressService(), runnable);
}
- } catch (InvocationTargetException e) {
- setErrorMessage(TracCorePlugin.toStatus(e.getCause(), getTaskRepository()).getMessage());
+ } catch (CoreException e) {
+ CommonUiUtil.setMessage(this, e.getStatus());
return;
- } catch (InterruptedException e) {
+ } catch (OperationCanceledException e) {
return;
}
}
@@ -658,15 +659,15 @@ public class TracQueryPage extends AbstractRepositoryQueryPage {
}
}
- public void selectItems(String[] items) {
- list.deselectAll();
- for (String item : items) {
- int i = list.indexOf(item);
- if (i != -1) {
- list.select(i);
- }
- }
- }
+// public void selectItems(String[] items) {
+// list.deselectAll();
+// for (String item : items) {
+// int i = list.indexOf(item);
+// if (i != -1) {
+// list.select(i);
+// }
+// }
+// }
}

Back to the top