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%
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(Throwable)
M: 12 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: 0 C: 6
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: 6
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-2015 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: * Lucas Koehler - initial API and implementation
13: ******************************************************************************/
14: package org.eclipse.emf.ecp.internal.view.template.model;
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 Class Activator.
23: *
24: * @author Lucas Koehler
25: * @since 1.6
26: */
27: public class Activator extends Plugin {
28:
29:         /**
30:          * The constant holding the id of this plugin.
31:          */
32:         public static final String PLUGIN_ID = "org.eclipse.emf.ecp.view.template.model"; //$NON-NLS-1$
33:
34:         private static Activator plugin;
35:
36:         // BEGIN SUPRESS CATCH EXCEPTION
37:         /**
38:          * {@inheritDoc}
39:          *
40:          * @see org.eclipse.core.runtime.Plugin#start(org.osgi.framework.BundleContext)
41:          */
42:         @Override
43:         public void start(BundleContext bundleContext) throws Exception {
44:                 super.start(bundleContext);
45:                 plugin = this;
46:         }
47:
48:         /**
49:          * {@inheritDoc}
50:          *
51:          * @see org.eclipse.core.runtime.Plugin#stop(org.osgi.framework.BundleContext)
52:          */
53:         @Override
54:         public void stop(BundleContext bundleContext) throws Exception {
55:                 plugin = null;
56:                 super.stop(bundleContext);
57:         }
58:
59:         // END SUPRESS CATCH EXCEPTION
60:         /**
61:          * Returns the instance of this Activator.
62:          *
63:          * @return the saved instance
64:          */
65:         public static Activator getDefault() {
66:                 return plugin;
67:         }
68:
69:         /**
70:          * Logs a {@link Throwable}.
71:          *
72:          * @param t the {@link Throwable} to log
73:          */
74:         public static void log(Throwable t) {
75:                 getDefault().getLog().log(new Status(IStatus.ERROR, PLUGIN_ID, t.getMessage(), t));
76:         }
77:
78: }