Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJared Burns2003-08-20 16:46:24 +0000
committerJared Burns2003-08-20 16:46:24 +0000
commitd57bf90692e95df16ee5a6d0018476a8679c28f9 (patch)
tree7cbb6b1c6c4f2eac291372266e315fed935a37e4
parent46a682b4c76860d2ac8514a453780f0ed5e8408d (diff)
downloadeclipse.platform.debug-d57bf90692e95df16ee5a6d0018476a8679c28f9.tar.gz
eclipse.platform.debug-d57bf90692e95df16ee5a6d0018476a8679c28f9.tar.xz
eclipse.platform.debug-d57bf90692e95df16ee5a6d0018476a8679c28f9.zip
Bug 39567 - Use a Job for the BackgroundResourceRefresher
-rw-r--r--org.eclipse.ui.externaltools/Program Tools Support/org/eclipse/ui/externaltools/internal/program/launchConfigurations/BackgroundResourceRefresher.java34
-rw-r--r--org.eclipse.ui.externaltools/Program Tools Support/org/eclipse/ui/externaltools/internal/program/launchConfigurations/ExternalToolsProgramMessages.properties1
2 files changed, 19 insertions, 16 deletions
diff --git a/org.eclipse.ui.externaltools/Program Tools Support/org/eclipse/ui/externaltools/internal/program/launchConfigurations/BackgroundResourceRefresher.java b/org.eclipse.ui.externaltools/Program Tools Support/org/eclipse/ui/externaltools/internal/program/launchConfigurations/BackgroundResourceRefresher.java
index 060d2fd8a..f93c07f6b 100644
--- a/org.eclipse.ui.externaltools/Program Tools Support/org/eclipse/ui/externaltools/internal/program/launchConfigurations/BackgroundResourceRefresher.java
+++ b/org.eclipse.ui.externaltools/Program Tools Support/org/eclipse/ui/externaltools/internal/program/launchConfigurations/BackgroundResourceRefresher.java
@@ -12,6 +12,10 @@ package org.eclipse.ui.externaltools.internal.program.launchConfigurations;
import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.debug.core.DebugEvent;
import org.eclipse.debug.core.DebugPlugin;
import org.eclipse.debug.core.IDebugEventSetListener;
@@ -24,7 +28,7 @@ import org.eclipse.ui.externaltools.internal.model.ExternalToolsPlugin;
* Refreshes resources as specified by a launch configuration, when
* an associated process terminates.
*/
-public class BackgroundResourceRefresher implements IDebugEventSetListener, Runnable {
+public class BackgroundResourceRefresher implements IDebugEventSetListener {
private ILaunchConfiguration fConfiguration;
private IProcess fProcess;
@@ -64,22 +68,20 @@ public class BackgroundResourceRefresher implements IDebugEventSetListener, Runn
}
/**
- * Submits a runnable to do the refresh
+ * Submits a job to do the refresh
*/
protected void refresh() {
- ExternalToolsPlugin.getStandardDisplay().asyncExec(this);
- }
-
- /**
- * Refreshes the resources.
- *
- * @see java.lang.Runnable#run()
- */
- public void run() {
- try {
- RefreshTab.refreshResources(fConfiguration, null);
- } catch (CoreException e) {
- ExternalToolsPlugin.getDefault().log(e);
- }
+ Job job= new Job(ExternalToolsProgramMessages.getString("BackgroundResourceRefresher.0")) { //$NON-NLS-1$
+ public IStatus run(IProgressMonitor monitor) {
+ try {
+ RefreshTab.refreshResources(fConfiguration, monitor);
+ } catch (CoreException e) {
+ ExternalToolsPlugin.getDefault().log(e);
+ return e.getStatus();
+ }
+ return Status.OK_STATUS;
+ }
+ };
+ job.schedule();
}
} \ No newline at end of file
diff --git a/org.eclipse.ui.externaltools/Program Tools Support/org/eclipse/ui/externaltools/internal/program/launchConfigurations/ExternalToolsProgramMessages.properties b/org.eclipse.ui.externaltools/Program Tools Support/org/eclipse/ui/externaltools/internal/program/launchConfigurations/ExternalToolsProgramMessages.properties
index 98ba99c7f..09a689034 100644
--- a/org.eclipse.ui.externaltools/Program Tools Support/org/eclipse/ui/externaltools/internal/program/launchConfigurations/ExternalToolsProgramMessages.properties
+++ b/org.eclipse.ui.externaltools/Program Tools Support/org/eclipse/ui/externaltools/internal/program/launchConfigurations/ExternalToolsProgramMessages.properties
@@ -12,3 +12,4 @@
ProgramMainTab.Select=&Select a program:
ProgramLaunchDelegate.Workbench_Closing_1=Workbench Closing
ProgramLaunchDelegate.The_workbench_is_exiting=The workbench is exiting and a program launched from an external tool appears to still be running. These programs will be terminated when the workbench exits. It is recommended that you exit any external programs launched from the workbench before you proceed.\n\nClick OK to continue exiting the workbench.
+BackgroundResourceRefresher.0=Refreshing resources...

Back to the top