Skip to content

Package: Activator

Activator

nameinstructionbranchcomplexitylinemethod
Activator()
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%
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: 6 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 3 C: 0
0%
M: 1 C: 0
0%
stop(BundleContext)
M: 6 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) 2011-2015 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: * Stefan Dirix - initial API and implementation
13: ******************************************************************************/
14: package org.eclipse.emf.ecp.emf2web.ui.json;
15:
16: import org.eclipse.core.runtime.IStatus;
17: import org.eclipse.core.runtime.Status;
18: import org.eclipse.ui.plugin.AbstractUIPlugin;
19: import org.osgi.framework.BundleContext;
20:
21: /**
22: * Activator for this plugin.
23: */
24: public class Activator extends AbstractUIPlugin {
25:         // The shared instance
26:         private static Activator plugin;
27:
28:         /**
29:          * The PlugIn ID.
30:          */
31:         public static final String PLUGIN_ID = "org.eclipse.emf.ecp.emf2web.ui.json"; //$NON-NLS-1$
32:
33:         /**
34:          * {@inheritDoc}
35:          *
36:          * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext)
37:          */
38:         @Override
39:         public void start(BundleContext context) throws Exception {
40:                 super.start(context);
41:                 plugin = this;
42:         }
43:
44:         /**
45:          * {@inheritDoc}
46:          *
47:          * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext)
48:          */
49:         @Override
50:         public void stop(BundleContext context) throws Exception {
51:                 super.stop(context);
52:                 plugin = null;
53:         }
54:
55:         /**
56:          * Returns the shared instance.
57:          *
58:          * @return the shared instance
59:          */
60:         public static Activator getDefault() {
61:                 return plugin;
62:         }
63:
64:         /**
65:          * Logs exception.
66:          *
67:          * @param e the {@link Exception} to log
68:          */
69:         public static void logException(Exception e) {
70:                 getDefault().getLog().log(
71:                         new Status(IStatus.ERROR, Activator.getDefault().getBundle().getSymbolicName(), e.getMessage(), e));
72:         }
73: }