Skip to content

Package: Activator

Activator

nameinstructionbranchcomplexitylinemethod
Activator()
M: 3 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 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%
getReportService()
M: 13 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-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: * Johannes Faltermeier - initial API and implementation
13: ******************************************************************************/
14: package org.eclipse.emf.ecp.view.internal.compoundcontrol.swt;
15:
16: import org.eclipse.core.runtime.Plugin;
17: import org.eclipse.emfforms.spi.common.report.ReportService;
18: import org.osgi.framework.BundleContext;
19: import org.osgi.framework.ServiceReference;
20:
21: /**
22: * The activator class controls the plug-in life cycle.
23: */
24: public class Activator extends Plugin {
25:
26:         /** The plug-in ID. */
27:         public static final String PLUGIN_ID = "org.eclipse.emf.ecp.view.compoundcontrol.swt"; //$NON-NLS-1$
28:
29:         private static Activator plugin;
30:
31:         /**
32:          * The constructor.
33:          */
34:         public Activator() {
35:         }
36:
37:         /**
38:          *
39:          * {@inheritDoc}
40:          *
41:          * @see org.eclipse.core.runtime.Plugin#start(org.osgi.framework.BundleContext)
42:          */
43:         @Override
44:         public void start(BundleContext context) throws Exception {
45:                 super.start(context);
46:                 plugin = this;
47:         }
48:
49:         /**
50:          *
51:          * {@inheritDoc}
52:          *
53:          * @see org.eclipse.core.runtime.Plugin#stop(org.osgi.framework.BundleContext)
54:          */
55:         @Override
56:         public void stop(BundleContext context) throws Exception {
57:                 plugin = null;
58:                 super.stop(context);
59:         }
60:
61:         /**
62:          * Returns the shared instance.
63:          *
64:          * @return the shared instance
65:          */
66:         public static Activator getDefault() {
67:                 return plugin;
68:         }
69:
70:         /**
71:          * Returns the {@link ReportService}.
72:          *
73:          * @return the {@link ReportService}
74:          */
75:         public ReportService getReportService() {
76:                 final BundleContext bundleContext = getBundle().getBundleContext();
77:                 final ServiceReference<ReportService> serviceReference = bundleContext.getServiceReference(ReportService.class);
78:                 return bundleContext.getService(serviceReference);
79:         }
80:
81: }