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
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    dispose(ProjectContext lifecycleContext)
     
    getDtProject(org.eclipse.emf.common.util.URI uri)
    Returns project which contains object with provided URI.
    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 resource IFile which contains object with provided model object URI.
    org.eclipse.core.resources.IFile
    getPlatformResource(org.eclipse.emf.ecore.EObject object)
    Returns workspace resource IFile which contains the provided model object.
    org.eclipse.core.resources.IFile
    getPlatformResource(org.eclipse.emf.ecore.resource.Resource resource)
    Returns workspace resource IFile which contains the provided model resource.
    org.eclipse.emf.common.util.URI
    getPlatformResourceUri(org.eclipse.emf.ecore.EObject object)
    Returns platform resource URI for the provided model object.
    org.eclipse.core.resources.IProject
    getProject(org.eclipse.emf.common.util.URI uri)
    Returns project which contains object with provided URI.
    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 from URI.
    void
    init(ProjectContext projectContext)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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 resource URI for the provided model object. Can return null if model object does not have associated platform URI.
      Specified by:
      getPlatformResourceUri in interface IResourceLookup
      Parameters:
      object - the model object, cannot be null
      Returns:
      the platform resource URI for the provided model object or null if object does not have associated platform URI
    • getPlatformResource

      public org.eclipse.core.resources.IFile getPlatformResource(org.eclipse.emf.ecore.EObject object)
      Description copied from interface: IResourceLookup
      Returns workspace resource IFile which contains the provided model object. Can return null if workspace resource file not found.
      Specified by:
      getPlatformResource in interface IResourceLookup
      Parameters:
      object - the model object, cannot be null
      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 resource IFile which contains the provided model resource. Can return null if workspace resource file not found.
      Specified by:
      getPlatformResource in interface IResourceLookup
      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 resource IFile which contains object with provided model object URI. Can return null if file not found.
      Specified by:
      getPlatformResource in interface IResourceLookup
      Parameters:
      uri - the object URI, cannot be null
      Returns:
      the file which contains object with provided URI or null 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 provided URI. Can return null if project not found.
      Specified by:
      getProject in interface IResourceLookup
      Parameters:
      uri - the object URI, cannot be null
      Returns:
      the project which contains object with provided URI or null 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 return null if project not found.
      Specified by:
      getProject in interface IResourceLookup
      Parameters:
      object - the model object, cannot be null
      Returns:
      the project which contains object with provided model object, or null if model object is out of any project
    • getDtProject

      public IDtProject getDtProject(org.eclipse.emf.ecore.EObject object)
      Description copied from interface: IResourceLookup
      Returns project which contains object with provided model object. Can return null if project not found.
      Specified by:
      getDtProject in interface IResourceLookup
      Parameters:
      object - the model object, cannot be null
      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 return null if project not found.
      Specified by:
      getProject in interface IResourceLookup
      Parameters:
      resource - the model resource, cannot be null
      Returns:
      the project which contains object with provided model object resource, or null if model resource is out of any project
    • getDtProject

      public IDtProject getDtProject(org.eclipse.emf.ecore.resource.Resource resource)
      Description copied from interface: IResourceLookup
      Returns project which contains object with provided model object resource. Can return null if project not found.
      Specified by:
      getDtProject in interface IResourceLookup
      Parameters:
      resource - the model resource, cannot be null
      Returns:
      the IDtProject which contains object with provided model object resource, or null if model resource is out of any project
    • getDtProject

      public IDtProject getDtProject(org.eclipse.emf.common.util.URI uri)
      Description copied from interface: IResourceLookup
      Returns project which contains object with provided URI. Can return null if project not found. This method returns IDtProject 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 interface IResourceLookup
      Parameters:
      uri - the object URI, cannot be null
      Returns:
      the project which contains object with provided URI or null if object is out of any project
    • init

      @LifecycleParticipant(phase=INITIALIZATION) public void init(ProjectContext projectContext)
    • dispose

      @LifecycleParticipant(phase=DISPOSING) public void dispose(ProjectContext lifecycleContext)
    • getProjectName

      protected String getProjectName(org.eclipse.emf.common.util.URI uri)
      Gets project name from URI.

      This implementation supports "platform" and "bm" URI schemes.

      Parameters:
      uri - URI (not null)
      Returns:
      project name, or null if URI not platform or URI object not in configuration