Package org.eclipse.core.runtime

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


            }
            if(!includeLibs && files[i] instanceof VLibraryResource)
              continue;

          IPath filePath = new Path(files[i].getPath());
            String pathString = filePath.removeFirstSegments(filePath.matchingFirstSegments(root)).toString();
           
            if(pathString==null) return;
           
            /* remove leading characters that confuse and anger windows built in archive util */
            if(pathString.length() > 1 && pathString.indexOf("./")==0)
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

        // TODO try to preselect the current file
        dialog.open();
        Object[] results = dialog.getResult();
        if ((results != null) && (results.length > 0) && (results[0] instanceof IResource)) {
            IPath path = ((IResource) results[0]).getFullPath();
            setProjectLoc(path.removeFirstSegments(1).makeRelative().toString());
        }
    }

    private void selectInWorkspace() {
        ElementTreeSelectionDialog dialog = new ElementTreeSelectionDialog(getShell(),
View Full Code Here

        dialog.open();
        Object[] results = dialog.getResult();
        if (results != null && results.length > 0 && results[0] instanceof IResource) {
            IPath path = ((IResource) results[0]).getFullPath();
            if (project != null && path.segment(0).equals(project.getProject().getName())) {
                setProjectLoc(path.removeFirstSegments(1).makeRelative().toString());
            } else {
                String containerName = path.makeRelative().toString();
                setWorkspaceLoc("${workspace_loc:" + containerName + "}");
            }
        }
View Full Code Here

    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

    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

    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;
    int segmentsToRemove = dataLocation
        .matchingFirstSegments(currentWorkspaceRoot);
 
    // Strip it down to the extension
    dataLocation = dataLocation.removeFirstSegments(segmentsToRemove);
    // Now add in the
    dataLocation = newWorkspaceRoot.append(dataLocation);
    return dataLocation;
  }
View Full Code Here

              }
            }
            // add absolute location
            {
              // remove first segment (project)
              location = location.removeFirstSegments(1);
              // prepare absolute location
              IPath absoluteLocation = project.getLocation().append(location);
              binaryLocations.add(absoluteLocation.toPortableString());
            }
          }
View Full Code Here

    tInfoLabelData.horizontalAlignment = GridData.FILL;
    tInfoLabelData.horizontalSpan = 1;
    tInfoPanel.setLayoutData(tInfoLabelData);

    IPath path = script.getFullPath().removeFileExtension();
    String pathString = path.removeFirstSegments(2).toPortableString().replaceAll("[/]", ".");
    tInfoPanel.setFilename(pathString);

    sash = new SashForm(overlay, SWT.HORIZONTAL);
    sash.setLayoutData(new GridData(GridData.FILL_BOTH));
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.