diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/formatter/DefaultCodeFormatterConstants.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/formatter/DefaultCodeFormatterConstants.java index c388bbd94eb..f2df1ac7aab 100644 --- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/formatter/DefaultCodeFormatterConstants.java +++ b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/formatter/DefaultCodeFormatterConstants.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 QNX Software Systems and others. + * Copyright (c) 2000, 2008 QNX Software Systems and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -63,15 +63,14 @@ public class DefaultCodeFormatterConstants { *
 	 * FORMATTER / Value to set a brace location at the end of a line.
 	 * 
- * @see #FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION - * @see #FORMATTER_BRACE_POSITION_FOR_ARRAY_INITIALIZER + * @see #FORMATTER_BRACE_POSITION_FOR_INITIALIZER_LIST * @see #FORMATTER_BRACE_POSITION_FOR_BLOCK * @see #FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION * @see #FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION * @see #FORMATTER_BRACE_POSITION_FOR_SWITCH * @see #FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION */ - public static final String END_OF_LINE = "end_of_line"; //$NON-NLS-1$ + public static final String END_OF_LINE = "end_of_line"; //$NON-NLS-1$ /** *
@@ -154,24 +153,44 @@ public class DefaultCodeFormatterConstants {
 	public static final String FORMATTER_ALIGNMENT_FOR_CONDITIONAL_EXPRESSION = CCorePlugin.PLUGIN_ID + ".formatter.alignment_for_conditional_expression";	 //$NON-NLS-1$
 	/**
 	 * 
-	 * FORMATTER / Option for alignment of expressions in array initializer
+	 * FORMATTER / Option for alignment of expressions in initializer list
 	 *     - option id:         "org.eclipse.cdt.core.formatter.alignment_for_expressions_in_array_initializer"
 	 *     - possible values:   values returned by createAlignmentValue(boolean, int, int) call
 	 *     - default:           createAlignmentValue(false, WRAP_COMPACT, INDENT_DEFAULT)
 	 * 
* @see #createAlignmentValue(boolean, int, int) */ - public static final String FORMATTER_ALIGNMENT_FOR_EXPRESSIONS_IN_ARRAY_INITIALIZER = CCorePlugin.PLUGIN_ID + ".formatter.alignment_for_expressions_in_array_initializer"; //$NON-NLS-1$ -// /** -// *
-//	 * FORMATTER / Option for alignment of multiple fields
-//	 *     - option id:         "org.eclipse.cdt.core.formatter.alignment_for_multiple_fields"
-//	 *     - possible values:   values returned by createAlignmentValue(boolean, int, int) call
-//	 *     - default:           createAlignmentValue(false, WRAP_COMPACT, INDENT_DEFAULT)
-//	 * 
-// * @see #createAlignmentValue(boolean, int, int) -// */ -// public static final String FORMATTER_ALIGNMENT_FOR_MULTIPLE_FIELDS = CCorePlugin.PLUGIN_ID + ".formatter.alignment_for_multiple_fields";//$NON-NLS-1$ + public static final String FORMATTER_ALIGNMENT_FOR_EXPRESSIONS_IN_INITIALIZER_LIST = CCorePlugin.PLUGIN_ID + ".formatter.alignment_for_expressions_in_array_initializer"; //$NON-NLS-1$ + /** + *
+	 * FORMATTER / Option for alignment of a declarator list
+	 *     - option id:         "org.eclipse.cdt.core.formatter.alignment_for_declarator_list"
+	 *     - possible values:   values returned by createAlignmentValue(boolean, int, int) call
+	 *     - default:           createAlignmentValue(false, WRAP_COMPACT, INDENT_DEFAULT)
+	 * 
+ * @see #createAlignmentValue(boolean, int, int) + */ + public static final String FORMATTER_ALIGNMENT_FOR_DECLARATOR_LIST = CCorePlugin.PLUGIN_ID + ".formatter.alignment_for_declarator_list"; //$NON-NLS-1$ + /** + *
+	 * FORMATTER / Option for alignment of a enumerator list
+	 *     - option id:         "org.eclipse.cdt.core.formatter.alignment_for_enumerator_list"
+	 *     - possible values:   values returned by createAlignmentValue(boolean, int, int) call
+	 *     - default:           createAlignmentValue(false, WRAP_ONE_PER_LINE, INDENT_DEFAULT)
+	 * 
+ * @see #createAlignmentValue(boolean, int, int) + */ + public static final String FORMATTER_ALIGNMENT_FOR_ENUMERATOR_LIST = CCorePlugin.PLUGIN_ID + ".formatter.alignment_for_enumerator_list"; //$NON-NLS-1$ + /** + *
+	 * FORMATTER / Option for alignment of a expression list (except arguments in a method invocation)
+	 *     - option id:         "org.eclipse.cdt.core.formatter.alignment_for_expression_list"
+	 *     - possible values:   values returned by createAlignmentValue(boolean, int, int) call
+	 *     - default:           createAlignmentValue(false, WRAP_COMPACT, INDENT_DEFAULT)
+	 * 
+ * @see #createAlignmentValue(boolean, int, int) + */ + public static final String FORMATTER_ALIGNMENT_FOR_EXPRESSION_LIST = CCorePlugin.PLUGIN_ID + ".formatter.alignment_for_expression_list"; //$NON-NLS-1$ /** *
 	 * FORMATTER / Option for alignment of parameters in method declaration
@@ -221,7 +240,7 @@ public class DefaultCodeFormatterConstants {
 //	 *     - default:           "0"
 //	 * 
// */ -// public static final String FORMATTER_BLANK_LINES_AFTER_INCLUDES = CCorePlugin.PLUGIN_ID + ".formatter.blank_lines_after_includes"; //$NON-NLS-1$ +// public static final String FORMATTER_BLANK_LINES_AFTER_INCLUDES = CCorePlugin.PLUGIN_ID + ".formatter.blank_lines_after_includes"; //$NON-NLS-1$ // /** // *
 //	 * FORMATTER / Option to add blank lines at the beginning of the method body
@@ -239,7 +258,7 @@ public class DefaultCodeFormatterConstants {
 //	 *     - default:           "0"
 //	 * 
// */ -// public static final String FORMATTER_BLANK_LINES_BEFORE_FIELD = CCorePlugin.PLUGIN_ID + ".formatter.blank_lines_before_field"; //$NON-NLS-1$ +// public static final String FORMATTER_BLANK_LINES_BEFORE_FIELD = CCorePlugin.PLUGIN_ID + ".formatter.blank_lines_before_field"; //$NON-NLS-1$ // /** // *
 //	 * FORMATTER / Option to add blank lines before the first class body declaration
@@ -248,7 +267,7 @@ public class DefaultCodeFormatterConstants {
 //	 *     - default:           "0"
 //	 * 
// */ -// public static final String FORMATTER_BLANK_LINES_BEFORE_FIRST_CLASS_BODY_DECLARATION = CCorePlugin.PLUGIN_ID + ".formatter.blank_lines_before_first_class_body_declaration"; //$NON-NLS-1$ +// public static final String FORMATTER_BLANK_LINES_BEFORE_FIRST_CLASS_BODY_DECLARATION = CCorePlugin.PLUGIN_ID + ".formatter.blank_lines_before_first_class_body_declaration"; //$NON-NLS-1$ // /** // *
 //	 * FORMATTER / Option to add blank lines before #include directive
@@ -257,7 +276,7 @@ public class DefaultCodeFormatterConstants {
 //	 *     - default:           "0"
 //	 * 
// */ -// public static final String FORMATTER_BLANK_LINES_BEFORE_INCLUDES = CCorePlugin.PLUGIN_ID + ".formatter.blank_lines_before_includes"; //$NON-NLS-1$ +// public static final String FORMATTER_BLANK_LINES_BEFORE_INCLUDES = CCorePlugin.PLUGIN_ID + ".formatter.blank_lines_before_includes"; //$NON-NLS-1$ // /** // *
 //	 * FORMATTER / Option to add blank lines before a member type declaration
@@ -266,7 +285,7 @@ public class DefaultCodeFormatterConstants {
 //	 *     - default:           "0"
 //	 * 
// */ -// public static final String FORMATTER_BLANK_LINES_BEFORE_MEMBER_TYPE = CCorePlugin.PLUGIN_ID + ".formatter.blank_lines_before_member_type"; //$NON-NLS-1$ +// public static final String FORMATTER_BLANK_LINES_BEFORE_MEMBER_TYPE = CCorePlugin.PLUGIN_ID + ".formatter.blank_lines_before_member_type"; //$NON-NLS-1$ // /** // *
 //	 * FORMATTER / Option to add blank lines before a method declaration
@@ -275,7 +294,7 @@ public class DefaultCodeFormatterConstants {
 //	 *     - default:           "0"
 //	 * 
// */ -// public static final String FORMATTER_BLANK_LINES_BEFORE_METHOD = CCorePlugin.PLUGIN_ID + ".formatter.blank_lines_before_method"; //$NON-NLS-1$ +// public static final String FORMATTER_BLANK_LINES_BEFORE_METHOD = CCorePlugin.PLUGIN_ID + ".formatter.blank_lines_before_method"; //$NON-NLS-1$ // /** // *
 //	 * FORMATTER / Option to add blank lines before a new chunk
@@ -284,7 +303,7 @@ public class DefaultCodeFormatterConstants {
 //	 *     - default:           "0"
 //	 * 
// */ -// public static final String FORMATTER_BLANK_LINES_BEFORE_NEW_CHUNK = CCorePlugin.PLUGIN_ID + ".formatter.blank_lines_before_new_chunk"; //$NON-NLS-1$ +// public static final String FORMATTER_BLANK_LINES_BEFORE_NEW_CHUNK = CCorePlugin.PLUGIN_ID + ".formatter.blank_lines_before_new_chunk"; //$NON-NLS-1$ // /** // *
 //	 * FORMATTER / Option to add blank lines between type declarations
@@ -293,10 +312,10 @@ public class DefaultCodeFormatterConstants {
 //	 *     - default:           "0"
 //	 * 
// */ -// public static final String FORMATTER_BLANK_LINES_BETWEEN_TYPE_DECLARATIONS = CCorePlugin.PLUGIN_ID + ".formatter.blank_lines_between_type_declarations"; //$NON-NLS-1$ +// public static final String FORMATTER_BLANK_LINES_BETWEEN_TYPE_DECLARATIONS = CCorePlugin.PLUGIN_ID + ".formatter.blank_lines_between_type_declarations"; //$NON-NLS-1$ /** *
-	 * FORMATTER / Option to position the braces of array initializer
+	 * FORMATTER / Option to position the braces of initializer list
 	 *     - option id:         "org.eclipse.cdt.core.formatter.brace_position_for_array_initializer"
 	 *     - possible values:   { END_OF_LINE, NEXT_LINE, NEXT_LINE_SHIFTED, NEXT_LINE_ON_WRAP }
 	 *     - default:           END_OF_LINE
@@ -306,7 +325,7 @@ public class DefaultCodeFormatterConstants {
 	 * @see #NEXT_LINE_SHIFTED
 	 * @see #NEXT_LINE_ON_WRAP
 	 */
-	public static final String FORMATTER_BRACE_POSITION_FOR_ARRAY_INITIALIZER = CCorePlugin.PLUGIN_ID + ".formatter.brace_position_for_array_initializer";	//$NON-NLS-1$
+	public static final String FORMATTER_BRACE_POSITION_FOR_INITIALIZER_LIST = CCorePlugin.PLUGIN_ID + ".formatter.brace_position_for_array_initializer"; //$NON-NLS-1$
 	/**
 	 * 
 	 * FORMATTER / Option to position the braces of a block
@@ -319,7 +338,7 @@ public class DefaultCodeFormatterConstants {
 	 * @see #NEXT_LINE_SHIFTED
 	 * @see #NEXT_LINE_ON_WRAP
 	 */
-	public static final String FORMATTER_BRACE_POSITION_FOR_BLOCK = CCorePlugin.PLUGIN_ID + ".formatter.brace_position_for_block";	//$NON-NLS-1$
+	public static final String FORMATTER_BRACE_POSITION_FOR_BLOCK = CCorePlugin.PLUGIN_ID + ".formatter.brace_position_for_block"; //$NON-NLS-1$
 	/**
 	 * 
 	 * FORMATTER / Option to position the braces of a block in a case statement when the block is the first statement following
@@ -333,7 +352,7 @@ public class DefaultCodeFormatterConstants {
 	 * @see #NEXT_LINE_SHIFTED
 	 * @see #NEXT_LINE_ON_WRAP
 	 */
-	public static final String FORMATTER_BRACE_POSITION_FOR_BLOCK_IN_CASE = CCorePlugin.PLUGIN_ID + ".formatter.brace_position_for_block_in_case";	//$NON-NLS-1$
+	public static final String FORMATTER_BRACE_POSITION_FOR_BLOCK_IN_CASE = CCorePlugin.PLUGIN_ID + ".formatter.brace_position_for_block_in_case"; //$NON-NLS-1$
 //	/**
 //	 * 
 //	 * FORMATTER / Option to position the braces of an enum declaration
@@ -346,7 +365,7 @@ public class DefaultCodeFormatterConstants {
 //	 * @see #NEXT_LINE_SHIFTED
 //	 * @see #NEXT_LINE_ON_WRAP
 //	 */
-//	public static final String FORMATTER_BRACE_POSITION_FOR_ENUM_DECLARATION = CCorePlugin.PLUGIN_ID + ".formatter.brace_position_for_enum_declaration";	//$NON-NLS-1$
+//	public static final String FORMATTER_BRACE_POSITION_FOR_ENUM_DECLARATION = CCorePlugin.PLUGIN_ID + ".formatter.brace_position_for_enum_declaration"; //$NON-NLS-1$
 	/**
 	 * 
 	 * FORMATTER / Option to position the braces of a method declaration
@@ -359,7 +378,7 @@ public class DefaultCodeFormatterConstants {
 	 * @see #NEXT_LINE_SHIFTED
 	 * @see #NEXT_LINE_ON_WRAP
 	 */
-	public static final String FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION = CCorePlugin.PLUGIN_ID + ".formatter.brace_position_for_method_declaration";	//$NON-NLS-1$
+	public static final String FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION = CCorePlugin.PLUGIN_ID + ".formatter.brace_position_for_method_declaration"; //$NON-NLS-1$
 	/**
 	 * 
 	 * FORMATTER / Option to position the braces of a switch statement
@@ -372,7 +391,7 @@ public class DefaultCodeFormatterConstants {
 	 * @see #NEXT_LINE_SHIFTED
 	 * @see #NEXT_LINE_ON_WRAP
 	 */
-	public static final String FORMATTER_BRACE_POSITION_FOR_SWITCH = CCorePlugin.PLUGIN_ID + ".formatter.brace_position_for_switch";	//$NON-NLS-1$
+	public static final String FORMATTER_BRACE_POSITION_FOR_SWITCH = CCorePlugin.PLUGIN_ID + ".formatter.brace_position_for_switch"; //$NON-NLS-1$
 	/**
 	 * 
 	 * FORMATTER / Option to position the braces of a type declaration
@@ -385,7 +404,7 @@ public class DefaultCodeFormatterConstants {
 	 * @see #NEXT_LINE_SHIFTED
 	 * @see #NEXT_LINE_ON_WRAP
 	 */
-	public static final String FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION = CCorePlugin.PLUGIN_ID + ".formatter.brace_position_for_type_declaration";	//$NON-NLS-1$
+	public static final String FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION = CCorePlugin.PLUGIN_ID + ".formatter.brace_position_for_type_declaration"; //$NON-NLS-1$
 	/**
 	 * 
 	 * FORMATTER / Option to position the braces of a namespace declaration
@@ -398,7 +417,7 @@ public class DefaultCodeFormatterConstants {
 	 * @see #NEXT_LINE_SHIFTED
 	 * @see #NEXT_LINE_ON_WRAP
 	 */
-	public static final String FORMATTER_BRACE_POSITION_FOR_NAMESPACE_DECLARATION = CCorePlugin.PLUGIN_ID + ".formatter.brace_position_for_namespace_declaration";	//$NON-NLS-1$
+	public static final String FORMATTER_BRACE_POSITION_FOR_NAMESPACE_DECLARATION = CCorePlugin.PLUGIN_ID + ".formatter.brace_position_for_namespace_declaration"; //$NON-NLS-1$
 
 //	/**
 //	 * 
@@ -468,7 +487,7 @@ public class DefaultCodeFormatterConstants {
 	 * @see #TRUE
 	 * @see #FALSE
 	 */
-	public static final String FORMATTER_COMPACT_ELSE_IF = CCorePlugin.PLUGIN_ID + ".formatter.compact_else_if";	//$NON-NLS-1$
+	public static final String FORMATTER_COMPACT_ELSE_IF = CCorePlugin.PLUGIN_ID + ".formatter.compact_else_if"; //$NON-NLS-1$
 
 	/**
 	 * 
@@ -478,27 +497,16 @@ public class DefaultCodeFormatterConstants {
 	 *     - default:           "2"
 	 * 
*/ - public static final String FORMATTER_CONTINUATION_INDENTATION = CCorePlugin.PLUGIN_ID + ".formatter.continuation_indentation"; //$NON-NLS-1$ + public static final String FORMATTER_CONTINUATION_INDENTATION = CCorePlugin.PLUGIN_ID + ".formatter.continuation_indentation"; //$NON-NLS-1$ /** *
-	 * FORMATTER / Option to set the continuation indentation inside array initializer
+	 * FORMATTER / Option to set the continuation indentation inside initializer list
 	 *     - option id:         "org.eclipse.cdt.core.formatter.continuation_indentation_for_array_initializer"
 	 *     - possible values:   "<n>", where n is zero or a positive integer
 	 *     - default:           "2"
 	 * 
*/ - public static final String FORMATTER_CONTINUATION_INDENTATION_FOR_ARRAY_INITIALIZER = CCorePlugin.PLUGIN_ID + ".formatter.continuation_indentation_for_array_initializer"; //$NON-NLS-1$ -// /** -// *
-//	 * FORMATTER / Option to indent body declarations compare to its enclosing enum declaration header
-//	 *     - option id:         "org.eclipse.cdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header"
-//	 *     - possible values:   { TRUE, FALSE }
-//	 *     - default:           TRUE
-//	 * 
-// * @see #TRUE -// * @see #FALSE -// */ -// public static final String FORMATTER_INDENT_BODY_DECLARATIONS_COMPARE_TO_ENUM_DECLARATION_HEADER = CCorePlugin.PLUGIN_ID + ".formatter.indent_body_declarations_compare_to_enum_declaration_header"; //$NON-NLS-1$ + public static final String FORMATTER_CONTINUATION_INDENTATION_FOR_INITIALIZER_LIST = CCorePlugin.PLUGIN_ID + ".formatter.continuation_indentation_for_array_initializer"; //$NON-NLS-1$ /** *
 	 * FORMATTER / Option to indent body declarations compare to its enclosing type header
@@ -520,7 +528,7 @@ public class DefaultCodeFormatterConstants {
 	 * @see #TRUE
 	 * @see #FALSE
 	 */
-	public static final String FORMATTER_INDENT_BODY_DECLARATIONS_COMPARE_TO_ACCESS_SPECIFIER = CCorePlugin.PLUGIN_ID + ".formatter.indent_body_declarations_compare_to_access_specifier";	//$NON-NLS-1$
+	public static final String FORMATTER_INDENT_BODY_DECLARATIONS_COMPARE_TO_ACCESS_SPECIFIER = CCorePlugin.PLUGIN_ID + ".formatter.indent_body_declarations_compare_to_access_specifier"; //$NON-NLS-1$
 	/**
 	 * 
 	 * FORMATTER / Option to indent body declarations compare to its enclosing namespace header
@@ -531,7 +539,7 @@ public class DefaultCodeFormatterConstants {
 	 * @see #TRUE
 	 * @see #FALSE
 	 */
-	public static final String FORMATTER_INDENT_BODY_DECLARATIONS_COMPARE_TO_NAMESPACE_HEADER = CCorePlugin.PLUGIN_ID + ".formatter.indent_body_declarations_compare_to_namespace_header";	//$NON-NLS-1$
+	public static final String FORMATTER_INDENT_BODY_DECLARATIONS_COMPARE_TO_NAMESPACE_HEADER = CCorePlugin.PLUGIN_ID + ".formatter.indent_body_declarations_compare_to_namespace_header"; //$NON-NLS-1$
 	/**
 	 * 
 	 * FORMATTER / Option to indent breaks compare to cases
@@ -542,7 +550,7 @@ public class DefaultCodeFormatterConstants {
 	 * @see #TRUE
 	 * @see #FALSE
 	 */
-	public static final String FORMATTER_INDENT_BREAKS_COMPARE_TO_CASES = CCorePlugin.PLUGIN_ID + ".formatter.indent_breaks_compare_to_cases";	//$NON-NLS-1$
+	public static final String FORMATTER_INDENT_BREAKS_COMPARE_TO_CASES = CCorePlugin.PLUGIN_ID + ".formatter.indent_breaks_compare_to_cases"; //$NON-NLS-1$
 	/**
 	 * 
 	 * FORMATTER / Option to indent empty lines
@@ -597,7 +605,7 @@ public class DefaultCodeFormatterConstants {
 	 * @see #TRUE
 	 * @see #FALSE
 	 */
-	public static final String FORMATTER_INDENT_SWITCHSTATEMENTS_COMPARE_TO_CASES = CCorePlugin.PLUGIN_ID + ".formatter.indent_switchstatements_compare_to_cases";	//$NON-NLS-1$
+	public static final String FORMATTER_INDENT_SWITCHSTATEMENTS_COMPARE_TO_CASES = CCorePlugin.PLUGIN_ID + ".formatter.indent_switchstatements_compare_to_cases"; //$NON-NLS-1$
 	/**
 	 * 
 	 * FORMATTER / Option to indent switch statements compare to switch
@@ -608,7 +616,7 @@ public class DefaultCodeFormatterConstants {
 	 * @see #TRUE
 	 * @see #FALSE
 	 */
-	public static final String FORMATTER_INDENT_SWITCHSTATEMENTS_COMPARE_TO_SWITCH = CCorePlugin.PLUGIN_ID + ".formatter.indent_switchstatements_compare_to_switch";	//$NON-NLS-1$
+	public static final String FORMATTER_INDENT_SWITCHSTATEMENTS_COMPARE_TO_SWITCH = CCorePlugin.PLUGIN_ID + ".formatter.indent_switchstatements_compare_to_switch"; //$NON-NLS-1$
 	/**
 	 * 
 	 * FORMATTER / Option to specify the equivalent number of spaces that represents one indentation 
@@ -623,7 +631,7 @@ public class DefaultCodeFormatterConstants {
 	public static final String FORMATTER_INDENTATION_SIZE = CCorePlugin.PLUGIN_ID + ".formatter.indentation.size"; //$NON-NLS-1$
 	/**
 	 * 
-	 * FORMATTER / Option to insert a new line after the opening brace in an array initializer
+	 * FORMATTER / Option to insert a new line after the opening brace in an initializer list
 	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer"
 	 *     - possible values:   { INSERT, DO_NOT_INSERT }
 	 *     - default:           DO_NOT_INSERT
@@ -631,7 +639,7 @@ public class DefaultCodeFormatterConstants {
 	 * @see CCorePlugin#INSERT
 	 * @see CCorePlugin#DO_NOT_INSERT
 	 */
-	public static final String FORMATTER_INSERT_NEW_LINE_AFTER_OPENING_BRACE_IN_ARRAY_INITIALIZER = CCorePlugin.PLUGIN_ID + ".formatter.insert_new_line_after_opening_brace_in_array_initializer";//$NON-NLS-1$
+	public static final String FORMATTER_INSERT_NEW_LINE_AFTER_OPENING_BRACE_IN_INITIALIZER_LIST = CCorePlugin.PLUGIN_ID + ".formatter.insert_new_line_after_opening_brace_in_array_initializer";//$NON-NLS-1$
 
 	/**
 	 * 
@@ -654,10 +662,10 @@ public class DefaultCodeFormatterConstants {
 //	 * @see CCorePlugin#INSERT
 //	 * @see CCorePlugin#DO_NOT_INSERT
 //	 */
-//	public static final String FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT = CCorePlugin.PLUGIN_ID + ".formatter.insert_new_line_before_catch_in_try_statement";	//$NON-NLS-1$
+//	public static final String FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT = CCorePlugin.PLUGIN_ID + ".formatter.insert_new_line_before_catch_in_try_statement"; //$NON-NLS-1$
 	/**
 	 * 
-	 * FORMATTER / Option to insert a new line before the closing brace in an array initializer
+	 * FORMATTER / Option to insert a new line before the closing brace in an initializer list
 	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer"
 	 *     - possible values:   { INSERT, DO_NOT_INSERT }
 	 *     - default:           DO_NOT_INSERT
@@ -665,7 +673,7 @@ public class DefaultCodeFormatterConstants {
 	 * @see CCorePlugin#INSERT
 	 * @see CCorePlugin#DO_NOT_INSERT
 	 */
-	public static final String FORMATTER_INSERT_NEW_LINE_BEFORE_CLOSING_BRACE_IN_ARRAY_INITIALIZER = CCorePlugin.PLUGIN_ID + ".formatter.insert_new_line_before_closing_brace_in_array_initializer";//$NON-NLS-1$
+	public static final String FORMATTER_INSERT_NEW_LINE_BEFORE_CLOSING_BRACE_IN_INITIALIZER_LIST = CCorePlugin.PLUGIN_ID + ".formatter.insert_new_line_before_closing_brace_in_array_initializer";//$NON-NLS-1$
 	/**
 	 * 
 	 * FORMATTER / Option to insert a new line before the else keyword in if statement
@@ -676,7 +684,7 @@ public class DefaultCodeFormatterConstants {
 	 * @see CCorePlugin#INSERT
 	 * @see CCorePlugin#DO_NOT_INSERT
 	 */
-	public static final String FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT = CCorePlugin.PLUGIN_ID + ".formatter.insert_new_line_before_else_in_if_statement";	//$NON-NLS-1$
+	public static final String FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT = CCorePlugin.PLUGIN_ID + ".formatter.insert_new_line_before_else_in_if_statement"; //$NON-NLS-1$
 //	/**
 //	 * 
 //	 * FORMATTER / Option to insert a new line before the finally keyword in try statement
@@ -687,7 +695,7 @@ public class DefaultCodeFormatterConstants {
 //	 * @see CCorePlugin#INSERT
 //	 * @see CCorePlugin#DO_NOT_INSERT
 //	 */
-//	public static final String FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT = CCorePlugin.PLUGIN_ID + ".formatter.insert_new_line_before_finally_in_try_statement";	//$NON-NLS-1$
+//	public static final String FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT = CCorePlugin.PLUGIN_ID + ".formatter.insert_new_line_before_finally_in_try_statement"; //$NON-NLS-1$
 	/**
 	 * 
 	 * FORMATTER / Option to insert a new line before while in do statement
@@ -698,18 +706,7 @@ public class DefaultCodeFormatterConstants {
 	 * @see CCorePlugin#INSERT
 	 * @see CCorePlugin#DO_NOT_INSERT
 	 */
-	public static final String FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT = CCorePlugin.PLUGIN_ID + ".formatter.insert_new_line_before_while_in_do_statement";	//$NON-NLS-1$
-//	/**
-//	 * 
-//	 * FORMATTER / Option to insert a new line in an empty anonymous type declaration
-//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration"
-//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
-//	 *     - default:           INSERT
-//	 * 
-// * @see CCorePlugin#INSERT -// * @see CCorePlugin#DO_NOT_INSERT -// */ -// public static final String FORMATTER_INSERT_NEW_LINE_IN_EMPTY_ANONYMOUS_TYPE_DECLARATION = CCorePlugin.PLUGIN_ID + ".formatter.insert_new_line_in_empty_anonymous_type_declaration"; //$NON-NLS-1$ + public static final String FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT = CCorePlugin.PLUGIN_ID + ".formatter.insert_new_line_before_while_in_do_statement"; //$NON-NLS-1$ /** *
 	 * FORMATTER / Option to insert a new line in an empty block
@@ -720,7 +717,7 @@ public class DefaultCodeFormatterConstants {
 	 * @see CCorePlugin#INSERT
 	 * @see CCorePlugin#DO_NOT_INSERT
 	 */
-	public static final String FORMATTER_INSERT_NEW_LINE_IN_EMPTY_BLOCK = CCorePlugin.PLUGIN_ID + ".formatter.insert_new_line_in_empty_block";	//$NON-NLS-1$
+	public static final String FORMATTER_INSERT_NEW_LINE_IN_EMPTY_BLOCK = CCorePlugin.PLUGIN_ID + ".formatter.insert_new_line_in_empty_block"; //$NON-NLS-1$
 //	/**
 //	 * 
 //	 * FORMATTER / Option to insert a new line in an empty enum declaration
@@ -731,7 +728,7 @@ public class DefaultCodeFormatterConstants {
 //	 * @see CCorePlugin#INSERT
 //	 * @see CCorePlugin#DO_NOT_INSERT
 //	 */
-//	public static final String FORMATTER_INSERT_NEW_LINE_IN_EMPTY_ENUM_DECLARATION = CCorePlugin.PLUGIN_ID + ".formatter.insert_new_line_in_empty_enum_declaration";	//$NON-NLS-1$
+//	public static final String FORMATTER_INSERT_NEW_LINE_IN_EMPTY_ENUM_DECLARATION = CCorePlugin.PLUGIN_ID + ".formatter.insert_new_line_in_empty_enum_declaration"; //$NON-NLS-1$
 //	/**
 //	 * 
 //	 * FORMATTER / Option to insert a new line in an empty method body
@@ -742,7 +739,7 @@ public class DefaultCodeFormatterConstants {
 //	 * @see CCorePlugin#INSERT
 //	 * @see CCorePlugin#DO_NOT_INSERT
 //	 */
-//	public static final String FORMATTER_INSERT_NEW_LINE_IN_EMPTY_METHOD_BODY = CCorePlugin.PLUGIN_ID + ".formatter.insert_new_line_in_empty_method_body";	//$NON-NLS-1$
+//	public static final String FORMATTER_INSERT_NEW_LINE_IN_EMPTY_METHOD_BODY = CCorePlugin.PLUGIN_ID + ".formatter.insert_new_line_in_empty_method_body"; //$NON-NLS-1$
 //	/**
 //	 * 
 //	 * FORMATTER / Option to insert a new line in an empty type declaration
@@ -753,62 +750,51 @@ public class DefaultCodeFormatterConstants {
 //	 * @see CCorePlugin#INSERT
 //	 * @see CCorePlugin#DO_NOT_INSERT
 //	 */
-//	public static final String FORMATTER_INSERT_NEW_LINE_IN_EMPTY_TYPE_DECLARATION = CCorePlugin.PLUGIN_ID + ".formatter.insert_new_line_in_empty_type_declaration";	//$NON-NLS-1$
-//	/**
-//	 * 
-//	 * FORMATTER / Option to insert a space after and in type parameter
-//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_after_and_in_type_parameter"
-//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
-//	 *     - default:           INSERT
-//	 * 
-// * @see CCorePlugin#INSERT -// * @see CCorePlugin#DO_NOT_INSERT -// */ -// public static final String FORMATTER_INSERT_SPACE_AFTER_AND_IN_TYPE_PARAMETER = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_and_in_type_parameter"; //$NON-NLS-1$ -// /** -// *
-//	 * FORMATTER / Option to insert a space after an assignment operator
-//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_after_assignment_operator"
-//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
-//	 *     - default:           INSERT
-//	 * 
-// * @see CCorePlugin#INSERT -// * @see CCorePlugin#DO_NOT_INSERT -// */ -// public static final String FORMATTER_INSERT_SPACE_AFTER_ASSIGNMENT_OPERATOR = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_assignment_operator"; //$NON-NLS-1$ -// /** -// *
-//	 * FORMATTER / Option to insert a space after a binary operator
-//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_after_binary_operator"
-//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
-//	 *     - default:           INSERT
-//	 * 
-// * @see CCorePlugin#INSERT -// * @see CCorePlugin#DO_NOT_INSERT -// */ -// public static final String FORMATTER_INSERT_SPACE_AFTER_BINARY_OPERATOR = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_binary_operator"; //$NON-NLS-1$ -// /** -// *
-//	 * FORMATTER / Option to insert a space after the closing angle bracket in type arguments
-//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments"
-//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
-//	 *     - default:           INSERT
-//	 * 
-// * @see CCorePlugin#INSERT -// * @see CCorePlugin#DO_NOT_INSERT -// */ -// public static final String FORMATTER_INSERT_SPACE_AFTER_CLOSING_ANGLE_BRACKET_IN_TYPE_ARGUMENTS = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_closing_angle_bracket_in_type_arguments"; //$NON-NLS-1$ -// /** -// *
-//	 * FORMATTER / Option to insert a space after the closing angle bracket in type parameters
-//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters"
-//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
-//	 *     - default:           INSERT
-//	 * 
-// * @see CCorePlugin#INSERT -// * @see CCorePlugin#DO_NOT_INSERT -// */ -// public static final String FORMATTER_INSERT_SPACE_AFTER_CLOSING_ANGLE_BRACKET_IN_TYPE_PARAMETERS = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_closing_angle_bracket_in_type_parameters"; //$NON-NLS-1$ +// public static final String FORMATTER_INSERT_NEW_LINE_IN_EMPTY_TYPE_DECLARATION = CCorePlugin.PLUGIN_ID + ".formatter.insert_new_line_in_empty_type_declaration"; //$NON-NLS-1$ + /** + *
+	 * FORMATTER / Option to insert a space after an assignment operator
+	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_after_assignment_operator"
+	 *     - possible values:   { INSERT, DO_NOT_INSERT }
+	 *     - default:           INSERT
+	 * 
+ * @see CCorePlugin#INSERT + * @see CCorePlugin#DO_NOT_INSERT + */ + public static final String FORMATTER_INSERT_SPACE_AFTER_ASSIGNMENT_OPERATOR = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_assignment_operator"; //$NON-NLS-1$ + /** + *
+	 * FORMATTER / Option to insert a space after a binary operator
+	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_after_binary_operator"
+	 *     - possible values:   { INSERT, DO_NOT_INSERT }
+	 *     - default:           INSERT
+	 * 
+ * @see CCorePlugin#INSERT + * @see CCorePlugin#DO_NOT_INSERT + */ + public static final String FORMATTER_INSERT_SPACE_AFTER_BINARY_OPERATOR = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_binary_operator"; //$NON-NLS-1$ + /** + *
+	 * FORMATTER / Option to insert a space after the closing angle bracket in template arguments
+	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_after_closing_angle_bracket_in_template_arguments"
+	 *     - possible values:   { INSERT, DO_NOT_INSERT }
+	 *     - default:           INSERT
+	 * 
+ * @see CCorePlugin#INSERT + * @see CCorePlugin#DO_NOT_INSERT + */ + public static final String FORMATTER_INSERT_SPACE_AFTER_CLOSING_ANGLE_BRACKET_IN_TEMPLATE_ARGUMENTS = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_closing_angle_bracket_in_template_arguments"; //$NON-NLS-1$ + /** + *
+	 * FORMATTER / Option to insert a space after the closing angle bracket in template parameters
+	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_after_closing_angle_bracket_in_template_parameters"
+	 *     - possible values:   { INSERT, DO_NOT_INSERT }
+	 *     - default:           INSERT
+	 * 
+ * @see CCorePlugin#INSERT + * @see CCorePlugin#DO_NOT_INSERT + */ + public static final String FORMATTER_INSERT_SPACE_AFTER_CLOSING_ANGLE_BRACKET_IN_TEMPLATE_PARAMETERS = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_closing_angle_bracket_in_template_parameters"; //$NON-NLS-1$ /** *
 	 * FORMATTER / Option to insert a space after the closing brace of a block
@@ -820,17 +806,28 @@ public class DefaultCodeFormatterConstants {
 	 * @see CCorePlugin#DO_NOT_INSERT
 	 */
 	public static final String FORMATTER_INSERT_SPACE_AFTER_CLOSING_BRACE_IN_BLOCK = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_closing_brace_in_block"; //$NON-NLS-1$
-//	/**
-//	 * 
-//	 * FORMATTER / Option to insert a space after the closing parenthesis of a cast expression
-//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_after_closing_paren_in_cast"
-//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
-//	 *     - default:           INSERT
-//	 * 
-// * @see CCorePlugin#INSERT -// * @see CCorePlugin#DO_NOT_INSERT -// */ -// public static final String FORMATTER_INSERT_SPACE_AFTER_CLOSING_PAREN_IN_CAST = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_closing_paren_in_cast"; //$NON-NLS-1$ + /** + *
+	 * FORMATTER / Option to insert a space after the closing parenthesis of a cast expression
+	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_after_closing_paren_in_cast"
+	 *     - possible values:   { INSERT, DO_NOT_INSERT }
+	 *     - default:           INSERT
+	 * 
+ * @see CCorePlugin#INSERT + * @see CCorePlugin#DO_NOT_INSERT + */ + public static final String FORMATTER_INSERT_SPACE_AFTER_CLOSING_PAREN_IN_CAST = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_closing_paren_in_cast"; //$NON-NLS-1$ + /** + *
+	 * FORMATTER / Option to insert a space after colon in a base clause of a type definition
+	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_after_colon_in_base_clause"
+	 *     - possible values:   { INSERT, DO_NOT_INSERT }
+	 *     - default:           INSERT
+	 * 
+ * @see CCorePlugin#INSERT + * @see CCorePlugin#DO_NOT_INSERT + */ + public static final String FORMATTER_INSERT_SPACE_AFTER_COLON_IN_BASE_CLAUSE = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_colon_in_base_clause"; //$NON-NLS-1$ /** *
 	 * FORMATTER / Option to insert a space after colon in a case statement when a opening brace follows the colon
@@ -841,7 +838,7 @@ public class DefaultCodeFormatterConstants {
 	 * @see CCorePlugin#INSERT
 	 * @see CCorePlugin#DO_NOT_INSERT
 	 */
-	public static final String FORMATTER_INSERT_SPACE_AFTER_COLON_IN_CASE = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_colon_in_case";	//$NON-NLS-1$
+	public static final String FORMATTER_INSERT_SPACE_AFTER_COLON_IN_CASE = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_colon_in_case"; //$NON-NLS-1$
 	/**
 	 * 
 	 * FORMATTER / Option to insert a space after the colon in a conditional expression
@@ -853,20 +850,20 @@ public class DefaultCodeFormatterConstants {
 	 * @see CCorePlugin#DO_NOT_INSERT
 	 */
 	public static final String FORMATTER_INSERT_SPACE_AFTER_COLON_IN_CONDITIONAL = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_colon_in_conditional"; //$NON-NLS-1$
-//	/**
-//	 * 
-//	 * FORMATTER / Option to insert a space after the colon in a labeled statement
-//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_after_colon_in_labeled_statement"
-//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
-//	 *     - default:           INSERT
-//	 * 
-// * @see CCorePlugin#INSERT -// * @see CCorePlugin#DO_NOT_INSERT -// */ -// public static final String FORMATTER_INSERT_SPACE_AFTER_COLON_IN_LABELED_STATEMENT = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_colon_in_labeled_statement"; //$NON-NLS-1$ /** *
-	 * FORMATTER / Option to insert a space after the comma in an array initializer
+	 * FORMATTER / Option to insert a space after the colon in a labeled statement
+	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_after_colon_in_labeled_statement"
+	 *     - possible values:   { INSERT, DO_NOT_INSERT }
+	 *     - default:           INSERT
+	 * 
+ * @see CCorePlugin#INSERT + * @see CCorePlugin#DO_NOT_INSERT + */ + public static final String FORMATTER_INSERT_SPACE_AFTER_COLON_IN_LABELED_STATEMENT = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_colon_in_labeled_statement"; //$NON-NLS-1$ + /** + *
+	 * FORMATTER / Option to insert a space after the comma in an initializer list
 	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_after_comma_in_array_initializer"
 	 *     - possible values:   { INSERT, DO_NOT_INSERT }
 	 *     - default:           INSERT
@@ -874,18 +871,29 @@ public class DefaultCodeFormatterConstants {
 	 * @see CCorePlugin#INSERT
 	 * @see CCorePlugin#DO_NOT_INSERT
 	 */
-	public static final String FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_ARRAY_INITIALIZER = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_comma_in_array_initializer"; //$NON-NLS-1$
+	public static final String FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_INITIALIZER_LIST = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_comma_in_array_initializer"; //$NON-NLS-1$
+	/**
+	 * 
+	 * FORMATTER / Option to insert a space after the comma in enum declarations
+	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_after_comma_in_enum_declarations"
+	 *     - possible values:   { INSERT, DO_NOT_INSERT }
+	 *     - default:           INSERT
+	 * 
+ * @see CCorePlugin#INSERT + * @see CCorePlugin#DO_NOT_INSERT + */ + public static final String FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_ENUM_DECLARATIONS = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_comma_in_enum_declarations"; //$NON-NLS-1$ // /** // *
-//	 * FORMATTER / Option to insert a space after the comma in enum declarations
-//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_after_comma_in_enum_declarations"
+//	 * FORMATTER / Option to insert a space after the comma in the increments of a for statement
+//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_after_comma_in_for_increments"
 //	 *     - possible values:   { INSERT, DO_NOT_INSERT }
 //	 *     - default:           INSERT
 //	 * 
// * @see CCorePlugin#INSERT // * @see CCorePlugin#DO_NOT_INSERT // */ -// public static final String FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_ENUM_DECLARATIONS = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_comma_in_enum_declarations"; //$NON-NLS-1$ +// public static final String FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_FOR_INCREMENTS = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_comma_in_for_increments"; //$NON-NLS-1$ // /** // *
 //	 * FORMATTER / Option to insert a space after the comma in the initializations of a for statement
@@ -930,72 +938,61 @@ public class DefaultCodeFormatterConstants {
 	 * @see CCorePlugin#DO_NOT_INSERT
 	 */
 	public static final String FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_METHOD_INVOCATION_ARGUMENTS = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_comma_in_method_invocation_arguments"; //$NON-NLS-1$
-//	/**
-//	 * 
-//	 * FORMATTER / Option to insert a space after the comma in multiple field declaration
-//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations"
-//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
-//	 *     - default:           INSERT
-//	 * 
-// * @see CCorePlugin#INSERT -// * @see CCorePlugin#DO_NOT_INSERT -// */ -// public static final String FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_MULTIPLE_FIELD_DECLARATIONS = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_comma_in_multiple_field_declarations"; //$NON-NLS-1$ -// /** -// *
-//	 * FORMATTER / Option to insert a space after the comma in multiple local declaration
-//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations"
-//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
-//	 *     - default:           INSERT
-//	 * 
-// * @see CCorePlugin#INSERT -// * @see CCorePlugin#DO_NOT_INSERT -// */ -// public static final String FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_MULTIPLE_LOCAL_DECLARATIONS = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_comma_in_multiple_local_declarations"; //$NON-NLS-1$ -// /** -// *
-//	 * FORMATTER / Option to insert a space after the comma in parameterized type reference
-//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference"
-//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
-//	 *     - default:           INSERT
-//	 * 
-// * @see CCorePlugin#INSERT -// * @see CCorePlugin#DO_NOT_INSERT -// */ -// public static final String FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_PARAMETERIZED_TYPE_REFERENCE = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_comma_in_parameterized_type_reference"; //$NON-NLS-1$ -// /** -// *
-//	 * FORMATTER / Option to insert a space after the comma in base type names of a type header
-//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_after_comma_in_base_types"
-//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
-//	 *     - default:           INSERT
-//	 * 
-// * @see CCorePlugin#INSERT -// * @see CCorePlugin#DO_NOT_INSERT -// */ -// public static final String FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_BASE_TYPES = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_comma_in_base_types"; //$NON-NLS-1$ -// /** -// *
-//	 * FORMATTER / Option to insert a space after the comma in type arguments
-//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_after_comma_in_type_arguments"
-//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
-//	 *     - default:           INSERT
-//	 * 
-// * @see CCorePlugin#INSERT -// * @see CCorePlugin#DO_NOT_INSERT -// */ -// public static final String FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_TYPE_ARGUMENTS = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_comma_in_type_arguments"; //$NON-NLS-1$ -// /** -// *
-//	 * FORMATTER / Option to insert a space after the comma in type parameters
-//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_after_comma_in_type_parameters"
-//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
-//	 *     - default:           INSERT
-//	 * 
-// * @see CCorePlugin#INSERT -// * @see CCorePlugin#DO_NOT_INSERT -// */ -// public static final String FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_TYPE_PARAMETERS = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_comma_in_type_parameters"; //$NON-NLS-1$ + /** + *
+	 * FORMATTER / Option to insert a space after the comma in a declarator list
+	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_after_comma_in_declarator_list"
+	 *     - possible values:   { INSERT, DO_NOT_INSERT }
+	 *     - default:           INSERT
+	 * 
+ * @see CCorePlugin#INSERT + * @see CCorePlugin#DO_NOT_INSERT + */ + public static final String FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_DECLARATOR_LIST = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_comma_in_declarator_list"; //$NON-NLS-1$ + /** + *
+	 * FORMATTER / Option to insert a space after the comma in expression list
+	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_after_comma_in_expression_list"
+	 *     - possible values:   { INSERT, DO_NOT_INSERT }
+	 *     - default:           INSERT
+	 * 
+ * @see CCorePlugin#INSERT + * @see CCorePlugin#DO_NOT_INSERT + */ + public static final String FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_EXPRESSION_LIST = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_comma_in_expression_list"; //$NON-NLS-1$ + /** + *
+	 * FORMATTER / Option to insert a space after the comma in base type names of a type header
+	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_after_comma_in_base_types"
+	 *     - possible values:   { INSERT, DO_NOT_INSERT }
+	 *     - default:           INSERT
+	 * 
+ * @see CCorePlugin#INSERT + * @see CCorePlugin#DO_NOT_INSERT + */ + public static final String FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_BASE_TYPES = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_comma_in_base_types"; //$NON-NLS-1$ + /** + *
+	 * FORMATTER / Option to insert a space after the comma in template arguments
+	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_after_comma_in_template_arguments"
+	 *     - possible values:   { INSERT, DO_NOT_INSERT }
+	 *     - default:           INSERT
+	 * 
+ * @see CCorePlugin#INSERT + * @see CCorePlugin#DO_NOT_INSERT + */ + public static final String FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_TEMPLATE_ARGUMENTS = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_comma_in_template_arguments"; //$NON-NLS-1$ + /** + *
+	 * FORMATTER / Option to insert a space after the comma in template parameters
+	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_after_comma_in_template_parameters"
+	 *     - possible values:   { INSERT, DO_NOT_INSERT }
+	 *     - default:           INSERT
+	 * 
+ * @see CCorePlugin#INSERT + * @see CCorePlugin#DO_NOT_INSERT + */ + public static final String FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_TEMPLATE_PARAMETERS = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_comma_in_template_parameters"; //$NON-NLS-1$ // /** // *
 //	 * FORMATTER / Option to insert a space after ellipsis
@@ -1006,43 +1003,32 @@ public class DefaultCodeFormatterConstants {
 //	 * @see CCorePlugin#INSERT
 //	 * @see CCorePlugin#DO_NOT_INSERT
 //	 */
-//	public static final String FORMATTER_INSERT_SPACE_AFTER_ELLIPSIS  = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_ellipsis";	//$NON-NLS-1$
-//	/**
-//	 * 
-//	 * FORMATTER / Option to insert a space after the opening angle bracket in parameterized type reference
-//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference"
-//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
-//	 *     - default:           DO_NOT_INSERT
-//	 * 
-// * @see CCorePlugin#INSERT -// * @see CCorePlugin#DO_NOT_INSERT -// */ -// public static final String FORMATTER_INSERT_SPACE_AFTER_OPENING_ANGLE_BRACKET_IN_PARAMETERIZED_TYPE_REFERENCE = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference";//$NON-NLS-1$ -// /** -// *
-//	 * FORMATTER / Option to insert a space after the opening angle bracket in type arguments
-//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments"
-//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
-//	 *     - default:           DO_NOT_INSERT
-//	 * 
-// * @see CCorePlugin#INSERT -// * @see CCorePlugin#DO_NOT_INSERT -// */ -// public static final String FORMATTER_INSERT_SPACE_AFTER_OPENING_ANGLE_BRACKET_IN_TYPE_ARGUMENTS = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_opening_angle_bracket_in_type_arguments";//$NON-NLS-1$ -// /** -// *
-//	 * FORMATTER / Option to insert a space after the opening angle bracket in type parameters
-//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters"
-//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
-//	 *     - default:           DO_NOT_INSERT
-//	 * 
-// * @see CCorePlugin#INSERT -// * @see CCorePlugin#DO_NOT_INSERT -// */ -// public static final String FORMATTER_INSERT_SPACE_AFTER_OPENING_ANGLE_BRACKET_IN_TYPE_PARAMETERS = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_opening_angle_bracket_in_type_parameters";//$NON-NLS-1$ +// public static final String FORMATTER_INSERT_SPACE_AFTER_ELLIPSIS = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_ellipsis"; //$NON-NLS-1$ /** *
-	 * FORMATTER / Option to insert a space after the opening brace in an array initializer
+	 * FORMATTER / Option to insert a space after the opening angle bracket in template arguments
+	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_after_opening_angle_bracket_in_template_arguments"
+	 *     - possible values:   { INSERT, DO_NOT_INSERT }
+	 *     - default:           DO_NOT_INSERT
+	 * 
+ * @see CCorePlugin#INSERT + * @see CCorePlugin#DO_NOT_INSERT + */ + public static final String FORMATTER_INSERT_SPACE_AFTER_OPENING_ANGLE_BRACKET_IN_TEMPLATE_ARGUMENTS = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_opening_angle_bracket_in_template_arguments";//$NON-NLS-1$ + /** + *
+	 * FORMATTER / Option to insert a space after the opening angle bracket in template parameters
+	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_after_opening_angle_bracket_in_template_parameters"
+	 *     - possible values:   { INSERT, DO_NOT_INSERT }
+	 *     - default:           DO_NOT_INSERT
+	 * 
+ * @see CCorePlugin#INSERT + * @see CCorePlugin#DO_NOT_INSERT + */ + public static final String FORMATTER_INSERT_SPACE_AFTER_OPENING_ANGLE_BRACKET_IN_TEMPLATE_PARAMETERS = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_opening_angle_bracket_in_template_parameters";//$NON-NLS-1$ + /** + *
+	 * FORMATTER / Option to insert a space after the opening brace in an initializer list
 	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_after_opening_brace_in_array_initializer"
 	 *     - possible values:   { INSERT, DO_NOT_INSERT }
 	 *     - default:           DO_NOT_INSERT
@@ -1050,51 +1036,40 @@ public class DefaultCodeFormatterConstants {
 	 * @see CCorePlugin#INSERT
 	 * @see CCorePlugin#DO_NOT_INSERT
 	 */
-	public static final String FORMATTER_INSERT_SPACE_AFTER_OPENING_BRACE_IN_ARRAY_INITIALIZER = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_opening_brace_in_array_initializer";	//$NON-NLS-1$
-//	/**
-//	 * 
-//	 * FORMATTER / Option to insert a space after the opening bracket inside an array allocation expression
-//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression"
-//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
-//	 *     - default:           DO_NOT_INSERT
-//	 * 
-// * @see CCorePlugin#INSERT -// * @see CCorePlugin#DO_NOT_INSERT -// */ -// public static final String FORMATTER_INSERT_SPACE_AFTER_OPENING_BRACKET_IN_ARRAY_ALLOCATION_EXPRESSION = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_opening_bracket_in_array_allocation_expression";//$NON-NLS-1$ -// /** -// *
-//	 * FORMATTER / Option to insert a space after the opening bracket inside an array reference
-//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_after_opening_bracket_in_array_reference"
-//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
-//	 *     - default:           DO_NOT_INSERT
-//	 * 
-// * @see CCorePlugin#INSERT -// * @see CCorePlugin#DO_NOT_INSERT -// */ -// public static final String FORMATTER_INSERT_SPACE_AFTER_OPENING_BRACKET_IN_ARRAY_REFERENCE = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_opening_bracket_in_array_reference";//$NON-NLS-1$ -// /** -// *
-//	 * FORMATTER / Option to insert a space after the opening parenthesis in a cast expression
-//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_after_opening_paren_in_cast"
-//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
-//	 *     - default:           DO_NOT_INSERT
-//	 * 
-// * @see CCorePlugin#INSERT -// * @see CCorePlugin#DO_NOT_INSERT -// */ -// public static final String FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_CAST = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_opening_paren_in_cast"; //$NON-NLS-1$ -// /** -// *
-//	 * FORMATTER / Option to insert a space after the opening parenthesis in a catch
-//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_after_opening_paren_in_catch"
-//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
-//	 *     - default:           DO_NOT_INSERT
-//	 * 
-// * @see CCorePlugin#INSERT -// * @see CCorePlugin#DO_NOT_INSERT -// */ -// public static final String FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_CATCH = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_opening_paren_in_catch"; //$NON-NLS-1$ + public static final String FORMATTER_INSERT_SPACE_AFTER_OPENING_BRACE_IN_INITIALIZER_LIST = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_opening_brace_in_array_initializer"; //$NON-NLS-1$ + /** + *
+	 * FORMATTER / Option to insert a space after the opening bracket
+	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_after_opening_bracket"
+	 *     - possible values:   { INSERT, DO_NOT_INSERT }
+	 *     - default:           DO_NOT_INSERT
+	 * 
+ * @see CCorePlugin#INSERT + * @see CCorePlugin#DO_NOT_INSERT + */ + public static final String FORMATTER_INSERT_SPACE_AFTER_OPENING_BRACKET = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_opening_bracket";//$NON-NLS-1$ + /** + *
+	 * FORMATTER / Option to insert a space after the opening parenthesis in a cast expression
+	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_after_opening_paren_in_cast"
+	 *     - possible values:   { INSERT, DO_NOT_INSERT }
+	 *     - default:           DO_NOT_INSERT
+	 * 
+ * @see CCorePlugin#INSERT + * @see CCorePlugin#DO_NOT_INSERT + */ + public static final String FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_CAST = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_opening_paren_in_cast"; //$NON-NLS-1$ + /** + *
+	 * FORMATTER / Option to insert a space after the opening parenthesis in a catch
+	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_after_opening_paren_in_catch"
+	 *     - possible values:   { INSERT, DO_NOT_INSERT }
+	 *     - default:           DO_NOT_INSERT
+	 * 
+ * @see CCorePlugin#INSERT + * @see CCorePlugin#DO_NOT_INSERT + */ + public static final String FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_CATCH = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_opening_paren_in_catch"; //$NON-NLS-1$ /** *
 	 * FORMATTER / Option to insert a space after the opening parenthesis in a for statement
@@ -1127,7 +1102,7 @@ public class DefaultCodeFormatterConstants {
 	 * @see CCorePlugin#INSERT
 	 * @see CCorePlugin#DO_NOT_INSERT
 	 */
-	public static final String FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_METHOD_DECLARATION = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_opening_paren_in_method_declaration";	//$NON-NLS-1$
+	public static final String FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_METHOD_DECLARATION = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_opening_paren_in_method_declaration"; //$NON-NLS-1$
 	/**
 	 * 
 	 * FORMATTER / Option to insert a space after the opening parenthesis in a method invocation
@@ -1139,17 +1114,17 @@ public class DefaultCodeFormatterConstants {
 	 * @see CCorePlugin#DO_NOT_INSERT
 	 */
 	public static final String FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_METHOD_INVOCATION = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_opening_paren_in_method_invocation"; //$NON-NLS-1$
-//	/**
-//	 * 
-//	 * FORMATTER / Option to insert a space after the opening parenthesis in a parenthesized expression
-//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression"
-//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
-//	 *     - default:           DO_NOT_INSERT
-//	 * 
-// * @see CCorePlugin#INSERT -// * @see CCorePlugin#DO_NOT_INSERT -// */ -// public static final String FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_PARENTHESIZED_EXPRESSION = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_opening_paren_in_parenthesized_expression"; //$NON-NLS-1$ + /** + *
+	 * FORMATTER / Option to insert a space after the opening parenthesis in a parenthesized expression
+	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression"
+	 *     - possible values:   { INSERT, DO_NOT_INSERT }
+	 *     - default:           DO_NOT_INSERT
+	 * 
+ * @see CCorePlugin#INSERT + * @see CCorePlugin#DO_NOT_INSERT + */ + public static final String FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_PARENTHESIZED_EXPRESSION = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_opening_paren_in_parenthesized_expression"; //$NON-NLS-1$ /** *
 	 * FORMATTER / Option to insert a space after the opening parenthesis in a switch statement
@@ -1172,28 +1147,28 @@ public class DefaultCodeFormatterConstants {
 	 * @see CCorePlugin#DO_NOT_INSERT
 	 */
 	public static final String FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_WHILE = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_opening_paren_in_while"; //$NON-NLS-1$
-//	/**
-//	 * 
-//	 * FORMATTER / Option to insert a space after a postfix operator
-//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_after_postfix_operator"
-//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
-//	 *     - default:           DO_NOT_INSERT
-//	 * 
-// * @see CCorePlugin#INSERT -// * @see CCorePlugin#DO_NOT_INSERT -// */ -// public static final String FORMATTER_INSERT_SPACE_AFTER_POSTFIX_OPERATOR = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_postfix_operator"; //$NON-NLS-1$ -// /** -// *
-//	 * FORMATTER / Option to insert a space after a prefix operator
-//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_after_prefix_operator"
-//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
-//	 *     - default:           DO_NOT_INSERT
-//	 * 
-// * @see CCorePlugin#INSERT -// * @see CCorePlugin#DO_NOT_INSERT -// */ -// public static final String FORMATTER_INSERT_SPACE_AFTER_PREFIX_OPERATOR = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_prefix_operator"; //$NON-NLS-1$ + /** + *
+	 * FORMATTER / Option to insert a space after a postfix operator
+	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_after_postfix_operator"
+	 *     - possible values:   { INSERT, DO_NOT_INSERT }
+	 *     - default:           DO_NOT_INSERT
+	 * 
+ * @see CCorePlugin#INSERT + * @see CCorePlugin#DO_NOT_INSERT + */ + public static final String FORMATTER_INSERT_SPACE_AFTER_POSTFIX_OPERATOR = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_postfix_operator"; //$NON-NLS-1$ + /** + *
+	 * FORMATTER / Option to insert a space after a prefix operator
+	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_after_prefix_operator"
+	 *     - possible values:   { INSERT, DO_NOT_INSERT }
+	 *     - default:           DO_NOT_INSERT
+	 * 
+ * @see CCorePlugin#INSERT + * @see CCorePlugin#DO_NOT_INSERT + */ + public static final String FORMATTER_INSERT_SPACE_AFTER_PREFIX_OPERATOR = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_prefix_operator"; //$NON-NLS-1$ /** *
 	 * FORMATTER / Option to insert a space after question mark in a conditional expression
@@ -1216,75 +1191,64 @@ public class DefaultCodeFormatterConstants {
 	 * @see CCorePlugin#DO_NOT_INSERT
 	 */
 	public static final String FORMATTER_INSERT_SPACE_AFTER_SEMICOLON_IN_FOR = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_semicolon_in_for"; //$NON-NLS-1$
-//	/**
-//	 * 
-//	 * FORMATTER / Option to insert a space after an unary operator
-//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_after_unary_operator"
-//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
-//	 *     - default:           DO_NOT_INSERT
-//	 * 
-// * @see CCorePlugin#INSERT -// * @see CCorePlugin#DO_NOT_INSERT -// */ -// public static final String FORMATTER_INSERT_SPACE_AFTER_UNARY_OPERATOR = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_unary_operator"; //$NON-NLS-1$ -// /** -// *
-//	 * FORMATTER / Option to insert a space before an assignment operator
-//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_before_assignment_operator"
-//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
-//	 *     - default:           INSERT
-//	 * 
-// * @see CCorePlugin#INSERT -// * @see CCorePlugin#DO_NOT_INSERT -// */ -// public static final String FORMATTER_INSERT_SPACE_BEFORE_ASSIGNMENT_OPERATOR = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_assignment_operator"; //$NON-NLS-1$ -// /** -// *
-//	 * FORMATTER / Option to insert a space before an binary operator
-//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_before_binary_operator"
-//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
-//	 *     - default:           DO_NOT_INSERT
-//	 * 
-// * @see CCorePlugin#INSERT -// * @see CCorePlugin#DO_NOT_INSERT -// */ -// public static final String FORMATTER_INSERT_SPACE_BEFORE_BINARY_OPERATOR = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_binary_operator"; //$NON-NLS-1$ -// /** -// *
-//	 * FORMATTER / Option to insert a space before the closing angle bracket in parameterized type reference
-//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference"
-//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
-//	 *     - default:           DO_NOT_INSERT
-//	 * 
-// * @see CCorePlugin#INSERT -// * @see CCorePlugin#DO_NOT_INSERT -// */ -// public static final String FORMATTER_INSERT_SPACE_BEFORE_CLOSING_ANGLE_BRACKET_IN_PARAMETERIZED_TYPE_REFERENCE = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference"; //$NON-NLS-1$ -// /** -// *
-//	 * FORMATTER / Option to insert a space before the closing angle bracket in type arguments
-//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments"
-//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
-//	 *     - default:           DO_NOT_INSERT
-//	 * 
-// * @see CCorePlugin#INSERT -// * @see CCorePlugin#DO_NOT_INSERT -// */ -// public static final String FORMATTER_INSERT_SPACE_BEFORE_CLOSING_ANGLE_BRACKET_IN_TYPE_ARGUMENTS = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_closing_angle_bracket_in_type_arguments"; //$NON-NLS-1$ -// /** -// *
-//	 * FORMATTER / Option to insert a space before the closing angle bracket in type parameters
-//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters"
-//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
-//	 *     - default:           DO_NOT_INSERT
-//	 * 
-// * @see CCorePlugin#INSERT -// * @see CCorePlugin#DO_NOT_INSERT -// */ -// public static final String FORMATTER_INSERT_SPACE_BEFORE_CLOSING_ANGLE_BRACKET_IN_TYPE_PARAMETERS = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_closing_angle_bracket_in_type_parameters"; //$NON-NLS-1$ /** *
-	 * FORMATTER / Option to insert a space before the closing brace in an array initializer
+	 * FORMATTER / Option to insert a space after an unary operator
+	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_after_unary_operator"
+	 *     - possible values:   { INSERT, DO_NOT_INSERT }
+	 *     - default:           DO_NOT_INSERT
+	 * 
+ * @see CCorePlugin#INSERT + * @see CCorePlugin#DO_NOT_INSERT + */ + public static final String FORMATTER_INSERT_SPACE_AFTER_UNARY_OPERATOR = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_unary_operator"; //$NON-NLS-1$ + /** + *
+	 * FORMATTER / Option to insert a space before an assignment operator
+	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_before_assignment_operator"
+	 *     - possible values:   { INSERT, DO_NOT_INSERT }
+	 *     - default:           INSERT
+	 * 
+ * @see CCorePlugin#INSERT + * @see CCorePlugin#DO_NOT_INSERT + */ + public static final String FORMATTER_INSERT_SPACE_BEFORE_ASSIGNMENT_OPERATOR = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_assignment_operator"; //$NON-NLS-1$ + /** + *
+	 * FORMATTER / Option to insert a space before an binary operator
+	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_before_binary_operator"
+	 *     - possible values:   { INSERT, DO_NOT_INSERT }
+	 *     - default:           DO_NOT_INSERT
+	 * 
+ * @see CCorePlugin#INSERT + * @see CCorePlugin#DO_NOT_INSERT + */ + public static final String FORMATTER_INSERT_SPACE_BEFORE_BINARY_OPERATOR = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_binary_operator"; //$NON-NLS-1$ + /** + *
+	 * FORMATTER / Option to insert a space before the closing angle bracket in template arguments
+	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_before_closing_angle_bracket_in_template_arguments"
+	 *     - possible values:   { INSERT, DO_NOT_INSERT }
+	 *     - default:           DO_NOT_INSERT
+	 * 
+ * @see CCorePlugin#INSERT + * @see CCorePlugin#DO_NOT_INSERT + */ + public static final String FORMATTER_INSERT_SPACE_BEFORE_CLOSING_ANGLE_BRACKET_IN_TEMPLATE_ARGUMENTS = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_closing_angle_bracket_in_template_arguments"; //$NON-NLS-1$ + /** + *
+	 * FORMATTER / Option to insert a space before the closing angle bracket in template parameters
+	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_before_closing_angle_bracket_in_template_parameters"
+	 *     - possible values:   { INSERT, DO_NOT_INSERT }
+	 *     - default:           DO_NOT_INSERT
+	 * 
+ * @see CCorePlugin#INSERT + * @see CCorePlugin#DO_NOT_INSERT + */ + public static final String FORMATTER_INSERT_SPACE_BEFORE_CLOSING_ANGLE_BRACKET_IN_TEMPLATE_PARAMETERS = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_closing_angle_bracket_in_template_parameters"; //$NON-NLS-1$ + /** + *
+	 * FORMATTER / Option to insert a space before the closing brace in an initializer list
 	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_before_closing_brace_in_array_initializer"
 	 *     - possible values:   { INSERT, DO_NOT_INSERT }
 	 *     - default:           DO_NOT_INSERT
@@ -1292,51 +1256,40 @@ public class DefaultCodeFormatterConstants {
 	 * @see CCorePlugin#INSERT
 	 * @see CCorePlugin#DO_NOT_INSERT
 	 */
-	public static final String FORMATTER_INSERT_SPACE_BEFORE_CLOSING_BRACE_IN_ARRAY_INITIALIZER = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_closing_brace_in_array_initializer";		//$NON-NLS-1$
-//	/**
-//	 * 
-//	 * FORMATTER / Option to insert a space before the closing bracket in an array allocation expression
-//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression"
-//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
-//	 *     - default:           DO_NOT_INSERT
-//	 * 
-// * @see CCorePlugin#INSERT -// * @see CCorePlugin#DO_NOT_INSERT -// */ -// public static final String FORMATTER_INSERT_SPACE_BEFORE_CLOSING_BRACKET_IN_ARRAY_ALLOCATION_EXPRESSION = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_closing_bracket_in_array_allocation_expression";//$NON-NLS-1$ -// /** -// *
-//	 * FORMATTER / Option to insert a space before the closing bracket in an array reference
-//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_before_closing_bracket_in_array_reference"
-//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
-//	 *     - default:           DO_NOT_INSERT
-//	 * 
-// * @see CCorePlugin#INSERT -// * @see CCorePlugin#DO_NOT_INSERT -// */ -// public static final String FORMATTER_INSERT_SPACE_BEFORE_CLOSING_BRACKET_IN_ARRAY_REFERENCE = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_closing_bracket_in_array_reference";//$NON-NLS-1$ -// /** -// *
-//	 * FORMATTER / Option to insert a space before the closing parenthesis in a cast expression
-//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_before_closing_paren_in_cast"
-//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
-//	 *     - default:           DO_NOT_INSERT
-//	 * 
-// * @see CCorePlugin#INSERT -// * @see CCorePlugin#DO_NOT_INSERT -// */ -// public static final String FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_CAST = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_closing_paren_in_cast"; //$NON-NLS-1$ -// /** -// *
-//	 * FORMATTER / Option to insert a space before the closing parenthesis in a catch
-//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_before_closing_paren_in_catch"
-//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
-//	 *     - default:           DO_NOT_INSERT
-//	 * 
-// * @see CCorePlugin#INSERT -// * @see CCorePlugin#DO_NOT_INSERT -// */ -// public static final String FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_CATCH = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_closing_paren_in_catch"; //$NON-NLS-1$ + public static final String FORMATTER_INSERT_SPACE_BEFORE_CLOSING_BRACE_IN_INITIALIZER_LIST = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_closing_brace_in_array_initializer"; //$NON-NLS-1$ + /** + *
+	 * FORMATTER / Option to insert a space before the closing bracket
+	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_before_closing_bracket"
+	 *     - possible values:   { INSERT, DO_NOT_INSERT }
+	 *     - default:           DO_NOT_INSERT
+	 * 
+ * @see CCorePlugin#INSERT + * @see CCorePlugin#DO_NOT_INSERT + */ + public static final String FORMATTER_INSERT_SPACE_BEFORE_CLOSING_BRACKET = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_closing_bracket";//$NON-NLS-1$ + /** + *
+	 * FORMATTER / Option to insert a space before the closing parenthesis in a cast expression
+	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_before_closing_paren_in_cast"
+	 *     - possible values:   { INSERT, DO_NOT_INSERT }
+	 *     - default:           DO_NOT_INSERT
+	 * 
+ * @see CCorePlugin#INSERT + * @see CCorePlugin#DO_NOT_INSERT + */ + public static final String FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_CAST = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_closing_paren_in_cast"; //$NON-NLS-1$ + /** + *
+	 * FORMATTER / Option to insert a space before the closing parenthesis in a catch
+	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_before_closing_paren_in_catch"
+	 *     - possible values:   { INSERT, DO_NOT_INSERT }
+	 *     - default:           DO_NOT_INSERT
+	 * 
+ * @see CCorePlugin#INSERT + * @see CCorePlugin#DO_NOT_INSERT + */ + public static final String FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_CATCH = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_closing_paren_in_catch"; //$NON-NLS-1$ /** *
 	 * FORMATTER / Option to insert a space before the closing parenthesis in a for statement
@@ -1347,7 +1300,7 @@ public class DefaultCodeFormatterConstants {
 	 * @see CCorePlugin#INSERT
 	 * @see CCorePlugin#DO_NOT_INSERT
 	 */
-	public static final String FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_FOR = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_closing_paren_in_for";	//$NON-NLS-1$
+	public static final String FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_FOR = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_closing_paren_in_for"; //$NON-NLS-1$
 	/**
 	 * 
 	 * FORMATTER / Option to insert a space before the closing parenthesis in an if statement
@@ -1358,7 +1311,7 @@ public class DefaultCodeFormatterConstants {
 	 * @see CCorePlugin#INSERT
 	 * @see CCorePlugin#DO_NOT_INSERT
 	 */
-	public static final String FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_IF = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_closing_paren_in_if";	//$NON-NLS-1$
+	public static final String FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_IF = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_closing_paren_in_if"; //$NON-NLS-1$
 	/**
 	 * 
 	 * FORMATTER / Option to insert a space before the closing parenthesis in a method declaration
@@ -1369,7 +1322,7 @@ public class DefaultCodeFormatterConstants {
 	 * @see CCorePlugin#INSERT
 	 * @see CCorePlugin#DO_NOT_INSERT
 	 */
-	public static final String FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_METHOD_DECLARATION = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_closing_paren_in_method_declaration";	//$NON-NLS-1$
+	public static final String FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_METHOD_DECLARATION = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_closing_paren_in_method_declaration"; //$NON-NLS-1$
 	/**
 	 * 
 	 * FORMATTER / Option to insert a space before the closing parenthesis in a method invocation
@@ -1381,17 +1334,17 @@ public class DefaultCodeFormatterConstants {
 	 * @see CCorePlugin#DO_NOT_INSERT
 	 */
 	public static final String FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_METHOD_INVOCATION = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_closing_paren_in_method_invocation"; //$NON-NLS-1$
-//	/**
-//	 * 
-//	 * FORMATTER / Option to insert a space before the closing parenthesis in a parenthesized expression
-//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression"
-//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
-//	 *     - default:           DO_NOT_INSERT
-//	 * 
-// * @see CCorePlugin#INSERT -// * @see CCorePlugin#DO_NOT_INSERT -// */ -// public static final String FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_PARENTHESIZED_EXPRESSION = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_closing_paren_in_parenthesized_expression"; //$NON-NLS-1$ + /** + *
+	 * FORMATTER / Option to insert a space before the closing parenthesis in a parenthesized expression
+	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression"
+	 *     - possible values:   { INSERT, DO_NOT_INSERT }
+	 *     - default:           DO_NOT_INSERT
+	 * 
+ * @see CCorePlugin#INSERT + * @see CCorePlugin#DO_NOT_INSERT + */ + public static final String FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_PARENTHESIZED_EXPRESSION = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_closing_paren_in_parenthesized_expression"; //$NON-NLS-1$ /** *
 	 * FORMATTER / Option to insert a space before the closing parenthesis in a switch statement
@@ -1402,7 +1355,7 @@ public class DefaultCodeFormatterConstants {
 	 * @see CCorePlugin#INSERT
 	 * @see CCorePlugin#DO_NOT_INSERT
 	 */
-	public static final String FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_SWITCH = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_closing_paren_in_switch";	//$NON-NLS-1$
+	public static final String FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_SWITCH = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_closing_paren_in_switch"; //$NON-NLS-1$
 	/**
 	 * 
 	 * FORMATTER / Option to insert a space before the closing parenthesis in a while statement
@@ -1413,7 +1366,18 @@ public class DefaultCodeFormatterConstants {
 	 * @see CCorePlugin#INSERT
 	 * @see CCorePlugin#DO_NOT_INSERT
 	 */
-	public static final String FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_WHILE = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_closing_paren_in_while";	//$NON-NLS-1$
+	public static final String FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_WHILE = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_closing_paren_in_while"; //$NON-NLS-1$
+	/**
+	 * 
+	 * FORMATTER / Option to insert a space before colon in a base clause of a type definition
+	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_before_colon_in_base_clause"
+	 *     - possible values:   { INSERT, DO_NOT_INSERT }
+	 *     - default:           INSERT
+	 * 
+ * @see CCorePlugin#INSERT + * @see CCorePlugin#DO_NOT_INSERT + */ + public static final String FORMATTER_INSERT_SPACE_BEFORE_COLON_IN_BASE_CLAUSE = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_colon_in_base_clause"; //$NON-NLS-1$ /** *
 	 * FORMATTER / Option to insert a space before colon in a case statement
@@ -1424,7 +1388,7 @@ public class DefaultCodeFormatterConstants {
 	 * @see CCorePlugin#INSERT
 	 * @see CCorePlugin#DO_NOT_INSERT
 	 */
-	public static final String FORMATTER_INSERT_SPACE_BEFORE_COLON_IN_CASE = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_colon_in_case";	//$NON-NLS-1$
+	public static final String FORMATTER_INSERT_SPACE_BEFORE_COLON_IN_CASE = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_colon_in_case"; //$NON-NLS-1$
 	/**
 	 * 
 	 * FORMATTER / Option to insert a space before colon in a conditional expression
@@ -1435,7 +1399,7 @@ public class DefaultCodeFormatterConstants {
 	 * @see CCorePlugin#INSERT
 	 * @see CCorePlugin#DO_NOT_INSERT
 	 */
-	public static final String FORMATTER_INSERT_SPACE_BEFORE_COLON_IN_CONDITIONAL = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_colon_in_conditional";	//$NON-NLS-1$
+	public static final String FORMATTER_INSERT_SPACE_BEFORE_COLON_IN_CONDITIONAL = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_colon_in_conditional"; //$NON-NLS-1$
 	/**
 	 * 
 	 * FORMATTER / Option to insert a space before colon in a default statement
@@ -1446,18 +1410,18 @@ public class DefaultCodeFormatterConstants {
 	 * @see CCorePlugin#INSERT
 	 * @see CCorePlugin#DO_NOT_INSERT
 	 */
-	public static final String FORMATTER_INSERT_SPACE_BEFORE_COLON_IN_DEFAULT = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_colon_in_default";	//$NON-NLS-1$
-//	/**
-//	 * 
-//	 * FORMATTER / Option to insert a space before colon in a labeled statement
-//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_before_colon_in_labeled_statement"
-//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
-//	 *     - default:           INSERT
-//	 * 
-// * @see CCorePlugin#INSERT -// * @see CCorePlugin#DO_NOT_INSERT -// */ -// public static final String FORMATTER_INSERT_SPACE_BEFORE_COLON_IN_LABELED_STATEMENT = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_colon_in_labeled_statement"; //$NON-NLS-1$ + public static final String FORMATTER_INSERT_SPACE_BEFORE_COLON_IN_DEFAULT = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_colon_in_default"; //$NON-NLS-1$ + /** + *
+	 * FORMATTER / Option to insert a space before colon in a labeled statement
+	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_before_colon_in_labeled_statement"
+	 *     - possible values:   { INSERT, DO_NOT_INSERT }
+	 *     - default:           INSERT
+	 * 
+ * @see CCorePlugin#INSERT + * @see CCorePlugin#DO_NOT_INSERT + */ + public static final String FORMATTER_INSERT_SPACE_BEFORE_COLON_IN_LABELED_STATEMENT = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_colon_in_labeled_statement"; //$NON-NLS-1$ // /** // *
 //	 * FORMATTER / Option to insert a space before comma in an allocation expression
@@ -1468,10 +1432,10 @@ public class DefaultCodeFormatterConstants {
 //	 * @see CCorePlugin#INSERT
 //	 * @see CCorePlugin#DO_NOT_INSERT
 //	 */
-//	public static final String FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_ALLOCATION_EXPRESSION = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_comma_in_allocation_expression";	//$NON-NLS-1$
+//	public static final String FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_ALLOCATION_EXPRESSION = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_comma_in_allocation_expression"; //$NON-NLS-1$
 	/**
 	 * 
-	 * FORMATTER / Option to insert a space before comma in an array initializer
+	 * FORMATTER / Option to insert a space before comma in an initializer list
 	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_before_comma_in_array_initializer"
 	 *     - possible values:   { INSERT, DO_NOT_INSERT }
 	 *     - default:           DO_NOT_INSERT
@@ -1479,18 +1443,29 @@ public class DefaultCodeFormatterConstants {
 	 * @see CCorePlugin#INSERT
 	 * @see CCorePlugin#DO_NOT_INSERT
 	 */
-	public static final String FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_ARRAY_INITIALIZER = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_comma_in_array_initializer";	//$NON-NLS-1$
+	public static final String FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_INITIALIZER_LIST = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_comma_in_array_initializer"; //$NON-NLS-1$
+	/**
+	 * 
+	 * FORMATTER / Option to insert a space before comma in enum declarations
+	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_before_comma_in_enum_declarations"
+	 *     - possible values:   { INSERT, DO_NOT_INSERT }
+	 *     - default:           DO_NOT_INSERT
+	 * 
+ * @see CCorePlugin#INSERT + * @see CCorePlugin#DO_NOT_INSERT + */ + public static final String FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_ENUM_DECLARATIONS = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_comma_in_enum_declarations"; //$NON-NLS-1$ // /** // *
-//	 * FORMATTER / Option to insert a space before comma in enum declarations
-//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_before_comma_in_enum_declarations"
+//	 * FORMATTER / Option to insert a space before comma in the increments of a for statement
+//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_before_comma_in_for_increments"
 //	 *     - possible values:   { INSERT, DO_NOT_INSERT }
 //	 *     - default:           DO_NOT_INSERT
 //	 * 
// * @see CCorePlugin#INSERT // * @see CCorePlugin#DO_NOT_INSERT // */ -// public static final String FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_ENUM_DECLARATIONS = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_comma_in_enum_declarations"; //$NON-NLS-1$ +// public static final String FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_FOR_INCREMENTS = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_comma_in_for_increments"; //$NON-NLS-1$ // /** // *
 //	 * FORMATTER / Option to insert a space before comma in the initializations of a for statement
@@ -1501,7 +1476,7 @@ public class DefaultCodeFormatterConstants {
 //	 * @see CCorePlugin#INSERT
 //	 * @see CCorePlugin#DO_NOT_INSERT
 //	 */
-//	public static final String FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_FOR_INITS = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_comma_in_for_inits";	//$NON-NLS-1$
+//	public static final String FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_FOR_INITS = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_comma_in_for_inits"; //$NON-NLS-1$
 	/**
 	 * 
 	 * FORMATTER / Option to insert a space before comma in the parameters of a method declaration
@@ -1512,7 +1487,7 @@ public class DefaultCodeFormatterConstants {
 	 * @see CCorePlugin#INSERT
 	 * @see CCorePlugin#DO_NOT_INSERT
 	 */
-	public static final String FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_METHOD_DECLARATION_PARAMETERS = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_comma_in_method_declaration_parameters";	//$NON-NLS-1$
+	public static final String FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_METHOD_DECLARATION_PARAMETERS = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_comma_in_method_declaration_parameters"; //$NON-NLS-1$
 //	/**
 //	 * 
 //	 * FORMATTER / Option to insert a space before comma in the exception names of the throws clause of a method declaration
@@ -1523,7 +1498,7 @@ public class DefaultCodeFormatterConstants {
 //	 * @see CCorePlugin#INSERT
 //	 * @see CCorePlugin#DO_NOT_INSERT
 //	 */
-//	public static final String FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_METHOD_DECLARATION_THROWS = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_comma_in_method_declaration_throws";	//$NON-NLS-1$
+//	public static final String FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_METHOD_DECLARATION_THROWS = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_comma_in_method_declaration_throws"; //$NON-NLS-1$
 	/**
 	 * 
 	 * FORMATTER / Option to insert a space before comma in the arguments of a method invocation
@@ -1534,73 +1509,62 @@ public class DefaultCodeFormatterConstants {
 	 * @see CCorePlugin#INSERT
 	 * @see CCorePlugin#DO_NOT_INSERT
 	 */
-	public static final String FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_METHOD_INVOCATION_ARGUMENTS = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_comma_in_method_invocation_arguments";	//$NON-NLS-1$
-//	/**
-//	 * 
-//	 * FORMATTER / Option to insert a space before comma in a multiple field declaration
-//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations"
-//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
-//	 *     - default:           DO_NOT_INSERT
-//	 * 
-// * @see CCorePlugin#INSERT -// * @see CCorePlugin#DO_NOT_INSERT -// */ -// public static final String FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_MULTIPLE_FIELD_DECLARATIONS = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_comma_in_multiple_field_declarations"; //$NON-NLS-1$ -// /** -// *
-//	 * FORMATTER / Option to insert a space before comma in a multiple local declaration
-//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations"
-//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
-//	 *     - default:           DO_NOT_INSERT
-//	 * 
-// * @see CCorePlugin#INSERT -// * @see CCorePlugin#DO_NOT_INSERT -// */ -// public static final String FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_MULTIPLE_LOCAL_DECLARATIONS = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_comma_in_multiple_local_declarations"; //$NON-NLS-1$ -// /** -// *
-//	 * FORMATTER / Option to insert a space before comma in parameterized type reference
-//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference"
-//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
-//	 *     - default:           DO_NOT_INSERT
-//	 * 
-// * @see CCorePlugin#INSERT -// * @see CCorePlugin#DO_NOT_INSERT -// */ -// public static final String FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_PARAMETERIZED_TYPE_REFERENCE = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_comma_in_parameterized_type_reference"; //$NON-NLS-1$ -// /** -// *
-//	 * FORMATTER / Option to insert a space before comma in the base type names in a type header
-//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_before_comma_in_base_types"
-//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
-//	 *     - default:           DO_NOT_INSERT
-//	 * 
-// * @see CCorePlugin#INSERT -// * @see CCorePlugin#DO_NOT_INSERT -// */ -// public static final String FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_BASE_TYPES = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_comma_in_base_types"; //$NON-NLS-1$ -// /** -// *
-//	 * FORMATTER / Option to insert a space before comma in type arguments
-//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_before_comma_in_type_arguments"
-//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
-//	 *     - default:           DO_NOT_INSERT
-//	 * 
-// * @see CCorePlugin#INSERT -// * @see CCorePlugin#DO_NOT_INSERT -// */ -// public static final String FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_TYPE_ARGUMENTS = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_comma_in_type_arguments"; //$NON-NLS-1$ -// /** -// *
-//	 * FORMATTER / Option to insert a space before comma in type parameters
-//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_before_comma_in_type_parameters"
-//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
-//	 *     - default:           DO_NOT_INSERT
-//	 * 
-// * @see CCorePlugin#INSERT -// * @see CCorePlugin#DO_NOT_INSERT -// */ -// public static final String FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_TYPE_PARAMETERS = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_comma_in_type_parameters"; //$NON-NLS-1$ + public static final String FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_METHOD_INVOCATION_ARGUMENTS = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_comma_in_method_invocation_arguments"; //$NON-NLS-1$ + /** + *
+	 * FORMATTER / Option to insert a space before comma in a declarator list
+	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_before_comma_in_declarator_list"
+	 *     - possible values:   { INSERT, DO_NOT_INSERT }
+	 *     - default:           DO_NOT_INSERT
+	 * 
+ * @see CCorePlugin#INSERT + * @see CCorePlugin#DO_NOT_INSERT + */ + public static final String FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_DECLARATOR_LIST = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_comma_in_declarator_list"; //$NON-NLS-1$ + /** + *
+	 * FORMATTER / Option to insert a space before comma in a expression list
+	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_before_comma_in_expression_list"
+	 *     - possible values:   { INSERT, DO_NOT_INSERT }
+	 *     - default:           DO_NOT_INSERT
+	 * 
+ * @see CCorePlugin#INSERT + * @see CCorePlugin#DO_NOT_INSERT + */ + public static final String FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_EXPRESSION_LIST = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_comma_in_expression_list"; //$NON-NLS-1$ + /** + *
+	 * FORMATTER / Option to insert a space before comma in the base type names in a type header
+	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_before_comma_in_base_types"
+	 *     - possible values:   { INSERT, DO_NOT_INSERT }
+	 *     - default:           DO_NOT_INSERT
+	 * 
+ * @see CCorePlugin#INSERT + * @see CCorePlugin#DO_NOT_INSERT + */ + public static final String FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_BASE_TYPES = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_comma_in_base_types"; //$NON-NLS-1$ + /** + *
+	 * FORMATTER / Option to insert a space before comma in template arguments
+	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_before_comma_in_template_arguments"
+	 *     - possible values:   { INSERT, DO_NOT_INSERT }
+	 *     - default:           DO_NOT_INSERT
+	 * 
+ * @see CCorePlugin#INSERT + * @see CCorePlugin#DO_NOT_INSERT + */ + public static final String FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_TEMPLATE_ARGUMENTS = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_comma_in_template_arguments"; //$NON-NLS-1$ + /** + *
+	 * FORMATTER / Option to insert a space before comma in template parameters
+	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_before_comma_in_template_parameters"
+	 *     - possible values:   { INSERT, DO_NOT_INSERT }
+	 *     - default:           DO_NOT_INSERT
+	 * 
+ * @see CCorePlugin#INSERT + * @see CCorePlugin#DO_NOT_INSERT + */ + public static final String FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_TEMPLATE_PARAMETERS = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_comma_in_template_parameters"; //$NON-NLS-1$ // /** // *
 //	 * FORMATTER / Option to insert a space before ellipsis
@@ -1611,54 +1575,32 @@ public class DefaultCodeFormatterConstants {
 //	 * @see CCorePlugin#INSERT
 //	 * @see CCorePlugin#DO_NOT_INSERT
 //	 */
-//	public static final String FORMATTER_INSERT_SPACE_BEFORE_ELLIPSIS  = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_ellipsis";	//$NON-NLS-1$
-//	/**
-//	 * 
-//	 * FORMATTER / Option to insert a space before the opening angle bracket in parameterized type reference
-//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference"
-//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
-//	 *     - default:           DO_NOT_INSERT
-//	 * 
-// * @see CCorePlugin#INSERT -// * @see CCorePlugin#DO_NOT_INSERT -// */ -// public static final String FORMATTER_INSERT_SPACE_BEFORE_OPENING_ANGLE_BRACKET_IN_PARAMETERIZED_TYPE_REFERENCE = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference"; //$NON-NLS-1$ -// /** -// *
-//	 * FORMATTER / Option to insert a space before the opening angle bracket in type arguments
-//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments"
-//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
-//	 *     - default:           DO_NOT_INSERT
-//	 * 
-// * @see CCorePlugin#INSERT -// * @see CCorePlugin#DO_NOT_INSERT -// */ -// public static final String FORMATTER_INSERT_SPACE_BEFORE_OPENING_ANGLE_BRACKET_IN_TYPE_ARGUMENTS = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_opening_angle_bracket_in_type_arguments"; //$NON-NLS-1$ -// /** -// *
-//	 * FORMATTER / Option to insert a space before the opening angle bracket in type parameters
-//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters"
-//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
-//	 *     - default:           DO_NOT_INSERT
-//	 * 
-// * @see CCorePlugin#INSERT -// * @see CCorePlugin#DO_NOT_INSERT -// */ -// public static final String FORMATTER_INSERT_SPACE_BEFORE_OPENING_ANGLE_BRACKET_IN_TYPE_PARAMETERS = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_opening_angle_bracket_in_type_parameters"; //$NON-NLS-1$ -// /** -// *
-//	 * FORMATTER / Option to insert a space before the opening brace in an anonymous type declaration
-//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration"
-//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
-//	 *     - default:           INSERT
-//	 * 
-// * @see CCorePlugin#INSERT -// * @see CCorePlugin#DO_NOT_INSERT -// */ -// public static final String FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACE_IN_ANONYMOUS_TYPE_DECLARATION = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_opening_brace_in_anonymous_type_declaration"; //$NON-NLS-1$ +// public static final String FORMATTER_INSERT_SPACE_BEFORE_ELLIPSIS = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_ellipsis"; //$NON-NLS-1$ /** *
-	 * FORMATTER / Option to insert a space before the opening brace in an array initializer
+	 * FORMATTER / Option to insert a space before the opening angle bracket in template arguments
+	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_before_opening_angle_bracket_in_template_arguments"
+	 *     - possible values:   { INSERT, DO_NOT_INSERT }
+	 *     - default:           DO_NOT_INSERT
+	 * 
+ * @see CCorePlugin#INSERT + * @see CCorePlugin#DO_NOT_INSERT + */ + public static final String FORMATTER_INSERT_SPACE_BEFORE_OPENING_ANGLE_BRACKET_IN_TEMPLATE_ARGUMENTS = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_opening_angle_bracket_in_template_arguments"; //$NON-NLS-1$ + /** + *
+	 * FORMATTER / Option to insert a space before the opening angle bracket in template parameters
+	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_before_opening_angle_bracket_in_template_parameters"
+	 *     - possible values:   { INSERT, DO_NOT_INSERT }
+	 *     - default:           DO_NOT_INSERT
+	 * 
+ * @see CCorePlugin#INSERT + * @see CCorePlugin#DO_NOT_INSERT + */ + public static final String FORMATTER_INSERT_SPACE_BEFORE_OPENING_ANGLE_BRACKET_IN_TEMPLATE_PARAMETERS = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_opening_angle_bracket_in_template_parameters"; //$NON-NLS-1$ + /** + *
+	 * FORMATTER / Option to insert a space before the opening brace in an initializer list
 	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_before_opening_brace_in_array_initializer"
 	 *     - possible values:   { INSERT, DO_NOT_INSERT }
 	 *     - default:           DO_NOT_INSERT
@@ -1666,7 +1608,7 @@ public class DefaultCodeFormatterConstants {
 	 * @see CCorePlugin#INSERT
 	 * @see CCorePlugin#DO_NOT_INSERT
 	 */
-	public static final String FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACE_IN_ARRAY_INITIALIZER = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_opening_brace_in_array_initializer"; //$NON-NLS-1$
+	public static final String FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACE_IN_INITIALIZER_LIST = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_opening_brace_in_array_initializer"; //$NON-NLS-1$
 	/**
 	 * 
 	 * FORMATTER / Option to insert a space before the opening brace in a block
@@ -1677,18 +1619,7 @@ public class DefaultCodeFormatterConstants {
 	 * @see CCorePlugin#INSERT
 	 * @see CCorePlugin#DO_NOT_INSERT
 	 */
-	public static final String FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACE_IN_BLOCK = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_opening_brace_in_block";	//$NON-NLS-1$
-//	/**
-//	 * 
-//	 * FORMATTER / Option to insert a space before the opening brace in an enum declaration
-//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration"
-//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
-//	 *     - default:           INSERT
-//	 * 
-// * @see CCorePlugin#INSERT -// * @see CCorePlugin#DO_NOT_INSERT -// */ -// public static final String FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACE_IN_ENUM_DECLARATION = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_opening_brace_in_enum_declaration"; //$NON-NLS-1$ + public static final String FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACE_IN_BLOCK = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_opening_brace_in_block"; //$NON-NLS-1$ /** *
 	 * FORMATTER / Option to insert a space before the opening brace in a method declaration
@@ -1699,7 +1630,7 @@ public class DefaultCodeFormatterConstants {
 	 * @see CCorePlugin#INSERT
 	 * @see CCorePlugin#DO_NOT_INSERT
 	 */
-	public static final String FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACE_IN_METHOD_DECLARATION = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_opening_brace_in_method_declaration";	//$NON-NLS-1$
+	public static final String FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACE_IN_METHOD_DECLARATION = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_opening_brace_in_method_declaration"; //$NON-NLS-1$
 	/**
 	 * 
 	 * FORMATTER / Option to insert a space before the opening brace in a switch statement
@@ -1710,7 +1641,7 @@ public class DefaultCodeFormatterConstants {
 	 * @see CCorePlugin#INSERT
 	 * @see CCorePlugin#DO_NOT_INSERT
 	 */
-	public static final String FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACE_IN_SWITCH = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_opening_brace_in_switch";	//$NON-NLS-1$
+	public static final String FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACE_IN_SWITCH = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_opening_brace_in_switch"; //$NON-NLS-1$
 	/**
 	 * 
 	 * FORMATTER / Option to insert a space before the opening brace in a type declaration
@@ -1721,7 +1652,7 @@ public class DefaultCodeFormatterConstants {
 	 * @see CCorePlugin#INSERT
 	 * @see CCorePlugin#DO_NOT_INSERT
 	 */
-	public static final String FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACE_IN_TYPE_DECLARATION = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_opening_brace_in_type_declaration";	//$NON-NLS-1$
+	public static final String FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACE_IN_TYPE_DECLARATION = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_opening_brace_in_type_declaration"; //$NON-NLS-1$
 	/**
 	 * 
 	 * FORMATTER / Option to insert a space before the opening brace in a namespace declaration
@@ -1732,51 +1663,29 @@ public class DefaultCodeFormatterConstants {
 	 * @see CCorePlugin#INSERT
 	 * @see CCorePlugin#DO_NOT_INSERT
 	 */
-	public static final String FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACE_IN_NAMESPACE_DECLARATION = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_opening_brace_in_namespace_declaration";	//$NON-NLS-1$
-//	/**
-//	 * 
-//	 * FORMATTER / Option to insert a space before the opening bracket in an array allocation expression
-//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression"
-//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
-//	 *     - default:           DO_NOT_INSERT
-//	 * 
-// * @see CCorePlugin#INSERT -// * @see CCorePlugin#DO_NOT_INSERT -// */ -// public static final String FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACKET_IN_ARRAY_ALLOCATION_EXPRESSION = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_opening_bracket_in_array_allocation_expression";//$NON-NLS-1$ -// /** -// *
-//	 * FORMATTER / Option to insert a space before the opening bracket in an array reference
-//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_before_opening_bracket_in_array_reference"
-//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
-//	 *     - default:           DO_NOT_INSERT
-//	 * 
-// * @see CCorePlugin#INSERT -// * @see CCorePlugin#DO_NOT_INSERT -// */ -// public static final String FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACKET_IN_ARRAY_REFERENCE = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_opening_bracket_in_array_reference";//$NON-NLS-1$ -// /** -// *
-//	 * FORMATTER / Option to insert a space before the opening bracket in an array type reference
-//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference"
-//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
-//	 *     - default:           DO_NOT_INSERT
-//	 * 
-// * @see CCorePlugin#INSERT -// * @see CCorePlugin#DO_NOT_INSERT -// */ -// public static final String FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACKET_IN_ARRAY_TYPE_REFERENCE = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_opening_bracket_in_array_type_reference"; //$NON-NLS-1$ -// /** -// *
-//	 * FORMATTER / Option to insert a space before the opening parenthesis in a catch
-//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_before_opening_paren_in_catch"
-//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
-//	 *     - default:           INSERT
-//	 * 
-// * @see CCorePlugin#INSERT -// * @see CCorePlugin#DO_NOT_INSERT -// */ -// public static final String FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_CATCH = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_opening_paren_in_catch"; //$NON-NLS-1$ + public static final String FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACE_IN_NAMESPACE_DECLARATION = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_opening_brace_in_namespace_declaration"; //$NON-NLS-1$ + /** + *
+	 * FORMATTER / Option to insert a space before the opening bracket
+	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_before_opening_bracket"
+	 *     - possible values:   { INSERT, DO_NOT_INSERT }
+	 *     - default:           DO_NOT_INSERT
+	 * 
+ * @see CCorePlugin#INSERT + * @see CCorePlugin#DO_NOT_INSERT + */ + public static final String FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACKET = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_opening_bracket";//$NON-NLS-1$ + /** + *
+	 * FORMATTER / Option to insert a space before the opening parenthesis in a catch
+	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_before_opening_paren_in_catch"
+	 *     - possible values:   { INSERT, DO_NOT_INSERT }
+	 *     - default:           INSERT
+	 * 
+ * @see CCorePlugin#INSERT + * @see CCorePlugin#DO_NOT_INSERT + */ + public static final String FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_CATCH = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_opening_paren_in_catch"; //$NON-NLS-1$ /** *
 	 * FORMATTER / Option to insert a space before the opening parenthesis in a for statement
@@ -1787,7 +1696,7 @@ public class DefaultCodeFormatterConstants {
 	 * @see CCorePlugin#INSERT
 	 * @see CCorePlugin#DO_NOT_INSERT
 	 */
-	public static final String FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_FOR = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_opening_paren_in_for";	//$NON-NLS-1$
+	public static final String FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_FOR = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_opening_paren_in_for"; //$NON-NLS-1$
 	/**
 	 * 
 	 * FORMATTER / Option to insert a space before the opening parenthesis in an if statement
@@ -1798,7 +1707,7 @@ public class DefaultCodeFormatterConstants {
 	 * @see CCorePlugin#INSERT
 	 * @see CCorePlugin#DO_NOT_INSERT
 	 */
-	public static final String FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_IF = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_opening_paren_in_if";	//$NON-NLS-1$
+	public static final String FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_IF = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_opening_paren_in_if"; //$NON-NLS-1$
 	/**
 	 * 
 	 * FORMATTER / Option to insert a space before the opening parenthesis in a method declaration
@@ -1809,7 +1718,7 @@ public class DefaultCodeFormatterConstants {
 	 * @see CCorePlugin#INSERT
 	 * @see CCorePlugin#DO_NOT_INSERT
 	 */
-	public static final String FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_METHOD_DECLARATION = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_opening_paren_in_method_declaration";	//$NON-NLS-1$
+	public static final String FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_METHOD_DECLARATION = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_opening_paren_in_method_declaration"; //$NON-NLS-1$
 	/**
 	 * 
 	 * FORMATTER / Option to insert a space before the opening parenthesis in a method invocation
@@ -1820,18 +1729,18 @@ public class DefaultCodeFormatterConstants {
 	 * @see CCorePlugin#INSERT
 	 * @see CCorePlugin#DO_NOT_INSERT
 	 */
-	public static final String FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_METHOD_INVOCATION = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_opening_paren_in_method_invocation";	//$NON-NLS-1$
-//	/**
-//	 * 
-//	 * FORMATTER / Option to insert a space before the opening parenthesis in a parenthesized expression
-//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression"
-//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
-//	 *     - default:           DO_NOT_INSERT
-//	 * 
-// * @see CCorePlugin#INSERT -// * @see CCorePlugin#DO_NOT_INSERT -// */ -// public static final String FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_PARENTHESIZED_EXPRESSION = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_opening_paren_in_parenthesized_expression"; //$NON-NLS-1$ + public static final String FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_METHOD_INVOCATION = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_opening_paren_in_method_invocation"; //$NON-NLS-1$ + /** + *
+	 * FORMATTER / Option to insert a space before the opening parenthesis in a parenthesized expression
+	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression"
+	 *     - possible values:   { INSERT, DO_NOT_INSERT }
+	 *     - default:           DO_NOT_INSERT
+	 * 
+ * @see CCorePlugin#INSERT + * @see CCorePlugin#DO_NOT_INSERT + */ + public static final String FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_PARENTHESIZED_EXPRESSION = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_opening_paren_in_parenthesized_expression"; //$NON-NLS-1$ /** *
 	 * FORMATTER / Option to insert a space before the opening parenthesis in a switch statement
@@ -1842,7 +1751,7 @@ public class DefaultCodeFormatterConstants {
 	 * @see CCorePlugin#INSERT
 	 * @see CCorePlugin#DO_NOT_INSERT
 	 */
-	public static final String FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_SWITCH = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_opening_paren_in_switch";	//$NON-NLS-1$
+	public static final String FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_SWITCH = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_opening_paren_in_switch"; //$NON-NLS-1$
 	/**
 	 * 
 	 * FORMATTER / Option to insert a space before the opening parenthesis in a while statement
@@ -1853,7 +1762,7 @@ public class DefaultCodeFormatterConstants {
 	 * @see CCorePlugin#INSERT
 	 * @see CCorePlugin#DO_NOT_INSERT
 	 */
-	public static final String FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_WHILE = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_opening_paren_in_while";	//$NON-NLS-1$
+	public static final String FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_WHILE = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_opening_paren_in_while"; //$NON-NLS-1$
 //	/**
 //	 * 
 //	 * FORMATTER / Option to insert a space before parenthesized expression in return statement
@@ -1865,29 +1774,29 @@ public class DefaultCodeFormatterConstants {
 //	 * @see CCorePlugin#INSERT
 //	 * @see CCorePlugin#DO_NOT_INSERT
 //	 */
-//	public static final String FORMATTER_INSERT_SPACE_BEFORE_PARENTHESIZED_EXPRESSION_IN_RETURN  = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_parenthesized_expression_in_return";	//$NON-NLS-1$
-//	/**
-//	 * 
-//	 * FORMATTER / Option to insert a space before a postfix operator
-//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_before_postfix_operator"
-//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
-//	 *     - default:           DO_NOT_INSERT
-//	 * 
-// * @see CCorePlugin#INSERT -// * @see CCorePlugin#DO_NOT_INSERT -// */ -// public static final String FORMATTER_INSERT_SPACE_BEFORE_POSTFIX_OPERATOR = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_postfix_operator"; //$NON-NLS-1$ -// /** -// *
-//	 * FORMATTER / Option to insert a space before a prefix operator
-//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_before_prefix_operator"
-//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
-//	 *     - default:           DO_NOT_INSERT
-//	 * 
-// * @see CCorePlugin#INSERT -// * @see CCorePlugin#DO_NOT_INSERT -// */ -// public static final String FORMATTER_INSERT_SPACE_BEFORE_PREFIX_OPERATOR = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_prefix_operator"; //$NON-NLS-1$ +// public static final String FORMATTER_INSERT_SPACE_BEFORE_PARENTHESIZED_EXPRESSION_IN_RETURN = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_parenthesized_expression_in_return"; //$NON-NLS-1$ + /** + *
+	 * FORMATTER / Option to insert a space before a postfix operator
+	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_before_postfix_operator"
+	 *     - possible values:   { INSERT, DO_NOT_INSERT }
+	 *     - default:           DO_NOT_INSERT
+	 * 
+ * @see CCorePlugin#INSERT + * @see CCorePlugin#DO_NOT_INSERT + */ + public static final String FORMATTER_INSERT_SPACE_BEFORE_POSTFIX_OPERATOR = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_postfix_operator"; //$NON-NLS-1$ + /** + *
+	 * FORMATTER / Option to insert a space before a prefix operator
+	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_before_prefix_operator"
+	 *     - possible values:   { INSERT, DO_NOT_INSERT }
+	 *     - default:           DO_NOT_INSERT
+	 * 
+ * @see CCorePlugin#INSERT + * @see CCorePlugin#DO_NOT_INSERT + */ + public static final String FORMATTER_INSERT_SPACE_BEFORE_PREFIX_OPERATOR = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_prefix_operator"; //$NON-NLS-1$ /** *
 	 * FORMATTER / Option to insert a space before question mark in a conditional expression
@@ -1898,7 +1807,7 @@ public class DefaultCodeFormatterConstants {
 	 * @see CCorePlugin#INSERT
 	 * @see CCorePlugin#DO_NOT_INSERT
 	 */
-	public static final String FORMATTER_INSERT_SPACE_BEFORE_QUESTION_IN_CONDITIONAL = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_question_in_conditional";	//$NON-NLS-1$
+	public static final String FORMATTER_INSERT_SPACE_BEFORE_QUESTION_IN_CONDITIONAL = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_question_in_conditional"; //$NON-NLS-1$
 	/**
 	 * 
 	 * FORMATTER / Option to insert a space before semicolon
@@ -1909,7 +1818,7 @@ public class DefaultCodeFormatterConstants {
 	 * @see CCorePlugin#INSERT
 	 * @see CCorePlugin#DO_NOT_INSERT
 	 */
-	public static final String FORMATTER_INSERT_SPACE_BEFORE_SEMICOLON = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_semicolon";	//$NON-NLS-1$
+	public static final String FORMATTER_INSERT_SPACE_BEFORE_SEMICOLON = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_semicolon"; //$NON-NLS-1$
 	/**
 	 * 
 	 * FORMATTER / Option to insert a space before semicolon in for statement
@@ -1920,33 +1829,21 @@ public class DefaultCodeFormatterConstants {
 	 * @see CCorePlugin#INSERT
 	 * @see CCorePlugin#DO_NOT_INSERT
 	 */
-	public static final String FORMATTER_INSERT_SPACE_BEFORE_SEMICOLON_IN_FOR = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_semicolon_in_for";	//$NON-NLS-1$
-//	/**
-//	 * 
-//	 * FORMATTER / Option to insert a space before unary operator
-//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_before_unary_operator"
-//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
-//	 *     - default:           DO_NOT_INSERT
-//	 * 
-// * @see CCorePlugin#INSERT -// * @see CCorePlugin#DO_NOT_INSERT -// */ -// public static final String FORMATTER_INSERT_SPACE_BEFORE_UNARY_OPERATOR = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_unary_operator"; //$NON-NLS-1$ -// -// /** -// *
-//	 * FORMATTER / Option to insert a space between brackets in an array type reference
-//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_between_brackets_in_array_type_reference"
-//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
-//	 *     - default:           DO_NOT_INSERT
-//	 * 
-// * @see CCorePlugin#INSERT -// * @see CCorePlugin#DO_NOT_INSERT -// */ -// public static final String FORMATTER_INSERT_SPACE_BETWEEN_BRACKETS_IN_ARRAY_TYPE_REFERENCE = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_between_brackets_in_array_type_reference"; //$NON-NLS-1$ + public static final String FORMATTER_INSERT_SPACE_BEFORE_SEMICOLON_IN_FOR = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_semicolon_in_for"; //$NON-NLS-1$ /** *
-	 * FORMATTER / Option to insert a space between empty braces in an array initializer
+	 * FORMATTER / Option to insert a space before unary operator
+	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_before_unary_operator"
+	 *     - possible values:   { INSERT, DO_NOT_INSERT }
+	 *     - default:           DO_NOT_INSERT
+	 * 
+ * @see CCorePlugin#INSERT + * @see CCorePlugin#DO_NOT_INSERT + */ + public static final String FORMATTER_INSERT_SPACE_BEFORE_UNARY_OPERATOR = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_unary_operator"; //$NON-NLS-1$ + /** + *
+	 * FORMATTER / Option to insert a space between empty braces in an initializer list
 	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_between_empty_braces_in_array_initializer"
 	 *     - possible values:   { INSERT, DO_NOT_INSERT }
 	 *     - default:           DO_NOT_INSERT
@@ -1954,18 +1851,18 @@ public class DefaultCodeFormatterConstants {
 	 * @see CCorePlugin#INSERT
 	 * @see CCorePlugin#DO_NOT_INSERT
 	 */
-	public static final String FORMATTER_INSERT_SPACE_BETWEEN_EMPTY_BRACES_IN_ARRAY_INITIALIZER = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_between_empty_braces_in_array_initializer";	//$NON-NLS-1$
-//	/**
-//	 * 
-//	 * FORMATTER / Option to insert a space between empty brackets in an array allocation expression
-//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression"
-//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
-//	 *     - default:           DO_NOT_INSERT
-//	 * 
-// * @see CCorePlugin#INSERT -// * @see CCorePlugin#DO_NOT_INSERT -// */ -// public static final String FORMATTER_INSERT_SPACE_BETWEEN_EMPTY_BRACKETS_IN_ARRAY_ALLOCATION_EXPRESSION = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_between_empty_brackets_in_array_allocation_expression"; //$NON-NLS-1$ + public static final String FORMATTER_INSERT_SPACE_BETWEEN_EMPTY_BRACES_IN_INITIALIZER_LIST = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_between_empty_braces_in_array_initializer"; //$NON-NLS-1$ + /** + *
+	 * FORMATTER / Option to insert a space between empty brackets
+	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_between_empty_brackets"
+	 *     - possible values:   { INSERT, DO_NOT_INSERT }
+	 *     - default:           DO_NOT_INSERT
+	 * 
+ * @see CCorePlugin#INSERT + * @see CCorePlugin#DO_NOT_INSERT + */ + public static final String FORMATTER_INSERT_SPACE_BETWEEN_EMPTY_BRACKETS = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_between_empty_brackets"; //$NON-NLS-1$ /** *
 	 * FORMATTER / Option to insert a space between empty parenthesis in a method declaration
@@ -1976,18 +1873,18 @@ public class DefaultCodeFormatterConstants {
 	 * @see CCorePlugin#INSERT
 	 * @see CCorePlugin#DO_NOT_INSERT
 	 */
-	public static final String FORMATTER_INSERT_SPACE_BETWEEN_EMPTY_PARENS_IN_METHOD_DECLARATION = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_between_empty_parens_in_method_declaration";	//$NON-NLS-1$
-//	/**
-//	 * 
-//	 * FORMATTER / Option to insert a space between empty parenthesis in a method invocation
-//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_between_empty_parens_in_method_invocation"
-//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
-//	 *     - default:           DO_NOT_INSERT
-//	 * 
-// * @see CCorePlugin#INSERT -// * @see CCorePlugin#DO_NOT_INSERT -// */ -// public static final String FORMATTER_INSERT_SPACE_BETWEEN_EMPTY_PARENS_IN_METHOD_INVOCATION = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_between_empty_parens_in_method_invocation"; //$NON-NLS-1$ + public static final String FORMATTER_INSERT_SPACE_BETWEEN_EMPTY_PARENS_IN_METHOD_DECLARATION = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_between_empty_parens_in_method_declaration"; //$NON-NLS-1$ + /** + *
+	 * FORMATTER / Option to insert a space between empty parenthesis in a method invocation
+	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_between_empty_parens_in_method_invocation"
+	 *     - possible values:   { INSERT, DO_NOT_INSERT }
+	 *     - default:           DO_NOT_INSERT
+	 * 
+ * @see CCorePlugin#INSERT + * @see CCorePlugin#DO_NOT_INSERT + */ + public static final String FORMATTER_INSERT_SPACE_BETWEEN_EMPTY_PARENS_IN_METHOD_INVOCATION = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_between_empty_parens_in_method_invocation"; //$NON-NLS-1$ /** *
 	 * FORMATTER / Option to keep else statement on the same line
@@ -2001,7 +1898,7 @@ public class DefaultCodeFormatterConstants {
 	public static final String FORMATTER_KEEP_ELSE_STATEMENT_ON_SAME_LINE = CCorePlugin.PLUGIN_ID + ".formatter.keep_else_statement_on_same_line"; //$NON-NLS-1$
 	/**
 	 * 
-	 * FORMATTER / Option to keep empty array initializer one one line
+	 * FORMATTER / Option to keep empty initializer list one one line
 	 *     - option id:         "org.eclipse.cdt.core.formatter.keep_empty_array_initializer_on_one_line"
 	 *     - possible values:   { TRUE, FALSE }
 	 *     - default:           FALSE
@@ -2009,7 +1906,7 @@ public class DefaultCodeFormatterConstants {
 	 * @see #TRUE
 	 * @see #FALSE
 	 */
-	public static final String FORMATTER_KEEP_EMPTY_ARRAY_INITIALIZER_ON_ONE_LINE = CCorePlugin.PLUGIN_ID + ".formatter.keep_empty_array_initializer_on_one_line"; //$NON-NLS-1$
+	public static final String FORMATTER_KEEP_EMPTY_INITIALIZER_LIST_ON_ONE_LINE = CCorePlugin.PLUGIN_ID + ".formatter.keep_empty_array_initializer_on_one_line"; //$NON-NLS-1$
 	/**
 	 * 
 	 * FORMATTER / Option to keep guardian clause on one line
@@ -2020,7 +1917,7 @@ public class DefaultCodeFormatterConstants {
 	 * @see #TRUE
 	 * @see #FALSE
 	 */
-	public static final String FORMATTER_KEEP_GUARDIAN_CLAUSE_ON_ONE_LINE = CCorePlugin.PLUGIN_ID + ".formatter.format_guardian_clause_on_one_line";	//$NON-NLS-1$
+	public static final String FORMATTER_KEEP_GUARDIAN_CLAUSE_ON_ONE_LINE = CCorePlugin.PLUGIN_ID + ".formatter.format_guardian_clause_on_one_line"; //$NON-NLS-1$
 	/**
 	 * 
 	 * FORMATTER / Option to keep simple if statement on the one line
@@ -2061,7 +1958,7 @@ public class DefaultCodeFormatterConstants {
 	 *     - default:           "0"
 	 * 
*/ - public static final String FORMATTER_NUMBER_OF_EMPTY_LINES_TO_PRESERVE = CCorePlugin.PLUGIN_ID + ".formatter.number_of_empty_lines_to_preserve"; //$NON-NLS-1$ + public static final String FORMATTER_NUMBER_OF_EMPTY_LINES_TO_PRESERVE = CCorePlugin.PLUGIN_ID + ".formatter.number_of_empty_lines_to_preserve"; //$NON-NLS-1$ /** *
 	 * FORMATTER / Option to specify whether or not empty statement should be on a new line
@@ -2072,7 +1969,7 @@ public class DefaultCodeFormatterConstants {
 	 * @see #TRUE
 	 * @see #FALSE
 	 */
-	public static final String FORMATTER_PUT_EMPTY_STATEMENT_ON_NEW_LINE = CCorePlugin.PLUGIN_ID + ".formatter.put_empty_statement_on_new_line";	//$NON-NLS-1$
+	public static final String FORMATTER_PUT_EMPTY_STATEMENT_ON_NEW_LINE = CCorePlugin.PLUGIN_ID + ".formatter.put_empty_statement_on_new_line"; //$NON-NLS-1$
 	/**
 	 * 
 	 * FORMATTER / Option to specify the tabulation size
@@ -2143,8 +2040,7 @@ public class DefaultCodeFormatterConstants {
 	 * FORMATTER / Value to set a brace location at the start of the next line with
 	 *             the right indentation.
 	 * 
- * @see #FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION - * @see #FORMATTER_BRACE_POSITION_FOR_ARRAY_INITIALIZER + * @see #FORMATTER_BRACE_POSITION_FOR_INITIALIZER_LIST * @see #FORMATTER_BRACE_POSITION_FOR_BLOCK * @see #FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION * @see #FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION @@ -2157,8 +2053,7 @@ public class DefaultCodeFormatterConstants { * FORMATTER / Value to set a brace location at the start of the next line if a wrapping * occured. *
- * @see #FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION - * @see #FORMATTER_BRACE_POSITION_FOR_ARRAY_INITIALIZER + * @see #FORMATTER_BRACE_POSITION_FOR_INITIALIZER_LIST * @see #FORMATTER_BRACE_POSITION_FOR_BLOCK * @see #FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION * @see #FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION @@ -2171,15 +2066,14 @@ public class DefaultCodeFormatterConstants { * FORMATTER / Value to set a brace location at the start of the next line with * an extra indentation. *
- * @see #FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION - * @see #FORMATTER_BRACE_POSITION_FOR_ARRAY_INITIALIZER + * @see #FORMATTER_BRACE_POSITION_FOR_INITIALIZER_LIST * @see #FORMATTER_BRACE_POSITION_FOR_BLOCK * @see #FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION * @see #FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION * @see #FORMATTER_BRACE_POSITION_FOR_SWITCH * @see #FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION */ - public static final String NEXT_LINE_SHIFTED = "next_line_shifted"; //$NON-NLS-1$ + public static final String NEXT_LINE_SHIFTED = "next_line_shifted"; //$NON-NLS-1$ /** *
 	 * FORMATTER / Value to set an option to true.
diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/formatter/CodeFormatterVisitor.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/formatter/CodeFormatterVisitor.java
index f80f8a1a511..b401656d25a 100644
--- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/formatter/CodeFormatterVisitor.java
+++ b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/formatter/CodeFormatterVisitor.java
@@ -22,6 +22,7 @@ import org.eclipse.cdt.core.CCorePlugin;
 import org.eclipse.cdt.core.dom.ast.IASTASMDeclaration;
 import org.eclipse.cdt.core.dom.ast.IASTArrayDeclarator;
 import org.eclipse.cdt.core.dom.ast.IASTArrayModifier;
+import org.eclipse.cdt.core.dom.ast.IASTArraySubscriptExpression;
 import org.eclipse.cdt.core.dom.ast.IASTBinaryExpression;
 import org.eclipse.cdt.core.dom.ast.IASTBreakStatement;
 import org.eclipse.cdt.core.dom.ast.IASTCaseStatement;
@@ -36,6 +37,7 @@ import org.eclipse.cdt.core.dom.ast.IASTDeclarationStatement;
 import org.eclipse.cdt.core.dom.ast.IASTDeclarator;
 import org.eclipse.cdt.core.dom.ast.IASTDefaultStatement;
 import org.eclipse.cdt.core.dom.ast.IASTDoStatement;
+import org.eclipse.cdt.core.dom.ast.IASTElaboratedTypeSpecifier;
 import org.eclipse.cdt.core.dom.ast.IASTEnumerationSpecifier;
 import org.eclipse.cdt.core.dom.ast.IASTExpression;
 import org.eclipse.cdt.core.dom.ast.IASTExpressionList;
@@ -86,28 +88,33 @@ import org.eclipse.cdt.core.dom.ast.IASTTypeIdExpression;
 import org.eclipse.cdt.core.dom.ast.IASTUnaryExpression;
 import org.eclipse.cdt.core.dom.ast.IASTWhileStatement;
 import org.eclipse.cdt.core.dom.ast.IASTEnumerationSpecifier.IASTEnumerator;
+import org.eclipse.cdt.core.dom.ast.c.ICASTArrayModifier;
 import org.eclipse.cdt.core.dom.ast.c.ICASTCompositeTypeSpecifier;
 import org.eclipse.cdt.core.dom.ast.c.ICASTDesignatedInitializer;
-import org.eclipse.cdt.core.dom.ast.c.ICASTElaboratedTypeSpecifier;
-import org.eclipse.cdt.core.dom.ast.c.ICASTEnumerationSpecifier;
 import org.eclipse.cdt.core.dom.ast.c.ICASTPointer;
+import org.eclipse.cdt.core.dom.ast.c.ICASTTypeIdInitializerExpression;
 import org.eclipse.cdt.core.dom.ast.cpp.CPPASTVisitor;
 import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTCastExpression;
 import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTCatchHandler;
 import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTCompositeTypeSpecifier;
 import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTConstructorChainInitializer;
 import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTConstructorInitializer;
+import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTDeleteExpression;
 import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTElaboratedTypeSpecifier;
 import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTExplicitTemplateInstantiation;
+import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTFieldReference;
 import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTForStatement;
 import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTFunctionDeclarator;
 import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTFunctionTryBlockDeclarator;
 import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTLinkageSpecification;
+import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTNamedTypeSpecifier;
 import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTNamespaceAlias;
 import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTNamespaceDefinition;
+import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTNewExpression;
 import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTPointerToMember;
 import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTQualifiedName;
 import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTReferenceOperator;
+import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTSimpleTypeConstructorExpression;
 import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTSimpleTypeTemplateParameter;
 import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTTemplateDeclaration;
 import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTTemplateId;
@@ -182,12 +189,9 @@ public class CodeFormatterVisitor extends CPPASTVisitor {
 		shouldVisitTemplateParameters = true;
 	}
 
-	private Scanner localScanner;
-
-	public DefaultCodeFormatterOptions preferences;
-
-	public Scribe scribe;
-	private String fTranslationUnitFile;
+	private final Scanner localScanner;
+	final DefaultCodeFormatterOptions preferences;
+	private final Scribe scribe;
 
 	private boolean fInsideFor;
 	private boolean fExpectSemicolonAfterDeclaration= true;
@@ -218,7 +222,7 @@ public class CodeFormatterVisitor extends CPPASTVisitor {
 		// reset the scribe
 		scribe.reset();
 
-		long startTime = System.currentTimeMillis();
+		final long startTime = DEBUG ? System.currentTimeMillis() : 0;
 
 		final char[] compilationUnitSource = string.toCharArray();
 
@@ -226,7 +230,6 @@ public class CodeFormatterVisitor extends CPPASTVisitor {
 		scribe.initializeScanner(compilationUnitSource);
 		scribe.setSkipPositions(collectInactiveCodePositions(unit));
 
-		fTranslationUnitFile= unit.getFilePath();
 		fStatus= new MultiStatus(CCorePlugin.PLUGIN_ID, 0, "Formatting problem(s)", null); //$NON-NLS-1$
 		try {
 			unit.accept(this);
@@ -247,7 +250,7 @@ public class CodeFormatterVisitor extends CPPASTVisitor {
 		return fStatus;
 	}
 	
-	private final TextEdit failedToFormat(RuntimeException e) {
+	private TextEdit failedToFormat(RuntimeException e) {
 		if (DEBUG) {
 			System.out.println("COULD NOT FORMAT: " + e.getMessage()); //$NON-NLS-1$
 			System.out.println(scribe.scanner);
@@ -284,7 +287,7 @@ public class CodeFormatterVisitor extends CPPASTVisitor {
 		IASTDeclaration[] decls= tu.getDeclarations();
 		for (int i = 0; i < decls.length; i++) {
 			IASTDeclaration declaration = decls[i];
-			if (!fTranslationUnitFile.equals(declaration.getContainingFilename())) {
+			if (!declaration.isPartOfTranslationUnitFile()) {
 				continue;
 			}
 			try {
@@ -328,14 +331,11 @@ public class CodeFormatterVisitor extends CPPASTVisitor {
     		} else if (node instanceof ICPPASTNamespaceDefinition) {
     			return visit((ICPPASTNamespaceDefinition)node);
     		} else if (node instanceof ICPPASTNamespaceAlias) {
-    			formatNode(node);
-    //			return visit((ICPPASTNamespaceAlias)declaration);
+    			return visit((ICPPASTNamespaceAlias)node);
     		} else if (node instanceof ICPPASTUsingDeclaration) {
-    			formatNode(node);
-    //			return visit((ICPPASTUsingDeclaration)declaration);
+    			return visit((ICPPASTUsingDeclaration)node);
     		} else if (node instanceof ICPPASTUsingDirective) {
-    			formatNode(node);
-    //			return visit((ICPPASTUsingDirective)declaration);
+    			return visit((ICPPASTUsingDirective)node);
     		} else if (node instanceof ICPPASTLinkageSpecification) {
     			return visit((ICPPASTLinkageSpecification)node);
     		} else if (node instanceof ICPPASTTemplateDeclaration) {
@@ -347,7 +347,7 @@ public class CodeFormatterVisitor extends CPPASTVisitor {
     		} else if (node instanceof IASTProblemDeclaration) {
     			return visit((IASTProblemDeclaration)node);
     		} else {
-    			formatNode(node);
+    			formatRaw(node);
     		}
 		} catch (ASTProblemException e) {
 			if (node instanceof IASTProblemDeclaration) {
@@ -376,7 +376,7 @@ public class CodeFormatterVisitor extends CPPASTVisitor {
 			} else if (node instanceof ICPPASTTemplateId) {
 				visit((ICPPASTTemplateId)node);
 			} else {
-				formatNode(node);
+				formatRaw(node);
 			}
 		} finally {
 			endOfNode(node);
@@ -390,13 +390,12 @@ public class CodeFormatterVisitor extends CPPASTVisitor {
 	@Override
 	public int visit(IASTInitializer node) {
 		if (node instanceof ICPPASTConstructorInitializer) {
-			visit((ICPPASTConstructorInitializer)node);
-			return PROCESS_SKIP;
+			return visit((ICPPASTConstructorInitializer)node);
 		}
 
 		if (peekNextToken() == Token.tASSIGN) {
-			scribe.printNextToken(Token.tASSIGN, scribe.printComment());
-			if (scribe.printComment()) {
+			scribe.printNextToken(Token.tASSIGN, preferences.insert_space_before_assignment_operator);
+			if (preferences.insert_space_after_assignment_operator) {
 				scribe.space();
 			}
 		}
@@ -408,9 +407,9 @@ public class CodeFormatterVisitor extends CPPASTVisitor {
 			} else if (node instanceof IASTInitializerList) {
 				visit((IASTInitializerList)node);
 			} else if (node instanceof ICASTDesignatedInitializer) {
-				formatNode(node);
+				formatRaw(node);
 			} else {
-				formatNode(node);
+				formatRaw(node);
 			}
 		} finally {
 			endOfNode(node);
@@ -423,7 +422,7 @@ public class CodeFormatterVisitor extends CPPASTVisitor {
 	 */
 	@Override
 	public int visit(IASTParameterDeclaration parameterDeclaration) {
-		formatNode(parameterDeclaration);
+		formatRaw(parameterDeclaration);
 		endOfNode(parameterDeclaration);
 		return PROCESS_SKIP;
 	}
@@ -437,12 +436,21 @@ public class CodeFormatterVisitor extends CPPASTVisitor {
 		
 		try {
 			// common to all declarators
-			formatPointers(node.getPointerOperators());
-			if (scribe.printComment()) {
-				scribe.space();
+			final IASTPointerOperator[] pointerOperators= node.getPointerOperators();
+			formatPointers(pointerOperators);
+			if (node instanceof IASTStandardFunctionDeclarator) {
+				// preserve newline between decl-specifier and declarator
+				// TLETODO need alignment for function definition
+				if (scribe.preserveNewLine()) {
+					scribe.space();
+				}
 			}
 			IASTName name= node.getName();
-			if (name != null) {
+			if (name != null && name.toCharArray().length != 0) {
+				// preserve non-space between pointer operator and name
+				if (pointerOperators.length == 0 || scribe.printComment()) {
+					scribe.space();
+				}
 				name.accept(this);
 			}
 			IASTDeclarator nestedDecl= node.getNestedDeclarator();
@@ -487,10 +495,8 @@ public class CodeFormatterVisitor extends CPPASTVisitor {
 				visit((ICPPASTCompositeTypeSpecifier)node);
 			} else if (node instanceof ICASTCompositeTypeSpecifier) {
 				visit((ICASTCompositeTypeSpecifier)node);
-			} else if (node instanceof ICPPASTElaboratedTypeSpecifier) {
-				visit((ICPPASTElaboratedTypeSpecifier)node);
-			} else if (node instanceof ICASTElaboratedTypeSpecifier) {
-				visit((ICASTElaboratedTypeSpecifier)node);
+			} else if (node instanceof IASTElaboratedTypeSpecifier) {
+				visit((IASTElaboratedTypeSpecifier)node);
 			} else if (node instanceof IASTEnumerationSpecifier) {
 				visit((IASTEnumerationSpecifier)node);
 			} else if (node instanceof IASTSimpleDeclSpecifier) {
@@ -498,7 +504,7 @@ public class CodeFormatterVisitor extends CPPASTVisitor {
 			} else if (node instanceof IASTNamedTypeSpecifier) {
 				visit((IASTNamedTypeSpecifier)node);
 			} else {
-				formatNode(node);
+				formatRaw(node);
 			}
 		} finally {
 			endOfNode(node);
@@ -511,10 +517,11 @@ public class CodeFormatterVisitor extends CPPASTVisitor {
 	 */
 	@Override
 	public int visit(IASTExpression node) {
-//		scribe.printComment();
 		startNode(node);
 		try {
-			if (node instanceof IASTConditionalExpression) {
+			if (node instanceof IASTArraySubscriptExpression) {
+				visit((IASTArraySubscriptExpression)node);
+			} else if (node instanceof IASTConditionalExpression) {
 				visit((IASTConditionalExpression)node);
 			} else if (node instanceof IASTFunctionCallExpression) {
 				visit((IASTFunctionCallExpression)node);
@@ -534,10 +541,18 @@ public class CodeFormatterVisitor extends CPPASTVisitor {
 				visit((IASTUnaryExpression)node);
 			} else if (node instanceof IASTFieldReference) {
 				visit((IASTFieldReference)node);
+			} else if (node instanceof ICASTTypeIdInitializerExpression) {
+				visit((ICASTTypeIdInitializerExpression)node);
+			} else if (node instanceof ICPPASTNewExpression) {
+				visit((ICPPASTNewExpression)node);
+			} else if (node instanceof ICPPASTDeleteExpression) {
+				visit((ICPPASTDeleteExpression)node);
+			} else if (node instanceof ICPPASTSimpleTypeConstructorExpression) {
+				visit((ICPPASTSimpleTypeConstructorExpression)node);
 			} else if (node instanceof IASTProblemExpression) {
 				visit((IASTProblemExpression)node);
 			} else {
-				formatNode(node);
+				formatRaw(node);
 			}
 		} finally {
 			endOfNode(node);
@@ -550,7 +565,6 @@ public class CodeFormatterVisitor extends CPPASTVisitor {
 	 */
 	@Override
 	public int visit(IASTStatement node) {
-//		scribe.printComment();
 		startNode(node);
 		int indentLevel= scribe.indentationLevel;
 		try {
@@ -560,16 +574,10 @@ public class CodeFormatterVisitor extends CPPASTVisitor {
     			visit((IASTNullStatement)node);
     		} else if (node instanceof IASTDeclarationStatement) {
     			visit((IASTDeclarationStatement)node);
-    		} else if (node instanceof ICPPASTForStatement) {
-    			// TLETODO [formatter] handle C++ specifics
-    			visit((IASTForStatement)node);
     		} else if (node instanceof IASTForStatement) {
     			visit((IASTForStatement)node);
     		} else if (node instanceof IASTIfStatement) {
     			visit((IASTIfStatement)node);
-    		} else if (node instanceof ICPPASTWhileStatement) {
-    			// TLETODO [formatter] handle C++ specifics
-    			visit((IASTWhileStatement)node);
     		} else if (node instanceof ICPPASTCatchHandler) {
     			visit((ICPPASTCatchHandler)node);
     		} else if (node instanceof ICPPASTTryBlockStatement) {
@@ -597,7 +605,7 @@ public class CodeFormatterVisitor extends CPPASTVisitor {
     		} else if (node instanceof IASTProblemStatement) {
     			visit((IASTProblemStatement)node);
     		} else {
-    			formatNode(node);
+    			formatRaw(node);
     		}
 		} catch (ASTProblemException e) {
 			if (node instanceof IASTProblemStatement) {
@@ -643,8 +651,23 @@ public class CodeFormatterVisitor extends CPPASTVisitor {
 	 */
 	@Override
 	public int visit(IASTEnumerator enumerator) {
-		formatNode(enumerator);
-		endOfNode(enumerator);
+		startNode(enumerator);
+		try {
+			// name
+			enumerator.getName().accept(this);
+			
+			// optional value assignment
+			final IASTExpression value= enumerator.getValue();
+			if (value != null) {
+				scribe.printNextToken(Token.tASSIGN, preferences.insert_space_before_assignment_operator);
+				if (preferences.insert_space_after_assignment_operator) {
+					scribe.space();
+				}
+				value.accept(this);
+			}
+		} finally {
+			endOfNode(enumerator);
+		}
 		return PROCESS_SKIP;
 	}
 
@@ -653,8 +676,30 @@ public class CodeFormatterVisitor extends CPPASTVisitor {
 	 */
 	@Override
 	public int visit(ICPPASTBaseSpecifier specifier) {
-		formatNode(specifier);
-		endOfNode(specifier);
+		startNode(specifier);
+		try {
+			boolean needSpace= false;
+			loop: while (true) {
+				int token= peekNextToken();
+				switch (token) {
+				case Token.t_public:
+				case Token.t_protected:
+				case Token.t_private:
+				case Token.t_virtual:
+					scribe.printNextToken(token, needSpace);
+					needSpace= true;
+					break;
+				default:
+					break loop;
+				}
+			}
+			if (needSpace) {
+				scribe.space();
+			}
+			specifier.getName().accept(this);
+		} finally {
+			endOfNode(specifier);
+		}
 		return PROCESS_SKIP;
 	}
 
@@ -663,7 +708,6 @@ public class CodeFormatterVisitor extends CPPASTVisitor {
 	 */
 	@Override
 	public int visit(ICPPASTNamespaceDefinition node) {
-		scribe.printComment();
 		startNode(node);
 		try {
 			final int line= scribe.line;
@@ -699,6 +743,7 @@ public class CodeFormatterVisitor extends CPPASTVisitor {
 		return PROCESS_SKIP;
 	}
 
+	
 	private int visit(ICPPASTLinkageSpecification node) {
 		scribe.printComment();
 		final int line= scribe.line;
@@ -732,6 +777,58 @@ public class CodeFormatterVisitor extends CPPASTVisitor {
 		return PROCESS_SKIP;
 	}
 
+	/**
+	 * 
+	 *   namespace-alias-definition:
+	 * 	      namespace identifier = qualified-namespace-specifier ;
+	 * 
+ */ + private int visit(ICPPASTNamespaceAlias node) { + scribe.printNextToken(Token.t_namespace); + scribe.space(); + node.getAlias().accept(this); + scribe.printNextToken(Token.tASSIGN, preferences.insert_space_before_assignment_operator); + if (preferences.insert_space_after_assignment_operator) { + scribe.space(); + } + node.getMappingName().accept(this); + scribe.printNextToken(Token.tSEMI, preferences.insert_space_before_semicolon); + return PROCESS_SKIP; + } + + /** + *
+	 *   using-declaration:
+	 * 	      using typenameopt ::opt nested-name-specifier unqualified-id ;
+	 * 	      using ::  unqualified-id ;
+	 * 
+ */ + private int visit(ICPPASTUsingDeclaration node) { + scribe.printNextToken(Token.t_using); + if (node.isTypename()) { + scribe.printNextToken(Token.t_typename, true); + } + scribe.space(); + node.getName().accept(this); + scribe.printNextToken(Token.tSEMI, preferences.insert_space_before_semicolon); + return PROCESS_SKIP; + } + + /** + *
+	 * 	 using-directive:
+	 * 	      using  namespace ::opt nested-name-specifieropt namespace-name ;
+	 * 
+ */ + private int visit(ICPPASTUsingDirective node) { + scribe.printNextToken(Token.t_using); + scribe.printNextToken(Token.t_namespace, true); + scribe.space(); + node.getQualifiedName().accept(this); + scribe.printNextToken(Token.tSEMI, preferences.insert_space_before_semicolon); + return PROCESS_SKIP; + } + /* * @see org.eclipse.cdt.core.dom.ast.cpp.CPPASTVisitor#visit(org.eclipse.cdt.core.dom.ast.cpp.ICPPASTTemplateParameter) */ @@ -766,7 +863,7 @@ public class CodeFormatterVisitor extends CPPASTVisitor { break; default: assert false : "Unknown template paramter type"; //$NON-NLS-1$ - formatNode(node); + formatRaw(node); return PROCESS_SKIP; } node.getName().accept(this); @@ -780,17 +877,19 @@ public class CodeFormatterVisitor extends CPPASTVisitor { private int visit(ICPPASTTemplatedTypeTemplateParameter node) { scribe.printNextToken(Token.t_template, scribe.printComment()); - scribe.printNextToken(Token.tLT, scribe.printComment()); - if (scribe.printComment()) { + scribe.printNextToken(Token.tLT, preferences.insert_space_before_opening_angle_bracket_in_template_parameters); + if (preferences.insert_space_after_opening_angle_bracket_in_template_parameters) { scribe.space(); } final ICPPASTTemplateParameter[] templateParameters= node.getTemplateParameters(); if (templateParameters.length > 0) { final ListAlignment align= new ListAlignment(Alignment.M_COMPACT_SPLIT); + align.fSpaceAfterComma= preferences.insert_space_after_comma_in_template_parameters; + align.fSpaceBeforeComma= preferences.insert_space_before_comma_in_template_parameters; formatList(Arrays.asList(templateParameters), align, false, false); } - scribe.printNextToken(Token.tGT, scribe.printComment()); - if (scribe.printComment()) { + scribe.printNextToken(Token.tGT, preferences.insert_space_before_closing_angle_bracket_in_template_parameters); + if (preferences.insert_space_after_closing_angle_bracket_in_template_parameters) { scribe.space(); } IASTName name= node.getName(); @@ -831,7 +930,7 @@ public class CodeFormatterVisitor extends CPPASTVisitor { } scribe.printNextToken(Token.tRPAREN, false); } else { - formatNode(node); + formatRaw(node); } return PROCESS_SKIP; } @@ -839,14 +938,20 @@ public class CodeFormatterVisitor extends CPPASTVisitor { private int visit(IASTFunctionDefinition node) { scribe.printComment(); final int line= scribe.line; - IASTDeclSpecifier declSpec= node.getDeclSpecifier(); + + // decl-specifier + final IASTDeclSpecifier declSpec= node.getDeclSpecifier(); declSpec.accept(this); - IASTFunctionDeclarator decl= node.getDeclarator(); - boolean needSpace= scribe.printComment() || (decl.getPointerOperators().length == 0 && decl.getNestedDeclarator() == null); + + // declarator + final IASTFunctionDeclarator declarator= node.getDeclarator(); + boolean needSpace= declarator.getPointerOperators().length > 0 && scribe.printComment(); if (needSpace) { scribe.space(); } - decl.accept(this); + declarator.accept(this); + + // body IASTStatement bodyStmt= node.getBody(); if (bodyStmt instanceof IASTCompoundStatement) { startNode(bodyStmt); @@ -866,8 +971,8 @@ public class CodeFormatterVisitor extends CPPASTVisitor { scribe.startNewLine(); // hack: catch handlers are part of declarator - if (decl instanceof ICPPASTFunctionTryBlockDeclarator) { - ICPPASTCatchHandler[] catchHandlers= ((ICPPASTFunctionTryBlockDeclarator)decl).getCatchHandlers(); + if (declarator instanceof ICPPASTFunctionTryBlockDeclarator) { + ICPPASTCatchHandler[] catchHandlers= ((ICPPASTFunctionTryBlockDeclarator)declarator).getCatchHandlers(); for (int i= 0; i < catchHandlers.length; i++) { catchHandlers[i].accept(this); scribe.printTrailingComment(); @@ -878,7 +983,8 @@ public class CodeFormatterVisitor extends CPPASTVisitor { } private int visit(IASTASMDeclaration node) { - formatNode(node); + // TLETODO implement formatting + formatRaw(node); return PROCESS_SKIP; } @@ -939,10 +1045,10 @@ public class CodeFormatterVisitor extends CPPASTVisitor { exceptionSpecification[0].accept(this); for (int i = 1; i < exceptionSpecification.length; i++) { // insert_space_before_comma_in_method_declaration_throws - scribe.printNextToken(Token.tCOMMA, preferences.insert_space_before_comma_in_array_initializer); + scribe.printNextToken(Token.tCOMMA, preferences.insert_space_before_comma_in_initializer_list); scribe.printTrailingComment(); // insert_space_after_comma_in_method_declaration_throws - if (preferences.insert_space_after_comma_in_array_initializer) { + if (preferences.insert_space_after_comma_in_initializer_list) { scribe.space(); } scribe.alignFragment(alignment, i); @@ -972,10 +1078,12 @@ public class CodeFormatterVisitor extends CPPASTVisitor { private int visit(IASTStandardFunctionDeclarator node) { final List parameters = Arrays.asList(node.getParameters()); + final boolean forceSpaceInsideParen= parameters.isEmpty() && !node.takesVarArgs() + && preferences.insert_space_between_empty_parens_in_method_declaration; final ListAlignment align= new ListAlignment(preferences.alignment_for_parameters_in_method_declaration); align.fSpaceBeforeOpeningParen= preferences.insert_space_before_opening_paren_in_method_declaration; align.fSpaceAfterOpeningParen= preferences.insert_space_after_opening_paren_in_method_declaration; - align.fSpaceBeforeClosingParen= preferences.insert_space_before_closing_paren_in_method_declaration; + align.fSpaceBeforeClosingParen= preferences.insert_space_before_closing_paren_in_method_declaration || forceSpaceInsideParen; align.fSpaceBeforeComma= preferences.insert_space_before_comma_in_method_declaration_parameters; align.fSpaceAfterComma= preferences.insert_space_after_comma_in_method_declaration_parameters; formatList(parameters, align, true, node.takesVarArgs()); @@ -989,11 +1097,14 @@ public class CodeFormatterVisitor extends CPPASTVisitor { if (scribe.printComment()) { scribe.space(); } - scribe.printModifiers(); + if (scribe.printModifiers()) { + scribe.space(); + } if (pointer instanceof ICPPASTReferenceOperator) { scribe.printNextToken(Token.tAMPER, false); } else if (pointer instanceof ICASTPointer) { scribe.printNextToken(Token.tSTAR, false); + skipConstVolatile(); } else if (pointer instanceof ICPPASTPointerToMember) { final ICPPASTPointerToMember ptrToMember= (ICPPASTPointerToMember)pointer; final IASTName name= ptrToMember.getName(); @@ -1001,8 +1112,9 @@ public class CodeFormatterVisitor extends CPPASTVisitor { name.accept(this); } scribe.printNextToken(Token.tSTAR, false); + skipConstVolatile(); } else { - formatNode(pointer); + formatRaw(pointer); } } } @@ -1044,13 +1156,31 @@ public class CodeFormatterVisitor extends CPPASTVisitor { if (arrayModifiers != null) { for (int i = 0; i < arrayModifiers.length; i++) { IASTArrayModifier arrayModifier = arrayModifiers[i]; - scribe.printNextToken(Token.tLBRACKET, scribe.printComment()); + scribe.printNextToken(Token.tLBRACKET, preferences.insert_space_before_opening_bracket); + if (preferences.insert_space_after_opening_bracket ) { + scribe.space(); + } + boolean emptyBrackets= arrayModifier.getConstantExpression() == null; + if (arrayModifier instanceof ICASTArrayModifier) { + emptyBrackets= false; + final ICASTArrayModifier cArrayModifier= (ICASTArrayModifier)arrayModifier; + if (scribe.printModifiers()) { + scribe.space(); + } + if (cArrayModifier.isVariableSized()) { + scribe.printNextToken(Token.tSTAR, scribe.printComment()); + } + if (scribe.printComment()) { + scribe.space(); + } + } + boolean forceSpace= emptyBrackets && preferences.insert_space_between_empty_brackets; try { arrayModifier.accept(this); } catch (ASTProblemException e) { scribe.skipToToken(Token.tRBRACKET); } - scribe.printNextToken(Token.tRBRACKET, scribe.printComment()); + scribe.printNextToken(Token.tRBRACKET, preferences.insert_space_before_closing_bracket || forceSpace); } } return PROCESS_SKIP; @@ -1061,13 +1191,15 @@ public class CodeFormatterVisitor extends CPPASTVisitor { declSpec.accept(this); final List declarators= Arrays.asList(node.getDeclarators()); if (declarators.size() >= 1) { - if (scribe.printComment() || peekNextToken() == Token.tIDENTIFIER) { + if (scribe.printComment()) { scribe.space(); } - final ListAlignment align= new ListAlignment(Alignment.M_COMPACT_SPLIT); + final ListAlignment align= new ListAlignment(preferences.alignment_for_declarator_list); + align.fSpaceAfterComma= preferences.insert_space_after_comma_in_declarator_list; + align.fSpaceBeforeComma= preferences.insert_space_before_comma_in_declarator_list; formatList(declarators, align, false, false); } - if (fExpectSemicolonAfterDeclaration) { + if (fExpectSemicolonAfterDeclaration && !fInsideFor) { if (peekNextToken() != Token.tSEMI) { scribe.skipToToken(Token.tSEMI); } @@ -1077,35 +1209,48 @@ public class CodeFormatterVisitor extends CPPASTVisitor { return PROCESS_SKIP; } - /** - * Test whether the given decl specifier is one of 'class', 'struct', 'union' or 'enum'. - * @param declSpec - * @return true if the decl specifier is one of 'class', 'struct', 'union' or 'enum' - */ - protected boolean isCompositeTypeDeclaration(IASTDeclSpecifier declSpec) { - return declSpec instanceof IASTCompositeTypeSpecifier || declSpec instanceof ICASTEnumerationSpecifier; - } - private int visit(ICPPASTTemplateDeclaration node) { - scribe.printNextToken(Token.t_template, scribe.printComment()); - scribe.printNextToken(Token.tLT, scribe.printComment()); - if (scribe.printComment()) { + if (node.isExported()) { + scribe.printNextToken(Token.t_export); + scribe.space(); + } + scribe.printNextToken(Token.t_template); + scribe.printNextToken(Token.tLT, preferences.insert_space_before_opening_angle_bracket_in_template_parameters); + if (preferences.insert_space_after_opening_angle_bracket_in_template_parameters) { scribe.space(); } final ICPPASTTemplateParameter[] templateParameters= node.getTemplateParameters(); if (templateParameters.length > 0) { final ListAlignment align= new ListAlignment(Alignment.M_COMPACT_SPLIT); + align.fSpaceAfterComma= preferences.insert_space_after_comma_in_template_parameters; + align.fSpaceBeforeComma= preferences.insert_space_before_comma_in_template_parameters; formatList(Arrays.asList(templateParameters), align, false, false); } - scribe.printNextToken(Token.tGT, scribe.printComment()); - if (scribe.printComment()) { + scribe.printNextToken(Token.tGT, preferences.insert_space_before_closing_angle_bracket_in_template_parameters); + if (preferences.insert_space_after_closing_angle_bracket_in_template_parameters) { scribe.space(); } - node.getDeclaration().accept(this); + final IASTDeclaration declaration= node.getDeclaration(); + // preserve newline if any + // TLETODO need alignment for template declaration + scribe.preserveNewLine(); + declaration.accept(this); return PROCESS_SKIP; } + /** + *
+	 *    explicit-specialization:
+     *            template < > declaration
+	 * 
+ */ private int visit(ICPPASTTemplateSpecialization node) { + scribe.printNextToken(Token.t_template); + scribe.printNextToken(Token.tLT, preferences.insert_space_before_opening_angle_bracket_in_template_parameters); + scribe.printNextToken(Token.tGT, scribe.printComment()); + if (preferences.insert_space_after_closing_angle_bracket_in_template_parameters) { + scribe.space(); + } node.getDeclaration().accept(this); return PROCESS_SKIP; } @@ -1116,12 +1261,18 @@ public class CodeFormatterVisitor extends CPPASTVisitor { } private int visit(IASTSimpleDeclSpecifier node) { - formatNode(node); + formatRaw(node); return PROCESS_SKIP; } private int visit(IASTNamedTypeSpecifier node) { - formatNode(node); + if (node instanceof ICPPASTNamedTypeSpecifier) { + if (((ICPPASTNamedTypeSpecifier)node).isTypename()) { + scribe.printNextToken(Token.t_typename); + scribe.space(); + } + } + node.getName().accept(this); return PROCESS_SKIP; } @@ -1130,7 +1281,9 @@ public class CodeFormatterVisitor extends CPPASTVisitor { final int line= scribe.line; // storage class and other modifiers - scribe.printModifiers(); + if (scribe.printModifiers()) { + scribe.space(); + } switch (node.getKey()) { case IASTCompositeTypeSpecifier.k_struct: @@ -1142,8 +1295,12 @@ public class CodeFormatterVisitor extends CPPASTVisitor { default: assert false : "Unexpected composite type specifier"; //$NON-NLS-1$ } - scribe.space(); - node.getName().accept(this); + + final IASTName name= node.getName(); + if (name != null) { + scribe.space(); + name.accept(this); + } // member declarations IASTDeclaration[] memberDecls= node.getMembers(); @@ -1170,31 +1327,41 @@ public class CodeFormatterVisitor extends CPPASTVisitor { final int line= scribe.line; // storage class and other modifiers - scribe.printModifiers(); + if (scribe.printModifiers()) { + scribe.space(); + } final int headerIndent= scribe.numberOfIndentations; switch (node.getKey()) { case IASTCompositeTypeSpecifier.k_struct: - scribe.printNextToken(Token.t_struct, true); + scribe.printNextToken(Token.t_struct, false); break; case IASTCompositeTypeSpecifier.k_union: - scribe.printNextToken(Token.t_union, true); + scribe.printNextToken(Token.t_union, false); break; case ICPPASTCompositeTypeSpecifier.k_class: - scribe.printNextToken(Token.t_class, true); + scribe.printNextToken(Token.t_class, false); break; default: assert false : "Unexpected composite type specifier"; //$NON-NLS-1$ } - scribe.space(); - node.getName().accept(this); + + final IASTName name= node.getName(); + if (name != null) { + scribe.space(); + name.accept(this); + } // base specifiers final List baseSpecifiers= Arrays.asList(node.getBaseSpecifiers()); if (baseSpecifiers.size() > 0) { - scribe.printNextToken(Token.tCOLON, true /*preferences.insert_space_before_colon_in_composite_type_specifier*/); - scribe.space(); + scribe.printNextToken(Token.tCOLON, preferences.insert_space_before_colon_in_base_clause); + if (preferences.insert_space_after_colon_in_base_clause) { + scribe.space(); + } final ListAlignment align= new ListAlignment(Alignment.M_COMPACT_SPLIT); + align.fSpaceAfterComma= preferences.insert_space_after_comma_in_base_types; + align.fSpaceBeforeComma= preferences.insert_space_before_comma_in_base_types; formatList(baseSpecifiers, align, false, false); } @@ -1272,18 +1439,82 @@ public class CodeFormatterVisitor extends CPPASTVisitor { return PROCESS_SKIP; } - private int visit(ICASTElaboratedTypeSpecifier node) { - formatNode(node); - return PROCESS_SKIP; - } + private int visit(IASTElaboratedTypeSpecifier node) { + // storage class and other modifiers + if (scribe.printModifiers()) { + scribe.space(); + } - private int visit(ICPPASTElaboratedTypeSpecifier node) { - formatNode(node); + switch (node.getKind()) { + case IASTElaboratedTypeSpecifier.k_enum: + scribe.printNextToken(Token.t_enum, false); + break; + case IASTElaboratedTypeSpecifier.k_struct: + scribe.printNextToken(Token.t_struct, false); + break; + case IASTElaboratedTypeSpecifier.k_union: + scribe.printNextToken(Token.t_union, false); + break; + case ICPPASTElaboratedTypeSpecifier.k_class: + scribe.printNextToken(Token.t_class, false); + break; + default: + assert false : "Unexpected elaborated type specifier"; //$NON-NLS-1$ + } + scribe.space(); + node.getName().accept(this); return PROCESS_SKIP; } private int visit(IASTEnumerationSpecifier node) { - formatNode(node); + scribe.printComment(); + final int line= scribe.line; + // storage class and other modifiers + if (scribe.printModifiers()) { + scribe.space(); + } + + scribe.printNextToken(Token.t_enum, true); + final IASTName name= node.getName(); + if (name != null) { + scribe.space(); + name.accept(this); + } + + formatLeftCurlyBrace(line, preferences.brace_position_for_type_declaration); + formatOpeningBrace(preferences.brace_position_for_type_declaration, preferences.insert_space_before_opening_brace_in_type_declaration); + +// if (preferences.insert_new_line_after_opening_brace_in_enumerator_list) { +// scribe.printNewLine(); +// } +// if (preferences.insert_space_after_opening_brace_in_enumerator_list) { +// scribe.space(); +// } + + final IASTEnumerator[] enumerators= node.getEnumerators(); + + final ListAlignment align= new ListAlignment(preferences.alignment_for_enumerator_list); + align.fSpaceBeforeComma= preferences.insert_space_before_comma_in_enum_declarations; + align.fSpaceAfterComma= preferences.insert_space_after_comma_in_enum_declarations; + align.fContinuationIndentation= 1; + formatList(Arrays.asList(enumerators), align, false, false); + + // handle trailing comma + if (peekNextToken() == Token.tCOMMA) { + scribe.printNextToken(Token.tCOMMA, align.fSpaceBeforeComma); + if (align.fSpaceAfterComma) { + scribe.space(); + } + } + +// if (preferences.insert_new_line_before_closing_brace_in_enumerator_list) { +// scribe.startNewLine(); +// } +// if (preferences.insert_space_before_closing_brace_in_enumerator_list) { +// scribe.space(); +// } + scribe.startNewLine(); + formatClosingBrace(preferences.brace_position_for_type_declaration); return PROCESS_SKIP; } @@ -1397,8 +1628,8 @@ public class CodeFormatterVisitor extends CPPASTVisitor { private int visit(ICPPASTCatchHandler node) { scribe.printNextToken(Token.t_catch, true); - scribe.printNextToken(Token.tLPAREN, /* preferences.insert_space_before_opening_paren_in_catch */ true); - if (/* preferences.insert_space_after_opening_paren_in_catch */ false) { + scribe.printNextToken(Token.tLPAREN, preferences.insert_space_before_opening_paren_in_catch); + if (preferences.insert_space_after_opening_paren_in_catch) { scribe.space(); } final IASTDeclaration decl= node.getDeclaration(); @@ -1410,12 +1641,12 @@ public class CodeFormatterVisitor extends CPPASTVisitor { fExpectSemicolonAfterDeclaration= true; } } else if (node.isCatchAll()) { - scribe.printNextToken(Token.tELIPSE); - } - scribe.printNextToken(Token.tRPAREN, /* preferences.insert_space_before_closing_paren_in_catch */ false); - if (/* preferences.insert_space_after_closing_paren_in_catch */ true) { - scribe.space(); + scribe.printNextToken(Token.tELIPSE, false /* preferences.insert_space_before_ellipsis */); + if (false /* preferences.insert_space_after_ellipsis */) { + scribe.space(); + } } + scribe.printNextToken(Token.tRPAREN, preferences.insert_space_before_closing_paren_in_catch); final IASTStatement catchBody= node.getCatchBody(); if (catchBody != null) { catchBody.accept(this); @@ -1481,22 +1712,28 @@ public class CodeFormatterVisitor extends CPPASTVisitor { scribe.space(); } if (paramExpr != null) { - paramExpr.accept(this); - } - scribe.printNextToken(Token.tRPAREN, preferences.insert_space_before_closing_paren_in_method_invocation); - if (scribe.printComment()) { + if (paramExpr instanceof IASTExpressionList) { + final IASTExpressionList exprList= (IASTExpressionList)paramExpr; + final List expressions = Arrays.asList(exprList.getExpressions()); + final ListAlignment align= new ListAlignment(preferences.alignment_for_arguments_in_method_invocation); + align.fSpaceBeforeComma= preferences.insert_space_before_comma_in_method_invocation_arguments; + align.fSpaceAfterComma= preferences.insert_space_after_comma_in_method_invocation_arguments; + formatList(expressions, align, false, false); + } else { + paramExpr.accept(this); + } + } else if (preferences.insert_space_between_empty_parens_in_method_invocation) { scribe.space(); } + scribe.printNextToken(Token.tRPAREN, preferences.insert_space_before_closing_paren_in_method_invocation); return PROCESS_SKIP; } private int visit(IASTExpressionList node) { final List expressions = Arrays.asList(node.getExpressions()); - final ListAlignment align= new ListAlignment(preferences.alignment_for_arguments_in_method_invocation); - align.fSpaceAfterOpeningParen= preferences.insert_space_after_opening_paren_in_method_invocation; - align.fSpaceBeforeClosingParen= preferences.insert_space_before_closing_paren_in_method_invocation; - align.fSpaceBeforeComma= preferences.insert_space_before_comma_in_method_invocation_arguments; - align.fSpaceAfterComma= preferences.insert_space_after_comma_in_method_invocation_arguments; + final ListAlignment align= new ListAlignment(preferences.alignment_for_expression_list); + align.fSpaceBeforeComma= preferences.insert_space_before_comma_in_expression_list; + align.fSpaceAfterComma= preferences.insert_space_after_comma_in_expression_list; formatList(expressions, align, false, false); return PROCESS_SKIP; } @@ -1509,39 +1746,39 @@ public class CodeFormatterVisitor extends CPPASTVisitor { private int visit(IASTCastExpression node) { switch (node.getOperator()) { case IASTCastExpression.op_cast: - scribe.printNextToken(Token.tLPAREN, scribe.printComment()); - if (scribe.printComment()) { + scribe.printNextToken(Token.tLPAREN, false); + if (preferences.insert_space_after_opening_paren_in_cast) { scribe.space(); } node.getTypeId().accept(this); - scribe.printNextToken(Token.tRPAREN, scribe.printComment()); - if (scribe.printComment()) { + scribe.printNextToken(Token.tRPAREN, preferences.insert_space_before_closing_paren_in_cast); + if (preferences.insert_space_after_closing_paren_in_cast) { scribe.space(); } // operand node.getOperand().accept(this); - if (scribe.printComment()) { - scribe.space(); - } break; case ICPPASTCastExpression.op_const_cast: case ICPPASTCastExpression.op_dynamic_cast: case ICPPASTCastExpression.op_reinterpret_cast: case ICPPASTCastExpression.op_static_cast: - scribe.printNextToken(peekNextToken(), scribe.printComment()); - scribe.printNextToken(Token.tLT, scribe.printComment()); - if (scribe.printComment()) { + scribe.printNextToken(peekNextToken(), false); + scribe.printNextToken(Token.tLT, preferences.insert_space_before_opening_angle_bracket_in_template_arguments); + if (preferences.insert_space_after_opening_angle_bracket_in_template_arguments) { scribe.space(); } node.getTypeId().accept(this); - scribe.printNextToken(Token.tGT, scribe.printComment()); - // operand - scribe.printNextToken(Token.tLPAREN, scribe.printComment()); - node.getOperand().accept(this); - scribe.printNextToken(Token.tRPAREN, scribe.printComment()); - if (scribe.printComment()) { + scribe.printNextToken(Token.tGT, preferences.insert_space_before_closing_angle_bracket_in_template_arguments); + if (preferences.insert_space_after_closing_angle_bracket_in_template_arguments) { scribe.space(); } + // operand + scribe.printNextToken(Token.tLPAREN, preferences.insert_space_before_opening_paren_in_method_invocation); + if (preferences.insert_space_after_opening_paren_in_method_invocation) { + scribe.space(); + } + node.getOperand().accept(this); + scribe.printNextToken(Token.tRPAREN, preferences.insert_space_before_closing_paren_in_method_invocation); break; default: skipToNode(node.getOperand()); @@ -1581,7 +1818,6 @@ public class CodeFormatterVisitor extends CPPASTVisitor { try { scribe.alignFragment(expressionAlignment, 0); - // r-value node.getExpression().accept(this); ok = true; @@ -1598,25 +1834,25 @@ public class CodeFormatterVisitor extends CPPASTVisitor { scribe.printComment(); final List initializers = Arrays.asList(node.getInitializers()); - if (initializers.isEmpty() && preferences.keep_empty_array_initializer_on_one_line) { - scribe.printNextToken(Token.tLBRACE, preferences.insert_space_before_opening_brace_in_array_initializer); - scribe.printNextToken(Token.tRBRACE, preferences.insert_space_between_empty_braces_in_array_initializer); + if (initializers.isEmpty() && preferences.keep_empty_initializer_list_on_one_line) { + scribe.printNextToken(Token.tLBRACE, preferences.insert_space_before_opening_brace_in_initializer_list); + scribe.printNextToken(Token.tRBRACE, preferences.insert_space_between_empty_braces_in_initializer_list); } else { final int line= scribe.line; - final String brace_position= preferences.brace_position_for_array_initializer; + final String brace_position= preferences.brace_position_for_initializer_list; formatLeftCurlyBrace(line, brace_position); - formatOpeningBrace(brace_position, preferences.insert_space_before_opening_brace_in_array_initializer); - if (preferences.insert_new_line_after_opening_brace_in_array_initializer) { + formatOpeningBrace(brace_position, preferences.insert_space_before_opening_brace_in_initializer_list); + if (preferences.insert_new_line_after_opening_brace_in_initializer_list) { scribe.printNewLine(); } - if (preferences.insert_space_after_opening_brace_in_array_initializer) { + if (preferences.insert_space_after_opening_brace_in_initializer_list) { scribe.space(); } - final ListAlignment align= new ListAlignment(preferences.alignment_for_expressions_in_array_initializer); - align.fSpaceBeforeComma= preferences.insert_space_before_comma_in_array_initializer; - align.fSpaceAfterComma= preferences.insert_space_after_comma_in_array_initializer; - align.fContinuationIndentation= preferences.continuation_indentation_for_array_initializer; + final ListAlignment align= new ListAlignment(preferences.alignment_for_expressions_in_initializer_list); + align.fSpaceBeforeComma= preferences.insert_space_before_comma_in_initializer_list; + align.fSpaceAfterComma= preferences.insert_space_after_comma_in_initializer_list; + align.fContinuationIndentation= preferences.continuation_indentation_for_initializer_list; formatList(initializers, align, false, false); // handle trailing comma @@ -1627,10 +1863,10 @@ public class CodeFormatterVisitor extends CPPASTVisitor { } } - if (preferences.insert_new_line_before_closing_brace_in_array_initializer) { + if (preferences.insert_new_line_before_closing_brace_in_initializer_list) { scribe.startNewLine(); } - if (preferences.insert_space_before_closing_brace_in_array_initializer) { + if (preferences.insert_space_before_closing_brace_in_initializer_list) { scribe.space(); } formatClosingBrace(brace_position); @@ -1644,58 +1880,23 @@ public class CodeFormatterVisitor extends CPPASTVisitor { final int operator= node.getOperator(); switch (operator) { case IASTUnaryExpression.op_bracketedPrimary: - scribe.printNextToken(Token.tLPAREN, scribe.printComment() /* insert_space_before_opening_paren_in_parenthesized_expression */); - if (scribe.printComment() /* insert_space_after_opening_paren_in_parenthesized_expression */) { - scribe.space(); - } - operand.accept(this); - if (peekNextToken() != Token.tRPAREN) { - scribe.skipToToken(Token.tRPAREN); - } - scribe.printNextToken(Token.tRPAREN, scribe.printComment() /* insert_space_before_closing_paren_in_parenthesized_expression */); - if (scribe.printComment() /* insert_space_after_closing_paren_in_parenthesized_expression */) { - scribe.space(); - } + formatParenthesizedExpression(operand); break; case IASTUnaryExpression.op_prefixIncr: - scribe.printNextToken(Token.tINCR, scribe.printComment()); - operand.accept(this); - break; case IASTUnaryExpression.op_prefixDecr: - scribe.printNextToken(Token.tDECR, scribe.printComment()); + scribe.printNextToken(peekNextToken(), preferences.insert_space_before_prefix_operator); + if (preferences.insert_space_after_prefix_operator) { + scribe.space(); + } operand.accept(this); break; case IASTUnaryExpression.op_postFixIncr: - operand.accept(this); - scribe.printNextToken(Token.tINCR, scribe.printComment()); - break; case IASTUnaryExpression.op_postFixDecr: operand.accept(this); - scribe.printNextToken(Token.tDECR, scribe.printComment()); - break; - case IASTUnaryExpression.op_minus: - scribe.printNextToken(Token.tMINUS, scribe.printComment()); - operand.accept(this); - break; - case IASTUnaryExpression.op_plus: - scribe.printNextToken(Token.tPLUS, scribe.printComment()); - operand.accept(this); - break; - case IASTUnaryExpression.op_not: - scribe.printNextToken(Token.tNOT, scribe.printComment()); - operand.accept(this); - break; - case IASTUnaryExpression.op_amper: - scribe.printNextToken(Token.tAMPER, scribe.printComment()); - operand.accept(this); - break; - case IASTUnaryExpression.op_star: - scribe.printNextToken(Token.tSTAR, scribe.printComment()); - operand.accept(this); - break; - case IASTUnaryExpression.op_tilde: - scribe.printNextToken(Token.tCOMPL, scribe.printComment()); - operand.accept(this); + scribe.printNextToken(peekNextToken(), preferences.insert_space_before_postfix_operator); + if (preferences.insert_space_after_postfix_operator) { + scribe.space(); + } break; case IASTUnaryExpression.op_sizeof: scribe.printNextToken(Token.t_sizeof, scribe.printComment()); @@ -1705,7 +1906,12 @@ public class CodeFormatterVisitor extends CPPASTVisitor { operand.accept(this); break; default: - formatNode(node); + scribe.printNextToken(peekNextToken(), preferences.insert_space_before_unary_operator); + if (preferences.insert_space_after_unary_operator) { + scribe.space(); + } + operand.accept(this); + break; } return PROCESS_SKIP; } @@ -1714,7 +1920,7 @@ public class CodeFormatterVisitor extends CPPASTVisitor { final IASTExpression op1= node.getOperand1(); // operand 1 op1.accept(this); - Alignment expressionAlignment =scribe.createAlignment( + Alignment expressionAlignment= scribe.createAlignment( "binaryExpression", //$NON-NLS-1$ // need configurable alignment Alignment.M_COMPACT_SPLIT, @@ -1728,9 +1934,28 @@ public class CodeFormatterVisitor extends CPPASTVisitor { scribe.alignFragment(expressionAlignment, 0); // operator - scribe.printNextToken(peekNextToken(), scribe.printComment()); - if (scribe.printComment()) { - scribe.space(); + switch (node.getOperator()) { + case IASTBinaryExpression.op_assign: + case IASTBinaryExpression.op_binaryAndAssign: + case IASTBinaryExpression.op_binaryOrAssign: + case IASTBinaryExpression.op_binaryXorAssign: + case IASTBinaryExpression.op_divideAssign: + case IASTBinaryExpression.op_minusAssign: + case IASTBinaryExpression.op_moduloAssign: + case IASTBinaryExpression.op_multiplyAssign: + case IASTBinaryExpression.op_plusAssign: + case IASTBinaryExpression.op_shiftLeftAssign: + case IASTBinaryExpression.op_shiftRightAssign: + scribe.printNextToken(peekNextToken(), preferences.insert_space_before_assignment_operator); + if (preferences.insert_space_after_assignment_operator) { + scribe.space(); + } + break; + default: + scribe.printNextToken(peekNextToken(), preferences.insert_space_before_binary_operator); + if (preferences.insert_space_after_binary_operator) { + scribe.space(); + } } // operand 2 @@ -1747,10 +1972,7 @@ public class CodeFormatterVisitor extends CPPASTVisitor { } private int visit(IASTLiteralExpression node) { - if (node.getNodeLocations().length > 1) { - // cannot handle embedded macros - skipNode(node); - } else if (node.getKind() == IASTLiteralExpression.lk_string_literal) { + if (node.getKind() == IASTLiteralExpression.lk_string_literal) { // handle concatentation of string literals int token; boolean needSpace= false; @@ -1776,7 +1998,7 @@ public class CodeFormatterVisitor extends CPPASTVisitor { } } } else { - scribe.printNextToken(peekNextToken(), scribe.printComment()); + scribe.printNextToken(peekNextToken()); } return PROCESS_SKIP; } @@ -1788,12 +2010,157 @@ public class CodeFormatterVisitor extends CPPASTVisitor { } final IASTName fieldName= node.getFieldName(); if (fieldName != null) { - skipToNode(fieldName); + final int operatorToken= node.isPointerDereference() ? Token.tARROW : Token.tDOT; + scribe.printNextToken(operatorToken, scribe.printComment()); + if (scribe.printComment()) { + scribe.space(); + } + if (node instanceof ICPPASTFieldReference) { + if (((ICPPASTFieldReference)node).isTemplate()) { + scribe.printNextToken(Token.t_template); + scribe.space(); + } + } fieldName.accept(this); } return PROCESS_SKIP; } + private int visit(IASTArraySubscriptExpression node) { + node.getArrayExpression().accept(this); + + scribe.printNextToken(Token.tLBRACKET, preferences.insert_space_before_opening_bracket); + if (preferences.insert_space_after_opening_bracket) { + scribe.space(); + } + + node.getSubscriptExpression().accept(this); + + scribe.printNextToken(Token.tRBRACKET, preferences.insert_space_before_closing_bracket); + return PROCESS_SKIP; + } + + private int visit(ICASTTypeIdInitializerExpression node) { + scribe.printComment(); + final int line= scribe.line; + + node.getTypeId().accept(this); + + final String brace_position= preferences.brace_position_for_initializer_list; + formatLeftCurlyBrace(line, brace_position); + formatOpeningBrace(brace_position, preferences.insert_space_before_opening_brace_in_initializer_list); + if (preferences.insert_new_line_after_opening_brace_in_initializer_list) { + scribe.printNewLine(); + } + if (preferences.insert_space_after_opening_brace_in_initializer_list) { + scribe.space(); + } + + node.getInitializer().accept(this); + + if (preferences.insert_new_line_before_closing_brace_in_initializer_list) { + scribe.startNewLine(); + } + if (preferences.insert_space_before_closing_brace_in_initializer_list) { + scribe.space(); + } + formatClosingBrace(brace_position); + scribe.printTrailingComment(); + return PROCESS_SKIP; + } + + /** + *
+	 * 	  new-expression:
+	 * 	          ::opt new new-placementopt new-type-id new-initializeropt
+	 * 	          ::opt new new-placementopt ( type-id ) new-initializeropt
+	 * 	  new-placement:
+	 * 	          ( expression-list )
+	 * 	  new-type-id:
+	 * 	          type-specifier-seq new-declaratoropt
+	 * 	  new-declarator:
+	 * 	          ptr-operator new-declaratoropt
+	 * 	          direct-new-declarator
+	 * 	  direct-new-declarator:
+	 * 	          [ expression ]
+	 * 	          direct-new-declarator [ constant-expression ]
+	 * 	  new-initializer:
+	 * 	          ( expression-listopt )
+	 * 
+ */ + private int visit(ICPPASTNewExpression node) { + if (node.isGlobal()) { + scribe.printNextToken(Token.tCOLONCOLON); + } + scribe.printNextToken(Token.t_new); + + // placement + final IASTExpression newPlacement= node.getNewPlacement(); + if (newPlacement != null) { + formatParenthesizedExpression(newPlacement); + } + // type-id + final IASTTypeId typeId= node.getTypeId(); + final boolean expectParen= !node.isNewTypeId() && peekNextToken() == Token.tLPAREN; + if (expectParen) { + scribe.printNextToken(Token.tLPAREN, scribe.printComment()); + } else { + scribe.space(); + } + typeId.accept(this); + if (expectParen) { + scribe.printNextToken(Token.tRPAREN); + } + // array spec + final IASTExpression[] newTypeIdArrayExpressions= node.getNewTypeIdArrayExpressions(); + for (int i= 0; i < newTypeIdArrayExpressions.length; i++) { + IASTExpression expression= newTypeIdArrayExpressions[i]; + scribe.printNextToken(Token.tLBRACKET, preferences.insert_space_before_opening_bracket); + if (preferences.insert_space_after_opening_bracket ) { + scribe.space(); + } + expression.accept(this); + scribe.printNextToken(Token.tRBRACKET, preferences.insert_space_before_closing_bracket); + } + // initializer + final IASTExpression newInitializer= node.getNewInitializer(); + if (newInitializer != null || peekNextToken() == Token.tLPAREN) { + formatParenthesizedExpression(newInitializer); + } + return PROCESS_SKIP; + } + + /** + *
+	 * 	 delete-expression:
+	 * 	      ::opt delete cast-expression
+	 * 	      ::opt delete [ ] cast-expression
+	 * 
+ */ + private int visit(ICPPASTDeleteExpression node) { + if (node.isGlobal()) { + scribe.printNextToken(Token.tCOLONCOLON); + } + scribe.printNextToken(Token.t_delete); + if (node.isVectored()) { + scribe.printNextToken(Token.tLBRACKET, preferences.insert_space_before_opening_bracket); + if (preferences.insert_space_after_opening_bracket || preferences.insert_space_between_empty_brackets) { + scribe.space(); + } + scribe.printNextToken(Token.tRBRACKET, preferences.insert_space_before_closing_bracket); + } + scribe.space(); + node.getOperand().accept(this); + return PROCESS_SKIP; + } + + private int visit(ICPPASTSimpleTypeConstructorExpression node) { + scribe.printNextToken(peekNextToken()); + final IASTExpression operand= node.getInitialValue(); + formatParenthesizedExpression(operand); + return PROCESS_SKIP; + } + private int visit(IASTContinueStatement node) { scribe.printNextToken(Token.t_continue); scribe.printNextToken(Token.tSEMI, preferences.insert_space_before_semicolon); @@ -1873,6 +2240,14 @@ public class CodeFormatterVisitor extends CPPASTVisitor { scribe.space(); } condition.accept(this); + } else if (node instanceof ICPPASTForStatement) { + final IASTDeclaration conditionDecl = ((ICPPASTForStatement)node).getConditionDeclaration(); + if (conditionDecl != null) { + if (preferences.insert_space_after_semicolon_in_for) { + scribe.space(); + } + conditionDecl.accept(this); + } } if (peekNextToken() == Token.tSEMI) { scribe.printNextToken(Token.tSEMI, preferences.insert_space_before_semicolon_in_for); @@ -2007,6 +2382,9 @@ public class CodeFormatterVisitor extends CPPASTVisitor { } private int visit(ICPPASTQualifiedName node) { + if (node.isFullyQualified()) { + scribe.printNextToken(Token.tCOLONCOLON); + } IASTName[] names= node.getNames(); for (int i = 0; i < names.length-1; i++) { names[i].accept(this); @@ -2023,16 +2401,27 @@ public class CodeFormatterVisitor extends CPPASTVisitor { private int visit(ICPPASTTemplateId node) { IASTName name= node.getTemplateName(); name.accept(this); - scribe.printNextToken(Token.tLT, scribe.printComment()); - if (scribe.printComment()) { + scribe.printNextToken(Token.tLT, preferences.insert_space_before_opening_angle_bracket_in_template_arguments); + if (preferences.insert_space_after_opening_angle_bracket_in_template_arguments) { scribe.space(); } final IASTNode[] templateArguments= node.getTemplateArguments(); if (templateArguments.length > 0) { final ListAlignment align= new ListAlignment(Alignment.M_COMPACT_SPLIT); + align.fSpaceAfterComma= preferences.insert_space_after_comma_in_template_arguments; + align.fSpaceBeforeComma= preferences.insert_space_before_comma_in_template_arguments; formatList(Arrays.asList(templateArguments), align, false, false); } - scribe.printNextToken(Token.tGT, scribe.printComment()); + scribe.printNextToken(Token.tGT, preferences.insert_space_before_closing_angle_bracket_in_template_arguments); + if (node.getPropertyInParent() != ICPPASTQualifiedName.SEGMENT_NAME) { + if (preferences.insert_space_after_closing_angle_bracket_in_template_arguments) { + scribe.space(); + } else { + scribe.printComment(); + scribe.needSpace= false; + scribe.pendingSpace= false; + } + } return PROCESS_SKIP; } @@ -2055,8 +2444,10 @@ public class CodeFormatterVisitor extends CPPASTVisitor { private int visit(IASTLabelStatement node) { // TLETODO [formatter] label indentation node.getName().accept(this); - scribe.printNextToken(Token.tCOLON, false); - scribe.space(); + scribe.printNextToken(Token.tCOLON, preferences.insert_space_before_colon_in_labeled_statement); + if (preferences.insert_space_after_colon_in_labeled_statement) { + scribe.space(); + } node.getNestedStatement().accept(this); return PROCESS_SKIP; } @@ -2112,10 +2503,10 @@ public class CodeFormatterVisitor extends CPPASTVisitor { } else { statements= Collections.singletonList(bodyStmt); } - final int statementsLength = statements.size(); - if (statementsLength != 0) { - startNode(bodyStmt); - try { + startNode(bodyStmt); + try { + final int statementsLength = statements.size(); + if (statementsLength != 0) { boolean wasACase = false; boolean wasAStatement = false; for (int i = 0; i < statementsLength; i++) { @@ -2171,7 +2562,7 @@ public class CodeFormatterVisitor extends CPPASTVisitor { preferences.indent_statements_compare_to_block); } catch (ASTProblemException e) { if (i < statementsLength - 1) { - final IASTStatement nextStatement = statements.get(i + 1); + final IASTStatement nextStatement= statements.get(i + 1); skipToNode(nextStatement); } } finally { @@ -2189,7 +2580,7 @@ public class CodeFormatterVisitor extends CPPASTVisitor { preferences.indent_statements_compare_to_block); } catch (ASTProblemException e) { if (i < statementsLength - 1) { - final IASTStatement nextStatement = statements.get(i + 1); + final IASTStatement nextStatement= statements.get(i + 1); skipToNode(nextStatement); } } finally { @@ -2204,7 +2595,7 @@ public class CodeFormatterVisitor extends CPPASTVisitor { statement.accept(this); } catch (ASTProblemException e) { if (i < statementsLength - 1) { - final IASTStatement nextStatement = statements.get(i + 1); + final IASTStatement nextStatement= statements.get(i + 1); skipToNode(nextStatement); } } @@ -2219,20 +2610,20 @@ public class CodeFormatterVisitor extends CPPASTVisitor { if ((wasACase || wasAStatement) && preferences.indent_switchstatements_compare_to_cases) { scribe.unIndent(); } - } finally { - endOfNode(bodyStmt); } - } - if (preferences.indent_switchstatements_compare_to_switch) { - scribe.unIndent(); + if (preferences.indent_switchstatements_compare_to_switch) { + scribe.unIndent(); + } + if (scribe.numberOfIndentations < braceIndent) { + scribe.indent(); + } + scribe.startNewLine(); + + formatClosingBrace(switch_brace); + } finally { + endOfNode(bodyStmt); } - if (scribe.numberOfIndentations < braceIndent) { - scribe.indent(); - } - scribe.startNewLine(); - - formatClosingBrace(switch_brace); return PROCESS_SKIP; } @@ -2244,8 +2635,15 @@ public class CodeFormatterVisitor extends CPPASTVisitor { if (preferences.insert_space_after_opening_paren_in_while) { scribe.space(); } - node.getCondition().accept(this); - + final IASTExpression condition= node.getCondition(); + if (condition != null) { + condition.accept(this); + } else if (node instanceof ICPPASTWhileStatement) { + final IASTDeclaration conditionDecl= ((ICPPASTWhileStatement)node).getConditionDeclaration(); + if (conditionDecl != null) { + conditionDecl.accept(this); + } + } scribe.printNextToken(Token.tRPAREN, preferences.insert_space_before_closing_paren_in_while); formatAction(line, node.getBody(), preferences.brace_position_for_block); @@ -2264,7 +2662,7 @@ public class CodeFormatterVisitor extends CPPASTVisitor { throw new ASTProblemException(node.getProblem()); } - private void formatNode(IASTNode node) { + private void formatRaw(IASTNode node) { scribe.printComment(); skipNode(node); } @@ -2299,18 +2697,30 @@ public class CodeFormatterVisitor extends CPPASTVisitor { } } + /** + * Formatting of node is complete. Undo skip region if any. + * + * @param node + */ private void endOfNode(IASTNode node) { if (node instanceof IASTProblemHolder) { return; } - IASTFileLocation fileLocation= node.getFileLocation(); - if (fileLocation != null) { - int nodeEndOffset= fileLocation.getNodeOffset() + fileLocation.getNodeLength(); - scribe.restartAtOffset(nodeEndOffset); + if (scribe.skipRange()) { + IASTFileLocation fileLocation= node.getFileLocation(); + if (fileLocation != null) { + int nodeEndOffset= fileLocation.getNodeOffset() + fileLocation.getNodeLength(); + scribe.restartAtOffset(nodeEndOffset); + } } continueNode(node.getParent()); } + /** + * Formatting of node continues after completion of a chil node. Establish next skip region. + * + * @param node + */ private void continueNode(IASTNode node) { if (node instanceof IASTProblemHolder || node instanceof IASTTranslationUnit) { return; @@ -2383,6 +2793,26 @@ public class CodeFormatterVisitor extends CPPASTVisitor { } } + /** + * Format an expression nested in parenthesis. If the operand is + * null, empty parenthesis are expected. + * + * @param operand + */ + private void formatParenthesizedExpression(final IASTExpression operand) { + scribe.printNextToken(Token.tLPAREN, preferences.insert_space_before_opening_paren_in_parenthesized_expression); + if (preferences.insert_space_after_opening_paren_in_parenthesized_expression ) { + scribe.space(); + } + if (operand != null) { + operand.accept(this); + } + if (peekNextToken() != Token.tRPAREN) { + scribe.skipToToken(Token.tRPAREN); + } + scribe.printNextToken(Token.tRPAREN, preferences.insert_space_before_closing_paren_in_parenthesized_expression); + } + private void formatAction(final int line, final IASTStatement stmt, String brace_position) { if (stmt != null) { if (stmt instanceof IASTCompoundStatement && !startsWithMacroExpansion(stmt)) { @@ -2483,7 +2913,7 @@ public class CodeFormatterVisitor extends CPPASTVisitor { } private void formatStatements(final List statements, boolean insertNewLineAfterLastStatement) { - final int statementsLength = statements.size(); + final int statementsLength= statements.size(); if (statementsLength > 1) { IASTStatement previousStatement= statements.get(0); try { @@ -2493,9 +2923,9 @@ public class CodeFormatterVisitor extends CPPASTVisitor { } final boolean previousStatementIsNullStmt= previousStatement instanceof IASTNullStatement; for (int i = 1; i < statementsLength - 1; i++) { - final IASTStatement statement = statements.get(i); + final IASTStatement statement= statements.get(i); startNode(statement); - final boolean statementIsNullStmt = statement instanceof IASTNullStatement; + final boolean statementIsNullStmt= statement instanceof IASTNullStatement; if ((previousStatementIsNullStmt && !statementIsNullStmt) || (!previousStatementIsNullStmt && !statementIsNullStmt)) { scribe.startNewLine(); @@ -2503,19 +2933,22 @@ public class CodeFormatterVisitor extends CPPASTVisitor { try { statement.accept(this); } catch (ASTProblemException e) { - skipToNode(statements.get(i + 1)); + if (i < statementsLength - 1) { + final IASTStatement nextStatement= statements.get(i + 1); + skipToNode(nextStatement); + } } - previousStatement = statement; + previousStatement= statement; } - final IASTStatement statement = statements.get(statementsLength - 1); - final boolean statementIsNullStmt = statement instanceof IASTNullStatement; + final IASTStatement statement= statements.get(statementsLength - 1); + final boolean statementIsNullStmt= statement instanceof IASTNullStatement; if ((previousStatementIsNullStmt && !statementIsNullStmt) || (!previousStatementIsNullStmt && !statementIsNullStmt)) { scribe.startNewLine(); } statement.accept(this); } else { - final IASTStatement statement = statements.get(0); + final IASTStatement statement= statements.get(0); statement.accept(this); } if (insertNewLineAfterLastStatement) { @@ -2535,22 +2968,7 @@ public class CodeFormatterVisitor extends CPPASTVisitor { return false; } - protected boolean hasComments() { - localScanner.resetTo(scribe.scanner.startPosition, scribe.scannerEndPosition - 1); - int token = localScanner.getNextToken(); - loop: while(true) { - switch(token) { - case Token.tBLOCKCOMMENT : - case Token.tLINECOMMENT : - return true; - default: - break loop; - } - } - return false; - } - - protected int peekNextToken() { + private int peekNextToken() { if (scribe.shouldSkip(scribe.scanner.getCurrentPosition())) { return Token.tBADCHAR; } diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/formatter/DefaultCodeFormatterOptions.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/formatter/DefaultCodeFormatterOptions.java index aaae54b5462..d38b5cba492 100644 --- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/formatter/DefaultCodeFormatterOptions.java +++ b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/formatter/DefaultCodeFormatterOptions.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 IBM Corporation and others. + * Copyright (c) 2000, 2008 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -55,22 +55,22 @@ public class DefaultCodeFormatterOptions { return options; } -// public int alignment_for_arguments_in_allocation_expression; public int alignment_for_arguments_in_method_invocation; // public int alignment_for_assignment; // public int alignment_for_binary_expression; public int alignment_for_compact_if; public int alignment_for_conditional_expression; - public int alignment_for_expressions_in_array_initializer; -// public int alignment_for_multiple_fields; + public int alignment_for_expressions_in_initializer_list; + public int alignment_for_declarator_list; + public int alignment_for_enumerator_list; + public int alignment_for_expression_list; public int alignment_for_parameters_in_method_declaration; -// public int alignment_for_selector_in_method_invocation; // public int alignment_for_superclass_in_type_declaration; // public int alignment_for_throws_clause_in_method_declaration; // public boolean align_type_members_on_columns; - public String brace_position_for_array_initializer; + public String brace_position_for_initializer_list; public String brace_position_for_block; public String brace_position_for_block_in_case; // public String brace_position_for_enum_declaration; @@ -80,7 +80,7 @@ public class DefaultCodeFormatterOptions { public String brace_position_for_switch; public int continuation_indentation; - public int continuation_indentation_for_array_initializer; + public int continuation_indentation_for_initializer_list; // public int blank_lines_after_includes; // public int blank_lines_before_field; @@ -101,7 +101,6 @@ public class DefaultCodeFormatterOptions { public boolean indent_statements_compare_to_block; public boolean indent_statements_compare_to_body; -// public boolean indent_body_declarations_compare_to_enum_declaration_header; public boolean indent_body_declarations_compare_to_access_specifier; public boolean indent_access_specifier_compare_to_type_header; public boolean indent_body_declarations_compare_to_namespace_header; @@ -111,134 +110,124 @@ public class DefaultCodeFormatterOptions { public boolean indent_switchstatements_compare_to_switch; public int indentation_size; - public boolean insert_new_line_after_opening_brace_in_array_initializer; + public boolean insert_new_line_after_opening_brace_in_initializer_list; public boolean insert_new_line_at_end_of_file_if_missing; // public boolean insert_new_line_before_catch_in_try_statement; - public boolean insert_new_line_before_closing_brace_in_array_initializer; + public boolean insert_new_line_before_closing_brace_in_initializer_list; public boolean insert_new_line_before_else_in_if_statement; // public boolean insert_new_line_before_finally_in_try_statement; public boolean insert_new_line_before_while_in_do_statement; public boolean insert_new_line_in_empty_block; -// public boolean insert_new_line_in_empty_enum_declaration; // public boolean insert_new_line_in_empty_method_body; // public boolean insert_new_line_in_empty_type_declaration; -// public boolean insert_space_after_and_in_type_parameter; -// public boolean insert_space_after_assignment_operator; -// public boolean insert_space_after_binary_operator; -// public boolean insert_space_after_closing_angle_bracket_in_type_arguments; -// public boolean insert_space_after_closing_angle_bracket_in_type_parameters; -// public boolean insert_space_after_closing_paren_in_cast; + public boolean insert_space_after_assignment_operator; + public boolean insert_space_after_binary_operator; + public boolean insert_space_after_closing_angle_bracket_in_template_arguments; + public boolean insert_space_after_closing_angle_bracket_in_template_parameters; + public boolean insert_space_after_closing_paren_in_cast; public boolean insert_space_after_closing_brace_in_block; + public boolean insert_space_after_colon_in_base_clause; public boolean insert_space_after_colon_in_case; public boolean insert_space_after_colon_in_conditional; -// public boolean insert_space_after_colon_in_for; -// public boolean insert_space_after_colon_in_labeled_statement; + public boolean insert_space_after_colon_in_labeled_statement; // public boolean insert_space_after_comma_in_allocation_expression; - public boolean insert_space_after_comma_in_array_initializer; -// public boolean insert_space_after_comma_in_enum_declarations; + public boolean insert_space_after_comma_in_initializer_list; + public boolean insert_space_after_comma_in_enum_declarations; +// public boolean insert_space_after_comma_in_for_increments; +// public boolean insert_space_after_comma_in_for_inits; public boolean insert_space_after_comma_in_method_invocation_arguments; public boolean insert_space_after_comma_in_method_declaration_parameters; // public boolean insert_space_after_comma_in_method_declaration_throws; -// public boolean insert_space_after_comma_in_multiple_field_declarations; -// public boolean insert_space_after_comma_in_multiple_local_declarations; -// public boolean insert_space_after_comma_in_parameterized_type_reference; -// public boolean insert_space_after_comma_in_base_types; -// public boolean insert_space_after_comma_in_type_arguments; -// public boolean insert_space_after_comma_in_type_parameters; + public boolean insert_space_after_comma_in_declarator_list; + public boolean insert_space_after_comma_in_expression_list; + public boolean insert_space_after_comma_in_base_types; + public boolean insert_space_after_comma_in_template_arguments; + public boolean insert_space_after_comma_in_template_parameters; // public boolean insert_space_after_ellipsis; -// public boolean insert_space_after_opening_angle_bracket_in_parameterized_type_reference; -// public boolean insert_space_after_opening_angle_bracket_in_type_arguments; -// public boolean insert_space_after_opening_angle_bracket_in_type_parameters; -// public boolean insert_space_after_opening_bracket_in_array_allocation_expression; -// public boolean insert_space_after_opening_bracket_in_array_reference; - public boolean insert_space_after_opening_brace_in_array_initializer; -// public boolean insert_space_after_opening_paren_in_cast; -// public boolean insert_space_after_opening_paren_in_catch; + public boolean insert_space_after_opening_angle_bracket_in_template_arguments; + public boolean insert_space_after_opening_angle_bracket_in_template_parameters; + public boolean insert_space_after_opening_bracket; + public boolean insert_space_after_opening_brace_in_initializer_list; + public boolean insert_space_after_opening_paren_in_cast; + public boolean insert_space_after_opening_paren_in_catch; public boolean insert_space_after_opening_paren_in_for; public boolean insert_space_after_opening_paren_in_if; public boolean insert_space_after_opening_paren_in_method_declaration; public boolean insert_space_after_opening_paren_in_method_invocation; -// public boolean insert_space_after_opening_paren_in_parenthesized_expression; + public boolean insert_space_after_opening_paren_in_parenthesized_expression; public boolean insert_space_after_opening_paren_in_switch; public boolean insert_space_after_opening_paren_in_while; -// public boolean insert_space_after_postfix_operator; -// public boolean insert_space_after_prefix_operator; + public boolean insert_space_after_postfix_operator; + public boolean insert_space_after_prefix_operator; public boolean insert_space_after_question_in_conditional; public boolean insert_space_after_semicolon_in_for; -// public boolean insert_space_after_unary_operator; -// public boolean insert_space_before_and_in_type_parameter; -// public boolean insert_space_before_assignment_operator; -// public boolean insert_space_before_binary_operator; -// public boolean insert_space_before_closing_angle_bracket_in_parameterized_type_reference; -// public boolean insert_space_before_closing_angle_bracket_in_type_arguments; -// public boolean insert_space_before_closing_angle_bracket_in_type_parameters; - public boolean insert_space_before_closing_brace_in_array_initializer; -// public boolean insert_space_before_closing_bracket_in_array_allocation_expression; -// public boolean insert_space_before_closing_bracket_in_array_reference; -// public boolean insert_space_before_closing_paren_in_cast; -// public boolean insert_space_before_closing_paren_in_catch; + public boolean insert_space_after_unary_operator; + public boolean insert_space_before_assignment_operator; + public boolean insert_space_before_binary_operator; + public boolean insert_space_before_closing_angle_bracket_in_template_arguments; + public boolean insert_space_before_closing_angle_bracket_in_template_parameters; + public boolean insert_space_before_closing_brace_in_initializer_list; + public boolean insert_space_before_closing_bracket; + public boolean insert_space_before_closing_paren_in_cast; + public boolean insert_space_before_closing_paren_in_catch; public boolean insert_space_before_closing_paren_in_for; public boolean insert_space_before_closing_paren_in_if; public boolean insert_space_before_closing_paren_in_method_declaration; public boolean insert_space_before_closing_paren_in_method_invocation; -// public boolean insert_space_before_closing_paren_in_parenthesized_expression; + public boolean insert_space_before_closing_paren_in_parenthesized_expression; public boolean insert_space_before_closing_paren_in_switch; public boolean insert_space_before_closing_paren_in_while; + public boolean insert_space_before_colon_in_base_clause; public boolean insert_space_before_colon_in_case; public boolean insert_space_before_colon_in_conditional; public boolean insert_space_before_colon_in_default; -// public boolean insert_space_before_colon_in_for; -// public boolean insert_space_before_colon_in_labeled_statement; + public boolean insert_space_before_colon_in_labeled_statement; // public boolean insert_space_before_comma_in_allocation_expression; - public boolean insert_space_before_comma_in_array_initializer; -// public boolean insert_space_before_comma_in_enum_declarations; + public boolean insert_space_before_comma_in_initializer_list; + public boolean insert_space_before_comma_in_enum_declarations; +// public boolean insert_space_before_comma_in_for_increments; +// public boolean insert_space_before_comma_in_for_inits; public boolean insert_space_before_comma_in_method_invocation_arguments; public boolean insert_space_before_comma_in_method_declaration_parameters; // public boolean insert_space_before_comma_in_method_declaration_throws; -// public boolean insert_space_before_comma_in_multiple_field_declarations; -// public boolean insert_space_before_comma_in_multiple_local_declarations; -// public boolean insert_space_before_comma_in_parameterized_type_reference; -// public boolean insert_space_before_comma_in_base_types; -// public boolean insert_space_before_comma_in_type_arguments; -// public boolean insert_space_before_comma_in_type_parameters; + public boolean insert_space_before_comma_in_declarator_list; + public boolean insert_space_before_comma_in_expression_list; + public boolean insert_space_before_comma_in_base_types; + public boolean insert_space_before_comma_in_template_arguments; + public boolean insert_space_before_comma_in_template_parameters; // public boolean insert_space_before_ellipsis; // public boolean insert_space_before_parenthesized_expression_in_return; -// public boolean insert_space_before_opening_angle_bracket_in_parameterized_type_reference; -// public boolean insert_space_before_opening_angle_bracket_in_type_arguments; -// public boolean insert_space_before_opening_angle_bracket_in_type_parameters; - public boolean insert_space_before_opening_brace_in_array_initializer; + public boolean insert_space_before_opening_angle_bracket_in_template_arguments; + public boolean insert_space_before_opening_angle_bracket_in_template_parameters; + public boolean insert_space_before_opening_brace_in_initializer_list; public boolean insert_space_before_opening_brace_in_block; -// public boolean insert_space_before_opening_brace_in_enum_declaration; public boolean insert_space_before_opening_brace_in_method_declaration; public boolean insert_space_before_opening_brace_in_type_declaration; public boolean insert_space_before_opening_brace_in_namespace_declaration; -// public boolean insert_space_before_opening_bracket_in_array_allocation_expression; -// public boolean insert_space_before_opening_bracket_in_array_reference; -// public boolean insert_space_before_opening_bracket_in_array_type_reference; -// public boolean insert_space_before_opening_paren_in_catch; + public boolean insert_space_before_opening_bracket; + public boolean insert_space_before_opening_paren_in_catch; public boolean insert_space_before_opening_paren_in_for; public boolean insert_space_before_opening_paren_in_if; public boolean insert_space_before_opening_paren_in_method_invocation; public boolean insert_space_before_opening_paren_in_method_declaration; public boolean insert_space_before_opening_paren_in_switch; public boolean insert_space_before_opening_brace_in_switch; -// public boolean insert_space_before_opening_paren_in_parenthesized_expression; + public boolean insert_space_before_opening_paren_in_parenthesized_expression; public boolean insert_space_before_opening_paren_in_while; -// public boolean insert_space_before_postfix_operator; -// public boolean insert_space_before_prefix_operator; + public boolean insert_space_before_postfix_operator; + public boolean insert_space_before_prefix_operator; public boolean insert_space_before_question_in_conditional; public boolean insert_space_before_semicolon; public boolean insert_space_before_semicolon_in_for; -// public boolean insert_space_before_unary_operator; -// public boolean insert_space_between_brackets_in_array_type_reference; - public boolean insert_space_between_empty_braces_in_array_initializer; -// public boolean insert_space_between_empty_brackets_in_array_allocation_expression; + public boolean insert_space_before_unary_operator; + public boolean insert_space_between_empty_braces_in_initializer_list; + public boolean insert_space_between_empty_brackets; public boolean insert_space_between_empty_parens_in_method_declaration; -// public boolean insert_space_between_empty_parens_in_method_invocation; + public boolean insert_space_between_empty_parens_in_method_invocation; public boolean compact_else_if; public boolean keep_guardian_clause_on_one_line; public boolean keep_else_statement_on_same_line; - public boolean keep_empty_array_initializer_on_one_line; + public boolean keep_empty_initializer_list_on_one_line; public boolean keep_simple_if_on_one_line; public boolean keep_then_statement_on_same_line; public int number_of_empty_lines_to_preserve; @@ -272,14 +261,16 @@ public class DefaultCodeFormatterOptions { // options.put(DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_BINARY_EXPRESSION, getAlignment(this.alignment_for_binary_expression)); // options.put(DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_COMPACT_IF, getAlignment(this.alignment_for_compact_if)); options.put(DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_CONDITIONAL_EXPRESSION, getAlignment(this.alignment_for_conditional_expression)); - options.put(DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_EXPRESSIONS_IN_ARRAY_INITIALIZER, getAlignment(this.alignment_for_expressions_in_array_initializer)); -// options.put(DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_MULTIPLE_FIELDS, getAlignment(this.alignment_for_multiple_fields)); + options.put(DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_EXPRESSIONS_IN_INITIALIZER_LIST, getAlignment(this.alignment_for_expressions_in_initializer_list)); + options.put(DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_DECLARATOR_LIST, getAlignment(this.alignment_for_declarator_list)); + options.put(DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_ENUMERATOR_LIST, getAlignment(this.alignment_for_enumerator_list)); + options.put(DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_EXPRESSION_LIST, getAlignment(this.alignment_for_expression_list)); options.put(DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_PARAMETERS_IN_METHOD_DECLARATION, getAlignment(this.alignment_for_parameters_in_method_declaration)); // options.put(DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_SELECTOR_IN_METHOD_INVOCATION, getAlignment(this.alignment_for_selector_in_method_invocation)); // options.put(DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_SUPERCLASS_IN_TYPE_DECLARATION, getAlignment(this.alignment_for_superclass_in_type_declaration)); // options.put(DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_THROWS_CLAUSE_IN_METHOD_DECLARATION, getAlignment(this.alignment_for_throws_clause_in_method_declaration)); // options.put(DefaultCodeFormatterConstants.FORMATTER_ALIGN_TYPE_MEMBERS_ON_COLUMNS, this.align_type_members_on_columns ? DefaultCodeFormatterConstants.TRUE : DefaultCodeFormatterConstants.FALSE); - options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ARRAY_INITIALIZER, this.brace_position_for_array_initializer); + options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_INITIALIZER_LIST, this.brace_position_for_initializer_list); options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, this.brace_position_for_block); options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK_IN_CASE, this.brace_position_for_block_in_case); // options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ENUM_DECLARATION, this.brace_position_for_enum_declaration); @@ -294,7 +285,7 @@ public class DefaultCodeFormatterOptions { // options.put(DefaultCodeFormatterConstants.FORMATTER_COMMENT_FORMAT_SOURCE, this.comment_format_source ? DefaultCodeFormatterConstants.TRUE : DefaultCodeFormatterConstants.FALSE); // options.put(DefaultCodeFormatterConstants.FORMATTER_COMMENT_LINE_LENGTH, Integer.toString(this.comment_line_length)); options.put(DefaultCodeFormatterConstants.FORMATTER_CONTINUATION_INDENTATION, Integer.toString(this.continuation_indentation)); - options.put(DefaultCodeFormatterConstants.FORMATTER_CONTINUATION_INDENTATION_FOR_ARRAY_INITIALIZER, Integer.toString(this.continuation_indentation_for_array_initializer)); + options.put(DefaultCodeFormatterConstants.FORMATTER_CONTINUATION_INDENTATION_FOR_INITIALIZER_LIST, Integer.toString(this.continuation_indentation_for_initializer_list)); // options.put(DefaultCodeFormatterConstants.FORMATTER_BLANK_LINES_AFTER_IMPORTS, Integer.toString(this.blank_lines_after_includes)); // options.put(DefaultCodeFormatterConstants.FORMATTER_BLANK_LINES_BEFORE_FIELD, Integer.toString(this.blank_lines_before_field)); // options.put(DefaultCodeFormatterConstants.FORMATTER_BLANK_LINES_BEFORE_FIRST_CLASS_BODY_DECLARATION, Integer.toString(this.blank_lines_before_first_class_body_declaration)); @@ -306,7 +297,6 @@ public class DefaultCodeFormatterOptions { // options.put(DefaultCodeFormatterConstants.FORMATTER_BLANK_LINES_AT_BEGINNING_OF_METHOD_BODY, Integer.toString(this.blank_lines_at_beginning_of_method_body)); options.put(DefaultCodeFormatterConstants.FORMATTER_INDENT_STATEMENTS_COMPARE_TO_BLOCK, this.indent_statements_compare_to_block ? DefaultCodeFormatterConstants.TRUE : DefaultCodeFormatterConstants.FALSE); options.put(DefaultCodeFormatterConstants.FORMATTER_INDENT_STATEMENTS_COMPARE_TO_BODY, this.indent_statements_compare_to_body ? DefaultCodeFormatterConstants.TRUE : DefaultCodeFormatterConstants.FALSE); -// options.put(DefaultCodeFormatterConstants.FORMATTER_INDENT_BODY_DECLARATIONS_COMPARE_TO_ENUM_DECLARATION_HEADER, this.indent_body_declarations_compare_to_enum_declaration_header ? DefaultCodeFormatterConstants.TRUE : DefaultCodeFormatterConstants.FALSE); options.put(DefaultCodeFormatterConstants.FORMATTER_INDENT_BODY_DECLARATIONS_COMPARE_TO_ACCESS_SPECIFIER, this.indent_body_declarations_compare_to_access_specifier ? DefaultCodeFormatterConstants.TRUE : DefaultCodeFormatterConstants.FALSE); options.put(DefaultCodeFormatterConstants.FORMATTER_INDENT_ACCESS_SPECIFIER_COMPARE_TO_TYPE_HEADER, this.indent_access_specifier_compare_to_type_header ? DefaultCodeFormatterConstants.TRUE : DefaultCodeFormatterConstants.FALSE); options.put(DefaultCodeFormatterConstants.FORMATTER_INDENT_BODY_DECLARATIONS_COMPARE_TO_NAMESPACE_HEADER, this.indent_body_declarations_compare_to_namespace_header ? DefaultCodeFormatterConstants.TRUE : DefaultCodeFormatterConstants.FALSE); @@ -315,134 +305,124 @@ public class DefaultCodeFormatterOptions { options.put(DefaultCodeFormatterConstants.FORMATTER_INDENT_SWITCHSTATEMENTS_COMPARE_TO_CASES, this.indent_switchstatements_compare_to_cases ? DefaultCodeFormatterConstants.TRUE : DefaultCodeFormatterConstants.FALSE); options.put(DefaultCodeFormatterConstants.FORMATTER_INDENT_SWITCHSTATEMENTS_COMPARE_TO_SWITCH, this.indent_switchstatements_compare_to_switch ? DefaultCodeFormatterConstants.TRUE : DefaultCodeFormatterConstants.FALSE); options.put(DefaultCodeFormatterConstants.FORMATTER_INDENTATION_SIZE, Integer.toString(this.indentation_size)); - options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_AFTER_OPENING_BRACE_IN_ARRAY_INITIALIZER, this.insert_new_line_after_opening_brace_in_array_initializer? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); + options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_AFTER_OPENING_BRACE_IN_INITIALIZER_LIST, this.insert_new_line_after_opening_brace_in_initializer_list? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_AT_END_OF_FILE_IF_MISSING, this.insert_new_line_at_end_of_file_if_missing ? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); // options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, this.insert_new_line_before_catch_in_try_statement? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); - options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CLOSING_BRACE_IN_ARRAY_INITIALIZER, this.insert_new_line_before_closing_brace_in_array_initializer? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); + options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CLOSING_BRACE_IN_INITIALIZER_LIST, this.insert_new_line_before_closing_brace_in_initializer_list? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, this.insert_new_line_before_else_in_if_statement? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); // options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, this.insert_new_line_before_finally_in_try_statement? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, this.insert_new_line_before_while_in_do_statement? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_IN_EMPTY_BLOCK, this.insert_new_line_in_empty_block? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); -// options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_IN_EMPTY_ENUM_DECLARATION, this.insert_new_line_in_empty_enum_declaration? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); // options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_IN_EMPTY_METHOD_BODY, this.insert_new_line_in_empty_method_body? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); // options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_IN_EMPTY_TYPE_DECLARATION, this.insert_new_line_in_empty_type_declaration? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); -// options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_ASSIGNMENT_OPERATOR, this.insert_space_after_assignment_operator? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); -// options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_BINARY_OPERATOR, this.insert_space_after_binary_operator? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); -// options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_CLOSING_ANGLE_BRACKET_IN_TYPE_ARGUMENTS, this.insert_space_after_closing_angle_bracket_in_type_arguments ? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); -// options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_CLOSING_ANGLE_BRACKET_IN_TYPE_PARAMETERS, this.insert_space_after_closing_angle_bracket_in_type_parameters ? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); -// options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_CLOSING_PAREN_IN_CAST, this.insert_space_after_closing_paren_in_cast? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); + options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_ASSIGNMENT_OPERATOR, this.insert_space_after_assignment_operator? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); + options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_BINARY_OPERATOR, this.insert_space_after_binary_operator? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); + options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_CLOSING_ANGLE_BRACKET_IN_TEMPLATE_ARGUMENTS, this.insert_space_after_closing_angle_bracket_in_template_arguments ? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); + options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_CLOSING_ANGLE_BRACKET_IN_TEMPLATE_PARAMETERS, this.insert_space_after_closing_angle_bracket_in_template_parameters ? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); + options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_CLOSING_PAREN_IN_CAST, this.insert_space_after_closing_paren_in_cast? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_CLOSING_BRACE_IN_BLOCK, this.insert_space_after_closing_brace_in_block? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); + options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COLON_IN_BASE_CLAUSE, this.insert_space_after_colon_in_base_clause ? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COLON_IN_CASE, this.insert_space_after_colon_in_case ? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COLON_IN_CONDITIONAL, this.insert_space_after_colon_in_conditional ? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); -// options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COLON_IN_FOR, this.insert_space_after_colon_in_for ? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); -// options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COLON_IN_LABELED_STATEMENT, this.insert_space_after_colon_in_labeled_statement? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); + options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COLON_IN_LABELED_STATEMENT, this.insert_space_after_colon_in_labeled_statement? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); // options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_ALLOCATION_EXPRESSION, this.insert_space_after_comma_in_allocation_expression? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); - options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_ARRAY_INITIALIZER, this.insert_space_after_comma_in_array_initializer? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); -// options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_ENUM_DECLARATIONS, this.insert_space_after_comma_in_enum_declarations ? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); + options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_INITIALIZER_LIST, this.insert_space_after_comma_in_initializer_list? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); + options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_ENUM_DECLARATIONS, this.insert_space_after_comma_in_enum_declarations ? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); +// options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_FOR_INCREMENTS, this.insert_space_after_comma_in_for_increments? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); +// options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_FOR_INITS, this.insert_space_after_comma_in_for_inits? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_METHOD_INVOCATION_ARGUMENTS, this.insert_space_after_comma_in_method_invocation_arguments? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_METHOD_DECLARATION_PARAMETERS, this.insert_space_after_comma_in_method_declaration_parameters? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); // options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_METHOD_DECLARATION_THROWS, this.insert_space_after_comma_in_method_declaration_throws? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); -// options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_MULTIPLE_FIELD_DECLARATIONS, this.insert_space_after_comma_in_multiple_field_declarations? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); -// options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_MULTIPLE_LOCAL_DECLARATIONS, this.insert_space_after_comma_in_multiple_local_declarations? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); -// options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_PARAMETERIZED_TYPE_REFERENCE, this.insert_space_after_comma_in_parameterized_type_reference? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); -// options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_BASE_TYPES, this.insert_space_after_comma_in_base_types? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); -// options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_TYPE_ARGUMENTS, this.insert_space_after_comma_in_type_arguments ? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); -// options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_TYPE_PARAMETERS, this.insert_space_after_comma_in_type_parameters ? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); -// options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_BRACKET_IN_ARRAY_ALLOCATION_EXPRESSION, this.insert_space_after_opening_bracket_in_array_allocation_expression? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); + options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_DECLARATOR_LIST, this.insert_space_after_comma_in_declarator_list? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); + options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_EXPRESSION_LIST, this.insert_space_after_comma_in_expression_list? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); + options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_BASE_TYPES, this.insert_space_after_comma_in_base_types? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); + options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_TEMPLATE_ARGUMENTS, this.insert_space_after_comma_in_template_arguments ? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); + options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_TEMPLATE_PARAMETERS, this.insert_space_after_comma_in_template_parameters ? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); // options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_ELLIPSIS, this.insert_space_after_ellipsis ? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); -// options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_ANGLE_BRACKET_IN_PARAMETERIZED_TYPE_REFERENCE, this.insert_space_after_opening_angle_bracket_in_parameterized_type_reference? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); -// options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_ANGLE_BRACKET_IN_TYPE_ARGUMENTS, this.insert_space_after_opening_angle_bracket_in_type_arguments? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); -// options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_ANGLE_BRACKET_IN_TYPE_PARAMETERS, this.insert_space_after_opening_angle_bracket_in_type_parameters? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); -// options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_BRACKET_IN_ARRAY_REFERENCE, this.insert_space_after_opening_bracket_in_array_reference? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); - options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_BRACE_IN_ARRAY_INITIALIZER, this.insert_space_after_opening_brace_in_array_initializer? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); -// options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_CAST, this.insert_space_after_opening_paren_in_cast? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); -// options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_CATCH, this.insert_space_after_opening_paren_in_catch? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); + options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_ANGLE_BRACKET_IN_TEMPLATE_ARGUMENTS, this.insert_space_after_opening_angle_bracket_in_template_arguments? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); + options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_ANGLE_BRACKET_IN_TEMPLATE_PARAMETERS, this.insert_space_after_opening_angle_bracket_in_template_parameters? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); + options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_BRACKET, this.insert_space_after_opening_bracket? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); + options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_BRACE_IN_INITIALIZER_LIST, this.insert_space_after_opening_brace_in_initializer_list? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); + options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_CAST, this.insert_space_after_opening_paren_in_cast? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); + options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_CATCH, this.insert_space_after_opening_paren_in_catch? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_FOR, this.insert_space_after_opening_paren_in_for? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_IF, this.insert_space_after_opening_paren_in_if? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_METHOD_DECLARATION, this.insert_space_after_opening_paren_in_method_declaration? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_METHOD_INVOCATION, this.insert_space_after_opening_paren_in_method_invocation? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); -// options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_PARENTHESIZED_EXPRESSION, this.insert_space_after_opening_paren_in_parenthesized_expression? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); + options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_PARENTHESIZED_EXPRESSION, this.insert_space_after_opening_paren_in_parenthesized_expression? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_SWITCH, this.insert_space_after_opening_paren_in_switch? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_WHILE, this.insert_space_after_opening_paren_in_while? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); -// options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_POSTFIX_OPERATOR, this.insert_space_after_postfix_operator? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); -// options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_PREFIX_OPERATOR, this.insert_space_after_prefix_operator? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); + options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_POSTFIX_OPERATOR, this.insert_space_after_postfix_operator? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); + options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_PREFIX_OPERATOR, this.insert_space_after_prefix_operator? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_QUESTION_IN_CONDITIONAL, this.insert_space_after_question_in_conditional? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_SEMICOLON_IN_FOR, this.insert_space_after_semicolon_in_for? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); -// options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_UNARY_OPERATOR, this.insert_space_after_unary_operator? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); -// options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_AND_IN_TYPE_PARAMETER, this.insert_space_before_and_in_type_parameter ? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); -// options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_ASSIGNMENT_OPERATOR, this.insert_space_before_assignment_operator? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); -// options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_BINARY_OPERATOR, this.insert_space_before_binary_operator? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); -// options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_ANGLE_BRACKET_IN_PARAMETERIZED_TYPE_REFERENCE, this.insert_space_before_closing_angle_bracket_in_parameterized_type_reference? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); -// options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_ANGLE_BRACKET_IN_TYPE_ARGUMENTS, this.insert_space_before_closing_angle_bracket_in_type_arguments? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); -// options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_ANGLE_BRACKET_IN_TYPE_PARAMETERS, this.insert_space_before_closing_angle_bracket_in_type_parameters? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); - options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_BRACE_IN_ARRAY_INITIALIZER, this.insert_space_before_closing_brace_in_array_initializer? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); -// options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_BRACKET_IN_ARRAY_ALLOCATION_EXPRESSION, this.insert_space_before_closing_bracket_in_array_allocation_expression? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); -// options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_BRACKET_IN_ARRAY_REFERENCE, this.insert_space_before_closing_bracket_in_array_reference? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); -// options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_CAST, this.insert_space_before_closing_paren_in_cast? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); -// options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_CATCH, this.insert_space_before_closing_paren_in_catch? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); + options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_UNARY_OPERATOR, this.insert_space_after_unary_operator? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); + options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_ASSIGNMENT_OPERATOR, this.insert_space_before_assignment_operator? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); + options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_BINARY_OPERATOR, this.insert_space_before_binary_operator? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); + options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_ANGLE_BRACKET_IN_TEMPLATE_ARGUMENTS, this.insert_space_before_closing_angle_bracket_in_template_arguments? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); + options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_ANGLE_BRACKET_IN_TEMPLATE_PARAMETERS, this.insert_space_before_closing_angle_bracket_in_template_parameters? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); + options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_BRACE_IN_INITIALIZER_LIST, this.insert_space_before_closing_brace_in_initializer_list? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); + options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_BRACKET, this.insert_space_before_closing_bracket? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); + options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_CAST, this.insert_space_before_closing_paren_in_cast? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); + options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_CATCH, this.insert_space_before_closing_paren_in_catch? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_FOR, this.insert_space_before_closing_paren_in_for? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_IF, this.insert_space_before_closing_paren_in_if? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_METHOD_DECLARATION, this.insert_space_before_closing_paren_in_method_declaration? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_METHOD_INVOCATION, this.insert_space_before_closing_paren_in_method_invocation? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); -// options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_PARENTHESIZED_EXPRESSION, this.insert_space_before_closing_paren_in_parenthesized_expression? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); + options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_PARENTHESIZED_EXPRESSION, this.insert_space_before_closing_paren_in_parenthesized_expression? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_SWITCH, this.insert_space_before_closing_paren_in_switch? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_WHILE, this.insert_space_before_closing_paren_in_while? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); + options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COLON_IN_BASE_CLAUSE, this.insert_space_before_colon_in_base_clause? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COLON_IN_CASE, this.insert_space_before_colon_in_case? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COLON_IN_CONDITIONAL, this.insert_space_before_colon_in_conditional? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COLON_IN_DEFAULT, this.insert_space_before_colon_in_default? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); -// options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COLON_IN_FOR, this.insert_space_before_colon_in_for ? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); -// options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COLON_IN_LABELED_STATEMENT, this.insert_space_before_colon_in_labeled_statement? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); + options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COLON_IN_LABELED_STATEMENT, this.insert_space_before_colon_in_labeled_statement? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); // options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_ALLOCATION_EXPRESSION, this.insert_space_before_comma_in_allocation_expression? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); - options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_ARRAY_INITIALIZER, this.insert_space_before_comma_in_array_initializer? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); -// options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_ENUM_DECLARATIONS, this.insert_space_before_comma_in_enum_declarations? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); + options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_INITIALIZER_LIST, this.insert_space_before_comma_in_initializer_list? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); + options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_ENUM_DECLARATIONS, this.insert_space_before_comma_in_enum_declarations? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); +// options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_FOR_INCREMENTS, this.insert_space_before_comma_in_for_increments? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); // options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_FOR_INITS, this.insert_space_before_comma_in_for_inits? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_METHOD_INVOCATION_ARGUMENTS, this.insert_space_before_comma_in_method_invocation_arguments? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_METHOD_DECLARATION_PARAMETERS, this.insert_space_before_comma_in_method_declaration_parameters? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); // options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_METHOD_DECLARATION_THROWS, this.insert_space_before_comma_in_method_declaration_throws? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); -// options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_MULTIPLE_FIELD_DECLARATIONS, this.insert_space_before_comma_in_multiple_field_declarations? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); -// options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_MULTIPLE_LOCAL_DECLARATIONS, this.insert_space_before_comma_in_multiple_local_declarations? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); -// options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_BASE_TYPES, this.insert_space_before_comma_in_base_types? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); -// options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_TYPE_ARGUMENTS, this.insert_space_before_comma_in_type_arguments ? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); -// options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_TYPE_PARAMETERS, this.insert_space_before_comma_in_type_parameters? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); -// options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_PARAMETERIZED_TYPE_REFERENCE, this.insert_space_before_comma_in_parameterized_type_reference? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); + options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_DECLARATOR_LIST, this.insert_space_before_comma_in_declarator_list? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); + options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_EXPRESSION_LIST, this.insert_space_before_comma_in_expression_list? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); + options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_BASE_TYPES, this.insert_space_before_comma_in_base_types? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); + options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_TEMPLATE_ARGUMENTS, this.insert_space_before_comma_in_template_arguments ? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); + options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_TEMPLATE_PARAMETERS, this.insert_space_before_comma_in_template_parameters? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); // options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_ELLIPSIS, this.insert_space_before_ellipsis ? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); -// options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_ANGLE_BRACKET_IN_PARAMETERIZED_TYPE_REFERENCE, this.insert_space_before_opening_angle_bracket_in_parameterized_type_reference? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); -// options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_ANGLE_BRACKET_IN_TYPE_ARGUMENTS, this.insert_space_before_opening_angle_bracket_in_type_arguments? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); -// options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_ANGLE_BRACKET_IN_TYPE_PARAMETERS, this.insert_space_before_opening_angle_bracket_in_type_parameters? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); - options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACE_IN_ARRAY_INITIALIZER, this.insert_space_before_opening_brace_in_array_initializer? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); + options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_ANGLE_BRACKET_IN_TEMPLATE_ARGUMENTS, this.insert_space_before_opening_angle_bracket_in_template_arguments? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); + options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_ANGLE_BRACKET_IN_TEMPLATE_PARAMETERS, this.insert_space_before_opening_angle_bracket_in_template_parameters? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); + options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACE_IN_INITIALIZER_LIST, this.insert_space_before_opening_brace_in_initializer_list? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACE_IN_BLOCK, this.insert_space_before_opening_brace_in_block? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); -// options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACE_IN_ENUM_DECLARATION, this.insert_space_before_opening_brace_in_enum_declaration? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACE_IN_METHOD_DECLARATION, this.insert_space_before_opening_brace_in_method_declaration? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACE_IN_TYPE_DECLARATION, this.insert_space_before_opening_brace_in_type_declaration? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACE_IN_NAMESPACE_DECLARATION, this.insert_space_before_opening_brace_in_namespace_declaration? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); -// options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACKET_IN_ARRAY_ALLOCATION_EXPRESSION, this.insert_space_before_opening_bracket_in_array_allocation_expression ? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); -// options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACKET_IN_ARRAY_REFERENCE, this.insert_space_before_opening_bracket_in_array_reference? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); -// options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACKET_IN_ARRAY_TYPE_REFERENCE, this.insert_space_before_opening_bracket_in_array_type_reference? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); -// options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_CATCH, this.insert_space_before_opening_paren_in_catch? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); + options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACKET, this.insert_space_before_opening_bracket? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); + options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_CATCH, this.insert_space_before_opening_paren_in_catch? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_FOR, this.insert_space_before_opening_paren_in_for? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_IF, this.insert_space_before_opening_paren_in_if? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_METHOD_INVOCATION, this.insert_space_before_opening_paren_in_method_invocation? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_METHOD_DECLARATION, this.insert_space_before_opening_paren_in_method_declaration? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_SWITCH, this.insert_space_before_opening_paren_in_switch? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACE_IN_SWITCH, this.insert_space_before_opening_brace_in_switch? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); -// options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_PARENTHESIZED_EXPRESSION, this.insert_space_before_opening_paren_in_parenthesized_expression? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); + options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_PARENTHESIZED_EXPRESSION, this.insert_space_before_opening_paren_in_parenthesized_expression? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_WHILE, this.insert_space_before_opening_paren_in_while? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); // options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_PARENTHESIZED_EXPRESSION_IN_RETURN, this.insert_space_before_parenthesized_expression_in_return ? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); -// options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_POSTFIX_OPERATOR, this.insert_space_before_postfix_operator? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); -// options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_PREFIX_OPERATOR, this.insert_space_before_prefix_operator? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); + options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_POSTFIX_OPERATOR, this.insert_space_before_postfix_operator? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); + options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_PREFIX_OPERATOR, this.insert_space_before_prefix_operator? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_QUESTION_IN_CONDITIONAL, this.insert_space_before_question_in_conditional? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_SEMICOLON, this.insert_space_before_semicolon? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_SEMICOLON_IN_FOR, this.insert_space_before_semicolon_in_for? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); -// options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_UNARY_OPERATOR, this.insert_space_before_unary_operator? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); -// options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BETWEEN_BRACKETS_IN_ARRAY_TYPE_REFERENCE, this.insert_space_between_brackets_in_array_type_reference? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); - options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BETWEEN_EMPTY_BRACES_IN_ARRAY_INITIALIZER, this.insert_space_between_empty_braces_in_array_initializer? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); -// options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BETWEEN_EMPTY_BRACKETS_IN_ARRAY_ALLOCATION_EXPRESSION, this.insert_space_between_empty_brackets_in_array_allocation_expression? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); + options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_UNARY_OPERATOR, this.insert_space_before_unary_operator? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); + options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BETWEEN_EMPTY_BRACES_IN_INITIALIZER_LIST, this.insert_space_between_empty_braces_in_initializer_list? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); + options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BETWEEN_EMPTY_BRACKETS, this.insert_space_between_empty_brackets? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BETWEEN_EMPTY_PARENS_IN_METHOD_DECLARATION, this.insert_space_between_empty_parens_in_method_declaration? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); -// options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BETWEEN_EMPTY_PARENS_IN_METHOD_INVOCATION, this.insert_space_between_empty_parens_in_method_invocation? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); + options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BETWEEN_EMPTY_PARENS_IN_METHOD_INVOCATION, this.insert_space_between_empty_parens_in_method_invocation? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); options.put(DefaultCodeFormatterConstants.FORMATTER_COMPACT_ELSE_IF, this.compact_else_if ? DefaultCodeFormatterConstants.TRUE : DefaultCodeFormatterConstants.FALSE); options.put(DefaultCodeFormatterConstants.FORMATTER_KEEP_GUARDIAN_CLAUSE_ON_ONE_LINE, this.keep_guardian_clause_on_one_line ? DefaultCodeFormatterConstants.TRUE : DefaultCodeFormatterConstants.FALSE); options.put(DefaultCodeFormatterConstants.FORMATTER_KEEP_ELSE_STATEMENT_ON_SAME_LINE, this.keep_else_statement_on_same_line ? DefaultCodeFormatterConstants.TRUE : DefaultCodeFormatterConstants.FALSE); - options.put(DefaultCodeFormatterConstants.FORMATTER_KEEP_EMPTY_ARRAY_INITIALIZER_ON_ONE_LINE, this.keep_empty_array_initializer_on_one_line ? DefaultCodeFormatterConstants.TRUE : DefaultCodeFormatterConstants.FALSE); + options.put(DefaultCodeFormatterConstants.FORMATTER_KEEP_EMPTY_INITIALIZER_LIST_ON_ONE_LINE, this.keep_empty_initializer_list_on_one_line ? DefaultCodeFormatterConstants.TRUE : DefaultCodeFormatterConstants.FALSE); options.put(DefaultCodeFormatterConstants.FORMATTER_KEEP_SIMPLE_IF_ON_ONE_LINE, this.keep_simple_if_on_one_line ? DefaultCodeFormatterConstants.TRUE : DefaultCodeFormatterConstants.FALSE); options.put(DefaultCodeFormatterConstants.FORMATTER_KEEP_THEN_STATEMENT_ON_SAME_LINE, this.keep_then_statement_on_same_line ? DefaultCodeFormatterConstants.TRUE : DefaultCodeFormatterConstants.FALSE); options.put(DefaultCodeFormatterConstants.FORMATTER_NUMBER_OF_EMPTY_LINES_TO_PRESERVE, Integer.toString(this.number_of_empty_lines_to_preserve)); @@ -525,26 +505,46 @@ public class DefaultCodeFormatterOptions { this.alignment_for_conditional_expression = Alignment.M_ONE_PER_LINE_SPLIT; } } - final Object alignmentForExpressionsInArrayInitializerOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_EXPRESSIONS_IN_ARRAY_INITIALIZER); - if (alignmentForExpressionsInArrayInitializerOption != null) { + final Object alignmentForExpressionsInInitializerListOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_EXPRESSIONS_IN_INITIALIZER_LIST); + if (alignmentForExpressionsInInitializerListOption != null) { try { - this.alignment_for_expressions_in_array_initializer = Integer.parseInt((String) alignmentForExpressionsInArrayInitializerOption); + this.alignment_for_expressions_in_initializer_list = Integer.parseInt((String) alignmentForExpressionsInInitializerListOption); } catch (NumberFormatException e) { - this.alignment_for_expressions_in_array_initializer = Alignment.M_COMPACT_SPLIT; + this.alignment_for_expressions_in_initializer_list = Alignment.M_COMPACT_SPLIT; } catch (ClassCastException e) { - this.alignment_for_expressions_in_array_initializer = Alignment.M_COMPACT_SPLIT; + this.alignment_for_expressions_in_initializer_list = Alignment.M_COMPACT_SPLIT; + } + } + final Object alignmentForDeclaratorListOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_DECLARATOR_LIST); + if (alignmentForDeclaratorListOption != null) { + try { + this.alignment_for_declarator_list = Integer.parseInt((String) alignmentForDeclaratorListOption); + } catch (NumberFormatException e) { + this.alignment_for_declarator_list = Alignment.M_COMPACT_SPLIT; + } catch (ClassCastException e) { + this.alignment_for_declarator_list = Alignment.M_COMPACT_SPLIT; + } + } + final Object alignmentForEnumeratorListOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_ENUMERATOR_LIST); + if (alignmentForEnumeratorListOption != null) { + try { + this.alignment_for_enumerator_list = Integer.parseInt((String) alignmentForEnumeratorListOption); + } catch (NumberFormatException e) { + this.alignment_for_enumerator_list = Alignment.M_ONE_PER_LINE_SPLIT; + } catch (ClassCastException e) { + this.alignment_for_enumerator_list = Alignment.M_ONE_PER_LINE_SPLIT; + } + } + final Object alignmentForExpressionListOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_EXPRESSION_LIST); + if (alignmentForExpressionListOption != null) { + try { + this.alignment_for_expression_list = Integer.parseInt((String) alignmentForExpressionListOption); + } catch (NumberFormatException e) { + this.alignment_for_expression_list = Alignment.M_COMPACT_SPLIT; + } catch (ClassCastException e) { + this.alignment_for_expression_list = Alignment.M_COMPACT_SPLIT; } } -// final Object alignmentForMultipleFieldsOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_MULTIPLE_FIELDS); -// if (alignmentForMultipleFieldsOption != null) { -// try { -// this.alignment_for_multiple_fields = Integer.parseInt((String) alignmentForMultipleFieldsOption); -// } catch (NumberFormatException e) { -// this.alignment_for_multiple_fields = Alignment.M_COMPACT_SPLIT; -// } catch (ClassCastException e) { -// this.alignment_for_multiple_fields = Alignment.M_COMPACT_SPLIT; -// } -// } final Object alignmentForParametersInMethodDeclarationOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_PARAMETERS_IN_METHOD_DECLARATION); if (alignmentForParametersInMethodDeclarationOption != null) { try { @@ -555,16 +555,6 @@ public class DefaultCodeFormatterOptions { this.alignment_for_parameters_in_method_declaration = Alignment.M_COMPACT_SPLIT; } } -// final Object alignmentForSelectorInMethodInvocationOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_SELECTOR_IN_METHOD_INVOCATION); -// if (alignmentForSelectorInMethodInvocationOption != null) { -// try { -// this.alignment_for_selector_in_method_invocation = Integer.parseInt((String) alignmentForSelectorInMethodInvocationOption); -// } catch (NumberFormatException e) { -// this.alignment_for_selector_in_method_invocation = Alignment.M_COMPACT_SPLIT; -// } catch(ClassCastException e) { -// this.alignment_for_selector_in_method_invocation = Alignment.M_COMPACT_SPLIT; -// } -// } // final Object alignmentForSuperclassInTypeDeclarationOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_SUPERCLASS_IN_TYPE_DECLARATION); // if (alignmentForSuperclassInTypeDeclarationOption != null) { // try { @@ -589,12 +579,12 @@ public class DefaultCodeFormatterOptions { // if (alignTypeMembersOnColumnsOption != null) { // this.align_type_members_on_columns = DefaultCodeFormatterConstants.TRUE.equals(alignTypeMembersOnColumnsOption); // } - final Object bracePositionForArrayInitializerOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ARRAY_INITIALIZER); - if (bracePositionForArrayInitializerOption != null) { + final Object bracePositionForInitializerListOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_INITIALIZER_LIST); + if (bracePositionForInitializerListOption != null) { try { - this.brace_position_for_array_initializer = (String) bracePositionForArrayInitializerOption; + this.brace_position_for_initializer_list = (String) bracePositionForInitializerListOption; } catch(ClassCastException e) { - this.brace_position_for_array_initializer = DefaultCodeFormatterConstants.END_OF_LINE; + this.brace_position_for_initializer_list = DefaultCodeFormatterConstants.END_OF_LINE; } } final Object bracePositionForBlockOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK); @@ -663,14 +653,14 @@ public class DefaultCodeFormatterOptions { this.continuation_indentation = 2; } } - final Object continuationIndentationForArrayInitializerOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_CONTINUATION_INDENTATION_FOR_ARRAY_INITIALIZER); - if (continuationIndentationForArrayInitializerOption != null) { + final Object continuationIndentationForInitializerListOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_CONTINUATION_INDENTATION_FOR_INITIALIZER_LIST); + if (continuationIndentationForInitializerListOption != null) { try { - this.continuation_indentation_for_array_initializer = Integer.parseInt((String) continuationIndentationForArrayInitializerOption); + this.continuation_indentation_for_initializer_list = Integer.parseInt((String) continuationIndentationForInitializerListOption); } catch (NumberFormatException e) { - this.continuation_indentation_for_array_initializer = 2; + this.continuation_indentation_for_initializer_list = 2; } catch(ClassCastException e) { - this.continuation_indentation_for_array_initializer = 2; + this.continuation_indentation_for_initializer_list = 2; } } // final Object blankLinesAfterIncludesOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_BLANK_LINES_AFTER_IMPORTS); @@ -839,9 +829,9 @@ public class DefaultCodeFormatterOptions { this.indentation_size = 4; } } - final Object insertNewLineAfterOpeningBraceInArrayInitializerOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_AFTER_OPENING_BRACE_IN_ARRAY_INITIALIZER); - if (insertNewLineAfterOpeningBraceInArrayInitializerOption != null) { - this.insert_new_line_after_opening_brace_in_array_initializer = CCorePlugin.INSERT.equals(insertNewLineAfterOpeningBraceInArrayInitializerOption); + final Object insertNewLineAfterOpeningBraceInInitializerListOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_AFTER_OPENING_BRACE_IN_INITIALIZER_LIST); + if (insertNewLineAfterOpeningBraceInInitializerListOption != null) { + this.insert_new_line_after_opening_brace_in_initializer_list = CCorePlugin.INSERT.equals(insertNewLineAfterOpeningBraceInInitializerListOption); } final Object insertNewLineAtEndOfFileIfMissingOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_AT_END_OF_FILE_IF_MISSING); if (insertNewLineAtEndOfFileIfMissingOption != null) { @@ -851,9 +841,9 @@ public class DefaultCodeFormatterOptions { // if (insertNewLineBeforeCatchInTryStatementOption != null) { // this.insert_new_line_before_catch_in_try_statement = CCorePlugin.INSERT.equals(insertNewLineBeforeCatchInTryStatementOption); // } - final Object insertNewLineBeforeClosingBraceInArrayInitializerOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CLOSING_BRACE_IN_ARRAY_INITIALIZER); - if (insertNewLineBeforeClosingBraceInArrayInitializerOption != null) { - this.insert_new_line_before_closing_brace_in_array_initializer = CCorePlugin.INSERT.equals(insertNewLineBeforeClosingBraceInArrayInitializerOption); + final Object insertNewLineBeforeClosingBraceInInitializerListOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CLOSING_BRACE_IN_INITIALIZER_LIST); + if (insertNewLineBeforeClosingBraceInInitializerListOption != null) { + this.insert_new_line_before_closing_brace_in_initializer_list = CCorePlugin.INSERT.equals(insertNewLineBeforeClosingBraceInInitializerListOption); } final Object insertNewLineBeforeElseInIfStatementOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT); if (insertNewLineBeforeElseInIfStatementOption != null) { @@ -871,10 +861,6 @@ public class DefaultCodeFormatterOptions { if (insertNewLineInEmptyBlockOption != null) { this.insert_new_line_in_empty_block = CCorePlugin.INSERT.equals(insertNewLineInEmptyBlockOption); } -// final Object insertNewLineInEmptyEnumDeclarationOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_IN_EMPTY_ENUM_DECLARATION); -// if (insertNewLineInEmptyEnumDeclarationOption != null) { -// this.insert_new_line_in_empty_enum_declaration = CCorePlugin.INSERT.equals(insertNewLineInEmptyEnumDeclarationOption); -// } // final Object insertNewLineInEmptyMethodBodyOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_IN_EMPTY_METHOD_BODY); // if (insertNewLineInEmptyMethodBodyOption != null) { // this.insert_new_line_in_empty_method_body = CCorePlugin.INSERT.equals(insertNewLineInEmptyMethodBodyOption); @@ -883,34 +869,34 @@ public class DefaultCodeFormatterOptions { // if (insertNewLineInEmptyTypeDeclarationOption != null) { // this.insert_new_line_in_empty_type_declaration = CCorePlugin.INSERT.equals(insertNewLineInEmptyTypeDeclarationOption); // } -// final Object insertSpaceAfterAndInWildcardOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_AND_IN_TYPE_PARAMETER); -// if (insertSpaceAfterAndInWildcardOption != null) { -// this.insert_space_after_and_in_type_parameter = CCorePlugin.INSERT.equals(insertSpaceAfterAndInWildcardOption); -// } -// final Object insertSpaceAfterAssignmentOperatorOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_ASSIGNMENT_OPERATOR); -// if (insertSpaceAfterAssignmentOperatorOption != null) { -// this.insert_space_after_assignment_operator = CCorePlugin.INSERT.equals(insertSpaceAfterAssignmentOperatorOption); -// } -// final Object insertSpaceAfterBinaryOperatorOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_BINARY_OPERATOR); -// if (insertSpaceAfterBinaryOperatorOption != null) { -// this.insert_space_after_binary_operator = CCorePlugin.INSERT.equals(insertSpaceAfterBinaryOperatorOption); -// } -// final Object insertSpaceAfterClosingAngleBracketInTypeArgumentsOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_CLOSING_ANGLE_BRACKET_IN_TYPE_ARGUMENTS); -// if (insertSpaceAfterClosingAngleBracketInTypeArgumentsOption != null) { -// this.insert_space_after_closing_angle_bracket_in_type_arguments = CCorePlugin.INSERT.equals(insertSpaceAfterClosingAngleBracketInTypeArgumentsOption); -// } -// final Object insertSpaceAfterClosingAngleBracketInTypeParametersOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_CLOSING_ANGLE_BRACKET_IN_TYPE_PARAMETERS); -// if (insertSpaceAfterClosingAngleBracketInTypeParametersOption != null) { -// this.insert_space_after_closing_angle_bracket_in_type_parameters = CCorePlugin.INSERT.equals(insertSpaceAfterClosingAngleBracketInTypeParametersOption); -// } -// final Object insertSpaceAfterClosingParenInCastOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_CLOSING_PAREN_IN_CAST); -// if (insertSpaceAfterClosingParenInCastOption != null) { -// this.insert_space_after_closing_paren_in_cast = CCorePlugin.INSERT.equals(insertSpaceAfterClosingParenInCastOption); -// } + final Object insertSpaceAfterAssignmentOperatorOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_ASSIGNMENT_OPERATOR); + if (insertSpaceAfterAssignmentOperatorOption != null) { + this.insert_space_after_assignment_operator = CCorePlugin.INSERT.equals(insertSpaceAfterAssignmentOperatorOption); + } + final Object insertSpaceAfterBinaryOperatorOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_BINARY_OPERATOR); + if (insertSpaceAfterBinaryOperatorOption != null) { + this.insert_space_after_binary_operator = CCorePlugin.INSERT.equals(insertSpaceAfterBinaryOperatorOption); + } + final Object insertSpaceAfterClosingAngleBracketInTemplateArgumentsOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_CLOSING_ANGLE_BRACKET_IN_TEMPLATE_ARGUMENTS); + if (insertSpaceAfterClosingAngleBracketInTemplateArgumentsOption != null) { + this.insert_space_after_closing_angle_bracket_in_template_arguments = CCorePlugin.INSERT.equals(insertSpaceAfterClosingAngleBracketInTemplateArgumentsOption); + } + final Object insertSpaceAfterClosingAngleBracketInTemplateParametersOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_CLOSING_ANGLE_BRACKET_IN_TEMPLATE_PARAMETERS); + if (insertSpaceAfterClosingAngleBracketInTemplateParametersOption != null) { + this.insert_space_after_closing_angle_bracket_in_template_parameters = CCorePlugin.INSERT.equals(insertSpaceAfterClosingAngleBracketInTemplateParametersOption); + } + final Object insertSpaceAfterClosingParenInCastOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_CLOSING_PAREN_IN_CAST); + if (insertSpaceAfterClosingParenInCastOption != null) { + this.insert_space_after_closing_paren_in_cast = CCorePlugin.INSERT.equals(insertSpaceAfterClosingParenInCastOption); + } final Object insertSpaceAfterClosingBraceInBlockOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_CLOSING_BRACE_IN_BLOCK); if (insertSpaceAfterClosingBraceInBlockOption != null) { this.insert_space_after_closing_brace_in_block = CCorePlugin.INSERT.equals(insertSpaceAfterClosingBraceInBlockOption); } + final Object insertSpaceAfterColonInBaseClauseOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COLON_IN_BASE_CLAUSE); + if (insertSpaceAfterColonInBaseClauseOption != null) { + this.insert_space_after_colon_in_base_clause = CCorePlugin.INSERT.equals(insertSpaceAfterColonInBaseClauseOption); + } final Object insertSpaceAfterColonInCaseOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COLON_IN_CASE); if (insertSpaceAfterColonInCaseOption != null) { this.insert_space_after_colon_in_case = CCorePlugin.INSERT.equals(insertSpaceAfterColonInCaseOption); @@ -919,25 +905,29 @@ public class DefaultCodeFormatterOptions { if (insertSpaceAfterColonInConditionalOption != null) { this.insert_space_after_colon_in_conditional = CCorePlugin.INSERT.equals(insertSpaceAfterColonInConditionalOption); } -// final Object insertSpaceAfterColonInForOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COLON_IN_FOR); -// if (insertSpaceAfterColonInForOption != null) { -// this.insert_space_after_colon_in_for = CCorePlugin.INSERT.equals(insertSpaceAfterColonInForOption); -// } -// final Object insertSpaceAfterColonInLabeledStatementOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COLON_IN_LABELED_STATEMENT); -// if (insertSpaceAfterColonInLabeledStatementOption != null) { -// this.insert_space_after_colon_in_labeled_statement = CCorePlugin.INSERT.equals(insertSpaceAfterColonInLabeledStatementOption); -// } + final Object insertSpaceAfterColonInLabeledStatementOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COLON_IN_LABELED_STATEMENT); + if (insertSpaceAfterColonInLabeledStatementOption != null) { + this.insert_space_after_colon_in_labeled_statement = CCorePlugin.INSERT.equals(insertSpaceAfterColonInLabeledStatementOption); + } // final Object insertSpaceAfterCommaInAllocationExpressionOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_ALLOCATION_EXPRESSION); // if (insertSpaceAfterCommaInAllocationExpressionOption != null) { // this.insert_space_after_comma_in_allocation_expression = CCorePlugin.INSERT.equals(insertSpaceAfterCommaInAllocationExpressionOption); // } - final Object insertSpaceAfterCommaInArrayInitializerOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_ARRAY_INITIALIZER); - if (insertSpaceAfterCommaInArrayInitializerOption != null) { - this.insert_space_after_comma_in_array_initializer = CCorePlugin.INSERT.equals(insertSpaceAfterCommaInArrayInitializerOption); + final Object insertSpaceAfterCommaInInitializerListOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_INITIALIZER_LIST); + if (insertSpaceAfterCommaInInitializerListOption != null) { + this.insert_space_after_comma_in_initializer_list = CCorePlugin.INSERT.equals(insertSpaceAfterCommaInInitializerListOption); } -// final Object insertSpaceAfterCommaInEnumDeclarationsOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_ENUM_DECLARATIONS); -// if (insertSpaceAfterCommaInEnumDeclarationsOption != null) { -// this.insert_space_after_comma_in_enum_declarations = CCorePlugin.INSERT.equals(insertSpaceAfterCommaInEnumDeclarationsOption); + final Object insertSpaceAfterCommaInEnumDeclarationsOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_ENUM_DECLARATIONS); + if (insertSpaceAfterCommaInEnumDeclarationsOption != null) { + this.insert_space_after_comma_in_enum_declarations = CCorePlugin.INSERT.equals(insertSpaceAfterCommaInEnumDeclarationsOption); + } +// final Object insertSpaceAfterCommaInForInitsOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_FOR_INITS); +// if (insertSpaceAfterCommaInForInitsOption != null) { +// this.insert_space_after_comma_in_for_inits = CCorePlugin.INSERT.equals(insertSpaceAfterCommaInForInitsOption); +// } +// final Object insertSpaceAfterCommaInForIncrementsOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_FOR_INCREMENTS); +// if (insertSpaceAfterCommaInForIncrementsOption != null) { +// this.insert_space_after_comma_in_for_increments = CCorePlugin.INSERT.equals(insertSpaceAfterCommaInForIncrementsOption); // } final Object insertSpaceAfterCommaInMethodInvocationArgumentsOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_METHOD_INVOCATION_ARGUMENTS); if (insertSpaceAfterCommaInMethodInvocationArgumentsOption != null) { @@ -951,30 +941,26 @@ public class DefaultCodeFormatterOptions { // if (insertSpaceAfterCommaInMethodDeclarationThrowsOption != null) { // this.insert_space_after_comma_in_method_declaration_throws = CCorePlugin.INSERT.equals(insertSpaceAfterCommaInMethodDeclarationThrowsOption); // } -// final Object insertSpaceAfterCommaInMultipleFieldDeclarationsOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_MULTIPLE_FIELD_DECLARATIONS); -// if (insertSpaceAfterCommaInMultipleFieldDeclarationsOption != null) { -// this.insert_space_after_comma_in_multiple_field_declarations = CCorePlugin.INSERT.equals(insertSpaceAfterCommaInMultipleFieldDeclarationsOption); -// } -// final Object insertSpaceAfterCommaInMultipleLocalDeclarationsOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_MULTIPLE_LOCAL_DECLARATIONS); -// if (insertSpaceAfterCommaInMultipleLocalDeclarationsOption != null) { -// this.insert_space_after_comma_in_multiple_local_declarations = CCorePlugin.INSERT.equals(insertSpaceAfterCommaInMultipleLocalDeclarationsOption); -// } -// final Object insertSpaceAfterCommaInParameterizedTypeReferenceOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_PARAMETERIZED_TYPE_REFERENCE); -// if (insertSpaceAfterCommaInParameterizedTypeReferenceOption != null) { -// this.insert_space_after_comma_in_parameterized_type_reference = CCorePlugin.INSERT.equals(insertSpaceAfterCommaInParameterizedTypeReferenceOption); -// } -// final Object insertSpaceAfterCommaInBaseTypesOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_BASE_TYPES); -// if (insertSpaceAfterCommaInBaseTypesOption != null) { -// this.insert_space_after_comma_in_base_types = CCorePlugin.INSERT.equals(insertSpaceAfterCommaInBaseTypesOption); -// } -// final Object insertSpaceAfterCommaInTypeArgumentsOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_TYPE_ARGUMENTS); -// if (insertSpaceAfterCommaInTypeArgumentsOption != null) { -// this.insert_space_after_comma_in_type_arguments = CCorePlugin.INSERT.equals(insertSpaceAfterCommaInTypeArgumentsOption); -// } -// final Object insertSpaceAfterCommaInTypeParametersOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_TYPE_PARAMETERS); -// if (insertSpaceAfterCommaInTypeParametersOption != null) { -// this.insert_space_after_comma_in_type_parameters = CCorePlugin.INSERT.equals(insertSpaceAfterCommaInTypeParametersOption); -// } + final Object insertSpaceAfterCommaInMultipleFieldDeclarationsOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_DECLARATOR_LIST); + if (insertSpaceAfterCommaInMultipleFieldDeclarationsOption != null) { + this.insert_space_after_comma_in_declarator_list = CCorePlugin.INSERT.equals(insertSpaceAfterCommaInMultipleFieldDeclarationsOption); + } + final Object insertSpaceAfterCommaInExpressionListOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_EXPRESSION_LIST); + if (insertSpaceAfterCommaInExpressionListOption != null) { + this.insert_space_after_comma_in_expression_list = CCorePlugin.INSERT.equals(insertSpaceAfterCommaInExpressionListOption); + } + final Object insertSpaceAfterCommaInBaseTypesOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_BASE_TYPES); + if (insertSpaceAfterCommaInBaseTypesOption != null) { + this.insert_space_after_comma_in_base_types = CCorePlugin.INSERT.equals(insertSpaceAfterCommaInBaseTypesOption); + } + final Object insertSpaceAfterCommaInTemplateArgumentsOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_TEMPLATE_ARGUMENTS); + if (insertSpaceAfterCommaInTemplateArgumentsOption != null) { + this.insert_space_after_comma_in_template_arguments = CCorePlugin.INSERT.equals(insertSpaceAfterCommaInTemplateArgumentsOption); + } + final Object insertSpaceAfterCommaInTemplateParametersOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_TEMPLATE_PARAMETERS); + if (insertSpaceAfterCommaInTemplateParametersOption != null) { + this.insert_space_after_comma_in_template_parameters = CCorePlugin.INSERT.equals(insertSpaceAfterCommaInTemplateParametersOption); + } // final Object insertSpaceAfterEllipsisOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_ELLIPSIS); // if (insertSpaceAfterEllipsisOption != null) { // this.insert_space_after_ellipsis = CCorePlugin.INSERT.equals(insertSpaceAfterEllipsisOption); @@ -983,34 +969,30 @@ public class DefaultCodeFormatterOptions { // if (insertSpaceAfterOpeningAngleBracketInParameterizedTypeReferenceOption != null) { // this.insert_space_after_opening_angle_bracket_in_parameterized_type_reference = CCorePlugin.INSERT.equals(insertSpaceAfterOpeningAngleBracketInParameterizedTypeReferenceOption); // } -// final Object insertSpaceAfterOpeningAngleBracketInTypeArgumentsOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_ANGLE_BRACKET_IN_TYPE_ARGUMENTS); -// if (insertSpaceAfterOpeningAngleBracketInTypeArgumentsOption != null) { -// this.insert_space_after_opening_angle_bracket_in_type_arguments = CCorePlugin.INSERT.equals(insertSpaceAfterOpeningAngleBracketInTypeArgumentsOption); -// } -// final Object insertSpaceAfterOpeningAngleBracketInTypeParametersOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_ANGLE_BRACKET_IN_TYPE_PARAMETERS); -// if (insertSpaceAfterOpeningAngleBracketInTypeParametersOption != null) { -// this.insert_space_after_opening_angle_bracket_in_type_parameters = CCorePlugin.INSERT.equals(insertSpaceAfterOpeningAngleBracketInTypeParametersOption); -// } -// final Object insertSpaceAfterOpeningBracketInArrayAllocationExpressionOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_BRACKET_IN_ARRAY_ALLOCATION_EXPRESSION); -// if (insertSpaceAfterOpeningBracketInArrayAllocationExpressionOption != null) { -// this.insert_space_after_opening_bracket_in_array_allocation_expression = CCorePlugin.INSERT.equals(insertSpaceAfterOpeningBracketInArrayAllocationExpressionOption); -// } -// final Object insertSpaceAfterOpeningBracketInArrayReferenceOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_BRACKET_IN_ARRAY_REFERENCE); -// if (insertSpaceAfterOpeningBracketInArrayReferenceOption != null) { -// this.insert_space_after_opening_bracket_in_array_reference = CCorePlugin.INSERT.equals(insertSpaceAfterOpeningBracketInArrayReferenceOption); -// } - final Object insertSpaceAfterOpeningBraceInArrayInitializerOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_BRACE_IN_ARRAY_INITIALIZER); - if (insertSpaceAfterOpeningBraceInArrayInitializerOption != null) { - this.insert_space_after_opening_brace_in_array_initializer = CCorePlugin.INSERT.equals(insertSpaceAfterOpeningBraceInArrayInitializerOption); + final Object insertSpaceAfterOpeningAngleBracketInTemplateArgumentsOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_ANGLE_BRACKET_IN_TEMPLATE_ARGUMENTS); + if (insertSpaceAfterOpeningAngleBracketInTemplateArgumentsOption != null) { + this.insert_space_after_opening_angle_bracket_in_template_arguments = CCorePlugin.INSERT.equals(insertSpaceAfterOpeningAngleBracketInTemplateArgumentsOption); + } + final Object insertSpaceAfterOpeningAngleBracketInTemplateParametersOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_ANGLE_BRACKET_IN_TEMPLATE_PARAMETERS); + if (insertSpaceAfterOpeningAngleBracketInTemplateParametersOption != null) { + this.insert_space_after_opening_angle_bracket_in_template_parameters = CCorePlugin.INSERT.equals(insertSpaceAfterOpeningAngleBracketInTemplateParametersOption); + } + final Object insertSpaceAfterOpeningBracketInArrayReferenceOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_BRACKET); + if (insertSpaceAfterOpeningBracketInArrayReferenceOption != null) { + this.insert_space_after_opening_bracket = CCorePlugin.INSERT.equals(insertSpaceAfterOpeningBracketInArrayReferenceOption); + } + final Object insertSpaceAfterOpeningBraceInInitializerListOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_BRACE_IN_INITIALIZER_LIST); + if (insertSpaceAfterOpeningBraceInInitializerListOption != null) { + this.insert_space_after_opening_brace_in_initializer_list = CCorePlugin.INSERT.equals(insertSpaceAfterOpeningBraceInInitializerListOption); + } + final Object insertSpaceAfterOpeningParenInCastOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_CAST); + if (insertSpaceAfterOpeningParenInCastOption != null) { + this.insert_space_after_opening_paren_in_cast = CCorePlugin.INSERT.equals(insertSpaceAfterOpeningParenInCastOption); + } + final Object insertSpaceAfterOpeningParenInCatchOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_CATCH); + if (insertSpaceAfterOpeningParenInCatchOption != null) { + this.insert_space_after_opening_paren_in_catch = CCorePlugin.INSERT.equals(insertSpaceAfterOpeningParenInCatchOption); } -// final Object insertSpaceAfterOpeningParenInCastOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_CAST); -// if (insertSpaceAfterOpeningParenInCastOption != null) { -// this.insert_space_after_opening_paren_in_cast = CCorePlugin.INSERT.equals(insertSpaceAfterOpeningParenInCastOption); -// } -// final Object insertSpaceAfterOpeningParenInCatchOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_CATCH); -// if (insertSpaceAfterOpeningParenInCatchOption != null) { -// this.insert_space_after_opening_paren_in_catch = CCorePlugin.INSERT.equals(insertSpaceAfterOpeningParenInCatchOption); -// } final Object insertSpaceAfterOpeningParenInForOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_FOR); if (insertSpaceAfterOpeningParenInForOption != null) { this.insert_space_after_opening_paren_in_for = CCorePlugin.INSERT.equals(insertSpaceAfterOpeningParenInForOption); @@ -1027,10 +1009,10 @@ public class DefaultCodeFormatterOptions { if (insertSpaceAfterOpeningParenInMethodInvocationOption != null) { this.insert_space_after_opening_paren_in_method_invocation = CCorePlugin.INSERT.equals(insertSpaceAfterOpeningParenInMethodInvocationOption); } -// final Object insertSpaceAfterOpeningParenInParenthesizedExpressionOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_PARENTHESIZED_EXPRESSION); -// if (insertSpaceAfterOpeningParenInParenthesizedExpressionOption != null) { -// this.insert_space_after_opening_paren_in_parenthesized_expression = CCorePlugin.INSERT.equals(insertSpaceAfterOpeningParenInParenthesizedExpressionOption); -// } + final Object insertSpaceAfterOpeningParenInParenthesizedExpressionOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_PARENTHESIZED_EXPRESSION); + if (insertSpaceAfterOpeningParenInParenthesizedExpressionOption != null) { + this.insert_space_after_opening_paren_in_parenthesized_expression = CCorePlugin.INSERT.equals(insertSpaceAfterOpeningParenInParenthesizedExpressionOption); + } final Object insertSpaceAfterOpeningParenInSwitchOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_SWITCH); if (insertSpaceAfterOpeningParenInSwitchOption != null) { this.insert_space_after_opening_paren_in_switch = CCorePlugin.INSERT.equals(insertSpaceAfterOpeningParenInSwitchOption); @@ -1039,14 +1021,14 @@ public class DefaultCodeFormatterOptions { if (insertSpaceAfterOpeningParenInWhileOption != null) { this.insert_space_after_opening_paren_in_while = CCorePlugin.INSERT.equals(insertSpaceAfterOpeningParenInWhileOption); } -// final Object insertSpaceAfterPostfixOperatorOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_POSTFIX_OPERATOR); -// if (insertSpaceAfterPostfixOperatorOption != null) { -// this.insert_space_after_postfix_operator = CCorePlugin.INSERT.equals(insertSpaceAfterPostfixOperatorOption); -// } -// final Object insertSpaceAfterPrefixOperatorOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_PREFIX_OPERATOR); -// if (insertSpaceAfterPrefixOperatorOption != null) { -// this.insert_space_after_prefix_operator = CCorePlugin.INSERT.equals(insertSpaceAfterPrefixOperatorOption); -// } + final Object insertSpaceAfterPostfixOperatorOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_POSTFIX_OPERATOR); + if (insertSpaceAfterPostfixOperatorOption != null) { + this.insert_space_after_postfix_operator = CCorePlugin.INSERT.equals(insertSpaceAfterPostfixOperatorOption); + } + final Object insertSpaceAfterPrefixOperatorOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_PREFIX_OPERATOR); + if (insertSpaceAfterPrefixOperatorOption != null) { + this.insert_space_after_prefix_operator = CCorePlugin.INSERT.equals(insertSpaceAfterPrefixOperatorOption); + } final Object insertSpaceAfterQuestionInConditionalOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_QUESTION_IN_CONDITIONAL); if (insertSpaceAfterQuestionInConditionalOption != null) { this.insert_space_after_question_in_conditional = CCorePlugin.INSERT.equals(insertSpaceAfterQuestionInConditionalOption); @@ -1055,54 +1037,42 @@ public class DefaultCodeFormatterOptions { if (insertSpaceAfterSemicolonInForOption != null) { this.insert_space_after_semicolon_in_for = CCorePlugin.INSERT.equals(insertSpaceAfterSemicolonInForOption); } -// final Object insertSpaceAfterUnaryOperatorOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_UNARY_OPERATOR); -// if (insertSpaceAfterUnaryOperatorOption != null) { -// this.insert_space_after_unary_operator = CCorePlugin.INSERT.equals(insertSpaceAfterUnaryOperatorOption); -// } -// final Object insertSpaceBeforeAndInWildcardOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_AND_IN_TYPE_PARAMETER); -// if (insertSpaceBeforeAndInWildcardOption != null) { -// this.insert_space_before_and_in_type_parameter = CCorePlugin.INSERT.equals(insertSpaceBeforeAndInWildcardOption); -// } -// final Object insertSpaceBeforeAssignmentOperatorOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_ASSIGNMENT_OPERATOR); -// if (insertSpaceBeforeAssignmentOperatorOption != null) { -// this.insert_space_before_assignment_operator = CCorePlugin.INSERT.equals(insertSpaceBeforeAssignmentOperatorOption); -// } -// final Object insertSpaceBeforeBinaryOperatorOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_BINARY_OPERATOR); -// if (insertSpaceBeforeBinaryOperatorOption != null) { -// this.insert_space_before_binary_operator = CCorePlugin.INSERT.equals(insertSpaceBeforeBinaryOperatorOption); -// } -// final Object insertSpaceBeforeClosingAngleBracketInParameterizedTypeReferenceOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_ANGLE_BRACKET_IN_PARAMETERIZED_TYPE_REFERENCE); -// if (insertSpaceBeforeClosingAngleBracketInParameterizedTypeReferenceOption != null) { -// this.insert_space_before_closing_angle_bracket_in_parameterized_type_reference = CCorePlugin.INSERT.equals(insertSpaceBeforeClosingAngleBracketInParameterizedTypeReferenceOption); -// } -// final Object insertSpaceBeforeClosingAngleBracketInTypeArgumentsOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_ANGLE_BRACKET_IN_TYPE_ARGUMENTS); -// if (insertSpaceBeforeClosingAngleBracketInTypeArgumentsOption != null) { -// this.insert_space_before_closing_angle_bracket_in_type_arguments = CCorePlugin.INSERT.equals(insertSpaceBeforeClosingAngleBracketInTypeArgumentsOption); -// } -// final Object insertSpaceBeforeClosingAngleBracketInTypeParametersOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_ANGLE_BRACKET_IN_TYPE_PARAMETERS); -// if (insertSpaceBeforeClosingAngleBracketInTypeParametersOption != null) { -// this.insert_space_before_closing_angle_bracket_in_type_parameters = CCorePlugin.INSERT.equals(insertSpaceBeforeClosingAngleBracketInTypeParametersOption); -// } -// final Object insertSpaceBeforeClosingBraceInArrayInitializerOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_BRACE_IN_ARRAY_INITIALIZER); -// if (insertSpaceBeforeClosingBraceInArrayInitializerOption != null) { -// this.insert_space_before_closing_brace_in_array_initializer = CCorePlugin.INSERT.equals(insertSpaceBeforeClosingBraceInArrayInitializerOption); -// } -// final Object insertSpaceBeforeClosingBracketInArrayAllocationExpressionOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_BRACKET_IN_ARRAY_ALLOCATION_EXPRESSION); -// if (insertSpaceBeforeClosingBracketInArrayAllocationExpressionOption != null) { -// this.insert_space_before_closing_bracket_in_array_allocation_expression = CCorePlugin.INSERT.equals(insertSpaceBeforeClosingBracketInArrayAllocationExpressionOption); -// } -// final Object insertSpaceBeforeClosingBracketInArrayReferenceOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_BRACKET_IN_ARRAY_REFERENCE); -// if (insertSpaceBeforeClosingBracketInArrayReferenceOption != null) { -// this.insert_space_before_closing_bracket_in_array_reference = CCorePlugin.INSERT.equals(insertSpaceBeforeClosingBracketInArrayReferenceOption); -// } -// final Object insertSpaceBeforeClosingParenInCastOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_CAST); -// if (insertSpaceBeforeClosingParenInCastOption != null) { -// this.insert_space_before_closing_paren_in_cast = CCorePlugin.INSERT.equals(insertSpaceBeforeClosingParenInCastOption); -// } -// final Object insertSpaceBeforeClosingParenInCatchOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_CATCH); -// if (insertSpaceBeforeClosingParenInCatchOption != null) { -// this.insert_space_before_closing_paren_in_catch = CCorePlugin.INSERT.equals(insertSpaceBeforeClosingParenInCatchOption); -// } + final Object insertSpaceAfterUnaryOperatorOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_UNARY_OPERATOR); + if (insertSpaceAfterUnaryOperatorOption != null) { + this.insert_space_after_unary_operator = CCorePlugin.INSERT.equals(insertSpaceAfterUnaryOperatorOption); + } + final Object insertSpaceBeforeAssignmentOperatorOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_ASSIGNMENT_OPERATOR); + if (insertSpaceBeforeAssignmentOperatorOption != null) { + this.insert_space_before_assignment_operator = CCorePlugin.INSERT.equals(insertSpaceBeforeAssignmentOperatorOption); + } + final Object insertSpaceBeforeBinaryOperatorOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_BINARY_OPERATOR); + if (insertSpaceBeforeBinaryOperatorOption != null) { + this.insert_space_before_binary_operator = CCorePlugin.INSERT.equals(insertSpaceBeforeBinaryOperatorOption); + } + final Object insertSpaceBeforeClosingAngleBracketInTemplateArgumentsOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_ANGLE_BRACKET_IN_TEMPLATE_ARGUMENTS); + if (insertSpaceBeforeClosingAngleBracketInTemplateArgumentsOption != null) { + this.insert_space_before_closing_angle_bracket_in_template_arguments = CCorePlugin.INSERT.equals(insertSpaceBeforeClosingAngleBracketInTemplateArgumentsOption); + } + final Object insertSpaceBeforeClosingAngleBracketInTemplateParametersOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_ANGLE_BRACKET_IN_TEMPLATE_PARAMETERS); + if (insertSpaceBeforeClosingAngleBracketInTemplateParametersOption != null) { + this.insert_space_before_closing_angle_bracket_in_template_parameters = CCorePlugin.INSERT.equals(insertSpaceBeforeClosingAngleBracketInTemplateParametersOption); + } + final Object insertSpaceBeforeClosingBraceInInitializerListOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_BRACE_IN_INITIALIZER_LIST); + if (insertSpaceBeforeClosingBraceInInitializerListOption != null) { + this.insert_space_before_closing_brace_in_initializer_list = CCorePlugin.INSERT.equals(insertSpaceBeforeClosingBraceInInitializerListOption); + } + final Object insertSpaceBeforeClosingBracketInArrayReferenceOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_BRACKET); + if (insertSpaceBeforeClosingBracketInArrayReferenceOption != null) { + this.insert_space_before_closing_bracket = CCorePlugin.INSERT.equals(insertSpaceBeforeClosingBracketInArrayReferenceOption); + } + final Object insertSpaceBeforeClosingParenInCastOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_CAST); + if (insertSpaceBeforeClosingParenInCastOption != null) { + this.insert_space_before_closing_paren_in_cast = CCorePlugin.INSERT.equals(insertSpaceBeforeClosingParenInCastOption); + } + final Object insertSpaceBeforeClosingParenInCatchOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_CATCH); + if (insertSpaceBeforeClosingParenInCatchOption != null) { + this.insert_space_before_closing_paren_in_catch = CCorePlugin.INSERT.equals(insertSpaceBeforeClosingParenInCatchOption); + } final Object insertSpaceBeforeClosingParenInForOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_FOR); if (insertSpaceBeforeClosingParenInForOption != null) { this.insert_space_before_closing_paren_in_for = CCorePlugin.INSERT.equals(insertSpaceBeforeClosingParenInForOption); @@ -1119,10 +1089,10 @@ public class DefaultCodeFormatterOptions { if (insertSpaceBeforeClosingParenInMethodInvocationOption != null) { this.insert_space_before_closing_paren_in_method_invocation = CCorePlugin.INSERT.equals(insertSpaceBeforeClosingParenInMethodInvocationOption); } -// final Object insertSpaceBeforeClosingParenInParenthesizedExpressionOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_PARENTHESIZED_EXPRESSION); -// if (insertSpaceBeforeClosingParenInParenthesizedExpressionOption != null) { -// this.insert_space_before_closing_paren_in_parenthesized_expression = CCorePlugin.INSERT.equals(insertSpaceBeforeClosingParenInParenthesizedExpressionOption); -// } + final Object insertSpaceBeforeClosingParenInParenthesizedExpressionOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_PARENTHESIZED_EXPRESSION); + if (insertSpaceBeforeClosingParenInParenthesizedExpressionOption != null) { + this.insert_space_before_closing_paren_in_parenthesized_expression = CCorePlugin.INSERT.equals(insertSpaceBeforeClosingParenInParenthesizedExpressionOption); + } final Object insertSpaceBeforeClosingParenInSwitchOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_SWITCH); if (insertSpaceBeforeClosingParenInSwitchOption != null) { this.insert_space_before_closing_paren_in_switch = CCorePlugin.INSERT.equals(insertSpaceBeforeClosingParenInSwitchOption); @@ -1132,6 +1102,10 @@ public class DefaultCodeFormatterOptions { this.insert_space_before_closing_paren_in_while = CCorePlugin.INSERT.equals(insertSpaceBeforeClosingParenInWhileOption); } final Object insertSpaceBeforeColonInCaseOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COLON_IN_CASE); + final Object insertSpaceBeforeColonInBaseClauseOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COLON_IN_BASE_CLAUSE); + if (insertSpaceBeforeColonInBaseClauseOption != null) { + this.insert_space_before_colon_in_base_clause = CCorePlugin.INSERT.equals(insertSpaceBeforeColonInBaseClauseOption); + } if (insertSpaceBeforeColonInCaseOption != null) { this.insert_space_before_colon_in_case = CCorePlugin.INSERT.equals(insertSpaceBeforeColonInCaseOption); } @@ -1143,25 +1117,29 @@ public class DefaultCodeFormatterOptions { if (insertSpaceBeforeColonInDefaultOption != null) { this.insert_space_before_colon_in_default = CCorePlugin.INSERT.equals(insertSpaceBeforeColonInDefaultOption); } -// final Object insertSpaceBeforeColonInForOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COLON_IN_FOR); -// if (insertSpaceBeforeColonInForOption != null) { -// this.insert_space_before_colon_in_for = CCorePlugin.INSERT.equals(insertSpaceBeforeColonInForOption); -// } -// final Object insertSpaceBeforeColonInLabeledStatementOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COLON_IN_LABELED_STATEMENT); -// if (insertSpaceBeforeColonInLabeledStatementOption != null) { -// this.insert_space_before_colon_in_labeled_statement = CCorePlugin.INSERT.equals(insertSpaceBeforeColonInLabeledStatementOption); -// } + final Object insertSpaceBeforeColonInLabeledStatementOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COLON_IN_LABELED_STATEMENT); + if (insertSpaceBeforeColonInLabeledStatementOption != null) { + this.insert_space_before_colon_in_labeled_statement = CCorePlugin.INSERT.equals(insertSpaceBeforeColonInLabeledStatementOption); + } // final Object insertSpaceBeforeCommaInAllocationExpressionOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_ALLOCATION_EXPRESSION); // if (insertSpaceBeforeCommaInAllocationExpressionOption != null) { // this.insert_space_before_comma_in_allocation_expression = CCorePlugin.INSERT.equals(insertSpaceBeforeCommaInAllocationExpressionOption); // } -// final Object insertSpaceBeforeCommaInArrayInitializerOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_ARRAY_INITIALIZER); -// if (insertSpaceBeforeCommaInArrayInitializerOption != null) { -// this.insert_space_before_comma_in_array_initializer = CCorePlugin.INSERT.equals(insertSpaceBeforeCommaInArrayInitializerOption); + final Object insertSpaceBeforeCommaInInitializerListOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_INITIALIZER_LIST); + if (insertSpaceBeforeCommaInInitializerListOption != null) { + this.insert_space_before_comma_in_initializer_list = CCorePlugin.INSERT.equals(insertSpaceBeforeCommaInInitializerListOption); + } + final Object insertSpaceBeforeCommaInEnumDeclarationsOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_ENUM_DECLARATIONS); + if (insertSpaceBeforeCommaInEnumDeclarationsOption != null) { + this.insert_space_before_comma_in_enum_declarations = CCorePlugin.INSERT.equals(insertSpaceBeforeCommaInEnumDeclarationsOption); + } +// final Object insertSpaceBeforeCommaInForInitsOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_FOR_INITS); +// if (insertSpaceBeforeCommaInForInitsOption != null) { +// this.insert_space_before_comma_in_for_inits = CCorePlugin.INSERT.equals(insertSpaceBeforeCommaInForInitsOption); // } -// final Object insertSpaceBeforeCommaInEnumDeclarationsOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_ENUM_DECLARATIONS); -// if (insertSpaceBeforeCommaInEnumDeclarationsOption != null) { -// this.insert_space_before_comma_in_enum_declarations = CCorePlugin.INSERT.equals(insertSpaceBeforeCommaInEnumDeclarationsOption); +// final Object insertSpaceBeforeCommaInForIncrementsOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_FOR_INCREMENTS); +// if (insertSpaceBeforeCommaInForIncrementsOption != null) { +// this.insert_space_before_comma_in_for_increments = CCorePlugin.INSERT.equals(insertSpaceBeforeCommaInForIncrementsOption); // } final Object insertSpaceBeforeCommaInMethodInvocationArgumentsOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_METHOD_INVOCATION_ARGUMENTS); if (insertSpaceBeforeCommaInMethodInvocationArgumentsOption != null) { @@ -1175,58 +1153,46 @@ public class DefaultCodeFormatterOptions { // if (insertSpaceBeforeCommaInMethodDeclarationThrowsOption != null) { // this.insert_space_before_comma_in_method_declaration_throws = CCorePlugin.INSERT.equals(insertSpaceBeforeCommaInMethodDeclarationThrowsOption); // } -// final Object insertSpaceBeforeCommaInMultipleFieldDeclarationsOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_MULTIPLE_FIELD_DECLARATIONS); -// if (insertSpaceBeforeCommaInMultipleFieldDeclarationsOption != null) { -// this.insert_space_before_comma_in_multiple_field_declarations = CCorePlugin.INSERT.equals(insertSpaceBeforeCommaInMultipleFieldDeclarationsOption); -// } -// final Object insertSpaceBeforeCommaInMultipleLocalDeclarationsOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_MULTIPLE_LOCAL_DECLARATIONS); -// if (insertSpaceBeforeCommaInMultipleLocalDeclarationsOption != null) { -// this.insert_space_before_comma_in_multiple_local_declarations = CCorePlugin.INSERT.equals(insertSpaceBeforeCommaInMultipleLocalDeclarationsOption); -// } -// final Object insertSpaceBeforeCommaInParameterizedTypeReferenceOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_PARAMETERIZED_TYPE_REFERENCE); -// if (insertSpaceBeforeCommaInParameterizedTypeReferenceOption != null) { -// this.insert_space_before_comma_in_parameterized_type_reference = CCorePlugin.INSERT.equals(insertSpaceBeforeCommaInParameterizedTypeReferenceOption); -// } -// final Object insertSpaceBeforeCommaInBaseTypesOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_BASE_TYPES); -// if (insertSpaceBeforeCommaInBaseTypesOption != null) { -// this.insert_space_before_comma_in_base_types = CCorePlugin.INSERT.equals(insertSpaceBeforeCommaInBaseTypesOption); -// } -// final Object insertSpaceBeforeCommaInTypeArgumentsOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_TYPE_ARGUMENTS); -// if (insertSpaceBeforeCommaInTypeArgumentsOption != null) { -// this.insert_space_before_comma_in_type_arguments = CCorePlugin.INSERT.equals(insertSpaceBeforeCommaInTypeArgumentsOption); -// } -// final Object insertSpaceBeforeCommaInTypeParametersOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_TYPE_PARAMETERS); -// if (insertSpaceBeforeCommaInTypeParametersOption != null) { -// this.insert_space_before_comma_in_type_parameters = CCorePlugin.INSERT.equals(insertSpaceBeforeCommaInTypeParametersOption); -// } + final Object insertSpaceBeforeCommaInMultipleFieldDeclarationsOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_DECLARATOR_LIST); + if (insertSpaceBeforeCommaInMultipleFieldDeclarationsOption != null) { + this.insert_space_before_comma_in_declarator_list = CCorePlugin.INSERT.equals(insertSpaceBeforeCommaInMultipleFieldDeclarationsOption); + } + final Object insertSpaceBeforeCommaInMultipleLocalDeclarationsOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_EXPRESSION_LIST); + if (insertSpaceBeforeCommaInMultipleLocalDeclarationsOption != null) { + this.insert_space_before_comma_in_expression_list = CCorePlugin.INSERT.equals(insertSpaceBeforeCommaInMultipleLocalDeclarationsOption); + } + final Object insertSpaceBeforeCommaInBaseTypesOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_BASE_TYPES); + if (insertSpaceBeforeCommaInBaseTypesOption != null) { + this.insert_space_before_comma_in_base_types = CCorePlugin.INSERT.equals(insertSpaceBeforeCommaInBaseTypesOption); + } + final Object insertSpaceBeforeCommaInTemplateArgumentsOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_TEMPLATE_ARGUMENTS); + if (insertSpaceBeforeCommaInTemplateArgumentsOption != null) { + this.insert_space_before_comma_in_template_arguments = CCorePlugin.INSERT.equals(insertSpaceBeforeCommaInTemplateArgumentsOption); + } + final Object insertSpaceBeforeCommaInTemplateParametersOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_TEMPLATE_PARAMETERS); + if (insertSpaceBeforeCommaInTemplateParametersOption != null) { + this.insert_space_before_comma_in_template_parameters = CCorePlugin.INSERT.equals(insertSpaceBeforeCommaInTemplateParametersOption); + } // final Object insertSpaceBeforeEllipsisOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_ELLIPSIS); // if (insertSpaceBeforeEllipsisOption != null) { // this.insert_space_before_ellipsis = CCorePlugin.INSERT.equals(insertSpaceBeforeEllipsisOption); // } -// final Object insertSpaceBeforeOpeningAngleBrackerInParameterizedTypeReferenceOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_ANGLE_BRACKET_IN_PARAMETERIZED_TYPE_REFERENCE); -// if (insertSpaceBeforeOpeningAngleBrackerInParameterizedTypeReferenceOption != null) { -// this.insert_space_before_opening_angle_bracket_in_parameterized_type_reference = CCorePlugin.INSERT.equals(insertSpaceBeforeOpeningAngleBrackerInParameterizedTypeReferenceOption); -// } -// final Object insertSpaceBeforeOpeningAngleBrackerInTypeArgumentsOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_ANGLE_BRACKET_IN_TYPE_ARGUMENTS); -// if (insertSpaceBeforeOpeningAngleBrackerInTypeArgumentsOption != null) { -// this.insert_space_before_opening_angle_bracket_in_type_arguments = CCorePlugin.INSERT.equals(insertSpaceBeforeOpeningAngleBrackerInTypeArgumentsOption); -// } -// final Object insertSpaceBeforeOpeningAngleBrackerInTypeParametersOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_ANGLE_BRACKET_IN_TYPE_PARAMETERS); -// if (insertSpaceBeforeOpeningAngleBrackerInTypeParametersOption != null) { -// this.insert_space_before_opening_angle_bracket_in_type_parameters = CCorePlugin.INSERT.equals(insertSpaceBeforeOpeningAngleBrackerInTypeParametersOption); -// } -// final Object insertSpaceBeforeOpeningBraceInArrayInitializerOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACE_IN_ARRAY_INITIALIZER); -// if (insertSpaceBeforeOpeningBraceInArrayInitializerOption != null) { -// this.insert_space_before_opening_brace_in_array_initializer = CCorePlugin.INSERT.equals(insertSpaceBeforeOpeningBraceInArrayInitializerOption); -// } + final Object insertSpaceBeforeOpeningAngleBrackerInTemplateArgumentsOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_ANGLE_BRACKET_IN_TEMPLATE_ARGUMENTS); + if (insertSpaceBeforeOpeningAngleBrackerInTemplateArgumentsOption != null) { + this.insert_space_before_opening_angle_bracket_in_template_arguments = CCorePlugin.INSERT.equals(insertSpaceBeforeOpeningAngleBrackerInTemplateArgumentsOption); + } + final Object insertSpaceBeforeOpeningAngleBrackerInTemplateParametersOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_ANGLE_BRACKET_IN_TEMPLATE_PARAMETERS); + if (insertSpaceBeforeOpeningAngleBrackerInTemplateParametersOption != null) { + this.insert_space_before_opening_angle_bracket_in_template_parameters = CCorePlugin.INSERT.equals(insertSpaceBeforeOpeningAngleBrackerInTemplateParametersOption); + } + final Object insertSpaceBeforeOpeningBraceInInitializerListOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACE_IN_INITIALIZER_LIST); + if (insertSpaceBeforeOpeningBraceInInitializerListOption != null) { + this.insert_space_before_opening_brace_in_initializer_list = CCorePlugin.INSERT.equals(insertSpaceBeforeOpeningBraceInInitializerListOption); + } final Object insertSpaceBeforeOpeningBraceInBlockOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACE_IN_BLOCK); if (insertSpaceBeforeOpeningBraceInBlockOption != null) { this.insert_space_before_opening_brace_in_block = CCorePlugin.INSERT.equals(insertSpaceBeforeOpeningBraceInBlockOption); } -// final Object insertSpaceBeforeOpeningBraceInEnumDeclarationOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACE_IN_ENUM_DECLARATION); -// if (insertSpaceBeforeOpeningBraceInEnumDeclarationOption != null) { -// this.insert_space_before_opening_brace_in_enum_declaration = CCorePlugin.INSERT.equals(insertSpaceBeforeOpeningBraceInEnumDeclarationOption); -// } final Object insertSpaceBeforeOpeningBraceInMethodDeclarationOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACE_IN_METHOD_DECLARATION); if (insertSpaceBeforeOpeningBraceInMethodDeclarationOption != null) { this.insert_space_before_opening_brace_in_method_declaration = CCorePlugin.INSERT.equals(insertSpaceBeforeOpeningBraceInMethodDeclarationOption); @@ -1239,22 +1205,14 @@ public class DefaultCodeFormatterOptions { if (insertSpaceBeforeOpeningBraceInNamespaceDeclarationOption != null) { this.insert_space_before_opening_brace_in_namespace_declaration = CCorePlugin.INSERT.equals(insertSpaceBeforeOpeningBraceInNamespaceDeclarationOption); } -// final Object insertSpaceBeforeOpeningBracketInArrayAllocationExpressionOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACKET_IN_ARRAY_ALLOCATION_EXPRESSION); -// if (insertSpaceBeforeOpeningBracketInArrayAllocationExpressionOption != null) { -// this.insert_space_before_opening_bracket_in_array_allocation_expression = CCorePlugin.INSERT.equals(insertSpaceBeforeOpeningBracketInArrayAllocationExpressionOption); -// } -// final Object insertSpaceBeforeOpeningBracketInArrayReferenceOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACKET_IN_ARRAY_REFERENCE); -// if (insertSpaceBeforeOpeningBracketInArrayReferenceOption != null) { -// this.insert_space_before_opening_bracket_in_array_reference = CCorePlugin.INSERT.equals(insertSpaceBeforeOpeningBracketInArrayReferenceOption); -// } -// final Object insertSpaceBeforeOpeningBracketInArrayTypeReferenceOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACKET_IN_ARRAY_TYPE_REFERENCE); -// if (insertSpaceBeforeOpeningBracketInArrayTypeReferenceOption != null) { -// this.insert_space_before_opening_bracket_in_array_type_reference = CCorePlugin.INSERT.equals(insertSpaceBeforeOpeningBracketInArrayTypeReferenceOption); -// } -// final Object insertSpaceBeforeOpeningParenInCatchOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_CATCH); -// if (insertSpaceBeforeOpeningParenInCatchOption != null) { -// this.insert_space_before_opening_paren_in_catch = CCorePlugin.INSERT.equals(insertSpaceBeforeOpeningParenInCatchOption); -// } + final Object insertSpaceBeforeOpeningBracketInArrayReferenceOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACKET); + if (insertSpaceBeforeOpeningBracketInArrayReferenceOption != null) { + this.insert_space_before_opening_bracket = CCorePlugin.INSERT.equals(insertSpaceBeforeOpeningBracketInArrayReferenceOption); + } + final Object insertSpaceBeforeOpeningParenInCatchOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_CATCH); + if (insertSpaceBeforeOpeningParenInCatchOption != null) { + this.insert_space_before_opening_paren_in_catch = CCorePlugin.INSERT.equals(insertSpaceBeforeOpeningParenInCatchOption); + } final Object insertSpaceBeforeOpeningParenInForOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_FOR); if (insertSpaceBeforeOpeningParenInForOption != null) { this.insert_space_before_opening_paren_in_for = CCorePlugin.INSERT.equals(insertSpaceBeforeOpeningParenInForOption); @@ -1279,10 +1237,10 @@ public class DefaultCodeFormatterOptions { if (insertSpaceBeforeOpeningBraceInSwitchOption != null) { this.insert_space_before_opening_brace_in_switch = CCorePlugin.INSERT.equals(insertSpaceBeforeOpeningBraceInSwitchOption); } -// final Object insertSpaceBeforeOpeningParenInParenthesizedExpressionOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_PARENTHESIZED_EXPRESSION); -// if (insertSpaceBeforeOpeningParenInParenthesizedExpressionOption != null) { -// this.insert_space_before_opening_paren_in_parenthesized_expression = CCorePlugin.INSERT.equals(insertSpaceBeforeOpeningParenInParenthesizedExpressionOption); -// } + final Object insertSpaceBeforeOpeningParenInParenthesizedExpressionOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_PARENTHESIZED_EXPRESSION); + if (insertSpaceBeforeOpeningParenInParenthesizedExpressionOption != null) { + this.insert_space_before_opening_paren_in_parenthesized_expression = CCorePlugin.INSERT.equals(insertSpaceBeforeOpeningParenInParenthesizedExpressionOption); + } final Object insertSpaceBeforeOpeningParenInWhileOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_WHILE); if (insertSpaceBeforeOpeningParenInWhileOption != null) { this.insert_space_before_opening_paren_in_while = CCorePlugin.INSERT.equals(insertSpaceBeforeOpeningParenInWhileOption); @@ -1291,14 +1249,14 @@ public class DefaultCodeFormatterOptions { // if (insertSpaceBeforeParenthesizedExpressionInReturnOption != null) { // this.insert_space_before_parenthesized_expression_in_return = CCorePlugin.INSERT.equals(insertSpaceBeforeParenthesizedExpressionInReturnOption); // } -// final Object insertSpaceBeforePostfixOperatorOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_POSTFIX_OPERATOR); -// if (insertSpaceBeforePostfixOperatorOption != null) { -// this.insert_space_before_postfix_operator = CCorePlugin.INSERT.equals(insertSpaceBeforePostfixOperatorOption); -// } -// final Object insertSpaceBeforePrefixOperatorOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_PREFIX_OPERATOR); -// if (insertSpaceBeforePrefixOperatorOption != null) { -// this.insert_space_before_prefix_operator = CCorePlugin.INSERT.equals(insertSpaceBeforePrefixOperatorOption); -// } + final Object insertSpaceBeforePostfixOperatorOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_POSTFIX_OPERATOR); + if (insertSpaceBeforePostfixOperatorOption != null) { + this.insert_space_before_postfix_operator = CCorePlugin.INSERT.equals(insertSpaceBeforePostfixOperatorOption); + } + final Object insertSpaceBeforePrefixOperatorOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_PREFIX_OPERATOR); + if (insertSpaceBeforePrefixOperatorOption != null) { + this.insert_space_before_prefix_operator = CCorePlugin.INSERT.equals(insertSpaceBeforePrefixOperatorOption); + } final Object insertSpaceBeforeQuestionInConditionalOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_QUESTION_IN_CONDITIONAL); if (insertSpaceBeforeQuestionInConditionalOption != null) { this.insert_space_before_question_in_conditional = CCorePlugin.INSERT.equals(insertSpaceBeforeQuestionInConditionalOption); @@ -1311,30 +1269,26 @@ public class DefaultCodeFormatterOptions { if (insertSpaceBeforeSemicolonInForOption != null) { this.insert_space_before_semicolon_in_for = CCorePlugin.INSERT.equals(insertSpaceBeforeSemicolonInForOption); } -// final Object insertSpaceBeforeUnaryOperatorOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_UNARY_OPERATOR); -// if (insertSpaceBeforeUnaryOperatorOption != null) { -// this.insert_space_before_unary_operator = CCorePlugin.INSERT.equals(insertSpaceBeforeUnaryOperatorOption); -// } -// final Object insertSpaceBetweenBracketsInArrayTypeReferenceOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BETWEEN_BRACKETS_IN_ARRAY_TYPE_REFERENCE); -// if (insertSpaceBetweenBracketsInArrayTypeReferenceOption != null) { -// this.insert_space_between_brackets_in_array_type_reference = CCorePlugin.INSERT.equals(insertSpaceBetweenBracketsInArrayTypeReferenceOption); -// } -// final Object insertSpaceBetweenEmptyBracesInArrayInitializerOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BETWEEN_EMPTY_BRACES_IN_ARRAY_INITIALIZER); -// if (insertSpaceBetweenEmptyBracesInArrayInitializerOption != null) { -// this.insert_space_between_empty_braces_in_array_initializer = CCorePlugin.INSERT.equals(insertSpaceBetweenEmptyBracesInArrayInitializerOption); -// } -// final Object insertSpaceBetweenEmptyBracketsInArrayAllocationExpressionOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BETWEEN_EMPTY_BRACKETS_IN_ARRAY_ALLOCATION_EXPRESSION); -// if (insertSpaceBetweenEmptyBracketsInArrayAllocationExpressionOption != null) { -// this.insert_space_between_empty_brackets_in_array_allocation_expression = CCorePlugin.INSERT.equals(insertSpaceBetweenEmptyBracketsInArrayAllocationExpressionOption); -// } + final Object insertSpaceBeforeUnaryOperatorOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_UNARY_OPERATOR); + if (insertSpaceBeforeUnaryOperatorOption != null) { + this.insert_space_before_unary_operator = CCorePlugin.INSERT.equals(insertSpaceBeforeUnaryOperatorOption); + } + final Object insertSpaceBetweenEmptyBracesInInitializerListOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BETWEEN_EMPTY_BRACES_IN_INITIALIZER_LIST); + if (insertSpaceBetweenEmptyBracesInInitializerListOption != null) { + this.insert_space_between_empty_braces_in_initializer_list = CCorePlugin.INSERT.equals(insertSpaceBetweenEmptyBracesInInitializerListOption); + } + final Object insertSpaceBetweenEmptyBracketsOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BETWEEN_EMPTY_BRACKETS); + if (insertSpaceBetweenEmptyBracketsOption != null) { + this.insert_space_between_empty_brackets = CCorePlugin.INSERT.equals(insertSpaceBetweenEmptyBracketsOption); + } final Object insertSpaceBetweenEmptyParensInMethodDeclarationOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BETWEEN_EMPTY_PARENS_IN_METHOD_DECLARATION); if (insertSpaceBetweenEmptyParensInMethodDeclarationOption != null) { this.insert_space_between_empty_parens_in_method_declaration = CCorePlugin.INSERT.equals(insertSpaceBetweenEmptyParensInMethodDeclarationOption); } -// final Object insertSpaceBetweenEmptyParensInMethodInvocationOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BETWEEN_EMPTY_PARENS_IN_METHOD_INVOCATION); -// if (insertSpaceBetweenEmptyParensInMethodInvocationOption != null) { -// this.insert_space_between_empty_parens_in_method_invocation = CCorePlugin.INSERT.equals(insertSpaceBetweenEmptyParensInMethodInvocationOption); -// } + final Object insertSpaceBetweenEmptyParensInMethodInvocationOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BETWEEN_EMPTY_PARENS_IN_METHOD_INVOCATION); + if (insertSpaceBetweenEmptyParensInMethodInvocationOption != null) { + this.insert_space_between_empty_parens_in_method_invocation = CCorePlugin.INSERT.equals(insertSpaceBetweenEmptyParensInMethodInvocationOption); + } final Object compactElseIfOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_COMPACT_ELSE_IF); if (compactElseIfOption != null) { this.compact_else_if = DefaultCodeFormatterConstants.TRUE.equals(compactElseIfOption); @@ -1347,10 +1301,10 @@ public class DefaultCodeFormatterOptions { if (keepElseStatementOnSameLineOption != null) { this.keep_else_statement_on_same_line = DefaultCodeFormatterConstants.TRUE.equals(keepElseStatementOnSameLineOption); } -// final Object keepEmptyArrayInitializerOnOneLineOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_KEEP_EMPTY_ARRAY_INITIALIZER_ON_ONE_LINE); -// if (keepEmptyArrayInitializerOnOneLineOption != null) { -// this.keep_empty_array_initializer_on_one_line = DefaultCodeFormatterConstants.TRUE.equals(keepEmptyArrayInitializerOnOneLineOption); -// } + final Object keepEmptyInitializerListOnOneLineOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_KEEP_EMPTY_INITIALIZER_LIST_ON_ONE_LINE); + if (keepEmptyInitializerListOnOneLineOption != null) { + this.keep_empty_initializer_list_on_one_line = DefaultCodeFormatterConstants.TRUE.equals(keepEmptyInitializerListOnOneLineOption); + } final Object keepSimpleIfOnOneLineOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_KEEP_SIMPLE_IF_ON_ONE_LINE); if (keepSimpleIfOnOneLineOption != null) { this.keep_simple_if_on_one_line = DefaultCodeFormatterConstants.TRUE.equals(keepSimpleIfOnOneLineOption); @@ -1416,14 +1370,15 @@ public class DefaultCodeFormatterOptions { // this.alignment_for_binary_expression = Alignment.M_COMPACT_SPLIT; // this.alignment_for_compact_if = Alignment.M_COMPACT_SPLIT; this.alignment_for_conditional_expression = Alignment.M_NEXT_PER_LINE_SPLIT; - this.alignment_for_expressions_in_array_initializer = Alignment.M_COMPACT_SPLIT; -// this.alignment_for_multiple_fields = Alignment.M_COMPACT_SPLIT; + this.alignment_for_expressions_in_initializer_list = Alignment.M_COMPACT_SPLIT; + this.alignment_for_declarator_list = Alignment.M_COMPACT_SPLIT; + this.alignment_for_enumerator_list = Alignment.M_ONE_PER_LINE_SPLIT; this.alignment_for_parameters_in_method_declaration = Alignment.M_COMPACT_SPLIT; // this.alignment_for_selector_in_method_invocation = Alignment.M_COMPACT_SPLIT; // this.alignment_for_superclass_in_type_declaration = Alignment.M_COMPACT_SPLIT; // this.alignment_for_throws_clause_in_method_declaration = Alignment.M_COMPACT_SPLIT; // this.align_type_members_on_columns = false; - this.brace_position_for_array_initializer = DefaultCodeFormatterConstants.END_OF_LINE; + this.brace_position_for_initializer_list = DefaultCodeFormatterConstants.END_OF_LINE; this.brace_position_for_block = DefaultCodeFormatterConstants.END_OF_LINE; this.brace_position_for_block_in_case = DefaultCodeFormatterConstants.END_OF_LINE; // this.brace_position_for_enum_declaration = DefaultCodeFormatterConstants.END_OF_LINE; @@ -1442,7 +1397,7 @@ public class DefaultCodeFormatterOptions { // this.comment_insert_new_line_for_parameter = true; // this.comment_line_length = 80; this.continuation_indentation = 2; - this.continuation_indentation_for_array_initializer = 2; + this.continuation_indentation_for_initializer_list = 2; // this.blank_lines_after_includes = 1; // this.blank_lines_before_field = 1; // this.blank_lines_before_first_class_body_declaration = 0; @@ -1462,134 +1417,123 @@ public class DefaultCodeFormatterOptions { this.indent_switchstatements_compare_to_cases = true; this.indent_switchstatements_compare_to_switch = false; this.indentation_size = 4; - this.insert_new_line_after_opening_brace_in_array_initializer = false; + this.insert_new_line_after_opening_brace_in_initializer_list = false; this.insert_new_line_at_end_of_file_if_missing = false; // this.insert_new_line_before_catch_in_try_statement = false; - this.insert_new_line_before_closing_brace_in_array_initializer = false; + this.insert_new_line_before_closing_brace_in_initializer_list = false; this.insert_new_line_before_else_in_if_statement = false; // this.insert_new_line_before_finally_in_try_statement = false; this.insert_new_line_before_while_in_do_statement = false; this.insert_new_line_in_empty_block = true; -// this.insert_new_line_in_empty_enum_declaration = true; // this.insert_new_line_in_empty_method_body = true; // this.insert_new_line_in_empty_type_declaration = true; -// this.insert_space_after_and_in_type_parameter = true; -// this.insert_space_after_assignment_operator = true; -// this.insert_space_after_binary_operator = true; -// this.insert_space_after_closing_angle_bracket_in_type_arguments = true; -// this.insert_space_after_closing_angle_bracket_in_type_parameters = true; -// this.insert_space_after_closing_paren_in_cast = true; + this.insert_space_after_assignment_operator = true; + this.insert_space_after_binary_operator = true; + this.insert_space_after_closing_angle_bracket_in_template_arguments = true; + this.insert_space_after_closing_angle_bracket_in_template_parameters = true; + this.insert_space_after_closing_paren_in_cast = true; this.insert_space_after_closing_brace_in_block = true; + this.insert_space_after_colon_in_base_clause = true; this.insert_space_after_colon_in_case = true; this.insert_space_after_colon_in_conditional = true; -// this.insert_space_after_colon_in_for = true; -// this.insert_space_after_colon_in_labeled_statement = true; + this.insert_space_after_colon_in_labeled_statement = true; // this.insert_space_after_comma_in_allocation_expression = true; - this.insert_space_after_comma_in_array_initializer = true; -// this.insert_space_after_comma_in_enum_declarations = true; + this.insert_space_after_comma_in_initializer_list = true; + this.insert_space_after_comma_in_enum_declarations = true; this.insert_space_after_comma_in_method_invocation_arguments = true; this.insert_space_after_comma_in_method_declaration_parameters = true; // this.insert_space_after_comma_in_method_declaration_throws = true; -// this.insert_space_after_comma_in_multiple_field_declarations = true; -// this.insert_space_after_comma_in_multiple_local_declarations = true; -// this.insert_space_after_comma_in_parameterized_type_reference = true; -// this.insert_space_after_comma_in_base_types = true; -// this.insert_space_after_comma_in_type_arguments = true; -// this.insert_space_after_comma_in_type_parameters = true; + this.insert_space_after_comma_in_declarator_list = true; + this.insert_space_after_comma_in_expression_list = true; + this.insert_space_after_comma_in_base_types = true; + this.insert_space_after_comma_in_template_arguments = true; + this.insert_space_after_comma_in_template_parameters = true; // this.insert_space_after_ellipsis = true; // this.insert_space_after_opening_angle_bracket_in_parameterized_type_reference = false; -// this.insert_space_after_opening_angle_bracket_in_type_arguments = false; -// this.insert_space_after_opening_angle_bracket_in_type_parameters = false; -// this.insert_space_after_opening_bracket_in_array_allocation_expression = false; -// this.insert_space_after_opening_bracket_in_array_reference = false; - this.insert_space_after_opening_brace_in_array_initializer = true; -// this.insert_space_after_opening_paren_in_cast = false; -// this.insert_space_after_opening_paren_in_catch = false; + this.insert_space_after_opening_angle_bracket_in_template_arguments = false; + this.insert_space_after_opening_angle_bracket_in_template_parameters = false; + this.insert_space_after_opening_bracket = false; + this.insert_space_after_opening_brace_in_initializer_list = true; + this.insert_space_after_opening_paren_in_cast = false; + this.insert_space_after_opening_paren_in_catch = false; this.insert_space_after_opening_paren_in_for = false; this.insert_space_after_opening_paren_in_if = false; this.insert_space_after_opening_paren_in_method_declaration = false; this.insert_space_after_opening_paren_in_method_invocation = false; -// this.insert_space_after_opening_paren_in_parenthesized_expression = false; + this.insert_space_after_opening_paren_in_parenthesized_expression = false; this.insert_space_after_opening_paren_in_switch = false; this.insert_space_after_opening_paren_in_while = false; -// this.insert_space_after_postfix_operator = false; -// this.insert_space_after_prefix_operator = false; + this.insert_space_after_postfix_operator = false; + this.insert_space_after_prefix_operator = false; this.insert_space_after_question_in_conditional = true; this.insert_space_after_semicolon_in_for = true; -// this.insert_space_after_unary_operator = false; -// this.insert_space_before_and_in_type_parameter = true; -// this.insert_space_before_assignment_operator = true; -// this.insert_space_before_binary_operator = true; -// this.insert_space_before_closing_angle_bracket_in_parameterized_type_reference = false; -// this.insert_space_before_closing_angle_bracket_in_type_arguments = false; -// this.insert_space_before_closing_angle_bracket_in_type_parameters = false; - this.insert_space_before_closing_brace_in_array_initializer = true; -// this.insert_space_before_closing_bracket_in_array_allocation_expression = false; -// this.insert_space_before_closing_bracket_in_array_reference = false; -// this.insert_space_before_closing_paren_in_cast = false; -// this.insert_space_before_closing_paren_in_catch = false; + this.insert_space_after_unary_operator = false; + this.insert_space_before_assignment_operator = true; + this.insert_space_before_binary_operator = true; + this.insert_space_before_closing_angle_bracket_in_template_arguments = false; + this.insert_space_before_closing_angle_bracket_in_template_parameters = false; + this.insert_space_before_closing_brace_in_initializer_list = true; + this.insert_space_before_closing_bracket = false; + this.insert_space_before_closing_paren_in_cast = false; + this.insert_space_before_closing_paren_in_catch = false; this.insert_space_before_closing_paren_in_for = false; this.insert_space_before_closing_paren_in_if = false; this.insert_space_before_closing_paren_in_method_declaration = false; this.insert_space_before_closing_paren_in_method_invocation = false; -// this.insert_space_before_closing_paren_in_parenthesized_expression = false; + this.insert_space_before_closing_paren_in_parenthesized_expression = false; this.insert_space_before_closing_paren_in_switch = false; this.insert_space_before_closing_paren_in_while = false; + this.insert_space_before_colon_in_base_clause = false; this.insert_space_before_colon_in_case = false; this.insert_space_before_colon_in_conditional = true; this.insert_space_before_colon_in_default = false; -// this.insert_space_before_colon_in_for = true; -// this.insert_space_before_colon_in_labeled_statement = false; + this.insert_space_before_colon_in_labeled_statement = false; // this.insert_space_before_comma_in_allocation_expression = false; - this.insert_space_before_comma_in_array_initializer = false; -// this.insert_space_before_comma_in_enum_declarations = false; + this.insert_space_before_comma_in_initializer_list = false; + this.insert_space_before_comma_in_enum_declarations = false; +// this.insert_space_before_comma_in_for_increments = false; +// this.insert_space_before_comma_in_for_inits = false; this.insert_space_before_comma_in_method_invocation_arguments = false; this.insert_space_before_comma_in_method_declaration_parameters = false; // this.insert_space_before_comma_in_method_declaration_throws = false; -// this.insert_space_before_comma_in_multiple_field_declarations = false; -// this.insert_space_before_comma_in_multiple_local_declarations = false; -// this.insert_space_before_comma_in_parameterized_type_reference = false; -// this.insert_space_before_comma_in_base_types = false; -// this.insert_space_before_comma_in_type_arguments = false; -// this.insert_space_before_comma_in_type_parameters = false; + this.insert_space_before_comma_in_declarator_list = false; + this.insert_space_before_comma_in_expression_list = false; + this.insert_space_before_comma_in_base_types = false; + this.insert_space_before_comma_in_template_arguments = false; + this.insert_space_before_comma_in_template_parameters = false; // this.insert_space_before_ellipsis = false; // this.insert_space_before_parenthesized_expression_in_return = true; -// this.insert_space_before_opening_angle_bracket_in_parameterized_type_reference = false; -// this.insert_space_before_opening_angle_bracket_in_type_arguments = false; -// this.insert_space_before_opening_angle_bracket_in_type_parameters = false; - this.insert_space_before_opening_brace_in_array_initializer = true; + this.insert_space_before_opening_angle_bracket_in_template_arguments = false; + this.insert_space_before_opening_angle_bracket_in_template_parameters = false; + this.insert_space_before_opening_brace_in_initializer_list = true; this.insert_space_before_opening_brace_in_block = true; -// this.insert_space_before_opening_brace_in_enum_declaration = true; this.insert_space_before_opening_brace_in_method_declaration = true; this.insert_space_before_opening_brace_in_switch = true; this.insert_space_before_opening_brace_in_type_declaration = true; this.insert_space_before_opening_brace_in_namespace_declaration = true; -// this.insert_space_before_opening_bracket_in_array_allocation_expression = false; -// this.insert_space_before_opening_bracket_in_array_reference = false; -// this.insert_space_before_opening_bracket_in_array_type_reference = false; -// this.insert_space_before_opening_paren_in_catch = true; + this.insert_space_before_opening_bracket = false; + this.insert_space_before_opening_paren_in_catch = true; this.insert_space_before_opening_paren_in_for = true; this.insert_space_before_opening_paren_in_if = true; this.insert_space_before_opening_paren_in_method_invocation = false; this.insert_space_before_opening_paren_in_method_declaration = false; this.insert_space_before_opening_paren_in_switch = true; -// this.insert_space_before_opening_paren_in_parenthesized_expression = false; + this.insert_space_before_opening_paren_in_parenthesized_expression = false; this.insert_space_before_opening_paren_in_while = true; -// this.insert_space_before_postfix_operator = false; -// this.insert_space_before_prefix_operator = false; + this.insert_space_before_postfix_operator = false; + this.insert_space_before_prefix_operator = false; this.insert_space_before_question_in_conditional = true; this.insert_space_before_semicolon = false; this.insert_space_before_semicolon_in_for = false; -// this.insert_space_before_unary_operator = false; -// this.insert_space_between_brackets_in_array_type_reference = false; - this.insert_space_between_empty_braces_in_array_initializer = false; -// this.insert_space_between_empty_brackets_in_array_allocation_expression = false; + this.insert_space_before_unary_operator = false; + this.insert_space_between_empty_braces_in_initializer_list = false; + this.insert_space_between_empty_brackets = false; this.insert_space_between_empty_parens_in_method_declaration = false; -// this.insert_space_between_empty_parens_in_method_invocation = false; + this.insert_space_between_empty_parens_in_method_invocation = false; this.compact_else_if = true; this.keep_guardian_clause_on_one_line = false; this.keep_else_statement_on_same_line = false; - this.keep_empty_array_initializer_on_one_line = false; + this.keep_empty_initializer_list_on_one_line = false; this.keep_simple_if_on_one_line = false; this.keep_then_statement_on_same_line = false; this.number_of_empty_lines_to_preserve = 1; @@ -1642,7 +1586,7 @@ public class DefaultCodeFormatterOptions { */ public void setAllmanSettings() { setDefaultSettings(); - this.brace_position_for_array_initializer = DefaultCodeFormatterConstants.NEXT_LINE; + this.brace_position_for_initializer_list = DefaultCodeFormatterConstants.NEXT_LINE; this.brace_position_for_block = DefaultCodeFormatterConstants.NEXT_LINE; this.brace_position_for_block_in_case = DefaultCodeFormatterConstants.NEXT_LINE; // this.brace_position_for_enum_declaration = DefaultCodeFormatterConstants.NEXT_LINE; @@ -1662,10 +1606,10 @@ public class DefaultCodeFormatterOptions { this.indent_switchstatements_compare_to_switch = false; this.indentation_size = 4; - this.insert_new_line_after_opening_brace_in_array_initializer = false; + this.insert_new_line_after_opening_brace_in_initializer_list = false; this.insert_new_line_at_end_of_file_if_missing = false; // this.insert_new_line_before_catch_in_try_statement = false; - this.insert_new_line_before_closing_brace_in_array_initializer = false; + this.insert_new_line_before_closing_brace_in_initializer_list = false; this.insert_new_line_before_else_in_if_statement = true; // this.insert_new_line_before_finally_in_try_statement = false; this.insert_new_line_before_while_in_do_statement = false; @@ -1677,7 +1621,7 @@ public class DefaultCodeFormatterOptions { this.compact_else_if = true; this.keep_guardian_clause_on_one_line = false; this.keep_else_statement_on_same_line = false; - this.keep_empty_array_initializer_on_one_line = false; + this.keep_empty_initializer_list_on_one_line = false; this.keep_simple_if_on_one_line = false; this.keep_then_statement_on_same_line = false; this.number_of_empty_lines_to_preserve = 1; @@ -1712,7 +1656,7 @@ public class DefaultCodeFormatterOptions { */ public void setGNUSettings() { setDefaultSettings(); - this.brace_position_for_array_initializer = DefaultCodeFormatterConstants.NEXT_LINE_SHIFTED; + this.brace_position_for_initializer_list = DefaultCodeFormatterConstants.NEXT_LINE_SHIFTED; this.brace_position_for_block = DefaultCodeFormatterConstants.NEXT_LINE_SHIFTED; this.brace_position_for_block_in_case = DefaultCodeFormatterConstants.NEXT_LINE_SHIFTED; // this.brace_position_for_enum_declaration = DefaultCodeFormatterConstants.NEXT_LINE_SHIFTED; @@ -1732,10 +1676,10 @@ public class DefaultCodeFormatterOptions { this.indent_switchstatements_compare_to_switch = false; this.indentation_size = 8; - this.insert_new_line_after_opening_brace_in_array_initializer = false; + this.insert_new_line_after_opening_brace_in_initializer_list = false; this.insert_new_line_at_end_of_file_if_missing = false; // this.insert_new_line_before_catch_in_try_statement = false; - this.insert_new_line_before_closing_brace_in_array_initializer = false; + this.insert_new_line_before_closing_brace_in_initializer_list = false; this.insert_new_line_before_else_in_if_statement = true; // this.insert_new_line_before_finally_in_try_statement = false; this.insert_new_line_before_while_in_do_statement = false; @@ -1747,7 +1691,7 @@ public class DefaultCodeFormatterOptions { this.compact_else_if = true; this.keep_guardian_clause_on_one_line = false; this.keep_else_statement_on_same_line = false; - this.keep_empty_array_initializer_on_one_line = false; + this.keep_empty_initializer_list_on_one_line = false; this.keep_simple_if_on_one_line = false; this.keep_then_statement_on_same_line = false; this.number_of_empty_lines_to_preserve = 1; @@ -1780,9 +1724,9 @@ public class DefaultCodeFormatterOptions { */ public void setWhitesmitsSettings() { setDefaultSettings(); - this.alignment_for_expressions_in_array_initializer = Alignment.M_ONE_PER_LINE_SPLIT; + this.alignment_for_expressions_in_initializer_list = Alignment.M_ONE_PER_LINE_SPLIT; - this.brace_position_for_array_initializer = DefaultCodeFormatterConstants.NEXT_LINE_SHIFTED; + this.brace_position_for_initializer_list = DefaultCodeFormatterConstants.NEXT_LINE_SHIFTED; this.brace_position_for_block = DefaultCodeFormatterConstants.NEXT_LINE_SHIFTED; this.brace_position_for_block_in_case = DefaultCodeFormatterConstants.NEXT_LINE_SHIFTED; this.brace_position_for_method_declaration = DefaultCodeFormatterConstants.NEXT_LINE_SHIFTED; @@ -1800,10 +1744,10 @@ public class DefaultCodeFormatterOptions { this.indent_switchstatements_compare_to_switch = false; this.indentation_size = 4; - this.insert_new_line_after_opening_brace_in_array_initializer = true; + this.insert_new_line_after_opening_brace_in_initializer_list = true; this.insert_new_line_at_end_of_file_if_missing = false; // this.insert_new_line_before_catch_in_try_statement = true; - this.insert_new_line_before_closing_brace_in_array_initializer = true; + this.insert_new_line_before_closing_brace_in_initializer_list = true; this.insert_new_line_before_else_in_if_statement = true; // this.insert_new_line_before_finally_in_try_statement = true; this.insert_new_line_before_while_in_do_statement = true; @@ -1815,7 +1759,7 @@ public class DefaultCodeFormatterOptions { this.compact_else_if = false; this.keep_guardian_clause_on_one_line = false; this.keep_else_statement_on_same_line = false; - this.keep_empty_array_initializer_on_one_line = false; + this.keep_empty_initializer_list_on_one_line = false; this.keep_simple_if_on_one_line = false; this.keep_then_statement_on_same_line = false; this.number_of_empty_lines_to_preserve = 1; diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/formatter/Scribe.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/formatter/Scribe.java index d9d79dcfdee..b8ecdaa8818 100644 --- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/formatter/Scribe.java +++ b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/formatter/Scribe.java @@ -32,91 +32,76 @@ import org.eclipse.text.edits.TextEdit; * @since 4.0 */ public class Scribe { - public static final String EMPTY_STRING= ""; //$NON-NLS-1$ + + private static final String EMPTY_STRING= ""; //$NON-NLS-1$ + private static final String SPACE= " "; //$NON-NLS-1$ private static final int INITIAL_SIZE= 100; - private boolean checkLineWrapping; + private final DefaultCodeFormatterOptions preferences; + public final Scanner scanner; /** one-based column */ public int column= 1; // Most specific alignment. public Alignment currentAlignment; + public Alignment memberAlignment; public Token currentToken; // edits management private OptimizedReplaceEdit[] edits; - public int editsIndex; - public CodeFormatterVisitor formatter; - public int indentationLevel; - - public int lastNumberOfNewLines; - - public int line; - - private String lineSeparator; - - public Alignment memberAlignment; - - public boolean needSpace= false; - - public int pageWidth; - - public boolean pendingSpace= false; - - public Scanner scanner; - - public int scannerEndPosition; - - public int tabLength; - + public int numberOfIndentations; public int indentationSize; - private int textRegionEnd; - - private int textRegionStart; - - public int tabChar; - - public int numberOfIndentations; - - private boolean useTabsOnlyForLeadingIndents; - - /** indent empty lines */ + private final String lineSeparator; private final boolean indentEmptyLines; + private final int pageWidth; + private boolean preserveNewLines; + private boolean checkLineWrapping; + public int lastNumberOfNewLines; + public int line; - private boolean preserveNewlines; + public boolean needSpace= false; + public boolean pendingSpace= false; + + public int tabLength; + public int tabChar; + private final boolean useTabsOnlyForLeadingIndents; + + private int textRegionEnd; + private int textRegionStart; + public int scannerEndPosition; private List fSkipPositions= Collections.emptyList(); private boolean skipOverInactive; - private int fSkipTokensFrom= Integer.MAX_VALUE; - private int fSkipTokensTo; + private int fSkipStartOffset= Integer.MAX_VALUE; + private int fSkipEndOffset; private int fSkippedIndentations; Scribe(CodeFormatterVisitor formatter, int offset, int length) { scanner= new Scanner(); - this.formatter= formatter; - pageWidth= formatter.preferences.page_width; - tabLength= formatter.preferences.tab_size; + preferences= formatter.preferences; + pageWidth= preferences.page_width; + tabLength= preferences.tab_size; indentationLevel= 0; // initialize properly numberOfIndentations= 0; - useTabsOnlyForLeadingIndents= formatter.preferences.use_tabs_only_for_leading_indentations; - indentEmptyLines= formatter.preferences.indent_empty_lines; - tabChar= formatter.preferences.tab_char; + useTabsOnlyForLeadingIndents= preferences.use_tabs_only_for_leading_indentations; + indentEmptyLines= preferences.indent_empty_lines; + tabChar= preferences.tab_char; if (tabChar == DefaultCodeFormatterOptions.MIXED) { - indentationSize= formatter.preferences.indentation_size; + indentationSize= preferences.indentation_size; } else { indentationSize= tabLength; } - lineSeparator= formatter.preferences.line_separator; - indentationLevel= formatter.preferences.initial_indentation_level * indentationSize; + lineSeparator= preferences.line_separator; + indentationLevel= preferences.initial_indentation_level * indentationSize; textRegionStart= offset; textRegionEnd= offset + length - 1; reset(); @@ -242,7 +227,7 @@ public class Scribe { public Alignment createAlignment(String name, int mode, int tieBreakRule, int count, int sourceRestart) { return createAlignment(name, mode, tieBreakRule, count, sourceRestart, - formatter.preferences.continuation_indentation, false); + preferences.continuation_indentation, false); } public Alignment createAlignment(String name, int mode, int count, int sourceRestart, int continuationIndent, @@ -473,13 +458,13 @@ public class Scribe { private String getPreserveEmptyLines(int count) { if (count > 0) { - if (formatter.preferences.number_of_empty_lines_to_preserve != 0) { - int linesToPreserve= Math.min(count, formatter.preferences.number_of_empty_lines_to_preserve); + if (preferences.number_of_empty_lines_to_preserve != 0) { + int linesToPreserve= Math.min(count, preferences.number_of_empty_lines_to_preserve); return getEmptyLines(linesToPreserve); } else { return getNewLine(); } - } else if (preserveNewlines) { + } else if (preserveNewLines) { return getNewLine(); } return EMPTY_STRING; @@ -604,8 +589,8 @@ public class Scribe { private void preserveEmptyLines(int count, int insertPosition) { if (count > 0) { - if (formatter.preferences.number_of_empty_lines_to_preserve != 0) { - int linesToPreserve= Math.min(count, formatter.preferences.number_of_empty_lines_to_preserve); + if (preferences.number_of_empty_lines_to_preserve != 0) { + int linesToPreserve= Math.min(count, preferences.number_of_empty_lines_to_preserve); printEmptyLines(linesToPreserve, insertPosition); } else { printNewLine(insertPosition); @@ -619,29 +604,31 @@ public class Scribe { if (length <= 0) { return; } - if (shouldSkip(scanner.getCurrentPosition())) { + int currentPosition= scanner.getCurrentPosition(); + if (shouldSkip(currentPosition)) { return; } - if (startOffset > scanner.getCurrentPosition()) { + if (startOffset > currentPosition) { printComment(); + currentPosition= scanner.getCurrentPosition(); } if (pendingSpace) { - addInsertEdit(scanner.getCurrentPosition(), " "); //$NON-NLS-1$ + addInsertEdit(currentPosition, SPACE); pendingSpace= false; needSpace= false; } - if (startOffset + length < scanner.getCurrentPosition()) { + if (startOffset + length < currentPosition) { // don't move backwards return; } - boolean savedPreserveNL= preserveNewlines; + boolean savedPreserveNL= preserveNewLines; boolean savedSkipOverInactive= skipOverInactive; int savedScannerEndPos= scannerEndPosition; - preserveNewlines= true; + preserveNewLines= true; skipOverInactive= false; scannerEndPosition= startOffset + length; try { - scanner.resetTo(Math.max(startOffset, scanner.getCurrentPosition()), startOffset + length - 1); + scanner.resetTo(Math.max(startOffset, currentPosition), startOffset + length - 1); int parenLevel= 0; boolean lastTokenWasGT= false; while (true) { @@ -655,36 +642,32 @@ public class Scribe { break; } if (pendingSpace) { - addInsertEdit(scanner.getCurrentTokenStartPosition(), " "); //$NON-NLS-1$ + addInsertEdit(scanner.getCurrentTokenStartPosition(), SPACE); pendingSpace= false; needSpace= false; } switch (currentToken.type) { case Token.tLBRACE: { -// int currentPosition= scanner.getCurrentPosition(); scanner.resetTo(scanner.getCurrentTokenStartPosition(), scannerEndPosition-1); - formatOpeningBrace(formatter.preferences.brace_position_for_block, formatter.preferences.insert_space_before_opening_brace_in_block); - if (formatter.preferences.indent_statements_compare_to_block) { + formatOpeningBrace(preferences.brace_position_for_block, preferences.insert_space_before_opening_brace_in_block); + if (preferences.indent_statements_compare_to_block) { indent(); } -// scanner.resetTo(currentPosition, scannerEndPosition-1); break; } case Token.tRBRACE: { -// int currentPosition= scanner.getCurrentPosition(); scanner.resetTo(scanner.getCurrentTokenStartPosition(), scannerEndPosition-1); - if (formatter.preferences.indent_statements_compare_to_block) { + if (preferences.indent_statements_compare_to_block) { unIndent(); } - formatClosingBrace(formatter.preferences.brace_position_for_block); -// scanner.resetTo(currentPosition, scannerEndPosition-1); + formatClosingBrace(preferences.brace_position_for_block); break; } case Token.tLPAREN: ++parenLevel; print(currentToken.getLength(), hasWhitespace); if (parenLevel > 0) { - for (int i= 0; i < formatter.preferences.continuation_indentation; i++) { + for (int i= 0; i < preferences.continuation_indentation; i++) { indent(); } // HACK: avoid indent in same line @@ -694,7 +677,7 @@ public class Scribe { case Token.tRPAREN: --parenLevel; if (parenLevel >= 0) { - for (int i= 0; i < formatter.preferences.continuation_indentation; i++) { + for (int i= 0; i < preferences.continuation_indentation; i++) { unIndent(); } } @@ -707,11 +690,11 @@ public class Scribe { isGT= true; break; case Token.tSEMI: - print(currentToken.getLength(), formatter.preferences.insert_space_before_semicolon); + print(currentToken.getLength(), preferences.insert_space_before_semicolon); break; - case Token.t_else: case Token.t_catch: - if (formatter.preferences.insert_new_line_before_else_in_if_statement) { + case Token.t_else: + if (preferences.insert_new_line_before_else_in_if_statement) { printNewLine(currentToken.offset); } else { hasWhitespace= true; @@ -720,7 +703,7 @@ public class Scribe { break; default: if (currentToken.isVisibilityModifier() - && !formatter.preferences.indent_access_specifier_compare_to_type_header) { + && !preferences.indent_access_specifier_compare_to_type_header) { int indentLevel= indentationLevel; if (indentationLevel > 0) unIndent(); @@ -739,11 +722,11 @@ public class Scribe { scannerEndPosition= savedScannerEndPos; scanner.resetTo(startOffset + length, scannerEndPosition - 1); skipOverInactive= savedSkipOverInactive; - preserveNewlines= savedPreserveNL; + preserveNewLines= savedPreserveNL; } } - private void formatOpeningBrace(String bracePosition, boolean insertSpaceBeforeBrace) { + public void formatOpeningBrace(String bracePosition, boolean insertSpaceBeforeBrace) { if (DefaultCodeFormatterConstants.NEXT_LINE.equals(bracePosition)) { printNewLine(); } else if (DefaultCodeFormatterConstants.NEXT_LINE_SHIFTED.equals(bracePosition)) { @@ -755,7 +738,7 @@ public class Scribe { printTrailingComment(); } - private void formatClosingBrace(String block_brace_position) { + public void formatClosingBrace(String block_brace_position) { printNextToken(Token.tRBRACE); printTrailingComment(); if (DefaultCodeFormatterConstants.NEXT_LINE_SHIFTED.equals(block_brace_position)) { @@ -776,7 +759,7 @@ public class Scribe { space(); } if (pendingSpace) { - addInsertEdit(scanner.getCurrentTokenStartPosition(), " "); //$NON-NLS-1$ + addInsertEdit(scanner.getCurrentTokenStartPosition(), SPACE); } pendingSpace= false; column+= length; @@ -794,7 +777,7 @@ public class Scribe { int nextCharacterStart= currentTokenStartPosition; printIndentationIfNecessary(); if (pendingSpace) { - addInsertEdit(currentTokenStartPosition, " "); //$NON-NLS-1$ + addInsertEdit(currentTokenStartPosition, SPACE); } needSpace= false; pendingSpace= false; @@ -978,7 +961,7 @@ public class Scribe { } else if (hasLineComment) { preserveEmptyLines(count - 1, scanner.getCurrentTokenStartPosition()); addDeleteEdit(scanner.getCurrentTokenStartPosition(), scanner.getCurrentTokenEndPosition()); - } else if (count != 0 && formatter.preferences.number_of_empty_lines_to_preserve != 0) { + } else if (count != 0 && preferences.number_of_empty_lines_to_preserve != 0) { String preservedEmptyLines= getPreserveEmptyLines(count - 1); addReplaceEdit(scanner.getCurrentTokenStartPosition(), scanner.getCurrentTokenEndPosition(), preservedEmptyLines); @@ -1074,7 +1057,7 @@ public class Scribe { int nextCharacterStart= currentTokenStartPosition; printIndentationIfNecessary(); if (pendingSpace) { - addInsertEdit(currentTokenStartPosition, " "); //$NON-NLS-1$ + addInsertEdit(currentTokenStartPosition, SPACE); } needSpace= false; pendingSpace= false; @@ -1503,10 +1486,10 @@ public class Scribe { /** */ - public void printModifiers() { + public boolean printModifiers() { int currentTokenStartPosition= scanner.getCurrentPosition(); if (shouldSkip(currentTokenStartPosition)) { - return; + return false; } boolean isFirstModifier= true; boolean hasComment= false; @@ -1595,9 +1578,20 @@ public class Scribe { } // step back one token scanner.resetTo(currentTokenStartPosition, scannerEndPosition - 1); - return; + return !isFirstModifier; } } + return !isFirstModifier; + } + + public boolean preserveNewLine() { + boolean savedPreserveNewLines= preserveNewLines; + try { + preserveNewLines= true; + return printComment(); + } finally { + preserveNewLines= savedPreserveNewLines; + } } /** @@ -1658,48 +1652,61 @@ public class Scribe { } public boolean printCommentPreservingNewLines() { - final boolean savedPreserveNL= this.preserveNewlines; - this.preserveNewlines= true; + final boolean savedPreserveNL= this.preserveNewLines; + this.preserveNewLines= true; try { return printComment(); } finally { - this.preserveNewlines= savedPreserveNL; + this.preserveNewLines= savedPreserveNL; } } boolean shouldSkip(int offset) { - return offset >= fSkipTokensFrom && offset <= fSkipTokensTo; + return offset >= fSkipStartOffset && offset <= fSkipEndOffset; } void skipRange(int offset, int endOffset) { - if (offset == fSkipTokensFrom) { + if (offset == fSkipStartOffset) { return; } final int currentPosition= scanner.getCurrentPosition(); if (currentPosition >= offset && currentPosition < endOffset) { printRaw(offset, endOffset - offset); } - fSkipTokensFrom= offset; - fSkipTokensTo= endOffset; + fSkipStartOffset= offset; + fSkipEndOffset= endOffset; + } + + boolean skipRange() { + return fSkipEndOffset > 0; } void restartAtOffset(int offset) { - if (fSkipTokensTo > 0) { - fSkipTokensFrom= Integer.MAX_VALUE; - fSkipTokensTo= 0; + final int currentPosition= scanner.getCurrentPosition(); + if (fSkipEndOffset > 0) { + fSkipStartOffset= Integer.MAX_VALUE; + fSkipEndOffset= 0; while (fSkippedIndentations < 0) { unIndent(); fSkippedIndentations++; } - if (offset > scanner.getCurrentPosition()) { - printRaw(scanner.getCurrentPosition(), offset - scanner.getCurrentPosition()); + if (offset > currentPosition) { + printRaw(currentPosition, offset - currentPosition); scanner.resetTo(offset, scannerEndPosition - 1); } while (fSkippedIndentations > 0) { indent(); fSkippedIndentations--; } + } else if (offset > currentPosition) { + printComment(); + final int nextPosition= scanner.getCurrentPosition(); + if (offset > nextPosition) { + printRaw(nextPosition, offset - nextPosition); + scanner.resetTo(offset, scannerEndPosition - 1); + } } + } } diff --git a/core/org.eclipse.cdt.ui.tests/resources/formatter/bugs/After.cpp b/core/org.eclipse.cdt.ui.tests/resources/formatter/bugs/After.cpp index 986e6c031db..f6cb5823fd8 100644 --- a/core/org.eclipse.cdt.ui.tests/resources/formatter/bugs/After.cpp +++ b/core/org.eclipse.cdt.ui.tests/resources/formatter/bugs/After.cpp @@ -4,28 +4,28 @@ struct x { struct x getX() { } // https://bugs.eclipse.org/bugs/show_bug.cgi?id=171520 -int bug=sizeof(int); +int bug = sizeof(int); // https://bugs.eclipse.org/bugs/show_bug.cgi?id=173837 class ABaseClass { protected: ABaseClass(int x); }; -class AClass : public ABaseClass { +class AClass: public ABaseClass { AClass(int x) throw(int); void test1() const throw(int); void test2() throw(); }; AClass::AClass(int x) throw(int) : ABaseClass(x) { - for (int i=0; i < 12; i++) { + for (int i = 0; i < 12; i++) { } } // keep space between decl spec and declarator int main(int argc, char **argv) { } // handling of string concat -char* s1= "this " "is " "one " "string."; -char* s2= "this " "is " +char* s1 = "this " "is " "one " "string."; +char* s2 = "this " "is " "one " "string."; // macro definition with line comment #define ID(x) x // identity @@ -34,7 +34,7 @@ int main() { } // semicolons inside for void g() { - for (int i=0; i<10; ++i) { + for (int i = 0; i < 10; ++i) { } } // https://bugs.eclipse.org/bugs/show_bug.cgi?id=183220 @@ -43,18 +43,17 @@ void bug183220() { rtc_s2000_src_pending, rtc_s2000_cr_sync_pending, rtc_hdw_cr_sync_next, rtc_hdw_current_clock; int rtc_s2000_clock_source_state, RTC_CLOCK_PLL; - if (( ( rtc_hdw_cr_sync_next != rtc_hdw_cr_sync ) - || rtc_hdw_cr_resync_enable )&& !rtc_s2000_src_pending - && !rtc_s2000_cr_sync_pending) { + if (((rtc_hdw_cr_sync_next != rtc_hdw_cr_sync) || rtc_hdw_cr_resync_enable) + && !rtc_s2000_src_pending && !rtc_s2000_cr_sync_pending) { if (!identify_hdw_fvr_master() || !rtc_hdw_current_clock->external - || !rtc_hdw_cr_sync_next ||( ( rtc_hdw_current_clock->external + || !rtc_hdw_cr_sync_next || ((rtc_hdw_current_clock->external && rtc_hdw_cr_sync_next && rtc_s2000_clock_source_state - != RTC_CLOCK_PLL ) )) { + != RTC_CLOCK_PLL))) { } } } // declaration with array initializer -long dummy[]= { 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, +long dummy[] = { 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, diff --git a/core/org.eclipse.cdt.ui.tests/resources/formatter/bugs/Before.cpp b/core/org.eclipse.cdt.ui.tests/resources/formatter/bugs/Before.cpp index 30437af2f4b..70ba3bdacac 100644 --- a/core/org.eclipse.cdt.ui.tests/resources/formatter/bugs/Before.cpp +++ b/core/org.eclipse.cdt.ui.tests/resources/formatter/bugs/Before.cpp @@ -9,16 +9,16 @@ class AClass : public ABaseClass {AClass(int x) throw(int); void test1() const t AClass::AClass(int x)throw(int):ABaseClass(x){for (int i=0;i < 12;i++) {}} // keep space between decl spec and declarator int -main(int argc, char **argv) {} +main(int argc,char **argv) {} // handling of string concat char* s1= "this " "is " "one ""string."; char* s2= "this " "is " "one " "string."; // macro definition with line comment #define ID(x) x // identity -int main() {return ID(0);} +int main(){return ID(0);} // semicolons inside for -void g() {for(int i=0;i<10;++i){}} +void g(){for(int i=0;i<10;++i){}} // https://bugs.eclipse.org/bugs/show_bug.cgi?id=183220 void bug183220() { diff --git a/core/org.eclipse.cdt.ui.tests/resources/formatter/preview/After.cpp b/core/org.eclipse.cdt.ui.tests/resources/formatter/preview/After.cpp index 1d1714954f9..07d43c21b4d 100644 --- a/core/org.eclipse.cdt.ui.tests/resources/formatter/preview/After.cpp +++ b/core/org.eclipse.cdt.ui.tests/resources/formatter/preview/After.cpp @@ -44,11 +44,11 @@ int foo(int bar) const { /* * Line Wrapping */ -int array[]= { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 1000, - 2000, 3000, 4000, 5000 }; -int compare(int argument, int otherArgument) { - return argument+otherArgument > argument*otherArgument+1000000 ? 100000 - +50000 : 200000-30000; +int array[] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, + 1000, 2000, 3000, 4000, 5000 }; +int compare(int argument, int otherArg) { + return argument + otherArg > argument * otherArg + 1000000 ? 100000 + 50000 + : 200000 - 30000; } class Other { static void bar(int arg1, int arg2, int arg3, int arg4, int arg5, int arg6, @@ -59,3 +59,21 @@ void foo() { Other::bar(100000, 200000, 300000, 400000, 500000, 600000, 700000, 800000, 900000); } +enum EEEE { + ONE, + TWO, + THREE, + FOUR, + FIVE, + SIX, + SEVEN = 7, + EIGHT, + NINE, + TEN, + HUNDRED, + THOUSAND, + AMILLION +}; +template class map { +}; +map m; diff --git a/core/org.eclipse.cdt.ui.tests/resources/formatter/preview/Before.cpp b/core/org.eclipse.cdt.ui.tests/resources/formatter/preview/Before.cpp index 97138157acc..461ecc0a9cc 100644 --- a/core/org.eclipse.cdt.ui.tests/resources/formatter/preview/Before.cpp +++ b/core/org.eclipse.cdt.ui.tests/resources/formatter/preview/Before.cpp @@ -7,6 +7,8 @@ class Point {public:Point(double xc, double yc) : x(xc), y(yc) {}double distance * Line Wrapping */ int array[]= {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 1000, 2000, 3000, 4000, 5000}; -int compare(int argument, int otherArgument) {return argument+otherArgument > argument*otherArgument+1000000 ? 100000+50000 : 200000-30000;} +int compare(int argument, int otherArg) {return argument+otherArg > argument*otherArg+1000000 ? 100000+50000 : 200000-30000;} class Other {static void bar(int arg1, int arg2, int arg3, int arg4, int arg5, int arg6, int arg7, int arg8, int arg9) {}}; void foo() {Other::bar(100000, 200000, 300000, 400000, 500000, 600000, 700000, 800000, 900000);} +enum EEEE{ONE,TWO,THREE,FOUR,FIVE,SIX,SEVEN=7,EIGHT,NINE,TEN,HUNDRED,THOUSAND,AMILLION}; +template class map {};map m; diff --git a/core/org.eclipse.cdt.ui.tests/resources/formatter/sample/After.cpp b/core/org.eclipse.cdt.ui.tests/resources/formatter/sample/After.cpp index da4d8fe71ee..89ede2db0a6 100644 --- a/core/org.eclipse.cdt.ui.tests/resources/formatter/sample/After.cpp +++ b/core/org.eclipse.cdt.ui.tests/resources/formatter/sample/After.cpp @@ -4,7 +4,7 @@ struct SimpleStruct { int num; - char name[ ]; + char name[]; float floatNum; }; diff --git a/core/org.eclipse.cdt.ui.tests/resources/formatter/sample/Before.cpp b/core/org.eclipse.cdt.ui.tests/resources/formatter/sample/Before.cpp index 772cee09500..5a012a8591d 100644 --- a/core/org.eclipse.cdt.ui.tests/resources/formatter/sample/Before.cpp +++ b/core/org.eclipse.cdt.ui.tests/resources/formatter/sample/Before.cpp @@ -5,7 +5,7 @@ struct SimpleStruct { int num; - char name[ ]; + char name [ ]; float floatNum; }; diff --git a/core/org.eclipse.cdt.ui.tests/resources/formatter/templates/After.cpp b/core/org.eclipse.cdt.ui.tests/resources/formatter/templates/After.cpp index 1fcaa2a11cd..e82c29c4db3 100644 --- a/core/org.eclipse.cdt.ui.tests/resources/formatter/templates/After.cpp +++ b/core/org.eclipse.cdt.ui.tests/resources/formatter/templates/After.cpp @@ -11,7 +11,8 @@ class Foo { }; // TEMPLATE_STRUCT -template struct Map { +template +struct Map { Key* keys; Value* values; SortAlgorithm* sortAlgorithm; @@ -25,7 +26,7 @@ private: public: nonVector() { - head =new T(); + head = new T(); } int length() { return 1; @@ -34,7 +35,8 @@ public: }; // TEMPLATE_UNION -template union ArrayOverlay { +template +union ArrayOverlay { public: X x[size]; Y y[size]; @@ -46,7 +48,8 @@ public: class TemplateContainer { // these are in an enclosing class template void fum(int i); - template void scrum(void) { + template + void scrum(void) { } ; }; @@ -62,12 +65,11 @@ template void Foo::fum(int i) { } // TEMPLATE_VARIABLES -template char +template char * default_alloc_template::S_start_free = 0; // an instantiation, not a template: -complex - cf(0, 0); +complex cf(0, 0); //template > //Dictionary* TheSpellCheckDictionary; diff --git a/core/org.eclipse.cdt.ui.tests/resources/formatter/templates/Before.cpp b/core/org.eclipse.cdt.ui.tests/resources/formatter/templates/Before.cpp index 6873eca767e..09696f13e9a 100644 --- a/core/org.eclipse.cdt.ui.tests/resources/formatter/templates/Before.cpp +++ b/core/org.eclipse.cdt.ui.tests/resources/formatter/templates/Before.cpp @@ -25,7 +25,7 @@ template class nonVector { private: T* head; public: - nonVector() {head =new T();} + nonVector() {head=new T();} int length() {return 1;} const T& first() const; }; diff --git a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/CHeuristicScannerTest.java b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/CHeuristicScannerTest.java index f84629e60c1..684ef69fb85 100644 --- a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/CHeuristicScannerTest.java +++ b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/CHeuristicScannerTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 IBM Corporation and others. + * Copyright (c) 2000, 2008 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -56,7 +56,7 @@ public class CHeuristicScannerTest extends TestCase { final String indentOnColumn= DefaultCodeFormatterConstants.createAlignmentValue(false, DefaultCodeFormatterConstants.WRAP_NO_SPLIT, DefaultCodeFormatterConstants.INDENT_ON_COLUMN); options.put(DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_PARAMETERS_IN_METHOD_DECLARATION, indentOnColumn); - options.put(DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_EXPRESSIONS_IN_ARRAY_INITIALIZER, indentOnColumn); + options.put(DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_EXPRESSIONS_IN_INITIALIZER_LIST, indentOnColumn); options.put(DefaultCodeFormatterConstants.FORMATTER_CONTINUATION_INDENTATION, "1"); CCorePlugin.setOptions(options); } diff --git a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/CodeFormatterTest.java b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/CodeFormatterTest.java index ebe74289424..11bdeecbfa3 100644 --- a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/CodeFormatterTest.java +++ b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/CodeFormatterTest.java @@ -104,7 +104,7 @@ public class CodeFormatterTest extends BaseUITestCase { // switch (confusefomatter) { // // case START_CONFUSION: - // SomeFunctionCallWithTypecast(( castConfusion_t)myvar1, + // SomeFunctionCallWithTypecast((castConfusion_t) myvar1, // (castNoAdditionalConfusion_t) myvar2); // break; // @@ -171,7 +171,7 @@ public class CodeFormatterTest extends BaseUITestCase { //void foo() { // for (;;) { - // int a=0; + // int a = 0; // switch (a) { // case 0: // ++a; @@ -380,7 +380,7 @@ public class CodeFormatterTest extends BaseUITestCase { // indentation_remains(); // } // - // if (b>a) + // if (b > a) // indentation_vanishes(); // // break_end(); @@ -391,4 +391,76 @@ public class CodeFormatterTest extends BaseUITestCase { public void testBracesInMacros_Bug217435() throws Exception { assertFormatterResult(); } + + //int a=1+2; + //int b= - a; + //int c =b ++/-- b; + + //int a = 1 + 2; + //int b = -a; + //int c = b++ / --b; + public void testWhitespaceSurroundingOperators() throws Exception { + assertFormatterResult(); + } + + //void f() { + //int *px= :: new int( 0 ); + //int py [] = new int [5 ] (0, 1,2,3, 4); + //int *pz[ ] =new ( px)int(0); + //delete [] py; + //:: delete px;} + + //void f() { + // int *px = ::new int(0); + // int py[] = new int[5](0, 1, 2, 3, 4); + // int *pz[] = new(px) int(0); + // delete[] py; + // ::delete px; + //} + public void testNewAndDeleteExpressions() throws Exception { + assertFormatterResult(); + } + + //namespace X= + // Y :: + // Z ; + + //namespace X = Y::Z; + public void testNamespaceAlias() throws Exception { + assertFormatterResult(); + } + + //using + // typename:: T + //; + //using X:: + // T ; + + //using typename ::T; + //using X::T; + public void testUsingDeclaration() throws Exception { + assertFormatterResult(); + } + + //using + // namespace + // X ; + + //using namespace X; + public void testUsingDirective() throws Exception { + assertFormatterResult(); + } + + //static void *f(){} + //static void * g(); + //static void* h(); + + //static void *f() { + //} + //static void * g(); + //static void* h(); + public void testSpaceBetweenDeclSpecAndDeclarator() throws Exception { + assertFormatterResult(); + } + } diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/formatter/BracesTabPage.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/formatter/BracesTabPage.java index ba05964f83c..af248e3dd12 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/formatter/BracesTabPage.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/formatter/BracesTabPage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 IBM Corporation and others. + * Copyright (c) 2000, 2008 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -21,7 +21,7 @@ import org.eclipse.swt.widgets.Group; import org.eclipse.cdt.core.formatter.DefaultCodeFormatterConstants; -public class BracesTabPage extends ModifyDialogTabPage { +public class BracesTabPage extends FormatterTabPage { /** * Constant array for boolean selection @@ -134,8 +134,8 @@ public class BracesTabPage extends ModifyDialogTabPage { createExtendedBracesCombo(group, numColumns, FormatterMessages.BracesTabPage_option_blocks_in_case, DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK_IN_CASE); createBracesCombo(group, numColumns, FormatterMessages.BracesTabPage_option_switch_case, DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH); - ComboPreference arrayInitOption= createBracesCombo(group, numColumns, FormatterMessages.BracesTabPage_option_array_initializer, DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ARRAY_INITIALIZER); - final CheckboxPreference arrayInitCheckBox= createIndentedCheckboxPref(group, numColumns, FormatterMessages.BracesTabPage_option_keep_empty_array_initializer_on_one_line, DefaultCodeFormatterConstants.FORMATTER_KEEP_EMPTY_ARRAY_INITIALIZER_ON_ONE_LINE, FALSE_TRUE); + ComboPreference arrayInitOption= createBracesCombo(group, numColumns, FormatterMessages.BracesTabPage_option_initializer_list, DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_INITIALIZER_LIST); + final CheckboxPreference arrayInitCheckBox= createIndentedCheckboxPref(group, numColumns, FormatterMessages.BracesTabPage_option_keep_empty_initializer_list_on_one_line, DefaultCodeFormatterConstants.FORMATTER_KEEP_EMPTY_INITIALIZER_LIST_ON_ONE_LINE, FALSE_TRUE); arrayInitOption.addObserver(new Observer() { public void update(Observable o, Object arg) { diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/formatter/CPreview.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/formatter/CPreview.java index ce41d04a76b..d3c64519c33 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/formatter/CPreview.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/formatter/CPreview.java @@ -42,7 +42,6 @@ import org.eclipse.cdt.ui.PreferenceConstants; import org.eclipse.cdt.ui.text.ICPartitions; import org.eclipse.cdt.internal.ui.editor.CSourceViewer; -import org.eclipse.cdt.internal.ui.text.CSourceViewerConfiguration; import org.eclipse.cdt.internal.ui.text.CTextTools; import org.eclipse.cdt.internal.ui.text.SimpleCSourceViewerConfiguration; @@ -90,7 +89,7 @@ public abstract class CPreview { } } - protected final CSourceViewerConfiguration fViewerConfiguration; + protected final SimpleCSourceViewerConfiguration fViewerConfiguration; protected final Document fPreviewDocument; protected final SourceViewer fSourceViewer; protected final IPreferenceStore fPreferenceStore; @@ -100,7 +99,7 @@ public abstract class CPreview { protected Map fWorkingValues; private int fTabSize= 0; - private WhitespaceCharacterPainter fWhitespacePainter; + private WhitespaceCharacterPainter fWhitespaceCharacterPainter; /** * Create a new C preview @@ -126,9 +125,7 @@ public abstract class CPreview { final RGB rgb= PreferenceConverter.getColor(fPreferenceStore, AbstractDecoratedTextEditorPreferenceConstants.EDITOR_PRINT_MARGIN_COLOR); fMarginPainter.setMarginRulerColor(tools.getColorManager().getColor(rgb)); fSourceViewer.addPainter(fMarginPainter); - - fWhitespacePainter= new WhitespaceCharacterPainter(fSourceViewer); - + new CSourcePreviewerUpdater(); fSourceViewer.setDocument(fPreviewDocument); } @@ -193,24 +190,26 @@ public abstract class CPreview { return defaultValue; } - public final Map getWorkingValues() { + + + public Map getWorkingValues() { return fWorkingValues; } - public final void setWorkingValues(Map workingValues) { + + public void setWorkingValues(Map workingValues) { fWorkingValues= workingValues; } - - /** - * Enable/disable display of whitespace characters. - * - * @param show flag, whether to display whitespace - */ - public void showWhitespace(boolean show) { - if (show) { - fSourceViewer.addPainter(fWhitespacePainter); + + public void showInvisibleCharacters(boolean enable) { + if (enable) { + if (fWhitespaceCharacterPainter == null) { + fWhitespaceCharacterPainter= new WhitespaceCharacterPainter(fSourceViewer); + fSourceViewer.addPainter(fWhitespaceCharacterPainter); + } } else { - fSourceViewer.removePainter(fWhitespacePainter); + fSourceViewer.removePainter(fWhitespaceCharacterPainter); + fWhitespaceCharacterPainter= null; } } } diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/formatter/FormatterMessages.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/formatter/FormatterMessages.java index cc8e11ce228..6561e8b8058 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/formatter/FormatterMessages.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/formatter/FormatterMessages.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 IBM Corporation and others. + * Copyright (c) 2000, 2008 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -25,6 +25,7 @@ final class FormatterMessages extends NLS { // Do not instantiate } + public static String FormatterTabPage_ShowInvisibleCharacters_label; public static String ModifyDialog_BuiltIn_Status; public static String ModifyDialog_Duplicate_Status; public static String ModifyDialog_EmptyName_Status; @@ -33,245 +34,187 @@ final class FormatterMessages extends NLS { public static String ModifyDialog_ProfileName_Label; public static String ModifyDialog_Shared_Status; public static String ProfileConfigurationBlock_load_profile_wrong_profile_message; -// public static String WhiteSpaceTabPage_assignments; -// public static String WhiteSpaceTabPage_assignments_before_assignment_operator; -// public static String WhiteSpaceTabPage_assignments_after_assignment_operator; -// public static String WhiteSpaceTabPage_operators; -// public static String WhiteSpaceTabPage_operators_before_binary_operators; -// public static String WhiteSpaceTabPage_operators_after_binary_operators; -// public static String WhiteSpaceTabPage_operators_before_unary_operators; -// public static String WhiteSpaceTabPage_operators_after_unary_operators; -// public static String WhiteSpaceTabPage_operators_before_prefix_operators; -// public static String WhiteSpaceTabPage_operators_after_prefix_operators; -// public static String WhiteSpaceTabPage_operators_before_postfix_operators; -// public static String WhiteSpaceTabPage_operators_after_postfix_operators; -// public static String WhiteSpaceTabPage_classes; -// public static String WhiteSpaceTabPage_classes_before_opening_brace_of_a_class; -// public static String WhiteSpaceTabPage_classes_before_opening_brace_of_anon_class; -// public static String WhiteSpaceTabPage_classes_before_comma_implements; -// public static String WhiteSpaceTabPage_classes_after_comma_implements; -// public static String WhiteSpaceTabPage_methods; -// public static String WhiteSpaceTabPage_constructors; -// public static String WhiteSpaceTabPage_fields; -// public static String WhiteSpaceTabPage_fields_before_comma; -// public static String WhiteSpaceTabPage_fields_after_comma; -// public static String WhiteSpaceTabPage_localvars; -// public static String WhiteSpaceTabPage_localvars_before_comma; -// public static String WhiteSpaceTabPage_localvars_after_comma; -// public static String WhiteSpaceTabPage_arrayinit; -// public static String WhiteSpaceTabPage_arraydecls; -// public static String WhiteSpaceTabPage_arrayelem; -// public static String WhiteSpaceTabPage_arrayalloc; -// public static String WhiteSpaceTabPage_calls; -// public static String WhiteSpaceTabPage_calls_before_comma_in_method_args; -// public static String WhiteSpaceTabPage_calls_after_comma_in_method_args; + public static String WhiteSpaceTabPage_assignments; + public static String WhiteSpaceTabPage_assignments_before_assignment_operator; + public static String WhiteSpaceTabPage_assignments_after_assignment_operator; + public static String WhiteSpaceTabPage_operators; + public static String WhiteSpaceTabPage_operators_before_binary_operators; + public static String WhiteSpaceTabPage_operators_after_binary_operators; + public static String WhiteSpaceTabPage_operators_before_unary_operators; + public static String WhiteSpaceTabPage_operators_after_unary_operators; + public static String WhiteSpaceTabPage_operators_before_prefix_operators; + public static String WhiteSpaceTabPage_operators_after_prefix_operators; + public static String WhiteSpaceTabPage_operators_before_postfix_operators; + public static String WhiteSpaceTabPage_operators_after_postfix_operators; + public static String WhiteSpaceTabPage_classes; + public static String WhiteSpaceTabPage_classes_before_opening_brace_of_a_class; + public static String WhiteSpaceTabPage_classes_before_colon_of_base_clause; + public static String WhiteSpaceTabPage_classes_after_colon_of_base_clause; + public static String WhiteSpaceTabPage_classes_before_comma_base_types; + public static String WhiteSpaceTabPage_classes_after_comma_base_types; + public static String WhiteSpaceTabPage_methods; + public static String WhiteSpaceTabPage_constructors; + public static String WhiteSpaceTabPage_declarator_list; + public static String WhiteSpaceTabPage_declarator_list_before_comma; + public static String WhiteSpaceTabPage_declarator_list_after_comma; + public static String WhiteSpaceTabPage_expression_list; + public static String WhiteSpaceTabPage_expression_list_before_comma; + public static String WhiteSpaceTabPage_expression_list_after_comma; + public static String WhiteSpaceTabPage_initializer_list; + public static String WhiteSpaceTabPage_calls; + public static String WhiteSpaceTabPage_calls_before_comma_in_method_args; + public static String WhiteSpaceTabPage_calls_after_comma_in_method_args; // public static String WhiteSpaceTabPage_calls_before_comma_in_alloc; // public static String WhiteSpaceTabPage_calls_after_comma_in_alloc; -// public static String WhiteSpaceTabPage_calls_before_comma_in_qalloc; -// public static String WhiteSpaceTabPage_calls_after_comma_in_qalloc; -// public static String WhiteSpaceTabPage_statements; -// public static String WhiteSpaceTabPage_blocks; -// public static String WhiteSpaceTabPage_switch; -// public static String WhiteSpaceTabPage_switch_before_case_colon; -// public static String WhiteSpaceTabPage_switch_before_default_colon; -// public static String WhiteSpaceTabPage_do; -// public static String WhiteSpaceTabPage_synchronized; -// public static String WhiteSpaceTabPage_try; -// public static String WhiteSpaceTabPage_if; -// public static String WhiteSpaceTabPage_assert; -// public static String WhiteSpaceTabPage_for; -// public static String WhiteSpaceTabPage_for_before_comma_init; -// public static String WhiteSpaceTabPage_for_after_comma_init; -// public static String WhiteSpaceTabPage_for_before_comma_inc; -// public static String WhiteSpaceTabPage_for_after_comma_inc; -// public static String WhiteSpaceTabPage_labels; -// public static String WhiteSpaceTabPage_annotations; -// public static String WhiteSpaceTabPage_annotation_types; -// public static String WhiteSpaceTabPage_enums; -// public static String WhiteSpaceTabPage_wildcardtype; -// public static String WhiteSpaceTabPage_param_type_ref; -// public static String WhiteSpaceTabPage_type_arguments; -// public static String WhiteSpaceTabPage_type_parameters; -// public static String WhiteSpaceTabPage_conditionals; -// public static String WhiteSpaceTabPage_typecasts; -// public static String WhiteSpaceTabPage_parenexpr; -// public static String WhiteSpaceTabPage_declarations; -// public static String WhiteSpaceTabPage_expressions; -// public static String WhiteSpaceTabPage_arrays; -// public static String WhiteSpaceTabPage_parameterized_types; -// public static String WhiteSpaceTabPage_after_opening_brace; -// public static String WhiteSpaceTabPage_after_closing_brace; -// public static String WhiteSpaceTabPage_before_opening_brace; -// public static String WhiteSpaceTabPage_before_closing_brace; -// public static String WhiteSpaceTabPage_between_empty_braces; -// public static String WhiteSpaceTabPage_after_opening_paren; -// public static String WhiteSpaceTabPage_after_closing_paren; -// public static String WhiteSpaceTabPage_before_opening_paren; -// public static String WhiteSpaceTabPage_before_closing_paren; -// public static String WhiteSpaceTabPage_between_empty_parens; -// public static String WhiteSpaceTabPage_after_opening_bracket; -// public static String WhiteSpaceTabPage_before_opening_bracket; -// public static String WhiteSpaceTabPage_before_closing_bracket; -// public static String WhiteSpaceTabPage_between_empty_brackets; -// public static String WhiteSpaceTabPage_before_comma_in_params; -// public static String WhiteSpaceTabPage_after_comma_in_params; -// public static String WhiteSpaceTabPage_before_comma_in_throws; -// public static String WhiteSpaceTabPage_after_comma_in_throws; -// public static String WhiteSpaceTabPage_before_ellipsis; -// public static String WhiteSpaceTabPage_after_ellipsis; -// public static String WhiteSpaceTabPage_before_comma; -// public static String WhiteSpaceTabPage_after_comma; -// public static String WhiteSpaceTabPage_after_semicolon; -// public static String WhiteSpaceTabPage_before_semicolon; -// public static String WhiteSpaceTabPage_before_colon; -// public static String WhiteSpaceTabPage_after_colon; -// public static String WhiteSpaceTabPage_before_question; -// public static String WhiteSpaceTabPage_after_question; -// public static String WhiteSpaceTabPage_before_at; -// public static String WhiteSpaceTabPage_after_at; -// public static String WhiteSpaceTabPage_after_opening_angle_bracket; -// public static String WhiteSpaceTabPage_after_closing_angle_bracket; -// public static String WhiteSpaceTabPage_before_opening_angle_bracket; -// public static String WhiteSpaceTabPage_before_closing_angle_bracket; -// public static String WhiteSpaceTabPage_before_and_list; -// public static String WhiteSpaceTabPage_after_and_list; -// public static String WhiteSpaceTabPage_enum_decl_before_opening_brace; -// public static String WhiteSpaceTabPage_enum_decl_before_comma; -// public static String WhiteSpaceTabPage_enum_decl_after_comma; -// public static String WhiteSpaceTabPage_enum_const_arg_before_opening_paren; -// public static String WhiteSpaceTabPage_enum_const_arg_after_opening_paren; -// public static String WhiteSpaceTabPage_enum_const_arg_between_empty_parens; -// public static String WhiteSpaceTabPage_enum_const_arg_before_comma; -// public static String WhiteSpaceTabPage_enum_const_arg_after_comma; -// public static String WhiteSpaceTabPage_enum_const_arg_before_closing_paren; -// public static String WhiteSpaceTabPage_enum_const_before_opening_brace; -// public static String WhiteSpaceTabPage_annot_type_method_before_opening_paren; -// public static String WhiteSpaceTabPage_annot_type_method_between_empty_parens; -// public static String WhiteSpaceTabPage_before_parenthesized_expressions; -// public static String WhiteSpaceTabPage_insert_space; -// public static String WhiteSpaceTabPage_sort_by_c_element; -// public static String WhiteSpaceTabPage_sort_by_syntax_element; -// public static String WhiteSpaceOptions_return; -// public static String WhiteSpaceOptions_before; -// public static String WhiteSpaceOptions_after; -// public static String WhiteSpaceOptions_operator; -// public static String WhiteSpaceOptions_assignment_operator; -// public static String WhiteSpaceOptions_binary_operator; -// public static String WhiteSpaceOptions_unary_operator; -// public static String WhiteSpaceOptions_prefix_operator; -// public static String WhiteSpaceOptions_postfix_operator; -// public static String WhiteSpaceOptions_opening_paren; -// public static String WhiteSpaceOptions_catch; -// public static String WhiteSpaceOptions_for; -// public static String WhiteSpaceOptions_if; -// public static String WhiteSpaceOptions_switch; -// public static String WhiteSpaceOptions_synchronized; -// public static String WhiteSpaceOptions_while; -// public static String WhiteSpaceOptions_assert; -// public static String WhiteSpaceOptions_member_function_declaration; -// public static String WhiteSpaceOptions_constructor; -// public static String WhiteSpaceOptions_method; -// public static String WhiteSpaceOptions_method_call; -// public static String WhiteSpaceOptions_paren_expr; -// public static String WhiteSpaceOptions_enum_constant_body; -// public static String WhiteSpaceOptions_enum_constant_arguments; -// public static String WhiteSpaceOptions_enum_declaration; -// public static String WhiteSpaceOptions_annotation_modifier; -// public static String WhiteSpaceOptions_annotation_modifier_args; -// public static String WhiteSpaceOptions_annotation_type_member; -// public static String WhiteSpaceOptions_annotation_type; -// public static String WhiteSpaceOptions_type_cast; -// public static String WhiteSpaceOptions_parameterized_type; -// public static String WhiteSpaceOptions_type_arguments; -// public static String WhiteSpaceOptions_type_parameters; -// public static String WhiteSpaceOptions_vararg_parameter; -// public static String WhiteSpaceOptions_closing_paren; -// public static String WhiteSpaceOptions_opening_brace; -// public static String WhiteSpaceOptions_closing_brace; -// public static String WhiteSpaceOptions_opening_bracket; -// public static String WhiteSpaceOptions_closing_bracket; -// public static String WhiteSpaceOptions_class_decl; -// public static String WhiteSpaceOptions_anon_class_decl; -// public static String WhiteSpaceOptions_initializer; -// public static String WhiteSpaceOptions_block; -// public static String WhiteSpaceOptions_array_decl; -// public static String WhiteSpaceOptions_array_element_access; -// public static String WhiteSpaceOptions_array_alloc; -// public static String WhiteSpaceOptions_array_init; -// public static String WhiteSpaceOptions_arguments; -// public static String WhiteSpaceOptions_initialization; -// public static String WhiteSpaceOptions_incrementation; -// public static String WhiteSpaceOptions_parameters; -// public static String WhiteSpaceOptions_explicit_constructor_call; + public static String WhiteSpaceTabPage_statements; + public static String WhiteSpaceTabPage_blocks; + public static String WhiteSpaceTabPage_switch; + public static String WhiteSpaceTabPage_switch_before_case_colon; + public static String WhiteSpaceTabPage_switch_before_default_colon; + public static String WhiteSpaceTabPage_do; + public static String WhiteSpaceTabPage_try; + public static String WhiteSpaceTabPage_if; + public static String WhiteSpaceTabPage_for; + public static String WhiteSpaceTabPage_labels; + public static String WhiteSpaceTabPage_template_arguments; + public static String WhiteSpaceTabPage_template_parameters; + public static String WhiteSpaceTabPage_conditionals; + public static String WhiteSpaceTabPage_typecasts; + public static String WhiteSpaceTabPage_parenexpr; + public static String WhiteSpaceTabPage_declarations; + public static String WhiteSpaceTabPage_expressions; + public static String WhiteSpaceTabPage_arrays; + public static String WhiteSpaceTabPage_templates; + public static String WhiteSpaceTabPage_after_opening_brace; + public static String WhiteSpaceTabPage_after_closing_brace; + public static String WhiteSpaceTabPage_before_opening_brace; + public static String WhiteSpaceTabPage_before_closing_brace; + public static String WhiteSpaceTabPage_between_empty_braces; + public static String WhiteSpaceTabPage_after_opening_paren; + public static String WhiteSpaceTabPage_after_closing_paren; + public static String WhiteSpaceTabPage_before_opening_paren; + public static String WhiteSpaceTabPage_before_closing_paren; + public static String WhiteSpaceTabPage_between_empty_parens; + public static String WhiteSpaceTabPage_after_opening_bracket; + public static String WhiteSpaceTabPage_before_opening_bracket; + public static String WhiteSpaceTabPage_before_closing_bracket; + public static String WhiteSpaceTabPage_between_empty_brackets; + public static String WhiteSpaceTabPage_before_comma_in_params; + public static String WhiteSpaceTabPage_after_comma_in_params; + public static String WhiteSpaceTabPage_before_comma_in_throws; + public static String WhiteSpaceTabPage_after_comma_in_throws; + public static String WhiteSpaceTabPage_before_ellipsis; + public static String WhiteSpaceTabPage_after_ellipsis; + public static String WhiteSpaceTabPage_before_comma; + public static String WhiteSpaceTabPage_after_comma; + public static String WhiteSpaceTabPage_after_semicolon; + public static String WhiteSpaceTabPage_before_semicolon; + public static String WhiteSpaceTabPage_before_colon; + public static String WhiteSpaceTabPage_after_colon; + public static String WhiteSpaceTabPage_before_question; + public static String WhiteSpaceTabPage_after_question; + public static String WhiteSpaceTabPage_after_opening_angle_bracket; + public static String WhiteSpaceTabPage_after_closing_angle_bracket; + public static String WhiteSpaceTabPage_before_opening_angle_bracket; + public static String WhiteSpaceTabPage_before_closing_angle_bracket; + public static String WhiteSpaceTabPage_before_parenthesized_expressions; + public static String WhiteSpaceTabPage_insert_space; + public static String WhiteSpaceTabPage_sort_by_c_element; + public static String WhiteSpaceTabPage_sort_by_syntax_element; + public static String WhiteSpaceOptions_return; + public static String WhiteSpaceOptions_throw; + public static String WhiteSpaceOptions_base_clause; + public static String WhiteSpaceOptions_before; + public static String WhiteSpaceOptions_after; + public static String WhiteSpaceOptions_operator; + public static String WhiteSpaceOptions_assignment_operator; + public static String WhiteSpaceOptions_binary_operator; + public static String WhiteSpaceOptions_unary_operator; + public static String WhiteSpaceOptions_prefix_operator; + public static String WhiteSpaceOptions_postfix_operator; + public static String WhiteSpaceOptions_opening_paren; + public static String WhiteSpaceOptions_catch; + public static String WhiteSpaceOptions_for; + public static String WhiteSpaceOptions_if; + public static String WhiteSpaceOptions_switch; + public static String WhiteSpaceOptions_while; + public static String WhiteSpaceOptions_member_function_declaration; + public static String WhiteSpaceOptions_constructor; + public static String WhiteSpaceOptions_method; + public static String WhiteSpaceOptions_method_call; + public static String WhiteSpaceOptions_paren_expr; + public static String WhiteSpaceOptions_type_cast; + public static String WhiteSpaceOptions_parameterized_type; + public static String WhiteSpaceOptions_template_arguments; + public static String WhiteSpaceOptions_template_parameters; + public static String WhiteSpaceOptions_vararg_parameter; + public static String WhiteSpaceOptions_closing_paren; + public static String WhiteSpaceOptions_opening_brace; + public static String WhiteSpaceOptions_closing_brace; + public static String WhiteSpaceOptions_opening_bracket; + public static String WhiteSpaceOptions_closing_bracket; + public static String WhiteSpaceOptions_class_decl; + public static String WhiteSpaceOptions_initializer_list; + public static String WhiteSpaceOptions_block; + public static String WhiteSpaceOptions_arrays; + public static String WhiteSpaceOptions_arguments; + public static String WhiteSpaceOptions_parameters; // public static String WhiteSpaceOptions_alloc_expr; -// public static String WhiteSpaceOptions_throws; -// public static String WhiteSpaceOptions_mult_decls; -// public static String WhiteSpaceOptions_local_vars; -// public static String WhiteSpaceOptions_fields; -// public static String WhiteSpaceOptions_implements_clause; -// public static String WhiteSpaceOptions_colon; -// public static String WhiteSpaceOptions_conditional; -// public static String WhiteSpaceOptions_wildcard; -// public static String WhiteSpaceOptions_label; -// public static String WhiteSpaceOptions_comma; -// public static String WhiteSpaceOptions_semicolon; -// public static String WhiteSpaceOptions_question_mark; -// public static String WhiteSpaceOptions_between_empty_parens; -// public static String WhiteSpaceOptions_between_empty_braces; -// public static String WhiteSpaceOptions_between_empty_brackets; -// public static String WhiteSpaceOptions_constructor_decl; -// public static String WhiteSpaceOptions_method_decl; -// public static String WhiteSpaceOptions_case; -// public static String WhiteSpaceOptions_default; -// public static String WhiteSpaceOptions_statements; -// public static String WhiteSpaceOptions_before_opening_paren; -// public static String WhiteSpaceOptions_after_opening_paren; -// public static String WhiteSpaceOptions_before_closing_paren; -// public static String WhiteSpaceOptions_after_closing_paren; -// public static String WhiteSpaceOptions_before_opening_brace; -// public static String WhiteSpaceOptions_after_opening_brace; -// public static String WhiteSpaceOptions_after_closing_brace; -// public static String WhiteSpaceOptions_before_closing_brace; -// public static String WhiteSpaceOptions_before_opening_bracket; -// public static String WhiteSpaceOptions_after_opening_bracket; -// public static String WhiteSpaceOptions_before_closing_bracket; -// public static String WhiteSpaceOptions_before_opening_angle_bracket; -// public static String WhiteSpaceOptions_after_opening_angle_bracket; -// public static String WhiteSpaceOptions_before_closing_angle_bracket; -// public static String WhiteSpaceOptions_after_closing_angle_bracket; -// public static String WhiteSpaceOptions_before_operator; -// public static String WhiteSpaceOptions_after_operator; -// public static String WhiteSpaceOptions_before_comma; -// public static String WhiteSpaceOptions_after_comma; -// public static String WhiteSpaceOptions_after_colon; -// public static String WhiteSpaceOptions_before_colon; -// public static String WhiteSpaceOptions_before_semicolon; -// public static String WhiteSpaceOptions_after_semicolon; -// public static String WhiteSpaceOptions_before_question_mark; -// public static String WhiteSpaceOptions_after_question_mark; -// public static String WhiteSpaceOptions_before_at; -// public static String WhiteSpaceOptions_after_at; -// public static String WhiteSpaceOptions_before_and; -// public static String WhiteSpaceOptions_after_and; -// public static String WhiteSpaceOptions_before_ellipsis; -// public static String WhiteSpaceOptions_after_ellipsis; -// public static String WhiteSpaceOptions_return_with_parenthesized_expression; + public static String WhiteSpaceOptions_throws; + public static String WhiteSpaceOptions_lists; + public static String WhiteSpaceOptions_expression_list; + public static String WhiteSpaceOptions_declarator_list; + public static String WhiteSpaceOptions_colon; + public static String WhiteSpaceOptions_conditional; + public static String WhiteSpaceOptions_label; + public static String WhiteSpaceOptions_comma; + public static String WhiteSpaceOptions_semicolon; + public static String WhiteSpaceOptions_question_mark; + public static String WhiteSpaceOptions_between_empty_parens; + public static String WhiteSpaceOptions_between_empty_braces; + public static String WhiteSpaceOptions_between_empty_brackets; + public static String WhiteSpaceOptions_constructor_decl; + public static String WhiteSpaceOptions_method_decl; + public static String WhiteSpaceOptions_case; + public static String WhiteSpaceOptions_default; + public static String WhiteSpaceOptions_statements; + public static String WhiteSpaceOptions_before_opening_paren; + public static String WhiteSpaceOptions_after_opening_paren; + public static String WhiteSpaceOptions_before_closing_paren; + public static String WhiteSpaceOptions_after_closing_paren; + public static String WhiteSpaceOptions_before_opening_brace; + public static String WhiteSpaceOptions_after_opening_brace; + public static String WhiteSpaceOptions_after_closing_brace; + public static String WhiteSpaceOptions_before_closing_brace; + public static String WhiteSpaceOptions_before_opening_bracket; + public static String WhiteSpaceOptions_after_opening_bracket; + public static String WhiteSpaceOptions_before_closing_bracket; + public static String WhiteSpaceOptions_before_opening_angle_bracket; + public static String WhiteSpaceOptions_after_opening_angle_bracket; + public static String WhiteSpaceOptions_before_closing_angle_bracket; + public static String WhiteSpaceOptions_after_closing_angle_bracket; + public static String WhiteSpaceOptions_before_operator; + public static String WhiteSpaceOptions_after_operator; + public static String WhiteSpaceOptions_before_comma; + public static String WhiteSpaceOptions_after_comma; + public static String WhiteSpaceOptions_after_colon; + public static String WhiteSpaceOptions_before_colon; + public static String WhiteSpaceOptions_before_semicolon; + public static String WhiteSpaceOptions_after_semicolon; + public static String WhiteSpaceOptions_before_question_mark; + public static String WhiteSpaceOptions_after_question_mark; + public static String WhiteSpaceOptions_before_ellipsis; + public static String WhiteSpaceOptions_after_ellipsis; + public static String WhiteSpaceOptions_return_with_parenthesized_expression; + public static String WhiteSpaceOptions_throw_with_parenthesized_expression; // public static String LineWrappingTabPage_compact_if_else; -// public static String LineWrappingTabPage_extends_clause; -// public static String LineWrappingTabPage_enum_constant_arguments; -// public static String LineWrappingTabPage_enum_constants; -// public static String LineWrappingTabPage_implements_clause; public static String LineWrappingTabPage_parameters; public static String LineWrappingTabPage_parameters_description; public static String LineWrappingTabPage_arguments; public static String LineWrappingTabPage_arguments_description; -// public static String LineWrappingTabPage_qualified_invocations; // public static String LineWrappingTabPage_throws_clause; -// public static String LineWrappingTabPage_object_allocation; -// public static String LineWrappingTabPage_qualified_object_allocation; - public static String LineWrappingTabPage_array_init; - public static String LineWrappingTabPage_array_init_description; -// public static String LineWrappingTabPage_explicit_constructor_invocations; + public static String LineWrappingTabPage_initializer_list; + public static String LineWrappingTabPage_initializer_list_description; public static String LineWrappingTabPage_conditionals; public static String LineWrappingTabPage_conditionals_description; // public static String LineWrappingTabPage_binary_exprs; @@ -287,7 +230,6 @@ final class FormatterMessages extends NLS { public static String LineWrappingTabPage_expressions; public static String LineWrappingTabPage_expressions_description; // public static String LineWrappingTabPage_statements; -// public static String LineWrappingTabPage_enum_decls; public static String LineWrappingTabPage_wrapping_policy_label_text; public static String LineWrappingTabPage_indentation_policy_label_text; public static String LineWrappingTabPage_force_split_checkbox_text; @@ -308,7 +250,6 @@ final class FormatterMessages extends NLS { public static String LineWrappingTabPage_width_indent_option_default_indent_wrapped; public static String LineWrappingTabPage_width_indent_option_default_indent_array; public static String LineWrappingTabPage_error_invalid_value; -// public static String LineWrappingTabPage_enum_superinterfaces; // public static String LineWrappingTabPage_assignment_alignment; public static String AlreadyExistsDialog_message_profile_already_exists; public static String AlreadyExistsDialog_message_profile_name_empty; @@ -345,11 +286,8 @@ final class FormatterMessages extends NLS { public static String BracesTabPage_option_blocks; public static String BracesTabPage_option_blocks_in_case; public static String BracesTabPage_option_switch_case; - public static String BracesTabPage_option_array_initializer; - public static String BracesTabPage_option_keep_empty_array_initializer_on_one_line; -// public static String BracesTabPage_option_enum_declaration; -// public static String BracesTabPage_option_enumconst_declaration; -// public static String BracesTabPage_option_annotation_type_declaration; + public static String BracesTabPage_option_initializer_list; + public static String BracesTabPage_option_keep_empty_initializer_list_on_one_line; public static String CodingStyleConfigurationBlock_save_profile_dialog_title; public static String CodingStyleConfigurationBlock_save_profile_error_title; public static String CodingStyleConfigurationBlock_save_profile_error_message; @@ -419,8 +357,6 @@ final class FormatterMessages extends NLS { public static String IndentationTabPage_indent_group_title; public static String IndentationTabPage_class_group_option_indent_access_specifiers_within_class_body; public static String IndentationTabPage_class_group_option_indent_declarations_compare_to_access_specifiers; -// public static String IndentationTabPage_class_group_option_indent_declarations_within_enum_const; -// public static String IndentationTabPage_class_group_option_indent_declarations_within_enum_decl; public static String IndentationTabPage_block_group_option_indent_statements_compare_to_body; public static String IndentationTabPage_block_group_option_indent_statements_compare_to_block; public static String IndentationTabPage_switch_group_option_indent_statements_within_switch_body; @@ -429,12 +365,11 @@ final class FormatterMessages extends NLS { public static String IndentationTabPage_namespace_group_option_indent_declarations_within_namespace; public static String IndentationTabPage_indent_empty_lines; public static String IndentationTabPage_use_tabs_only_for_leading_indentations; - public static String IndentationTabPage_show_whitespace_in_preview_label_text; public static String ModifyDialog_dialog_title; public static String ModifyDialog_apply_button; public static String ModifyDialog_tabpage_braces_title; public static String ModifyDialog_tabpage_indentation_title; -// public static String ModifyDialog_tabpage_whitespace_title; + public static String ModifyDialog_tabpage_whitespace_title; // public static String ModifyDialog_tabpage_blank_lines_title; // public static String ModifyDialog_tabpage_new_lines_title; // public static String ModifyDialog_tabpage_control_statements_title; @@ -448,10 +383,6 @@ final class FormatterMessages extends NLS { // public static String NewLinesTabPage_preview_header; // public static String NewLinesTabPage_newlines_group_title; // public static String NewLinesTabPage_newlines_group_option_empty_class_body; -// public static String NewLinesTabPage_newlines_group_option_empty_annotation_decl_body; -// public static String NewLinesTabPage_newlines_group_option_empty_anonymous_class_body; -// public static String NewLinesTabPage_newlines_group_option_empty_enum_declaration; -// public static String NewLinesTabPage_newlines_group_option_empty_enum_constant; // public static String NewLinesTabPage_newlines_group_option_empty_method_body; // public static String NewLinesTabPage_newlines_group_option_empty_block; // public static String NewLinesTabPage_newlines_group_option_empty_end_of_file; diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/formatter/FormatterMessages.properties b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/formatter/FormatterMessages.properties index 4f532f1a6ec..9beb756e0ed 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/formatter/FormatterMessages.properties +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/formatter/FormatterMessages.properties @@ -1,5 +1,5 @@ ############################################################################### -# Copyright (c) 2000, 2007 IBM Corporation and others. +# Copyright (c) 2000, 2008 IBM Corporation and others. # All rights reserved. This program and the accompanying materials # are made available under the terms of the Eclipse Public License v1.0 # which accompanies this distribution, and is available at @@ -13,307 +13,239 @@ # Anton Leherbauer (Wind River Systems) ############################################################################### +WhiteSpaceTabPage_assignments=Assignments +WhiteSpaceTabPage_assignments_before_assignment_operator=before assignment operator +WhiteSpaceTabPage_assignments_after_assignment_operator=after assignment operator -#WhiteSpaceTabPage_assignments=Assignments -#WhiteSpaceTabPage_assignments_before_assignment_operator=before assignment operator -#WhiteSpaceTabPage_assignments_after_assignment_operator=after assignment operator +WhiteSpaceTabPage_operators=Operators +WhiteSpaceTabPage_operators_before_binary_operators=before binary operators +WhiteSpaceTabPage_operators_after_binary_operators=after binary operators +WhiteSpaceTabPage_operators_before_unary_operators=before unary operators +WhiteSpaceTabPage_operators_after_unary_operators=after unary operators +WhiteSpaceTabPage_operators_before_prefix_operators=before prefix operators +WhiteSpaceTabPage_operators_after_prefix_operators=after prefix operators +WhiteSpaceTabPage_operators_before_postfix_operators=before postfix operators +WhiteSpaceTabPage_operators_after_postfix_operators=after postfix operators -#WhiteSpaceTabPage_operators=Operators -#WhiteSpaceTabPage_operators_before_binary_operators=before binary operators -#WhiteSpaceTabPage_operators_after_binary_operators=after binary operators -#WhiteSpaceTabPage_operators_before_unary_operators=before unary operators -#WhiteSpaceTabPage_operators_after_unary_operators=after unary operators -#WhiteSpaceTabPage_operators_before_prefix_operators=before prefix operators -#WhiteSpaceTabPage_operators_after_prefix_operators=after prefix operators -#WhiteSpaceTabPage_operators_before_postfix_operators=before postfix operators -#WhiteSpaceTabPage_operators_after_postfix_operators=after postfix operators +WhiteSpaceTabPage_classes=Types +WhiteSpaceTabPage_classes_before_opening_brace_of_a_class=before opening brace of a class +WhiteSpaceTabPage_classes_before_colon_of_base_clause=before colon of base clause +WhiteSpaceTabPage_classes_after_colon_of_base_clause=after colon of base clause +WhiteSpaceTabPage_classes_before_comma_base_types=before comma in base clause +WhiteSpaceTabPage_classes_after_comma_base_types=after comma in base clause +WhiteSpaceTabPage_methods=Methods +WhiteSpaceTabPage_constructors=Constructors -#WhiteSpaceTabPage_classes=Classes -#WhiteSpaceTabPage_classes_before_opening_brace_of_a_class=before opening brace of a class -#WhiteSpaceTabPage_classes_before_opening_brace_of_anon_class=before opening brace of an anonymous class -#WhiteSpaceTabPage_classes_before_comma_implements=before comma in implements clause -#WhiteSpaceTabPage_classes_after_comma_implements=after comma in implements clause +WhiteSpaceTabPage_declarator_list=Declarator list +WhiteSpaceTabPage_declarator_list_before_comma=before comma in declarator list +WhiteSpaceTabPage_declarator_list_after_comma=after comma in declarator list +WhiteSpaceTabPage_expression_list=Expression list +WhiteSpaceTabPage_expression_list_before_comma=before comma in expression list +WhiteSpaceTabPage_expression_list_after_comma=after comma in expression list +WhiteSpaceTabPage_initializer_list=Initializer list -#WhiteSpaceTabPage_methods=Methods -#WhiteSpaceTabPage_constructors=Constructors +WhiteSpaceTabPage_calls=Function invocations -#WhiteSpaceTabPage_fields=Fields -#WhiteSpaceTabPage_fields_before_comma=before comma in multiple field declarations -#WhiteSpaceTabPage_fields_after_comma=after comma in multiple field declarations - -#WhiteSpaceTabPage_localvars=Local variables -#WhiteSpaceTabPage_localvars_before_comma=before comma in multiple local declarations -#WhiteSpaceTabPage_localvars_after_comma=after comma in multiple local declarations - -#WhiteSpaceTabPage_arrayinit=Initializer lists -#WhiteSpaceTabPage_arraydecls=Array declarations -#WhiteSpaceTabPage_arrayelem=Array element access -#WhiteSpaceTabPage_arrayalloc=Array allocation - -#WhiteSpaceTabPage_calls=Function invocations - -#WhiteSpaceTabPage_calls_before_comma_in_method_args=before comma in method arguments -#WhiteSpaceTabPage_calls_after_comma_in_method_args=after comma in method arguments +WhiteSpaceTabPage_calls_before_comma_in_method_args=before comma in method arguments +WhiteSpaceTabPage_calls_after_comma_in_method_args=after comma in method arguments #WhiteSpaceTabPage_calls_before_comma_in_alloc=before comma in object allocation arguments #WhiteSpaceTabPage_calls_after_comma_in_alloc=after comma in object allocation arguments -#WhiteSpaceTabPage_calls_before_comma_in_qalloc=before comma in explicit constructor call -#WhiteSpaceTabPage_calls_after_comma_in_qalloc=after comma in explicit constructor call -#WhiteSpaceTabPage_statements=Control statements +WhiteSpaceTabPage_statements=Control statements -#WhiteSpaceTabPage_blocks=Blocks +WhiteSpaceTabPage_blocks=Blocks -#WhiteSpaceTabPage_switch='switch' -#WhiteSpaceTabPage_switch_before_case_colon=before colon in case -#WhiteSpaceTabPage_switch_before_default_colon=before colon in default +WhiteSpaceTabPage_switch='switch' +WhiteSpaceTabPage_switch_before_case_colon=before colon in case +WhiteSpaceTabPage_switch_before_default_colon=before colon in default -#WhiteSpaceTabPage_do='while' & 'do while' +WhiteSpaceTabPage_do='while' & 'do while' -#WhiteSpaceTabPage_synchronized='synchronized' +WhiteSpaceTabPage_try='catch' -#WhiteSpaceTabPage_try='catch' +WhiteSpaceTabPage_if='if else' -#WhiteSpaceTabPage_if='if else' -#WhiteSpaceTabPage_assert='assert' - -#WhiteSpaceTabPage_for='for' +WhiteSpaceTabPage_for='for' #WhiteSpaceTabPage_for_before_comma_init=before comma in initialization #WhiteSpaceTabPage_for_after_comma_init=after comma in initialization #WhiteSpaceTabPage_for_before_comma_inc=before comma in increments #WhiteSpaceTabPage_for_after_comma_inc=after comma in increments -#WhiteSpaceTabPage_labels=Labels -#WhiteSpaceTabPage_annotations=Annotations -#WhiteSpaceTabPage_annotation_types=Annotation types -#WhiteSpaceTabPage_enums=Enum types -#WhiteSpaceTabPage_wildcardtype=Wildcard type -#WhiteSpaceTabPage_param_type_ref=Type reference -#WhiteSpaceTabPage_type_arguments=Type arguments -#WhiteSpaceTabPage_type_parameters=Type parameters +WhiteSpaceTabPage_labels=Labels +WhiteSpaceTabPage_template_arguments=Template arguments +WhiteSpaceTabPage_template_parameters=Template parameters -#WhiteSpaceTabPage_conditionals=Conditionals +WhiteSpaceTabPage_conditionals=Conditionals -#WhiteSpaceTabPage_typecasts=Type casts +WhiteSpaceTabPage_typecasts=Type casts -#WhiteSpaceTabPage_parenexpr=Parenthesized expressions -#WhiteSpaceTabPage_declarations=Declarations -#WhiteSpaceTabPage_expressions=Expressions -#WhiteSpaceTabPage_arrays=Arrays -#WhiteSpaceTabPage_parameterized_types=Parameterized types +WhiteSpaceTabPage_parenexpr=Parenthesized expressions +WhiteSpaceTabPage_declarations=Declarations +WhiteSpaceTabPage_expressions=Expressions +WhiteSpaceTabPage_arrays=Arrays +WhiteSpaceTabPage_templates=Templates +WhiteSpaceTabPage_after_opening_brace=after opening brace +WhiteSpaceTabPage_after_closing_brace=after closing brace +WhiteSpaceTabPage_before_opening_brace=before opening brace +WhiteSpaceTabPage_before_closing_brace=before closing brace +WhiteSpaceTabPage_between_empty_braces=between empty braces -#WhiteSpaceTabPage_after_opening_brace=after opening brace -#WhiteSpaceTabPage_after_closing_brace=after closing brace -#WhiteSpaceTabPage_before_opening_brace=before opening brace -#WhiteSpaceTabPage_before_closing_brace=before closing brace -#WhiteSpaceTabPage_between_empty_braces=between empty braces +WhiteSpaceTabPage_after_opening_paren=after opening parenthesis +WhiteSpaceTabPage_after_closing_paren=after closing parenthesis +WhiteSpaceTabPage_before_opening_paren=before opening parenthesis +WhiteSpaceTabPage_before_closing_paren=before closing parenthesis +WhiteSpaceTabPage_between_empty_parens=between empty parenthesis +WhiteSpaceTabPage_after_opening_bracket=after opening bracket +WhiteSpaceTabPage_before_opening_bracket=before opening bracket +WhiteSpaceTabPage_before_closing_bracket=before closing bracket +WhiteSpaceTabPage_between_empty_brackets=between empty brackets -#WhiteSpaceTabPage_after_opening_paren=after opening parenthesis -#WhiteSpaceTabPage_after_closing_paren=after closing parenthesis -#WhiteSpaceTabPage_before_opening_paren=before opening parenthesis -#WhiteSpaceTabPage_before_closing_paren=before closing parenthesis -#WhiteSpaceTabPage_between_empty_parens=between empty parenthesis +WhiteSpaceTabPage_before_comma_in_params=before comma in parameters +WhiteSpaceTabPage_after_comma_in_params=after comma in parameters +WhiteSpaceTabPage_before_comma_in_throws=before comma in 'throws' clause +WhiteSpaceTabPage_after_comma_in_throws=after comma in 'throws' clause -#WhiteSpaceTabPage_after_opening_bracket=after opening bracket -#WhiteSpaceTabPage_before_opening_bracket=before opening bracket -#WhiteSpaceTabPage_before_closing_bracket=before closing bracket -#WhiteSpaceTabPage_between_empty_brackets=between empty brackets +WhiteSpaceTabPage_before_ellipsis=before ellipsis in vararg parameters +WhiteSpaceTabPage_after_ellipsis=after ellipsis in vararg parameters -#WhiteSpaceTabPage_before_comma_in_params=before comma in parameters -#WhiteSpaceTabPage_after_comma_in_params=after comma in parameters -#WhiteSpaceTabPage_before_comma_in_throws=before comma in 'throws' clause -#WhiteSpaceTabPage_after_comma_in_throws=after comma in 'throws' clause +WhiteSpaceTabPage_before_comma=before comma +WhiteSpaceTabPage_after_comma=after comma -#WhiteSpaceTabPage_before_ellipsis=before ellipsis in vararg parameters -#WhiteSpaceTabPage_after_ellipsis=after ellipsis in vararg parameters +WhiteSpaceTabPage_after_semicolon=after semicolon +WhiteSpaceTabPage_before_semicolon=before semicolon -#WhiteSpaceTabPage_before_comma=before comma -#WhiteSpaceTabPage_after_comma=after comma +WhiteSpaceTabPage_before_colon=before colon +WhiteSpaceTabPage_after_colon=after colon -#WhiteSpaceTabPage_after_semicolon=after semicolon -#WhiteSpaceTabPage_before_semicolon=before semicolon +WhiteSpaceTabPage_before_question=before question mark +WhiteSpaceTabPage_after_question=after question mark -#WhiteSpaceTabPage_before_colon=before colon -#WhiteSpaceTabPage_after_colon=after colon +WhiteSpaceTabPage_after_opening_angle_bracket=after opening angle bracket +WhiteSpaceTabPage_after_closing_angle_bracket=after closing angle bracket +WhiteSpaceTabPage_before_opening_angle_bracket=before opening angle bracket +WhiteSpaceTabPage_before_closing_angle_bracket=before closing angle bracket +WhiteSpaceTabPage_before_parenthesized_expressions=before parenthesized expressions -#WhiteSpaceTabPage_before_question=before question mark -#WhiteSpaceTabPage_after_question=after question mark +WhiteSpaceTabPage_sort_by_c_element=Sort options by C/C++ element +WhiteSpaceTabPage_sort_by_syntax_element=Sort options by Syntax element -#WhiteSpaceTabPage_before_at=before @ -#WhiteSpaceTabPage_after_at=after @ +WhiteSpaceOptions_base_clause=Base clause +WhiteSpaceOptions_before=Before +WhiteSpaceOptions_after=After -#WhiteSpaceTabPage_after_opening_angle_bracket=after opening angle bracket -#WhiteSpaceTabPage_after_closing_angle_bracket=after closing angle bracket -#WhiteSpaceTabPage_before_opening_angle_bracket=before opening angle bracket -#WhiteSpaceTabPage_before_closing_angle_bracket=before closing angle bracket -#WhiteSpaceTabPage_before_parenthesized_expressions=before parenthesized expressions +WhiteSpaceOptions_operator=Operator +WhiteSpaceOptions_assignment_operator=Assignment operator +WhiteSpaceOptions_binary_operator=Binary operator +WhiteSpaceOptions_unary_operator=Unary operator +WhiteSpaceOptions_prefix_operator=Prefix operator +WhiteSpaceOptions_postfix_operator=Postfix operator -#WhiteSpaceTabPage_before_and_list=before '&' in type bounds -#WhiteSpaceTabPage_after_and_list=after '&' in type bounds +WhiteSpaceOptions_opening_paren=Opening parenthesis +WhiteSpaceOptions_catch='catch' +WhiteSpaceOptions_for='for' +WhiteSpaceOptions_if='if' +WhiteSpaceOptions_switch='switch' +WhiteSpaceOptions_while='while' +WhiteSpaceOptions_member_function_declaration=Member function declaration +WhiteSpaceOptions_constructor=Constructor +WhiteSpaceOptions_method=Method +WhiteSpaceOptions_method_call=Method call +WhiteSpaceOptions_paren_expr=Parenthesized expression -#WhiteSpaceTabPage_enum_decl_before_opening_brace=before opening brace in declaration -#WhiteSpaceTabPage_enum_decl_before_comma=before comma between constants -#WhiteSpaceTabPage_enum_decl_after_comma=after comma between constants +WhiteSpaceOptions_type_cast=Type cast +WhiteSpaceOptions_parameterized_type=Parameterized type +WhiteSpaceOptions_template_arguments=Template arguments +WhiteSpaceOptions_template_parameters=Template parameters +WhiteSpaceOptions_vararg_parameter=Vararg parameters -#WhiteSpaceTabPage_enum_const_arg_before_opening_paren=before opening parenthesis in constant arguments -#WhiteSpaceTabPage_enum_const_arg_after_opening_paren=after opening parenthesis in constant arguments -#WhiteSpaceTabPage_enum_const_arg_between_empty_parens=between empty parenthesis in constant arguments -#WhiteSpaceTabPage_enum_const_arg_before_comma=before comma in constant arguments -#WhiteSpaceTabPage_enum_const_arg_after_comma=after comma in constant arguments -#WhiteSpaceTabPage_enum_const_arg_before_closing_paren=before closing parenthesis in constant arguments +WhiteSpaceOptions_closing_paren=Closing parenthesis -#WhiteSpaceTabPage_enum_const_before_opening_brace=before opening brace of constant body +WhiteSpaceOptions_opening_brace=Opening brace +WhiteSpaceOptions_closing_brace=Closing brace +WhiteSpaceOptions_opening_bracket=Opening bracket +WhiteSpaceOptions_closing_bracket=Closing bracket +WhiteSpaceOptions_class_decl=Type declaration +WhiteSpaceOptions_initializer_list=Initializer list +WhiteSpaceOptions_block=Block -#WhiteSpaceTabPage_annot_type_method_before_opening_paren=before opening parenthesis in annotation type members -#WhiteSpaceTabPage_annot_type_method_between_empty_parens=between parenthesis in annotation type members - -#WhiteSpaceTabPage_sort_by_c_element=Sort options by C element -#WhiteSpaceTabPage_sort_by_syntax_element=Sort options by Syntax element - -#WhiteSpaceOptions_before=Before -#WhiteSpaceOptions_after=After - -#WhiteSpaceOptions_operator=Operator -#WhiteSpaceOptions_assignment_operator=Assignment operator -#WhiteSpaceOptions_binary_operator=Binary operator -#WhiteSpaceOptions_unary_operator=Unary operator -#WhiteSpaceOptions_prefix_operator=Prefix operator -#WhiteSpaceOptions_postfix_operator=Postfix operator - - -#WhiteSpaceOptions_opening_paren=Opening parenthesis -#WhiteSpaceOptions_catch='catch' -#WhiteSpaceOptions_for='for' -#WhiteSpaceOptions_if='if' -#WhiteSpaceOptions_switch='switch' -#WhiteSpaceOptions_synchronized='synchronized' -#WhiteSpaceOptions_while='while' -#WhiteSpaceOptions_assert='assert' -#WhiteSpaceOptions_member_function_declaration=Member function declaration -#WhiteSpaceOptions_constructor=Constructor -#WhiteSpaceOptions_method=Method -#WhiteSpaceOptions_method_call=Method call -#WhiteSpaceOptions_paren_expr=Parenthesized expression -#WhiteSpaceOptions_enum_constant_body=Enum constant body -#WhiteSpaceOptions_enum_constant_arguments=Enum constant arguments -#WhiteSpaceOptions_enum_declaration=Enum declaration -#WhiteSpaceOptions_annotation_modifier=Annotation -#WhiteSpaceOptions_annotation_modifier_args=Annotation arguments -#WhiteSpaceOptions_annotation_type_member=Annotation type member -#WhiteSpaceOptions_annotation_type=Annotation type - -#WhiteSpaceOptions_type_cast=Type cast -#WhiteSpaceOptions_parameterized_type=Parameterized type -#WhiteSpaceOptions_type_arguments=Type arguments -#WhiteSpaceOptions_type_parameters=Type parameters -#WhiteSpaceOptions_vararg_parameter=Vararg parameters - -#WhiteSpaceOptions_closing_paren=Closing parenthesis - -#WhiteSpaceOptions_opening_brace=Opening brace -#WhiteSpaceOptions_closing_brace=Closing brace -#WhiteSpaceOptions_opening_bracket=Opening bracket -#WhiteSpaceOptions_closing_bracket=Closing bracket -#WhiteSpaceOptions_class_decl=Type declaration -#WhiteSpaceOptions_anon_class_decl=Anonymous type declaration -#WhiteSpaceOptions_initializer=Initializer lists -#WhiteSpaceOptions_block=Block - -#WhiteSpaceOptions_array_decl=Array declaration -#WhiteSpaceOptions_array_element_access=Array element access -#WhiteSpaceOptions_array_alloc=Array allocation -#WhiteSpaceOptions_array_init=Initializer list - -#WhiteSpaceOptions_arguments=Arguments +WhiteSpaceOptions_arrays=Arrays +WhiteSpaceOptions_initializer_list=Initializer list +WhiteSpaceOptions_arguments=Arguments #WhiteSpaceOptions_initialization=Initialization #WhiteSpaceOptions_incrementation=Increment -#WhiteSpaceOptions_parameters=Parameters +WhiteSpaceOptions_parameters=Parameters -#WhiteSpaceOptions_explicit_constructor_call=Explicit constructor call #WhiteSpaceOptions_alloc_expr=Allocation expression -#WhiteSpaceOptions_throws='throws' clause -#WhiteSpaceOptions_mult_decls=Multiple declarations -#WhiteSpaceOptions_local_vars=Local variables -#WhiteSpaceOptions_fields=Fields -#WhiteSpaceOptions_return='return' -#WhiteSpaceOptions_implements_clause='extends'/'implements' clause -#WhiteSpaceOptions_colon=Colon -#WhiteSpaceOptions_conditional=Conditional -#WhiteSpaceOptions_wildcard=Wildcard type -#WhiteSpaceOptions_label=Label -#WhiteSpaceOptions_comma=Comma +WhiteSpaceOptions_throws='throws' clause +WhiteSpaceOptions_lists=Lists +WhiteSpaceOptions_expression_list=Expression list +WhiteSpaceOptions_declarator_list=Declarator list +WhiteSpaceOptions_return='return' +WhiteSpaceOptions_throw='throw' +WhiteSpaceOptions_colon=Colon +WhiteSpaceOptions_conditional=Conditional +WhiteSpaceOptions_label=Label +WhiteSpaceOptions_comma=Comma -#WhiteSpaceOptions_semicolon=Semicolon -#WhiteSpaceOptions_question_mark=Question mark -#WhiteSpaceOptions_between_empty_parens=Between empty parenthesis -#WhiteSpaceOptions_between_empty_braces=Between empty braces -#WhiteSpaceOptions_between_empty_brackets=Between empty brackets -#WhiteSpaceOptions_constructor_decl=Constructor declaration -#WhiteSpaceOptions_method_decl=Method declaration -#WhiteSpaceOptions_case='case' -#WhiteSpaceOptions_default='default' -#WhiteSpaceOptions_statements=Statements +WhiteSpaceOptions_semicolon=Semicolon +WhiteSpaceOptions_question_mark=Question mark +WhiteSpaceOptions_between_empty_parens=Between empty parenthesis +WhiteSpaceOptions_between_empty_braces=Between empty braces +WhiteSpaceOptions_between_empty_brackets=Between empty brackets +WhiteSpaceOptions_constructor_decl=Constructor declaration +WhiteSpaceOptions_method_decl=Method declaration +WhiteSpaceOptions_case='case' +WhiteSpaceOptions_default='default' +WhiteSpaceOptions_statements=Statements +WhiteSpaceOptions_before_opening_paren=Before opening parenthesis +WhiteSpaceOptions_after_opening_paren=After opening parenthesis +WhiteSpaceOptions_before_closing_paren=Before closing parenthesis +WhiteSpaceOptions_after_closing_paren=After closing parenthesis +WhiteSpaceOptions_before_opening_brace=Before opening brace +WhiteSpaceOptions_after_opening_brace=After opening brace +WhiteSpaceOptions_after_closing_brace=After closing brace +WhiteSpaceOptions_before_closing_brace=Before closing brace +WhiteSpaceOptions_before_opening_bracket=Before opening bracket +WhiteSpaceOptions_after_opening_bracket=After opening bracket +WhiteSpaceOptions_before_closing_bracket=Before closing bracket -#WhiteSpaceOptions_before_opening_paren=Before opening parenthesis -#WhiteSpaceOptions_after_opening_paren=After opening parenthesis -#WhiteSpaceOptions_before_closing_paren=Before closing parenthesis +WhiteSpaceOptions_before_opening_angle_bracket=Before opening angle bracket +WhiteSpaceOptions_after_opening_angle_bracket=After opening angle bracket +WhiteSpaceOptions_before_closing_angle_bracket=Before closing angle bracket +WhiteSpaceOptions_return_with_parenthesized_expression='return' with parenthesized expression +WhiteSpaceOptions_throw_with_parenthesized_expression='throws' with parenthesized expression +WhiteSpaceOptions_after_closing_angle_bracket=After closing angle bracket -#WhiteSpaceOptions_after_closing_paren=After closing parenthesis -#WhiteSpaceOptions_before_opening_brace=Before opening brace -#WhiteSpaceOptions_after_opening_brace=After opening brace -#WhiteSpaceOptions_after_closing_brace=After closing brace -#WhiteSpaceOptions_before_closing_brace=Before closing brace -#WhiteSpaceOptions_before_opening_bracket=Before opening bracket -#WhiteSpaceOptions_after_opening_bracket=After opening bracket -#WhiteSpaceOptions_before_closing_bracket=Before closing bracket +WhiteSpaceOptions_before_operator=Before operator +WhiteSpaceOptions_after_operator=After operator +WhiteSpaceOptions_before_comma=Before comma +WhiteSpaceOptions_after_comma=After comma +WhiteSpaceOptions_after_colon=After colon +WhiteSpaceOptions_before_colon=Before colon +WhiteSpaceOptions_before_semicolon=Before semicolon +WhiteSpaceOptions_after_semicolon=After semicolon +WhiteSpaceOptions_before_question_mark=Before question mark +WhiteSpaceOptions_after_question_mark=After question mark -#WhiteSpaceOptions_before_opening_angle_bracket=Before opening angle bracket -#WhiteSpaceOptions_after_opening_angle_bracket=After opening angle bracket -#WhiteSpaceOptions_before_closing_angle_bracket=Before closing angle bracket -#WhiteSpaceOptions_return_with_parenthesized_expression=parenthesized expression -#WhiteSpaceOptions_after_closing_angle_bracket=After closing angle bracket +WhiteSpaceOptions_before_ellipsis=Before Ellipsis +WhiteSpaceOptions_after_ellipsis=After Ellipsis -#WhiteSpaceOptions_before_operator=Before operator -#WhiteSpaceOptions_after_operator=After operator -#WhiteSpaceOptions_before_comma=Before comma -#WhiteSpaceOptions_after_comma=After comma -#WhiteSpaceOptions_after_colon=After colon -#WhiteSpaceOptions_before_colon=Before colon -#WhiteSpaceOptions_before_semicolon=Before semicolon -#WhiteSpaceOptions_after_semicolon=After semicolon -#WhiteSpaceOptions_before_question_mark=Before question mark -#WhiteSpaceOptions_after_question_mark=After question mark -#WhiteSpaceOptions_before_at=Before @ -#WhiteSpaceOptions_after_at=After @ - -#WhiteSpaceOptions_before_and=Before & list -#WhiteSpaceOptions_after_and=After & list - -#WhiteSpaceOptions_before_ellipsis=Before Ellipsis -#WhiteSpaceOptions_after_ellipsis=After Ellipsis - -#WhiteSpaceTabPage_insert_space=&Insert space: +WhiteSpaceTabPage_insert_space=&Insert space: #LineWrappingTabPage_compact_if_else=Compact 'if else' -#LineWrappingTabPage_extends_clause='extends' clause -#LineWrappingTabPage_enum_constant_arguments=Constant arguments -#LineWrappingTabPage_enum_constants=Constants -#LineWrappingTabPage_implements_clause='implements' clause LineWrappingTabPage_parameters=Parameters LineWrappingTabPage_parameters_description=parameters LineWrappingTabPage_arguments=Arguments LineWrappingTabPage_arguments_description=arguments -#LineWrappingTabPage_qualified_invocations=Qualified invocations #LineWrappingTabPage_throws_clause='throws' clause #LineWrappingTabPage_object_allocation=Object allocation arguments -#LineWrappingTabPage_qualified_object_allocation=Qualified object allocation arguments -LineWrappingTabPage_array_init=Initializer Lists -LineWrappingTabPage_array_init_description=initializer lists -#LineWrappingTabPage_explicit_constructor_invocations=Explicit constructor invocations +LineWrappingTabPage_initializer_list=Initializer List +LineWrappingTabPage_initializer_list_description=initializer list LineWrappingTabPage_conditionals=Conditionals LineWrappingTabPage_conditionals_description=conditionals #LineWrappingTabPage_binary_exprs=Binary expressions @@ -329,7 +261,6 @@ LineWrappingTabPage_function_calls_description=function calls LineWrappingTabPage_expressions=Expressions LineWrappingTabPage_expressions_description=expressions #LineWrappingTabPage_statements=Statements -#LineWrappingTabPage_enum_decls='enum' declaration LineWrappingTabPage_wrapping_policy_label_text=Lin&e wrapping policy: LineWrappingTabPage_indentation_policy_label_text=Indent&ation policy: LineWrappingTabPage_force_split_checkbox_text=&Force split @@ -350,7 +281,6 @@ LineWrappingTabPage_width_indent_option_max_line_width=Ma&ximum line width: LineWrappingTabPage_width_indent_option_default_indent_wrapped=Defa&ult indentation for wrapped lines: LineWrappingTabPage_width_indent_option_default_indent_array=Default indentation for initializer lists: LineWrappingTabPage_error_invalid_value=The key ''{0}'' contained an invalid value; resetting to defaults. -#LineWrappingTabPage_enum_superinterfaces='implements' clause #LineWrappingTabPage_assignment_alignment=Assignments @@ -395,12 +325,8 @@ BracesTabPage_option_method_declaration=Met&hod declaration: BracesTabPage_option_blocks=&Blocks: BracesTabPage_option_blocks_in_case=Bloc&ks in case statement: BracesTabPage_option_switch_case='&switch' statement: -BracesTabPage_option_array_initializer=Initiali&zer list: -BracesTabPage_option_keep_empty_array_initializer_on_one_line=Keep empty &initializer list on one line -#BracesTabPage_option_enum_declaration=&Enum declaration: -#BracesTabPage_option_enumconst_declaration=Enum c&onstant body: -#BracesTabPage_option_annotation_type_declaration=&Annotation type declaration: - +BracesTabPage_option_initializer_list=Initiali&zer list: +BracesTabPage_option_keep_empty_initializer_list_on_one_line=Keep empty &initializer list on one line CodingStyleConfigurationBlock_save_profile_dialog_title=Export Profile CodingStyleConfigurationBlock_save_profile_error_title=Export Profile CodingStyleConfigurationBlock_save_profile_error_message=Could not export the profiles. @@ -491,8 +417,6 @@ IndentationTabPage_indent_group_title=Indent IndentationTabPage_class_group_option_indent_access_specifiers_within_class_body='public', 'protected', 'private' within class &body IndentationTabPage_class_group_option_indent_declarations_compare_to_access_specifiers=De&clarations relative to 'public', 'protected', 'private' -#IndentationTabPage_class_group_option_indent_declarations_within_enum_const=Declarations within en&um constants -#IndentationTabPage_class_group_option_indent_declarations_within_enum_decl=Declarations within enum declaration IndentationTabPage_block_group_option_indent_statements_compare_to_body=Stat&ements within method/constructor body IndentationTabPage_block_group_option_indent_statements_compare_to_block=Statements within bl&ocks IndentationTabPage_namespace_group_option_indent_declarations_within_namespace=Declarations within '&namespace' definition @@ -503,13 +427,12 @@ IndentationTabPage_switch_group_option_indent_statements_within_case_body=Statem IndentationTabPage_switch_group_option_indent_break_statements='brea&k' statements IndentationTabPage_use_tabs_only_for_leading_indentations=Use tabs only for leading indentations -IndentationTabPage_show_whitespace_in_preview_label_text=Show whitespace ModifyDialog_tabpage_braces_title=B&races ModifyDialog_ProfileName_Label=&Profile name: ModifyDialog_NewCreated_Status=A new profile will be created. ModifyDialog_tabpage_indentation_title=In&dentation -#ModifyDialog_tabpage_whitespace_title=&White Space +ModifyDialog_tabpage_whitespace_title=&White Space #ModifyDialog_tabpage_blank_lines_title=Bla&nk Lines #ModifyDialog_tabpage_new_lines_title=New &Lines #ModifyDialog_tabpage_control_statements_title=Con&trol Statements @@ -534,23 +457,16 @@ ModifyDialogTabPage_NumberPreference_error_invalid_value=Invalid value: Please e #NewLinesTabPage_newlines_group_title=Insert new line #NewLinesTabPage_newlines_group_option_empty_class_body=in empty &class body -#NewLinesTabPage_newlines_group_option_empty_annotation_decl_body=in empty annotation body -#NewLinesTabPage_newlines_group_option_empty_anonymous_class_body=in empty &anonymous class body -#NewLinesTabPage_newlines_group_option_empty_enum_declaration=in empty &enum declaration -#NewLinesTabPage_newlines_group_option_empty_enum_constant=in empty enum c&onstant body #NewLinesTabPage_newlines_group_option_empty_method_body=in empt&y method body #NewLinesTabPage_newlines_group_option_empty_block=in empty &block #NewLinesTabPage_newlines_group_option_empty_end_of_file=at end of &file #NewLinesTabPage_empty_statement_group_title=Empty statements #NewLinesTabPage_emtpy_statement_group_option_empty_statement_on_new_line=Put empty &statement on new line -#NewLinesTabPage_arrayInitializer_group_title=Initializer lists +#NewLinesTabPage_arrayInitializer_group_title=Initializer list #NewLinesTabPage_array_group_option_after_opening_brace_of_array_initializer=Insert new line after openin&g brace of initializer list #NewLinesTabPage_array_group_option_before_closing_brace_of_array_initializer=Insert new line before closing brace of initiali&zer list -#NewLinesTabPage_annotations_group_title=Annotations -#NewLinesTabPage_annotations_group_option_after_annotation=&Insert new line after annotations - ProfileManager_kandr_profile_name=K&R [built-in] ProfileManager_allman_profile_name=BSD/Allman [built-in] @@ -563,3 +479,4 @@ ProfileManager_unmanaged_profile_with_name=Unmanaged profile "{0}" CPreview_formatter_exception=The formatter threw an unhandled exception while formatting the preview. ProfileConfigurationBlock_load_profile_wrong_profile_message=Import failed. This is not a valid profile: Expected ''{0}'' but encountered ''{1}''. +FormatterTabPage_ShowInvisibleCharacters_label=Show &invisible characters diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/formatter/FormatterModifyDialog.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/formatter/FormatterModifyDialog.java index c9d849aed22..3f1cd97ee08 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/formatter/FormatterModifyDialog.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/formatter/FormatterModifyDialog.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2006 IBM Corporation and others. + * Copyright (c) 2000, 2008 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -26,7 +26,7 @@ public class FormatterModifyDialog extends ModifyDialog { protected void addPages(Map values) { addTabPage(FormatterMessages.ModifyDialog_tabpage_indentation_title, new IndentationTabPage(this, values)); addTabPage(FormatterMessages.ModifyDialog_tabpage_braces_title, new BracesTabPage(this, values)); -// addTabPage(FormatterMessages.ModifyDialog_tabpage_whitespace_title, new WhiteSpaceTabPage(this, values)); + addTabPage(FormatterMessages.ModifyDialog_tabpage_whitespace_title, new WhiteSpaceTabPage(this, values)); // addTabPage(FormatterMessages.ModifyDialog_tabpage_blank_lines_title, new BlankLinesTabPage(this, values)); // addTabPage(FormatterMessages.ModifyDialog_tabpage_new_lines_title, new NewLinesTabPage(this, values)); // addTabPage(FormatterMessages.ModifyDialog_tabpage_control_statements_title, new ControlStatementsTabPage(this, values)); diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/formatter/FormatterTabPage.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/formatter/FormatterTabPage.java new file mode 100644 index 00000000000..c187082b030 --- /dev/null +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/formatter/FormatterTabPage.java @@ -0,0 +1,78 @@ +/******************************************************************************* + * Copyright (c) 2005, 2008 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + * Anton Leherbauer (Wind River Systems) + *******************************************************************************/ +package org.eclipse.cdt.internal.ui.preferences.formatter; + +import java.util.Map; + +import org.eclipse.jface.dialogs.IDialogSettings; +import org.eclipse.swt.SWT; +import org.eclipse.swt.events.SelectionAdapter; +import org.eclipse.swt.events.SelectionEvent; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.widgets.Button; +import org.eclipse.swt.widgets.Composite; + +import org.eclipse.cdt.ui.CUIPlugin; + +public abstract class FormatterTabPage extends ModifyDialogTabPage { + + private final static String SHOW_INVISIBLE_PREFERENCE_KEY= CUIPlugin.PLUGIN_ID + ".formatter_page.show_invisible_characters"; //$NON-NLS-1$ + + private CPreview fPreview; + private final IDialogSettings fDialogSettings; + private Button fShowInvisibleButton; + + public FormatterTabPage(IModifyDialogTabPage.IModificationListener modifyListener, Map workingValues) { + super(modifyListener, workingValues); + + fDialogSettings= CUIPlugin.getDefault().getDialogSettings(); + } + + protected Composite doCreatePreviewPane(Composite composite, int numColumns) { + + createLabel(numColumns - 1, composite, FormatterMessages.ModifyDialogTabPage_preview_label_text); + + fShowInvisibleButton= new Button(composite, SWT.CHECK); + fShowInvisibleButton.setText(FormatterMessages.FormatterTabPage_ShowInvisibleCharacters_label); + fShowInvisibleButton.setLayoutData(new GridData(SWT.RIGHT, SWT.TOP, true, false)); + fShowInvisibleButton.addSelectionListener(new SelectionAdapter() { + public void widgetSelected(SelectionEvent e) { + fPreview.showInvisibleCharacters(fShowInvisibleButton.getSelection()); + fDialogSettings.put(SHOW_INVISIBLE_PREFERENCE_KEY, fShowInvisibleButton.getSelection()); + doUpdatePreview(); + } + }); + fShowInvisibleButton.setSelection(isShowInvisible()); + + fPreview= doCreateCPreview(composite); + fDefaultFocusManager.add(fPreview.getControl()); + fPreview.showInvisibleCharacters(fShowInvisibleButton.getSelection()); + + final GridData gd= createGridData(numColumns, GridData.FILL_BOTH, 0); + gd.widthHint= 0; + gd.heightHint=0; + fPreview.getControl().setLayoutData(gd); + + return composite; + } + + private boolean isShowInvisible() { + return fDialogSettings.getBoolean(SHOW_INVISIBLE_PREFERENCE_KEY); + } + + protected void doUpdatePreview() { + boolean showInvisible= isShowInvisible(); + fPreview.showInvisibleCharacters(showInvisible); + fShowInvisibleButton.setSelection(showInvisible); + } + +} \ No newline at end of file diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/formatter/IModifyDialogTabPage.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/formatter/IModifyDialogTabPage.java new file mode 100644 index 00000000000..ee52d4e45c7 --- /dev/null +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/formatter/IModifyDialogTabPage.java @@ -0,0 +1,76 @@ +/******************************************************************************* + * Copyright (c) 2007, 2008 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + * Anton Leherbauer (Wind River Systems) + *******************************************************************************/ +package org.eclipse.cdt.internal.ui.preferences.formatter; + +import java.util.Map; + +import org.eclipse.core.runtime.IStatus; + +import org.eclipse.swt.widgets.Composite; + +/** + * @since 5.0 + */ +public interface IModifyDialogTabPage { + + public interface IModificationListener { + + void updateStatus(IStatus status); + + void valuesModified(); + + } + + /** + * A map containing key value pairs this tab page + * is must modify. + * + * @param workingValues the values to work with + */ + public void setWorkingValues(Map workingValues); + + /** + * A modify listener which must be informed whenever + * a value in the map passed to {@link #setWorkingValues(Map)} + * changes. The listener can also be informed about status + * changes. + * + * @param modifyListener the listener to inform + */ + public void setModifyListener(IModificationListener modifyListener); + + /** + * Create the contents of this tab page. + * + * @param parent the parent composite + * @return created content control + */ + public Composite createContents(Composite parent); + + /** + * This is called when the page becomes visible. + * Common tasks to do include: + *
  • Updating the preview.
  • + *
  • Setting the focus
  • + *
+ */ + public void makeVisible(); + + /** + * Each tab page should remember where its last focus was, and reset it + * correctly within this method. This method is only called after + * initialization on the first tab page to be displayed in order to restore + * the focus of the last session. + */ + public void setInitialFocus(); + +} \ No newline at end of file diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/formatter/IndentationTabPage.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/formatter/IndentationTabPage.java index 7096f7b8597..bcc1d3c66a5 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/formatter/IndentationTabPage.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/formatter/IndentationTabPage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 IBM Corporation and others. + * Copyright (c) 2000, 2008 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -13,7 +13,6 @@ *******************************************************************************/ package org.eclipse.cdt.internal.ui.preferences.formatter; -import java.util.HashMap; import java.util.Map; import java.util.Observable; import java.util.Observer; @@ -26,7 +25,7 @@ import org.eclipse.cdt.core.CCorePlugin; import org.eclipse.cdt.core.formatter.DefaultCodeFormatterConstants; -public class IndentationTabPage extends ModifyDialogTabPage { +public class IndentationTabPage extends FormatterTabPage { /** * Constant array for boolean selection @@ -85,8 +84,6 @@ public class IndentationTabPage extends ModifyDialogTabPage { "}"+ //$NON-NLS-1$ "} // end namespace FOO"; //$NON-NLS-1$ - private static final String SHOW_WHITESPACE = "showWhitespace"; //$NON-NLS-1$ - private TranslationUnitPreview fPreview; private String fOldTabChar= null; @@ -151,25 +148,6 @@ public class IndentationTabPage extends ModifyDialogTabPage { fPreview.setPreviewText(PREVIEW); } - /* - * @see org.eclipse.cdt.internal.ui.preferences.formatter.ModifyDialogTabPage#doCreatePreviewPane(org.eclipse.swt.widgets.Composite, int) - */ - protected Composite doCreatePreviewPane(Composite composite, int numColumns) { - - super.doCreatePreviewPane(composite, numColumns); - - final Map previewPrefs= new HashMap(); - final CheckboxPreference previewShowWhitespace= new CheckboxPreference(composite, numColumns / 2, previewPrefs, SHOW_WHITESPACE, FALSE_TRUE, - FormatterMessages.IndentationTabPage_show_whitespace_in_preview_label_text); - fDefaultFocusManager.add(previewShowWhitespace); - previewShowWhitespace.addObserver(new Observer() { - public void update(Observable o, Object arg) { - fPreview.showWhitespace(FALSE_TRUE[1] == previewPrefs.get(SHOW_WHITESPACE)); - } - }); - return composite; - } - /* * @see org.eclipse.cdt.internal.ui.preferences.formatter.ModifyDialogTabPage#doCreateCPreview(org.eclipse.swt.widgets.Composite) */ diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/formatter/LineWrappingTabPage.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/formatter/LineWrappingTabPage.java index 71f42a84d17..c94661546fc 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/formatter/LineWrappingTabPage.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/formatter/LineWrappingTabPage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 IBM Corporation and others. + * Copyright (c) 2000, 2008 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -53,7 +53,7 @@ import org.eclipse.cdt.internal.corext.util.Messages; /** * The line wrapping tab page. */ -public class LineWrappingTabPage extends ModifyDialogTabPage { +public class LineWrappingTabPage extends FormatterTabPage { /** * Represents a line wrapping category. All members are final. @@ -437,10 +437,10 @@ public class LineWrappingTabPage extends ModifyDialogTabPage { // ); private final Category fArrayInitializerExpressionsCategory= new Category( - DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_EXPRESSIONS_IN_ARRAY_INITIALIZER, + DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_EXPRESSIONS_IN_INITIALIZER_LIST, "int array[]= {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17};", //$NON-NLS-1$ - FormatterMessages.LineWrappingTabPage_array_init, - FormatterMessages.LineWrappingTabPage_array_init_description + FormatterMessages.LineWrappingTabPage_initializer_list, + FormatterMessages.LineWrappingTabPage_initializer_list_description ); // private final Category fExplicitConstructorArgumentsCategory= new Category( @@ -636,7 +636,7 @@ public class LineWrappingTabPage extends ModifyDialogTabPage { createNumberPref(lineWidthGroup, numColumns, FormatterMessages.LineWrappingTabPage_width_indent_option_max_line_width, DefaultCodeFormatterConstants.FORMATTER_LINE_SPLIT, 0, 9999); createNumberPref(lineWidthGroup, numColumns, FormatterMessages.LineWrappingTabPage_width_indent_option_default_indent_wrapped, DefaultCodeFormatterConstants.FORMATTER_CONTINUATION_INDENTATION, 0, 9999); - createNumberPref(lineWidthGroup, numColumns, FormatterMessages.LineWrappingTabPage_width_indent_option_default_indent_array, DefaultCodeFormatterConstants.FORMATTER_CONTINUATION_INDENTATION_FOR_ARRAY_INITIALIZER, 0, 9999); + createNumberPref(lineWidthGroup, numColumns, FormatterMessages.LineWrappingTabPage_width_indent_option_default_indent_array, DefaultCodeFormatterConstants.FORMATTER_CONTINUATION_INDENTATION_FOR_INITIALIZER_LIST, 0, 9999); fCategoriesViewer= new TreeViewer(composite /*categoryGroup*/, SWT.MULTI | SWT.BORDER | SWT.READ_ONLY | SWT.V_SCROLL ); fCategoriesViewer.setContentProvider(new ITreeContentProvider() { diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/formatter/ModifyDialog.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/formatter/ModifyDialog.java index 93282e53cac..9c4d5be222a 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/formatter/ModifyDialog.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/formatter/ModifyDialog.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 IBM Corporation and others. + * Copyright (c) 2000, 2008 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -48,7 +48,6 @@ import org.eclipse.swt.widgets.TabItem; import org.eclipse.cdt.ui.CUIPlugin; import org.eclipse.cdt.internal.ui.dialogs.StatusInfo; -import org.eclipse.cdt.internal.ui.preferences.formatter.ModifyDialogTabPage.IModificationListener; import org.eclipse.cdt.internal.ui.preferences.formatter.ProfileManager.CustomProfile; import org.eclipse.cdt.internal.ui.preferences.formatter.ProfileManager.Profile; import org.eclipse.cdt.internal.ui.util.ExceptionHandler; @@ -57,7 +56,7 @@ import org.eclipse.cdt.internal.ui.wizards.dialogfields.DialogField; import org.eclipse.cdt.internal.ui.wizards.dialogfields.IDialogFieldListener; import org.eclipse.cdt.internal.ui.wizards.dialogfields.StringDialogField; -public abstract class ModifyDialog extends StatusDialog implements IModificationListener { +public abstract class ModifyDialog extends StatusDialog implements IModifyDialogTabPage.IModificationListener { /** * The keys to retrieve the preferred area from the dialog settings. @@ -134,7 +133,7 @@ public abstract class ModifyDialog extends StatusDialog implements IModification if (!fNewProfile) { fTabFolder.setSelection(lastFocusNr); - ((ModifyDialogTabPage)fTabFolder.getSelection()[0].getData()).setInitialFocus(); + ((IModifyDialogTabPage)fTabFolder.getSelection()[0].getData()).setInitialFocus(); } } @@ -171,7 +170,7 @@ public abstract class ModifyDialog extends StatusDialog implements IModification public void widgetDefaultSelected(SelectionEvent e) {} public void widgetSelected(SelectionEvent e) { final TabItem tabItem= (TabItem)e.item; - final ModifyDialogTabPage page= (ModifyDialogTabPage)tabItem.getData(); + final IModifyDialogTabPage page= (IModifyDialogTabPage)tabItem.getData(); // page.fSashForm.setWeights(); fDialogSettings.put(fKeyLastFocus, fTabPages.indexOf(page)); page.makeVisible(); @@ -202,7 +201,7 @@ public abstract class ModifyDialog extends StatusDialog implements IModification lastWidth= initialSize.x; int lastHeight= fDialogSettings.getInt(fKeyPreferredHight); if (initialSize.y > lastHeight) - lastHeight= initialSize.x; + lastHeight= initialSize.y; return new Point(lastWidth, lastHeight); } catch (NumberFormatException ex) { } @@ -309,7 +308,7 @@ public abstract class ModifyDialog extends StatusDialog implements IModification super.createButtonsForButtonBar(parent); } - protected final void addTabPage(String title, ModifyDialogTabPage tabPage) { + protected final void addTabPage(String title, IModifyDialogTabPage tabPage) { final TabItem tabItem= new TabItem(fTabFolder, SWT.NONE); applyDialogFont(tabItem.getControl()); tabItem.setText(title); @@ -333,13 +332,18 @@ public abstract class ModifyDialog extends StatusDialog implements IModification } private void doValidate() { + String name= fProfileNameField.getText().trim(); + if (name.equals(fProfile.getName()) && fProfile.hasEqualSettings(fWorkingValues, fWorkingValues.keySet())) { + updateStatus(StatusInfo.OK_STATUS); + return; + } + IStatus status= validateProfileName(); if (status.matches(IStatus.ERROR)) { updateStatus(status); return; } - String name= fProfileNameField.getText().trim(); if (!name.equals(fProfile.getName()) && fProfileManager.containsName(name)) { updateStatus(new Status(IStatus.ERROR, CUIPlugin.PLUGIN_ID, 0, FormatterMessages.ModifyDialog_Duplicate_Status, null)); return; diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/formatter/ModifyDialogTabPage.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/formatter/ModifyDialogTabPage.java index ead3b20502e..8af8eacdfdb 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/formatter/ModifyDialogTabPage.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/formatter/ModifyDialogTabPage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 IBM Corporation and others. + * Copyright (c) 2000, 2008 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -25,6 +25,9 @@ import org.eclipse.jface.dialogs.IDialogConstants; import org.eclipse.jface.dialogs.IDialogSettings; import org.eclipse.swt.SWT; import org.eclipse.swt.custom.SashForm; +import org.eclipse.swt.custom.ScrolledComposite; +import org.eclipse.swt.events.ControlEvent; +import org.eclipse.swt.events.ControlListener; import org.eclipse.swt.events.FocusAdapter; import org.eclipse.swt.events.FocusEvent; import org.eclipse.swt.events.FocusListener; @@ -32,6 +35,8 @@ import org.eclipse.swt.events.ModifyEvent; import org.eclipse.swt.events.ModifyListener; import org.eclipse.swt.events.SelectionAdapter; import org.eclipse.swt.events.SelectionEvent; +import org.eclipse.swt.graphics.Point; +import org.eclipse.swt.graphics.Rectangle; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.widgets.Button; @@ -40,6 +45,7 @@ import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Control; import org.eclipse.swt.widgets.Group; import org.eclipse.swt.widgets.Label; +import org.eclipse.swt.widgets.Layout; import org.eclipse.swt.widgets.Text; import org.eclipse.cdt.ui.CUIPlugin; @@ -48,16 +54,7 @@ import org.eclipse.cdt.internal.ui.util.Messages; import org.eclipse.cdt.internal.ui.util.PixelConverter; -public abstract class ModifyDialogTabPage { - - public interface IModificationListener { - - void updateStatus(IStatus status); - - void valuesModified(); - - } - +public abstract class ModifyDialogTabPage implements IModifyDialogTabPage { /** * This is the default listener for any of the Preference * classes. It is added by the respective factory methods and @@ -514,6 +511,68 @@ public abstract class ModifyDialogTabPage { fDialogSettings.put(PREF_LAST_FOCUS_INDEX, -1); } } + + /** + * Layout used for the settings part. Makes sure to show scrollbars + * if necessary. The settings part needs to be layouted on resize. + */ + private static class PageLayout extends Layout { + + private final ScrolledComposite fContainer; + private final int fMinimalWidth; + private final int fMinimalHight; + + private PageLayout(ScrolledComposite container, int minimalWidth, int minimalHight) { + fContainer= container; + fMinimalWidth= minimalWidth; + fMinimalHight= minimalHight; + } + + public Point computeSize(Composite composite, int wHint, int hHint, boolean force) { + if (wHint != SWT.DEFAULT && hHint != SWT.DEFAULT) { + return new Point(wHint, hHint); + } + + int x = fMinimalWidth; + int y = fMinimalHight; + Control[] children = composite.getChildren(); + for (int i = 0; i < children.length; i++) { + Point size = children[i].computeSize(SWT.DEFAULT, SWT.DEFAULT, force); + x = Math.max(x, size.x); + y = Math.max(y, size.y); + } + + Rectangle area= fContainer.getClientArea(); + if (area.width > x) { + fContainer.setExpandHorizontal(true); + } else { + fContainer.setExpandHorizontal(false); + } + + if (area.height > y) { + fContainer.setExpandVertical(true); + } else { + fContainer.setExpandVertical(false); + } + + if (wHint != SWT.DEFAULT) { + x = wHint; + } + if (hHint != SWT.DEFAULT) { + y = hHint; + } + + return new Point(x, y); + } + + public void layout(Composite composite, boolean force) { + Rectangle rect = composite.getClientArea(); + Control[] children = composite.getChildren(); + for (int i = 0; i < children.length; i++) { + children[i].setSize(rect.width, rect.height); + } + } + } /** * The default focus manager. This widget knows all widgets which can have the focus @@ -536,23 +595,41 @@ public abstract class ModifyDialogTabPage { /** * The map where the current settings are stored. */ - protected final Map fWorkingValues; + protected Map fWorkingValues; /** * The modify dialog where we can display status messages. */ - private final IModificationListener fModifyListener; + private IModifyDialogTabPage.IModificationListener fModifyListener; /* * Create a new ModifyDialogTabPage */ - public ModifyDialogTabPage(IModificationListener modifyListener, Map workingValues) { + public ModifyDialogTabPage(IModifyDialogTabPage.IModificationListener modifyListener, Map workingValues) { fWorkingValues= workingValues; fModifyListener= modifyListener; fDefaultFocusManager= new DefaultFocusManager(); } + public ModifyDialogTabPage() { + fDefaultFocusManager= new DefaultFocusManager(); + } + + /** + * {@inheritDoc} + */ + public void setWorkingValues(Map workingValues) { + fWorkingValues= workingValues; + } + + /** + * {@inheritDoc} + */ + public void setModifyListener(IModifyDialogTabPage.IModificationListener modifyListener) { + fModifyListener= modifyListener; + } + /** * Create the contents of this tab page. Subclasses cannot override this, * instead they must implement doCreatePreferences. doCreatePreview may also @@ -567,33 +644,74 @@ public abstract class ModifyDialogTabPage { fPixelConverter= new PixelConverter(parent); } - final SashForm fSashForm = new SashForm(parent, SWT.HORIZONTAL); - fSashForm.setFont(parent.getFont()); + final SashForm sashForm = new SashForm(parent, SWT.HORIZONTAL); + sashForm.setFont(parent.getFont()); - final Composite settingsPane= new Composite(fSashForm, SWT.NONE); - settingsPane.setFont(fSashForm.getFont()); + Composite scrollContainer = new Composite(sashForm, SWT.NONE); - final GridLayout layout= new GridLayout(numColumns, false); + GridData gridData = new GridData(SWT.FILL, SWT.FILL, true, true); + scrollContainer.setLayoutData(gridData); + + GridLayout layout= new GridLayout(2, false); + layout.marginHeight= 0; + layout.marginWidth= 0; + layout.horizontalSpacing= 0; + layout.verticalSpacing= 0; + scrollContainer.setLayout(layout); + + ScrolledComposite scroll= new ScrolledComposite(scrollContainer, SWT.V_SCROLL | SWT.H_SCROLL); + scroll.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); + scroll.setExpandHorizontal(true); + scroll.setExpandVertical(true); + + final Composite settingsContainer= new Composite(scroll, SWT.NONE); + settingsContainer.setFont(sashForm.getFont()); + + scroll.setContent(settingsContainer); + + settingsContainer.setLayout(new PageLayout(scroll, 400, 400)); + settingsContainer.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); + + Composite settingsPane= new Composite(settingsContainer, SWT.NONE); + settingsPane.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); + + layout= new GridLayout(numColumns, false); layout.verticalSpacing= (int)(1.5 * fPixelConverter.convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING)); layout.horizontalSpacing= fPixelConverter.convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING); layout.marginHeight= fPixelConverter.convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN); layout.marginWidth= fPixelConverter.convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN); settingsPane.setLayout(layout); doCreatePreferences(settingsPane, numColumns); + + settingsContainer.setSize(settingsContainer.computeSize(SWT.DEFAULT, SWT.DEFAULT)); + + scroll.addControlListener(new ControlListener() { - final Composite previewPane= new Composite(fSashForm, SWT.NONE); + public void controlMoved(ControlEvent e) { + } + + public void controlResized(ControlEvent e) { + settingsContainer.setSize(settingsContainer.computeSize(SWT.DEFAULT, SWT.DEFAULT)); + } + }); + + Label sashHandle = new Label(scrollContainer, SWT.SEPARATOR | SWT.VERTICAL); + gridData= new GridData(SWT.RIGHT, SWT.FILL, false, true); + sashHandle.setLayoutData(gridData); + + final Composite previewPane= new Composite(sashForm, SWT.NONE); previewPane.setLayout(createGridLayout(numColumns, true)); - previewPane.setFont(fSashForm.getFont()); + previewPane.setFont(sashForm.getFont()); doCreatePreviewPane(previewPane, numColumns); initializePage(); - fSashForm.setWeights(new int [] {3, 3}); - return fSashForm; + sashForm.setWeights(new int [] {3, 3}); + return sashForm; } /** - * This method is called after all controls have been alloated, including the preview. + * This method is called after all controls have been allocated, including the preview. * It can be used to set the preview text and to create listeners. * */ @@ -641,11 +759,7 @@ public abstract class ModifyDialogTabPage { protected abstract CPreview doCreateCPreview(Composite parent); /** - * This is called when the page becomes visible. - * Common tasks to do include: - *
  • Updating the preview.
  • - *
  • Setting the focus
  • - *
+ * {@inheritDoc} */ final public void makeVisible() { fDefaultFocusManager.resetFocus(); @@ -661,11 +775,8 @@ public abstract class ModifyDialogTabPage { fModifyListener.valuesModified(); } /** - * Each tab page should remember where its last focus was, and reset it - * correctly within this method. This method is only called after - * initialization on the first tab page to be displayed in order to restore - * the focus of the last session. - */ + * {@inheritDoc} + */ public void setInitialFocus() { if (fDefaultFocusManager.isUsed()) { fDefaultFocusManager.restoreFocus(); @@ -729,7 +840,9 @@ public abstract class ModifyDialogTabPage { final Label label= new Label(parent, SWT.WRAP); label.setFont(parent.getFont()); label.setText(text); - label.setLayoutData(createGridData(numColumns, gridDataStyle, SWT.DEFAULT)); + + PixelConverter pixelConverter= new PixelConverter(parent); + label.setLayoutData(createGridData(numColumns, gridDataStyle, pixelConverter.convertHorizontalDLUsToPixels(150))); return label; } diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/formatter/ProfileManager.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/formatter/ProfileManager.java index 543ea70fd0a..bffe6c0345c 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/formatter/ProfileManager.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/formatter/ProfileManager.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 IBM Corporation and others. + * Copyright (c) 2000, 2008 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -13,6 +13,7 @@ package org.eclipse.cdt.internal.ui.preferences.formatter; import java.util.ArrayList; +import java.util.Collection; import java.util.Collections; import java.util.HashMap; import java.util.Iterator; @@ -82,7 +83,7 @@ public abstract class ProfileManager extends Observable { public abstract int getVersion(); - public boolean hasEqualSettings(Map otherMap, List allKeys) { + public boolean hasEqualSettings(Map otherMap, Collection allKeys) { Map settings= getSettings(); for (Iterator iter= allKeys.iterator(); iter.hasNext(); ){ String key= (String) iter.next(); diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/formatter/SnippetPreview.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/formatter/SnippetPreview.java new file mode 100644 index 00000000000..b2f26d3b7f2 --- /dev/null +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/formatter/SnippetPreview.java @@ -0,0 +1,108 @@ +/******************************************************************************* + * Copyright (c) 2000, 2008 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + * Anton Leherbauer (Wind River Systems) + *******************************************************************************/ + +package org.eclipse.cdt.internal.ui.preferences.formatter; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.Iterator; +import java.util.Map; + +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Status; +import org.eclipse.jface.text.Document; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.text.edits.TextEdit; + +import org.eclipse.cdt.ui.CUIPlugin; + +import org.eclipse.cdt.internal.corext.util.CodeFormatterUtil; + +import org.eclipse.cdt.internal.ui.ICStatusConstants; + + +public class SnippetPreview extends CPreview { + + public final static class PreviewSnippet { + + public String header; + public final String source; + public final int kind; + + public PreviewSnippet(int kind, String source) { + this.kind= kind; + this.source= source; + } + } + + private ArrayList fSnippets; + + public SnippetPreview(Map workingValues, Composite parent) { + super(workingValues, parent); + fSnippets= new ArrayList(); + } + + protected void doFormatPreview() { + if (fSnippets.isEmpty()) { + fPreviewDocument.set(""); //$NON-NLS-1$ + return; + } + + //This delimiter looks best for invisible characters + final String delimiter= "\n"; //$NON-NLS-1$ + + final StringBuffer buffer= new StringBuffer(); + for (final Iterator iter= fSnippets.iterator(); iter.hasNext();) { + final PreviewSnippet snippet= (PreviewSnippet) iter.next(); + String formattedSource; + try { + TextEdit edit= CodeFormatterUtil.format(snippet.kind, snippet.source, 0, delimiter, fWorkingValues); + if (edit == null) { + formattedSource= snippet.source; + } else { + Document document= new Document(snippet.source); + edit.apply(document, TextEdit.NONE); + formattedSource= document.get(); + } + } catch (Exception e) { + final IStatus status= new Status(IStatus.ERROR, CUIPlugin.getPluginId(), ICStatusConstants.INTERNAL_ERROR, + FormatterMessages.CPreview_formatter_exception, e); + CUIPlugin.getDefault().log(status); + continue; + } + buffer.append(delimiter); + buffer.append(formattedSource); + buffer.append(delimiter); + buffer.append(delimiter); + } + fPreviewDocument.set(buffer.toString()); + } + + + + public void add(PreviewSnippet snippet) { + fSnippets.add(snippet); + } + + public void remove(PreviewSnippet snippet) { + fSnippets.remove(snippet); + } + + public void addAll(Collection snippets) { + fSnippets.addAll(snippets); + } + + public void clear() { + fSnippets.clear(); + } + +} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/formatter/WhiteSpaceOptions.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/formatter/WhiteSpaceOptions.java new file mode 100644 index 00000000000..e32ae191841 --- /dev/null +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/formatter/WhiteSpaceOptions.java @@ -0,0 +1,1000 @@ +/******************************************************************************* + * Copyright (c) 2000, 2008 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + * Anton Leherbauer (Wind River Systems) + *******************************************************************************/ + +package org.eclipse.cdt.internal.ui.preferences.formatter; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.Iterator; +import java.util.List; +import java.util.Map; + +import org.eclipse.cdt.core.CCorePlugin; +import org.eclipse.cdt.core.formatter.CodeFormatter; +import org.eclipse.cdt.core.formatter.DefaultCodeFormatterConstants; + +import org.eclipse.cdt.internal.ui.preferences.formatter.SnippetPreview.PreviewSnippet; + + +/** + * Manage code formatter white space options on a higher level. + */ +public final class WhiteSpaceOptions { + + /** + * Represents a node in the options tree. + */ + public abstract static class Node { + + private final InnerNode fParent; + private final String fName; + + public int index; + + protected final Map fWorkingValues; + protected final ArrayList fChildren; + + public Node(InnerNode parent, Map workingValues, String message) { + if (workingValues == null || message == null) + throw new IllegalArgumentException(); + fParent= parent; + fWorkingValues= workingValues; + fName= message; + fChildren= new ArrayList(); + if (fParent != null) + fParent.add(this); + } + + public abstract void setChecked(boolean checked); + + public boolean hasChildren() { + return !fChildren.isEmpty(); + } + + public List getChildren() { + return Collections.unmodifiableList(fChildren); + } + + public InnerNode getParent() { + return fParent; + } + + public final String toString() { + return fName; + } + + public abstract List getSnippets(); + + public abstract void getCheckedLeafs(List list); + } + + /** + * A node representing a group of options in the tree. + */ + public static class InnerNode extends Node { + + public InnerNode(InnerNode parent, Map workingValues, String messageKey) { + super(parent, workingValues, messageKey); + } + + public void setChecked(boolean checked) { + for (final Iterator iter = fChildren.iterator(); iter.hasNext();) + ((Node)iter.next()).setChecked(checked); + } + + public void add(Node child) { + fChildren.add(child); + } + + public List getSnippets() { + final ArrayList snippets= new ArrayList(fChildren.size()); + for (Iterator iter= fChildren.iterator(); iter.hasNext();) { + final List childSnippets= ((Node)iter.next()).getSnippets(); + for (final Iterator chIter= childSnippets.iterator(); chIter.hasNext(); ) { + final Object snippet= chIter.next(); + if (!snippets.contains(snippet)) + snippets.add(snippet); + } + } + return snippets; + } + + public void getCheckedLeafs(List list) { + for (Iterator iter= fChildren.iterator(); iter.hasNext();) { + ((Node)iter.next()).getCheckedLeafs(list); + } + } + } + + + /** + * A node representing a concrete white space option in the tree. + */ + public static class OptionNode extends Node { + private final String fKey; + private final ArrayList fSnippets; + + public OptionNode(InnerNode parent, Map workingValues, String messageKey, String key, PreviewSnippet snippet) { + super(parent, workingValues, messageKey); + fKey= key; + fSnippets= new ArrayList(1); + fSnippets.add(snippet); + } + + public void setChecked(boolean checked) { + fWorkingValues.put(fKey, checked ? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT); + } + + public boolean getChecked() { + return CCorePlugin.INSERT.equals(fWorkingValues.get(fKey)); + } + + public List getSnippets() { + return fSnippets; + } + + public void getCheckedLeafs(List list) { + if (getChecked()) + list.add(this); + } + } + + + + /** + * Preview snippets. + */ + + private final PreviewSnippet FOR_PREVIEW= new PreviewSnippet( + CodeFormatter.K_STATEMENTS, + "for (int i= 0, j= argc; i < argc; i++, j--) {}" //$NON-NLS-1$ + ); + + private final PreviewSnippet WHILE_PREVIEW= new PreviewSnippet( + CodeFormatter.K_STATEMENTS, + "while (condition) {} do {} while (condition);" //$NON-NLS-1$ + ); + + private final PreviewSnippet CATCH_PREVIEW= new PreviewSnippet( + CodeFormatter.K_STATEMENTS, + "try { number= Math::parseInt(value); } catch (Math::Exception e) {}"); //$NON-NLS-1$ + + private final PreviewSnippet IF_PREVIEW= new PreviewSnippet( + CodeFormatter.K_STATEMENTS, + "if (condition) { return foo; } else {return bar;}"); //$NON-NLS-1$ + + private final PreviewSnippet SWITCH_PREVIEW= new PreviewSnippet( + CodeFormatter.K_STATEMENTS, + "switch (number) { case RED: return GREEN; case GREEN: return BLUE; case BLUE: return RED; default: return BLACK;}"); //$NON-NLS-1$ + + private final PreviewSnippet METHOD_DECL_PREVIEW= new PreviewSnippet( + CodeFormatter.K_CLASS_BODY_DECLARATIONS, + "void foo() throw(E0, E1) {}" + //$NON-NLS-1$ + "void bar(int x, int y) throw(E0, E1) {}"); //$NON-NLS-1$ + + private final PreviewSnippet INITIALIZER_LIST_PREVIEW= new PreviewSnippet( + CodeFormatter.K_STATEMENTS, + "int array[]= {1, 2, 3};"); //$NON-NLS-1$ + + private final PreviewSnippet ARRAY_PREVIEW= new PreviewSnippet( + CodeFormatter.K_STATEMENTS, + "int array[]= {1, 2, 3};\n" + //$NON-NLS-1$ + "array [2] = 0;\n" + //$NON-NLS-1$ + "int * parray= new int[3];" + //$NON-NLS-1$ + "delete[] parray;"); //$NON-NLS-1$ + + private final PreviewSnippet METHOD_CALL_PREVIEW= new PreviewSnippet( + CodeFormatter.K_STATEMENTS, + "foo();\n" + //$NON-NLS-1$ + "bar(x, y);"); //$NON-NLS-1$ + + private final PreviewSnippet LABEL_PREVIEW= new PreviewSnippet( + CodeFormatter.K_STATEMENTS, + "label: for (int i= 0; i class map {};\n" + //$NON-NLS-1$ + "map m;" //$NON-NLS-1$ + ); + + /** + * Create the tree, in this order: syntax element - position - abstract element + * @param workingValues + * @return returns roots (type Node) + */ + public List createTreeBySyntaxElem(Map workingValues) { + final ArrayList roots= new ArrayList(); + + InnerNode element; + + element= new InnerNode(null, workingValues, FormatterMessages.WhiteSpaceOptions_opening_paren); + createBeforeOpenParenTree(workingValues, createChild(element, workingValues, FormatterMessages.WhiteSpaceOptions_before)); + createAfterOpenParenTree(workingValues, createChild(element, workingValues, FormatterMessages.WhiteSpaceOptions_after)); + roots.add(element); + + element= new InnerNode(null, workingValues, FormatterMessages.WhiteSpaceOptions_closing_paren); + createBeforeClosingParenTree(workingValues, createChild(element, workingValues, FormatterMessages.WhiteSpaceOptions_before)); + createAfterCloseParenTree(workingValues, createChild(element, workingValues, FormatterMessages.WhiteSpaceOptions_after)); + roots.add(element); + + element= new InnerNode(null, workingValues, FormatterMessages.WhiteSpaceOptions_opening_brace); + createBeforeOpenBraceTree(workingValues, createChild(element, workingValues, FormatterMessages.WhiteSpaceOptions_before)); + createAfterOpenBraceTree(workingValues, createChild(element, workingValues, FormatterMessages.WhiteSpaceOptions_after)); + roots.add(element); + + element= new InnerNode(null, workingValues, FormatterMessages.WhiteSpaceOptions_closing_brace); + createBeforeClosingBraceTree(workingValues, createChild(element, workingValues, FormatterMessages.WhiteSpaceOptions_before)); + createAfterCloseBraceTree(workingValues, createChild(element, workingValues, FormatterMessages.WhiteSpaceOptions_after)); + roots.add(element); + + element= new InnerNode(null, workingValues, FormatterMessages.WhiteSpaceOptions_opening_bracket); + createBeforeOpenBracketTree(workingValues, createChild(element, workingValues, FormatterMessages.WhiteSpaceOptions_before)); + createAfterOpenBracketTree(workingValues, createChild(element, workingValues, FormatterMessages.WhiteSpaceOptions_after)); + roots.add(element); + + element= new InnerNode(null, workingValues, FormatterMessages.WhiteSpaceOptions_closing_bracket); + createBeforeClosingBracketTree(workingValues, createChild(element, workingValues, FormatterMessages.WhiteSpaceOptions_before)); + roots.add(element); + + element= new InnerNode(null, workingValues, FormatterMessages.WhiteSpaceOptions_operator); + createBeforeOperatorTree(workingValues, createChild(element, workingValues, FormatterMessages.WhiteSpaceOptions_before)); + createAfterOperatorTree(workingValues, createChild(element, workingValues, FormatterMessages.WhiteSpaceOptions_after)); + roots.add(element); + + element= new InnerNode(null, workingValues, FormatterMessages.WhiteSpaceOptions_comma); + createBeforeCommaTree(workingValues, createChild(element, workingValues, FormatterMessages.WhiteSpaceOptions_before)); + createAfterCommaTree(workingValues, createChild(element, workingValues, FormatterMessages.WhiteSpaceOptions_after)); + roots.add(element); + + element= new InnerNode(null, workingValues, FormatterMessages.WhiteSpaceOptions_colon); + createBeforeColonTree(workingValues, createChild(element, workingValues, FormatterMessages.WhiteSpaceOptions_before)); + createAfterColonTree(workingValues, createChild(element, workingValues, FormatterMessages.WhiteSpaceOptions_after)); + roots.add(element); + + element= new InnerNode(null, workingValues, FormatterMessages.WhiteSpaceOptions_semicolon); + createBeforeSemicolonTree(workingValues, createChild(element, workingValues, FormatterMessages.WhiteSpaceOptions_before)); + createAfterSemicolonTree(workingValues, createChild(element, workingValues, FormatterMessages.WhiteSpaceOptions_after)); + roots.add(element); + + element= new InnerNode(null, workingValues, FormatterMessages.WhiteSpaceOptions_question_mark); + createBeforeQuestionTree(workingValues, createChild(element, workingValues, FormatterMessages.WhiteSpaceOptions_before)); + createAfterQuestionTree(workingValues, createChild(element, workingValues, FormatterMessages.WhiteSpaceOptions_after)); + roots.add(element); + + element= new InnerNode(null, workingValues, FormatterMessages.WhiteSpaceOptions_between_empty_parens); + createBetweenEmptyParenTree(workingValues, element); + roots.add(element); + + element= new InnerNode(null, workingValues, FormatterMessages.WhiteSpaceOptions_between_empty_braces); + createBetweenEmptyBracesTree(workingValues, element); + roots.add(element); + + element= new InnerNode(null, workingValues, FormatterMessages.WhiteSpaceOptions_between_empty_brackets); + createBetweenEmptyBracketsTree(workingValues, element); + roots.add(element); + + return roots; + } + + /** + * Create the tree, in this order: position - syntax element - abstract + * element + * @param workingValues + * @return returns roots (type Node) + */ + public List createAltTree(Map workingValues) { + + final ArrayList roots= new ArrayList(); + + InnerNode parent; + + parent= createParentNode(roots, workingValues, FormatterMessages.WhiteSpaceOptions_before_opening_paren); + createBeforeOpenParenTree(workingValues, parent); + + parent= createParentNode(roots, workingValues, FormatterMessages.WhiteSpaceOptions_after_opening_paren); + createAfterOpenParenTree(workingValues, parent); + + parent= createParentNode(roots, workingValues, FormatterMessages.WhiteSpaceOptions_before_closing_paren); + createBeforeClosingParenTree(workingValues, parent); + + parent= createParentNode(roots, workingValues, FormatterMessages.WhiteSpaceOptions_after_closing_paren); + createAfterCloseParenTree(workingValues, parent); + + parent= createParentNode(roots, workingValues, FormatterMessages.WhiteSpaceOptions_between_empty_parens); + createBetweenEmptyParenTree(workingValues, parent); + + parent= createParentNode(roots, workingValues, FormatterMessages.WhiteSpaceOptions_before_opening_brace); + createBeforeOpenBraceTree(workingValues, parent); + + parent= createParentNode(roots, workingValues, FormatterMessages.WhiteSpaceOptions_after_opening_brace); + createAfterOpenBraceTree(workingValues, parent); + + parent= createParentNode(roots, workingValues, FormatterMessages.WhiteSpaceOptions_before_closing_brace); + createBeforeClosingBraceTree(workingValues, parent); + + parent= createParentNode(roots, workingValues, FormatterMessages.WhiteSpaceOptions_after_closing_brace); + createAfterCloseBraceTree(workingValues, parent); + + parent= createParentNode(roots, workingValues, FormatterMessages.WhiteSpaceOptions_between_empty_braces); + createBetweenEmptyBracesTree(workingValues, parent); + + parent= createParentNode(roots, workingValues, FormatterMessages.WhiteSpaceOptions_before_opening_bracket); + createBeforeOpenBracketTree(workingValues, parent); + + parent= createParentNode(roots, workingValues, FormatterMessages.WhiteSpaceOptions_after_opening_bracket); + createAfterOpenBracketTree(workingValues, parent); + + parent= createParentNode(roots, workingValues, FormatterMessages.WhiteSpaceOptions_before_closing_bracket); + createBeforeClosingBracketTree(workingValues, parent); + + parent= createParentNode(roots, workingValues, FormatterMessages.WhiteSpaceOptions_between_empty_brackets); + createBetweenEmptyBracketsTree(workingValues, parent); + + parent= createParentNode(roots, workingValues, FormatterMessages.WhiteSpaceOptions_before_opening_angle_bracket); + createBeforeOpenAngleBracketTree(workingValues, parent); + + parent= createParentNode(roots, workingValues, FormatterMessages.WhiteSpaceOptions_after_opening_angle_bracket); + createAfterOpenAngleBracketTree(workingValues, parent); + + parent= createParentNode(roots, workingValues, FormatterMessages.WhiteSpaceOptions_before_closing_angle_bracket); + createBeforeClosingAngleBracketTree(workingValues, parent); + + parent= createParentNode(roots, workingValues, FormatterMessages.WhiteSpaceOptions_after_closing_angle_bracket); + createAfterClosingAngleBracketTree(workingValues, parent); + + + parent= createParentNode(roots, workingValues, FormatterMessages.WhiteSpaceOptions_before_operator); + createBeforeOperatorTree(workingValues, parent); + + parent= createParentNode(roots, workingValues, FormatterMessages.WhiteSpaceOptions_after_operator); + createAfterOperatorTree(workingValues, parent); + + parent= createParentNode(roots, workingValues, FormatterMessages.WhiteSpaceOptions_before_comma); + createBeforeCommaTree(workingValues, parent); + + parent= createParentNode(roots, workingValues, FormatterMessages.WhiteSpaceOptions_after_comma); + createAfterCommaTree(workingValues, parent); + + parent= createParentNode(roots, workingValues, FormatterMessages.WhiteSpaceOptions_after_colon); + createAfterColonTree(workingValues, parent); + + parent= createParentNode(roots, workingValues, FormatterMessages.WhiteSpaceOptions_before_colon); + createBeforeColonTree(workingValues, parent); + + parent= createParentNode(roots, workingValues, FormatterMessages.WhiteSpaceOptions_before_semicolon); + createBeforeSemicolonTree(workingValues, parent); + + parent= createParentNode(roots, workingValues, FormatterMessages.WhiteSpaceOptions_after_semicolon); + createAfterSemicolonTree(workingValues, parent); + + parent= createParentNode(roots, workingValues, FormatterMessages.WhiteSpaceOptions_before_question_mark); + createBeforeQuestionTree(workingValues, parent); + + parent= createParentNode(roots, workingValues, FormatterMessages.WhiteSpaceOptions_after_question_mark); + createAfterQuestionTree(workingValues, parent); + +// parent= createParentNode(roots, workingValues, FormatterMessages.WhiteSpaceOptions_before_ellipsis); +// createBeforeEllipsis(workingValues, parent); +// +// parent= createParentNode(roots, workingValues, FormatterMessages.WhiteSpaceOptions_after_ellipsis); +// createAfterEllipsis(workingValues, parent); + + return roots; + } + + private InnerNode createParentNode(List roots, Map workingValues, String text) { + final InnerNode parent= new InnerNode(null, workingValues, text); + roots.add(parent); + return parent; + } + + public ArrayList createTreeByJavaElement(Map workingValues) { + + final InnerNode declarations= new InnerNode(null, workingValues, FormatterMessages.WhiteSpaceTabPage_declarations); + createClassTree(workingValues, declarations); + createDeclaratorListTree(workingValues, declarations); +// createConstructorTree(workingValues, declarations); + createMethodDeclTree(workingValues, declarations); + createLabelTree(workingValues, declarations); + + final InnerNode statements= new InnerNode(null, workingValues, FormatterMessages.WhiteSpaceTabPage_statements); + createOption(statements, workingValues, FormatterMessages.WhiteSpaceOptions_before_semicolon, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_SEMICOLON, SEMICOLON_PREVIEW); + createBlockTree(workingValues, statements); + createIfStatementTree(workingValues, statements); + createForStatementTree(workingValues, statements); + createSwitchStatementTree(workingValues, statements); + createDoWhileTree(workingValues, statements); + createTryStatementTree(workingValues, statements); +// createReturnTree(workingValues, statements); +// createThrowTree(workingValues, statements); + + final InnerNode expressions= new InnerNode(null, workingValues, FormatterMessages.WhiteSpaceTabPage_expressions); + createFunctionCallTree(workingValues, expressions); + createAssignmentTree(workingValues, expressions); + createInitializerListTree(workingValues, expressions); + createOperatorTree(workingValues, expressions); + createParenthesizedExpressionTree(workingValues, expressions); + createTypecastTree(workingValues, expressions); + createConditionalTree(workingValues, expressions); + createExpressionListTree(workingValues, expressions); + + final InnerNode arrays= new InnerNode(null, workingValues, FormatterMessages.WhiteSpaceTabPage_arrays); + createArrayTree(workingValues, arrays); + + final InnerNode templates= new InnerNode(null, workingValues, FormatterMessages.WhiteSpaceTabPage_templates); + createTemplateArgumentTree(workingValues, templates); + createTemplateParameterTree(workingValues, templates); + + final ArrayList roots= new ArrayList(); + roots.add(declarations); + roots.add(statements); + roots.add(expressions); + roots.add(arrays); + roots.add(templates); + return roots; + } + + private void createBeforeQuestionTree(Map workingValues, final InnerNode parent) { + createOption(parent, workingValues, FormatterMessages.WhiteSpaceOptions_conditional, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_QUESTION_IN_CONDITIONAL, CONDITIONAL_PREVIEW); + } + + private void createBeforeSemicolonTree(Map workingValues, final InnerNode parent) { + createOption(parent, workingValues, FormatterMessages.WhiteSpaceOptions_for, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_SEMICOLON_IN_FOR, FOR_PREVIEW); + createOption(parent, workingValues, FormatterMessages.WhiteSpaceOptions_statements, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_SEMICOLON, SEMICOLON_PREVIEW); + } + + private void createBeforeColonTree(Map workingValues, final InnerNode parent) { + createOption(parent, workingValues, FormatterMessages.WhiteSpaceOptions_conditional, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COLON_IN_CONDITIONAL, CONDITIONAL_PREVIEW); + createOption(parent, workingValues, FormatterMessages.WhiteSpaceOptions_label, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COLON_IN_LABELED_STATEMENT, LABEL_PREVIEW); + createOption(parent, workingValues, FormatterMessages.WhiteSpaceOptions_base_clause, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COLON_IN_BASE_CLAUSE, CLASS_DECL_PREVIEW); + + final InnerNode switchStatement= createChild(parent, workingValues, FormatterMessages.WhiteSpaceOptions_switch); + createOption(switchStatement, workingValues, FormatterMessages.WhiteSpaceOptions_case, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COLON_IN_CASE, SWITCH_PREVIEW); + createOption(switchStatement, workingValues, FormatterMessages.WhiteSpaceOptions_default, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COLON_IN_DEFAULT, SWITCH_PREVIEW); + } + + private void createBeforeCommaTree(Map workingValues, final InnerNode parent) { + +// final InnerNode forStatement= createChild(parent, workingValues, FormatterMessages.WhiteSpaceOptions_for); +// createOption(forStatement, workingValues, FormatterMessages.WhiteSpaceOptions_initialization, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_FOR_INITS, FOR_PREVIEW); +// createOption(forStatement, workingValues, FormatterMessages.WhiteSpaceOptions_incrementation, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_FOR_INCREMENTS, FOR_PREVIEW); + + final InnerNode invocation= createChild(parent, workingValues, FormatterMessages.WhiteSpaceOptions_arguments); + createOption(invocation, workingValues, FormatterMessages.WhiteSpaceOptions_method_call, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_METHOD_INVOCATION_ARGUMENTS, METHOD_CALL_PREVIEW); +// createOption(invocation, workingValues, FormatterMessages.WhiteSpaceOptions_alloc_expr, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_ALLOCATION_EXPRESSION, ALLOC_PREVIEW); + + final InnerNode decl= createChild(parent, workingValues, FormatterMessages.WhiteSpaceOptions_parameters); +// createOption(decl, workingValues, FormatterMessages.WhiteSpaceOptions_constructor, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_CONSTRUCTOR_DECLARATION_PARAMETERS, CONSTRUCTOR_DECL_PREVIEW); + createOption(decl, workingValues, FormatterMessages.WhiteSpaceOptions_method, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_METHOD_DECLARATION_PARAMETERS, METHOD_DECL_PREVIEW); + +// final InnerNode throwsDecl= createChild(parent, workingValues, FormatterMessages.WhiteSpaceOptions_throws); +// createOption(throwsDecl, workingValues, FormatterMessages.WhiteSpaceOptions_constructor, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_CONSTRUCTOR_DECLARATION_THROWS, CONSTRUCTOR_DECL_PREVIEW); +// createOption(throwsDecl, workingValues, FormatterMessages.WhiteSpaceOptions_method, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_METHOD_DECLARATION_THROWS, METHOD_DECL_PREVIEW); + + final InnerNode lists= createChild(parent, workingValues, FormatterMessages.WhiteSpaceOptions_lists); + createOption(lists, workingValues, FormatterMessages.WhiteSpaceOptions_declarator_list, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_DECLARATOR_LIST, DECLARATOR_LIST_PREVIEW); + createOption(lists, workingValues, FormatterMessages.WhiteSpaceOptions_expression_list, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_EXPRESSION_LIST, EXPRESSION_LIST_PREVIEW); + createOption(lists, workingValues, FormatterMessages.WhiteSpaceOptions_initializer_list, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_INITIALIZER_LIST, INITIALIZER_LIST_PREVIEW); + + createOption(parent, workingValues, FormatterMessages.WhiteSpaceOptions_template_parameters, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_TEMPLATE_PARAMETERS, TEMPLATES_PREVIEW); + createOption(parent, workingValues, FormatterMessages.WhiteSpaceOptions_template_arguments, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_TEMPLATE_ARGUMENTS, TEMPLATES_PREVIEW); + } + + private void createBeforeOperatorTree(Map workingValues, final InnerNode parent) { + createOption(parent, workingValues, FormatterMessages.WhiteSpaceOptions_assignment_operator, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_ASSIGNMENT_OPERATOR, OPERATOR_PREVIEW); + createOption(parent, workingValues, FormatterMessages.WhiteSpaceOptions_unary_operator, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_UNARY_OPERATOR, OPERATOR_PREVIEW); + createOption(parent, workingValues, FormatterMessages.WhiteSpaceOptions_binary_operator, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_BINARY_OPERATOR, OPERATOR_PREVIEW); + createOption(parent, workingValues, FormatterMessages.WhiteSpaceOptions_prefix_operator, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_PREFIX_OPERATOR, OPERATOR_PREVIEW); + createOption(parent, workingValues, FormatterMessages.WhiteSpaceOptions_postfix_operator, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_POSTFIX_OPERATOR, OPERATOR_PREVIEW); + } + + private void createBeforeClosingBracketTree(Map workingValues, final InnerNode parent) { + createOption(parent, workingValues, FormatterMessages.WhiteSpaceOptions_arrays, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_BRACKET, ARRAY_PREVIEW); + } + + private void createBeforeClosingAngleBracketTree(Map workingValues, final InnerNode parent) { + createOption(parent, workingValues, FormatterMessages.WhiteSpaceOptions_template_parameters, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_ANGLE_BRACKET_IN_TEMPLATE_PARAMETERS, TEMPLATES_PREVIEW); + createOption(parent, workingValues, FormatterMessages.WhiteSpaceOptions_template_arguments, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_ANGLE_BRACKET_IN_TEMPLATE_ARGUMENTS, TEMPLATES_PREVIEW); + } + + + private void createBeforeOpenBracketTree(Map workingValues, final InnerNode parent) { + createOption(parent, workingValues, FormatterMessages.WhiteSpaceOptions_arrays, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACKET, ARRAY_PREVIEW); + } + + private void createBeforeOpenAngleBracketTree(Map workingValues, final InnerNode parent) { + createOption(parent, workingValues, FormatterMessages.WhiteSpaceOptions_template_parameters, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_ANGLE_BRACKET_IN_TEMPLATE_PARAMETERS, TEMPLATES_PREVIEW); + createOption(parent, workingValues, FormatterMessages.WhiteSpaceOptions_template_arguments, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_ANGLE_BRACKET_IN_TEMPLATE_ARGUMENTS, TEMPLATES_PREVIEW); + } + + private void createBeforeClosingBraceTree(Map workingValues, final InnerNode parent) { + createOption(parent, workingValues, FormatterMessages.WhiteSpaceOptions_initializer_list, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_BRACE_IN_INITIALIZER_LIST, CLASS_DECL_PREVIEW); + } + + private void createBeforeOpenBraceTree(Map workingValues, final InnerNode parent) { + + createOption(parent, workingValues, FormatterMessages.WhiteSpaceOptions_class_decl, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACE_IN_TYPE_DECLARATION, CLASS_DECL_PREVIEW); + + final InnerNode functionDecl= createChild(parent, workingValues, FormatterMessages.WhiteSpaceOptions_member_function_declaration); { +// createOption(functionDecl, workingValues, FormatterMessages.WhiteSpaceOptions_constructor, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACE_IN_CONSTRUCTOR_DECLARATION, CONSTRUCTOR_DECL_PREVIEW); + createOption(functionDecl, workingValues, FormatterMessages.WhiteSpaceOptions_method, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACE_IN_METHOD_DECLARATION, METHOD_DECL_PREVIEW); + } + + createOption(parent, workingValues, FormatterMessages.WhiteSpaceOptions_initializer_list, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACE_IN_INITIALIZER_LIST, INITIALIZER_LIST_PREVIEW); + createOption(parent, workingValues, FormatterMessages.WhiteSpaceOptions_block, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACE_IN_BLOCK, BLOCK_PREVIEW); + createOption(parent, workingValues, FormatterMessages.WhiteSpaceOptions_switch, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACE_IN_SWITCH, SWITCH_PREVIEW); + } + + private void createBeforeClosingParenTree(Map workingValues, final InnerNode parent) { + + createOption(parent, workingValues, FormatterMessages.WhiteSpaceOptions_catch, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_CATCH, CATCH_PREVIEW); + createOption(parent, workingValues, FormatterMessages.WhiteSpaceOptions_for, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_FOR, FOR_PREVIEW); + createOption(parent, workingValues, FormatterMessages.WhiteSpaceOptions_if, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_IF, IF_PREVIEW); + createOption(parent, workingValues, FormatterMessages.WhiteSpaceOptions_switch, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_SWITCH, SWITCH_PREVIEW); + createOption(parent, workingValues, FormatterMessages.WhiteSpaceOptions_while, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_WHILE, WHILE_PREVIEW); + + createOption(parent, workingValues, FormatterMessages.WhiteSpaceOptions_type_cast, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_CAST, CAST_PREVIEW); + + final InnerNode decl= createChild(parent, workingValues, FormatterMessages.WhiteSpaceOptions_member_function_declaration); +// createOption(decl, workingValues, FormatterMessages.WhiteSpaceOptions_constructor, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_CONSTRUCTOR_DECLARATION, CONSTRUCTOR_DECL_PREVIEW); + createOption(decl, workingValues, FormatterMessages.WhiteSpaceOptions_method, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_METHOD_DECLARATION, METHOD_DECL_PREVIEW); + + createOption(parent, workingValues, FormatterMessages.WhiteSpaceOptions_method_call, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_METHOD_INVOCATION, METHOD_CALL_PREVIEW); + createOption(parent, workingValues, FormatterMessages.WhiteSpaceOptions_paren_expr, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_PARENTHESIZED_EXPRESSION, PAREN_EXPR_PREVIEW); + } + + private void createBeforeOpenParenTree(Map workingValues, final InnerNode parent) { + + createOption(parent, workingValues, FormatterMessages.WhiteSpaceOptions_catch, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_CATCH, CATCH_PREVIEW); + createOption(parent, workingValues, FormatterMessages.WhiteSpaceOptions_for, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_FOR, FOR_PREVIEW); + createOption(parent, workingValues, FormatterMessages.WhiteSpaceOptions_if, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_IF, IF_PREVIEW); + createOption(parent, workingValues, FormatterMessages.WhiteSpaceOptions_switch, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_SWITCH, SWITCH_PREVIEW); + createOption(parent, workingValues, FormatterMessages.WhiteSpaceOptions_while, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_WHILE, WHILE_PREVIEW); +// createOption(parent, workingValues, FormatterMessages.WhiteSpaceOptions_return_with_parenthesized_expression, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_PARENTHESIZED_EXPRESSION_IN_RETURN, RETURN_PREVIEW); +// createOption(parent, workingValues, FormatterMessages.WhiteSpaceOptions_throw_with_parenthesized_expression, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_PARENTHESIZED_EXPRESSION_IN_THROW, THROW_PREVIEW); + + final InnerNode decls= createChild(parent, workingValues, FormatterMessages.WhiteSpaceOptions_member_function_declaration); +// createOption(decls, workingValues, FormatterMessages.WhiteSpaceOptions_constructor, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_CONSTRUCTOR_DECLARATION, CONSTRUCTOR_DECL_PREVIEW); + createOption(decls, workingValues, FormatterMessages.WhiteSpaceOptions_method, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_METHOD_DECLARATION, METHOD_DECL_PREVIEW); + + createOption(parent, workingValues, FormatterMessages.WhiteSpaceOptions_method_call, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_METHOD_INVOCATION, METHOD_CALL_PREVIEW); + createOption(parent, workingValues, FormatterMessages.WhiteSpaceOptions_paren_expr, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_PARENTHESIZED_EXPRESSION, PAREN_EXPR_PREVIEW); + } + + private void createAfterQuestionTree(Map workingValues, final InnerNode parent) { + createOption(parent, workingValues, FormatterMessages.WhiteSpaceOptions_conditional, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_QUESTION_IN_CONDITIONAL, CONDITIONAL_PREVIEW); + } + +// private void createBeforeEllipsis(Map workingValues, InnerNode parent) { +// createOption(parent, workingValues, FormatterMessages.WhiteSpaceOptions_vararg_parameter, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_ELLIPSIS, VARARG_PARAMETER_PREVIEW); +// } +// +// private void createAfterEllipsis(Map workingValues, InnerNode parent) { +// createOption(parent, workingValues, FormatterMessages.WhiteSpaceOptions_vararg_parameter, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_ELLIPSIS, VARARG_PARAMETER_PREVIEW); +// } + + private void createAfterSemicolonTree(Map workingValues, final InnerNode parent) { + createOption(parent, workingValues, FormatterMessages.WhiteSpaceOptions_for, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_SEMICOLON_IN_FOR, FOR_PREVIEW); + } + + private void createAfterColonTree(Map workingValues, final InnerNode parent) { + createOption(parent, workingValues, FormatterMessages.WhiteSpaceOptions_conditional, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COLON_IN_CONDITIONAL, CONDITIONAL_PREVIEW); + createOption(parent, workingValues, FormatterMessages.WhiteSpaceOptions_label, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COLON_IN_LABELED_STATEMENT, LABEL_PREVIEW); + createOption(parent, workingValues, FormatterMessages.WhiteSpaceOptions_base_clause, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COLON_IN_BASE_CLAUSE, CLASS_DECL_PREVIEW); + } + + private void createAfterCommaTree(Map workingValues, final InnerNode parent) { + +// final InnerNode forStatement= createChild(parent, workingValues, FormatterMessages.WhiteSpaceOptions_for); { +// createOption(forStatement, workingValues, FormatterMessages.WhiteSpaceOptions_initialization, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_FOR_INITS, FOR_PREVIEW); +// createOption(forStatement, workingValues, FormatterMessages.WhiteSpaceOptions_incrementation, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_FOR_INCREMENTS, FOR_PREVIEW); +// } + final InnerNode invocation= createChild(parent, workingValues, FormatterMessages.WhiteSpaceOptions_arguments); { + createOption(invocation, workingValues, FormatterMessages.WhiteSpaceOptions_method, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_METHOD_INVOCATION_ARGUMENTS, METHOD_CALL_PREVIEW); +// createOption(invocation, workingValues, FormatterMessages.WhiteSpaceOptions_alloc_expr, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_ALLOCATION_EXPRESSION, ALLOC_PREVIEW); + } + final InnerNode decl= createChild(parent, workingValues, FormatterMessages.WhiteSpaceOptions_parameters); { +// createOption(decl, workingValues, FormatterMessages.WhiteSpaceOptions_constructor, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_CONSTRUCTOR_DECLARATION_PARAMETERS, CONSTRUCTOR_DECL_PREVIEW); + createOption(decl, workingValues, FormatterMessages.WhiteSpaceOptions_method, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_METHOD_DECLARATION_PARAMETERS, METHOD_DECL_PREVIEW); + } +// final InnerNode throwsDecl= createChild(parent, workingValues, FormatterMessages.WhiteSpaceOptions_throws); { +// createOption(throwsDecl, workingValues, FormatterMessages.WhiteSpaceOptions_constructor, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_CONSTRUCTOR_DECLARATION_THROWS, CONSTRUCTOR_DECL_PREVIEW); +// createOption(throwsDecl, workingValues, FormatterMessages.WhiteSpaceOptions_method, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_METHOD_DECLARATION_THROWS, METHOD_DECL_PREVIEW); +// } + final InnerNode lists= createChild(parent, workingValues, FormatterMessages.WhiteSpaceOptions_lists); { + createOption(lists, workingValues, FormatterMessages.WhiteSpaceOptions_declarator_list, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_DECLARATOR_LIST, DECLARATOR_LIST_PREVIEW); + createOption(lists, workingValues, FormatterMessages.WhiteSpaceOptions_expression_list, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_EXPRESSION_LIST, EXPRESSION_LIST_PREVIEW); + createOption(lists, workingValues, FormatterMessages.WhiteSpaceOptions_initializer_list, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_INITIALIZER_LIST, INITIALIZER_LIST_PREVIEW); + } + + createOption(parent, workingValues, FormatterMessages.WhiteSpaceOptions_template_parameters, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_TEMPLATE_PARAMETERS, TEMPLATES_PREVIEW); + createOption(parent, workingValues, FormatterMessages.WhiteSpaceOptions_template_arguments, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_TEMPLATE_ARGUMENTS, TEMPLATES_PREVIEW); + } + + private void createAfterOperatorTree(Map workingValues, final InnerNode parent) { + + createOption(parent, workingValues, FormatterMessages.WhiteSpaceOptions_assignment_operator, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_ASSIGNMENT_OPERATOR, OPERATOR_PREVIEW); + createOption(parent, workingValues, FormatterMessages.WhiteSpaceOptions_unary_operator, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_UNARY_OPERATOR, OPERATOR_PREVIEW); + createOption(parent, workingValues, FormatterMessages.WhiteSpaceOptions_binary_operator, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_BINARY_OPERATOR, OPERATOR_PREVIEW); + createOption(parent, workingValues, FormatterMessages.WhiteSpaceOptions_prefix_operator, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_PREFIX_OPERATOR, OPERATOR_PREVIEW); + createOption(parent, workingValues, FormatterMessages.WhiteSpaceOptions_postfix_operator, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_POSTFIX_OPERATOR, OPERATOR_PREVIEW); + } + + private void createAfterOpenBracketTree(Map workingValues, final InnerNode parent) { + createOption(parent, workingValues, FormatterMessages.WhiteSpaceOptions_arrays, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_BRACKET, ARRAY_PREVIEW); + } + + private void createAfterOpenAngleBracketTree(Map workingValues, final InnerNode parent) { + createOption(parent, workingValues, FormatterMessages.WhiteSpaceOptions_template_parameters, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_ANGLE_BRACKET_IN_TEMPLATE_PARAMETERS, TEMPLATES_PREVIEW); + createOption(parent, workingValues, FormatterMessages.WhiteSpaceOptions_template_arguments, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_ANGLE_BRACKET_IN_TEMPLATE_ARGUMENTS, TEMPLATES_PREVIEW); + } + + + + private void createAfterOpenBraceTree(Map workingValues, final InnerNode parent) { + + createOption(parent, workingValues, FormatterMessages.WhiteSpaceOptions_initializer_list, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_BRACE_IN_INITIALIZER_LIST, INITIALIZER_LIST_PREVIEW); + } + + private void createAfterCloseBraceTree(Map workingValues, final InnerNode parent) { + createOption(parent, workingValues, FormatterMessages.WhiteSpaceOptions_block, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_CLOSING_BRACE_IN_BLOCK, BLOCK_PREVIEW); + } + + private void createAfterCloseParenTree(Map workingValues, final InnerNode parent) { + + createOption(parent, workingValues, FormatterMessages.WhiteSpaceOptions_type_cast, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_CLOSING_PAREN_IN_CAST, CAST_PREVIEW); + } + + private void createAfterClosingAngleBracketTree(Map workingValues, final InnerNode parent) { + createOption(parent, workingValues, FormatterMessages.WhiteSpaceOptions_template_parameters, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_CLOSING_ANGLE_BRACKET_IN_TEMPLATE_PARAMETERS, TEMPLATES_PREVIEW); + //createOption(parent, workingValues, "WhiteSpaceOptions.parameterized_type", DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_CLOSING_ANGLE_BRACKET_IN_PARAMETERIZED_TYPE_REFERENCE, TYPE_ARGUMENTS_PREVIEW); //$NON-NLS-1$ + createOption(parent, workingValues, FormatterMessages.WhiteSpaceOptions_template_arguments, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_CLOSING_ANGLE_BRACKET_IN_TEMPLATE_ARGUMENTS, TEMPLATES_PREVIEW); + } + + private void createAfterOpenParenTree(Map workingValues, final InnerNode parent) { + createOption(parent, workingValues, FormatterMessages.WhiteSpaceOptions_catch, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_CATCH, CATCH_PREVIEW); + createOption(parent, workingValues, FormatterMessages.WhiteSpaceOptions_for, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_FOR, FOR_PREVIEW); + createOption(parent, workingValues, FormatterMessages.WhiteSpaceOptions_if, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_IF, IF_PREVIEW); + createOption(parent, workingValues, FormatterMessages.WhiteSpaceOptions_switch, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_SWITCH, SWITCH_PREVIEW); + createOption(parent, workingValues, FormatterMessages.WhiteSpaceOptions_while, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_WHILE, WHILE_PREVIEW); + + final InnerNode decls= createChild(parent, workingValues, FormatterMessages.WhiteSpaceOptions_member_function_declaration); { +// createOption(decls, workingValues, FormatterMessages.WhiteSpaceOptions_constructor, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_CONSTRUCTOR_DECLARATION, CONSTRUCTOR_DECL_PREVIEW); + createOption(decls, workingValues, FormatterMessages.WhiteSpaceOptions_method, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_METHOD_DECLARATION, METHOD_DECL_PREVIEW); + } + createOption(parent, workingValues, FormatterMessages.WhiteSpaceOptions_type_cast, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_CAST, CAST_PREVIEW); + createOption(parent, workingValues, FormatterMessages.WhiteSpaceOptions_method_call, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_METHOD_INVOCATION, METHOD_CALL_PREVIEW); + createOption(parent, workingValues, FormatterMessages.WhiteSpaceOptions_paren_expr, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_PARENTHESIZED_EXPRESSION, PAREN_EXPR_PREVIEW); + } + + private void createBetweenEmptyParenTree(Map workingValues, final InnerNode parent) { + +// createOption(parent, workingValues, FormatterMessages.WhiteSpaceOptions_constructor_decl, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BETWEEN_EMPTY_PARENS_IN_CONSTRUCTOR_DECLARATION, CONSTRUCTOR_DECL_PREVIEW); + createOption(parent, workingValues, FormatterMessages.WhiteSpaceOptions_method_decl, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BETWEEN_EMPTY_PARENS_IN_METHOD_DECLARATION, METHOD_DECL_PREVIEW); + createOption(parent, workingValues, FormatterMessages.WhiteSpaceOptions_method_call, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BETWEEN_EMPTY_PARENS_IN_METHOD_INVOCATION, METHOD_CALL_PREVIEW); + } + + private void createBetweenEmptyBracketsTree(Map workingValues, final InnerNode parent) { + createOption(parent, workingValues, FormatterMessages.WhiteSpaceOptions_arrays, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BETWEEN_EMPTY_BRACKETS, ARRAY_PREVIEW); + } + + private void createBetweenEmptyBracesTree(Map workingValues, final InnerNode parent) { + createOption(parent, workingValues, FormatterMessages.WhiteSpaceOptions_initializer_list, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BETWEEN_EMPTY_BRACES_IN_INITIALIZER_LIST, INITIALIZER_LIST_PREVIEW); + } + + // syntax element tree + + private InnerNode createClassTree(Map workingValues, InnerNode parent) { + final InnerNode root= new InnerNode(parent, workingValues, FormatterMessages.WhiteSpaceTabPage_classes); + createOption(root, workingValues, FormatterMessages.WhiteSpaceTabPage_classes_before_opening_brace_of_a_class, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACE_IN_TYPE_DECLARATION, CLASS_DECL_PREVIEW); + createOption(root, workingValues, FormatterMessages.WhiteSpaceTabPage_classes_before_colon_of_base_clause, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COLON_IN_BASE_CLAUSE, CLASS_DECL_PREVIEW); + createOption(root, workingValues, FormatterMessages.WhiteSpaceTabPage_classes_after_colon_of_base_clause, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COLON_IN_BASE_CLAUSE, CLASS_DECL_PREVIEW); + createOption(root, workingValues, FormatterMessages.WhiteSpaceTabPage_classes_before_comma_base_types, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_BASE_TYPES, CLASS_DECL_PREVIEW); + createOption(root, workingValues, FormatterMessages.WhiteSpaceTabPage_classes_after_comma_base_types, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_BASE_TYPES, CLASS_DECL_PREVIEW); + return root; + } + + private InnerNode createAssignmentTree(Map workingValues, InnerNode parent) { + final InnerNode root= new InnerNode(parent, workingValues, FormatterMessages.WhiteSpaceTabPage_assignments); + createOption(root, workingValues, FormatterMessages.WhiteSpaceTabPage_assignments_before_assignment_operator, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_ASSIGNMENT_OPERATOR, OPERATOR_PREVIEW); + createOption(root, workingValues, FormatterMessages.WhiteSpaceTabPage_assignments_after_assignment_operator, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_ASSIGNMENT_OPERATOR, OPERATOR_PREVIEW); + return root; + } + + private InnerNode createOperatorTree(Map workingValues, InnerNode parent) { + final InnerNode root= new InnerNode(parent, workingValues, FormatterMessages.WhiteSpaceTabPage_operators); + + createOption(root, workingValues, FormatterMessages.WhiteSpaceTabPage_operators_before_binary_operators, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_BINARY_OPERATOR, OPERATOR_PREVIEW); + createOption(root, workingValues, FormatterMessages.WhiteSpaceTabPage_operators_after_binary_operators, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_BINARY_OPERATOR, OPERATOR_PREVIEW); + createOption(root, workingValues, FormatterMessages.WhiteSpaceTabPage_operators_before_unary_operators, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_UNARY_OPERATOR, OPERATOR_PREVIEW); + createOption(root, workingValues, FormatterMessages.WhiteSpaceTabPage_operators_after_unary_operators, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_UNARY_OPERATOR, OPERATOR_PREVIEW); + createOption(root, workingValues, FormatterMessages.WhiteSpaceTabPage_operators_before_prefix_operators, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_PREFIX_OPERATOR, OPERATOR_PREVIEW); + createOption(root, workingValues, FormatterMessages.WhiteSpaceTabPage_operators_after_prefix_operators, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_PREFIX_OPERATOR, OPERATOR_PREVIEW); + createOption(root, workingValues, FormatterMessages.WhiteSpaceTabPage_operators_before_postfix_operators, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_POSTFIX_OPERATOR, OPERATOR_PREVIEW); + createOption(root, workingValues, FormatterMessages.WhiteSpaceTabPage_operators_after_postfix_operators, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_POSTFIX_OPERATOR, OPERATOR_PREVIEW); + return root; + } + + private InnerNode createMethodDeclTree(Map workingValues, InnerNode parent) { + final InnerNode root= new InnerNode(parent, workingValues, FormatterMessages.WhiteSpaceTabPage_methods); + + createOption(root, workingValues, FormatterMessages.WhiteSpaceTabPage_before_opening_paren, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_METHOD_DECLARATION, METHOD_DECL_PREVIEW); + createOption(root, workingValues, FormatterMessages.WhiteSpaceTabPage_after_opening_paren, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_METHOD_DECLARATION, METHOD_DECL_PREVIEW); + createOption(root, workingValues, FormatterMessages.WhiteSpaceTabPage_before_closing_paren, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_METHOD_DECLARATION, METHOD_DECL_PREVIEW); + createOption(root, workingValues, FormatterMessages.WhiteSpaceTabPage_between_empty_parens, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BETWEEN_EMPTY_PARENS_IN_METHOD_DECLARATION, METHOD_DECL_PREVIEW); + createOption(root, workingValues, FormatterMessages.WhiteSpaceTabPage_before_opening_brace, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACE_IN_METHOD_DECLARATION, METHOD_DECL_PREVIEW); + + createOption(root, workingValues, FormatterMessages.WhiteSpaceTabPage_before_comma_in_params, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_METHOD_DECLARATION_PARAMETERS, METHOD_DECL_PREVIEW); + createOption(root, workingValues, FormatterMessages.WhiteSpaceTabPage_after_comma_in_params, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_METHOD_DECLARATION_PARAMETERS, METHOD_DECL_PREVIEW); +// createOption(root, workingValues, FormatterMessages.WhiteSpaceTabPage_before_ellipsis, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_ELLIPSIS, VARARG_PARAMETER_PREVIEW); +// createOption(root, workingValues, FormatterMessages.WhiteSpaceTabPage_after_ellipsis, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_ELLIPSIS, VARARG_PARAMETER_PREVIEW); +// createOption(root, workingValues, FormatterMessages.WhiteSpaceTabPage_before_comma_in_throws, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_METHOD_DECLARATION_THROWS, METHOD_DECL_PREVIEW); +// createOption(root, workingValues, FormatterMessages.WhiteSpaceTabPage_after_comma_in_throws, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_METHOD_DECLARATION_THROWS, METHOD_DECL_PREVIEW); + + return root; + } + +// private InnerNode createConstructorTree(Map workingValues, InnerNode parent) { +// final InnerNode root= new InnerNode(parent, workingValues, FormatterMessages.WhiteSpaceTabPage_constructors); +// +// createOption(root, workingValues, FormatterMessages.WhiteSpaceTabPage_before_opening_paren, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_CONSTRUCTOR_DECLARATION, CONSTRUCTOR_DECL_PREVIEW); +// createOption(root, workingValues, FormatterMessages.WhiteSpaceTabPage_after_opening_paren, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_CONSTRUCTOR_DECLARATION, CONSTRUCTOR_DECL_PREVIEW); +// createOption(root, workingValues, FormatterMessages.WhiteSpaceTabPage_before_closing_paren, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_CONSTRUCTOR_DECLARATION, CONSTRUCTOR_DECL_PREVIEW); +// createOption(root, workingValues, FormatterMessages.WhiteSpaceTabPage_between_empty_parens, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BETWEEN_EMPTY_PARENS_IN_CONSTRUCTOR_DECLARATION, CONSTRUCTOR_DECL_PREVIEW); +// createOption(root, workingValues, FormatterMessages.WhiteSpaceTabPage_before_opening_brace, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACE_IN_CONSTRUCTOR_DECLARATION, CONSTRUCTOR_DECL_PREVIEW); +// +// createOption(root, workingValues, FormatterMessages.WhiteSpaceTabPage_before_comma_in_params, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_CONSTRUCTOR_DECLARATION_PARAMETERS, CONSTRUCTOR_DECL_PREVIEW); +// createOption(root, workingValues, FormatterMessages.WhiteSpaceTabPage_after_comma_in_params, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_CONSTRUCTOR_DECLARATION_PARAMETERS, CONSTRUCTOR_DECL_PREVIEW); +// createOption(root, workingValues, FormatterMessages.WhiteSpaceTabPage_before_comma_in_throws, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_CONSTRUCTOR_DECLARATION_THROWS, CONSTRUCTOR_DECL_PREVIEW); +// createOption(root, workingValues, FormatterMessages.WhiteSpaceTabPage_after_comma_in_throws, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_CONSTRUCTOR_DECLARATION_THROWS, CONSTRUCTOR_DECL_PREVIEW); +// return root; +// } + + private InnerNode createDeclaratorListTree(Map workingValues, InnerNode parent) { + final InnerNode root= new InnerNode(parent, workingValues, FormatterMessages.WhiteSpaceTabPage_declarator_list); + + createOption(root, workingValues, FormatterMessages.WhiteSpaceTabPage_declarator_list_before_comma, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_DECLARATOR_LIST, DECLARATOR_LIST_PREVIEW); + createOption(root, workingValues, FormatterMessages.WhiteSpaceTabPage_declarator_list_after_comma, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_DECLARATOR_LIST, EXPRESSION_LIST_PREVIEW); + return root; + } + + private InnerNode createExpressionListTree(Map workingValues, InnerNode parent) { + final InnerNode root= new InnerNode(parent, workingValues, FormatterMessages.WhiteSpaceTabPage_expression_list); + createOption(root, workingValues, FormatterMessages.WhiteSpaceTabPage_expression_list_before_comma, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_EXPRESSION_LIST, EXPRESSION_LIST_PREVIEW); + createOption(root, workingValues, FormatterMessages.WhiteSpaceTabPage_expression_list_after_comma, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_EXPRESSION_LIST, EXPRESSION_LIST_PREVIEW); + return root; + } + + private InnerNode createInitializerListTree(Map workingValues, InnerNode parent) { + final InnerNode root= new InnerNode(parent, workingValues, FormatterMessages.WhiteSpaceTabPage_initializer_list); + + createOption(root, workingValues, FormatterMessages.WhiteSpaceTabPage_before_opening_brace, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACE_IN_INITIALIZER_LIST, INITIALIZER_LIST_PREVIEW); + createOption(root, workingValues, FormatterMessages.WhiteSpaceTabPage_after_opening_brace, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_BRACE_IN_INITIALIZER_LIST, INITIALIZER_LIST_PREVIEW); + createOption(root, workingValues, FormatterMessages.WhiteSpaceTabPage_before_closing_brace, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_BRACE_IN_INITIALIZER_LIST, INITIALIZER_LIST_PREVIEW); + createOption(root, workingValues, FormatterMessages.WhiteSpaceTabPage_before_comma, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_INITIALIZER_LIST, INITIALIZER_LIST_PREVIEW); + createOption(root, workingValues, FormatterMessages.WhiteSpaceTabPage_after_comma, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_INITIALIZER_LIST, INITIALIZER_LIST_PREVIEW); + createOption(root, workingValues, FormatterMessages.WhiteSpaceTabPage_between_empty_braces, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BETWEEN_EMPTY_BRACES_IN_INITIALIZER_LIST, INITIALIZER_LIST_PREVIEW); + return root; + } + + private InnerNode createArrayTree(Map workingValues, InnerNode parent) { + createOption(parent, workingValues, FormatterMessages.WhiteSpaceTabPage_before_opening_bracket, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACKET, ARRAY_PREVIEW); + createOption(parent, workingValues, FormatterMessages.WhiteSpaceTabPage_after_opening_bracket, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_BRACKET, ARRAY_PREVIEW); + createOption(parent, workingValues, FormatterMessages.WhiteSpaceTabPage_before_closing_bracket, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_BRACKET, ARRAY_PREVIEW); + createOption(parent, workingValues, FormatterMessages.WhiteSpaceTabPage_between_empty_brackets, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BETWEEN_EMPTY_BRACKETS, ARRAY_PREVIEW); + return parent; + } + + private InnerNode createFunctionCallTree(Map workingValues, InnerNode parent) { + final InnerNode root= new InnerNode(parent, workingValues, FormatterMessages.WhiteSpaceTabPage_calls); + + createOption(root, workingValues, FormatterMessages.WhiteSpaceTabPage_before_opening_paren, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_METHOD_INVOCATION, METHOD_CALL_PREVIEW); + createOption(root, workingValues, FormatterMessages.WhiteSpaceTabPage_after_opening_paren, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_METHOD_INVOCATION, METHOD_CALL_PREVIEW); + createOption(root, workingValues, FormatterMessages.WhiteSpaceTabPage_before_closing_paren, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_METHOD_INVOCATION, METHOD_CALL_PREVIEW); + createOption(root, workingValues, FormatterMessages.WhiteSpaceTabPage_between_empty_parens, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BETWEEN_EMPTY_PARENS_IN_METHOD_INVOCATION, METHOD_CALL_PREVIEW); + createOption(root, workingValues, FormatterMessages.WhiteSpaceTabPage_calls_before_comma_in_method_args, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_METHOD_INVOCATION_ARGUMENTS, METHOD_CALL_PREVIEW); + createOption(root, workingValues, FormatterMessages.WhiteSpaceTabPage_calls_after_comma_in_method_args, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_METHOD_INVOCATION_ARGUMENTS, METHOD_CALL_PREVIEW); +// createOption(root, workingValues, FormatterMessages.WhiteSpaceTabPage_calls_before_comma_in_alloc, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_ALLOCATION_EXPRESSION, ALLOC_PREVIEW); +// createOption(root, workingValues, FormatterMessages.WhiteSpaceTabPage_calls_after_comma_in_alloc, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_ALLOCATION_EXPRESSION, ALLOC_PREVIEW); + return root; + } + + private InnerNode createBlockTree(Map workingValues, InnerNode parent) { + final InnerNode root= new InnerNode(parent, workingValues, FormatterMessages.WhiteSpaceTabPage_blocks); + + createOption(root, workingValues, FormatterMessages.WhiteSpaceTabPage_before_opening_brace, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACE_IN_BLOCK, BLOCK_PREVIEW); + createOption(root, workingValues, FormatterMessages.WhiteSpaceTabPage_after_closing_brace, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_CLOSING_BRACE_IN_BLOCK, BLOCK_PREVIEW); + return root; + } + + private InnerNode createSwitchStatementTree(Map workingValues, InnerNode parent) { + final InnerNode root= new InnerNode(parent, workingValues, FormatterMessages.WhiteSpaceTabPage_switch); + + createOption(root, workingValues, FormatterMessages.WhiteSpaceTabPage_switch_before_case_colon, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COLON_IN_CASE, SWITCH_PREVIEW); + createOption(root, workingValues, FormatterMessages.WhiteSpaceTabPage_switch_before_default_colon, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COLON_IN_DEFAULT, SWITCH_PREVIEW); + createOption(root, workingValues, FormatterMessages.WhiteSpaceTabPage_before_opening_brace, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACE_IN_SWITCH, SWITCH_PREVIEW); + createOption(root, workingValues, FormatterMessages.WhiteSpaceTabPage_before_opening_paren, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_SWITCH, SWITCH_PREVIEW); + createOption(root, workingValues, FormatterMessages.WhiteSpaceTabPage_after_opening_paren, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_SWITCH, SWITCH_PREVIEW); + createOption(root, workingValues, FormatterMessages.WhiteSpaceTabPage_before_closing_paren, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_SWITCH, SWITCH_PREVIEW); + return root; + } + + private InnerNode createDoWhileTree(Map workingValues, InnerNode parent) { + final InnerNode root= new InnerNode(parent, workingValues, FormatterMessages.WhiteSpaceTabPage_do); + + createOption(root, workingValues, FormatterMessages.WhiteSpaceTabPage_before_opening_paren, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_WHILE, WHILE_PREVIEW); + createOption(root, workingValues, FormatterMessages.WhiteSpaceTabPage_after_opening_paren, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_WHILE, WHILE_PREVIEW); + createOption(root, workingValues, FormatterMessages.WhiteSpaceTabPage_before_closing_paren, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_WHILE, WHILE_PREVIEW); + + return root; + } + + private InnerNode createTryStatementTree(Map workingValues, InnerNode parent) { + final InnerNode root= new InnerNode(parent, workingValues, FormatterMessages.WhiteSpaceTabPage_try); + + createOption(root, workingValues, FormatterMessages.WhiteSpaceTabPage_before_opening_paren, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_CATCH, CATCH_PREVIEW); + createOption(root, workingValues, FormatterMessages.WhiteSpaceTabPage_after_opening_paren, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_CATCH, CATCH_PREVIEW); + createOption(root, workingValues, FormatterMessages.WhiteSpaceTabPage_before_closing_paren, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_CATCH, CATCH_PREVIEW); + return root; + } + private InnerNode createIfStatementTree(Map workingValues, InnerNode parent) { + final InnerNode root= new InnerNode(parent, workingValues, FormatterMessages.WhiteSpaceTabPage_if); + + createOption(root, workingValues, FormatterMessages.WhiteSpaceTabPage_before_opening_paren, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_IF, IF_PREVIEW); + createOption(root, workingValues, FormatterMessages.WhiteSpaceTabPage_after_opening_paren, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_IF, IF_PREVIEW); + createOption(root, workingValues, FormatterMessages.WhiteSpaceTabPage_before_closing_paren, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_IF, IF_PREVIEW); + return root; + } + + private InnerNode createForStatementTree(Map workingValues, InnerNode parent) { + final InnerNode root= new InnerNode(parent, workingValues, FormatterMessages.WhiteSpaceTabPage_for); + + createOption(root, workingValues, FormatterMessages.WhiteSpaceTabPage_before_opening_paren, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_FOR, FOR_PREVIEW); + createOption(root, workingValues, FormatterMessages.WhiteSpaceTabPage_after_opening_paren, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_FOR, FOR_PREVIEW); + createOption(root, workingValues, FormatterMessages.WhiteSpaceTabPage_before_closing_paren, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_FOR, FOR_PREVIEW); +// createOption(root, workingValues, FormatterMessages.WhiteSpaceTabPage_for_before_comma_init, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_FOR_INITS, FOR_PREVIEW); +// createOption(root, workingValues, FormatterMessages.WhiteSpaceTabPage_for_after_comma_init, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_FOR_INITS, FOR_PREVIEW); +// createOption(root, workingValues, FormatterMessages.WhiteSpaceTabPage_for_before_comma_inc, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_FOR_INCREMENTS, FOR_PREVIEW); +// createOption(root, workingValues, FormatterMessages.WhiteSpaceTabPage_for_after_comma_inc, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_FOR_INCREMENTS, FOR_PREVIEW); + createOption(root, workingValues, FormatterMessages.WhiteSpaceTabPage_before_semicolon, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_SEMICOLON_IN_FOR, FOR_PREVIEW); + createOption(root, workingValues, FormatterMessages.WhiteSpaceTabPage_after_semicolon, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_SEMICOLON_IN_FOR, FOR_PREVIEW); + + return root; + } + +// private InnerNode createReturnTree(Map workingValues, InnerNode parent) { +// final InnerNode root= new InnerNode(parent, workingValues, FormatterMessages.WhiteSpaceOptions_return); +// createOption(root, workingValues, FormatterMessages.WhiteSpaceTabPage_before_parenthesized_expressions, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_PARENTHESIZED_EXPRESSION_IN_RETURN, RETURN_PREVIEW); +// return root; +// } + +// private InnerNode createThrowTree(Map workingValues, InnerNode parent) { +// final InnerNode root= new InnerNode(parent, workingValues, FormatterMessages.WhiteSpaceOptions_throw); +// createOption(root, workingValues, FormatterMessages.WhiteSpaceTabPage_before_parenthesized_expressions, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_PARENTHESIZED_EXPRESSION_IN_THROW, THROW_PREVIEW); +// return root; +// } + + private InnerNode createLabelTree(Map workingValues, InnerNode parent) { + final InnerNode root= new InnerNode(parent, workingValues, FormatterMessages.WhiteSpaceTabPage_labels); + createOption(root, workingValues, FormatterMessages.WhiteSpaceTabPage_before_colon, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COLON_IN_LABELED_STATEMENT, LABEL_PREVIEW); + createOption(root, workingValues, FormatterMessages.WhiteSpaceTabPage_after_colon, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COLON_IN_LABELED_STATEMENT, LABEL_PREVIEW); + return root; + } + + private InnerNode createTemplateArgumentTree(Map workingValues, InnerNode parent) { + final InnerNode root= new InnerNode(parent, workingValues, FormatterMessages.WhiteSpaceTabPage_template_arguments); + createOption(root, workingValues, FormatterMessages.WhiteSpaceTabPage_before_opening_angle_bracket, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_ANGLE_BRACKET_IN_TEMPLATE_ARGUMENTS, TEMPLATES_PREVIEW); + createOption(root, workingValues, FormatterMessages.WhiteSpaceTabPage_after_opening_angle_bracket, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_ANGLE_BRACKET_IN_TEMPLATE_ARGUMENTS, TEMPLATES_PREVIEW); + createOption(root, workingValues, FormatterMessages.WhiteSpaceTabPage_before_comma, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_TEMPLATE_ARGUMENTS, TEMPLATES_PREVIEW); + createOption(root, workingValues, FormatterMessages.WhiteSpaceTabPage_after_comma, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_TEMPLATE_ARGUMENTS, TEMPLATES_PREVIEW); + createOption(root, workingValues, FormatterMessages.WhiteSpaceTabPage_before_closing_angle_bracket, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_ANGLE_BRACKET_IN_TEMPLATE_ARGUMENTS, TEMPLATES_PREVIEW); + createOption(root, workingValues, FormatterMessages.WhiteSpaceTabPage_after_closing_angle_bracket, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_CLOSING_ANGLE_BRACKET_IN_TEMPLATE_ARGUMENTS, TEMPLATES_PREVIEW); + return root; + } + + private InnerNode createTemplateParameterTree(Map workingValues, InnerNode parent) { + final InnerNode root= new InnerNode(parent, workingValues, FormatterMessages.WhiteSpaceTabPage_template_parameters); + createOption(root, workingValues, FormatterMessages.WhiteSpaceTabPage_before_opening_angle_bracket, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_ANGLE_BRACKET_IN_TEMPLATE_PARAMETERS, TEMPLATES_PREVIEW); + createOption(root, workingValues, FormatterMessages.WhiteSpaceTabPage_after_opening_angle_bracket, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_ANGLE_BRACKET_IN_TEMPLATE_PARAMETERS, TEMPLATES_PREVIEW); + createOption(root, workingValues, FormatterMessages.WhiteSpaceTabPage_before_comma, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_TEMPLATE_PARAMETERS, TEMPLATES_PREVIEW); + createOption(root, workingValues, FormatterMessages.WhiteSpaceTabPage_after_comma, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_TEMPLATE_PARAMETERS, TEMPLATES_PREVIEW); + createOption(root, workingValues, FormatterMessages.WhiteSpaceTabPage_before_closing_angle_bracket, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_ANGLE_BRACKET_IN_TEMPLATE_PARAMETERS, TEMPLATES_PREVIEW); + createOption(root, workingValues, FormatterMessages.WhiteSpaceTabPage_after_closing_angle_bracket, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_CLOSING_ANGLE_BRACKET_IN_TEMPLATE_PARAMETERS, TEMPLATES_PREVIEW); + return root; + } + + private InnerNode createConditionalTree(Map workingValues, InnerNode parent) { + final InnerNode root= new InnerNode(parent, workingValues, FormatterMessages.WhiteSpaceTabPage_conditionals); + + createOption(root, workingValues, FormatterMessages.WhiteSpaceTabPage_before_question, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_QUESTION_IN_CONDITIONAL, CONDITIONAL_PREVIEW); + createOption(root, workingValues, FormatterMessages.WhiteSpaceTabPage_after_question, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_QUESTION_IN_CONDITIONAL, CONDITIONAL_PREVIEW); + createOption(root, workingValues, FormatterMessages.WhiteSpaceTabPage_before_colon, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COLON_IN_CONDITIONAL, CONDITIONAL_PREVIEW); + createOption(root, workingValues, FormatterMessages.WhiteSpaceTabPage_after_colon, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COLON_IN_CONDITIONAL, CONDITIONAL_PREVIEW); + return root; + } + + + private InnerNode createTypecastTree(Map workingValues, InnerNode parent) { + final InnerNode root= new InnerNode(parent, workingValues, FormatterMessages.WhiteSpaceTabPage_typecasts); + + createOption(root, workingValues, FormatterMessages.WhiteSpaceTabPage_after_opening_paren, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_CAST, CAST_PREVIEW); + createOption(root, workingValues, FormatterMessages.WhiteSpaceTabPage_before_closing_paren, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_CAST, CAST_PREVIEW); + createOption(root, workingValues, FormatterMessages.WhiteSpaceTabPage_after_closing_paren, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_CLOSING_PAREN_IN_CAST, CAST_PREVIEW); + return root; + } + + + private InnerNode createParenthesizedExpressionTree(Map workingValues, InnerNode parent) { + final InnerNode root= new InnerNode(parent, workingValues, FormatterMessages.WhiteSpaceTabPage_parenexpr); + + createOption(root, workingValues, FormatterMessages.WhiteSpaceTabPage_before_opening_paren, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_PARENTHESIZED_EXPRESSION, PAREN_EXPR_PREVIEW); + createOption(root, workingValues, FormatterMessages.WhiteSpaceTabPage_after_opening_paren, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_PARENTHESIZED_EXPRESSION, PAREN_EXPR_PREVIEW); + createOption(root, workingValues, FormatterMessages.WhiteSpaceTabPage_before_closing_paren, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_PARENTHESIZED_EXPRESSION, PAREN_EXPR_PREVIEW); + return root; + } + + + + private static InnerNode createChild(InnerNode root, Map workingValues, String message) { + return new InnerNode(root, workingValues, message); + } + + private static OptionNode createOption(InnerNode root, Map workingValues, String message, String key, PreviewSnippet snippet) { + return new OptionNode(root, workingValues, message, key, snippet); + } + + public static void makeIndexForNodes(List tree, List flatList) { + for (final Iterator iter= tree.iterator(); iter.hasNext();) { + final Node node= (Node) iter.next(); + node.index= flatList.size(); + flatList.add(node); + makeIndexForNodes(node.getChildren(), flatList); + } + } +} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/formatter/WhiteSpaceTabPage.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/formatter/WhiteSpaceTabPage.java new file mode 100644 index 00000000000..df2099a0739 --- /dev/null +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/formatter/WhiteSpaceTabPage.java @@ -0,0 +1,479 @@ +/******************************************************************************* + * Copyright (c) 2000, 2008 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + * Anton Leherbauer (Wind River Systems) + *******************************************************************************/ +package org.eclipse.cdt.internal.ui.preferences.formatter; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.Iterator; +import java.util.List; +import java.util.Map; + +import org.eclipse.swt.SWT; +import org.eclipse.swt.custom.SashForm; +import org.eclipse.swt.events.SelectionAdapter; +import org.eclipse.swt.events.SelectionEvent; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.widgets.Combo; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Control; + +import org.eclipse.jface.dialogs.IDialogSettings; +import org.eclipse.jface.viewers.ArrayContentProvider; +import org.eclipse.jface.viewers.CheckStateChangedEvent; +import org.eclipse.jface.viewers.CheckboxTableViewer; +import org.eclipse.jface.viewers.DoubleClickEvent; +import org.eclipse.jface.viewers.ICheckStateListener; +import org.eclipse.jface.viewers.IDoubleClickListener; +import org.eclipse.jface.viewers.ISelection; +import org.eclipse.jface.viewers.ISelectionChangedListener; +import org.eclipse.jface.viewers.IStructuredSelection; +import org.eclipse.jface.viewers.ITreeContentProvider; +import org.eclipse.jface.viewers.LabelProvider; +import org.eclipse.jface.viewers.SelectionChangedEvent; +import org.eclipse.jface.viewers.StructuredSelection; +import org.eclipse.jface.viewers.TreeViewer; +import org.eclipse.jface.viewers.Viewer; + +import org.eclipse.ui.dialogs.ContainerCheckedTreeViewer; +import org.eclipse.ui.part.PageBook; + +import org.eclipse.cdt.ui.CUIPlugin; + +import org.eclipse.cdt.internal.ui.preferences.formatter.WhiteSpaceOptions.InnerNode; +import org.eclipse.cdt.internal.ui.preferences.formatter.WhiteSpaceOptions.Node; +import org.eclipse.cdt.internal.ui.preferences.formatter.WhiteSpaceOptions.OptionNode; + + +public class WhiteSpaceTabPage extends FormatterTabPage { + + + /** + * Encapsulates a view of the options tree which is structured by + * syntactical element. + */ + + private final class SyntaxComponent implements ISelectionChangedListener, ICheckStateListener, IDoubleClickListener { + + private final String PREF_NODE_KEY= CUIPlugin.PLUGIN_ID + "formatter_page.white_space_tab_page.node"; //$NON-NLS-1$ + + private final List fIndexedNodeList; + private final List fTree; + + private ContainerCheckedTreeViewer fTreeViewer; + private Composite fComposite; + + private Node fLastSelected= null; + + public SyntaxComponent() { + fIndexedNodeList= new ArrayList(); + fTree= new WhiteSpaceOptions().createAltTree(fWorkingValues); + WhiteSpaceOptions.makeIndexForNodes(fTree, fIndexedNodeList); + } + + public void createContents(final int numColumns, final Composite parent) { + fComposite= new Composite(parent, SWT.NONE); + fComposite.setLayoutData(createGridData(numColumns, GridData.HORIZONTAL_ALIGN_FILL, SWT.DEFAULT)); + fComposite.setLayout(createGridLayout(numColumns, false)); + + createLabel(numColumns, fComposite, FormatterMessages.WhiteSpaceTabPage_insert_space); + + fTreeViewer= new ContainerCheckedTreeViewer(fComposite, SWT.SINGLE | SWT.BORDER | SWT.V_SCROLL); + fTreeViewer.setContentProvider(new ITreeContentProvider() { + public Object[] getElements(Object inputElement) { + return ((Collection)inputElement).toArray(); + } + public Object[] getChildren(Object parentElement) { + return ((Node)parentElement).getChildren().toArray(); + } + public Object getParent(Object element) { + return ((Node)element).getParent(); + } + public boolean hasChildren(Object element) { + return ((Node)element).hasChildren(); + } + public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {} + public void dispose() {} + }); + fTreeViewer.setLabelProvider(new LabelProvider()); + fTreeViewer.getControl().setLayoutData(createGridData(numColumns, GridData.FILL_HORIZONTAL | GridData.FILL_VERTICAL, SWT.DEFAULT)); + fDefaultFocusManager.add(fTreeViewer.getControl()); + } + + public void initialize() { + fTreeViewer.addCheckStateListener(this); + fTreeViewer.addSelectionChangedListener(this); + fTreeViewer.addDoubleClickListener(this); + fTreeViewer.setInput(fTree); + restoreSelection(); + refreshState(); + } + + public void refreshState() { + final ArrayList checked= new ArrayList(100); + for (Iterator iter= fTree.iterator(); iter.hasNext();) + ((Node) iter.next()).getCheckedLeafs(checked); + fTreeViewer.setGrayedElements(new Object[0]); + fTreeViewer.setCheckedElements(checked.toArray()); + fPreview.clear(); + if (fLastSelected != null) { + fPreview.addAll(fLastSelected.getSnippets()); + } + doUpdatePreview(); + } + + public void selectionChanged(SelectionChangedEvent event) { + final IStructuredSelection selection= (IStructuredSelection)event.getSelection(); + if (selection.isEmpty()) + return; + final Node node= (Node)selection.getFirstElement(); + if (node == fLastSelected) + return; + fDialogSettings.put(PREF_NODE_KEY, node.index); + fPreview.clear(); + fPreview.addAll(node.getSnippets()); + doUpdatePreview(); + fLastSelected= node; + } + + public void checkStateChanged(CheckStateChangedEvent event) { + final Node node= (Node)event.getElement(); + node.setChecked(event.getChecked()); + doUpdatePreview(); + notifyValuesModified(); + } + + public void restoreSelection() { + int index; + try { + index= fDialogSettings.getInt(PREF_NODE_KEY); + } catch (NumberFormatException ex) { + index= -1; + } + if (index < 0 || index > fIndexedNodeList.size() - 1) { + index= 0; + } + final Node node= (Node)fIndexedNodeList.get(index); + if (node != null) { + fTreeViewer.expandToLevel(node, 0); + fTreeViewer.setSelection(new StructuredSelection(new Node [] {node})); + fLastSelected= node; + } + } + + public void doubleClick(DoubleClickEvent event) { + final ISelection selection= event.getSelection(); + if (selection instanceof IStructuredSelection) { + final Node node= (Node)((IStructuredSelection)selection).getFirstElement(); + fTreeViewer.setExpandedState(node, !fTreeViewer.getExpandedState(node)); + } + } + + public Control getControl() { + return fComposite; + } + } + + + + private final class JavaElementComponent implements ISelectionChangedListener, ICheckStateListener { + + private final String PREF_INNER_INDEX= CUIPlugin.PLUGIN_ID + "formatter_page.white_space.java_view.inner"; //$NON-NLS-1$ + private final String PREF_OPTION_INDEX= CUIPlugin.PLUGIN_ID + "formatter_page.white_space.java_view.option"; //$NON-NLS-1$ + + private final ArrayList fIndexedNodeList; + private final ArrayList fTree; + + private InnerNode fLastSelected; + + private TreeViewer fInnerViewer; + private CheckboxTableViewer fOptionsViewer; + + private Composite fComposite; + + public JavaElementComponent() { + fIndexedNodeList= new ArrayList(); + fTree= new WhiteSpaceOptions().createTreeByJavaElement(fWorkingValues); + WhiteSpaceOptions.makeIndexForNodes(fTree, fIndexedNodeList); + } + + public void createContents(int numColumns, Composite parent) { + + fComposite= new Composite(parent, SWT.NONE); + fComposite.setLayoutData(createGridData(numColumns, GridData.HORIZONTAL_ALIGN_FILL, SWT.DEFAULT)); + fComposite.setLayout(createGridLayout(numColumns, false)); + + createLabel(numColumns, fComposite, FormatterMessages.WhiteSpaceTabPage_insert_space, GridData.HORIZONTAL_ALIGN_BEGINNING); + + final SashForm sashForm= new SashForm(fComposite, SWT.VERTICAL); + sashForm.setLayoutData(createGridData(numColumns, GridData.FILL_BOTH, SWT.DEFAULT)); + + fInnerViewer= new TreeViewer(sashForm, SWT.SINGLE | SWT.BORDER | SWT.V_SCROLL); + + fInnerViewer.setContentProvider(new ITreeContentProvider() { + public Object[] getElements(Object inputElement) { + return ((Collection)inputElement).toArray(); + } + public Object[] getChildren(Object parentElement) { + final List children= ((Node)parentElement).getChildren(); + final ArrayList innerChildren= new ArrayList(); + for (final Iterator iter= children.iterator(); iter.hasNext();) { + final Object o= iter.next(); + if (o instanceof InnerNode) innerChildren.add(o); + } + return innerChildren.toArray(); + } + public Object getParent(Object element) { + if (element instanceof InnerNode) + return ((InnerNode)element).getParent(); + return null; + } + public boolean hasChildren(Object element) { + final List children= ((Node)element).getChildren(); + for (final Iterator iter= children.iterator(); iter.hasNext();) + if (iter.next() instanceof InnerNode) return true; + return false; + } + public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {} + public void dispose() {} + }); + + fInnerViewer.setLabelProvider(new LabelProvider()); + + final GridData innerGd= createGridData(numColumns, GridData.HORIZONTAL_ALIGN_FILL | GridData.FILL_VERTICAL, SWT.DEFAULT); + innerGd.heightHint= fPixelConverter.convertHeightInCharsToPixels(3); + fInnerViewer.getControl().setLayoutData(innerGd); + + fOptionsViewer= CheckboxTableViewer.newCheckList(sashForm, SWT.SINGLE | SWT.BORDER | SWT.H_SCROLL); + fOptionsViewer.setContentProvider(new ArrayContentProvider()); + fOptionsViewer.setLabelProvider(new LabelProvider()); + + final GridData optionsGd= createGridData(numColumns, GridData.HORIZONTAL_ALIGN_FILL | GridData.FILL_VERTICAL, SWT.DEFAULT); + optionsGd.heightHint= fPixelConverter.convertHeightInCharsToPixels(3); + fOptionsViewer.getControl().setLayoutData(optionsGd); + + fDefaultFocusManager.add(fInnerViewer.getControl()); + fDefaultFocusManager.add(fOptionsViewer.getControl()); + + fInnerViewer.setInput(fTree); + } + + public void refreshState() { + if (fLastSelected != null) { + innerViewerChanged(fLastSelected); + } + } + + public void initialize() { + fInnerViewer.addSelectionChangedListener(this); + fOptionsViewer.addSelectionChangedListener(this); + fOptionsViewer.addCheckStateListener(this); + restoreSelections(); + refreshState(); + } + + private void restoreSelections() { + Node node; + final int innerIndex= getValidatedIndex(PREF_INNER_INDEX); + node= (Node)fIndexedNodeList.get(innerIndex); + if (node instanceof InnerNode) { + fInnerViewer.expandToLevel(node, 0); + fInnerViewer.setSelection(new StructuredSelection(new Object[] {node})); + fLastSelected= (InnerNode)node; + } + + final int optionIndex= getValidatedIndex(PREF_OPTION_INDEX); + node= (Node)fIndexedNodeList.get(optionIndex); + if (node instanceof OptionNode) { + fOptionsViewer.setSelection(new StructuredSelection(new Object[] {node})); + } + + } + + private int getValidatedIndex(String key) { + int index; + try { + index= fDialogSettings.getInt(key); + } catch (NumberFormatException ex) { + index= 0; + } + if (index < 0 || index > fIndexedNodeList.size() - 1) { + index= 0; + } + return index; + } + + public Control getControl() { + return fComposite; + } + + public void selectionChanged(SelectionChangedEvent event) { + final IStructuredSelection selection= (IStructuredSelection)event.getSelection(); + + if (selection.isEmpty() || !(selection.getFirstElement() instanceof Node)) + return; + + final Node selected= (Node)selection.getFirstElement(); + + if (selected == null || selected == fLastSelected) + return; + + + if (event.getSource() == fInnerViewer && selected instanceof InnerNode) { + fLastSelected= (InnerNode)selected; + fDialogSettings.put(PREF_INNER_INDEX, selected.index); + innerViewerChanged((InnerNode)selected); + } + else if (event.getSource() == fOptionsViewer && selected instanceof OptionNode) + fDialogSettings.put(PREF_OPTION_INDEX, selected.index); + } + + private void innerViewerChanged(InnerNode selectedNode) { + + final List children= selectedNode.getChildren(); + + final ArrayList optionsChildren= new ArrayList(); + for (final Iterator iter= children.iterator(); iter.hasNext();) { + final Object o= iter.next(); + if (o instanceof OptionNode) optionsChildren.add(o); + } + + fOptionsViewer.setInput(optionsChildren.toArray()); + + for (final Iterator iter= optionsChildren.iterator(); iter.hasNext();) { + final OptionNode child= (OptionNode)iter.next(); + fOptionsViewer.setChecked(child, child.getChecked()); + } + + fPreview.clear(); + fPreview.addAll(selectedNode.getSnippets()); + doUpdatePreview(); + } + + public void checkStateChanged(CheckStateChangedEvent event) { + final OptionNode option= (OptionNode)event.getElement(); + if (option != null) + option.setChecked(event.getChecked()); + doUpdatePreview(); + notifyValuesModified(); + } + } + + + + /** + * This component switches between the two view and is responsible for delegating + * the appropriate update requests. + */ + private final class SwitchComponent extends SelectionAdapter { + private final String PREF_VIEW_KEY= CUIPlugin.PLUGIN_ID + "formatter_page.white_space_tab_page.view"; //$NON-NLS-1$ + private final String [] fItems= new String [] { + FormatterMessages.WhiteSpaceTabPage_sort_by_c_element, + FormatterMessages.WhiteSpaceTabPage_sort_by_syntax_element + }; + + private Combo fSwitchCombo; + private PageBook fPageBook; + private final SyntaxComponent fSyntaxComponent; + private final JavaElementComponent fJavaElementComponent; + + public SwitchComponent() { + fSyntaxComponent= new SyntaxComponent(); + fJavaElementComponent= new JavaElementComponent(); + } + + public void widgetSelected(SelectionEvent e) { + final int index= fSwitchCombo.getSelectionIndex(); + if (index == 0) { + fDialogSettings.put(PREF_VIEW_KEY, false); + fJavaElementComponent.refreshState(); + fPageBook.showPage(fJavaElementComponent.getControl()); + } + else if (index == 1) { + fDialogSettings.put(PREF_VIEW_KEY, true); + fSyntaxComponent.refreshState(); + fPageBook.showPage(fSyntaxComponent.getControl()); + } + } + + public void createContents(int numColumns, Composite parent) { + + fPageBook= new PageBook(parent, SWT.NONE); + fPageBook.setLayoutData(createGridData(numColumns, GridData.FILL_BOTH, SWT.DEFAULT)); + + fJavaElementComponent.createContents(numColumns, fPageBook); + fSyntaxComponent.createContents(numColumns, fPageBook); + + fSwitchCombo= new Combo(parent, SWT.READ_ONLY); + final GridData gd= createGridData(numColumns, GridData.HORIZONTAL_ALIGN_END, SWT.DEFAULT); + fSwitchCombo.setLayoutData(gd); + fSwitchCombo.setItems(fItems); + } + + public void initialize() { + fSwitchCombo.addSelectionListener(this); + fJavaElementComponent.initialize(); + fSyntaxComponent.initialize(); + restoreSelection(); + } + + private void restoreSelection() { + final boolean selectSyntax= fDialogSettings.getBoolean(PREF_VIEW_KEY); + if (selectSyntax) { + fSyntaxComponent.refreshState(); + fSwitchCombo.setText(fItems[1]); + fPageBook.showPage(fSyntaxComponent.getControl()); + } else { + fJavaElementComponent.refreshState(); + fSwitchCombo.setText(fItems[0]); + fPageBook.showPage(fJavaElementComponent.getControl()); + } + } + } + + + + + private final SwitchComponent fSwitchComponent; + protected final IDialogSettings fDialogSettings; + + protected SnippetPreview fPreview; + + + /** + * Create a new white space dialog page. + * @param modifyDialog + * @param workingValues + */ + public WhiteSpaceTabPage(ModifyDialog modifyDialog, Map workingValues) { + super(modifyDialog, workingValues); + fDialogSettings= CUIPlugin.getDefault().getDialogSettings(); + fSwitchComponent= new SwitchComponent(); + } + + protected void doCreatePreferences(Composite composite, int numColumns) { + fSwitchComponent.createContents(numColumns, composite); + } + + protected void initializePage() { + fSwitchComponent.initialize(); + } + + protected CPreview doCreateCPreview(Composite parent) { + fPreview= new SnippetPreview(fWorkingValues, parent); + return fPreview; + } + + protected void doUpdatePreview() { + super.doUpdatePreview(); + fPreview.update(); + } +} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/CIndenter.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/CIndenter.java index 16b3393ef39..ac02d59b402 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/CIndenter.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/CIndenter.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 IBM Corporation and others. + * Copyright (c) 2000, 2008 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -137,7 +137,7 @@ public final class CIndenter { } private int prefArrayIndent() { - String option= getCoreFormatterOption(DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_EXPRESSIONS_IN_ARRAY_INITIALIZER); + String option= getCoreFormatterOption(DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_EXPRESSIONS_IN_INITIALIZER_LIST); try { if (DefaultCodeFormatterConstants.getIndentStyle(option) == DefaultCodeFormatterConstants.INDENT_BY_ONE) return 1; @@ -149,7 +149,7 @@ public final class CIndenter { } private boolean prefArrayDeepIndent() { - String option= getCoreFormatterOption(DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_EXPRESSIONS_IN_ARRAY_INITIALIZER); + String option= getCoreFormatterOption(DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_EXPRESSIONS_IN_INITIALIZER_LIST); try { return DefaultCodeFormatterConstants.getIndentStyle(option) == DefaultCodeFormatterConstants.INDENT_ON_COLUMN; } catch (IllegalArgumentException e) { @@ -319,7 +319,7 @@ public final class CIndenter { } private boolean prefIndentBracesForArrays() { - return DefaultCodeFormatterConstants.NEXT_LINE_SHIFTED.equals(getCoreFormatterOption(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ARRAY_INITIALIZER)); + return DefaultCodeFormatterConstants.NEXT_LINE_SHIFTED.equals(getCoreFormatterOption(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_INITIALIZER_LIST)); } private boolean prefIndentBracesForMethods() {