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%
getInstance()
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%
log(int, 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%
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-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.table.swt;
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: * Activator for this plugin.
23: *
24: * @author Eugen Neufeld
25: *
26: */
27: public class Activator extends Plugin {
28:
29:         private static final String PLUGIN_ID = "org.eclipse.emf.ecp.view.table.ui.swt"; //$NON-NLS-1$
30:         private static Activator instance;
31:
32:         /**
33:          * Returns the instance.
34:          *
35:          * @return the {@link Activator} instance.
36:          */
37:         public static Activator getInstance() {
38:                 return instance;
39:         }
40:
41:         @Override
42:         public void start(BundleContext bundleContext) throws Exception {
43:                 instance = this;
44:                 super.start(bundleContext);
45:         }
46:
47:         @Override
48:         public void stop(BundleContext bundleContext) throws Exception {
49:                 instance = null;
50:                 super.stop(bundleContext);
51:         }
52:
53:         /**
54:          * Logs a {@link Throwable}.
55:          *
56:          * @param t the {@link Throwable} to log
57:          */
58:         public void log(Throwable t) {
59:                 getLog().log(new Status(IStatus.ERROR, PLUGIN_ID, t.getMessage(), t));
60:         }
61:
62:         /**
63:          * Logs a message with the given {@link IStatus}.
64:          *
65:          * @param severity the {@link IStatus} severity to log
66:          * @param message the message to log
67:          */
68:         public void log(int severity, String message) {
69:                 getLog().log(new Status(severity, PLUGIN_ID, message));
70:         }
71:
72: }