1、插件类Activator.java 该类主要创建整个插件对象,是插件的全局对象。可以通过该类的静态方法getDefault()获得插件对象的引用,然后可以获得插件的各种信息,其中包括插件对应的Bundle文件信息和工作台对象等。 package myfirstrcp; import org.eclipse.jface.resource.ImageDescriptor; import org.eclipse.ui.plugin.AbstractUIPlugin; import org.osgi.framework.BundleContext; /** */ /** * The activator class controls the plug-in life cycle */ public class Activator extends AbstractUIPlugin ... { // The plug-in ID public static final String PLUGIN_ID = "com.zhangjun.MyFirstRCP"; // The shared instance //插件类的对象,为静态对象 private static Activator plugin; /** *//** * The constructor构造方法 */ public Activator() ...{ plugin = this; } /** *//** * (non-Javadoc) * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) */ //装载Bundle文件并启动插件 public void start(BundleContext context) throws Exception ...{ super.start(context); } /** *//**