Package org.eclipse.core.runtime

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


  }
 
  public ILibraryFinder getInstance(URI baseResource, String project) {
    // TODO Auto-generated method stub
    IPath p = new Path(baseResource.getPath());
    String projectPiece = p.segment(p.segmentCount()-1);
   
    return new DojoLibraryFinder(baseResource, project);
  }

  private static URI appendPath(URI u, String piece){
View Full Code Here


        IPath path = new Path(file.getPath());
       
        if(path==null) return false;
       
        for (int i = 0; i < this.filterDirs.length; i++) {
            for(int k=0;k<path.segmentCount();k++){
              String seg = path.segment(k);
              if(seg!=null && seg.equalsIgnoreCase(filterDirs[i])) return true;
            }
           
           
View Full Code Here

      IPath rootPath = description.getLocalRoot(baseResource.getFullPath());
      return rootPath;
    }
    // try to handle out-of-workspace paths
    IPath root = path.makeAbsolute();
    while (root.segmentCount() > 0 && !root.isRoot())
      root = root.removeLastSegments(1);
    return root;
  }

  private void internalRemoveTaglibIndexListener(ITaglibIndexListener listener) {
View Full Code Here

   *            the IFileDelta containing the file name to get
   * @return the IFile
   */
  public IFile getFile(String delta) {
    IPath path = new Path(delta);
    if (path.segmentCount() > 1) {
      IFile file = ResourcesPlugin.getWorkspace().getRoot().getFile(path);
      if (file != null && file.exists())
        return file;
    }
    return null;
View Full Code Here

   * @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

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

            Util.verbose("Invalid Class-Path entry " + calledFileName + " in manifest of jar file: " + jarPath.toOSString()); //$NON-NLS-1$ //$NON-NLS-2$
          }
        } else {
          IPath calledJar = directoryPath.append(new Path(calledFileName));
          // Ignore if segment count is Zero (https://bugs.eclipse.org/bugs/show_bug.cgi?id=308150)
          if (calledJar.segmentCount() == 0) {
            if (JavaModelManager.CP_RESOLVE_VERBOSE_FAILURE) {
              Util.verbose("Invalid Class-Path entry " + calledFileName + " in manifest of jar file: " + jarPath.toOSString()); //$NON-NLS-1$ //$NON-NLS-2$
            }
            continue;
          }
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.