Package org.eclipse.core.resources

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


    try {
      IProject currProject = getProject();
      IWorkspaceRoot wsroot = ResourcesPlugin.getWorkspace().getRoot();
      IResource init = null;
      if (params.getRoot() != null) {
        init = wsroot.findMember(currProject.getName() + params.getRoot());
      }
      Class[] acceptedClasses = new Class[] { IProject.class, IFolder.class };
      ISelectionStatusValidator validator = new TypedElementSelectionValidator(acceptedClasses, false);
      IProject[] allProjects = wsroot.getProjects();
      ArrayList<IProject> rejectedElements = new ArrayList<IProject>(allProjects.length);
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

            continue;
          }
          IWorkspace workspace = ResourcesPlugin.getWorkspace();
          IWorkspaceRoot root = workspace.getRoot();
          IPath makeRelativeTo = path.makeRelativeTo(root.getLocation());
          IResource resource = root.findMember(makeRelativeTo);

          try {
            if (resource != null) {
              resource.getParent()
                      .refreshLocal(IResource.DEPTH_INFINITE, new NullProgressMonitor());
View Full Code Here

    }

    private void doFinish(String containerName, String fileName, IProgressMonitor monitor) throws CoreException {
        monitor.beginTask("Creating " + fileName, 2);
        IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
        IResource resource = root.findMember(new Path(containerName));

        if (!resource.exists() || !(resource instanceof IContainer)) {
            throwCoreException("Container \"" + containerName + "\" does not exist.");
        }
View Full Code Here

    rootDir = event.getParameter(ROOT_PARAM_NAME);
    projectName = event.getParameter(PROJECT_NAME_PARAM_NAME);
   
   
    IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
    IResource resource = root.findMember(new Path(rootDir));
    if (!resource.exists() || !(resource instanceof IContainer)) {
      throw new ExecutionException("Container \"" + rootDir + "\" does not exist.");
    }
   
    IContainer container = (IContainer) resource;
View Full Code Here

    String filename = null;
    directory = event.getParameter(DIR_PARAM_NAME);
    filename = event.getParameter(FILENAME_PARAM_NAME);
   
    IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
    IResource resource = root.findMember(new Path(directory));
    if (!resource.exists() || !(resource instanceof IContainer)) {
      throw new ExecutionException("Container \"" + directory + "\" does not exist.");
    }
   
    IContainer container = (IContainer) resource;
View Full Code Here

        {
            for( IClasspathEntry cpe : project.getRawClasspath() )
            {
                if( cpe.getEntryKind() == IClasspathEntry.CPE_SOURCE )
                {
                    final IResource sourceFolderResource = root.findMember( cpe.getPath() );
                   
                    if( sourceFolderResource instanceof IContainer )
                    {
                        sourceFolders.add( (IContainer) sourceFolderResource );
                    }
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.