Package org.eclipse.core.runtime

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


    IPath path = JavaUtil.getPathOnClasspath(_javaProject, objects[0]);
    String result = null;
    if (path.segmentCount() == 0) {
      return new Object[] { "" }; //$NON-NLS-1$
    }
    path = path.removeFileExtension();
    result = path.toOSString();
    result = result.replace(File.separatorChar, '.');
    return new Object[] { result };
  }
View Full Code Here


    }

    // Try to find an unused numbered variant
    int trial = 1;
    String ext = newPath.getFileExtension();
    String base = newPath.removeFileExtension().toOSString();
    do {
      newPath = Path.fromOSString(base + " (" + trial + ")")
          .addFileExtension(ext);
      if (!container.exists(newPath)) {
        return newPath.toOSString();
View Full Code Here

        @Override
        protected InputStream getInitialContents() {

                IPath path = new Path(getFileName());
                String name = path.removeFileExtension().toString();
                ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
                PrintWriter printWriter = new PrintWriter(outputStream);
                printWriter.println("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");             
                printWriter.println("<composite xmlns=\"http://www.osoa.org/xmlns/sca/1.0\"");
                printWriter.println("    xmlns:t=\"http://tuscany.apache.org/xmlns/sca/1.0\"");
View Full Code Here

    IPath filePath = containerFullPath.append(fileName);
    if (extension != null && !extension.equals(filePath.getFileExtension())) {
      filePath = filePath.addFileExtension(extension);
    }
    extension = filePath.getFileExtension();
    fileName = filePath.removeFileExtension().lastSegment();
    int i = 1;
    while (ResourcesPlugin.getWorkspace().getRoot().exists(filePath)) {
      i++;
      filePath = containerFullPath.append(fileName + i);
      if (extension != null) {
View Full Code Here

    IPath filePath = containerFullPath.append(fileName);
    if (extension != null && !extension.equals(filePath.getFileExtension())) {
      filePath = filePath.addFileExtension(extension);
    }
    extension = filePath.getFileExtension();
    fileName = filePath.removeFileExtension().lastSegment();
    int i = 1;
    while (ResourcesPlugin.getWorkspace().getRoot().exists(filePath)) {
      i++;
      filePath = containerFullPath.append(fileName + i);
      if (extension != null) {
View Full Code Here

    IPath filePath = containerFullPath.append(fileName);
    if (extension != null && !extension.equals(filePath.getFileExtension())) {
      filePath = filePath.addFileExtension(extension);
    }
    extension = filePath.getFileExtension();
    fileName = filePath.removeFileExtension().lastSegment();
    int i = 1;
    while (ResourcesPlugin.getWorkspace().getRoot().exists(filePath)) {
      i++;
      filePath = containerFullPath.append(fileName + i);
      if (extension != null) {
View Full Code Here

    formatcombo.add(UIMessages.ExportReportPage1EMMAFormat_value);
    formatcombo.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(SelectionEvent e) {
        // Adjust the extension to the new format
        IPath path = Path.fromOSString(destinationcombo.getText());
        path = path.removeFileExtension();
        String ext = ISessionExporter.DEFAULT_EXTENSIONS[formatcombo.getSelectionIndex()];
        path = path.addFileExtension(ext);
        destinationcombo.setText(path.toOSString());
      }
    });
View Full Code Here

    formatcombo.add(UIMessages.ExportReportPage1EMMAFormat_value);
    formatcombo.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(SelectionEvent e) {
        // Adjust the extension to the new format
        IPath path = Path.fromOSString(destinationcombo.getText());
        path = path.removeFileExtension();
        String ext = ISessionExporter.DEFAULT_EXTENSIONS[formatcombo.getSelectionIndex()];
        path = path.addFileExtension(ext);
        destinationcombo.setText(path.toOSString());
      }
    });
View Full Code Here

    });
    formatcombo.setInput(ExportFormat.values());
    formatcombo.addSelectionChangedListener(new ISelectionChangedListener() {
      public void selectionChanged(SelectionChangedEvent event) {
        IPath path = Path.fromOSString(destinationcombo.getText());
        path = path.removeFileExtension();
        final ExportFormat format = getExportFormat();
        if (!format.isFolderOutput()) {
          path = path.addFileExtension(format.getFileExtension());
        }
        destinationcombo.setText(path.toOSString());
View Full Code Here

    formatcombo.add(UIMessages.ExportReportPage1EMMAFormat_value);
    formatcombo.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(SelectionEvent e) {
        // Adjust the extension to the new format
        IPath path = Path.fromOSString(destinationcombo.getText());
        path = path.removeFileExtension();
        String ext = ISessionExporter.DEFAULT_EXTENSIONS[formatcombo.getSelectionIndex()];
        path = path.addFileExtension(ext);
        destinationcombo.setText(path.toOSString());
      }
    });
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.