public class ProjectMap extends StandaloneProjectMap
ProjectManager
to support polymorphic access in either plugin or standalone environments
to EMF resources and EPackages.
StandaloneProjectMap.getProjectDescriptors()
returns a map of project names, but not bundle names, to resolvable location.
StandaloneProjectMap.initializePackageRegistry(ResourceSet)
augments the default EMF startup in a plugin environment
whereby the global package registry acquires a registration for each namespace URI
(e.g. http://www.eclipse.org/emf/2002/Ecore) defined by the
org.eclipse.emf.ecore.generated_package extension point in plugins.
The standard reguistration is auugmented where appropriate, by two further registrations for
the project URI (e.g. platform:/resource/org.eclipse.emf.ecore/model/Ecore.ecore) and the plugin URI
(e.g. platform:/plugin/org.eclipse.emf.ecore/model/Ecore.ecore). These extra registrations
derived from the genPackages.ecorePackage referenced by the genmodel
org.eclipse.emf.ecore.generated_package declarations ensure that all three URIs resolve to
the same Resource eliminating most opportunities for meta-model schizophrenia.
initializePlatformResourceMap(boolean)
does nothing since the standard EMF Platform URI Handler
can open platform resources directly.
StandaloneProjectMap.initializeGenModelLocationMap(boolean)
does nothing, since the standard EMF startup in a
plugin environment populates the EcorePlugin#getEPackageNsURIToGenModelLocationMap()
.
initializeURIMap(ResourceSet)
installs explicit URI mappings into the URIConverter
so that for each project so that both platform:/resource/project and
platform:/plugin/project reference platform:/resource/project. An additional
backstop URI mapping redirects platform:/resource to platform:/plugin.
The explicit mapping ensures that projects are accessible as either platform:/resource/project or platform:/plugin/project. The backstop mapping ensures that plugins, that are not occluded by projects, are accessible as platform:/plugin/project or platform:/resource/project, without needing to create an explicit URI map entry for each of the many hundreds of bundles in typical use.
Modifier and Type | Class and Description |
---|---|
static class |
ProjectMap.ProjectDescriptor |
StandaloneProjectMap.AbstractResourceDescriptor, StandaloneProjectMap.AbstractResourceLoadStatus, StandaloneProjectMap.CreateStrategy, StandaloneProjectMap.DelegatedMultiplePackageResource, StandaloneProjectMap.DelegatedSinglePackageResource, StandaloneProjectMap.LoadBothStrategy, StandaloneProjectMap.LoadDynamicResourceStrategy, StandaloneProjectMap.LoadFirstStrategy, StandaloneProjectMap.LoadGeneratedPackageStrategy, StandaloneProjectMap.LoadingBothLoadedDynamicResourceStrategy, StandaloneProjectMap.MapToFirstConflictHandler, StandaloneProjectMap.MapToFirstConflictHandlerWithLog, StandaloneProjectMap.MultiplePackageResourceDescriptor, StandaloneProjectMap.MultiplePackageResourceLoadStatus, StandaloneProjectMap.PackageDescriptor, StandaloneProjectMap.PackageLoadStatus, StandaloneProjectMap.SinglePackageResourceDescriptor, StandaloneProjectMap.SinglePackageResourceLoadStatus
ProjectManager.IConflictHandler, ProjectManager.IPackageDescriptor, ProjectManager.IPackageLoadStatus, ProjectManager.IProjectDescriptor, ProjectManager.IResourceDescriptor, ProjectManager.IResourceLoadStatus, ProjectManager.IResourceLoadStrategy
liveStandaloneProjectMaps, PROJECT_MAP_ADD_EPACKAGE, PROJECT_MAP_ADD_GEN_MODEL, PROJECT_MAP_ADD_GENERATED_PACKAGE, PROJECT_MAP_ADD_URI_MAP, PROJECT_MAP_CONFIGURE, PROJECT_MAP_GET, PROJECT_MAP_INSTALL, PROJECT_MAP_RESOLVE
CLASS_PATH, NO_PROJECTS
Constructor and Description |
---|
ProjectMap(boolean isGlobal) |
Modifier and Type | Method and Description |
---|---|
static StandaloneProjectMap |
findAdapter(ResourceSet resourceSet) |
static StandaloneProjectMap |
getAdapter(ResourceSet resourceSet) |
URI |
getLocation(String projectName)
Return the resolveable URI for a given project or bundle name.
|
void |
initializePlatformResourceMap(boolean force)
Initialize the
EcorePlugin#getPlatformResourceMap() so that in a standalone
environment and in conjunction with StandaloneProjectMap.initializeURIMap(ResourceSet) URIs such as
platform:/resource/project and
platform:/plugin/project are useable. |
void |
initializeURIMap(ResourceSet resourceSet)
Initialize the uriMap of a uriConverter so that each of
platform:/resource/project and
platform:/plugin/project resolve the workspace project
resource else the plugin bundle for use in either standalone or plugin
environment.
|
boolean |
isAdapterForType(Object type) |
addResourceDescriptor, configure, getExceptionMap, getPackageDescriptor, getPackageRegistry, getProjectDescriptor, getProjectNames, getResourceDescriptor, getResourceFactoryRegistry, getTarget, getURIConverter, getURIMap, initializeGenModelLocationMap, initializePackageRegistry, initializeResourceSet, initializeURIResourceMap, initStatics, isGlobal, notifyChanged, removeResourceDescriptor, setTarget, toString, unload, useGeneratedResource
public static StandaloneProjectMap findAdapter(ResourceSet resourceSet)
public static StandaloneProjectMap getAdapter(ResourceSet resourceSet)
public URI getLocation(String projectName)
StandaloneProjectMap
getLocation
in class StandaloneProjectMap
public void initializePlatformResourceMap(boolean force)
StandaloneProjectMap
EcorePlugin#getPlatformResourceMap()
so that in a standalone
environment and in conjunction with StandaloneProjectMap.initializeURIMap(ResourceSet)
URIs such as
platform:/resource/project and
platform:/plugin/project are useable.
Initialization is only necessary once and for a standalone environment. If force is true a re-initialization or plugin initialization may be forced.
initializePlatformResourceMap
in class StandaloneProjectMap
public void initializeURIMap(ResourceSet resourceSet)
StandaloneProjectMap
Note that in a plugin environment, a single platform:/resource/ to platform:/plugin/ mapping is sufficient since platform:/plugin/ is directly resolveable by the Eclipse Platform.
initializeURIMap
in class StandaloneProjectMap
public boolean isAdapterForType(Object type)
isAdapterForType
in class StandaloneProjectMap
Copyright © 2005, 2018 IBM Corporation and others. All Rights Reserved.