Package org.eclipse.core.runtime

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


          IPath webContentPath = webRoot.getUnderlyingFolder().getFullPath();
          IPath filePath = jsp.getFullPath();
          if (filePath.matchingFirstSegments(webContentPath) == webContentPath.segmentCount()) {
            String extension = filePath.getFileExtension();
            filePath = filePath.removeFirstSegments(webContentPath.segmentCount());
            filePath = filePath.removeLastSegments(1);
            filePath = filePath.append(value);
            if (filePath.getFileExtension() == null && extension != null) {
              filePath = filePath.addFileExtension(extension);
            }
            IVirtualFile file = webRoot.getFile(filePath);
View Full Code Here


                if (ext == null)
                {
                    String lastSeg = extPath.lastSegment();
                    if (lastSeg != null && lastSeg.equals("*")) //$NON-NLS-1$
                    {
                        return extPath.removeLastSegments(1).toString();
                    }

                    return extPath.toString();
                }
            }
View Full Code Here

  public ICompilationUnit createCompilationUnit(
      IPackageFragmentRoot fragmentRoot, String testsrc, String path)
      throws CoreException, IOException {
    IPath typepath = new Path(path);
    String pkgname = typepath.removeLastSegments(1).toString()
        .replace('/', '.');
    IPackageFragment fragment = createPackage(fragmentRoot, pkgname);
    StringBuffer sb = new StringBuffer();
    InputStream source = openTestResource(new Path(testsrc).append(typepath));
    Reader r = new InputStreamReader(source);
View Full Code Here

  public ICompilationUnit createCompilationUnit(
      IPackageFragmentRoot fragmentRoot, String testsrc, String path)
      throws CoreException, IOException {
    IPath typepath = new Path(path);
    String pkgname = typepath.removeLastSegments(1).toString()
        .replace('/', '.');
    IPackageFragment fragment = createPackage(fragmentRoot, pkgname);
    StringBuffer sb = new StringBuffer();
    InputStream source = openTestResource(new Path(testsrc).append(typepath));
    Reader r = new InputStreamReader(source);
View Full Code Here

    return fragment.createCompilationUnit(name, content, false, null);
  }
 
  public ICompilationUnit createCompilationUnit(IPackageFragmentRoot fragmentRoot, String testsrc, String path) throws CoreException, IOException {
    IPath typepath = new Path(path);
    String pkgname = typepath.removeLastSegments(1).toString().replace('/', '.');
    IPackageFragment fragment = createPackage(fragmentRoot, pkgname);
    StringBuffer sb = new StringBuffer();
    URL url = Platform.find(Platform.getBundle("com.mountainminds.eclemma.core"), new Path(testsrc).append(typepath));
    Reader r = new InputStreamReader(url.openStream());
    int c;
View Full Code Here

  public ICompilationUnit createCompilationUnit(
      IPackageFragmentRoot fragmentRoot, String testsrc, String path)
      throws CoreException, IOException {
    IPath typepath = new Path(path);
    String pkgname = typepath.removeLastSegments(1).toString()
        .replace('/', '.');
    IPackageFragment fragment = createPackage(fragmentRoot, pkgname);
    StringBuffer sb = new StringBuffer();
    InputStream source = openTestResource(new Path(testsrc).append(typepath));
    Reader r = new InputStreamReader(source);
View Full Code Here

    return fragment.createCompilationUnit(name, content, false, null);
  }
 
  public ICompilationUnit createCompilationUnit(IPackageFragmentRoot fragmentRoot, String testsrc, String path) throws CoreException, IOException {
    IPath typepath = new Path(path);
    String pkgname = typepath.removeLastSegments(1).toString().replace('/', '.');
    IPackageFragment fragment = createPackage(fragmentRoot, pkgname);
    StringBuffer sb = new StringBuffer();
    URL url = Platform.find(Platform.getBundle("com.mountainminds.eclemma.core"), new Path(testsrc).append(typepath));
    Reader r = new InputStreamReader(url.openStream());
    int c;
View Full Code Here

        }
        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)) {
            // entire item name fits within maximum length
View Full Code Here

   *          gwt-user.jar may be returned; if <code>null</code>, then workspace-global one.
   */
  public static String getGWTLocation(IProject project) {
    IPath userLibPath = getUserLibPath(project);
    if (userLibPath != null) {
      return userLibPath.removeLastSegments(1).toPortableString();
    } else {
      return null;
    }
  }

View Full Code Here

    File file = new File(firstPage.getLocationURI());
    IPath location = new Path(file.toString());
   
    // let the create-project command handle folder creation
    if (firstPage.isInLocalServer()) {
      location = location.removeLastSegments(1);
    }
   
    CreateProjectJob projectJob = new CreateProjectJob(location, firstPage.nameGroup.getName(), filterItem.getPackage().getName(), filterItem.getSelectedVersion());
    projectJob.setJobListener(new JobListener() {
      @Override
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.