Examples of IResourceDescription


Examples of org.eclipse.xtext.resource.IResourceDescription

        if(eReference!= null) {
          EClassifier eType = eReference.getEType();
          if(eType == XdocPackage.Literals.CHAPTER_REF || eType == XdocPackage.Literals.SECTION_REF || eType == XdocPackage.Literals.SECTION2_REF
              || eType == XdocPackage.Literals.CODE_BLOCK) {
            URI targetFile = referenceDescription.getTargetEObjectUri().trimFragment();
            IResourceDescription nextCand = context.getResourceDescription(targetFile);
            if(!checked.contains(nextCand))
              if(desc(exportedNames, nextCand, context, checked))
                return true;
          }
        }
View Full Code Here

Examples of org.eclipse.xtext.resource.IResourceDescription

    // : sourceContainer.getEObjectURI();

    final URI eObjectURI = (containerEObjectURI == null)
        ? referenceDescription.getSourceEObjectUri()
        : containerEObjectURI;
    IResourceDescription resourceDescription = resourceDescriptions.getResourceDescription(eObjectURI.trimFragment());
    if(resourceDescription != null) {
      ReferenceSearchViewTreeNode resourceNode = resourceNode(resourceDescription, isUpdateViewer);
      ReferenceSearchViewTreeNode referenceNode = null;
      for(IEObjectDescription eObjectDescription : resourceDescription.getExportedObjects()) {
        if(eObjectDescription.getEObjectURI().equals(eObjectURI)) {
          referenceNode = new ReferenceSearchViewTreeNode(
            resourceNode, referenceDescription, eObjectDescription);
          break;
        }
View Full Code Here

Examples of org.eclipse.xtext.resource.IResourceDescription

   */
  @Override
  public void build(IBuildContext context, IProgressMonitor monitor) throws CoreException {

    for(IResourceDescription.Delta delta : context.getDeltas()) {
      IResourceDescription resourceDescription = delta.getNew();
      if(resourceDescription != null) {
        URI uri = resourceDescription.getURI();
        if(uri != null) {
          if("pp".equals(uri.fileExtension())) {
            Resource r = context.getResourceSet().getResource(uri, true);
            List<PPTask> taskList = getTaskList(r);
            syncTasks(taskList, uri);
View Full Code Here

Examples of org.eclipse.xtext.resource.IResourceDescription

    // clear names remembered in the past
    PPImportedNamesAdapter importedNames = PPImportedNamesAdapterFactory.eINSTANCE.adapt(resource);
    importedNames.clear();

    IResourceDescriptions descriptionIndex = indexProvider.getResourceDescriptions(resource);
    IResourceDescription descr = descriptionIndex.getResourceDescription(resource.getURI());

    if(descr == null) {
      if(tracer.isTracing()) {
        tracer.trace("Cleaning resource: " + resource.getURI().path());
      }
View Full Code Here

Examples of org.eclipse.xtext.resource.IResourceDescription

      }
    }
  }

  protected Iterable<IEObjectDescription> getExportedElements(Resource resource) {
    IResourceDescription resourceDescription = index.getResourceDescription(EcoreUtil2.getNormalizedURI(resource));
    if(resourceDescription != null)
      return resourceDescription.getExportedObjects();
    return emptyIterable;
  }
View Full Code Here

Examples of org.eclipse.xtext.resource.IResourceDescription

  private List<IEObjectDescription> exportedPatternVariables;

  private void buildExportedObjectsIndex(IResourceDescription descr, IResourceDescriptions descriptionIndex) {
    // The current (possibly dirty) exported resources
    IResourceDescription dirty = resourceServiceProvider.getResourceDescriptionManager().getResourceDescription(
      resource);
    String pathToCurrent = resource.getURI().path();

    Multimap<String, IEObjectDescription> map = ArrayListMultimap.create();
    List<IEObjectDescription> patternedVariables = Lists.newArrayList();
    // add all (possibly dirty in global index)
    // check for empty qualified names which may be present in case of syntax errors / while editing etc.
    // empty names are simply skipped (they can not be found anyway).
    //
    for(IEObjectDescription d : dirty.getExportedObjects())
      if(d.getQualifiedName().getSegmentCount() >= 1)
        map.put(d.getQualifiedName().getLastSegment(), d);
    // add all from global index, except those for current resource
    for(IEObjectDescription d : getExportedObjects(descr, descriptionIndex))
      if(!d.getEObjectURI().path().equals(pathToCurrent) && d.getQualifiedName().getSegmentCount() >= 1) {
View Full Code Here

Examples of org.eclipse.xtext.resource.IResourceDescription

    metaVarCache = Maps.newHashMap();

    Resource scopeDetermeningResource = scopeDetermeningObject.eResource();

    IResourceDescriptions descriptionIndex = indexProvider.getResourceDescriptions(scopeDetermeningResource);
    IResourceDescription descr = descriptionIndex.getResourceDescription(scopeDetermeningResource.getURI());
    if(descr == null)
      return; // give up - some sort of clean build
    EClass wantedType = PPTPPackage.Literals.TYPE_ARGUMENT;
    for(IContainer visibleContainer : manager.getVisibleContainers(descr, descriptionIndex)) {
      for(IEObjectDescription objDesc : visibleContainer.getExportedObjects()) {
View Full Code Here

Examples of org.eclipse.xtext.resource.IResourceDescription

  }

  public void configure(Resource r) {
    resource = r;
    IResourceDescriptions descriptionIndex = indexProvider.getResourceDescriptions(resource);
    IResourceDescription descr = descriptionIndex.getResourceDescription(resource.getURI());

    // Happens during start/clean in some state
    if(descr == null)
      return;
    manager = resourceServiceProvider.getContainerManager();
View Full Code Here

Examples of org.eclipse.xtext.resource.IResourceDescription

      // GIVE UP (the system is cleaning / is in bad state).
      if(resource == null || scopeDetermeningResource == null)
        return new SearchResult(targets, targets);

      IResourceDescriptions descriptionIndex = indexProvider.getResourceDescriptions(scopeDetermeningResource);
      IResourceDescription descr = descriptionIndex.getResourceDescription(scopeDetermeningResource.getURI());

      // GIVE UP (the system is performing a build clean).
      if(descr == null)
        return new SearchResult(targets, targets);
      QualifiedName nameOfScope = getNameOfScope(scopeDetermeningObject);
View Full Code Here

Examples of org.eclipse.xtext.resource.IResourceDescription

    }

  }

  public void listVisibleResources(Resource myResource, IResourceDescriptions index) {
    IResourceDescription descr = index.getResourceDescription(myResource.getURI());
    for(IContainer visibleContainer : manager.getVisibleContainers(descr, index)) {
      for(IResourceDescription visibleResourceDesc : visibleContainer.getResourceDescriptions()) {
        for(IEObjectDescription objDesc : visibleResourceDesc.getExportedObjects())
          System.out.println("\texported: " + converter.toString(objDesc.getQualifiedName()) + " type: " +
              objDesc.getEClass().getName());
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.