Package org.eclipse.emf.common
Class CommonPlugin
java.lang.Object
org.eclipse.emf.common.util.DelegatingResourceLocator
org.eclipse.emf.common.EMFPlugin
org.eclipse.emf.common.CommonPlugin
- All Implemented Interfaces:
Logger,ResourceLocator
The Plugin for the model EMF.Common library.
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 should be directed to the resource locator,
which can redirect the service as appropriate to the runtime.
During stand-alone invocation no plugin initialization takes place.
In this case, common.resources.jar must be on the CLASSPATH.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classA simple representation of an element in aplugin.xml.static classThe actual implementation of the Eclipse Plugin.static classNested classes/interfaces inherited from class org.eclipse.emf.common.EMFPlugin
EMFPlugin.EclipsePlugin, EMFPlugin.InternalEclipsePlugin, EMFPlugin.InternalHelper, EMFPlugin.OSGiDelegatingBundleActivator -
Field Summary
FieldsFields inherited from class org.eclipse.emf.common.EMFPlugin
delegateResourceLocators, IS_ECLIPSE_RUNNING, IS_OSGI_RUNNING, IS_RESOURCES_BUNDLE_AVAILABLEFields inherited from class org.eclipse.emf.common.util.DelegatingResourceLocator
baseURL, bundleLocalization, images, resourceBundle, shouldTranslate, strings, untranslatedResourceBundle, untranslatedStrings -
Method Summary
Modifier and TypeMethodDescriptionstatic URIasLocalURI(URI uri) Use the platform, if available, to convert to a local URI.Returns a string comparator appropriate for collating strings for thecurrent locale.getComparator(Locale locale) Returns a string comparator appropriate for collating strings for the give locale.static CommonPlugin.ImplementationReturns the singleton instance of the Eclipse plugin.Returns an Eclipse plugin implementation of a resource locator.Computes a map from bundle symbolic name to the bundle's location URI.static Map<String,List<CommonPlugin.ElementRecord>> getTargetPlatformExtensionPoints(Set<String> extensionPoints) Computes a list ofelement recordsfor each requested extension point.static Class<?>Use the platform, if available, to load the named class using the right class loader.static URIUse the platform, if available, to resolve the URI.Methods inherited from class org.eclipse.emf.common.EMFPlugin
getDelegateResourceLocators, getPluginLogger, getPrimaryResourceLocator, getSymbolicName, log, mainMethods inherited from class org.eclipse.emf.common.util.DelegatingResourceLocator
delegatedGetImage, delegatedGetString, doGetImage, doGetString, extensionFor, getBaseURL, getBundleLocalization, getImage, getString, getString, getString, getString, setShouldTranslate, shouldTranslateMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.eclipse.emf.common.util.ResourceLocator
getBaseURL, getImage, getString, getString, getString, getString
-
Field Details
-
INSTANCE
The singleton instance of the plugin.
-
-
Method Details
-
getPluginResourceLocator
Description copied from class:EMFPluginReturns an Eclipse plugin implementation of a resource locator.- Specified by:
getPluginResourceLocatorin classEMFPlugin- Returns:
- an Eclipse plugin implementation of a resource locator.
-
getPlugin
Returns the singleton instance of the Eclipse plugin.- Returns:
- the singleton instance.
-
asLocalURI
Use the platform, if available, to convert to a local URI. -
resolve
Use the platform, if available, to resolve the URI. -
loadClass
Use the platform, if available, to load the named class using the right class loader.- Throws:
ClassNotFoundException
-
getTargetPlatformExtensionPoints
public static Map<String,List<CommonPlugin.ElementRecord>> getTargetPlatformExtensionPoints(Set<String> extensionPoints) Computes a list ofelement recordsfor each requested extension point. Each key in the map is extension point ID.The corresponding value is a list of the extension point element records associated with that extension point.
Each root element record has synthetic attributes derived from the extension point:
point- The extension point ID itself.
symbolicName- The symbolic name of the bundle that contains the extension point.
location-
The root location URI the bundle containing the extension point.
For example,
platform:/resource/org.example.pluginfor an extension point in the workspace,file:/folder/org.eclipse.pluginfor folder bundle in the target platform, orarchive:file:/file/folder/org.example.plugin.jar!/for a jarred bundle in the target platform. This is useful for resolving a relative path in attribute value to its absolute path in the bundle.
This method uses the Plug-in Development Environment (PDE) to compute the results. It will include results for plug-ins in the workspace as well as for plug-ins in the target platform. If PDE is not available, this information cannot be computed.
- Parameters:
extensionPoints- a set of extension points to query; if it'snullor empty, all extension points will be queried.- Returns:
- a map of extension point data, or
nullif PDE is not available. - Since:
- 2.14
-
getTargetPlatformBundleMappings
Computes a map from bundle symbolic name to the bundle's location URI.This method uses the Plug-in Development Environment (PDE) to compute the results. It will include results for plug-ins in the workspace as well as for plug-ins in the target platform. If PDE is not available, this information cannot be computed.
- Returns:
- a map from bundle symbolic name to the bundle's location URI, or
nullif PDE is not available. - Since:
- 2.14
-
getComparator
Returns a string comparator appropriate for collating strings for thecurrent locale.- Returns:
- a string comparator appropriate for collating strings for the
current locale.
-
getComparator
Returns a string comparator appropriate for collating strings for the give locale. This will use ICU, when available that plug-in is available, orCollatorotherwise.- Parameters:
locale- the locale for which a comparator is needed.- Returns:
- a string comparator appropriate for collating strings for the give locale.
-