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%
log(Exception)
M: 14 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 4 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: * Eugen Neufeld - initial API and implementation
13: ******************************************************************************/
14: package org.eclipse.emf.ecp.view.internal.validation.bean;
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: * 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.validation.bean"; //$NON-NLS-1$
28:
29:         // The shared instance
30:         private static Activator plugin;
31:
32:         /**
33:          * The constructor.
34:          */
35:         public Activator() {
36:         }
37:
38:         /*
39:          * (non-Javadoc)
40:          * @see
41:          * org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext
42:          * )
43:          */
44:         @Override
45:         public void start(BundleContext context) throws Exception {
46:                 super.start(context);
47:                 plugin = this;
48:         }
49:
50:         /*
51:          * (non-Javadoc)
52:          * @see
53:          * org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext
54:          * )
55:          */
56:         @Override
57:         public void stop(BundleContext context) throws Exception {
58:                 plugin = null;
59:                 super.stop(context);
60:         }
61:
62:         /**
63:          * Returns the shared instance.
64:          *
65:          * @return the shared instance
66:          */
67:         public static Activator getDefault() {
68:                 return plugin;
69:         }
70:
71:         /**
72:          * Logs exception.
73:          *
74:          * @param e
75:          * the {@link Exception} to log
76:          */
77:         public static void log(Exception e) {
78:                 getDefault().getLog().log(
79:                         new Status(IStatus.ERROR, Activator.getDefault().getBundle()
80:                                 .getSymbolicName(), e.getMessage(), e));
81:         }
82: }