Package org.eclipse.core.runtime

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


     
      if (namespace != null) {
        String nmspc = namespace.getNamespace();
        IPath nmspcPath = new Path(nmspc.replace("\\", "/"));
       
        int match = nmspcPath.matchingFirstSegments(appendix);
        appendix = appendix.removeFirstSegments(match);

        if (appendix.segmentCount() > 0) {
          nmspc += (!nmspc.isEmpty() ? "\\" : "") +
            appendix.removeTrailingSeparator().toString().replace("/", "\\");
View Full Code Here


            IClasspathEntry curr= oldEntries[i];
            if (curr.getEntryKind() == IClasspathEntry.CPE_CONTAINER) {
              IPath path= curr.getPath();
              if (path.equals(entry.getPath())) {
                return new NullChange(); // already on build path
              } else if (path.matchingFirstSegments(entry.getPath()) > 0) {
                if (!added) {
                  curr= entry; // replace
                  added= true;
                } else {
                  curr= null;
View Full Code Here

    }

    @Override
    public IPath getConfigurationFile(final String key) {
        final IPath origFile = parentKarafModel.getConfigurationFile(key);
        final int matchingSegments = origFile.matchingFirstSegments(parentKarafModel
                        .getConfigurationDirectory());

        final IPath configFile = origFile.removeFirstSegments(matchingSegments - 1);

        return location.append(configFile);
View Full Code Here

      // workspace. Also, take the last segment as the new project name.
      if (location.toOSString().toLowerCase().startsWith(
            workspaceLocation.toOSString().toLowerCase()))
      {
        String name = location.removeFirstSegments(
            location.matchingFirstSegments(workspaceLocation)).toString();
        // hack for windows... manually remove drive letter
        name = name.replaceFirst("^[A-Z]:", "");
        name = name.replaceFirst("/$", "");

        location = null;
View Full Code Here

      return moveProjectHelperMoveOnlyProject(tree, source, description, updateFlags,
          monitor, srcm, newLocationFile);
    } else {
      int dstAboveSrcRepo = newLocation.matchingFirstSegments(RepositoryMapping
          .getMapping(source).getGitDirAbsolutePath());
      int srcAboveSrcRepo = sourceLocation.matchingFirstSegments(RepositoryMapping.getMapping(source).getGitDirAbsolutePath());
      if (dstAboveSrcRepo > 0 && srcAboveSrcRepo > 0) {
        return moveProjectHelperMoveRepo(tree, source, description, updateFlags, monitor,
          srcm, newLocation, sourceLocation);
      } else {
        return FINISH_FOR_ME;
View Full Code Here

    IPath workspaceLocation = ResourcesPlugin.getWorkspace().getRoot()
        .getLocation();
    if (workspaceLocation != null
        && workspaceLocation.isPrefixOf(pharData
            .getAbsolutePharLocation())) {
      int segments = workspaceLocation.matchingFirstSegments(pharData
          .getAbsolutePharLocation());
      IPath path = pharData.getAbsolutePharLocation()
          .removeFirstSegments(segments);
      IResource resource = ResourcesPlugin.getWorkspace().getRoot()
          .findMember(path);
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.