|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.emf.compare.util.EclipseModelUtils
public final class EclipseModelUtils
Utility class for model loading/saving and serialization within Eclipse.
Method Summary | |
---|---|
static org.eclipse.emf.common.util.Monitor |
createProgressMonitor(java.lang.Object delegate)
This will create an EMF progress monitor that can be used standalone to display
comparison progress to the user. |
static org.eclipse.emf.ecore.resource.Resource |
createResource(org.eclipse.emf.common.util.URI modelURI,
java.lang.String contentType,
org.eclipse.emf.ecore.resource.ResourceSet resourceSet)
This will create a Resource given the model extension it is intended for and a ResourceSet. |
static java.lang.String |
getCommonContentType(org.eclipse.emf.common.util.URI... uris)
This will try and find the common content-type of the given resources. |
static org.eclipse.emf.ecore.EObject |
load(org.eclipse.core.resources.IFile file,
org.eclipse.emf.ecore.resource.ResourceSet resourceSet)
Loads a model from an IFile in a given ResourceSet . |
static org.eclipse.emf.ecore.EObject |
load(org.eclipse.core.runtime.IPath path,
org.eclipse.emf.ecore.resource.ResourceSet resourceSet)
Loads a model from an IPath in a given ResourceSet . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static org.eclipse.emf.common.util.Monitor createProgressMonitor(java.lang.Object delegate)
progress monitor
that can be used standalone to display
comparison progress to the user. If delegate
isn't null
, the created monitor
will delegate all calls to it.
delegate
- The delegate progress monitor. Can be null
or Eclipse specific monitors.
public static org.eclipse.emf.ecore.resource.Resource createResource(org.eclipse.emf.common.util.URI modelURI, java.lang.String contentType, org.eclipse.emf.ecore.resource.ResourceSet resourceSet)
Resource
given the model extension it is intended for and a ResourceSet.
modelURI
- URI
where the model is stored.contentType
- Content type of this file.resourceSet
- The ResourceSet
to load the model in.
Resource
given the model extension it is intended for.public static java.lang.String getCommonContentType(org.eclipse.emf.common.util.URI... uris)
uris
- The resource URIs that will be compared.
null
if
content-types are distinct.public static org.eclipse.emf.ecore.EObject load(org.eclipse.core.resources.IFile file, org.eclipse.emf.ecore.resource.ResourceSet resourceSet) throws java.io.IOException
IFile
in a given ResourceSet
.
This will return the first root of the loaded model, other roots can be accessed via the resource's content.
file
- IFile
containing the model to be loaded.resourceSet
- The ResourceSet
to load the model in.
java.io.IOException
- If the given file does not exist.public static org.eclipse.emf.ecore.EObject load(org.eclipse.core.runtime.IPath path, org.eclipse.emf.ecore.resource.ResourceSet resourceSet) throws java.io.IOException
IPath
in a given ResourceSet
.
This will return the first root of the loaded model, other roots can be accessed via the resource's content.
path
- IPath
where the model lies.resourceSet
- The ResourceSet
to load the model in.
java.io.IOException
- If the given file does not exist.
|
Copyright 2006 IBM Corporation and others. All Rights Reserved. |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |