1 /*******************************************************************************
2 * Copyright (c) 2012 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 * Francois Chouinard - Initial API and implementation
11 *******************************************************************************/
13 package org
.eclipse
.linuxtools
.internal
.lttng2
.ui
;
15 import org
.eclipse
.jface
.resource
.ImageDescriptor
;
16 import org
.eclipse
.jface
.resource
.ImageRegistry
;
17 import org
.eclipse
.swt
.graphics
.Image
;
18 import org
.eclipse
.ui
.plugin
.AbstractUIPlugin
;
19 import org
.osgi
.framework
.BundleContext
;
22 * The activator class controls the plug-in life cycle
24 public class Activator
extends AbstractUIPlugin
{
26 // ------------------------------------------------------------------------
28 // ------------------------------------------------------------------------
33 public static final String PLUGIN_ID
= "org.eclipse.linuxtools.lttng2.ui"; //$NON-NLS-1$
38 private static Activator plugin
;
40 // ------------------------------------------------------------------------
42 // ------------------------------------------------------------------------
50 // ------------------------------------------------------------------------
52 // ------------------------------------------------------------------------
55 * Returns the shared instance
57 * @return the shared instance
59 public static Activator
getDefault() {
63 // ------------------------------------------------------------------------
65 // ------------------------------------------------------------------------
68 * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
71 public void start(BundleContext context
) throws Exception
{
77 * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
80 public void stop(BundleContext context
) throws Exception
{
86 * @see org.eclipse.ui.plugin.AbstractUIPlugin#initializeImageRegistry(org.eclipse.jface.resource.ImageRegistry)
89 protected void initializeImageRegistry(ImageRegistry reg
) {
92 // ------------------------------------------------------------------------
94 // ------------------------------------------------------------------------
96 public Image
getImageFromPath(String path
) {
97 return getImageDescripterFromPath(path
).createImage();
100 public ImageDescriptor
getImageDescripterFromPath(String path
) {
101 return AbstractUIPlugin
.imageDescriptorFromPlugin(PLUGIN_ID
, path
);
104 public Image
getImageFromImageRegistry(String path
) {
105 Image icon
= getImageRegistry().get(path
);
107 icon
= getImageDescripterFromPath(path
).createImage();
108 plugin
.getImageRegistry().put(path
, icon
);
This page took 0.046927 seconds and 6 git commands to generate.