KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > emf > edit > ui > EMFEditUIPlugin


1 /**
2  * <copyright>
3  *
4  * Copyright (c) 2002-2004 IBM Corporation and others.
5  * All rights reserved. This program and the accompanying materials
6  * are made available under the terms of the Eclipse Public License v1.0
7  * which accompanies this distribution, and is available at
8  * http://www.eclipse.org/legal/epl-v10.html
9  *
10  * Contributors:
11  * IBM - Initial API and implementation
12  *
13  * </copyright>
14  *
15  * $Id: EMFEditUIPlugin.java,v 1.4 2005/06/08 06:20:52 nickb Exp $
16  */

17 package org.eclipse.emf.edit.ui;
18
19
20 import org.eclipse.emf.common.EMFPlugin;
21 import org.eclipse.emf.common.util.ResourceLocator;
22
23
24 /**
25  * The <b>Plugin</b> for the model EMF.Edit.UI library.
26  * EMF must run
27  * within an Eclipse workbench,
28  * within a headless Eclipse workspace,
29  * or just stand-alone as part of some other application.
30  * To support this, all resource access should be directed to the resource locator,
31  * which can redirect the service as appopriate to the runtime.
32  * During stand-alone invocation no plugin initialization takes place.
33  * In this case, emf.edit.resources.jar must be on the CLASSPATH.
34  * @see #INSTANCE
35  */

36 public final class EMFEditUIPlugin extends EMFPlugin
37 {
38   /**
39    * The singleton instance of the plugin.
40    */

41   public static final EMFEditUIPlugin INSTANCE = new EMFEditUIPlugin();
42
43   /**
44    * The one instance of this class.
45    */

46   private static Implementation plugin;
47
48   /**
49    * Creates the singleton instance.
50    */

51   private EMFEditUIPlugin()
52   {
53     super(new ResourceLocator[] {});
54   }
55
56   /*
57    * Javadoc copied from base class.
58    */

59   public ResourceLocator getPluginResourceLocator()
60   {
61     return plugin;
62   }
63
64   /**
65    * Returns the singleton instance of the Eclipse plugin.
66    * @return the singleton instance.
67    */

68   public static Implementation getPlugin()
69   {
70     return plugin;
71   }
72
73   /**
74    * The actual implementation of the Eclipse <b>Plugin</b>.
75    */

76   public static class Implementation extends EclipsePlugin
77   {
78     /**
79      * Creates an instance.
80      */

81     public Implementation()
82     {
83       super();
84
85       // Remember the static instance.
86
//
87
plugin = this;
88     }
89   }
90 }
91
Popular Tags