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%
log(String)
M: 10 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
log(String, Throwable)
M: 11 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 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-2016 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.emfforms.internal.editor.genmodel.util;
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: * The activator class controls the plug-in life cycle.
23: *
24: * @author Johannes Faltermeier
25: */
26: public class Activator extends AbstractUIPlugin {
27:
28:         // The plug-in ID
29:         private static final String PLUGIN_ID = "org.eclipse.emfforms.editor.genmodel.util"; //$NON-NLS-1$
30:
31:         // The shared instance
32:         private static Activator plugin;
33:
34:         @Override
35:         public void start(BundleContext context) throws Exception {
36:                 super.start(context);
37:                 plugin = this;
38:         }
39:
40:         @Override
41:         public void stop(BundleContext context) throws Exception {
42:                 plugin = null;
43:                 super.stop(context);
44:         }
45:
46:         /**
47:          * Returns the shared instance.
48:          *
49:          * @return the shared instance
50:          */
51:         public static Activator getDefault() {
52:                 return plugin;
53:         }
54:
55:         /**
56:          * Logs the given message as an error.
57:          *
58:          * @param message the error description
59:          */
60:         public static void log(String message) {
61:                 getDefault().getLog().log(new Status(IStatus.ERROR, PLUGIN_ID, message));
62:         }
63:
64:         /**
65:          * Logs the given message + exception as an error.
66:          *
67:          * @param message the error description
68:          * @param ex the exception
69:          */
70:         public static void log(String message, Throwable ex) {
71:                 getDefault().getLog().log(new Status(IStatus.ERROR, PLUGIN_ID, message, ex));
72:
73:         }
74:
75: }