Examples of ASFormatter


Examples of com.github.abrarsyed.jastyle.ASFormatter

        return patch;
    }

    private void applyMcpCleanup(File conf) throws IOException, InvalidSyntaxException
    {
        ASFormatter formatter = new ASFormatter();
        OptParser parser = new OptParser(formatter);
        parser.parseOptionFile(conf);

        Reader reader;
        Writer writer;

        GLConstantFixer fixer = new GLConstantFixer();
        ArrayList<String> files = new ArrayList<String>(sourceMap.keySet());
        Collections.sort(files); // Just to make sure we have the same order.. shouldn't matter on anything but lets be careful.

        for (String file : files)
        {
            String text = sourceMap.get(file);

            getLogger().debug("Processing file: " + file);

            getLogger().debug("processing comments");
            text = McpCleanup.stripComments(text);

            getLogger().debug("fixing imports comments");
            text = McpCleanup.fixImports(text);

            getLogger().debug("various other cleanup");
            text = McpCleanup.cleanup(text);

            getLogger().debug("fixing OGL constants");
            text = fixer.fixOGL(text);

            getLogger().debug("formatting source");
            reader = new StringReader(text);
            writer = new StringWriter();
            formatter.format(reader, writer);
            reader.close();
            writer.flush();
            writer.close();
            text = writer.toString();
           
View Full Code Here

Examples of net.sourceforge.astyleclipse.astyle.ASFormatter

  public TextEdit format(int kind, String source, int offset, int length,
      int indentationLevel, String lineSeparator) {
    try {
      // AstyleLog.logInfo(source);
      // kind,offset,length,indentationLevel,lineSeparator);
      ASFormatter formatter = new ASFormatter();

      // TODO : check suffix to set C or Java Style
      // filename = getSourcefileName();
      // if (filename.endsWith(".java")) {
      // formatter.setCStyle(false);
View Full Code Here

Examples of net.sourceforge.astyleclipse.astyle.ASFormatter

  /**
   * @param updateReferenceStore
   * @return
   */
  private boolean updatePreview(boolean updateReferenceStore) {
    ASFormatter formatter = new ASFormatter();
    // AstyleLog.logInfo(selectedStyle);
    if (!selectedStyle.equalsIgnoreCase(ASTYLE_STYLE_NONE)) {
      // style: style=ansi
      if (!AStyle.parseOptions(formatter, "style=" + selectedStyle))
        return false;
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.