KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > core > internal > plugins > CompatibilityActivator


1 /*******************************************************************************
2  * Copyright (c) 2003, 2005 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.core.internal.plugins;
12
13 import org.eclipse.core.internal.runtime.CompatibilityHelper;
14 import org.eclipse.core.internal.runtime.InternalPlatform;
15 import org.eclipse.core.runtime.IPluginDescriptor;
16 import org.eclipse.core.runtime.Platform;
17 import org.osgi.framework.BundleActivator;
18 import org.osgi.framework.BundleContext;
19
20 public class CompatibilityActivator implements BundleActivator {
21     public void start(BundleContext context) throws Exception JavaDoc {
22         IPluginDescriptor descriptor = CompatibilityHelper.getPluginDescriptor(Platform.PI_RUNTIME);
23         CompatibilityHelper.setPlugin(descriptor, InternalPlatform.getDefault().getRuntimeInstance());
24         CompatibilityHelper.setActive(descriptor);
25     }
26
27     public void stop(BundleContext context) throws Exception JavaDoc {
28         IPluginDescriptor descriptor = CompatibilityHelper.getPluginDescriptor(Platform.PI_RUNTIME);
29         CompatibilityHelper.setPlugin(descriptor, null);
30         ((PluginRegistry) org.eclipse.core.internal.plugins.InternalPlatform.getPluginRegistry()).close();
31         CompatibilityHelper.nullCompatibility();
32     }
33
34 }
35
Popular Tags