Package org.eclipse.core.runtime

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


                IClasspathEntry[] entries = new IClasspathEntry[sourceLength
                    + libLength];
                for (int i = 0; i < sourceLength; i++) {
                    IPath sourcePath = new Path(sourceFolders[i]);
                    int segmentCount = sourcePath.segmentCount();
                    if (segmentCount > 0) {
                        // create folder and its parents
                        IContainer container = project;
                        for (int j = 0; j < segmentCount; j++) {
                            IFolder folder = container.getFolder(new Path(
View Full Code Here


                                : null, vars.length > 2
                                ? new Path(new String(vars[2]))
                                : null);
                    } else {
                        IPath libPath = new Path(lib);
                        if (!libPath.isAbsolute() && libPath.segmentCount() > 0
                            && libPath.getFileExtension() == null) {
                            project.getFolder(libPath).create(true, true, null);
                            libPath = projectPath.append(libPath);
                        }
                        entries[sourceLength + i] = JavaCore.newLibraryEntry(
View Full Code Here

                    }
                }

                // create project's output folder
                IPath outputPath = new Path(projectOutput);
                if (outputPath.segmentCount() > 0) {
                    IFolder output = project.getFolder(outputPath);
                    if (!output.exists()) {
                        output.create(true, true, null);
                    }
                }
View Full Code Here

        // must be an entry in this project or specify another project
        String projSegment = path.segment(0);
        if (projSegment != null && projSegment.equals(project.getElementName())) { // this project
          entry = JavaCore.newSourceEntry(path, inclusionPatterns, exclusionPatterns, outputLocation, extraAttributes);
        } else {
          if (path.segmentCount() == 1) {
            // another project
            entry = JavaCore.newProjectEntry(
                        path,
                        accessRules,
                        combineAccessRestrictions,
View Full Code Here

      CharOperation.replace(pkgName, '/', '.');
      return root.getPackageFragment(new String(pkgName));
    } else {
      Path path = new Path(new String(fileName, 0, pkgEnd));
      IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot();
      IContainer folder = path.segmentCount() == 1 ? workspaceRoot.getProject(path.lastSegment()) : (IContainer) workspaceRoot.getFolder(path);
      IJavaElement element = JavaCore.create(folder);
      if (element == null) return null;
      switch (element.getElementType()) {
        case IJavaElement.PACKAGE_FRAGMENT:
          return (IPackageFragment) element;
View Full Code Here

        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

          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

                                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

    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

  }

  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

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.