Bug 486251 - Remove activator in org.eclipse.pde.ui.templates 

Change-Id: Icaa79507f7d4ef9e1037019655d607439b57ce91
Signed-off-by: Lars Vogel <Lars.Vogel@vogella.com>
diff --git a/ui/org.eclipse.pde.ui.templates/META-INF/MANIFEST.MF b/ui/org.eclipse.pde.ui.templates/META-INF/MANIFEST.MF
index 1e6dfdf..76020f9 100644
--- a/ui/org.eclipse.pde.ui.templates/META-INF/MANIFEST.MF
+++ b/ui/org.eclipse.pde.ui.templates/META-INF/MANIFEST.MF
@@ -16,6 +16,4 @@
  org.eclipse.core.resources;bundle-version="[3.6.0,4.0.0)",
  org.eclipse.ui.ide;bundle-version="3.11.0"
 Bundle-Localization: plugin
-Eclipse-LazyStart: true
-Bundle-Activator: org.eclipse.pde.internal.ui.templates.Activator
-Bundle-ActivationPolicy: lazy
+Eclipse-LazyStart: false
diff --git a/ui/org.eclipse.pde.ui.templates/src/org/eclipse/pde/internal/ui/templates/Activator.java b/ui/org.eclipse.pde.ui.templates/src/org/eclipse/pde/internal/ui/templates/Activator.java
deleted file mode 100644
index aacf057..0000000
--- a/ui/org.eclipse.pde.ui.templates/src/org/eclipse/pde/internal/ui/templates/Activator.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
- *  Copyright (c) 2006, 2007 IBM Corporation and others.
- *  All rights reserved. This program and the accompanying materials
- *  are made available under the terms of the Eclipse Public License v1.0
- *  which accompanies this distribution, and is available at
- *  http://www.eclipse.org/legal/epl-v10.html
- *
- *  Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.pde.internal.ui.templates;
-
-import java.net.URL;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.osgi.framework.BundleContext;
-
-public class Activator extends AbstractUIPlugin {
-
-	// Shared instance
-	private static Activator fInstance;
-
-	public URL getInstallURL() {
-		return getDefault().getBundle().getEntry("/"); //$NON-NLS-1$
-	}
-
-	public static Activator getDefault() {
-		return fInstance;
-	}
-
-	public static String getPluginId() {
-		return getDefault().getBundle().getSymbolicName();
-	}
-
-	@Override
-	public void start(BundleContext context) throws Exception {
-		super.start(context);
-		fInstance = this;
-	}
-
-	@Override
-	public void stop(BundleContext context) throws Exception {
-		fInstance = null;
-		super.stop(context);
-	}
-}
diff --git a/ui/org.eclipse.pde.ui.templates/src/org/eclipse/pde/internal/ui/templates/PDETemplateSection.java b/ui/org.eclipse.pde.ui.templates/src/org/eclipse/pde/internal/ui/templates/PDETemplateSection.java
index 7b7e2eb..bf378ed 100644
--- a/ui/org.eclipse.pde.ui.templates/src/org/eclipse/pde/internal/ui/templates/PDETemplateSection.java
+++ b/ui/org.eclipse.pde.ui.templates/src/org/eclipse/pde/internal/ui/templates/PDETemplateSection.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2015 IBM Corporation and others.
+ * Copyright (c) 2000, 2016 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -18,6 +18,7 @@
 import org.eclipse.core.runtime.*;
 import org.eclipse.pde.ui.templates.OptionTemplateSection;
 import org.osgi.framework.Bundle;
+import org.osgi.framework.FrameworkUtil;
 
 public abstract class PDETemplateSection extends OptionTemplateSection {
 
@@ -29,15 +30,16 @@
 	public static final String VALUE_PERSPECTIVE_NAME = "RCP Perspective"; //$NON-NLS-1$
 	public static final String VALUE_APPLICATION_ID = "application"; //$NON-NLS-1$
 
+	private Bundle bundle = FrameworkUtil.getBundle(PDETemplateSection.class);
+
 	@Override
 	protected ResourceBundle getPluginResourceBundle() {
-		Bundle bundle = Platform.getBundle(Activator.getPluginId());
 		return Platform.getResourceBundle(bundle);
 	}
 
 	@Override
 	protected URL getInstallURL() {
-		return Activator.getDefault().getInstallURL();
+		return bundle.getEntry("/"); //$NON-NLS-1$
 	}
 
 	@Override
@@ -45,7 +47,7 @@
 		try {
 			String[] candidates = getDirectoryCandidates();
 			for (int i = 0; i < candidates.length; i++) {
-				if (Activator.getDefault().getBundle().getEntry(candidates[i]) != null) {
+				if (bundle.getEntry(candidates[i]) != null) {
 					URL candidate = new URL(getInstallURL(), candidates[i]);
 					return candidate;
 				}
@@ -96,7 +98,7 @@
 		super.generateFiles(monitor);
 		// Copy the default splash screen if the branding option is selected
 		if (copyBrandingDirectory()) {
-			super.generateFiles(monitor, Activator.getDefault().getBundle().getEntry("branding/")); //$NON-NLS-1$
+			super.generateFiles(monitor, bundle.getEntry("branding/")); //$NON-NLS-1$
 		}
 	}