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 * Matthew Khouzam - Initial implementation
11 *******************************************************************************/
13 package org
.eclipse
.tracecompass
.btf
.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
.osgi
.framework
.BundleContext
;
21 * The activator class controls the plug-in life cycle. No more than one such
22 * plug-in can exist at any time.
24 * It also provides the plug-in's general logging facility and manages the
27 public class Activator
extends Plugin
{
29 // ------------------------------------------------------------------------
31 // ------------------------------------------------------------------------
36 public static final String PLUGIN_ID
= "org.eclipse.tracecompass.btf.ui"; //$NON-NLS-1$
41 private static Activator fPlugin
;
44 // ------------------------------------------------------------------------
46 // ------------------------------------------------------------------------
55 // ------------------------------------------------------------------------
57 // ------------------------------------------------------------------------
60 * Returns the BTF plug-in instance.
62 * @return the BTF plug-in instance.
64 public static Activator
getDefault() {
68 // Sets plug-in instance
69 private static void setDefault(Activator plugin
) {
73 // ------------------------------------------------------------------------
75 // ------------------------------------------------------------------------
78 public void start(BundleContext context
) throws Exception
{
84 public void stop(BundleContext context
) throws Exception
{
90 // ------------------------------------------------------------------------
92 // ------------------------------------------------------------------------
95 * Log an IStatus object directly
100 public static void log(IStatus status
) {
101 fPlugin
.getLog().log(status
);
104 // ------------------------------------------------------------------------
106 // ------------------------------------------------------------------------
109 * Logs a message with severity INFO in the runtime log of the plug-in.
114 public static void logInfo(String message
) {
115 fPlugin
.getLog().log(new Status(IStatus
.INFO
, PLUGIN_ID
, message
));
119 * Logs a message and exception with severity INFO in the runtime log of the
125 * The corresponding exception
127 public static void logInfo(String message
, Throwable exception
) {
128 fPlugin
.getLog().log(new Status(IStatus
.INFO
, PLUGIN_ID
, message
, exception
));
131 // ------------------------------------------------------------------------
133 // ------------------------------------------------------------------------
136 * Logs a message and exception with severity WARNING in the runtime log of
142 public static void logWarning(String message
) {
143 fPlugin
.getLog().log(new Status(IStatus
.WARNING
, PLUGIN_ID
, message
));
147 * Logs a message and exception with severity WARNING in the runtime log of
153 * The corresponding exception
155 public static void logWarning(String message
, Throwable exception
) {
156 fPlugin
.getLog().log(new Status(IStatus
.WARNING
, PLUGIN_ID
, message
, exception
));
159 // ------------------------------------------------------------------------
161 // ------------------------------------------------------------------------
164 * Logs a message and exception with severity ERROR in the runtime log of
170 public static void logError(String message
) {
171 fPlugin
.getLog().log(new Status(IStatus
.ERROR
, PLUGIN_ID
, message
));
175 * Logs a message and exception with severity ERROR in the runtime log of
181 * The corresponding exception
183 public static void logError(String message
, Throwable exception
) {
184 fPlugin
.getLog().log(new Status(IStatus
.ERROR
, PLUGIN_ID
, message
, exception
));
This page took 0.035954 seconds and 5 git commands to generate.