Examples of IResourceVisitor


Examples of org.eclipse.core.resources.IResourceVisitor

          final Map<HitContainer, HashMap<IProject, Integer>> potentialProjects = new HashMap<HitContainer, HashMap<IProject, Integer>>();

          final Map<IProject, ArrayList<String>> locationSegments = new HashMap<IProject, ArrayList<String>>();

          try {
            workspaceRoot.accept(new IResourceVisitor() {
              @Override
              public boolean visit(IResource resource) throws CoreException {
                if (resource instanceof IWorkspaceRoot) {
                  return true;
                }
View Full Code Here

Examples of org.eclipse.core.resources.IResourceVisitor

  }

  private static <RES> List<RES> readFiles(ResourceMapping resourceMapping,
      final FileFilter<RES> fileFilter) {
    final List<RES> fileList = new ArrayList<RES>(1);
    IResourceVisitor visitor = new IResourceVisitor() {
      public boolean visit(IResource resource) throws CoreException {
        if (resource instanceof IFile == false) {
          return true;
        } else {
          IFile file = (IFile) resource;
View Full Code Here

Examples of org.eclipse.core.resources.IResourceVisitor

    }
  }

  private void search(IResource resource) throws CoreException
  {
    resource.accept(new IResourceVisitor()
    {
      @Override
      public boolean visit(IResource resource) throws CoreException
      {
        if (resource.getType() == IResource.FILE)
View Full Code Here

Examples of org.eclipse.core.resources.IResourceVisitor

     * @return All the IFiles below the current folder that are python files (does not check if it has an __init__ path)
     */
    public static List<IFile> getAllIFilesBelow(IContainer member) {
        final ArrayList<IFile> ret = new ArrayList<IFile>();
        try {
            member.accept(new IResourceVisitor() {

                public boolean visit(IResource resource) {
                    if (resource instanceof IFile) {
                        ret.add((IFile) resource);
                        return false; //has no members
View Full Code Here

Examples of org.eclipse.core.resources.IResourceVisitor

 
  private void createMarker(final String filename, final int line, final String message) {
    try {
//      System.out.println("(trying to) create a marker for " + filename);
      for (IFolder srcFolder: srcFolders.keySet()) {
        srcFolder.accept(new IResourceVisitor() {
          public boolean visit(IResource resource) throws CoreException {
            if (resource.getType() == IResource.FILE) {
//              System.out.println("    file found: " + resource.getName());
              if (resource.getName().equals(filename)) {
                Map attrs = new HashMap();
View Full Code Here

Examples of org.eclipse.core.resources.IResourceVisitor

  @Test
  public void testTrackFiles() throws Exception {

    final ArrayList<IFile> files = new ArrayList<IFile>();

    project.accept(new IResourceVisitor() {

      public boolean visit(IResource resource) throws CoreException {
        if (resource instanceof IFile)
          files.add((IFile) resource);
        return true;
View Full Code Here

Examples of org.eclipse.core.resources.IResourceVisitor

    final ArrayList<IContainer> containers = new ArrayList<IContainer>();
    containers.add(project);

    final ArrayList<IFile> files = new ArrayList<IFile>();

    project.accept(new IResourceVisitor() {

      public boolean visit(IResource resource) throws CoreException {
        if (resource instanceof IFile)
          files.add((IFile) resource);
        return true;
View Full Code Here

Examples of org.eclipse.core.resources.IResourceVisitor

   *
   * @param project
   * @throws CoreException
   */
  public void trackAllFiles(IProject project) throws CoreException {
    project.accept(new IResourceVisitor() {

      public boolean visit(IResource resource) throws CoreException {
        if (resource instanceof IFile) {
          try {
            track(EFS.getStore(resource.getLocationURI())
View Full Code Here

Examples of org.eclipse.core.resources.IResourceVisitor

    }
  }

  private void addExercises(IResource resource, final ResourceSet resourceSet) {
    try {
      resource.accept(new IResourceVisitor() {
        public boolean visit(IResource resource) throws CoreException {
          IPath path = resource.getFullPath();
          String pathString = path.toString();
          if (pathPrefix != null && (! pathString.startsWith(pathPrefix))) {
            return false;
View Full Code Here

Examples of org.eclipse.core.resources.IResourceVisitor

   
    try {
      for( IPackageFragmentRoot r : javaProject.getPackageFragmentRoots() ) {
        if( r.getCorrespondingResource() != null ) {
          final int count = r.getCorrespondingResource().getProjectRelativePath().segmentCount();
          r.getCorrespondingResource().accept(new IResourceVisitor() {
           
            @Override
            public boolean visit(IResource resource) throws CoreException {
              if (resource.getType() == IResource.FOLDER || resource.getType() == IResource.PROJECT) {
                return true;
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.