Package org.eclipse.core.resources

Examples of org.eclipse.core.resources.IWorkspaceRoot.findMember()


                    }

                    //Now, try to get it knowing that it's properly synched (it may still not be there, but at least we tried it)
                    try {
                        r = root.findMember(p);
                    } catch (Exception e) {
                        Log.log(e);
                    }
                }
View Full Code Here


            IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();

            for (String path : projectSourcePathSet) {
                if (path.trim().length() > 0) {
                    IPath p = new Path(path);
                    IResource resource = root.findMember(p);
                    if (resource == null) {
                        relatedToProject.refreshLocal(p.segmentCount(), null);
                        resource = root.findMember(p); //2nd attempt (after refresh)
                    }
                    if (resource == null || !resource.exists()) {
View Full Code Here

                if (path.trim().length() > 0) {
                    IPath p = new Path(path);
                    IResource resource = root.findMember(p);
                    if (resource == null) {
                        relatedToProject.refreshLocal(p.segmentCount(), null);
                        resource = root.findMember(p); //2nd attempt (after refresh)
                    }
                    if (resource == null || !resource.exists()) {
                        lst.add(new ProjectConfigError(relatedToProject, "Source folder: " + path + " not found"));
                    }
                }
View Full Code Here

            return "The source folder was not correctly validated.";
        }

        IPath path = validatedSourceFolder.getFullPath().append(text);
        IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
        IResource resource = root.findMember(path);
        if (resource == null) {
            packageText = initialText;
            labelWarningImageWillCreate.setVisible(true);
            labelWarningWillCreate.setVisible(true);
            labelWarningWillCreate.getParent().layout();
View Full Code Here

        validatedSourceFolder = null;
        if (text == null || text.trim().length() == 0) {
            return "The source folder must be filled.";
        }
        IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
        IResource resource = root.findMember(new Path(text));
        if (resource == null) {
            return "The source folder was not found in the workspace.";
        }
        if (!(resource instanceof IContainer)) {
            return "The source folder was found in the workspace but is not a container.";
View Full Code Here

              projectsInCycle = new IJavaProject[cycleParticipants.size()];
              Iterator it = cycleParticipants.iterator();
              int k = 0;
              while (it.hasNext()) {
                //projectsInCycle[i++] = (IPath) it.next();
                IResource member = workspaceRoot.findMember((IPath) it.next());
                if (member != null && member.getType() == IResource.PROJECT){
                  projectsInCycle[k] = JavaCore.create((IProject)member);
                  if (projectsInCycle[k] != null) {
                    if (k != 0) cycleString += ", "; //$NON-NLS-1$
                    cycleString += projectsInCycle[k++].getElementName();
View Full Code Here

        ClasspathEntry combinedEntry = entry.combineWith(referringEntry);
        accumulatedEntries.add(combinedEntry);

        // recurse in project to get all its indirect exports (only consider exported entries from there on)
        if (entry.getEntryKind() == IClasspathEntry.CPE_PROJECT) {
          IResource member = workspaceRoot.findMember(entry.getPath());
          if (member != null && member.getType() == IResource.PROJECT){ // double check if bound to project (23977)
            IProject projRsc = (IProject) member;
            if (JavaProject.hasJavaNature(projRsc)) {
              JavaProject javaProject = (JavaProject) JavaCore.create(projRsc);
              javaProject.computeExpandedClasspath(
View Full Code Here

      case IClasspathEntry.CPE_PROJECT :

        if (!retrieveExportedRoots) return;
        if (referringEntry != null && !resolvedEntry.isExported()) return;

        IResource member = workspaceRoot.findMember(entryPath);
        if (member != null && member.getType() == IResource.PROJECT){// double check if bound to project (23977)
          IProject requiredProjectRsc = (IProject) member;
          if (JavaProject.hasJavaNature(requiredProjectRsc)){ // special builder binary output
            rootIDs.add(rootID);
            JavaProject requiredProject = (JavaProject)JavaCore.create(requiredProjectRsc);
View Full Code Here

    if (path.getDevice() != null || JavaModel.getExternalTarget(path, true/*check existence*/) != null) {
      // external path
      return getPackageFragmentRoot0(path);
    }
    IWorkspaceRoot workspaceRoot = this.project.getWorkspace().getRoot();
    IResource resource = workspaceRoot.findMember(path);
    if (resource == null) {
      // resource doesn't exist in workspace
      if (path.getFileExtension() != null) {
        if (!workspaceRoot.getProject(path.segment(0)).exists()) {
          // assume it is an external ZIP archive
View Full Code Here

      IWorkspaceRoot root = this.project.getWorkspace().getRoot();
      for (int i = 0; i < sourceEntriesNumber; i++) {
        if (this.isCancelled) return false;

        IClasspathEntry entry = sourceEntries[i];
        IResource sourceFolder = root.findMember(entry.getPath());
        if (sourceFolder != null) {

          // collect output locations if source is project (see http://bugs.eclipse.org/bugs/show_bug.cgi?id=32041)
          final HashSet outputs = new HashSet();
          if (sourceFolder.getType() == IResource.PROJECT) {
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.