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%
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-2013 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: * Mat Hansen - initial API and implementation
13: ******************************************************************************/
14: package org.eclipse.emfforms.common.internal.validation;
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 bundle activator.
23: */
24: public class Activator extends Plugin {
25:
26:         /**
27:          * The plug-in ID.
28:          */
29:         public static final String PLUGIN_ID = "org.eclipse.emfforms.common.validation"; //$NON-NLS-1$
30:
31:         /**
32:          * The shared instance.
33:          */
34:         private static Activator plugin;
35:
36:         /**
37:          * The constructor.
38:          */
39:         public Activator() {
40:         }
41:
42:         // BEGIN SUPRESS CATCH EXCEPTION
43:         @Override
44:         public void start(BundleContext context) throws Exception {
45:                 super.start(context);
46:                 plugin = this;
47:         }
48:
49:         @Override
50:         public void stop(BundleContext context) throws Exception {
51:                 super.stop(context);
52:                 plugin = null;
53:         }
54:         // END SUPRESS CATCH EXCEPTION
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: }