diff options
author | Mike Rennie | 2013-07-31 16:44:16 +0000 |
---|---|---|
committer | Mike Rennie | 2013-07-31 16:44:16 +0000 |
commit | d975f27f12707ae6598994c5e3c6bd5e271d46c4 (patch) | |
tree | c7d1b2b1a202e19c0c2ccaaff959f4dd25286f0d /org.eclipse.core.externaltools/src/org/eclipse/core/externaltools/internal/launchConfigurations | |
parent | 4fcde1ffaf34791bd406d47ce72d17e2801432a3 (diff) | |
download | eclipse.platform.debug-d975f27f12707ae6598994c5e3c6bd5e271d46c4.tar.gz eclipse.platform.debug-d975f27f12707ae6598994c5e3c6bd5e271d46c4.tar.xz eclipse.platform.debug-d975f27f12707ae6598994c5e3c6bd5e271d46c4.zip |
Bug 352626 - Move platform debug to Java 1.6 BREE
Diffstat (limited to 'org.eclipse.core.externaltools/src/org/eclipse/core/externaltools/internal/launchConfigurations')
2 files changed, 27 insertions, 21 deletions
diff --git a/org.eclipse.core.externaltools/src/org/eclipse/core/externaltools/internal/launchConfigurations/BackgroundResourceRefresher.java b/org.eclipse.core.externaltools/src/org/eclipse/core/externaltools/internal/launchConfigurations/BackgroundResourceRefresher.java index de772967d..4ab5d4d0e 100644 --- a/org.eclipse.core.externaltools/src/org/eclipse/core/externaltools/internal/launchConfigurations/BackgroundResourceRefresher.java +++ b/org.eclipse.core.externaltools/src/org/eclipse/core/externaltools/internal/launchConfigurations/BackgroundResourceRefresher.java @@ -1,10 +1,10 @@ /******************************************************************************* - * Copyright (c) 2000, 2009 IBM Corporation and others. + * Copyright (c) 2000, 2013 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 * http://www.eclipse.org/legal/epl-v10.html - * + * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ @@ -25,21 +25,21 @@ import org.eclipse.debug.core.RefreshUtil; import org.eclipse.debug.core.model.IProcess; /** - * Refreshes resources as specified by a launch configuration, when + * Refreshes resources as specified by a launch configuration, when * an associated process terminates. */ public class BackgroundResourceRefresher implements IDebugEventSetListener { private ILaunchConfiguration fConfiguration; private IProcess fProcess; - - - + + + public BackgroundResourceRefresher(ILaunchConfiguration configuration, IProcess process) { fConfiguration = configuration; fProcess = process; } - + /** * If the process has already terminated, resource refreshing is done * immediately in the current thread. Otherwise, refreshing is done when the @@ -54,10 +54,11 @@ public class BackgroundResourceRefresher implements IDebugEventSetListener { } } } - + /* (non-Javadoc) * @see org.eclipse.debug.core.IDebugEventSetListener#handleDebugEvents(org.eclipse.debug.core.DebugEvent[]) */ + @Override public void handleDebugEvents(DebugEvent[] events) { for (int i = 0; i < events.length; i++) { DebugEvent event = events[i]; @@ -68,19 +69,20 @@ public class BackgroundResourceRefresher implements IDebugEventSetListener { } } } - + /** * Submits a job to do the refresh */ protected void refresh() { Job job= new Job(ExternalToolsProgramMessages.BackgroundResourceRefresher_0) { + @Override public IStatus run(IProgressMonitor monitor) { try { RefreshUtil.refreshResources(fConfiguration, monitor); } catch (CoreException e) { ExternalToolsCore.log(e); return e.getStatus(); - } + } return Status.OK_STATUS; } }; 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 022279070..0086da7e6 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, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2013 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,7 +35,7 @@ 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>. @@ -51,6 +51,7 @@ public class ProgramLaunchDelegate extends LaunchConfigurationDelegate { * java.lang.String, org.eclipse.debug.core.ILaunch, * org.eclipse.core.runtime.IProgressMonitor) */ + @Override public void launch(ILaunchConfiguration configuration, String mode, ILaunch launch, IProgressMonitor monitor) throws CoreException { @@ -110,7 +111,7 @@ public class ProgramLaunchDelegate extends LaunchConfigurationDelegate { IProcess process = null; // add process type to process attributes - Map processAttributes = new HashMap(); + Map<String, String> processAttributes = new HashMap<String, String>(); String programName = location.lastSegment(); String extension = location.getFileExtension(); if (extension != null) { @@ -125,12 +126,12 @@ public class ProgramLaunchDelegate extends LaunchConfigurationDelegate { ExternalToolsProgramMessages.ProgramLaunchDelegate_3, new String[] { configuration.getName() }), IProgressMonitor.UNKNOWN); - process = DebugPlugin.newProcess(launch, p, location.toOSString(), - processAttributes); + process = DebugPlugin.newProcess(launch, p, location.toOSString(), processAttributes); } if (p == null || process == null) { - if (p != null) + if (p != null) { p.destroy(); + } throw new CoreException(new Status(IStatus.ERROR, IExternalToolConstants.PLUGIN_ID, IExternalToolConstants.ERR_INTERNAL_ERROR, @@ -165,8 +166,9 @@ public class ProgramLaunchDelegate extends LaunchConfigurationDelegate { } private String generateCommandLine(String[] commandLine) { - if (commandLine.length < 1) + if (commandLine.length < 1) { return IExternalToolConstants.EMPTY_STRING; + } StringBuffer buf = new StringBuffer(); for (int i = 0; i < commandLine.length; i++) { buf.append(' '); @@ -195,11 +197,12 @@ public class ProgramLaunchDelegate extends LaunchConfigurationDelegate { /* * (non-Javadoc) - * + * * @see * org.eclipse.debug.core.model.LaunchConfigurationDelegate#getBuildOrder * (org.eclipse.debug.core.ILaunchConfiguration, java.lang.String) */ + @Override protected IProject[] getBuildOrder(ILaunchConfiguration configuration, String mode) throws CoreException { IProject[] projects = ExternalToolsCoreUtil.getBuildProjects( @@ -214,14 +217,15 @@ public class ProgramLaunchDelegate extends LaunchConfigurationDelegate { } return computeBuildOrder(projects); } - + /* * (non-Javadoc) - * + * * @see org.eclipse.debug.core.model.LaunchConfigurationDelegate#saveBeforeLaunch - * (org.eclipse.debug.core.ILaunchConfiguration, java.lang.String, + * (org.eclipse.debug.core.ILaunchConfiguration, java.lang.String, * org.eclipse.core.runtime.IProgressMonitor) */ + @Override protected boolean saveBeforeLaunch(ILaunchConfiguration configuration, String mode, IProgressMonitor monitor) throws CoreException { if (IExternalToolConstants.ID_EXTERNAL_TOOLS_BUILDER_LAUNCH_CATEGORY |