KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > pde > internal > ui > templates > Activator


1 /*******************************************************************************
2  * Copyright (c) 2006 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.pde.internal.ui.templates;
12
13 import java.net.URL JavaDoc;
14
15 import org.eclipse.ui.plugin.AbstractUIPlugin;
16 import org.osgi.framework.BundleContext;
17
18 public class Activator extends AbstractUIPlugin {
19
20     // Shared instance
21
private static Activator fInstance;
22     
23     public URL JavaDoc getInstallURL() {
24         return getDefault().getBundle().getEntry("/"); //$NON-NLS-1$
25
}
26     
27     public static Activator getDefault() {
28         return fInstance;
29     }
30
31     public static String JavaDoc getPluginId() {
32         return getDefault().getBundle().getSymbolicName();
33     }
34     
35     /* (non-Javadoc)
36      * @see org.eclipse.core.runtime.Plugin#start(org.osgi.framework.BundleContext)
37      */

38     public void start(BundleContext context) throws Exception JavaDoc {
39         super.start(context);
40         fInstance = this;
41     }
42     
43     public void stop(BundleContext context) throws Exception JavaDoc {
44         fInstance = null;
45         super.stop(context);
46     }
47 }
48
Popular Tags