Package org.eclipse.core.resources

Examples of org.eclipse.core.resources.IResourceProxyVisitor


      if (model == null){

        try {
          final List<IFolder> planFolderList = new ArrayList<IFolder>();
          project.accept(new IResourceProxyVisitor() {

            @Override
            public boolean visit(IResourceProxy proxy) throws CoreException {
              if ((proxy.getType() == IResource.FOLDER  &&
                  proxy.getName().equalsIgnoreCase(name))){
View Full Code Here


          final Map<String, RepositoryComponent> list = FScript.getFScript(project).ListWorkspaceChanges();
          QualifiedName partner = RepositoryPropertiesManager.getSyncQualifiedName(project);
          syncronizer.add(partner);
          syncronizer.flushSyncInfo(partner, project, IResource.DEPTH_INFINITE);
          final List<IFile> components = 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(ToolNature.COMPONENT_EXTENSIONS)) {
                  components.add(file);
View Full Code Here

  @Override
  protected void fillContentProvider(AbstractContentProvider provider,
      ItemsFilter filter, IProgressMonitor monitor) throws CoreException {
    final List<IFile> files = new ArrayList<IFile>();
    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("cla|CLA|wcl|WCL|ifc|IFC")) {
              files.add(file);
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

   */
  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

    final Collection<IFile> validateFiles = new LinkedList<IFile>();
   
    if (kind == FULL_BUILD) {
     
      deleteValidationMarkers(getProject());
      getProject().accept(new IResourceProxyVisitor() {
         
        public boolean visit(IResourceProxy proxy) throws CoreException {
          if (!proxy.isDerived()) {
           
            String filename = proxy.requestFullPath().getFileExtension();
View Full Code Here

          final IResource resource = (IResource) actualParent;
          final List<IResource> list = new ArrayList<IResource>();
          IContainer lproj = resource.getParent();
          if (lproj != null && "lprog".equals(lproj.getFileExtension())) {
            IContainer p = lproj.getParent();
            p.accept(new IResourceProxyVisitor() {
 
              public boolean visit(IResourceProxy proxy) throws CoreException {
                if (proxy.getName().endsWith(".lproj")) {
                  IContainer f = (IContainer) proxy.requestResource();
                  IResource m = f.findMember(resource.getName());
View Full Code Here

        if (result == null)
            return new IFile[0];
        while (resources.hasNext()) {
            IResource resource = (IResource) resources.next();
            try {
                resource.accept(new IResourceProxyVisitor() {
                    public boolean visit(IResourceProxy proxy) throws CoreException {
                        if (proxy.getType() == IResource.FILE) {
                            IResource file = proxy.requestResource();
                            if (result.getMatchCount(file) > 0) {
                                files.add(file);
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

          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

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.