Package org.eclipse.core.runtime

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


                    && (JavaModel.getTarget(otherPath, false/*don't check existence*/) instanceof IContainer)))) {
            char[][] inclusionPatterns, exclusionPatterns;
            if (otherPath.isPrefixOf(entryPath)
                && !otherPath.equals(entryPath)
                && !Util.isExcluded(entryPath.append("*"), inclusionPatterns = ((ClasspathEntry)otherEntry).fullInclusionPatternChars(), exclusionPatterns = ((ClasspathEntry)otherEntry).fullExclusionPatternChars(), false)) { //$NON-NLS-1$
              String exclusionPattern = entryPath.removeFirstSegments(otherPath.segmentCount()).segment(0);
              if (Util.isExcluded(entryPath, inclusionPatterns, exclusionPatterns, false)) {
                return new JavaModelStatus(IJavaModelStatusConstants.INVALID_CLASSPATH, Messages.bind(Messages.classpath_mustEndWithSlash, new String[] {exclusionPattern, entryPath.makeRelative().toString()}));
              } else {
                if (otherKind == IClasspathEntry.CPE_SOURCE) {
                  exclusionPattern += '/';
View Full Code Here


}

String extractTypeName() {
  // answer a String with the qualified type name for the source file in the form: 'p1/p2/A'
  IPath fullPath = this.resource.getFullPath();
  int resourceSegmentCount = fullPath.segmentCount();
  int sourceFolderSegmentCount = this.sourceLocation.sourceFolder.getFullPath().segmentCount();
  int charCount = (resourceSegmentCount - sourceFolderSegmentCount - 1);
  resourceSegmentCount--; // deal with the last segment separately
  for (int i = sourceFolderSegmentCount; i < resourceSegmentCount; i++)
    charCount += fullPath.segment(i).length();
View Full Code Here

      IResource resource = JavaModel.getWorkspaceTarget(path.uptoSegment(2/*linked folders for external folders are always of size 2*/));
      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);
      }
    }
  }
View Full Code Here

          for (Enumeration entries = zip.entries(); entries.hasMoreElements(); ) {
            ZipEntry entry = (ZipEntry) entries.nextElement();
            String entryName;
            if (!entry.isDirectory() && org.eclipse.jdt.internal.core.util.Util.isJavaLikeFileName(entryName = entry.getName())) {
              IPath path = new Path(entryName);
              int segmentCount = path.segmentCount();
              if (segmentCount > 1) {
                for (int i = 0, max = path.segmentCount() - 1; i < max; i++) {
                  if (firstLevelPackageNames.contains(path.segment(i))) {
                    tempRoots.add(path.uptoSegment(i));
                    // don't break here as this path could contain other first level package names (see https://bugs.eclipse.org/bugs/show_bug.cgi?id=74014)
View Full Code Here

            String entryName;
            if (!entry.isDirectory() && org.eclipse.jdt.internal.core.util.Util.isJavaLikeFileName(entryName = entry.getName())) {
              IPath path = new Path(entryName);
              int segmentCount = path.segmentCount();
              if (segmentCount > 1) {
                for (int i = 0, max = path.segmentCount() - 1; i < max; i++) {
                  if (firstLevelPackageNames.contains(path.segment(i))) {
                    tempRoots.add(path.uptoSegment(i));
                    // don't break here as this path could contain other first level package names (see https://bugs.eclipse.org/bugs/show_bug.cgi?id=74014)
                  }
                  if (i == max - 1 && containsADefaultPackage) {
View Full Code Here

      if (size > 1) {
        Collections.sort(sortedRoots, new Comparator() {
          public int compare(Object o1, Object o2) {
            IPath path1 = (IPath) o1;
            IPath path2 = (IPath) o2;
            return path1.segmentCount() - path2.segmentCount();
          }
        });
      }
      for (Iterator iter = sortedRoots.iterator(); iter.hasNext();) {
        IPath path = (IPath) iter.next();
View Full Code Here

        IResource resource = resources[i];
        if (resource.getType() == IResource.FOLDER) {
          if (firstLevelPackageNames.contains(resource.getName())) {
            IPath fullPath = container.getFullPath();
            IPath rootPathEntry = fullPath.removeFirstSegments(sourcePathSegmentCount).setDevice(null);
            if (rootPathEntry.segmentCount() >= 1) {
              set.add(rootPathEntry);
            }
            computeRootPath((IFolder) resource, firstLevelPackageNames, hasDefaultPackage, set, sourcePathSegmentCount);
          } else {
            computeRootPath((IFolder) resource, firstLevelPackageNames, hasDefaultPackage, set, sourcePathSegmentCount);
View Full Code Here

          // now the output location becomes a package fragment - along with any subfolders
          ArrayList folders = new ArrayList();
          folders.add(folder);
          collectAllSubfolders(folder, folders);
          Iterator elements = folders.iterator();
          int segments = path.segmentCount();
          while (elements.hasNext()) {
            IFolder f = (IFolder) elements.next();
            IPath relativePath = f.getFullPath().removeFirstSegments(segments);
            String[] pkgName = relativePath.segments();
            IPackageFragment pkg = root.getPackageFragment(pkgName);
View Full Code Here

    switch(entry.getEntryKind()){

      // container entry check
      case IClasspathEntry.CPE_CONTAINER :
        if (path.segmentCount() >= 1){
          try {
            IJavaModelStatus status = null;
            // Validate extra attributes
            IClasspathAttribute[] extraAttributes = entry.getExtraAttributes();
            if (extraAttributes != null) {
View Full Code Here

        }
        break;

      // variable entry check
      case IClasspathEntry.CPE_VARIABLE :
        if (path.segmentCount() >= 1){
          try {
            entry = JavaCore.getResolvedClasspathEntry(entry);
          } catch (AssertionFailedException e) {
            // Catch the assertion failure and throw java model exception instead
            // see bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=55992
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.