01: /*******************************************************************************
02: * Copyright (c) 2006 IBM Corporation and others.
03: * All rights reserved. This program and the accompanying materials
04: * are made available under the terms of the Eclipse Public License v1.0
05: * which accompanies this distribution, and is available at
06: * http://www.eclipse.org/legal/epl-v10.html
07: *
08: * Contributors:
09: * IBM Corporation - initial API and implementation
10: *******************************************************************************/package org.eclipse.pde.internal.ui.templates;
11:
12: import java.net.URL;
13:
14: import org.eclipse.ui.plugin.AbstractUIPlugin;
15: import org.osgi.framework.BundleContext;
16:
17: public class Activator extends AbstractUIPlugin {
18:
19: // Shared instance
20: private static Activator fInstance;
21:
22: public URL getInstallURL() {
23: return getDefault().getBundle().getEntry("/"); //$NON-NLS-1$
24: }
25:
26: public static Activator getDefault() {
27: return fInstance;
28: }
29:
30: public static String getPluginId() {
31: return getDefault().getBundle().getSymbolicName();
32: }
33:
34: /* (non-Javadoc)
35: * @see org.eclipse.core.runtime.Plugin#start(org.osgi.framework.BundleContext)
36: */
37: public void start(BundleContext context) throws Exception {
38: super .start(context);
39: fInstance = this ;
40: }
41:
42: public void stop(BundleContext context) throws Exception {
43: fInstance = null;
44: super.stop(context);
45: }
46: }
|