Package org.eclipse.core.runtime

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


        parameters.put(tagName, tagValue);
      }

    if (this.specificOutputLocation != null) {
      IPath outputLocation = this.specificOutputLocation.removeFirstSegments(1);
      outputLocation = outputLocation.makeRelative();
      parameters.put(TAG_OUTPUT, String.valueOf(outputLocation));
    }

    boolean hasExtraAttributes = this.extraAttributes.length != 0;
    boolean hasRestrictions = getAccessRuleSet() != null; // access rule set is null if no access rules
View Full Code Here


    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) continue; // 36465 - for 2.0 backward compatibility, only check specific output locations (the default can still coincidate)
        // if (output == null) output = projectOutputLocation; // if no specific output, still need to check using default output (this line would check default output)
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

     * is the project. The rest is the policy source.
     */
    private String getPolicySource() {
        IPath fullPath = creationPage.getContainerFullPath();
        fullPath = fullPath.removeFirstSegments(1);
        fullPath = fullPath.makeRelative();
        return fullPath.toOSString();
    }

    /**
     * Returns the type of policy created by this wizard.
View Full Code Here

    int kind = classPathEntry.getEntryKind();
    IPath path = classPathEntry.getPath();

    System.out.println("ClassEntry:");
    System.out.println("\tOriginal : " + path.toOSString());
    System.out.println("\tRelative : " + path.makeRelative().toOSString());
    System.out.println("\tAbsolute : " + path.makeAbsolute().toOSString());

    switch (kind) {
      case IClasspathEntry.CPE_LIBRARY:
        path = classPathEntry.getPath();
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.