Examples of IResourceVisitor


Examples of org.eclipse.core.resources.IResourceVisitor

                    });
                }
            } else if (event.getType() == IResourceChangeEvent.PRE_DELETE) {
                IResource resource = event.getResource();
                if (resource != null) {
                    resource.accept(new IResourceVisitor() {
                        public boolean visit(IResource resource) throws CoreException {
                            removeElementsFromResource(resource);
                            return true;
                        }
                    });
                }
            } else if (event.getType() == IResourceChangeEvent.PRE_CLOSE) {
                IResource resource = event.getResource();
                if (resource != null) {
                    resource.accept(new IResourceVisitor() {
                        public boolean visit(IResource resource) throws CoreException {
                            removeElementsFromResource(resource);
                            return true;
                        }
                    });
View Full Code Here

Examples of org.eclipse.core.resources.IResourceVisitor

                    });
                }
            } else if (event.getType() == IResourceChangeEvent.PRE_DELETE) {
                IResource resource = event.getResource();
                if (resource != null) {
                    resource.accept(new IResourceVisitor() {
                        public boolean visit(IResource resource) throws CoreException {
                            removeElementsFromResource(resource);
                            return true;
                        }
                    });
                }
            } else if (event.getType() == IResourceChangeEvent.PRE_CLOSE) {
                IResource resource = event.getResource();
                if (resource != null) {
                    resource.accept(new IResourceVisitor() {
                        public boolean visit(IResource resource) throws CoreException {
                            removeElementsFromResource(resource);
                            return true;
                        }
                    });
View Full Code Here

Examples of org.eclipse.core.resources.IResourceVisitor

  @Override
  public Map<String, ConfigurationData> getConfigurations(final IProject project)
      throws CoreException {
    final Map<String, ConfigurationData> configurationPaths = Maps.newHashMap();
    final BasePaths basePaths = new BasePaths(project.getLocation().toFile());
    project.accept(new IResourceVisitor() {
        @SuppressWarnings("unused") // interface requires the exception to be visible.
        @Override
      public boolean visit(IResource resource) throws CoreException {
        if (resource.getName().endsWith(".conf") || resource.getName().endsWith(".jstd")) {
          // get the path relative to the project.
View Full Code Here

Examples of org.eclipse.core.resources.IResourceVisitor

                    });
                }
            } else if (event.getType() == IResourceChangeEvent.PRE_DELETE) {
                IResource resource = event.getResource();
                if (resource != null) {
                    resource.accept(new IResourceVisitor() {
                        public boolean visit(IResource resource) throws CoreException {
                            removeElementsFromResource(resource);
                            return true;
                        }
                    });
                }
            } else if (event.getType() == IResourceChangeEvent.PRE_CLOSE) {
                IResource resource = event.getResource();
                if (resource != null) {
                    resource.accept(new IResourceVisitor() {
                        public boolean visit(IResource resource) throws CoreException {
                            removeElementsFromResource(resource);
                            return true;
                        }
                    });
View Full Code Here

Examples of org.eclipse.core.resources.IResourceVisitor

        members = ResourcesPlugin.getWorkspace().getRoot().members();
        for (int i = 0; i < members.length; i++) {
          final IResource member = members[i];

          if (member.isAccessible()) {
            member.getProject().accept(new IResourceVisitor() {

              public boolean visit(final IResource resource) throws CoreException {
                if (resource.getName().equals(filename)) {
                  file = ResourcesPlugin.getWorkspace().getRoot().findFilesForLocationURI(resource.getLocationURI())[0];
                }
View Full Code Here

Examples of org.eclipse.core.resources.IResourceVisitor

                    path, projectName, foundUrl, expected.url);
                logIllegalStateException(msg);
                illegalState = true;
            }
        }
        IResourceVisitor visitor = new IResourceVisitor() {
            boolean result = false;

            public boolean visit(IResource resource) {
                if (resource == null)
                    return result;
                IPath path = resource.getProjectRelativePath();
                String assMsg = MessageFormat.format(
                    Messages.SharedProject_path_is_null, resource);
                assert path != null : assMsg;
                if (!contains(resource)) {
                    final String msg = format(
                        Messages.SharedProject_resource_map_does_not_contain,
                        projectName, path.toString());
                    logIllegalStateException(msg);
                    result = true;
                    add(resource);
                    if (vcs != null) {
                        final VCSResourceInfo info = vcs
                            .getResourceInfo(resource);
                        updateRevision(resource, info.revision);
                        updateVcsUrl(resource, info.url);
                    }
                }
                return true;
            }
        };
        try {
            project.accept(visitor, IResource.DEPTH_INFINITE,
                IContainer.EXCLUDE_DERIVED);
            illegalState = illegalState || visitor.visit(null);
        } catch (CoreException e) {
            return false;
        }
        return !illegalState;
    }
View Full Code Here

Examples of org.eclipse.core.resources.IResourceVisitor

        }
      }
    }

    IFolder moduleFolder = (IFolder) sourceFolder.getCorrespondingResource();
    moduleFolder.accept(new IResourceVisitor() {

      public boolean visit(IResource resource) throws CoreException {

        if (Util.isModuleXml(resource)) {
          try {
View Full Code Here

Examples of org.eclipse.core.resources.IResourceVisitor

  }

  private void jarFolder(final JarOutputStream d,
      final BufferedOutputStream b, final IFolder folder)
      throws CoreException {
    folder.accept(new IResourceVisitor() {

      @Override
      public boolean visit(IResource resource) throws CoreException {
        if (resource.getType() == IResource.FILE) {
          IPath removeFirstSegments = resource
View Full Code Here

Examples of org.eclipse.core.resources.IResourceVisitor

                ITagDirRecord record = (ITagDirRecord) reference;
                IPath path = record.getPath();
                IResource found = ResourcesPlugin.getWorkspace().getRoot().findMember(path, false);

                try {
                  found.accept(new IResourceVisitor() {
                    public boolean visit(IResource resource) throws CoreException {
                      if (resource.getType() == IResource.FILE) {
                        addDependsOn(resource);
                      }
                      return true;
                    }
                  });
                }
                catch (CoreException e) {
                  Logger.logException(e);
                }
              }
                break;
              case (ITaglibRecord.URL) : {
                IURLRecord record = (IURLRecord) reference;
                String baseLocation = record.getBaseLocation();
                if (baseLocation != null && baseLocation.indexOf("://") < 0) {
                  IResource found = ResourcesPlugin.getWorkspace().getRoot().findMember(baseLocation, false);
                  if (found != null) {
                    try {
                      found.accept(new IResourceVisitor() {
                        public boolean visit(IResource resource) throws CoreException {
                          if (resource.getType() == IResource.FILE) {
                            addDependsOn(resource);
                          }
                          return true;
View Full Code Here

Examples of org.eclipse.core.resources.IResourceVisitor

    public static void setReadOnly(IProject project, final boolean readonly,
        final IProgressMonitor monitor) {
        monitor.beginTask("Project settings ... ", IProgressMonitor.UNKNOWN);

        try {
            project.accept(new IResourceVisitor() {
                public boolean visit(IResource resource) throws CoreException {

                    // Don't set the project and derived
                    // files read-only
                    if (resource instanceof IProject || resource.isDerived())
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.