Package: AcceleoSourcePathComputer

AcceleoSourcePathComputer

nameinstructionbranchcomplexitylinemethod
AcceleoSourcePathComputer()
M: 3 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
computeSourceContainers(ILaunchConfiguration, IProgressMonitor)
M: 10 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 3 C: 0
0%
M: 1 C: 0
0%

Coverage

1: /*******************************************************************************
2: * Copyright (c) 2008, 2012 Obeo.
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: * Obeo - initial API and implementation
10: *******************************************************************************/
11: package org.eclipse.acceleo.internal.ide.ui.launching;
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.debug.core.sourcelookup.ISourceContainer;
17: import org.eclipse.debug.core.sourcelookup.ISourcePathComputerDelegate;
18: import org.eclipse.jdt.launching.IRuntimeClasspathEntry;
19: import org.eclipse.jdt.launching.JavaRuntime;
20:
21: /**
22: * Computes a default source lookup path for Acceleo applications. The source path provider associated with a
23: * launch configuration is consulted to compute a source lookup path.
24: *
25: * @author <a href="mailto:jonathan.musset@obeo.fr">Jonathan Musset</a>
26: */
27: public class AcceleoSourcePathComputer implements ISourcePathComputerDelegate {
28:
29:         /**
30:          * Unique identifier for the Acceleo source path computer.
31:          */
32:         public static final String ID = "org.eclipse.acceleo.ide.ui.launching.AcceleoSourcePathComputer"; //$NON-NLS-1$
33:
34:         /**
35:          * {@inheritDoc}
36:          *
37:          * @see org.eclipse.debug.core.sourcelookup.ISourcePathComputerDelegate#computeSourceContainers(org.eclipse.debug.core.ILaunchConfiguration,
38:          * org.eclipse.core.runtime.IProgressMonitor)
39:          */
40:         public ISourceContainer[] computeSourceContainers(ILaunchConfiguration configuration,
41:                         IProgressMonitor monitor) throws CoreException {
42:                 IRuntimeClasspathEntry[] entries = JavaRuntime.computeUnresolvedSourceLookupPath(configuration);
43:                 IRuntimeClasspathEntry[] resolved = JavaRuntime.resolveSourceLookupPath(entries, configuration);
44:                 return JavaRuntime.getSourceContainers(resolved);
45:         }
46:
47: }