Package org.eclipse.core.runtime

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


            String referencePath = null;
            reference = reference.toLowerCase();
            if (reference.startsWith("::")) {
                String tmpPath = "/";
                for (int i = 0; i < relativePathToMediumFolder.segmentCount(); i++) {
                    tmpPath += relativePathToMediumFolder.segment(i) + "/";
                }

                referencePath = reference.replace("::", tmpPath);
                referencePath = referencePath.replaceAll(":", "/");
                //referencePath += "." + scriptType;
View Full Code Here


      String referencePath = null;
      reference = reference.toLowerCase();
      if (reference.startsWith("::")) {
        String tmpPath = scriptType + "/";
        for (int i = 0; i < relativePathToMediumFolder.segmentCount(); i++) {
          tmpPath += relativePathToMediumFolder.segment(i) + "/";
        }

        referencePath = reference.replace("::", tmpPath);
        referencePath = referencePath.replaceAll(":", "/");
        referencePath += "." + scriptType;
View Full Code Here

                    if (segmentCount > 0) {
                        // create folder and its parents
                        IContainer container = project;
                        for (int j = 0; j < segmentCount; j++) {
                            IFolder folder = container.getFolder(new Path(
                                sourcePath.segment(j)));
                            if (!folder.exists()) {
                                folder.create(true, true, null);
                            }
                            container = folder;
                        }
View Full Code Here

              if (variableName.equals(entry.getPath().segment(0))){
                affectedProjectClasspaths.put(project, project.getResolvedClasspath());
                continue nextProject;
              }
              IPath sourcePath, sourceRootPath;
              if (((sourcePath = entry.getSourceAttachmentPath()) != null  && variableName.equals(sourcePath.segment(0)))
                || ((sourceRootPath = entry.getSourceAttachmentRootPath()) != null  && variableName.equals(sourceRootPath.segment(0)))) {
 
                affectedProjectClasspaths.put(project, project.getResolvedClasspath());
                continue nextProject;
              }
View Full Code Here

      if (entry == null) continue;
      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();

      // complain if duplicate path
      if (!pathes.add(entryPath)){
        return new JavaModelStatus(IJavaModelStatusConstants.NAME_COLLISION, Messages.bind(Messages.classpath_duplicateEntryPath, new String[] {entryPathMsg, projectName}));
View Full Code Here

      if (entry == null) continue;
      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)
View Full Code Here

    IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot();
    IPath path = entry.getPath();

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

    switch(entry.getEntryKind()){

      // container entry check
View Full Code Here

          // get validation status
          IJavaModelStatus status = validateClasspathEntry(project, entry, checkSourceAttachment, recurseInContainers);
          if (!status.isOK()) return status;

          // return deprecation status if any
          String variableName = path.segment(0);
          String deprecatedMessage = JavaCore.getClasspathVariableDeprecationMessage(variableName);
          if (deprecatedMessage != null) {
            return new JavaModelStatus(IStatus.WARNING, IJavaModelStatusConstants.DEPRECATED_VARIABLE, project, path, deprecatedMessage);
          }
          return status;
View Full Code Here

    IPath xmlPath = this.path;
    if (this.entryKind != IClasspathEntry.CPE_VARIABLE && this.entryKind != IClasspathEntry.CPE_CONTAINER) {
      // translate to project relative from absolute (unless a device path)
      if (xmlPath.isAbsolute()) {
        if (projectPath != null && projectPath.isPrefixOf(xmlPath)) {
          if (xmlPath.segment(0).equals(projectPath.segment(0))) {
            xmlPath = xmlPath.removeFirstSegments(1);
            xmlPath = xmlPath.makeRelative();
          } else {
            xmlPath = xmlPath.makeAbsolute();
          }
View Full Code Here

    if (this.sourceAttachmentPath != null) {
      xmlPath = this.sourceAttachmentPath;
      // translate to project relative from absolute
      if (this.entryKind != IClasspathEntry.CPE_VARIABLE && projectPath != null && projectPath.isPrefixOf(xmlPath)) {
        if (xmlPath.segment(0).equals(projectPath.segment(0))) {
          xmlPath = xmlPath.removeFirstSegments(1);
          xmlPath = xmlPath.makeRelative();
        }
      }
      parameters.put(TAG_SOURCEPATH, String.valueOf(xmlPath));
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.