KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > ant > internal > ui > launchConfigurations > AntJavaLaunchDelegate


1 /*******************************************************************************
2  * Copyright (c) 2000, 2005 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.ant.internal.ui.launchConfigurations;
12
13 import org.eclipse.core.runtime.CoreException;
14 import org.eclipse.core.runtime.IProgressMonitor;
15 import org.eclipse.debug.core.ILaunchConfiguration;
16 import org.eclipse.jdt.launching.IJavaLaunchConfigurationConstants;
17 import org.eclipse.jdt.launching.JavaLaunchDelegate;
18
19 /**
20  * Used by the AntLaunchDelegate for Ant builds in a separate VM
21  * The subclassing is needed to be able to launch an Ant build from a non-Java project
22  */

23 public class AntJavaLaunchDelegate extends JavaLaunchDelegate {
24     /* (non-Javadoc)
25      * @see org.eclipse.debug.core.model.ILaunchConfigurationDelegate2#preLaunchCheck(org.eclipse.debug.core.ILaunchConfiguration, java.lang.String, org.eclipse.core.runtime.IProgressMonitor)
26      */

27     public boolean preLaunchCheck(ILaunchConfiguration configuration,String JavaDoc mode, IProgressMonitor monitor) throws CoreException {
28         try {
29             return super.preLaunchCheck(configuration, mode, monitor);
30         } catch (CoreException ce) {
31             //likely dealing with a non-Java project
32
}
33         //no need to check for breakpoints as always in run mode
34
return true;
35     }
36     
37     /* (non-Javadoc)
38      * @see org.eclipse.jdt.launching.AbstractJavaLaunchConfigurationDelegate#getProgramArguments(org.eclipse.debug.core.ILaunchConfiguration)
39      */

40     public String JavaDoc getProgramArguments(ILaunchConfiguration configuration) throws CoreException {
41         try {
42             return super.getProgramArguments(configuration);
43         } catch (CoreException ce) {
44         }
45         return configuration.getAttribute(IJavaLaunchConfigurationConstants.ATTR_PROGRAM_ARGUMENTS, ""); //$NON-NLS-1$
46
}
47 }
48
Popular Tags