Examples of removeLastSegments()


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

    private String getLibName(final String libDir) {
        final IPath p = new Path(libDir);
        String s = p.lastSegment();
        if ("ebin".equals(s)) {
            s = p.removeLastSegments(1).lastSegment();
        }
        final int dashPos = s.lastIndexOf('-');
        if (dashPos != -1) {
            return s.substring(0, dashPos);
        }
View Full Code Here

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

        final Map<IPath, String> paths = Maps.newHashMap();
        for (final OtpErlangObject ebeam : list) {
            final OtpErlangString beam = (OtpErlangString) ebeam;
            final String sbeam = beam.stringValue();
            IPath p = new Path(sbeam);
            p = p.removeLastSegments(1);
            p = p.removeFirstSegments(project.getLocation().segmentCount());
            p = p.setDevice(null);
            paths.put(p, sbeam);
        }
        for (final Entry<IPath, String> p : paths.entrySet()) {
View Full Code Here

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

            }
        }
        if (filePath != null) {
            final IPath path = new Path(filePath);
            IFileStore fileStore = EFS.getLocalFileSystem().getStore(
                    path.removeLastSegments(1));
            fileStore = fileStore.getChild(path.lastSegment());
            final IFileInfo fetchInfo = fileStore.fetchInfo();
            if (!fetchInfo.isDirectory() && fetchInfo.exists()) {
                if (element instanceof IErlModule
                        && element.getParent() instanceof IErlExternal) {
View Full Code Here

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

        final int n = ref.segmentCount();
        final List<String> result = Lists.newArrayList();
        for (final Iterator<String> iter = list.iterator(); iter.hasNext();) {
            final String element = iter.next();
            IPath p = new Path(element);
            p = p.removeLastSegments(1).removeFirstSegments(n).setDevice(null);
            String ps = p.toString();
            if ("".equals(ps)) {
                ps = ".";
            }
            if (result.indexOf(ps) < 0) {
View Full Code Here

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

      return rootPath;
    }
    // try to handle out-of-workspace paths
    IPath root = path.makeAbsolute();
    while (root.segmentCount() > 0 && !root.isRoot())
      root = root.removeLastSegments(1);
    return root;
  }

  private void internalRemoveTaglibIndexListener(ITaglibIndexListener listener) {
    try {
View Full Code Here

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

      return null;
    }
    if (path.hasTrailingSeparator()) {
      return path;
    }
    path = path.removeLastSegments(1);
    if (path.isEmpty()) {
      return null;
    }
    return path.addTrailingSeparator();
  }
View Full Code Here

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

      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

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

        // add relative path to the output path
        IPath out = outputRoot.append(path.removeFirstSegments(firstSegments));
        String fileName = path.removeFileExtension().lastSegment();
        String namePattern = fileName + "\\.class|" + fileName + "\\$.*\\.class";
        namePattern = addSecondaryTypesToPattern(file, fileName, namePattern);
        File directory = out.removeLastSegments(1).toFile();

        // add parent folder and regexp for file names
        Pattern classNamesPattern = Pattern.compile(namePattern);
        ResourceUtils.addFiles(fbProject, directory, classNamesPattern);
    }
View Full Code Here

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

  private String getTypeSystemDescriptorFromScriptFile(IPath scriptFilePath) {
    IPath folder = scriptFilePath;

    while (!folder.lastSegment().equals(RutaProjectUtils.getDefaultScriptLocation())) {
      folder = folder.removeLastSegments(1);
    }
    IPath relativeTo = scriptFilePath.makeRelativeTo(folder);
    IPath projectPath = folder.removeLastSegments(1);
    String elementName = scriptFilePath.lastSegment();
    int lastIndexOf = elementName.lastIndexOf(RutaEngine.SCRIPT_FILE_EXTENSION);
View Full Code Here

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

    String scriptName = segments.lastSegment();
    if(scriptName == null) {
      return null;
    }
    scriptName += "TypeSystem.xml";
    segments = segments.removeLastSegments(1);
    IFolder descPackageFolder = null;
    try {
      descPackageFolder = descFolder.getFolder(segments);
    } catch (Exception e) {
      return null;
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.