Package org.eclipse.core.resources

Examples of org.eclipse.core.resources.IResourceProxyVisitor


         
          final char[][] inclusionPatterns = ((ClasspathEntry) entry).fullInclusionPatternChars();
          final char[][] exclusionPatterns = ((ClasspathEntry) entry).fullExclusionPatternChars();
          if (max == 0) {
            sourceFolder.accept(
              new IResourceProxyVisitor() {
                public boolean visit(IResourceProxy proxy) {
                  if (isCancelled) return false;
                  switch(proxy.getType()) {
                    case IResource.FILE :
                      if (org.aspectj.org.eclipse.jdt.internal.core.util.Util.isJavaLikeFileName(proxy.getName())) {
                        IFile file = (IFile) proxy.requestResource();
                        if (exclusionPatterns != null || inclusionPatterns != null)
                          if (Util.isExcluded(file, inclusionPatterns, exclusionPatterns))
                            return false;
                        indexedFileNames.put(Util.relativePath(file.getFullPath(), 1/*remove project segment*/), file);
                      }
                      return false;
                    case IResource.FOLDER :
                      if (exclusionPatterns != null && inclusionPatterns == null) {
                        // if there are inclusion patterns then we must walk the children
                        if (Util.isExcluded(proxy.requestFullPath(), inclusionPatterns, exclusionPatterns, true))
                            return false;
                      }
                      if (hasOutputs && outputs.contains(proxy.requestFullPath()))
                        return false;
                  }
                  return true;
                }
              },
              IResource.NONE
            );
          } else {
            sourceFolder.accept(
              new IResourceProxyVisitor() {
                public boolean visit(IResourceProxy proxy) throws CoreException {
                  if (isCancelled) return false;
                  switch(proxy.getType()) {
                    case IResource.FILE :
                      if (org.aspectj.org.eclipse.jdt.internal.core.util.Util.isJavaLikeFileName(proxy.getName())) {
View Full Code Here


      final IPath container = this.containerPath;
      final IndexManager indexManager = this.manager;
      final SourceElementParser parser = indexManager.getSourceElementParser(JavaCore.create(this.project), null/*requestor will be set by indexer*/);
      if (this.exclusionPatterns == null && this.inclusionPatterns == null) {
        folder.accept(
          new IResourceProxyVisitor() {
            public boolean visit(IResourceProxy proxy) /* throws CoreException */{
              if (proxy.getType() == IResource.FILE) {
                if (org.aspectj.org.eclipse.jdt.internal.core.util.Util.isJavaLikeFileName(proxy.getName()))
                  indexManager.addSource((IFile) proxy.requestResource(), container, parser);
                return false;
              }
              return true;
            }
          },
          IResource.NONE
        );
      } else {
        folder.accept(
          new IResourceProxyVisitor() {
            public boolean visit(IResourceProxy proxy) /* throws CoreException */{
              switch(proxy.getType()) {
                case IResource.FILE :
                  if (org.aspectj.org.eclipse.jdt.internal.core.util.Util.isJavaLikeFileName(proxy.getName())) {
                    IResource resource = proxy.requestResource();
View Full Code Here

      int max = paths == null ? 0 : paths.length;
      final SimpleLookupTable indexedFileNames = new SimpleLookupTable(max==0 ? 33 : max+11);
      final String OK = "OK"; //$NON-NLS-1$
      final String DELETED = "DELETED"; //$NON-NLS-1$
      if (paths == null) {
        this.folder.accept(new IResourceProxyVisitor() {
          public boolean visit(IResourceProxy proxy) {
            if (isCancelled) return false;
            if (proxy.getType() == IResource.FILE) {
              if (org.aspectj.org.eclipse.jdt.internal.compiler.util.Util.isClassFileName(proxy.getName())) {
                IFile file = (IFile) proxy.requestResource();
                String containerRelativePath = Util.relativePath(file.getFullPath(), containerPath.segmentCount());
                indexedFileNames.put(containerRelativePath, file);
              }
              return false;
            }
            return true;
          }
        }, IResource.NONE);
      } else {
        for (int i = 0; i < max; i++) {
          indexedFileNames.put(paths[i], DELETED);
        }
        final long indexLastModified = index.getIndexFile().lastModified();
        this.folder.accept(
          new IResourceProxyVisitor() {
            public boolean visit(IResourceProxy proxy) throws CoreException {
              if (isCancelled) return false;
              if (proxy.getType() == IResource.FILE) {
                if (org.aspectj.org.eclipse.jdt.internal.compiler.util.Util.isClassFileName(proxy.getName())) {
                  IFile file = (IFile) proxy.requestResource();
View Full Code Here

    @Override
    public Change createChange(IProgressMonitor pm) throws CoreException, OperationCanceledException {
        final Map<IFile,TextChange> fileChanges = new HashMap<IFile,TextChange>();

        IResourceProxyVisitor visitor = new IResourceProxyVisitor() {
            public boolean visit(IResourceProxy proxy) throws CoreException {
                if ((proxy.getType() == IResource.FOLDER) || (proxy.getType() == IResource.PROJECT)) {
                    return true;
                }
View Full Code Here

        final IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(selectedProjectName);

        final List<IResource> bndFiles = new ArrayList<IResource>();

        try {
            project.accept(new IResourceProxyVisitor() {

                public boolean visit(IResourceProxy res) throws CoreException {
                    if (res.getType() == IResource.FILE && res.getName().endsWith(".bnd")) {
                        bndFiles.add(res.requestResource());
                    }
View Full Code Here

      int max = paths == null ? 0 : paths.length;
      final SimpleLookupTable indexedFileNames = new SimpleLookupTable(max==0 ? 33 : max+11);
      final String OK = "OK"; //$NON-NLS-1$
      final String DELETED = "DELETED"; //$NON-NLS-1$
      if (paths == null) {
        this.folder.accept(new IResourceProxyVisitor() {
          public boolean visit(IResourceProxy proxy) {
            if (IndexBinaryFolder.this.isCancelled) return false;
            if (proxy.getType() == IResource.FILE) {
              if (org.eclipse.jdt.internal.compiler.util.Util.isClassFileName(proxy.getName())) {
                IFile file = (IFile) proxy.requestResource();
                String containerRelativePath = Util.relativePath(file.getFullPath(), IndexBinaryFolder.this.containerPath.segmentCount());
                indexedFileNames.put(containerRelativePath, file);
              }
              return false;
            }
            return true;
          }
        }, IResource.NONE);
      } else {
        for (int i = 0; i < max; i++) {
          indexedFileNames.put(paths[i], DELETED);
        }
        final long indexLastModified = index.getIndexFile().lastModified();
        this.folder.accept(
          new IResourceProxyVisitor() {
            public boolean visit(IResourceProxy proxy) throws CoreException {
              if (IndexBinaryFolder.this.isCancelled) return false;
              if (proxy.getType() == IResource.FILE) {
                if (org.eclipse.jdt.internal.compiler.util.Util.isClassFileName(proxy.getName())) {
                  IFile file = (IFile) proxy.requestResource();
View Full Code Here

          final char[][] inclusionPatterns = ((ClasspathEntry) entry).fullInclusionPatternChars();
          final char[][] exclusionPatterns = ((ClasspathEntry) entry).fullExclusionPatternChars();
          if (max == 0) {
            sourceFolder.accept(
              new IResourceProxyVisitor() {
                public boolean visit(IResourceProxy proxy) {
                  if (IndexAllProject.this.isCancelled) return false;
                  switch(proxy.getType()) {
                    case IResource.FILE :
                      if (org.eclipse.jdt.internal.core.util.Util.isJavaLikeFileName(proxy.getName())) {
                        IFile file = (IFile) proxy.requestResource();
                        if (exclusionPatterns != null || inclusionPatterns != null)
                          if (Util.isExcluded(file, inclusionPatterns, exclusionPatterns))
                            return false;
                        indexedFileNames.put(Util.relativePath(file.getFullPath(), 1/*remove project segment*/), file);
                      }
                      return false;
                    case IResource.FOLDER :
                      if (exclusionPatterns != null && inclusionPatterns == null) {
                        // if there are inclusion patterns then we must walk the children
                        if (Util.isExcluded(proxy.requestFullPath(), inclusionPatterns, exclusionPatterns, true))
                            return false;
                      }
                      if (hasOutputs && outputs.contains(proxy.requestFullPath()))
                        return false;
                  }
                  return true;
                }
              },
              IResource.NONE
            );
          } else {
            sourceFolder.accept(
              new IResourceProxyVisitor() {
                public boolean visit(IResourceProxy proxy) throws CoreException {
                  if (IndexAllProject.this.isCancelled) return false;
                  switch(proxy.getType()) {
                    case IResource.FILE :
                      if (org.eclipse.jdt.internal.core.util.Util.isJavaLikeFileName(proxy.getName())) {
View Full Code Here

    super.stop(context);
  }

    private void findSourceFolders() throws CoreException{
      IWorkspace workspace = ResourcesPlugin.getWorkspace();
    workspace.getRoot().accept(new IResourceProxyVisitor() {
      public boolean visit(IResourceProxy proxy) throws CoreException {
        if (proxy.getType() == IResource.FOLDER &&
            isSourceFolder(proxy.requestResource())){
          return true;
        }
View Full Code Here

  protected IStatus run(IProgressMonitor monitor) {
    IStatus status = Status.OK_STATUS;
    try {
      // find each pex and parse it
      final List<IFile> pexFiles = new ArrayList<IFile>();
      project.accept(new IResourceProxyVisitor() {
        public boolean visit(IResourceProxy proxy) throws CoreException {
          if (proxy.getType() == IResource.FILE) {
            IFile file = (IFile) proxy.requestResource();
            if (file.getLocation().getFileExtension() != null
                && file.getLocation().getFileExtension().matches("pex") &&
View Full Code Here

  protected void fillContentProvider(AbstractContentProvider provider,
      ItemsFilter filter, IProgressMonitor monitor) throws CoreException {
    availablePlans = new ArrayList<String>(ToolPlan.forteLibrariesSet);
   
    try {
      ResourcesPlugin.getWorkspace().getRoot().accept(new IResourceProxyVisitor() {
        public boolean visit(IResourceProxy proxy) throws CoreException {
          if (proxy.getType() == IResource.FILE) {
            IFile file = (IFile) proxy.requestResource();
                  if (file.getLocation().getFileExtension() != null && file.getLocation().getFileExtension().matches("pex")) {
                    String planName = file.getName().substring(0, file.getName().lastIndexOf('.'));
View Full Code Here

TOP

Related Classes of org.eclipse.core.resources.IResourceProxyVisitor

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.