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%
getContext()
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%
getDefault()
M: 0 C: 2
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
start(BundleContext)
M: 0 C: 5
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: 5
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:
15: package org.eclipse.emf.ecp.view.model.preview.common;
16:
17: import org.eclipse.core.runtime.Plugin;
18: import org.osgi.framework.BundleContext;
19:
20: /**
21: * The activator class controls the plug-in life cycle.
22: */
23: public class Activator extends Plugin {
24:         /** The shared instance. **/
25:         private static Activator plugin;
26:
27:         private static BundleContext context;
28:
29:         /** The plug-in ID. */
30:         public static final String PLUGIN_ID = "org.eclipse.emf.ecp.view.model.preview.common"; //$NON-NLS-1$
31:
32:         /**
33:          * Returns the shared instance.
34:          *
35:          * @return the shared instance
36:          */
37:         static BundleContext getContext() {
38:                 return context;
39:         }
40:
41:         /*
42:          * (non-Javadoc)
43:          * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext)
44:          */
45:         @Override
46:         public void start(BundleContext bundleContext) throws Exception {
47:                 Activator.context = bundleContext;
48:                 plugin = this;
49:         }
50:
51:         /*
52:          * (non-Javadoc)
53:          * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext)
54:          */
55:         @Override
56:         public void stop(BundleContext bundleContext) throws Exception {
57:                 Activator.context = null;
58:                 plugin = null;
59:         }
60:
61:         /**
62:          * Returns the Activator instance.
63:          *
64:          * @return the {@link Activator}
65:          */
66:         public static Activator getDefault() {
67:                 return plugin;
68:         }
69: }