Package org.eclipse.core.runtime

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


        PathNode pathNode = (PathNode) element;
        IPath path = pathNode.getPath();
        if (path.segmentCount() == 0)
          return null;
        else
          return containerNodes.get(path.removeLastSegments(1));
      } else
        return null;
    }

    public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
View Full Code Here


          if (suffix != null)
            styled.append(suffix, StyledString.DECORATIONS_STYLER);
          styled.append(' ');
          styled.append('-', StyledString.QUALIFIER_STYLER);
          styled.append(' ');
          styled.append(parsed.removeLastSegments(1).toString(),
              StyledString.QUALIFIER_STYLER);
        } else {
          styled.append(stagingEntry.getPath());
          if (suffix != null)
            styled.append(suffix, StyledString.DECORATIONS_STYLER);
View Full Code Here

        // the root must be shown in any case, so propagate the
        // change of the "only equal content" flag.
        if (type != Type.FILE_BOTH_SIDES_SAME) {
          IPath path = currentPath;
          while (path.segmentCount() > 0) {
            path = path.removeLastSegments(1);
            ContainerNode node = containerNodes.get(path);
            node.setOnlyEqualContent(false);
          }
        }
      }
View Full Code Here

    List<StagingFolderEntry> folderEntries = new ArrayList<StagingFolderEntry>();
    for (IPath folderPath : folderPaths) {
      IPath parent = folderPath.removeLastSegments(1);
      // Find first existing parent node, but stop at root
      while (parent.segmentCount() != 0 && !folderPaths.contains(parent))
        parent = parent.removeLastSegments(1);
      if (parent.segmentCount() == 0) {
        // Parent is root
        StagingFolderEntry folderEntry = new StagingFolderEntry(
            workingDirectory, folderPath, folderPath);
        folderEntries.add(folderEntry);
View Full Code Here

    while (path.segmentCount() > 0) {
      result.add(base.append(path).toString());
      // for backwards compatibility only, don't replace the slashes
      if (path.segmentCount() > 1)
        result.add(base.append(path.toString().replace('/', '_')).toString());
      path = path.removeLastSegments(1);
    }

    return (String[]) result.toArray(new String[result.size()]);
  }
View Full Code Here

    /**
     * Returns the parent folder of the given path.
     */
    public static IPath getParentFolderPath(String contentFilePath) {
        IPath path = new Path(contentFilePath);
        path = path.removeLastSegments(1).addTrailingSeparator();
        return path;
    }



View Full Code Here

    IPath pathname = new Path(entry.getName());
    TarEntry parent;
    if (pathname.segmentCount() == 1) {
      parent = root;
    } else {
      parent = (TarEntry) directoryEntryCache.get(pathname
          .removeLastSegments(1));
    }

    List childList = (List) children.get(parent);
    childList.add(entry);
View Full Code Here

    IPath pathname = new Path(entry.getName());
    PharEntry parent;
    if (pathname.segmentCount() == 1) {
      parent = root;
    } else {
      parent = (PharEntry) directoryEntryCache.get(pathname
          .removeLastSegments(1));
    }

    List childList = (List) children.get(parent);
    childList.add(entry);
View Full Code Here

      if (resource != null)
        rootInfo = (DeltaProcessor.RootInfo) rootInfos.get(resource.getLocation());
    } else {
      rootInfo = (DeltaProcessor.RootInfo) rootInfos.get(path);
      while (rootInfo == null && path.segmentCount() > 0) {
        path = path.removeLastSegments(1);
        rootInfo = (DeltaProcessor.RootInfo) rootInfos.get(path);
      }
    }
  }
  if (rootInfo == null)
View Full Code Here

        IPath localPath = path.setDevice(null).removeFirstSegments(
            rootPath.segmentCount());
        if (localPath.segmentCount() >= 1) {
          final IScriptFolder folder;
          if (localPath.segmentCount() > 1) {
            folder = root.getScriptFolder(localPath
                .removeLastSegments(1));
          } else {
            folder = root.getScriptFolder(""); //$NON-NLS-1$
          }
          return folder.getSourceModule(localPath.lastSegment());
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.