ec79c2ae768d883803f1ca79f763fd31084d44e3
1 /*******************************************************************************
2 * Copyright (c) 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
8 *******************************************************************************/
10 package org
.eclipse
.tracecompass
.internal
.analysis
.timing
.ui
;
12 import org
.eclipse
.core
.runtime
.IStatus
;
13 import org
.eclipse
.core
.runtime
.Status
;
14 import org
.eclipse
.jface
.resource
.ImageDescriptor
;
15 import org
.eclipse
.swt
.graphics
.Image
;
16 import org
.eclipse
.ui
.plugin
.AbstractUIPlugin
;
17 import org
.osgi
.framework
.BundleContext
;
20 * The activator class controls the plug-in life cycle
22 public class Activator
extends AbstractUIPlugin
{
25 public static final String PLUGIN_ID
= "org.eclipse.tracecompass.analysis.timing.ui"; //$NON-NLS-1$
27 // The shared instance
28 private static Activator plugin
;
37 public void start(BundleContext context
) throws Exception
{
43 public void stop(BundleContext context
) throws Exception
{
49 * Get the image object from a given path
52 * The path to the image file
53 * @return The Image object
55 public Image
getImageFromPath(String path
) {
56 return getImageDescripterFromPath(path
).createImage();
60 * Get the ImageDescriptor from a given path
63 * The path to the image file
64 * @return The ImageDescriptor object
66 public ImageDescriptor
getImageDescripterFromPath(String path
) {
67 return AbstractUIPlugin
.imageDescriptorFromPlugin(PLUGIN_ID
, path
);
71 * Get the Image from a registry
74 * The path to the image registry
75 * @return The Image object
77 public Image
getImageFromImageRegistry(String path
) {
78 Image icon
= getImageRegistry().get(path
);
80 icon
= getImageDescripterFromPath(path
).createImage();
81 plugin
.getImageRegistry().put(path
, icon
);
87 * Returns the shared instance
89 * @return the shared instance
91 public static Activator
getDefault() {
95 // --------------------------------------
97 // --------------------------------------
100 * Logs a message with severity INFO in the runtime log of the plug-in.
105 public void logInfo(String message
) {
106 getLog().log(new Status(IStatus
.INFO
, PLUGIN_ID
, message
));
110 * Logs a message and exception with severity INFO in the runtime log of the
118 public void logInfo(String message
, Throwable exception
) {
119 getLog().log(new Status(IStatus
.INFO
, PLUGIN_ID
, message
, exception
));
123 * Logs a message and exception with severity WARNING in the runtime log of
129 public void logWarning(String message
) {
130 getLog().log(new Status(IStatus
.WARNING
, PLUGIN_ID
, message
));
134 * Logs a message and exception with severity WARNING in the runtime log of
142 public void logWarning(String message
, Throwable exception
) {
143 getLog().log(new Status(IStatus
.WARNING
, PLUGIN_ID
, message
, exception
));
147 * Logs a message and exception with severity ERROR in the runtime log of
153 public void logError(String message
) {
154 getLog().log(new Status(IStatus
.ERROR
, PLUGIN_ID
, message
));
158 * Logs a message and exception with severity ERROR in the runtime log of
166 public void logError(String message
, Throwable exception
) {
167 getLog().log(new Status(IStatus
.ERROR
, PLUGIN_ID
, message
, exception
));
This page took 0.049356 seconds and 5 git commands to generate.