Package org.eclipse.core.runtime

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


  protected String generateInterpreterName(IFileHandle file, String nature)
  {
    final String genName;
    final IPath path = new Path(file.getCanonicalPath());
    if (path.segmentCount() > 0) {
      genName = path.lastSegment();
    } else {
      genName = null;
    }
    // Add number if interpreter with such name already exists.
    String name = genName;
View Full Code Here


  }

  private void setResultFromFile() {
    // Use the filename without extension as the id of this cheatsheet
    IPath filePath = new Path(selectFileCombo.getText());
    String id = filePath.lastSegment();
    int extensionIndex = id.indexOf('.');
    if (extensionIndex > 0) {
        id = id.substring(0, extensionIndex);
    }
    // Use the id as the name
View Full Code Here

  }
 
  private void setResultFromUrl() {
    // Use the filename without extension as the id of this cheatsheet
    IPath filePath = new Path(selectUrlCombo.getText());
    String id = filePath.lastSegment();
    int extensionIndex = id.indexOf('.');
    if (extensionIndex > 0) {
        id = id.substring(0, extensionIndex);
    }
    // Use the id as the name
View Full Code Here

      proj.open(new NullProgressMonitor());
   
    javaModel.refreshExternalArchives(new IJavaElement[]{proj}, new NullProgressMonitor());
   
    IPath filePath = new Path(doc.getFilePath());
    String fileName = filePath.lastSegment();
   
    IPath jarPath = filePath.removeLastSegments(2); // remove pkg and filename
    IPackageFragmentRoot jar = null;
    IResource jarFile = workspaceRoot.findMember(jarPath);
   
View Full Code Here

    Reader r = new InputStreamReader(source);
    int c;
    while ((c = r.read()) != -1)
      sb.append((char) c);
    r.close();
    return createCompilationUnit(fragment, typepath.lastSegment(),
        sb.toString());
  }

  public void addClassPathEntry(IClasspathEntry entry) throws CoreException {
    IClasspathEntry[] oldEntries = javaProject.getRawClasspath();
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.