trace/tracebuilder/com.nokia.tracebuilder.view/src/com/nokia/tracebuilder/view/TraceViewPlugin.java
changeset 10 ed1c9f64298a
equal deleted inserted replaced
9:14dc2103a631 10:ed1c9f64298a
       
     1 /*
       
     2 * Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:
       
    15 *
       
    16 * The activator class controls the plug-in life cycle
       
    17 *
       
    18 */
       
    19 package com.nokia.tracebuilder.view;
       
    20 
       
    21 import org.eclipse.jface.resource.ImageDescriptor;
       
    22 import org.eclipse.ui.plugin.AbstractUIPlugin;
       
    23 import org.osgi.framework.BundleContext;
       
    24 
       
    25 /**
       
    26  * The activator class controls the plug-in life cycle
       
    27  */
       
    28 public class TraceViewPlugin extends AbstractUIPlugin {
       
    29 
       
    30 	/**
       
    31 	 * The plug-in ID
       
    32 	 */
       
    33 	public static final String PLUGIN_ID = "com.nokia.tracebuilder.view"; //$NON-NLS-1$
       
    34 
       
    35 	/**
       
    36 	 * The shared instance
       
    37 	 */
       
    38 	private static TraceViewPlugin plugin;
       
    39 
       
    40 	/**
       
    41 	 * The constructor
       
    42 	 */
       
    43 	public TraceViewPlugin() {
       
    44 		plugin = this;
       
    45 	}
       
    46 
       
    47 	/*
       
    48 	 * (non-Javadoc)
       
    49 	 * 
       
    50 	 * @see
       
    51 	 * org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext
       
    52 	 * )
       
    53 	 */
       
    54 	@Override
       
    55 	public void start(BundleContext context) throws Exception {
       
    56 		super.start(context);
       
    57 	}
       
    58 
       
    59 	/*
       
    60 	 * (non-Javadoc)
       
    61 	 * 
       
    62 	 * @see
       
    63 	 * org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext
       
    64 	 * )
       
    65 	 */
       
    66 	@Override
       
    67 	public void stop(BundleContext context) throws Exception {
       
    68 		plugin = null;
       
    69 		super.stop(context);
       
    70 	}
       
    71 
       
    72 	/**
       
    73 	 * Returns an image descriptor for the image file at the given plug-in
       
    74 	 * relative path.
       
    75 	 * 
       
    76 	 * @param path
       
    77 	 *            the path
       
    78 	 * @return the image descriptor
       
    79 	 */
       
    80 	public static ImageDescriptor getImageDescriptor(String path) {
       
    81 		return AbstractUIPlugin.imageDescriptorFromPlugin(
       
    82 				"com.nokia.tracebuilder.view", path); //$NON-NLS-1$		
       
    83 	}
       
    84 
       
    85 	/**
       
    86 	 * Returns the shared instance
       
    87 	 * 
       
    88 	 * @return the shared instance
       
    89 	 */
       
    90 	public static TraceViewPlugin getDefault() {
       
    91 		return plugin;
       
    92 	}
       
    93 
       
    94 }