Examples of CodeFormatter


Examples of org.eclipse.jdt.core.formatter.CodeFormatter

    options.put(
        DefaultCodeFormatterConstants.FORMATTER_COMMENT_FORMAT_JAVADOC_COMMENT,
        DefaultCodeFormatterConstants.TRUE);

    // instantiate the default code formatter with the given options
    final CodeFormatter codeFormatter = ToolFactory
        .createCodeFormatter(options);
    final TextEdit editCode = codeFormatter.format(
        CodeFormatter.K_COMPILATION_UNIT
            | CodeFormatter.F_INCLUDE_COMMENTS, source, 0,
        source.length(), 0, System.getProperty("line.separator"));

    IDocument document = new Document(source);
View Full Code Here

Examples of org.eclipse.jdt.core.formatter.CodeFormatter

    options.put(
        DefaultCodeFormatterConstants.FORMATTER_COMMENT_FORMAT_JAVADOC_COMMENT,
        DefaultCodeFormatterConstants.TRUE);

    // instantiate the default code formatter with the given options
    final CodeFormatter codeFormatter = ToolFactory
        .createCodeFormatter(options);
    final TextEdit editCode = codeFormatter.format(
        CodeFormatter.K_COMPILATION_UNIT
            | CodeFormatter.F_INCLUDE_COMMENTS, source, 0,
        source.length(), 0, System.getProperty("line.separator"));

    IDocument document = new Document(source);
View Full Code Here

Examples of org.eclipse.jdt.core.formatter.CodeFormatter

   /**
    * Format the given {@link String} as a Java source type, using the given Eclipse code format {@link Properties}.
    */
   public static String format(Properties prefs, String source)
   {
      final CodeFormatter codeFormatter = ToolFactory.createCodeFormatter(prefs);
      return _format(source, codeFormatter);
   }
View Full Code Here

Examples of org.eclipse.jdt.core.formatter.CodeFormatter

   public static String format(String source)
   {
       // TODO locate user's eclipse project settings, use those if we can.
       Properties options = readConfig("org.eclipse.jdt.core.prefs");

       final CodeFormatter codeFormatter = ToolFactory.createCodeFormatter(options);
       return ensureCorrectNewLines(formatFile(source, codeFormatter));
   }
View Full Code Here

Examples of org.eclipse.jdt.core.formatter.CodeFormatter

   public static String format(JavaClass javaClass)
   {
      // TODO locate user's eclipse project settings, use those if we can.
      Properties options = readConfig("org.eclipse.jdt.core.prefs");

      final CodeFormatter codeFormatter = ToolFactory.createCodeFormatter(options);
      String result = formatFile(javaClass, codeFormatter);

      return result;
   }
View Full Code Here

Examples of org.eclipse.jdt.core.formatter.CodeFormatter

        .readConfig(pathToConfigFile);
    if (properties.isEmpty()) {
      throw new IllegalStateException("incorrect properties file");
    }

    CodeFormatter codeFormatter = ToolFactory
        .createCodeFormatter(properties);
    return codeFormatter;
  }
View Full Code Here

Examples of org.eclipse.jdt.core.formatter.CodeFormatter

            Messages.CommandLineConfigFile, this.configName ) );
      }
      System.out.println( Messages.bind( Messages.CommandLineStart ) );
    }

    final CodeFormatter codeFormatter = ToolFactory
        .createCodeFormatter( this.options );
    // format the list of files and/or directories
    for( int i = 0, max = filesToFormat.length; i < max; i++ )
    {
      final File file = filesToFormat[ i ];
View Full Code Here

Examples of org.eclipse.jdt.core.formatter.CodeFormatter

   public static String format(String source)
   {
       // TODO locate user's eclipse project settings, use those if we can.
       Properties options = readConfig("org.eclipse.jdt.core.prefs");

       final CodeFormatter codeFormatter = ToolFactory.createCodeFormatter(options);
       return ensureCorrectNewLines(formatFile(source, codeFormatter));
   }
View Full Code Here

Examples of org.eclipse.jdt.core.formatter.CodeFormatter

   public static String format(String source)
   {
       // TODO locate user's eclipse project settings, use those if we can.
       Properties options = readConfig("org.eclipse.jdt.core.prefs");

       final CodeFormatter codeFormatter = ToolFactory.createCodeFormatter(options);
       return ensureCorrectNewLines(formatFile(source, codeFormatter));
   }
View Full Code Here

Examples of org.eclipse.jdt.core.formatter.CodeFormatter

   public static String format(String source)
   {
       // TODO locate user's eclipse project settings, use those if we can.
       Properties options = readConfig("org.eclipse.jdt.core.prefs");

       final CodeFormatter codeFormatter = ToolFactory.createCodeFormatter(options);
       return ensureCorrectNewLines(formatFile(source, codeFormatter));
   }
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.