Package org.eclipse.core.runtime

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


        String baseLocation = model.getBaseLocation();
        // The baseLocation may be a path on disk or relative to the
        // workspace root. Don't translate on-disk paths to
        // in-workspace resources.
        IPath basePath = new Path(baseLocation);
        if (basePath.segmentCount() > 1) {
          file = ResourcesPlugin.getWorkspace().getRoot().getFile(basePath);
          /*
           * If the IFile doesn't  exist, make sure it's not
           * returned
           */
 
View Full Code Here


    }

    if (baselocation != null) {
      IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
      IPath filePath = new Path(baselocation);
      if (filePath.segmentCount() > 0) {
        resource = root.getFile(filePath);
      }
    }
    return resource;
  }
View Full Code Here

              baseLocation = file.getAbsolutePath();
            }
            else {
              IPath basePath = new Path(model.getBaseLocation());
              IResource derivedResource = null;
              if (basePath.segmentCount() > 1)
                derivedResource = ResourcesPlugin.getWorkspace().getRoot().getFile(basePath);
              else
                derivedResource = ResourcesPlugin.getWorkspace().getRoot().getProject(basePath.segment(0));
              IPath derivedPath = derivedResource.getLocation();
              if (derivedPath != 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

      return out;
   
    needsLiveHelp = HelpBasePlugin.getActivitySupport().getDocumentMessageUsesLiveHelp(addNarrow);

    IPath path = new Path(pathInfo);
    int upLevels = path.segmentCount() - 1;
    StringBuffer script = new StringBuffer();
    StringBuffer disabledContent = new StringBuffer();
    //StringBuffer feedbackContent = new StringBuffer();
    if (addNarrow) {
      script.append(narrowBook1);
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

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

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

            // sometimes it's the same as name, so it shouldn't be treated as a path then
            pathName = ""; //$NON-NLS-1$
        }
        IPath path = new Path(pathName);
        // if last segment in path is the fileName, remove it
        if (path.segmentCount() > 1
                && path.segment(path.segmentCount() - 1).equals(fileName)) {
            path = path.removeLastSegments(1);
            pathName = path.toString();
        }
View Full Code Here

            pathName = ""; //$NON-NLS-1$
        }
        IPath path = new Path(pathName);
        // if last segment in path is the fileName, remove it
        if (path.segmentCount() > 1
                && path.segment(path.segmentCount() - 1).equals(fileName)) {
            path = path.removeLastSegments(1);
            pathName = path.toString();
        }

        if ((fileName.length() + pathName.length()) <= (MAX_TEXT_LENGTH - 4)) {
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.