Package org.eclipse.core.runtime

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


    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


      return null;
    }

    IStructuredModel model = null;
    if (project != null) {
      IPath filePath = fullIPath.removeFirstSegments(project.getLocation().segmentCount());
      IFile file = (filePath != null && !filePath.isEmpty()) ? project.getFile(filePath) : null;
      if (file == null) {
        return null;
      }
View Full Code Here

        IPath srcPath = new Path(newSourceLocation);
        if (workspaceRoot.findMember(srcPath) != null) {
          sourceLocation = newSourceLocation;
        } else if (wsRootPath.isPrefixOf(srcPath)) {
          int segmentsMatched = wsRootPath.matchingFirstSegments(srcPath);
          srcPath = srcPath.removeFirstSegments(segmentsMatched).setDevice(null);
          sourceLocation = srcPath.toOSString();
        } else {
          sourceLocation = newSourceLocation;
          relativeToWorkspace = false;
        }
View Full Code Here

  public static boolean isTagDirDocument(final TLDDocument tldDoc, final IProject project) {
    if (tldDoc.getUri() == null || tldDoc.getUri().equals("")) { //$NON-NLS-1$
      IPath p = new Path(tldDoc.getBaseLocation());
      IPath webContentPath = ComponentCore.createComponent(project).getRootFolder().getUnderlyingFolder().getFullPath();
      if (p.matchingFirstSegments(webContentPath) == webContentPath.segmentCount()) {
        p = p.removeFirstSegments(webContentPath.segmentCount());
        if (p.matchingFirstSegments(new Path("WEB-INF/tags")) == 2) { //$NON-NLS-1$)  {
          return true;
        }
      }
    }
View Full Code Here

        IPath srcPath = new Path(newSourceLocation);
        if (workspaceRoot.findMember(srcPath) != null) {
          sourceLocation = newSourceLocation;
        } else if (wsRootPath.isPrefixOf(srcPath)) {
          int segmentsMatched = wsRootPath.matchingFirstSegments(srcPath);
          srcPath = srcPath.removeFirstSegments(segmentsMatched).setDevice(null);
          sourceLocation = srcPath.toOSString();
        } else {
          sourceLocation = newSourceLocation;
          relativeToWorkspace = false;
        }
View Full Code Here

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

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

   * @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 {
      return getBundledImageDescriptor(p.makeAbsolute().toString());
    }
  }
View Full Code Here

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

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.