public interface IEmfService extends IEmfService
EObject
,
URI
, ResourceSet
, and TransactionalEditingDomain
.Modifier and Type | Method and Description |
---|---|
Diagram |
getDiagramFromFile(IFile file,
org.eclipse.emf.ecore.resource.ResourceSet resourceSet)
If given file is a valid emf resource and it contains a diagram as first
root element, this methods return the diagram.
|
org.eclipse.emf.ecore.EObject |
getEObject(java.lang.Object object)
Tries to convert the given object to a
EObject
using #adaptObject(Object, Class) ,
unwrapping an IStructuredSelection .
|
IFile |
getFile(org.eclipse.emf.ecore.EObject object)
Returns the Eclipse file for the given
EObject 's Resource
. |
IFile |
getFile(org.eclipse.emf.common.util.URI uri)
Returns the Eclipse file for the given
URI . |
org.eclipse.emf.common.util.URI |
getFileURI(IFile file)
Retrieves the workspace-local string location of the given
IFile ,
constructs a potentially normalized platform resource URI from it
and returns it. |
java.lang.String |
getObjectName(java.lang.Object obj)
Returns the human readable name of a given object or the EMF id if no
name can be found.
|
org.eclipse.emf.common.util.URI |
mapDiagramFileUriToDiagramUri(org.eclipse.emf.common.util.URI diagramFileUri)
Maps the fileURI to an URI which points directly to the Diagram Object.
|
java.lang.StringBuilder |
toString(org.eclipse.emf.ecore.EObject o,
java.lang.StringBuilder result)
Creates an extended string presentation of the given
EObject ,
including its type and attributes |
createResourceSetAndEditingDomain
java.lang.String getObjectName(java.lang.Object obj)
TranslatableTextFragment
is returned, otherwise null
.obj
- the object to get a name fororg.eclipse.emf.ecore.EObject getEObject(java.lang.Object object)
EObject
#adaptObject(Object, Class)
,IStructuredSelection
.object
- the object to convertnull
getEObject(Object)
IFile getFile(org.eclipse.emf.ecore.EObject object)
EObject
's Resource
.
Note that the file is null
for objects in
IProject.getFile(String)
.object
- the model object to get the file fornull
under the mentioned
circumstancesgetFile(URI)
IFile getFile(org.eclipse.emf.common.util.URI uri)
URI
.
Note that the file is null
for objects in
IProject.getFile(String)
.uri
- the URI to get the file fornull
under the mentioned circumstancesgetFile(EObject)
java.lang.StringBuilder toString(org.eclipse.emf.ecore.EObject o, java.lang.StringBuilder result)
EObject
,
including its type and attributeso
- the object to create a string presentation forresult
- the string buffer to store the result intoresult
per convenience#toString(EObject)
Diagram getDiagramFromFile(IFile file, org.eclipse.emf.ecore.resource.ResourceSet resourceSet)
file
- a valid emf (diagram) resourceorg.eclipse.emf.common.util.URI getFileURI(IFile file)
IFile
,
constructs a potentially normalized platform resource URI
from it
and returns it.file
- The file to construct the URI forresourceSet
- The ResourceSet
to use for the normalization (can be
null
, in this case no normalization is done).org.eclipse.emf.common.util.URI mapDiagramFileUriToDiagramUri(org.eclipse.emf.common.util.URI diagramFileUri)
diagramFileUri
- URI of the diagramFile