Package: InterpreterDependencyChecks

InterpreterDependencyChecks

nameinstructionbranchcomplexitylinemethod
isDebugAccessible()
M: 2 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
static {...}
M: 12 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 6 C: 0
0%
M: 1 C: 0
0%

Coverage

1: /*******************************************************************************
2: * Copyright (c) 2011, 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.ui.interpreter.internal.optional;
12:
13: /**
14: * This will be used to check whether our optional dependencies are present or not.
15: *
16: * @author <a href="mailto:laurent.goubet@obeo.fr">Laurent Goubet</a>
17: */
18: public final class InterpreterDependencyChecks {
19:         /** Set to <code>true</code> if the <i>org.eclipse.debug.ui</i> dependency is accessible in the classpath. */
20:         private static final boolean DEBUG_DEPENDENCY;
21:
22:         static {
23:                 boolean tempDebugDependency;
24:                 try {
25:                         Class.forName("org.eclipse.debug.ui.IDebugView"); //$NON-NLS-1$
26:                         tempDebugDependency = true;
27:                 } catch (ClassNotFoundException e) {
28:                         tempDebugDependency = false;
29:                 }
30:                 DEBUG_DEPENDENCY = tempDebugDependency;
31:         }
32:
33:         /** Does not need to be instantiated. */
34:         private InterpreterDependencyChecks() {
35:                 // Hides default constructor
36:         }
37:
38:         /**
39:          * Checks whether the org.eclipse.debug.ui plugin is accessible in the classpath.
40:          *
41:          * @return <code>true</code> if <i>org.eclipse.debug.ui</i> is accessible from this class,
42:          * <code>false</code> otherwise.
43:          */
44:         public static boolean isDebugAccessible() {
45:                 return DEBUG_DEPENDENCY;
46:         }
47: }