Package org.eclipse.core.runtime

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


    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


      IPath childPath = filePath.removeFirstSegments(this.names.length);
      if (jarEntries.containsKey(childPath)) {
        // see https://bugs.eclipse.org/bugs/show_bug.cgi?id=222665
        continue;
      }
      JarEntryFile file = new JarEntryFile(filePath.lastSegment());
      jarEntries.put(childPath, file);
      if (childPath.segmentCount() == 1) {
        file.setParent(this);
        topJarEntries.add(file);
      } else {
View Full Code Here

            .loadProjectDescription(path);
        projectName = description.getName();
      }
    } catch (CoreException e) {
      description = null;
      projectName = path.lastSegment();
    }
  }

  /**
   * Get the name of the project
View Full Code Here

  }

  private IProjectDescription createDescription(String path,
      boolean insidews, IWorkspaceRoot root, File workspaceSupplement) {
    Path ppath = new Path(path);
    String projectName = ppath.lastSegment();
    URI locationURI;
    URI top;
    if (insidews) {
      top = root.getRawLocationURI();
    } else {
View Full Code Here

    if (insidews) {
      top = root.getRawLocationURI();
    } else {
      top = URIUtil.toURI(workspaceSupplement.getAbsolutePath());
    }
    if (!insidews || !ppath.lastSegment().equals(path)) {
      locationURI = URIUtil.toURI(URIUtil.toPath(top).append(path));
    } else
      locationURI = null;
    IProjectDescription description = ResourcesPlugin.getWorkspace()
        .newProjectDescription(projectName);
View Full Code Here

      IPath childPath = filePath.removeFirstSegments(this.names.length);
      if (jarEntries.containsKey(childPath)) {
        // see https://bugs.eclipse.org/bugs/show_bug.cgi?id=222665
        continue;
      }
      JarEntryFile file = new JarEntryFile(filePath.lastSegment());
      jarEntries.put(childPath, file);
      if (childPath.segmentCount() == 1) {
        file.setParent(this);
        topJarEntries.add(file);
      } else {
View Full Code Here

    if (object instanceof DBGpStackFrame) {
      String src = ((DBGpStackFrame) object).getSourceName();
      if (src == null) {
        src = ((DBGpStackFrame) object).getQualifiedFile();
        IPath p = new Path(src);
        src = p.lastSegment();
      }
      return src;
    }
    return null;
  }
View Full Code Here

            .getFileExtension())) {
          path = path
              .addFileExtension(PharConstants.PHAR_EXTENSION_ZIP);
        }
      } else if (tarCompressRadio.getSelection()) {
        String fileName = path.lastSegment();
        if (noneCompressTypePhar.getSelection()) {
          if (!PharConstants.PHAR_EXTENSION_TAR1.equals(path
              .getFileExtension())) {
            path = path
                .addFileExtension(PharConstants.PHAR_EXTENSION_TAR1);
View Full Code Here

  public String getFileDisplayName() {
    IPath filePath = new Path(fileName);
    if (filePath.segmentCount() > 1
        && filePath.segment(filePath.segmentCount() - 2).equals(
            "Untitled_Documents")) { //$NON-NLS-1$
      return filePath.lastSegment();
    }
    return fileName;
  }

  /**
 
View Full Code Here

    IPath path = new Path(filePath);
    String parentPath = path.removeLastSegments(1).toOSString();
    IFileStore fileStore = EFS.getLocalFileSystem().getStore(
        new Path(parentPath));

    fileStore = fileStore.getChild(path.lastSegment());

    if (!fileStore.fetchInfo().isDirectory()
        && fileStore.fetchInfo().exists()) {

      IWorkbenchPage page = DLTKUIPlugin.getActivePage();
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.