Skip to content

Package: Activator

Activator

nameinstructionbranchcomplexitylinemethod
Activator()
M: 0 C: 3
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
getDefault()
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%
logException(Exception)
M: 14 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 3 C: 0
0%
M: 1 C: 0
0%
start(BundleContext)
M: 0 C: 6
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 3
100%
M: 0 C: 1
100%
stop(BundleContext)
M: 0 C: 6
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 3
100%
M: 0 C: 1
100%

Coverage

1: /*******************************************************************************
2: * Copyright (c) 2011-2014 EclipseSource Muenchen GmbH and others.
3: *
4: * All rights reserved. This program and the accompanying materials
5: * are made available under the terms of the Eclipse Public License 2.0
6: * which accompanies this distribution, and is available at
7: * https://www.eclipse.org/legal/epl-2.0/
8: *
9: * SPDX-License-Identifier: EPL-2.0
10: *
11: * Contributors:
12: * Alexandra Buzila - initial API and implementation
13: ******************************************************************************/
14: package org.eclipse.emf.ecp.ide.view.service;
15:
16: import org.eclipse.core.runtime.IStatus;
17: import org.eclipse.core.runtime.Plugin;
18: import org.eclipse.core.runtime.Status;
19: import org.osgi.framework.BundleContext;
20:
21: /**
22: * @author Alexandra Buzila
23: *
24: */
25: public class Activator extends Plugin {
26:         // The shared instance
27:         private static Activator plugin;
28:
29:         /**
30:          * The PlugIn ID.
31:          */
32:         public static final String PLUGIN_ID = "org.eclipse.emf.ecp.ide.view.service"; //$NON-NLS-1$
33:
34:         /**
35:          * {@inheritDoc}
36:          *
37:          * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext)
38:          */
39:         @Override
40:         public void start(BundleContext context) throws Exception {
41:                 super.start(context);
42:                 plugin = this;
43:         }
44:
45:         /**
46:          * {@inheritDoc}
47:          *
48:          * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext)
49:          */
50:         @Override
51:         public void stop(BundleContext context) throws Exception {
52:                 super.stop(context);
53:                 plugin = null;
54:         }
55:
56:         /**
57:          * Returns the shared instance.
58:          *
59:          * @return the shared instance
60:          */
61:         public static Activator getDefault() {
62:                 return plugin;
63:         }
64:
65:         /**
66:          * Logs exception.
67:          *
68:          * @param e the {@link Exception} to log
69:          */
70:         public static void logException(Exception e) {
71:                 getDefault().getLog().log(
72:                         new Status(IStatus.ERROR, Activator.getDefault().getBundle().getSymbolicName(), e.getMessage(), e));
73:         }
74:
75: }