Class EMFPlugin

  extended by org.eclipse.emf.common.util.DelegatingResourceLocator
      extended by org.eclipse.emf.common.EMFPlugin
All Implemented Interfaces:
Logger, ResourceLocator
Direct Known Subclasses:
ChangeEditPlugin, ChangePlugin, CheatSheetsPlugin, CodeGenEcorePlugin, CodeGenPlugin, CommonPlugin, CommonUIPlugin, ConverterPlugin, DataBindingEditPlugin, DataBindingPlugin, Ecore2EcoreEditorPlugin, Ecore2EcorePlugin, Ecore2XMLUIPlugin, EcoreEditorPlugin, EcoreEditPlugin, EcoreImporterPlugin, EcorePlugin, EMFEditPlugin, EMFEditUIPlugin, ExporterPlugin, GenModelEditPlugin, ImporterPlugin, JavaImporterPlugin, MappingPlugin, RoseImporterPlugin, XMIPlugin

public abstract class EMFPlugin
extends DelegatingResourceLocator
implements ResourceLocator, Logger

EMF must run within an Eclipse workbench, within a headless Eclipse workspace, or just stand-alone as part of some other application. To support this, all resource access (e.g., NL strings, images, and so on) is directed to the resource locator methods, which can redirect the service as appropriate to the runtime. During Eclipse invocation, the implementation delegates to a plugin implementation. During stand-alone invocation, no plugin initialization takes place, so the implementation delegates to a resource JAR on the CLASSPATH. The resource jar will typically not be on the CLASSPATH during Eclipse invocation. It will contain things like the icons and the .properties, which are available in a different way during Eclipse invocation.

See Also:
DelegatingResourceLocator, ResourceLocator, Logger

Nested Class Summary
static class EMFPlugin.EclipsePlugin
          The actual implementation of an Eclipse Plugin.
static interface EMFPlugin.InternalEclipsePlugin
          This just provides a common interface for the Eclipse plugins supported by EMF.
static class EMFPlugin.InternalHelper
          This just provides a common delegate for non-UI and UI plug-in classes.
Field Summary
protected  ResourceLocator[] delegateResourceLocators
static boolean IS_ECLIPSE_RUNNING
Fields inherited from class org.eclipse.emf.common.util.DelegatingResourceLocator
baseURL, images, resourceBundle, shouldTranslate, strings, untranslatedResourceBundle, untranslatedStrings
Constructor Summary
EMFPlugin(ResourceLocator[] delegateResourceLocators)
Method Summary
protected  ResourceLocator[] getDelegateResourceLocators()
          Returns the delegate resource locators.
 Logger getPluginLogger()
          Returns an Eclipse plugin implementation of a logger.
abstract  ResourceLocator getPluginResourceLocator()
          Returns an Eclipse plugin implementation of a resource locator.
protected  ResourceLocator getPrimaryResourceLocator()
          Returns the primary resource locator.
 java.lang.String getSymbolicName()
 void log(java.lang.Object logEntry)
          Logs an entry.
static void main(java.lang.String[] args)
Methods inherited from class org.eclipse.emf.common.util.DelegatingResourceLocator
delegatedGetImage, delegatedGetString, doGetImage, doGetString, extensionFor, getBaseURL, getImage, getString, getString, getString, getString, setShouldTranslate, shouldTranslate
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.eclipse.emf.common.util.ResourceLocator
getBaseURL, getImage, getString, getString, getString, getString

Field Detail


public static final boolean IS_ECLIPSE_RUNNING


public static final boolean IS_RESOURCES_BUNDLE_AVAILABLE


protected ResourceLocator[] delegateResourceLocators
Constructor Detail


public EMFPlugin(ResourceLocator[] delegateResourceLocators)
Method Detail


public abstract ResourceLocator getPluginResourceLocator()
Returns an Eclipse plugin implementation of a resource locator.

an Eclipse plugin implementation of a resource locator.


protected final ResourceLocator getPrimaryResourceLocator()
Description copied from class: DelegatingResourceLocator
Returns the primary resource locator.

Specified by:
getPrimaryResourceLocator in class DelegatingResourceLocator
the primary resource locator.


protected ResourceLocator[] getDelegateResourceLocators()
Description copied from class: DelegatingResourceLocator
Returns the delegate resource locators.

Specified by:
getDelegateResourceLocators in class DelegatingResourceLocator
the delegate resource locators.


public Logger getPluginLogger()
Returns an Eclipse plugin implementation of a logger.

an Eclipse plugin implementation of a logger.


public java.lang.String getSymbolicName()


public void log(java.lang.Object logEntry)
Description copied from interface: Logger
Logs an entry.

Specified by:
log in interface Logger
logEntry - a plastic entry to log.


public static void main(java.lang.String[] args)

Copyright 2001-2006 IBM Corporation and others.
All Rights Reserved.