Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsminto2005-07-20 20:47:55 +0000
committersminto2005-07-20 20:47:55 +0000
commit1885b19080f19b18d43b132b7581225ccdae3b7c (patch)
tree0557c8597d02b7b522e7c0e48b700d69e2b1dd33 /org.eclipse.mylyn.tasks.core
parentb7c8be6c13c8adad360393818c28610bcf0548d8 (diff)
downloadorg.eclipse.mylyn.tasks-1885b19080f19b18d43b132b7581225ccdae3b7c.tar.gz
org.eclipse.mylyn.tasks-1885b19080f19b18d43b132b7581225ccdae3b7c.tar.xz
org.eclipse.mylyn.tasks-1885b19080f19b18d43b132b7581225ccdae3b7c.zip
Fixed Bug #104382: stop button for active search
Diffstat (limited to 'org.eclipse.mylyn.tasks.core')
-rw-r--r--org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/bugzilla/BugzillaMylarBridge.java16
-rw-r--r--org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/search/BugzillaReferencesProvider.java7
2 files changed, 20 insertions, 3 deletions
diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/bugzilla/BugzillaMylarBridge.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/bugzilla/BugzillaMylarBridge.java
index 38325ab31..b76efc5b0 100644
--- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/bugzilla/BugzillaMylarBridge.java
+++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/bugzilla/BugzillaMylarBridge.java
@@ -13,6 +13,8 @@
*/
package org.eclipse.mylar.bugzilla;
+import java.util.Collection;
+import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -31,17 +33,17 @@ import org.eclipse.mylar.bugzilla.ui.tasks.BugzillaReportNode;
public class BugzillaMylarBridge {
/** The hash of all of the landmarks and their related search hits */
- private HashMap<String, Map<Integer, List<BugzillaReportNode>>> landmarksHash;
+ private Map<String, Map<Integer, List<BugzillaReportNode>>> landmarksHash;
/**
* The currently running search jobs so that we can cancel it if necessary <br> KEY: IMember VALUE: Job
*/
- public static HashMap<String, Job> runningJobs = new HashMap<String, Job>();
+ static Map<String, Job> runningJobs = Collections.synchronizedMap(new HashMap<String, Job>());
/**
* Constructor
*/
public BugzillaMylarBridge() {
- landmarksHash = new HashMap<String, Map<Integer, List<BugzillaReportNode>>>();
+ landmarksHash = Collections.synchronizedMap(new HashMap<String, Map<Integer, List<BugzillaReportNode>>>());
}
@@ -140,4 +142,12 @@ public class BugzillaMylarBridge {
public static void addJob(String handle, Job searchJob) {
runningJobs.put(handle, searchJob);
}
+
+ public static void cancelAllRunningJobs(){
+ Collection<Job> jobs = runningJobs.values();
+ for(Job j: jobs){
+ j.cancel();
+ }
+ runningJobs.clear();
+ }
} \ No newline at end of file
diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/search/BugzillaReferencesProvider.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/search/BugzillaReferencesProvider.java
index 5c4174e6c..5dbd1d1b3 100644
--- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/search/BugzillaReferencesProvider.java
+++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/search/BugzillaReferencesProvider.java
@@ -24,6 +24,7 @@ import org.eclipse.jdt.core.IJavaElement;
import org.eclipse.jdt.core.IMember;
import org.eclipse.jdt.core.IType;
import org.eclipse.jdt.core.JavaCore;
+import org.eclipse.mylar.bugzilla.BugzillaMylarBridge;
import org.eclipse.mylar.bugzilla.BugzillaStructureBridge;
import org.eclipse.mylar.bugzilla.MylarBugzillaPlugin;
import org.eclipse.mylar.bugzilla.ui.tasks.BugzillaReportNode;
@@ -148,4 +149,10 @@ public class BugzillaReferencesProvider extends AbstractRelationshipProvider {
public Collection<? extends String> getCachedHandles() {
return reports.keySet();
}
+
+ @Override
+ public void stopAllRunningJobs() {
+ BugzillaMylarBridge.cancelAllRunningJobs();
+
+ }
}

Back to the top