Package org.eclipse.core.runtime

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


  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

  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

  public XsltTransformer(String contributorId, String fileName)
      throws TransformerConfigurationException, IOException,
      URISyntaxException {
    IPath path = new Path(fileName);
    final Bundle bundle = Platform.getBundle(contributorId);
    final IPath folder = path.removeLastSegments(1);

    TransformerFactory factory = TransformerFactory.newInstance(
        "net.sf.saxon.TransformerFactoryImpl", null);
    factory.setURIResolver(new URIResolver() {
View Full Code Here

  public void testLibraryLocations() throws Exception { testLibraryLocations$(); }
  public void testLibraryLocations$() throws Exception {   
    Path compilerPath = epath(CompilerInstallDetector_Test.MOCK_GDC_CMDPATH);
    LibraryLocation[] libLocations = getLibraryLocations(new GDCInstallType(), compilerPath);
   
    checkLibLocations(libLocations, compilerPath.removeLastSegments(2),
      "include/d2/4.5.2")
  }
 
  @Test
  public void stestLibraryLocations_2() throws Exception { stestLibraryLocations_2$(); }
View Full Code Here

  public void stestLibraryLocations_2() throws Exception { stestLibraryLocations_2$(); }
  public void stestLibraryLocations_2$() throws Exception {
    Path compilerPath = epath(CompilerInstallDetector_Test.MOCK_GDC_B_CMDPATH);
    LibraryLocation[] libLocations = getLibraryLocations(new GDCInstallType(), compilerPath);
   
    checkLibLocations(libLocations, compilerPath.removeLastSegments(2),
      "include/d/4.6.1");      
  }
 
}
View Full Code Here

  public void testLibraryLocations() throws Exception { testLibraryLocations$(); }
  public void testLibraryLocations$() throws Exception {
    Path compilerPath = epath(CompilerInstallDetector_Test.MOCK_DMD_CMDPATH);
    LibraryLocation[] libLocations = getLibraryLocations(new DMDInstallType(), compilerPath);
   
    checkLibLocations(libLocations, compilerPath.removeLastSegments(3),
      "src/druntime/import", "src/phobos")
  }
 
  @Test
  public void testLibraryLocUnix() throws Exception { testLibraryLocUnix$(); }
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.