Package org.eclipse.php.internal.core.filenetwork

Examples of org.eclipse.php.internal.core.filenetwork.ReferenceTree


    return "/" + PROJECT + "/" + projectRelativePath;
  }

  public void testReferencingFiles() throws Exception {
    ISourceModule sourceModule = getSourceModule(getFilePath("test1/a.php"));
    ReferenceTree tree = FileNetworkUtility.buildReferencingFilesTree(
        sourceModule, null);
    assertContents(getSavedHierarchy("test1"), tree.toString());
  }
View Full Code Here


    assertContents(getSavedHierarchy("test1"), tree.toString());
  }

  public void testReferencedFiles() throws Exception {
    ISourceModule sourceModule = getSourceModule(getFilePath("test2/a.php"));
    ReferenceTree tree = FileNetworkUtility.buildReferencedFilesTree(
        sourceModule, null);
    assertContents(getSavedHierarchy("test2"), tree.toString());
  }
View Full Code Here

  public void testCachedReferencedFiles() throws Exception {
    ISourceModule sourceModule = getSourceModule(getFilePath("test2/a.php"));
    HashMap<ISourceModule, Node> cache = new HashMap<ISourceModule, Node>();

    ReferenceTree tree = FileNetworkUtility.buildReferencedFilesTree(
        sourceModule, cache, null);
    tree = FileNetworkUtility.buildReferencedFilesTree(sourceModule, cache,
        null);
    assertContents(getSavedHierarchy("test2"), tree.toString());
  }
View Full Code Here

    final ISourceModule sourceModule = (ISourceModule) DLTKCore
        .create(file);
    perfMonitor.execute("PerformanceTests.testReferencingfiles" + "_"
        + fileName, new Operation() {
      public void run() throws Exception {
        ReferenceTree tree = FileNetworkUtility
            .buildReferencingFilesTree(sourceModule, null);
        System.out.println(tree.toString());
      }
    }, 1, 10);
  }
View Full Code Here

    final ISourceModule sourceModule = (ISourceModule) DLTKCore
        .create(file);
    perfMonitor.execute("PerformanceTests.testReferencedfiles" + "_"
        + fileName, new Operation() {
      public void run() throws Exception {
        ReferenceTree tree = FileNetworkUtility
            .buildReferencedFilesTree(sourceModule, null);
        System.out.println(tree.toString());
      }
    }, 1, 10);
  }
View Full Code Here

    }
  }

  private IDLTKSearchScope createSearchScopeWithReferencedFiles(
      ISourceModule sourceModule) {
    ReferenceTree tree = FileNetworkUtility.buildReferencedFilesTree(
        sourceModule, null);
    Set<ISourceModule> list = new HashSet<ISourceModule>();
    list.add(sourceModule);
    if (tree != null && tree.getRoot() != null) {
      Collection<Node> allIncludedNodes = tree.getRoot().getChildren();
      if (allIncludedNodes != null) {
        getNodeChildren(tree.getRoot(), list);
      }
    }
    return BasicSearchEngine.createSearchScope(
        list.toArray(new ISourceModule[list.size()]),
        DLTKLanguageManager.getLanguageToolkit(sourceModule));
View Full Code Here

        if (sourceModule.equals(element.getOpenable())) {
          filteredElements.add(element);
        }
      }
      if (filteredElements.size() == 0) {
        ReferenceTree referenceTree;
        if (cache != null) {
          referenceTree = cache.getFileHierarchy(sourceModule,
              monitor);
        } else {
          // Filter by includes network
          referenceTree = FileNetworkUtility
              .buildReferencedFilesTree(sourceModule, monitor);
        }
        for (T element : elements) {
          if (LanguageModelInitializer
              .isLanguageModelElement(element)
              || referenceTree.find(((ModelElement) element)
                  .getSourceModule())) {
            filteredElements.add(element);
          }
        }
      }
View Full Code Here

          }
        } catch (ModelException e) {
        }
      }
      if (filteredElements.size() == 0) {
        ReferenceTree referenceTree;
        if (cache != null) {
          referenceTree = cache.getFileHierarchy(sourceModule,
              monitor);
        } else {
          // Filter by includes network
          referenceTree = FileNetworkUtility
              .buildReferencedFilesTree(sourceModule, monitor);
        }
        for (T element : elements) {
          if (LanguageModelInitializer
              .isLanguageModelElement(element)
              || referenceTree.find(((ModelElement) element)
                  .getSourceModule())) {
            try {
              if ((isNs
                  && PHPFlags.isNamespace(((IType) element)
                      .getFlags()) || !isNs
View Full Code Here

TOP

Related Classes of org.eclipse.php.internal.core.filenetwork.ReferenceTree

Copyright © 2018 www.massapicom. 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.