Class ResourceLookup
java.lang.Object
com._1c.g5.v8.dt.internal.core.platform.ResourceLookup
- All Implemented Interfaces:
IResourceLookup
@LifecycleService(name="ResourceLookup")
public class ResourceLookup
extends Object
implements IResourceLookup
Implementation of
IResourceLookup
.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
dispose
(ProjectContext lifecycleContext) getDtProject
(org.eclipse.emf.common.util.URI uri) Returns project which contains object with providedURI
.getDtProject
(org.eclipse.emf.ecore.EObject object) Returns project which contains object with provided model object.getDtProject
(org.eclipse.emf.ecore.resource.Resource resource) Returns project which contains object with provided model object resource.org.eclipse.core.resources.IFile
getPlatformResource
(org.eclipse.emf.common.util.URI uri) Returns workspace resourceIFile
which contains object with provided model objectURI
.org.eclipse.core.resources.IFile
getPlatformResource
(org.eclipse.emf.ecore.EObject object) Returns workspace resourceIFile
which contains the provided model object.org.eclipse.core.resources.IFile
getPlatformResource
(org.eclipse.emf.ecore.resource.Resource resource) Returns workspace resourceIFile
which contains the provided model resource.org.eclipse.emf.common.util.URI
getPlatformResourceUri
(org.eclipse.emf.ecore.EObject object) Returns platform resourceURI
for the provided model object.org.eclipse.core.resources.IProject
getProject
(org.eclipse.emf.common.util.URI uri) Returns project which contains object with providedURI
.org.eclipse.core.resources.IProject
getProject
(org.eclipse.emf.ecore.EObject object) Returns project which contains object with provided model object.org.eclipse.core.resources.IProject
getProject
(org.eclipse.emf.ecore.resource.Resource resource) Returns project which contains object with provided model object resource.protected String
getProjectName
(org.eclipse.emf.common.util.URI uri) Gets project name fromURI
.void
init
(ProjectContext projectContext)
-
Constructor Details
-
ResourceLookup
public ResourceLookup()
-
-
Method Details
-
getPlatformResourceUri
public org.eclipse.emf.common.util.URI getPlatformResourceUri(org.eclipse.emf.ecore.EObject object) Description copied from interface:IResourceLookup
Returns platform resourceURI
for the provided model object. Can returnnull
if model object does not have associated platformURI
.- Specified by:
getPlatformResourceUri
in interfaceIResourceLookup
- Parameters:
object
- the model object, cannot benull
- Returns:
- the platform resource
URI
for the provided model object ornull
if object does not have associated platformURI
-
getPlatformResource
public org.eclipse.core.resources.IFile getPlatformResource(org.eclipse.emf.ecore.EObject object) Description copied from interface:IResourceLookup
Returns workspace resourceIFile
which contains the provided model object. Can returnnull
if workspace resource file not found.- Specified by:
getPlatformResource
in interfaceIResourceLookup
- Parameters:
object
- the model object, cannot benull
- Returns:
- the file which contains the provided model object, or
null
if model object is out of any file
-
getPlatformResource
public org.eclipse.core.resources.IFile getPlatformResource(org.eclipse.emf.ecore.resource.Resource resource) Description copied from interface:IResourceLookup
Returns workspace resourceIFile
which contains the provided model resource. Can returnnull
if workspace resource file not found.- Specified by:
getPlatformResource
in interfaceIResourceLookup
- Returns:
- the file which contains the provided model resource, or
null
if model resource is out of any file
-
getPlatformResource
public org.eclipse.core.resources.IFile getPlatformResource(org.eclipse.emf.common.util.URI uri) Description copied from interface:IResourceLookup
Returns workspace resourceIFile
which contains object with provided model objectURI
. Can returnnull
if file not found.- Specified by:
getPlatformResource
in interfaceIResourceLookup
- Parameters:
uri
- the objectURI
, cannot benull
- Returns:
- the file which contains object with provided
URI
ornull
if object is out of any file
-
getProject
public org.eclipse.core.resources.IProject getProject(org.eclipse.emf.common.util.URI uri) Description copied from interface:IResourceLookup
Returns project which contains object with providedURI
. Can returnnull
if project not found.- Specified by:
getProject
in interfaceIResourceLookup
- Parameters:
uri
- the objectURI
, cannot benull
- Returns:
- the project which contains object with provided
URI
ornull
if object is out of any project
-
getProject
public org.eclipse.core.resources.IProject getProject(org.eclipse.emf.ecore.EObject object) Description copied from interface:IResourceLookup
Returns project which contains object with provided model object. Can returnnull
if project not found.- Specified by:
getProject
in interfaceIResourceLookup
- Parameters:
object
- the model object, cannot benull
- Returns:
- the project which contains object with provided model object, or
null
if model object is out of any project
-
getDtProject
Description copied from interface:IResourceLookup
Returns project which contains object with provided model object. Can returnnull
if project not found.- Specified by:
getDtProject
in interfaceIResourceLookup
- Parameters:
object
- the model object, cannot benull
- Returns:
- the project which contains object with provided model object, or
null
if model object is out of any project
-
getProject
public org.eclipse.core.resources.IProject getProject(org.eclipse.emf.ecore.resource.Resource resource) Description copied from interface:IResourceLookup
Returns project which contains object with provided model object resource. Can returnnull
if project not found.- Specified by:
getProject
in interfaceIResourceLookup
- Parameters:
resource
- the model resource, cannot benull
- Returns:
- the project which contains object with provided model object resource, or
null
if model resource is out of any project
-
getDtProject
Description copied from interface:IResourceLookup
Returns project which contains object with provided model object resource. Can returnnull
if project not found.- Specified by:
getDtProject
in interfaceIResourceLookup
- Parameters:
resource
- the model resource, cannot benull
- Returns:
- the
IDtProject
which contains object with provided model object resource, ornull
if model resource is out of any project
-
getDtProject
Description copied from interface:IResourceLookup
Returns project which contains object with providedURI
. Can returnnull
if project not found. This method returnsIDtProject
only for active workspace DT projects and not overlay/virtual ones (as URI it's doesn't provide enough resolution for their addressing)- Specified by:
getDtProject
in interfaceIResourceLookup
- Parameters:
uri
- the objectURI
, cannot benull
- Returns:
- the project which contains object with provided
URI
ornull
if object is out of any project
-
init
-
dispose
-
getProjectName
Gets project name fromURI
.This implementation supports "platform" and "bm"
URI
schemes.- Parameters:
uri
-URI
(notnull
)- Returns:
- project name, or null if
URI
not platform orURI
object not in configuration
-