1 /*******************************************************************************
2 * Copyright (c) 2014, 2015 Ericsson
4 * All rights reserved. This program and the accompanying materials are
5 * made available under the terms of the Eclipse Public License v1.0 which
6 * accompanies this distribution, and is available at
7 * http://www.eclipse.org/legal/epl-v10.html
10 * Vincent Perot - Initial API and implementation
11 *******************************************************************************/
13 package org
.eclipse
.tracecompass
.internal
.tmf
.pcap
.ui
;
15 import org
.eclipse
.core
.runtime
.IStatus
;
16 import org
.eclipse
.core
.runtime
.Plugin
;
17 import org
.eclipse
.core
.runtime
.Status
;
18 import org
.eclipse
.jdt
.annotation
.Nullable
;
19 import org
.osgi
.framework
.BundleContext
;
22 * <b><u>Activator</u></b>
24 * The activator class controls the plug-in life cycle
26 public class Activator
extends Plugin
{
28 // ------------------------------------------------------------------------
30 // ------------------------------------------------------------------------
35 public static final String PLUGIN_ID
= "org.eclipse.tracecompass.tmf.pcap.ui"; //$NON-NLS-1$
40 private static @Nullable Activator fPlugin
;
42 // ------------------------------------------------------------------------
44 // ------------------------------------------------------------------------
53 // ------------------------------------------------------------------------
55 // ------------------------------------------------------------------------
58 * Returns the TMF Core plug-in instance.
60 * @return the TMF Core plug-in instance.
62 public static @Nullable Activator
getDefault() {
66 // Sets plug-in instance
67 private static void setDefault(@Nullable Activator plugin
) {
71 // ------------------------------------------------------------------------
73 // ------------------------------------------------------------------------
76 public void start(@Nullable BundleContext context
) throws Exception
{
82 public void stop(@Nullable BundleContext context
) throws Exception
{
88 // ------------------------------------------------------------------------
90 // ------------------------------------------------------------------------
93 * Log an IStatus object directly
98 public static void log(IStatus status
) {
99 Activator activator
= fPlugin
;
100 if (activator
== null) {
103 activator
.getLog().log(status
);
106 // ------------------------------------------------------------------------
108 // ------------------------------------------------------------------------
111 * Logs a message with severity INFO in the runtime log of the plug-in.
116 public static void logInfo(String message
) {
117 Activator activator
= fPlugin
;
118 if (activator
== null) {
121 activator
.getLog().log(new Status(IStatus
.INFO
, PLUGIN_ID
, message
));
125 * Logs a message and exception with severity INFO in the runtime log of the
131 * The corresponding exception
133 public static void logInfo(String message
, Throwable exception
) {
134 Activator activator
= fPlugin
;
135 if (activator
== null) {
138 activator
.getLog().log(new Status(IStatus
.INFO
, PLUGIN_ID
, message
, exception
));
141 // ------------------------------------------------------------------------
143 // ------------------------------------------------------------------------
146 * Logs a message and exception with severity WARNING in the runtime log of
152 public static void logWarning(String message
) {
153 Activator activator
= fPlugin
;
154 if (activator
== null) {
157 activator
.getLog().log(new Status(IStatus
.WARNING
, PLUGIN_ID
, message
));
161 * Logs a message and exception with severity WARNING in the runtime log of
167 * The corresponding exception
169 public static void logWarning(String message
, Throwable exception
) {
170 Activator activator
= fPlugin
;
171 if (activator
== null) {
174 activator
.getLog().log(new Status(IStatus
.WARNING
, PLUGIN_ID
, message
, exception
));
177 // ------------------------------------------------------------------------
179 // ------------------------------------------------------------------------
182 * Logs a message and exception with severity ERROR in the runtime log of
188 public static void logError(String message
) {
189 Activator activator
= fPlugin
;
190 if (activator
== null) {
193 activator
.getLog().log(new Status(IStatus
.ERROR
, PLUGIN_ID
, message
));
197 * Logs a message and exception with severity ERROR in the runtime log of
203 * The corresponding exception
205 public static void logError(String message
, Throwable exception
) {
206 Activator activator
= fPlugin
;
207 if (activator
== null) {
210 activator
.getLog().log(new Status(IStatus
.ERROR
, PLUGIN_ID
, message
, exception
));
This page took 0.055269 seconds and 6 git commands to generate.