Package org.eclipse.core.resources

Examples of org.eclipse.core.resources.IResourceProxyVisitor


      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.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.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 (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.getIndexLastModified();
        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

  public boolean performAction() {
    if (idText.getText().length() == 0)
      return false;
    try {
      final List files = new ArrayList();
      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("xml|html|js|css")) {
View Full Code Here

    * @param resources
    *           resources that match
    */
   private void getMatchingResources(final ArrayList<IResource> resources) {
      try {
         container.accept(new IResourceProxyVisitor() {
            @Override
            public boolean visit(IResourceProxy proxy) {
               // optionally exclude derived resources (bugs 38085 and 81333)
               if (!getShowDerived() && proxy.isDerived()) {
                  return false;
View Full Code Here

     *
     * @param resources resources that match
     */
    private void getMatchingResources(final ArrayList resources) {
        try {
            container.accept(new IResourceProxyVisitor() {
                @Override
                public boolean visit(IResourceProxy proxy) {
                    // optionally exclude derived resources (bugs 38085 and 81333)
                    if (!getShowDerived() && proxy.isDerived()) {
                        return false;
View Full Code Here

  private void validateV1Project(IValidationContext helper, final IReporter reporter) {
    // if uris[] length 0 -> validate() gets called for each project
    if (helper instanceof IWorkbenchContext) {
      IProject project = ((IWorkbenchContext) helper).getProject();
      IResourceProxyVisitor visitor = new IResourceProxyVisitor() {
        public boolean visit(IResourceProxy proxy) throws CoreException {
          if (shouldValidate(proxy)) {
            validateV1File((IFile) proxy.requestResource(), reporter);
          }
          return true;
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.