Package org.eclipse.core.runtime

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


                sb.append("..."); //$NON-NLS-1$
            } else if (length > MAX_TEXT_LENGTH - 7) {
                sb.append(fileName);
            } else {
                sb.append(fileName);
                int segmentCount = path.segmentCount();
                if (segmentCount > 0) {
                    length += 7; // 7 chars are taken for "  [...]"

                    sb.append("  ["); //$NON-NLS-1$
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

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

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

            // Fixing issue AXIS2-4008 by retrieving the project
            // path instead of appending it to the workspace root.
            IProject project = null;
            StringBuilder builder=new StringBuilder();
           
            if (path.segmentCount() > 1) {
              // User has selected a folder inside a project
              project = root.getProject(path.segment(ECLIPSE_PROJECT_NAME_SEGMENT_INDEX));
              for (int i = ECLIPSE_PROJECT_NAME_SEGMENT_INDEX + 1; i < path.segments().length; i++) {
                builder.append(File.separator).append(path.segment(i));
              }
View Full Code Here

          if (root.exists(path)) {
            //Fixing issue AXIS2-4008 by retrieving the project path instead of appending it to the workspace root.
            IProject project = null;
            StringBuilder builder=new StringBuilder();
           
            if (path.segmentCount() > 1) {
              // User has selected a folder inside a project
              project = root.getProject(path.segment(ECLIPSE_PROJECT_NAME_SEGMENT_INDEX));
              for (int i = ECLIPSE_PROJECT_NAME_SEGMENT_INDEX + 1; i < path.segments().length; i++) {
                builder.append(File.separator).append(path.segment(i));
              }
View Full Code Here

    if (baselocation != null) {
      // copied from JSPTranslationAdapter#getJavaProject
      IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
      IPath filePath = new Path(baselocation);
      if (filePath.segmentCount() > 0) {
        resource = root.getFile(filePath);
      }
    }
    return (IFile) resource;
  }
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.