1 /*******************************************************************************
2 * Copyright (c) 2013 École Polytechnique de Montréal
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 * Geneviève Bastien - Initial API and implementation
11 *******************************************************************************/
13 package org
.eclipse
.linuxtools
.internal
.tmf
.analysis
.xml
.ui
;
15 import org
.eclipse
.core
.runtime
.IStatus
;
16 import org
.eclipse
.core
.runtime
.Status
;
17 import org
.eclipse
.ui
.plugin
.AbstractUIPlugin
;
18 import org
.osgi
.framework
.BundleContext
;
21 * The activator class controls the plug-in life cycle
23 * @author Geneviève Bastien
25 public class Activator
extends AbstractUIPlugin
{
28 public static final String PLUGIN_ID
= "org.eclipse.linuxtools.tmf.analysis.xml.ui"; //$NON-NLS-1$
30 // The shared instance
31 private static Activator fPlugin
;
41 public void start(BundleContext context
) throws Exception
{
47 public void stop(BundleContext context
) throws Exception
{
53 * Returns the shared instance
55 * @return the shared instance
57 public static Activator
getDefault() {
61 // Sets plug-in instance
62 private static void setDefault(Activator plugin
) {
66 // ------------------------------------------------------------------------
68 // ------------------------------------------------------------------------
71 * Log an IStatus object directly
76 public static void log(IStatus status
) {
77 fPlugin
.getLog().log(status
);
80 // ------------------------------------------------------------------------
82 // ------------------------------------------------------------------------
85 * Logs a message with severity INFO in the runtime log of the plug-in.
90 public static void logInfo(String message
) {
91 fPlugin
.getLog().log(new Status(IStatus
.INFO
, PLUGIN_ID
, message
));
95 * Logs a message and exception with severity INFO in the runtime log of the
101 * The corresponding exception
103 public static void logInfo(String message
, Throwable exception
) {
104 fPlugin
.getLog().log(new Status(IStatus
.INFO
, PLUGIN_ID
, message
, exception
));
107 // ------------------------------------------------------------------------
109 // ------------------------------------------------------------------------
112 * Logs a message and exception with severity WARNING in the runtime log of
118 public static void logWarning(String message
) {
119 fPlugin
.getLog().log(new Status(IStatus
.WARNING
, PLUGIN_ID
, message
));
123 * Logs a message and exception with severity WARNING in the runtime log of
129 * The corresponding exception
131 public static void logWarning(String message
, Throwable exception
) {
132 fPlugin
.getLog().log(new Status(IStatus
.WARNING
, PLUGIN_ID
, message
, exception
));
135 // ------------------------------------------------------------------------
137 // ------------------------------------------------------------------------
140 * Logs a message and exception with severity ERROR in the runtime log of
146 public static void logError(String message
) {
147 fPlugin
.getLog().log(new Status(IStatus
.ERROR
, PLUGIN_ID
, message
));
151 * Logs a message and exception with severity ERROR in the runtime log of
157 * The corresponding exception
159 public static void logError(String message
, Throwable exception
) {
160 fPlugin
.getLog().log(new Status(IStatus
.ERROR
, PLUGIN_ID
, message
, exception
));
This page took 0.039224 seconds and 5 git commands to generate.