| 1 |
/** |
| 2 |
* Copyright (c) 2002-2006 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 v2.0 |
| 5 |
* which accompanies this distribution, and is available at |
| 6 |
* http://www.eclipse.org/legal/epl-v20.html |
| 7 |
* |
| 8 |
* Contributors: |
| 9 |
* IBM - Initial API and implementation |
| 10 |
*/ |
| 11 |
package org.eclipse.xsd.provider; |
| 12 |
|
| 13 |
|
| 14 |
import org.eclipse.emf.common.EMFPlugin; |
| 15 |
import org.eclipse.emf.common.util.ResourceLocator; |
| 16 |
|
| 17 |
/** |
| 18 |
* The <b>Plugin</b> for the model. |
| 19 |
* The XML Schema model needs to be able to run |
| 20 |
* within an Eclipse workbench, |
| 21 |
* within a headless Eclipse workspace, |
| 22 |
* or just stand-alone as part of some other application. |
| 23 |
* To support this, all access is directed to the static methods, |
| 24 |
* which can redirect the service as appopriate to the runtime. |
| 25 |
* During stand-alone invocation no plugin initialization takes place. |
| 26 |
* In this case you will need the resources jar on the class path. |
| 27 |
* @see #getBaseURL() |
| 28 |
*/ |
| 29 |
public final class XSDEditPlugin extends EMFPlugin |
| 30 |
{ |
| 31 |
/** |
| 32 |
* The singleton instance of the plugin. |
| 33 |
*/ |
| 34 |
public static final XSDEditPlugin INSTANCE = new XSDEditPlugin(); |
| 35 |
|
| 36 |
/** |
| 37 |
* The one instance of this class. |
| 38 |
*/ |
| 39 |
static private Implementation plugin; |
| 40 |
|
| 41 |
/** |
| 42 |
* Creates the singleton instance. |
| 43 |
*/ |
| 44 |
private XSDEditPlugin() |
| 45 |
{ |
| 46 |
super(new ResourceLocator[] {}); |
| 47 |
} |
| 48 |
|
| 49 |
/* |
| 50 |
* Javadoc copied from base class. |
| 51 |
*/ |
| 52 |
@Override |
| 53 |
public ResourceLocator getPluginResourceLocator() |
| 54 |
{ |
| 55 |
return plugin; |
| 56 |
} |
| 57 |
|
| 58 |
/** |
| 59 |
* Returns the singleton instance of the Eclipse plugin. |
| 60 |
* @return the singleton instance. |
| 61 |
*/ |
| 62 |
public static Implementation getPlugin() |
| 63 |
{ |
| 64 |
return plugin; |
| 65 |
} |
| 66 |
|
| 67 |
/** |
| 68 |
* The actual implementation of the Eclipse <b>Plugin</b>. |
| 69 |
*/ |
| 70 |
public static class Implementation extends EMFPlugin.EclipsePlugin |
| 71 |
{ |
| 72 |
/** |
| 73 |
* Creates an instance. |
| 74 |
*/ |
| 75 |
public Implementation() |
| 76 |
{ |
| 77 |
super(); |
| 78 |
|
| 79 |
// Remember the static instance. |
| 80 |
// |
| 81 |
plugin = this; |
| 82 |
} |
| 83 |
} |
| 84 |
} |