Package org.eclipse.core.runtime

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


  } else {
      folderPath = new Path(""); //$NON-NLS-1$
  }
  IResourceInfo rcInfo = config.getResourceInfo(folderPath, false);
  if (rcInfo instanceof IFileInfo) {
      rcInfo = config.getResourceInfo(folderPath.removeLastSegments(1), false);
  }
  String targetExtension = ((IFolderInfo) rcInfo).getOutputExtension(srcExtension);
  if (targetExtension != "") //$NON-NLS-1$
      fileName += DOT + targetExtension;
  IPath projectRelativePath = deletedFile.getProjectRelativePath().removeLastSegments(1);
View Full Code Here


    private ToolInfoHolder getFolderToolInfo(IPath _path) {
  IPath path = _path;
  IResourceInfo rcInfo = config.getResourceInfo(path, false);
  while (rcInfo instanceof IFileInfo) {
      path = path.removeLastSegments(1);
      rcInfo = config.getResourceInfo(path, false);
  }
  return getToolInfo(path, false);
    }
View Full Code Here

   
    final String newFilePrefix = "new_file";
    String fName = newFilePrefix + ".go";
    if (path != null && prjPath != null) {
      sourceFileComposite.getSourceFolderName().setText(path);
      String fullPath = prjPath.removeLastSegments(1).append(path).toOSString();
      File f = new File(fullPath);
     
      String[] newFiles = f.list(new FilenameFilter() {
       
        @Override
View Full Code Here

        while (parentPath.segmentCount() > 0) {
          String pathAsString = parentPath.toOSString();
          if (!includedFolders.contains(pathAsString)) {
            missingParentFolders.add(pathAsString);
          }
          parentPath = parentPath.removeLastSegments(1);
        }
      }
      includedFolders.addAll(missingParentFolders);

      for (String file : includedFiles) {
View Full Code Here

        IPath filePath = new Path(file);
        IPath parentPath = filePath.removeLastSegments(1);
        while (parentPath.segmentCount() > 0) {
          if (includedFolders.add(parentPath.toOSString())) {
            parentPath = parentPath.removeLastSegments(1);
          } else {
            // Parent hierarchy already added
            break;
          }
        }
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

      if (path != null) {
        String ext = path.getFileExtension();
        if (ext != null) {
          path = path.removeFileExtension();
          fileText = path.lastSegment();
          path = path.removeLastSegments(1);
        }
        containerText.setText(path.toString());
      }
    }
    if (! fileText.endsWith(JEXTEST_EXTENSION)) {
View Full Code Here

   */
  private String addBaseURL(IEditorPart editor, String html) {
  try {
    IPathEditorInput input = (IPathEditorInput) editor.getEditorInput();
    IPath path = input.getPath();
    path = path.removeLastSegments(1);
    File f = path.toFile();
    URI fileURI = f.toURI();
    String html2 = "<html><head><base href='"+fileURI+"' /></head><body>\r\n"+html
    +"\r\n</body></html>";
    return html2;
View Full Code Here

      boolean readFromLegacyLocation = false;
      DocumentBuilder docBuilder = SpringCoreUtils.getDocumentBuilder();
      IPath rooInstallFile = RooCoreActivator.getDefault().getStateLocation().append("roo.installs");
      if (!rooInstallFile.toFile().exists()) {
        // Look for legacy install file at <workspace>/.metadata/.plugins/com.springsource.sts.roo.core/roo.installs
        rooInstallFile = rooInstallFile.removeLastSegments(2).append("com.springsource.sts.roo.core/roo.installs");
        readFromLegacyLocation = true;
      }
      if (rooInstallFile.toFile().exists()) {
        Document doc = docBuilder.parse(rooInstallFile.toFile());
        NodeList installNodes = doc.getElementsByTagName("install");
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.