Package org.eclipse.core.runtime

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


    final IPath p = new Path(path);
   
    if (p.isAbsolute() && p.segmentCount() > 1)
    {
      return AbstractUIPlugin.imageDescriptorFromPlugin(
        p.segment(0), p.removeFirstSegments(1).makeAbsolute().toString());
    }
    else
    {
      return getBundledImageDescriptor(p.makeAbsolute().toString());
    }
View Full Code Here


  {
    IPath iPath = new Path(path);
   
    if (iPath.isAbsolute() && iPath.segmentCount() > 1)
    {
      return AbstractUIPlugin.imageDescriptorFromPlugin(iPath.segment(0),
        iPath.removeFirstSegments(1).makeAbsolute().toString());
    }
    else
    {
      return getBundledImageDescriptor(iPath.makeAbsolute().toString());
View Full Code Here

    SourceIndexerRequestor requestor = new SourceIndexerRequestor(this);
    String documentPath = this.document.getPath();
    SourceElementParser parser = this.document.getParser();
    if (parser == null) {
      IPath path = new Path(documentPath);
      IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(path.segment(0));
      parser = JavaModelManager.getJavaModelManager().indexManager.getSourceElementParser(JavaCore.create(project), requestor);
    } else {
      parser.setRequestor(requestor);
    }
View Full Code Here

            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) {
                    tempRoots.add(path.uptoSegment(max));
View Full Code Here

    // ensure path is absolute
    IPath path = new Path(pathAttr);
    int kind = kindFromString(kindAttr);
    if (kind != IClasspathEntry.CPE_VARIABLE && kind != IClasspathEntry.CPE_CONTAINER && !path.isAbsolute()) {
      if (!(path.segmentCount() > 0 && path.segment(0).equals(ClasspathEntry.DOT_DOT))) {
        path = projectPath.append(path);
      }
    }
    // source attachment info (optional)
    IPath sourceAttachmentPath =
View Full Code Here

                        extraAttributes,
                        isExported);
        break;
      case IClasspathEntry.CPE_SOURCE :
        // 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,
View Full Code Here

      try {

        IJavaProject project = JavaCore.create(Util.getProject(projectText));
        IPath moduleXmlPath = new Path(moduleText);
        root = project.findPackageFragmentRoot(new Path("/").append(projectText).append(moduleXmlPath.segment(0)));//$NON-NLS-1$

      } catch (JavaModelException e) {
        Activator.logException(e);
      }
    }
View Full Code Here

      try {

        IJavaProject project = JavaCore.create(Util.getProject(projectText));
        IPath moduleXmlPath = new Path(moduleText);
        root = project.findPackageFragmentRoot(new Path("/").append(projectText).append(moduleXmlPath.segment(0)));//$NON-NLS-1$

      } catch (JavaModelException e) {
        Activator.logException(e);
      }
    }
View Full Code Here

      try {

        IJavaProject project = JavaCore.create(Util.getProject(projectText));
        IPath moduleXmlPath = new Path(moduleText);
        root = project.findPackageFragmentRoot(new Path("/").append(projectText).append(moduleXmlPath.segment(0)));//$NON-NLS-1$

      } catch (JavaModelException e) {
        Activator.logException(e);
      }
    }
View Full Code Here

      try {

        IJavaProject project = JavaCore.create(Util.getProject(projectText));
        IPath moduleXmlPath = new Path(moduleText);
        root = project.findPackageFragmentRoot(new Path("/").append(projectText).append(moduleXmlPath.segment(0)));//$NON-NLS-1$

      } catch (JavaModelException e) {
        Activator.logException(e);
      }
    }
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.