Package org.eclipse.jdt.core

Examples of org.eclipse.jdt.core.IBuffer.replace()


        pw.println("}");
        createClassConstructor(pw, clazz, fields);
      }
     
      if (formatSource) {
        buffer.replace(pos, 0, sw.toString());
        String builderSource = buffer.getContents();
     
        TextEdit text = ToolFactory.createCodeFormatter(null).format(CodeFormatter.K_COMPILATION_UNIT, builderSource, 0, builderSource.length(), 0, "\n");
        // text is null if source cannot be formatted
        if (text != null) {
View Full Code Here


          Document simpleDocument = new Document(builderSource);
          text.apply(simpleDocument);
          buffer.setContents(simpleDocument.get());
        }
      } else {
        buffer.replace(pos, 0, sw.toString())
      }
    } catch (JavaModelException e) {
      e.printStackTrace();
    } catch (MalformedTreeException e) {
      e.printStackTrace();
View Full Code Here

                fullSource.get(), fTestSuite
                    .findRecommendedLineSeparator());
        // buf.replace(range.getOffset(), range.getLength(),
        // formattedContent);
        IBuffer buf = fTestSuite.getBuffer();
        buf.replace(0, buf.getLength(), formattedContent);
        monitor.worked(1);
        fTestSuite.save(new SubProgressMonitor(monitor, 1), true);
        monitor.worked(1);
      }
    } catch (JavaModelException e) {
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.