trace/traceviewer/com.nokia.trace.eventview/src/com/nokia/trace/eventview/Activator.java
changeset 11 5b9d4d8641ce
equal deleted inserted replaced
10:ed1c9f64298a 11:5b9d4d8641ce
       
     1 /*
       
     2  * Copyright (c) 2007-2010 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  * Event view plug-in
       
    17  *
       
    18  */
       
    19 package com.nokia.trace.eventview;
       
    20 
       
    21 import org.eclipse.ui.plugin.AbstractUIPlugin;
       
    22 import org.osgi.framework.BundleContext;
       
    23 
       
    24 /**
       
    25  * The activator class controls the plug-in life cycle
       
    26  * 
       
    27  */
       
    28 public class Activator extends AbstractUIPlugin {
       
    29 
       
    30 	/**
       
    31 	 * The plug-in ID
       
    32 	 */
       
    33 	public static final String PLUGIN_ID = "com.nokia.trace.eventview"; //$NON-NLS-1$
       
    34 
       
    35 	/**
       
    36 	 * The shared instance
       
    37 	 */
       
    38 	private static Activator plugin;
       
    39 
       
    40 	/**
       
    41 	 * Shared event list
       
    42 	 */
       
    43 	TraceEventList eventList;
       
    44 
       
    45 	/**
       
    46 	 * The constructor
       
    47 	 */
       
    48 	public Activator() {
       
    49 		plugin = this;
       
    50 	}
       
    51 
       
    52 	/*
       
    53 	 * (non-Javadoc)
       
    54 	 * 
       
    55 	 * @see
       
    56 	 * org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext
       
    57 	 * )
       
    58 	 */
       
    59 	@Override
       
    60 	public void start(BundleContext context) throws Exception {
       
    61 		super.start(context);
       
    62 	}
       
    63 
       
    64 	/*
       
    65 	 * (non-Javadoc)
       
    66 	 * 
       
    67 	 * @see
       
    68 	 * org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext
       
    69 	 * )
       
    70 	 */
       
    71 	@Override
       
    72 	public void stop(BundleContext context) throws Exception {
       
    73 		if (eventList != null) {
       
    74 			((EventListContentProvider) eventList).removeListener();
       
    75 		}
       
    76 		plugin = null;
       
    77 		super.stop(context);
       
    78 	}
       
    79 
       
    80 	/**
       
    81 	 * Returns the shared instance
       
    82 	 * 
       
    83 	 * @return the shared instance
       
    84 	 */
       
    85 	public static Activator getDefault() {
       
    86 		return plugin;
       
    87 	}
       
    88 
       
    89 }