Package org.eclipse.core.runtime

Examples of org.eclipse.core.runtime.IPath.makeRelative()


    int rawLength = rawClasspath.length;
    HashSet pathes = new HashSet(rawLength);
    for (int i = 0 ; i < rawLength; i++) {
      IPath entryPath = rawClasspath[i].getPath();
      if (!pathes.add(entryPath)){
        String entryPathMsg = projectName.equals(entryPath.segment(0)) ? entryPath.removeFirstSegments(1).toString() : entryPath.makeRelative().toString();
        return new JavaModelStatus(IJavaModelStatusConstants.NAME_COLLISION, Messages.bind(Messages.classpath_duplicateEntryPath, new String[] {entryPathMsg, projectName}));
      }
    }

    // retrieve resolved classpath
View Full Code Here


        if (index == 0) {
          // custom output is nested in project's output: need to check if all source entries have a custom
          // output before complaining
          if (potentialNestedOutput == null) potentialNestedOutput = customOutput;
        } else {
          return new JavaModelStatus(IJavaModelStatusConstants.INVALID_CLASSPATH, Messages.bind(Messages.classpath_cannotNestOutputInOutput, new String[] {customOutput.makeRelative().toString(), outputLocations[index].makeRelative().toString()}));
        }
      }
    }
    // allow custom output nesting in project's output if all source entries have a custom output
    if (sourceEntryCount <= outputCount-1) {
View Full Code Here

      // no further check if entry coincidates with project or output location
      if (entryPath.equals(projectPath)){
        // complain if self-referring project entry
        if (kind == IClasspathEntry.CPE_PROJECT){
          return new JavaModelStatus(IJavaModelStatusConstants.INVALID_PATH, Messages.bind(Messages.classpath_cannotReferToItself, entryPath.makeRelative().toString()));
        }
        // tolerate nesting output in src if src==prj
        continue;
      }
View Full Code Here

      for (int j = 0; j < outputCount; j++){
        IPath currentOutput = outputLocations[j];
        if (entryPath.equals(currentOutput)) continue;
        if (entryPath.isPrefixOf(currentOutput)) {
            if (kind != IClasspathEntry.CPE_SOURCE || !Util.isExcluded(currentOutput, inclusionPatterns, exclusionPatterns, true)) {
            return new JavaModelStatus(IJavaModelStatusConstants.INVALID_CLASSPATH, Messages.bind(Messages.classpath_cannotNestOutputInEntry, new String[] {currentOutput.makeRelative().toString(), entryPath.makeRelative().toString()}));
            }
        }
      }

      // prevent nesting entry inside output location - when distinct from project or a source folder
View Full Code Here

      // prevent nesting entry inside output location - when distinct from project or a source folder
      for (int j = 0; j < outputCount; j++){
        if (allowNestingInOutputLocations[j]) continue;
        IPath currentOutput = outputLocations[j];
        if (currentOutput.isPrefixOf(entryPath)) {
          return new JavaModelStatus(IJavaModelStatusConstants.INVALID_CLASSPATH, Messages.bind(Messages.classpath_cannotNestEntryInOutput, new String[] {entryPath.makeRelative().toString(), currentOutput.makeRelative().toString()}));
        }
      }
    }
    // ensure that no specific output is coincidating with another source folder (only allowed if matching current source folder)
    // 36465 - for 2.0 backward compatibility, only check specific output locations (the default can still coincidate)
View Full Code Here

      IPath entryPath = entry.getPath();
      int kind = entry.getEntryKind();

      // Build some common strings for status message
      boolean isProjectRelative = projectName.equals(entryPath.segment(0));
      String entryPathMsg = isProjectRelative ? entryPath.removeFirstSegments(1).toString() : entryPath.makeRelative().toString();

      if (kind == IClasspathEntry.CPE_SOURCE) {
        IPath output = entry.getOutputLocation();
        if (output == null) output = projectOutputLocation; // if no specific output, still need to check using default output (this line would check default output)
        for (int j = 0; j < length; j++) {
View Full Code Here

                    project, path,
                    Messages.bind(Messages.classpath_incompatibleLibraryJDKLevel,
                        new String[] {
                          project.getElementName(),
                          CompilerOptions.versionFromJdkLevel(projectTargetJDK),
                          path.makeRelative().toString(),
                          CompilerOptions.versionFromJdkLevel(prereqProjectTargetJDK)}));
              }
            }
          } catch (CoreException e){
            return new JavaModelStatus(IJavaModelStatusConstants.INVALID_CLASSPATH, Messages.bind(Messages.classpath_unboundProject, new String[] {path.segment(0), projectName}));
View Full Code Here

          String projectName = javaProject.getElementName();
          IPath newPath = this.path;
          if (this.path.segment(0).toString().equals(projectName)) {
            newPath = this.path.removeFirstSegments(1);
          }
          return Messages.bind(Messages.classpath_disabledInclusionExclusionPatterns, new String[] {newPath.makeRelative().toString(), projectName});

        case DISABLED_CP_MULTIPLE_OUTPUT_LOCATIONS:
          javaProject = (IJavaProject)this.elements[0];
          projectName = javaProject.getElementName();
          newPath = this.path;
View Full Code Here

          projectName = javaProject.getElementName();
          newPath = this.path;
          if (this.path.segment(0).toString().equals(projectName)) {
            newPath = this.path.removeFirstSegments(1);
          }
          return Messages.bind(Messages.classpath_disabledMultipleOutputLocations, new String[] {newPath.makeRelative().toString(), projectName});

        case CANNOT_RETRIEVE_ATTACHED_JAVADOC :
          if (this.elements != null && this.elements.length == 1) {
            if (this.string != null) {
              return Messages.bind(Messages.status_cannot_retrieve_attached_javadoc, ((JavaElement)this.elements[0]).toStringWithAncestors(), this.string);
View Full Code Here

                    if (result == PythonModulePickerDialog.OK) {
                        Object results[] = dialog.getResult();
                        if ((results != null) && (results.length > 0) && (results[0] instanceof IFile)) {
                            IFile file = (IFile) results[0];
                            IPath path = file.getFullPath();
                            String containerName = path.makeRelative().toString();
                            fMainModuleText.setText("${workspace_loc:" + containerName + "}");
                        }
                    }
                }
            }
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.