Examples of segmentCount()


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

}

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

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

        for (Enumeration entries = zip.entries(); entries.hasMoreElements(); ) {
          ZipEntry entry = (ZipEntry) entries.nextElement();
          String entryName;
          if (!entry.isDirectory() && org.aspectj.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

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

          String entryName;
          if (!entry.isDirectory() && org.aspectj.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

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

      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

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

            IResource r = ResourcesPlugin.getWorkspace().getRoot().findMember(path);
            if (r != null)
                return;

            IPath p = (IPath) path.clone();
            while (p.segmentCount() > 0) {
                p = p.removeLastSegments(1);
                IResource resource = ResourcesPlugin.getWorkspace().getRoot().findMember(p);
                if (resource != null) {
                    resource.refreshLocal(2, null);
                    return;
View Full Code Here

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

            IResource r = ResourcesPlugin.getWorkspace().getRoot().findMember(path);
            if (r != null)
                return;

            IPath p = (IPath) path.clone();
            while (p.segmentCount() > 0) {
                p = p.removeLastSegments(1);
                IResource resource = ResourcesPlugin.getWorkspace().getRoot().findMember(p);
                if (resource != null) {
                    resource.refreshLocal(2, null);
                    return;
View Full Code Here

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

                                for (Entry<String,Map<String,Resource>> entry : dirs.entrySet()) {
                                    if (entry.getValue() == null)
                                        continue;

                                    IPath packagePath = new Path(entry.getKey());
                                    if (packagePath.segmentCount() < 1)
                                        continue;
                                    if ("META-INF".equalsIgnoreCase(packagePath.segment(0)))
                                        continue;

                                    availablePackages.add(packagePath);
View Full Code Here

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

    if (parent == null)
      parent = this;

    IPath path = new Path(name);
    for (int i = 0; i < path.segmentCount(); i++) {
      parent = (VOrionStorage) parent.create(path.segment(i));
    }

    return parent;
  }
View Full Code Here

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

  }

  public IStorage create(String name) {
    IPath path = new Path(name);
    VOrionStorage result = this;
    for (int i = 0, len = path.segmentCount(); i < len; i++) {
      // getChild() is a handle-only method; a child is provided regardless of whether this
      // store or the child store exists, or whether this store represents a directory or not.
      IFileStore childStore = result.store.getChild(path.segment(i));
      result = new VOrionStorage(path.segment(i), childStore, result);
    }
View Full Code Here

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

   *  
   */
  public void addAtributesFor(HttpServletRequest request, URI resource,JSONObject representation) {
    IPath resourcePath = new Path(request.getServletPath() + (request.getPathInfo() == null ? "" : request.getPathInfo()));
   
    if ("/workspace".equals(request.getServletPath()) && resourcePath.segmentCount() == 2) {
      try {
        JSONArray projObjects = representation.getJSONArray("Children");
        for (int i = 0; i < projObjects.length(); i++) {
          JSONObject projectObject = (JSONObject) projObjects.get(i);
          if (checkMaqettaProject(projectObject)){
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.