diff options
author | Darin Wright | 2010-08-30 20:32:00 +0000 |
---|---|---|
committer | Darin Wright | 2010-08-30 20:32:00 +0000 |
commit | 67e3c2ea8c17775988abe724ea45ed12b8d1a88d (patch) | |
tree | 3c75d9bc3900af7bec350b5467f5b6e22134dd2c /org.eclipse.core.externaltools | |
parent | 4f85bcd19cc1684cdc512ab6fd5ecbfff43813ed (diff) | |
download | eclipse.platform.debug-67e3c2ea8c17775988abe724ea45ed12b8d1a88d.tar.gz eclipse.platform.debug-67e3c2ea8c17775988abe724ea45ed12b8d1a88d.tar.xz eclipse.platform.debug-67e3c2ea8c17775988abe724ea45ed12b8d1a88d.zip |
Bug 323953 - External Tools Launch delegate no longer supports launch in background
Diffstat (limited to 'org.eclipse.core.externaltools')
-rw-r--r-- | org.eclipse.core.externaltools/src/org/eclipse/core/externaltools/internal/launchConfigurations/ProgramLaunchDelegate.java | 30 |
1 files changed, 20 insertions, 10 deletions
diff --git a/org.eclipse.core.externaltools/src/org/eclipse/core/externaltools/internal/launchConfigurations/ProgramLaunchDelegate.java b/org.eclipse.core.externaltools/src/org/eclipse/core/externaltools/internal/launchConfigurations/ProgramLaunchDelegate.java index 635f340fd..00d1c63f8 100644 --- a/org.eclipse.core.externaltools/src/org/eclipse/core/externaltools/internal/launchConfigurations/ProgramLaunchDelegate.java +++ b/org.eclipse.core.externaltools/src/org/eclipse/core/externaltools/internal/launchConfigurations/ProgramLaunchDelegate.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2009 IBM Corporation and others. + * Copyright (c) 2000, 2010 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 @@ -35,6 +35,16 @@ import org.eclipse.osgi.util.NLS; * Launch delegate for a program. */ public class ProgramLaunchDelegate extends LaunchConfigurationDelegate { + + /** + * Launch configuration attribute - a boolean value indicating whether a + * configuration should be launched in the background. Default value is <code>true</code>. + * <p> + * This constant is defined in org.eclipse.debug.ui, but has to be copied here to support + * headless launching. + * </p> + */ + private static final String ATTR_LAUNCH_IN_BACKGROUND = "org.eclipse.debug.ui.ATTR_LAUNCH_IN_BACKGROUND"; //$NON-NLS-1$ /** * @see org.eclipse.debug.core.model.ILaunchConfigurationDelegate#launch(org.eclipse.debug.core.ILaunchConfiguration, @@ -129,14 +139,14 @@ public class ProgramLaunchDelegate extends LaunchConfigurationDelegate { process.setAttribute(IProcess.ATTR_CMDLINE, generateCommandLine(cmdLine)); -// if (launchManager.isLaunchInBackground(configuration)) { -// // refresh resources after process finishes -// if (launchManager.getRefreshScope(configuration) != null) { -// BackgroundResourceRefresher refresher = new BackgroundResourceRefresher( -// configuration, process); -// refresher.startBackgroundRefresh(); -// } -// } else { + if (configuration.getAttribute(ATTR_LAUNCH_IN_BACKGROUND, true)) { + // refresh resources after process finishes + String scope = configuration.getAttribute(RefreshUtil.ATTR_REFRESH_SCOPE, (String)null); + if (scope != null) { + BackgroundResourceRefresher refresher = new BackgroundResourceRefresher(configuration, process); + refresher.startBackgroundRefresh(); + } + } else { // wait for process to exit while (!process.isTerminated()) { try { @@ -151,7 +161,7 @@ public class ProgramLaunchDelegate extends LaunchConfigurationDelegate { // refresh resources RefreshUtil.refreshResources(configuration, monitor); -// } + } } private String generateCommandLine(String[] commandLine) { |