Package org.eclipse.core.runtime

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


   * @param path the path to image, either absolute (with plug-in id as first segment), or relative for bundled images
   * @return the image descriptor
   */
  public static ImageDescriptor findImageDescriptor(String path) {
    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


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

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

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

    Path path = new Path(pathString);

    String messageString;
    // Break the message up if there is a file name and a directory
    // and there are at least 2 segments.
    if (path.getFileExtension() == null || path.segmentCount() < 2) {
      messageString = NLS.bind(
          PreferencesMessages.WizardDataTransfer_existsQuestion,
          pathString);
    } else {
      messageString = NLS
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

    // 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

                        inclusionPatterns,
                        exclusionPatterns,
                        outputLocation,
                        extraAttributes);
        } else {
          if (path.segmentCount() == 1) {
            // another project
            entry = JavaCore.newProjectEntry(
                        path,
                        accessRules,
                        combineAccessRestrictions,
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.