Package org.eclipse.core.runtime

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


    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);
   
    if( jarFile != null )
      jar = proj.getPackageFragmentRoot(jarFile);
View Full Code Here


      jar = proj.getPackageFragmentRoot(jarPath.toString()); // external archive
   
    if( jar == null )
      throw new Exception("Jar " + jarPath + " not found in project " + doc.getProjectName());
   
    IPath pkgPath = filePath.removeLastSegments(1); // remove filename
    String pkgName = pkgPath.lastSegment();
   
    IPackageFragment pkg = jar.getPackageFragment(pkgName);
   
    if( pkg == null )
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

      String file = configuration.getAttribute(Server.FILE_NAME, "");     
      IPath path = new Path(file);
      kernels = new ArrayList<AppKernel>();
     
      if (path != null && path.segmentCount() > 0) {
        IProject rawProject = ResourcesPlugin.getWorkspace().getRoot().getProject(path.removeLastSegments(path.segmentCount()-1).toString());
        if (rawProject != null) {
          project = DLTKCore.create(rawProject);
          kernels = SymfonyKernelAccess.getDefault().getKernels(project);         
        }
      }
View Full Code Here

          testClassName = testClassName.substring(0, pos);
        }
        if (Character.isLowerCase(testClassName.charAt(0))) {
          testClassName = Character.toUpperCase(testClassName.charAt(0)) + testClassName.substring(1);
        }
        IPath containerPath = path.removeLastSegments(1);
        Map<String, String> variables = createVariables(
            "namespaceName", containerPath.removeFirstSegments(2).toString().replace('/', '.'),
            "testClassName", testClassName
        );
        file.create(getInitialContents("sample", variables), false, new NullProgressMonitor());
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.