Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnton Leherbauer2006-07-19 14:33:02 +0000
committerAnton Leherbauer2006-07-19 14:33:02 +0000
commit7a6144969813b38f3096fc41541ca66c5c9439eb (patch)
treed5c327c6ea9c3fc2baa59a3cc00f3190a35c9587
parent3b95e39b47c191b9ac5388f346d8644bb8f48619 (diff)
downloadorg.eclipse.cdt-7a6144969813b38f3096fc41541ca66c5c9439eb.tar.gz
org.eclipse.cdt-7a6144969813b38f3096fc41541ca66c5c9439eb.tar.xz
org.eclipse.cdt-7a6144969813b38f3096fc41541ca66c5c9439eb.zip
Patch from Sergey Prigogin for bug 148582 - Support smart indenting in C editor
-rw-r--r--core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/CCorePlugin.java20
-rw-r--r--core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/formatter/CodeFormatterConstants.java3059
-rw-r--r--core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/CCorePreferenceInitializer.java32
-rw-r--r--core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/formatter/DefaultCodeFormatterOptions.java2158
-rw-r--r--core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/formatter/align/Alignment.java124
-rw-r--r--core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/CAutoIndentTest.java93
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/util/CodeFormatterUtil.java79
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/actions/AddBlockCommentAction.java7
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/actions/RemoveBlockCommentAction.java7
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/CEditor.java58
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/asm/AsmSourceViewerConfiguration.java8
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/CAutoIndentStrategy.java639
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/CHeuristicScanner.java867
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/CIndenter.java1615
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/CPartitionScanner.java4
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/CSourceViewerConfiguration.java45
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/CTextTools.java11
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/FastCPartitionScanner.java6
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/SimpleDocument.java374
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/Symbols.java53
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/PreferenceConstants.java51
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/text/ICPartitions.java (renamed from core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/ICPartitions.java)41
22 files changed, 9173 insertions, 178 deletions
diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/CCorePlugin.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/CCorePlugin.java
index a990341e856..f373e9e8037 100644
--- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/CCorePlugin.java
+++ b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/CCorePlugin.java
@@ -141,6 +141,26 @@ public class CCorePlugin extends Plugin {
*/
public final static String CONTENT_TYPE_ASMSOURCE = "org.eclipse.cdt.core.asmSource"; //$NON-NLS-1$
+ /**
+ * Possible configurable option value.
+ * @see #getDefaultOptions()
+ */
+ public static final String INSERT = "insert"; //$NON-NLS-1$
+ /**
+ * Possible configurable option value.
+ * @see #getDefaultOptions()
+ */
+ public static final String DO_NOT_INSERT = "do not insert"; //$NON-NLS-1$
+ /**
+ * Possible configurable option value.
+ * @see #getDefaultOptions()
+ */
+ public static final String TAB = "tab"; //$NON-NLS-1$
+ /**
+ * Possible configurable option value.
+ * @see #getDefaultOptions()
+ */
+ public static final String SPACE = "space"; //$NON-NLS-1$
public CDTLogWriter cdtLog = null;
diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/formatter/CodeFormatterConstants.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/formatter/CodeFormatterConstants.java
index 0f3f1b87558..0401c9b43ae 100644
--- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/formatter/CodeFormatterConstants.java
+++ b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/formatter/CodeFormatterConstants.java
@@ -7,20 +7,24 @@
*
* Contributors:
* QNX Software Systems - Initial API and implementation
+ * Sergey Prigogin, Google
*******************************************************************************/
package org.eclipse.cdt.core.formatter;
+import java.util.Map;
+
import org.eclipse.cdt.core.CCorePlugin;
+import org.eclipse.cdt.internal.formatter.DefaultCodeFormatterOptions;
+import org.eclipse.cdt.internal.formatter.align.Alignment;
/**
*/
public class CodeFormatterConstants {
-
/**
* <pre>
* FORMATTER / Option for alignment of arguments in allocation expression
- * - option id: "org.eclipse.jdt.core.formatter.language"
+ * - option id: "org.eclipse.cdt.core.formatter.language"
* - possible values: values proposed in class <code>ParserLanguage</code>
* - default: ParserLanguage.CPP
* </pre>
@@ -30,13 +34,3062 @@ public class CodeFormatterConstants {
/**
* <pre>
* FORMATTER / Option for alignment of arguments in allocation expression
- * - option id: "org.eclipse.jdt.core.formatter.current_file"
+ * - option id: "org.eclipse.cdt.core.formatter.current_file"
* - possible values: object of class <code>IFile</code> or <code>null</code>
* - default: null
* </pre>
*/
public static final String FORMATTER_CURRENT_FILE = CCorePlugin.PLUGIN_ID + ".formatter.current_file"; //$NON-NLS-1$
+ /**
+ * <pre>
+ * FORMATTER / Value to set a brace location at the end of a line.
+ * </pre>
+ * @see #FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION
+ * @see #FORMATTER_BRACE_POSITION_FOR_ARRAY_INITIALIZER
+ * @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$
+
+ /**
+ * <pre>
+ * FORMATTER / Value to set an option to false.
+ * </pre>
+ */
+ public static final String FALSE = "false"; //$NON-NLS-1$
+
+ /**
+ * <pre>
+ * FORMATTER / Option to align type members of a type declaration on column
+ * - option id: "org.eclipse.cdt.core.formatter.formatter.align_type_members_on_columns"
+ * - possible values: { TRUE, FALSE }
+ * - default: FALSE
+ * </pre>
+ * @see #TRUE
+ * @see #FALSE
+ */
+ public static final String FORMATTER_ALIGN_TYPE_MEMBERS_ON_COLUMNS = CCorePlugin.PLUGIN_ID + ".formatter.align_type_members_on_columns"; //$NON-NLS-1$
+
+ /**
+ * <pre>
+ * FORMATTER / Option for alignment of arguments in allocation expression
+ * - option id: "org.eclipse.cdt.core.formatter.alignment_for_arguments_in_allocation_expression"
+ * - possible values: values returned by <code>createAlignmentValue(boolean, int, int)</code> call
+ * - default: createAlignmentValue(false, WRAP_COMPACT, INDENT_DEFAULT)
+ * </pre>
+ * @see #createAlignmentValue(boolean, int, int)
+ */
+ public static final String FORMATTER_ALIGNMENT_FOR_ARGUMENTS_IN_ALLOCATION_EXPRESSION = CCorePlugin.PLUGIN_ID + ".formatter.alignment_for_arguments_in_allocation_expression"; //$NON-NLS-1$
+ /**
+ * <pre>
+ * FORMATTER / Option for alignment of arguments in enum constant
+ * - option id: "org.eclipse.cdt.core.formatter.alignment_for_arguments_in_enum_constant"
+ * - possible values: values returned by <code>createAlignmentValue(boolean, int, int)</code> call
+ * - default: createAlignmentValue(false, WRAP_COMPACT, INDENT_DEFAULT)
+ * </pre>
+ * @see #createAlignmentValue(boolean, int, int)
+ */
+ public static final String FORMATTER_ALIGNMENT_FOR_ARGUMENTS_IN_ENUM_CONSTANT = CCorePlugin.PLUGIN_ID + ".formatter.alignment_for_arguments_in_enum_constant"; //$NON-NLS-1$
+ /**
+ * <pre>
+ * FORMATTER / Option for alignment of arguments in explicit constructor call
+ * - option id: "org.eclipse.cdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call"
+ * - possible values: values returned by <code>createAlignmentValue(boolean, int, int)</code> call
+ * - default: createAlignmentValue(false, WRAP_COMPACT, INDENT_DEFAULT)
+ * </pre>
+ * @see #createAlignmentValue(boolean, int, int)
+ */
+ public static final String FORMATTER_ALIGNMENT_FOR_ARGUMENTS_IN_EXPLICIT_CONSTRUCTOR_CALL = CCorePlugin.PLUGIN_ID + ".formatter.alignment_for_arguments_in_explicit_constructor_call"; //$NON-NLS-1$
+ /**
+ * <pre>
+ * FORMATTER / Option for alignment of arguments in method invocation
+ * - option id: "org.eclipse.cdt.core.formatter.alignment_for_arguments_in_method_invocation"
+ * - possible values: values returned by <code>createAlignmentValue(boolean, int, int)</code> call
+ * - default: createAlignmentValue(false, WRAP_COMPACT, INDENT_DEFAULT)
+ * </pre>
+ * @see #createAlignmentValue(boolean, int, int)
+ */
+ public static final String FORMATTER_ALIGNMENT_FOR_ARGUMENTS_IN_METHOD_INVOCATION = CCorePlugin.PLUGIN_ID + ".formatter.alignment_for_arguments_in_method_invocation"; //$NON-NLS-1$
+ /**
+ * <pre>
+ * FORMATTER / Option for alignment of arguments in qualified allocation expression
+ * - option id: "org.eclipse.cdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression"
+ * - possible values: values returned by <code>createAlignmentValue(boolean, int, int)</code> call
+ * - default: createAlignmentValue(false, WRAP_COMPACT, INDENT_DEFAULT)
+ * </pre>
+ * @see #createAlignmentValue(boolean, int, int)
+ */
+ public static final String FORMATTER_ALIGNMENT_FOR_ARGUMENTS_IN_QUALIFIED_ALLOCATION_EXPRESSION = CCorePlugin.PLUGIN_ID + ".formatter.alignment_for_arguments_in_qualified_allocation_expression"; //$NON-NLS-1$
+ /**
+ * <pre>
+ * FORMATTER / Option for alignment of assignment
+ * - option id: "org.eclipse.cdt.core.formatter.alignment_for_assignment"
+ * - possible values: values returned by <code>createAlignmentValue(boolean, int, int)</code> call
+ * - default: createAlignmentValue(false, M_NO_ALIGNMENT, INDENT_DEFAULT)
+ * </pre>
+ * @see #createAlignmentValue(boolean, int, int)
+ */
+ public static final String FORMATTER_ALIGNMENT_FOR_ASSIGNMENT = CCorePlugin.PLUGIN_ID + ".formatter.alignment_for_assignment"; //$NON-NLS-1$
+ /**
+ * <pre>
+ * FORMATTER / Option for alignment of binary expression
+ * - option id: "org.eclipse.cdt.core.formatter.alignment_for_binary_expression"
+ * - possible values: values returned by <code>createAlignmentValue(boolean, int, int)</code> call
+ * - default: createAlignmentValue(false, WRAP_COMPACT, INDENT_DEFAULT)
+ * </pre>
+ * @see #createAlignmentValue(boolean, int, int)
+ */
+ public static final String FORMATTER_ALIGNMENT_FOR_BINARY_EXPRESSION = CCorePlugin.PLUGIN_ID + ".formatter.alignment_for_binary_expression"; //$NON-NLS-1$
+ /**
+ * <pre>
+ * FORMATTER / Option for alignment of compact if
+ * - option id: "org.eclipse.cdt.core.formatter.alignment_for_compact_if"
+ * - possible values: values returned by <code>createAlignmentValue(boolean, int, int)</code> call
+ * - default: createAlignmentValue(false, WRAP_ONE_PER_LINE, INDENT_BY_ONE)
+ * </pre>
+ * @see #createAlignmentValue(boolean, int, int)
+ */
+ public static final String FORMATTER_ALIGNMENT_FOR_COMPACT_IF = CCorePlugin.PLUGIN_ID + ".formatter.alignment_for_compact_if"; //$NON-NLS-1$
+ /**
+ * <pre>
+ * FORMATTER / Option for alignment of conditional expression
+ * - option id: "org.eclipse.cdt.core.formatter.alignment_for_conditional_expression"
+ * - possible values: values returned by <code>createAlignmentValue(boolean, int, int)</code> call
+ * - default: createAlignmentValue(false, WRAP_ONE_PER_LINE, INDENT_DEFAULT)
+ * </pre>
+ * @see #createAlignmentValue(boolean, int, int)
+ */
+ public static final String FORMATTER_ALIGNMENT_FOR_CONDITIONAL_EXPRESSION = CCorePlugin.PLUGIN_ID + ".formatter.alignment_for_conditional_expression"; //$NON-NLS-1$
+ /**
+ * <pre>
+ * FORMATTER / Option for alignment of enum constants
+ * - option id: "org.eclipse.cdt.core.formatter.alignment_for_enum_constants"
+ * - possible values: values returned by <code>createAlignmentValue(boolean, int, int)</code> call
+ * - default: createAlignmentValue(false, WRAP_NO_SPLIT, INDENT_DEFAULT)
+ * </pre>
+ * @see #createAlignmentValue(boolean, int, int)
+ */
+ public static final String FORMATTER_ALIGNMENT_FOR_ENUM_CONSTANTS = CCorePlugin.PLUGIN_ID + ".formatter.alignment_for_enum_constants"; //$NON-NLS-1$
+ /**
+ * <pre>
+ * FORMATTER / Option for alignment of expressions in array initializer
+ * - option id: "org.eclipse.cdt.core.formatter.alignment_for_expressions_in_array_initializer"
+ * - possible values: values returned by <code>createAlignmentValue(boolean, int, int)</code> call
+ * - default: createAlignmentValue(false, WRAP_COMPACT, INDENT_DEFAULT)
+ * </pre>
+ * @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$
+ /**
+ * <pre>
+ * FORMATTER / Option for alignment of multiple fields
+ * - option id: "org.eclipse.cdt.core.formatter.alignment_for_multiple_fields"
+ * - possible values: values returned by <code>createAlignmentValue(boolean, int, int)</code> call
+ * - default: createAlignmentValue(false, WRAP_COMPACT, INDENT_DEFAULT)
+ * </pre>
+ * @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$
+ /**
+ * <pre>
+ * FORMATTER / Option for alignment of parameters in constructor declaration
+ * - option id: "org.eclipse.cdt.core.formatter.alignment_for_parameters_in_constructor_declaration"
+ * - possible values: values returned by <code>createAlignmentValue(boolean, int, int)</code> call
+ * - default: createAlignmentValue(false, WRAP_COMPACT, INDENT_DEFAULT)
+ * </pre>
+ * @see #createAlignmentValue(boolean, int, int)
+ */
+ public static final String FORMATTER_ALIGNMENT_FOR_PARAMETERS_IN_CONSTRUCTOR_DECLARATION = CCorePlugin.PLUGIN_ID + ".formatter.alignment_for_parameters_in_constructor_declaration"; //$NON-NLS-1$
+ /**
+ * <pre>
+ * FORMATTER / Option for alignment of parameters in method declaration
+ * - option id: "org.eclipse.cdt.core.formatter.alignment_for_parameters_in_method_declaration"
+ * - possible values: values returned by <code>createAlignmentValue(boolean, int, int)</code> call
+ * - default: createAlignmentValue(false, WRAP_COMPACT, INDENT_DEFAULT)
+ * </pre>
+ * @see #createAlignmentValue(boolean, int, int)
+ */
+ public static final String FORMATTER_ALIGNMENT_FOR_PARAMETERS_IN_METHOD_DECLARATION = CCorePlugin.PLUGIN_ID + ".formatter.alignment_for_parameters_in_method_declaration"; //$NON-NLS-1$
+ /**
+ * <pre>
+ * FORMATTER / Option for alignment of selector in method invocation
+ * - option id: "org.eclipse.cdt.core.formatter.alignment_for_selector_in_method_invocation"
+ * - possible values: values returned by <code>createAlignmentValue(boolean, int, int)</code> call
+ * - default: createAlignmentValue(false, WRAP_COMPACT, INDENT_DEFAULT)
+ * </pre>
+ * @see #createAlignmentValue(boolean, int, int)
+ */
+ public static final String FORMATTER_ALIGNMENT_FOR_SELECTOR_IN_METHOD_INVOCATION = CCorePlugin.PLUGIN_ID + ".formatter.alignment_for_selector_in_method_invocation"; //$NON-NLS-1$
+ /**
+ * <pre>
+ * FORMATTER / Option for alignment of superclass in type declaration
+ * - option id: "org.eclipse.cdt.core.formatter.alignment_for_superclass_in_type_declaration"
+ * - possible values: values returned by <code>createAlignmentValue(boolean, int, int)</code> call
+ * - default: createAlignmentValue(false, WRAP_NEXT_SHIFTED, INDENT_DEFAULT)
+ * </pre>
+ * @see #createAlignmentValue(boolean, int, int)
+ */
+ public static final String FORMATTER_ALIGNMENT_FOR_SUPERCLASS_IN_TYPE_DECLARATION = CCorePlugin.PLUGIN_ID + ".formatter.alignment_for_superclass_in_type_declaration"; //$NON-NLS-1$
+ /**
+ * <pre>
+ * FORMATTER / Option for alignment of superinterfaces in enum declaration
+ * - option id: "org.eclipse.cdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration"
+ * - possible values: values returned by <code>createAlignmentValue(boolean, int, int)</code> call
+ * - default: createAlignmentValue(false, WRAP_COMPACT, INDENT_DEFAULT)
+ * </pre>
+ * @see #createAlignmentValue(boolean, int, int)
+ */
+ public static final String FORMATTER_ALIGNMENT_FOR_SUPERINTERFACES_IN_ENUM_DECLARATION = CCorePlugin.PLUGIN_ID + ".formatter.alignment_for_superinterfaces_in_enum_declaration"; //$NON-NLS-1$
+ /**
+ * <pre>
+ * FORMATTER / Option for alignment of superinterfaces in type declaration
+ * - option id: "org.eclipse.cdt.core.formatter.alignment_for_superinterfaces_in_type_declaration"
+ * - possible values: values returned by <code>createAlignmentValue(boolean, int, int)</code> call
+ * - default: createAlignmentValue(false, WRAP_COMPACT, INDENT_DEFAULT)
+ * </pre>
+ * @see #createAlignmentValue(boolean, int, int)
+ */
+ public static final String FORMATTER_ALIGNMENT_FOR_SUPERINTERFACES_IN_TYPE_DECLARATION = CCorePlugin.PLUGIN_ID + ".formatter.alignment_for_superinterfaces_in_type_declaration"; //$NON-NLS-1$
+ /**
+ * <pre>
+ * FORMATTER / Option for alignment of throws clause in constructor declaration
+ * - option id: "org.eclipse.cdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration"
+ * - possible values: values returned by <code>createAlignmentValue(boolean, int, int)</code> call
+ * - default: createAlignmentValue(false, WRAP_COMPACT, INDENT_DEFAULT)
+ * </pre>
+ * @see #createAlignmentValue(boolean, int, int)
+ */
+ public static final String FORMATTER_ALIGNMENT_FOR_THROWS_CLAUSE_IN_CONSTRUCTOR_DECLARATION = CCorePlugin.PLUGIN_ID + ".formatter.alignment_for_throws_clause_in_constructor_declaration"; //$NON-NLS-1$
+ /**
+ * <pre>
+ * FORMATTER / Option for alignment of throws clause in method declaration
+ * - option id: "org.eclipse.cdt.core.formatter.alignment_for_throws_clause_in_method_declaration"
+ * - possible values: values returned by <code>createAlignmentValue(boolean, int, int)</code> call
+ * - default: createAlignmentValue(false, WRAP_COMPACT, INDENT_DEFAULT)
+ * </pre>
+ * @see #createAlignmentValue(boolean, int, int)
+ */
+ public static final String FORMATTER_ALIGNMENT_FOR_THROWS_CLAUSE_IN_METHOD_DECLARATION = CCorePlugin.PLUGIN_ID + ".formatter.alignment_for_throws_clause_in_method_declaration"; //$NON-NLS-1$
+
+// /**
+// * <pre>
+// * FORMATTER / Option to add blank lines after the imports declaration
+// * - option id: "org.eclipse.cdt.core.formatter.blank_lines_after_imports"
+// * - possible values: "&lt;n&gt;", where n is zero or a positive integer
+// * - default: "0"
+// * </pre>
+// */
+// public static final String FORMATTER_BLANK_LINES_AFTER_IMPORTS = CCorePlugin.PLUGIN_ID + ".formatter.blank_lines_after_imports"; //$NON-NLS-1$
+// /**
+// * <pre>
+// * FORMATTER / Option to add blank lines after the package declaration
+// * - option id: "org.eclipse.cdt.core.formatter.blank_lines_after_package"
+// * - possible values: "&lt;n&gt;", where n is zero or a positive integer
+// * - default: "0"
+// * </pre>
+// */
+// public static final String FORMATTER_BLANK_LINES_AFTER_PACKAGE = CCorePlugin.PLUGIN_ID + ".formatter.blank_lines_after_package"; //$NON-NLS-1$
+// /**
+// * <pre>
+// * FORMATTER / Option to add blank lines at the beginning of the method body
+// * - option id: "org.eclipse.cdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body"
+// * - possible values: "&lt;n&gt;", where n is zero or a positive integer
+// * - default: "0"
+// * </pre>
+// */
+// public static final String FORMATTER_BLANK_LINES_AT_BEGINNING_OF_METHOD_BODY = CCorePlugin.PLUGIN_ID + ".formatter.number_of_blank_lines_at_beginning_of_method_body"; //$NON-NLS-1$
+// /**
+// * <pre>
+// * FORMATTER / Option to add blank lines before a field declaration
+// * - option id: "org.eclipse.cdt.core.formatter.blank_lines_before_field"
+// * - possible values: "&lt;n&gt;", where n is zero or a positive integer
+// * - default: "0"
+// * </pre>
+// */
+// public static final String FORMATTER_BLANK_LINES_BEFORE_FIELD = CCorePlugin.PLUGIN_ID + ".formatter.blank_lines_before_field"; //$NON-NLS-1$
+// /**
+// * <pre>
+// * FORMATTER / Option to add blank lines before the first class body declaration
+// * - option id: "org.eclipse.cdt.core.formatter.blank_lines_before_first_class_body_declaration"
+// * - possible values: "&lt;n&gt;", where n is zero or a positive integer
+// * - default: "0"
+// * </pre>
+// */
+// 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$
+// /**
+// * <pre>
+// * FORMATTER / Option to add blank lines before the imports declaration
+// * - option id: "org.eclipse.cdt.core.formatter.blank_lines_before_imports"
+// * - possible values: "&lt;n&gt;", where n is zero or a positive integer
+// * - default: "0"
+// * </pre>
+// */
+// public static final String FORMATTER_BLANK_LINES_BEFORE_IMPORTS = CCorePlugin.PLUGIN_ID + ".formatter.blank_lines_before_imports"; //$NON-NLS-1$
+// /**
+// * <pre>
+// * FORMATTER / Option to add blank lines before a member type declaration
+// * - option id: "org.eclipse.cdt.core.formatter.blank_lines_before_member_type"
+// * - possible values: "&lt;n&gt;", where n is zero or a positive integer
+// * - default: "0"
+// * </pre>
+// */
+// public static final String FORMATTER_BLANK_LINES_BEFORE_MEMBER_TYPE = CCorePlugin.PLUGIN_ID + ".formatter.blank_lines_before_member_type"; //$NON-NLS-1$
+// /**
+// * <pre>
+// * FORMATTER / Option to add blank lines before a method declaration
+// * - option id: "org.eclipse.cdt.core.formatter.blank_lines_before_method"
+// * - possible values: "&lt;n&gt;", where n is zero or a positive integer
+// * - default: "0"
+// * </pre>
+// */
+// public static final String FORMATTER_BLANK_LINES_BEFORE_METHOD = CCorePlugin.PLUGIN_ID + ".formatter.blank_lines_before_method"; //$NON-NLS-1$
+// /**
+// * <pre>
+// * FORMATTER / Option to add blank lines before a new chunk
+// * - option id: "org.eclipse.cdt.core.formatter.blank_lines_before_new_chunk"
+// * - possible values: "&lt;n&gt;", where n is zero or a positive integer
+// * - default: "0"
+// * </pre>
+// */
+// public static final String FORMATTER_BLANK_LINES_BEFORE_NEW_CHUNK = CCorePlugin.PLUGIN_ID + ".formatter.blank_lines_before_new_chunk"; //$NON-NLS-1$
+// /**
+// * <pre>
+// * FORMATTER / Option to add blank lines before the package declaration
+// * - option id: "org.eclipse.cdt.core.formatter.blank_lines_before_package"
+// * - possible values: "&lt;n&gt;", where n is zero or a positive integer
+// * - default: "0"
+// * </pre>
+// */
+// public static final String FORMATTER_BLANK_LINES_BEFORE_PACKAGE = CCorePlugin.PLUGIN_ID + ".formatter.blank_lines_before_package"; //$NON-NLS-1$
+// /**
+// * <pre>
+// * FORMATTER / Option to add blank lines between type declarations
+// * - option id: "org.eclipse.cdt.core.formatter.blank_lines_between_type_declarations"
+// * - possible values: "&lt;n&gt;", where n is zero or a positive integer
+// * - default: "0"
+// * </pre>
+// */
+// public static final String FORMATTER_BLANK_LINES_BETWEEN_TYPE_DECLARATIONS = CCorePlugin.PLUGIN_ID + ".formatter.blank_lines_between_type_declarations"; //$NON-NLS-1$
+
+ /**
+ * <pre>
+ * FORMATTER / Option to position the braces of an annotation type declaration
+ * - option id: "org.eclipse.cdt.core.formatter.brace_position_for_annotation_type_declaration"
+ * - possible values: { END_OF_LINE, NEXT_LINE, NEXT_LINE_SHIFTED, NEXT_LINE_ON_WRAP }
+ * - default: END_OF_LINE
+ * </pre>
+ * @see #END_OF_LINE
+ * @see #NEXT_LINE
+ * @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$
+ /**
+ * <pre>
+ * FORMATTER / Option to position the braces of a block
+ * - option id: "org.eclipse.cdt.core.formatter.brace_position_for_block"
+ * - possible values: { END_OF_LINE, NEXT_LINE, NEXT_LINE_SHIFTED, NEXT_LINE_ON_WRAP }
+ * - default: END_OF_LINE
+ * </pre>
+ * @see #END_OF_LINE
+ * @see #NEXT_LINE
+ * @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$
+ /**
+ * <pre>
+ * FORMATTER / Option to position the braces of a block in a case statement when the block is the first statement following
+ * the case
+ * - option id: "org.eclipse.cdt.core.formatter.brace_position_for_block_in_case"
+ * - possible values: { END_OF_LINE, NEXT_LINE, NEXT_LINE_SHIFTED, NEXT_LINE_ON_WRAP }
+ * - default: END_OF_LINE
+ * </pre>
+ * @see #END_OF_LINE
+ * @see #NEXT_LINE
+ * @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$
+ /**
+ * <pre>
+ * FORMATTER / Option to position the braces of a constructor declaration
+ * - option id: "org.eclipse.cdt.core.formatter.brace_position_for_constructor_declaration"
+ * - possible values: { END_OF_LINE, NEXT_LINE, NEXT_LINE_SHIFTED, NEXT_LINE_ON_WRAP }
+ * - default: END_OF_LINE
+ * </pre>
+ * @see #END_OF_LINE
+ * @see #NEXT_LINE
+ * @see #NEXT_LINE_SHIFTED
+ * @see #NEXT_LINE_ON_WRAP
+ */
+ public static final String FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION = CCorePlugin.PLUGIN_ID + ".formatter.brace_position_for_constructor_declaration"; //$NON-NLS-1$
+ /**
+ * <pre>
+ * FORMATTER / Option to position the braces of an enum constant
+ * - option id: "org.eclipse.cdt.core.formatter.brace_position_for_enum_constant"
+ * - possible values: { END_OF_LINE, NEXT_LINE, NEXT_LINE_SHIFTED, NEXT_LINE_ON_WRAP }
+ * - default: END_OF_LINE
+ * </pre>
+ * @see #END_OF_LINE
+ * @see #NEXT_LINE
+ * @see #NEXT_LINE_SHIFTED
+ * @see #NEXT_LINE_ON_WRAP
+ */
+ public static final String FORMATTER_BRACE_POSITION_FOR_ENUM_CONSTANT = CCorePlugin.PLUGIN_ID + ".formatter.brace_position_for_enum_constant"; //$NON-NLS-1$
+ /**
+ * <pre>
+ * FORMATTER / Option to position the braces of an enum declaration
+ * - option id: "org.eclipse.cdt.core.formatter.brace_position_for_enum_declaration"
+ * - possible values: { END_OF_LINE, NEXT_LINE, NEXT_LINE_SHIFTED, NEXT_LINE_ON_WRAP }
+ * - default: END_OF_LINE
+ * </pre>
+ * @see #END_OF_LINE
+ * @see #NEXT_LINE
+ * @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$
+ /**
+ * <pre>
+ * FORMATTER / Option to position the braces of a method declaration
+ * - option id: "org.eclipse.cdt.core.formatter.brace_position_for_method_declaration"
+ * - possible values: { END_OF_LINE, NEXT_LINE, NEXT_LINE_SHIFTED, NEXT_LINE_ON_WRAP }
+ * - default: END_OF_LINE
+ * </pre>
+ * @see #END_OF_LINE
+ * @see #NEXT_LINE
+ * @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$
+ /**
+ * <pre>
+ * FORMATTER / Option to position the braces of a switch statement
+ * - option id: "org.eclipse.cdt.core.formatter.brace_position_for_switch"
+ * - possible values: { END_OF_LINE, NEXT_LINE, NEXT_LINE_SHIFTED, NEXT_LINE_ON_WRAP }
+ * - default: END_OF_LINE
+ * </pre>
+ * @see #END_OF_LINE
+ * @see #NEXT_LINE
+ * @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$
+ /**
+ * <pre>
+ * FORMATTER / Option to position the braces of a type declaration
+ * - option id: "org.eclipse.cdt.core.formatter.brace_position_for_type_declaration"
+ * - possible values: { END_OF_LINE, NEXT_LINE, NEXT_LINE_SHIFTED, NEXT_LINE_ON_WRAP }
+ * - default: END_OF_LINE
+ * </pre>
+ * @see #END_OF_LINE
+ * @see #NEXT_LINE
+ * @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$
+
+// /**
+// * <pre>
+// * FORMATTER / Option to control whether blank lines are cleared inside comments
+// * - option id: "org.eclipse.cdt.core.formatter.comment.clear_blank_lines"
+// * - possible values: { TRUE, FALSE }
+// * - default: FALSE
+// * </pre>
+// * @see #TRUE
+// * @see #FALSE
+// */
+// public final static String FORMATTER_COMMENT_CLEAR_BLANK_LINES = CCorePlugin.PLUGIN_ID + ".formatter.comment.clear_blank_lines"; //$NON-NLS-1$
+
+// /**
+// * <pre>
+// * FORMATTER / Option to control whether comments are formatted
+// * - option id: "org.eclipse.cdt.core.formatter.comment.format_comments"
+// * - possible values: { TRUE, FALSE }
+// * - default: TRUE
+// * </pre>
+// * @see #TRUE
+// * @see #FALSE
+// */
+// public final static String FORMATTER_COMMENT_FORMAT = CCorePlugin.PLUGIN_ID + ".formatter.comment.format_comments"; //$NON-NLS-1$
+
+// /**
+// * <pre>
+// * FORMATTER / Option to control whether the header comment of a C/C++ source file is formatted
+// * - option id: "org.eclipse.cdt.core.formatter.comment.format_header"
+// * - possible values: { TRUE, FALSE }
+// * - default: FALSE
+// * </pre>
+// * @see #TRUE
+// * @see #FALSE
+// */
+// public final static String FORMATTER_COMMENT_FORMAT_HEADER = CCorePlugin.PLUGIN_ID + ".formatter.comment.format_header"; //$NON-NLS-1$
+
+// /**
+// * <pre>
+// * FORMATTER / Option to control whether HTML tags are formatted.
+// * - option id: "org.eclipse.cdt.core.formatter.comment.format_html"
+// * - possible values: { TRUE, FALSE }
+// * - default: TRUE
+// * </pre>
+// * @see #TRUE
+// * @see #FALSE
+// */
+// public final static String FORMATTER_COMMENT_FORMAT_HTML = CCorePlugin.PLUGIN_ID + ".formatter.comment.format_html"; //$NON-NLS-1$
+
+// /**
+// * <pre>
+// * FORMATTER / Option to control whether code snippets are formatted in comments
+// * - option id: "org.eclipse.cdt.core.formatter.comment.format_source_code"
+// * - possible values: { TRUE, FALSE }
+// * - default: TRUE
+// * </pre>
+// * @see #TRUE
+// * @see #FALSE
+// */
+// public final static String FORMATTER_COMMENT_FORMAT_SOURCE = CCorePlugin.PLUGIN_ID + ".formatter.comment.format_source_code"; //$NON-NLS-1$
+
+// /**
+// * <pre>
+// * FORMATTER / Option to specify the line length for comments.
+// * - option id: "org.eclipse.cdt.core.formatter.comment.line_length"
+// * - possible values: "&lt;n&gt;", where n is zero or a positive integer
+// * - default: "80"
+// * </pre>
+// */
+// public final static String FORMATTER_COMMENT_LINE_LENGTH = CCorePlugin.PLUGIN_ID + ".formatter.comment.line_length"; //$NON-NLS-1$
+
+// /**
+// * <pre>
+// * FORMATTER / Option to compact else/if
+// * - option id: "org.eclipse.cdt.core.formatter.compact_else_if"
+// * - possible values: { TRUE, FALSE }
+// * - default: TRUE
+// * </pre>
+// * @see #TRUE
+// * @see #FALSE
+// */
+// public static final String FORMATTER_COMPACT_ELSE_IF = CCorePlugin.PLUGIN_ID + ".formatter.compact_else_if"; //$NON-NLS-1$
+
+ /**
+ * <pre>
+ * FORMATTER / Option to set the continuation indentation
+ * - option id: "org.eclipse.cdt.core.formatter.continuation_indentation"
+ * - possible values: "&lt;n&gt;", where n is zero or a positive integer
+ * - default: "2"
+ * </pre>
+ */
+ public static final String FORMATTER_CONTINUATION_INDENTATION = CCorePlugin.PLUGIN_ID + ".formatter.continuation_indentation"; //$NON-NLS-1$
+ /**
+ * <pre>
+ * FORMATTER / Option to set the continuation indentation inside array initializer
+ * - option id: "org.eclipse.cdt.core.formatter.continuation_indentation_for_array_initializer"
+ * - possible values: "&lt;n&gt;", where n is zero or a positive integer
+ * - default: "2"
+ * </pre>
+ */
+ public static final String FORMATTER_CONTINUATION_INDENTATION_FOR_ARRAY_INITIALIZER = CCorePlugin.PLUGIN_ID + ".formatter.continuation_indentation_for_array_initializer"; //$NON-NLS-1$
+ /**
+ * <pre>
+ * FORMATTER / Option to indent body declarations compare to its enclosing annotation declaration header
+ * - option id: "org.eclipse.cdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header"
+ * - possible values: { TRUE, FALSE }
+ * - default: TRUE
+ * </pre>
+ * @see #TRUE
+ * @see #FALSE
+ */
+ public static final String FORMATTER_INDENT_BODY_DECLARATIONS_COMPARE_TO_ANNOTATION_DECLARATION_HEADER = CCorePlugin.PLUGIN_ID + ".formatter.indent_body_declarations_compare_to_annotation_declaration_header"; //$NON-NLS-1$
+ /**
+ * <pre>
+ * FORMATTER / Option to indent body declarations compare to its enclosing enum constant header
+ * - option id: "org.eclipse.cdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header"
+ * - possible values: { TRUE, FALSE }
+ * - default: TRUE
+ * </pre>
+ * @see #TRUE
+ * @see #FALSE
+ */
+ public static final String FORMATTER_INDENT_BODY_DECLARATIONS_COMPARE_TO_ENUM_CONSTANT_HEADER = CCorePlugin.PLUGIN_ID + ".formatter.indent_body_declarations_compare_to_enum_constant_header"; //$NON-NLS-1$
+ /**
+ * <pre>
+ * 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
+ * </pre>
+ * @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$
+ /**
+ * <pre>
+ * FORMATTER / Option to indent body declarations compare to its enclosing type header
+ * - option id: "org.eclipse.cdt.core.formatter.indent_body_declarations_compare_to_type_header"
+ * - possible values: { TRUE, FALSE }
+ * - default: TRUE
+ * </pre>
+ * @see #TRUE
+ * @see #FALSE
+ */
+ public static final String FORMATTER_INDENT_BODY_DECLARATIONS_COMPARE_TO_TYPE_HEADER = CCorePlugin.PLUGIN_ID + ".formatter.indent_body_declarations_compare_to_type_header"; //$NON-NLS-1$
+ /**
+ * <pre>
+ * FORMATTER / Option to indent breaks compare to cases
+ * - option id: "org.eclipse.cdt.core.formatter.indent_breaks_compare_to_cases"
+ * - possible values: { TRUE, FALSE }
+ * - default: TRUE
+ * </pre>
+ * @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$
+ /**
+ * <pre>
+ * FORMATTER / Option to indent empty lines
+ * - option id: "org.eclipse.cdt.core.formatter.indent_empty_lines"
+ * - possible values: { TRUE, FALSE }
+ * - default: FALSE
+ * </pre>
+ * @see #TRUE
+ * @see #FALSE
+ */
+ public static final String FORMATTER_INDENT_EMPTY_LINES = CCorePlugin.PLUGIN_ID + ".formatter.indent_empty_lines"; //$NON-NLS-1$
+ /**
+ * <pre>
+ * FORMATTER / Option to indent statements inside a block
+ * - option id: "org.eclipse.cdt.core.formatter.indent_statements_compare_to_block"
+ * - possible values: { TRUE, FALSE }
+ * - default: TRUE
+ * </pre>
+ * @see #TRUE
+ * @see #FALSE
+ */
+ public static final String FORMATTER_INDENT_STATEMENTS_COMPARE_TO_BLOCK = CCorePlugin.PLUGIN_ID + ".formatter.indent_statements_compare_to_block"; //$NON-NLS-1$
+ /**
+ * <pre>
+ * FORMATTER / Option to indent statements inside the body of a method or a constructor
+ * - option id: "org.eclipse.cdt.core.formatter.indent_statements_compare_to_body"
+ * - possible values: { TRUE, FALSE }
+ * - default: TRUE
+ * </pre>
+ * @see #TRUE
+ * @see #FALSE
+ */
+ public static final String FORMATTER_INDENT_STATEMENTS_COMPARE_TO_BODY = CCorePlugin.PLUGIN_ID + ".formatter.indent_statements_compare_to_body"; //$NON-NLS-1$
+ /**
+ * <pre>
+ * FORMATTER / Option to indent switch statements compare to cases
+ * - option id: "org.eclipse.cdt.core.formatter.indent_switchstatements_compare_to_cases"
+ * - possible values: { TRUE, FALSE }
+ * - default: TRUE
+ * </pre>
+ * @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$
+ /**
+ * <pre>
+ * FORMATTER / Option to indent switch statements compare to switch
+ * - option id: "org.eclipse.cdt.core.formatter.indent_switchstatements_compare_to_switch"
+ * - possible values: { TRUE, FALSE }
+ * - default: TRUE
+ * </pre>
+ * @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$
+
+ /**
+ * <pre>
+ * FORMATTER / Option to specify the equivalent number of spaces that represents one indentation
+ * - option id: "org.eclipse.cdt.core.formatter.indentation.size"
+ * - possible values: "&lt;n&gt;", where n is zero or a positive integer
+ * - default: "4"
+ * </pre>
+ * <p>This option is used only if the tab char is set to MIXED.
+ * </p>
+ * @see #FORMATTER_TAB_CHAR
+ */
+ public static final String FORMATTER_INDENTATION_SIZE = CCorePlugin.PLUGIN_ID + ".formatter.indentation.size"; //$NON-NLS-1$
+
+// /**
+// * <pre>
+// * FORMATTER / Option to insert a new line after an annotation
+// * - option id: "org.eclipse.cdt.core.formatter.insert_new_line_after_annotation"
+// * - possible values: { INSERT, DO_NOT_INSERT }
+// * - default: INSERT
+// * </pre>
+// * @see CCorePlugin#INSERT
+// * @see CCorePlugin#DO_NOT_INSERT
+// */
+// public static final String FORMATTER_INSERT_NEW_LINE_AFTER_ANNOTATION = CCorePlugin.PLUGIN_ID + ".formatter.insert_new_line_after_annotation";//$NON-NLS-1$
+//
+// /**
+// * <pre>
+// * FORMATTER / Option to insert a new line after the opening brace in an array initializer
+// * - 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
+// * </pre>
+// * @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$
+//
+// /**
+// * <pre>
+// * FORMATTER / Option to insert a new line at the end of the current file if missing
+// * - option id: "org.eclipse.cdt.core.formatter.insert_new_line_at_end_of_file_if_missing"
+// * - possible values: { INSERT, DO_NOT_INSERT }
+// * - default: DO_NOT_INSERT
+// * </pre>
+// * @see CCorePlugin#INSERT
+// * @see CCorePlugin#DO_NOT_INSERT
+// */
+// public static final String FORMATTER_INSERT_NEW_LINE_AT_END_OF_FILE_IF_MISSING = CCorePlugin.PLUGIN_ID + ".formatter.insert_new_line_at_end_of_file_if_missing";//$NON-NLS-1$
+// /**
+// * <pre>
+// * FORMATTER / Option to insert a new line before the catch keyword in try statement
+// * - option id: "org.eclipse.cdt.core.formatter.insert_new_line_before_catch_in_try_statement"
+// * - possible values: { INSERT, DO_NOT_INSERT }
+// * - default: DO_NOT_INSERT
+// * </pre>
+// * @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$
+// /**
+// * <pre>
+// * FORMATTER / Option to insert a new line before the closing brace in an array initializer
+// * - 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
+// * </pre>
+// * @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$
+// /**
+// * <pre>
+// * FORMATTER / Option to insert a new line before the else keyword in if statement
+// * - option id: "org.eclipse.cdt.core.formatter.insert_new_line_before_else_in_if_statement"
+// * - possible values: { INSERT, DO_NOT_INSERT }
+// * - default: DO_NOT_INSERT
+// * </pre>
+// * @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$
+// /**
+// * <pre>
+// * FORMATTER / Option to insert a new line before the finally keyword in try statement
+// * - option id: "org.eclipse.cdt.core.formatter.insert_new_line_before_finally_in_try_statement"
+// * - possible values: { INSERT, DO_NOT_INSERT }
+// * - default: DO_NOT_INSERT
+// * </pre>
+// * @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$
+// /**
+// * <pre>
+// * FORMATTER / Option to insert a new line before while in do statement
+// * - option id: "org.eclipse.cdt.core.formatter.insert_new_line_before_while_in_do_statement"
+// * - possible values: { INSERT, DO_NOT_INSERT }
+// * - default: DO_NOT_INSERT
+// * </pre>
+// * @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$
+// /**
+// * <pre>
+// * FORMATTER / Option to insert a new line in an empty annotation declaration
+// * - option id: "org.eclipse.cdt.core.formatter.insert_new_line_in_empty_annotation_declaration"
+// * - possible values: { INSERT, DO_NOT_INSERT }
+// * - default: INSERT
+// * </pre>
+// * @see CCorePlugin#INSERT
+// * @see CCorePlugin#DO_NOT_INSERT
+// */
+// public static final String FORMATTER_INSERT_NEW_LINE_IN_EMPTY_ANNOTATION_DECLARATION = CCorePlugin.PLUGIN_ID + ".formatter.insert_new_line_in_empty_annotation_declaration"; //$NON-NLS-1$
+// /**
+// * <pre>
+// * 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
+// * </pre>
+// * @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$
+// /**
+// * <pre>
+// * FORMATTER / Option to insert a new line in an empty block
+// * - option id: "org.eclipse.cdt.core.formatter.insert_new_line_in_empty_block"
+// * - possible values: { INSERT, DO_NOT_INSERT }
+// * - default: INSERT
+// * </pre>
+// * @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$
+// /**
+// * <pre>
+// * FORMATTER / Option to insert a new line in an empty enum constant
+// * - option id: "org.eclipse.cdt.core.formatter.insert_new_line_in_empty_enum_constant"
+// * - possible values: { INSERT, DO_NOT_INSERT }
+// * - default: INSERT
+// * </pre>
+// * @see CCorePlugin#INSERT
+// * @see CCorePlugin#DO_NOT_INSERT
+// */
+// public static final String FORMATTER_INSERT_NEW_LINE_IN_EMPTY_ENUM_CONSTANT = CCorePlugin.PLUGIN_ID + ".formatter.insert_new_line_in_empty_enum_constant"; //$NON-NLS-1$
+// /**
+// * <pre>
+// * FORMATTER / Option to insert a new line in an empty enum declaration
+// * - option id: "org.eclipse.cdt.core.formatter.insert_new_line_in_empty_enum_declaration"
+// * - possible values: { INSERT, DO_NOT_INSERT }
+// * - default: INSERT
+// * </pre>
+// * @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$
+// /**
+// * <pre>
+// * FORMATTER / Option to insert a new line in an empty method body
+// * - option id: "org.eclipse.cdt.core.formatter.insert_new_line_in_empty_method_body"
+// * - possible values: { INSERT, DO_NOT_INSERT }
+// * - default: INSERT
+// * </pre>
+// * @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$
+// /**
+// * <pre>
+// * FORMATTER / Option to insert a new line in an empty type declaration
+// * - option id: "org.eclipse.cdt.core.formatter.insert_new_line_in_empty_type_declaration"
+// * - possible values: { INSERT, DO_NOT_INSERT }
+// * - default: INSERT
+// * </pre>
+// * @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$
+// /**
+// * <pre>
+// * FORMATTER / Option to insert a space after and in wilcard
+// * - option id: "org.eclipse.cdt.core.formatter.insert_space_after_and_in_type_parameter"
+// * - possible values: { INSERT, DO_NOT_INSERT }
+// * - default: INSERT
+// * </pre>
+// * @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$
+// /**
+// * <pre>
+// * 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
+// * </pre>
+// * @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$
+// /**
+// * <pre>
+// * FORMATTER / Option to insert a space after at in annotation
+// * - option id: "org.eclipse.cdt.core.formatter.insert_space_after_at_in_annotation"
+// * - possible values: { INSERT, DO_NOT_INSERT }
+// * - default: INSERT
+// * </pre>
+// * @see CCorePlugin#INSERT
+// * @see CCorePlugin#DO_NOT_INSERT
+// */
+// public static final String FORMATTER_INSERT_SPACE_AFTER_AT_IN_ANNOTATION = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_at_in_annotation"; //$NON-NLS-1$
+// /**
+// * <pre>
+// * FORMATTER / Option to insert a space after at in annotation type declaration
+// * - option id: "org.eclipse.cdt.core.formatter.insert_space_after_at_in_annotation_type_declaration"
+// * - possible values: { INSERT, DO_NOT_INSERT }
+// * - default: DO_NOT_INSERT
+// * </pre>
+// * @see CCorePlugin#INSERT
+// * @see CCorePlugin#DO_NOT_INSERT
+// */
+// public static final String FORMATTER_INSERT_SPACE_AFTER_AT_IN_ANNOTATION_TYPE_DECLARATION = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_at_in_annotation_type_declaration"; //$NON-NLS-1$
+// /**
+// * <pre>
+// * 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
+// * </pre>
+// * @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$
+// /**
+// * <pre>
+// * 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
+// * </pre>
+// * @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$
+// /**
+// * <pre>
+// * 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
+// * </pre>
+// * @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$
+// /**
+// * <pre>
+// * FORMATTER / Option to insert a space after the closing brace of a block
+// * - option id: "org.eclipse.cdt.core.formatter.insert_space_after_closing_brace_in_block"
+// * - possible values: { INSERT, DO_NOT_INSERT }
+// * - default: INSERT
+// * </pre>
+// * @see CCorePlugin#INSERT
+// * @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$
+// /**
+// * <pre>
+// * 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
+// * </pre>
+// * @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$
+// /**
+// * <pre>
+// * FORMATTER / Option to insert a space after the colon in an assert statement
+// * - option id: "org.eclipse.cdt.core.formatter.insert_space_after_colon_in_assert"
+// * - possible values: { INSERT, DO_NOT_INSERT }
+// * - default: INSERT
+// * </pre>
+// * @see CCorePlugin#INSERT
+// * @see CCorePlugin#DO_NOT_INSERT
+// */
+// public static final String FORMATTER_INSERT_SPACE_AFTER_COLON_IN_ASSERT = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_colon_in_assert"; //$NON-NLS-1$
+// /**
+// * <pre>
+// * FORMATTER / Option to insert a space after colon in a case statement when a opening brace follows the colon
+// * - option id: "org.eclipse.cdt.core.formatter.insert_space_after_colon_in_case"
+// * - possible values: { INSERT, DO_NOT_INSERT }
+// * - default: INSERT
+// * </pre>
+// * @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$
+// /**
+// * <pre>
+// * FORMATTER / Option to insert a space after the colon in a conditional expression
+// * - option id: "org.eclipse.cdt.core.formatter.insert_space_after_colon_in_conditional"
+// * - possible values: { INSERT, DO_NOT_INSERT }
+// * - default: INSERT
+// * </pre>
+// * @see CCorePlugin#INSERT
+// * @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$
+// /**
+// * <pre>
+// * FORMATTER / Option to insert a space after colon in a for statement
+// * - option id: "org.eclipse.cdt.core.formatter.insert_space_after_colon_in_for"
+// * - possible values: { INSERT, DO_NOT_INSERT }
+// * - default: INSERT
+// * </pre>
+// * @see CCorePlugin#INSERT
+// * @see CCorePlugin#DO_NOT_INSERT
+// */
+// public static final String FORMATTER_INSERT_SPACE_AFTER_COLON_IN_FOR = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_colon_in_for"; //$NON-NLS-1$
+// /**
+// * <pre>
+// * 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
+// * </pre>
+// * @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$
+// /**
+// * <pre>
+// * FORMATTER / Option to insert a space after the comma in an allocation expression
+// * - option id: "org.eclipse.cdt.core.formatter.insert_space_after_comma_in_allocation_expression"
+// * - possible values: { INSERT, DO_NOT_INSERT }
+// * - default: INSERT
+// * </pre>
+// * @see CCorePlugin#INSERT
+// * @see CCorePlugin#DO_NOT_INSERT
+// */
+// public static final String FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_ALLOCATION_EXPRESSION = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_comma_in_allocation_expression"; //$NON-NLS-1$
+// /**
+// * <pre>
+// * FORMATTER / Option to insert a space after the comma in annotation
+// * - option id: "org.eclipse.cdt.core.formatter.insert_space_after_comma_in_annotation"
+// * - possible values: { INSERT, DO_NOT_INSERT }
+// * - default: INSERT
+// * </pre>
+// * @see CCorePlugin#INSERT
+// * @see CCorePlugin#DO_NOT_INSERT
+// */
+// public static final String FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_ANNOTATION = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_comma_in_annotation"; //$NON-NLS-1$
+// /**
+// * <pre>
+// * FORMATTER / Option to insert a space after the comma in an array initializer
+// * - option id: "org.eclipse.cdt.core.formatter.insert_space_after_comma_in_array_initializer"
+// * - possible values: { INSERT, DO_NOT_INSERT }
+// * - default: INSERT
+// * </pre>
+// * @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$
+// /**
+// * <pre>
+// * FORMATTER / Option to insert a space after the comma in the parameters of a constructor declaration
+// * - option id: "org.eclipse.cdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters"
+// * - possible values: { INSERT, DO_NOT_INSERT }
+// * - default: INSERT
+// * </pre>
+// * @see CCorePlugin#INSERT
+// * @see CCorePlugin#DO_NOT_INSERT
+// */
+// public static final String FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_CONSTRUCTOR_DECLARATION_PARAMETERS = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_comma_in_constructor_declaration_parameters"; //$NON-NLS-1$
+// /**
+// * <pre>
+// * FORMATTER / Option to insert a space after the comma in the exception names in a throws clause of a constructor declaration
+// * - option id: "org.eclipse.cdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws"
+// * - possible values: { INSERT, DO_NOT_INSERT }
+// * - default: INSERT
+// * </pre>
+// * @see CCorePlugin#INSERT
+// * @see CCorePlugin#DO_NOT_INSERT
+// */
+// public static final String FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_CONSTRUCTOR_DECLARATION_THROWS = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_comma_in_constructor_declaration_throws"; //$NON-NLS-1$
+// /**
+// * <pre>
+// * FORMATTER / Option to insert a space after the comma in the arguments of an enum constant
+// * - option id: "org.eclipse.cdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments"
+// * - possible values: { INSERT, DO_NOT_INSERT }
+// * - default: INSERT
+// * </pre>
+// * @see CCorePlugin#INSERT
+// * @see CCorePlugin#DO_NOT_INSERT
+// */
+// public static final String FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_ENUM_CONSTANT_ARGUMENTS = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_comma_in_enum_constant_arguments"; //$NON-NLS-1$
+// /**
+// * <pre>
+// * 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
+// * </pre>
+// * @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$
+// /**
+// * <pre>
+// * FORMATTER / Option to insert a space after the comma in the arguments of an explicit constructor call
+// * - option id: "org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments"
+// * - possible values: { INSERT, DO_NOT_INSERT }
+// * - default: INSERT
+// * </pre>
+// * @see CCorePlugin#INSERT
+// * @see CCorePlugin#DO_NOT_INSERT
+// */
+// public static final String FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_EXPLICIT_CONSTRUCTOR_CALL_ARGUMENTS = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_comma_in_explicitconstructorcall_arguments"; //$NON-NLS-1$
+// /**
+// * <pre>
+// * 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
+// * </pre>
+// * @see CCorePlugin#INSERT
+// * @see CCorePlugin#DO_NOT_INSERT
+// */
+// 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$
+// /**
+// * <pre>
+// * FORMATTER / Option to insert a space after the comma in the initializations of a for statement
+// * - option id: "org.eclipse.cdt.core.formatter.insert_space_after_comma_in_for_inits"
+// * - possible values: { INSERT, DO_NOT_INSERT }
+// * - default: INSERT
+// * </pre>
+// * @see CCorePlugin#INSERT
+// * @see CCorePlugin#DO_NOT_INSERT
+// */
+// public static final String FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_FOR_INITS = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_comma_in_for_inits"; //$NON-NLS-1$
+// /**
+// * <pre>
+// * FORMATTER / Option to insert a space after the comma in the parameters of a method declaration
+// * - option id: "org.eclipse.cdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters"
+// * - possible values: { INSERT, DO_NOT_INSERT }
+// * - default: INSERT
+// * </pre>
+// * @see CCorePlugin#INSERT
+// * @see CCorePlugin#DO_NOT_INSERT
+// */
+// public static final String FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_METHOD_DECLARATION_PARAMETERS = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_comma_in_method_declaration_parameters"; //$NON-NLS-1$
+// /**
+// * <pre>
+// * FORMATTER / Option to insert a space after the comma in the exception names in a throws clause of a method declaration
+// * - option id: "org.eclipse.cdt.core.formatter.insert_space_after_comma_in_method_declaration_throws"
+// * - possible values: { INSERT, DO_NOT_INSERT }
+// * - default: INSERT
+// * </pre>
+// * @see CCorePlugin#INSERT
+// * @see CCorePlugin#DO_NOT_INSERT
+// */
+// public static final String FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_METHOD_DECLARATION_THROWS = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_comma_in_method_declaration_throws"; //$NON-NLS-1$
+// /**
+// * <pre>
+// * FORMATTER / Option to insert a space after the comma in the arguments of a method invocation
+// * - option id: "org.eclipse.cdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments"
+// * - possible values: { INSERT, DO_NOT_INSERT }
+// * - default: INSERT
+// * </pre>
+// * @see CCorePlugin#INSERT
+// * @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$
+// /**
+// * <pre>
+// * 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
+// * </pre>
+// * @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$
+// /**
+// * <pre>
+// * 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
+// * </pre>
+// * @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$
+// /**
+// * <pre>
+// * 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
+// * </pre>
+// * @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$
+// /**
+// * <pre>
+// * FORMATTER / Option to insert a space after the comma in superinterfaces names of a type header
+// * - option id: "org.eclipse.cdt.core.formatter.insert_space_after_comma_in_superinterfaces"
+// * - possible values: { INSERT, DO_NOT_INSERT }
+// * - default: INSERT
+// * </pre>
+// * @see CCorePlugin#INSERT
+// * @see CCorePlugin#DO_NOT_INSERT
+// */
+// public static final String FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_SUPERINTERFACES = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_comma_in_superinterfaces"; //$NON-NLS-1$
+// /**
+// * <pre>
+// * 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
+// * </pre>
+// * @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$
+// /**
+// * <pre>
+// * 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
+// * </pre>
+// * @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$
+// /**
+// * <pre>
+// * FORMATTER / Option to insert a space after ellipsis
+// * - option id: "org.eclipse.cdt.core.formatter.insert_space_after_ellipsis"
+// * - possible values: { INSERT, DO_NOT_INSERT }
+// * - default: INSERT
+// * </pre>
+// * @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$
+// /**
+// * <pre>
+// * 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
+// * </pre>
+// * @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$
+// /**
+// * <pre>
+// * 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
+// * </pre>
+// * @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$
+// /**
+// * <pre>
+// * 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
+// * </pre>
+// * @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$
+// /**
+// * <pre>
+// * FORMATTER / Option to insert a space after the opening brace in an array initializer
+// * - 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
+// * </pre>
+// * @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$
+// /**
+// * <pre>
+// * 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
+// * </pre>
+// * @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$
+// /**
+// * <pre>
+// * 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
+// * </pre>
+// * @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$
+// /**
+// * <pre>
+// * FORMATTER / Option to insert a space after the opening parenthesis in annotation
+// * - option id: "org.eclipse.cdt.core.formatter.insert_space_after_opening_paren_in_annotation"
+// * - possible values: { INSERT, DO_NOT_INSERT }
+// * - default: DO_NOT_INSERT
+// * </pre>
+// * @see CCorePlugin#INSERT
+// * @see CCorePlugin#DO_NOT_INSERT
+// */
+// public static final String FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_ANNOTATION = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_opening_paren_in_annotation"; //$NON-NLS-1$
+// /**
+// * <pre>
+// * 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
+// * </pre>
+// * @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$
+// /**
+// * <pre>
+// * 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
+// * </pre>
+// * @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$
+// /**
+// * <pre>
+// * FORMATTER / Option to insert a space after the opening parenthesis in a constructor declaration
+// * - option id: "org.eclipse.cdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration"
+// * - possible values: { INSERT, DO_NOT_INSERT }
+// * - default: DO_NOT_INSERT
+// * </pre>
+// * @see CCorePlugin#INSERT
+// * @see CCorePlugin#DO_NOT_INSERT
+// */
+// public static final String FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_CONSTRUCTOR_DECLARATION = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_opening_paren_in_constructor_declaration"; //$NON-NLS-1$
+// /**
+// * <pre>
+// * FORMATTER / Option to insert a space after the opening parenthesis in enum constant
+// * - option id: "org.eclipse.cdt.core.formatter.insert_space_after_opening_paren_in_enum_constant"
+// * - possible values: { INSERT, DO_NOT_INSERT }
+// * - default: DO_NOT_INSERT
+// * </pre>
+// * @see CCorePlugin#INSERT
+// * @see CCorePlugin#DO_NOT_INSERT
+// */
+// public static final String FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_ENUM_CONSTANT = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_opening_paren_in_enum_constant"; //$NON-NLS-1$
+// /**
+// * <pre>
+// * FORMATTER / Option to insert a space after the opening parenthesis in a for statement
+// * - option id: "org.eclipse.cdt.core.formatter.insert_space_after_opening_paren_in_for"
+// * - possible values: { INSERT, DO_NOT_INSERT }
+// * - default: DO_NOT_INSERT
+// * </pre>
+// * @see CCorePlugin#INSERT
+// * @see CCorePlugin#DO_NOT_INSERT
+// */
+// public static final String FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_FOR = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_opening_paren_in_for"; //$NON-NLS-1$
+// /**
+// * <pre>
+// * FORMATTER / Option to insert a space after the opening parenthesis in an if statement
+// * - option id: "org.eclipse.cdt.core.formatter.insert_space_after_opening_paren_in_if"
+// * - possible values: { INSERT, DO_NOT_INSERT }
+// * - default: DO_NOT_INSERT
+// * </pre>
+// * @see CCorePlugin#INSERT
+// * @see CCorePlugin#DO_NOT_INSERT
+// */
+// public static final String FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_IF = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_opening_paren_in_if"; //$NON-NLS-1$
+// /**
+// * <pre>
+// * FORMATTER / Option to insert a space after the opening parenthesis in a method declaration
+// * - option id: "org.eclipse.cdt.core.formatter.insert_space_after_opening_paren_in_method_declaration"
+// * - possible values: { INSERT, DO_NOT_INSERT }
+// * - default: DO_NOT_INSERT
+// * </pre>
+// * @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$
+// /**
+// * <pre>
+// * FORMATTER / Option to insert a space after the opening parenthesis in a method invocation
+// * - option id: "org.eclipse.cdt.core.formatter.insert_space_after_opening_paren_in_method_invocation"
+// * - possible values: { INSERT, DO_NOT_INSERT }
+// * - default: DO_NOT_INSERT
+// * </pre>
+// * @see CCorePlugin#INSERT
+// * @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$
+// /**
+// * <pre>
+// * 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
+// * </pre>
+// * @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$
+// /**
+// * <pre>
+// * FORMATTER / Option to insert a space after the opening parenthesis in a switch statement
+// * - option id: "org.eclipse.cdt.core.formatter.insert_space_after_opening_paren_in_switch"
+// * - possible values: { INSERT, DO_NOT_INSERT }
+// * - default: DO_NOT_INSERT
+// * </pre>
+// * @see CCorePlugin#INSERT
+// * @see CCorePlugin#DO_NOT_INSERT
+// */
+// public static final String FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_SWITCH = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_opening_paren_in_switch"; //$NON-NLS-1$
+// /**
+// * <pre>
+// * FORMATTER / Option to insert a space after the opening parenthesis in a synchronized statement
+// * - option id: "org.eclipse.cdt.core.formatter.insert_space_after_opening_paren_in_synchronized"
+// * - possible values: { INSERT, DO_NOT_INSERT }
+// * - default: DO_NOT_INSERT
+// * </pre>
+// * @see CCorePlugin#INSERT
+// * @see CCorePlugin#DO_NOT_INSERT
+// */
+// public static final String FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_SYNCHRONIZED = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_opening_paren_in_synchronized"; //$NON-NLS-1$
+// /**
+// * <pre>
+// * FORMATTER / Option to insert a space after the opening parenthesis in a while statement
+// * - option id: "org.eclipse.cdt.core.formatter.insert_space_after_opening_paren_in_while"
+// * - possible values: { INSERT, DO_NOT_INSERT }
+// * - default: DO_NOT_INSERT
+// * </pre>
+// * @see CCorePlugin#INSERT
+// * @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$
+// /**
+// * <pre>
+// * 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
+// * </pre>
+// * @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$
+// /**
+// * <pre>
+// * 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
+// * </pre>
+// * @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$
+// /**
+// * <pre>
+// * FORMATTER / Option to insert a space after question mark in a conditional expression
+// * - option id: "org.eclipse.cdt.core.formatter.insert_space_after_question_in_conditional"
+// * - possible values: { INSERT, DO_NOT_INSERT }
+// * - default: DO_NOT_INSERT
+// * </pre>
+// * @see CCorePlugin#INSERT
+// * @see CCorePlugin#DO_NOT_INSERT
+// */
+// public static final String FORMATTER_INSERT_SPACE_AFTER_QUESTION_IN_CONDITIONAL = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_question_in_conditional"; //$NON-NLS-1$
+// /**
+// * <pre>
+// * FORMATTER / Option to insert a space after question mark in a wildcard
+// * - option id: "org.eclipse.cdt.core.formatter.insert_space_after_question_in_wildcard"
+// * - possible values: { INSERT, DO_NOT_INSERT }
+// * - default: DO_NOT_INSERT
+// * </pre>
+// * @see CCorePlugin#INSERT
+// * @see CCorePlugin#DO_NOT_INSERT
+// */
+// public static final String FORMATTER_INSERT_SPACE_AFTER_QUESTION_IN_WILDCARD = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_question_in_wildcard"; //$NON-NLS-1$
+// /**
+// * <pre>
+// * FORMATTER / Option to insert a space after semicolon in a for statement
+// * - option id: "org.eclipse.cdt.core.formatter.insert_space_after_semicolon_in_for"
+// * - possible values: { INSERT, DO_NOT_INSERT }
+// * - default: INSERT
+// * </pre>
+// * @see CCorePlugin#INSERT
+// * @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$
+// /**
+// * <pre>
+// * 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
+// * </pre>
+// * @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$
+// /**
+// * <pre>
+// * FORMATTER / Option to insert a space before and in wildcard
+// * - option id: "org.eclipse.cdt.core.formatter.insert_space_before_and_in_type_parameter"
+// * - possible values: { INSERT, DO_NOT_INSERT }
+// * - default: INSERT
+// * </pre>
+// * @see CCorePlugin#INSERT
+// * @see CCorePlugin#DO_NOT_INSERT
+// */
+// public static final String FORMATTER_INSERT_SPACE_BEFORE_AND_IN_TYPE_PARAMETER = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_and_in_type_parameter"; //$NON-NLS-1$
+// /**
+// * <pre>
+// * 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
+// * </pre>
+// * @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$
+// /**
+// * <pre>
+// * FORMATTER / Option to insert a space before at in annotation type declaration
+// * - option id: "org.eclipse.cdt.core.formatter.insert_space_before_at_in_annotation_type_declaration"
+// * - possible values: { INSERT, DO_NOT_INSERT }
+// * - default: INSERT
+// * </pre>
+// * @see CCorePlugin#INSERT
+// * @see CCorePlugin#DO_NOT_INSERT
+// */
+// public static final String FORMATTER_INSERT_SPACE_BEFORE_AT_IN_ANNOTATION_TYPE_DECLARATION = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_at_in_annotation_type_declaration"; //$NON-NLS-1$
+// /**
+// * <pre>
+// * 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
+// * </pre>
+// * @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$
+// /**
+// * <pre>
+// * 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
+// * </pre>
+// * @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$
+// /**
+// * <pre>
+// * 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
+// * </pre>
+// * @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$
+// /**
+// * <pre>
+// * 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
+// * </pre>
+// * @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$
+// /**
+// * <pre>
+// * FORMATTER / Option to insert a space before the closing brace in an array initializer
+// * - 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
+// * </pre>
+// * @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$
+// /**
+// * <pre>
+// * 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
+// * </pre>
+// * @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$
+// /**
+// * <pre>
+// * 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
+// * </pre>
+// * @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$
+// /**
+// * <pre>
+// * FORMATTER / Option to insert a space before the closing parenthesis in annotation
+// * - option id: "org.eclipse.cdt.core.formatter.insert_space_before_closing_paren_in_annotation"
+// * - possible values: { INSERT, DO_NOT_INSERT }
+// * - default: DO_NOT_INSERT
+// * </pre>
+// * @see CCorePlugin#INSERT
+// * @see CCorePlugin#DO_NOT_INSERT
+// */
+// public static final String FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_ANNOTATION = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_closing_paren_in_annotation"; //$NON-NLS-1$
+// /**
+// * <pre>
+// * 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
+// * </pre>
+// * @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$
+// /**
+// * <pre>
+// * 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
+// * </pre>
+// * @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$
+// /**
+// * <pre>
+// * FORMATTER / Option to insert a space before the closing parenthesis in a constructor declaration
+// * - option id: "org.eclipse.cdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration"
+// * - possible values: { INSERT, DO_NOT_INSERT }
+// * - default: DO_NOT_INSERT
+// * </pre>
+// * @see CCorePlugin#INSERT
+// * @see CCorePlugin#DO_NOT_INSERT
+// */
+// public static final String FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_CONSTRUCTOR_DECLARATION = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_closing_paren_in_constructor_declaration"; //$NON-NLS-1$
+// /**
+// * <pre>
+// * FORMATTER / Option to insert a space before the closing parenthesis in enum constant
+// * - option id: "org.eclipse.cdt.core.formatter.insert_space_before_closing_paren_in_enum_constant"
+// * - possible values: { INSERT, DO_NOT_INSERT }
+// * - default: DO_NOT_INSERT
+// * </pre>
+// * @see CCorePlugin#INSERT
+// * @see CCorePlugin#DO_NOT_INSERT
+// */
+// public static final String FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_ENUM_CONSTANT = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_closing_paren_in_enum_constant"; //$NON-NLS-1$
+// /**
+// * <pre>
+// * FORMATTER / Option to insert a space before the closing parenthesis in a for statement
+// * - option id: "org.eclipse.cdt.core.formatter.insert_space_before_closing_paren_in_for"
+// * - possible values: { INSERT, DO_NOT_INSERT }
+// * - default: DO_NOT_INSERT
+// * </pre>
+// * @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$
+// /**
+// * <pre>
+// * FORMATTER / Option to insert a space before the closing parenthesis in an if statement
+// * - option id: "org.eclipse.cdt.core.formatter.insert_space_before_closing_paren_in_if"
+// * - possible values: { INSERT, DO_NOT_INSERT }
+// * - default: DO_NOT_INSERT
+// * </pre>
+// * @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$
+// /**
+// * <pre>
+// * FORMATTER / Option to insert a space before the closing parenthesis in a method declaration
+// * - option id: "org.eclipse.cdt.core.formatter.insert_space_before_closing_paren_in_method_declaration"
+// * - possible values: { INSERT, DO_NOT_INSERT }
+// * - default: DO_NOT_INSERT
+// * </pre>
+// * @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$
+// /**
+// * <pre>
+// * FORMATTER / Option to insert a space before the closing parenthesis in a method invocation
+// * - option id: "org.eclipse.cdt.core.formatter.insert_space_before_closing_paren_in_method_invocation"
+// * - possible values: { INSERT, DO_NOT_INSERT }
+// * - default: DO_NOT_INSERT
+// * </pre>
+// * @see CCorePlugin#INSERT
+// * @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$
+// /**
+// * <pre>
+// * 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
+// * </pre>
+// * @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$
+// /**
+// * <pre>
+// * FORMATTER / Option to insert a space before the closing parenthesis in a switch statement
+// * - option id: "org.eclipse.cdt.core.formatter.insert_space_before_closing_paren_in_switch"
+// * - possible values: { INSERT, DO_NOT_INSERT }
+// * - default: DO_NOT_INSERT
+// * </pre>
+// * @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$
+// /**
+// * <pre>
+// * FORMATTER / Option to insert a space before the closing parenthesis in a synchronized statement
+// * - option id: "org.eclipse.cdt.core.formatter.insert_space_before_closing_paren_in_synchronized"
+// * - possible values: { INSERT, DO_NOT_INSERT }
+// * - default: DO_NOT_INSERT
+// * </pre>
+// * @see CCorePlugin#INSERT
+// * @see CCorePlugin#DO_NOT_INSERT
+// */
+// public static final String FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_SYNCHRONIZED = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_closing_paren_in_synchronized"; //$NON-NLS-1$
+// /**
+// * <pre>
+// * FORMATTER / Option to insert a space before the closing parenthesis in a while statement
+// * - option id: "org.eclipse.cdt.core.formatter.insert_space_before_closing_paren_in_while"
+// * - possible values: { INSERT, DO_NOT_INSERT }
+// * - default: DO_NOT_INSERT
+// * </pre>
+// * @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$
+// /**
+// * <pre>
+// * FORMATTER / Option to insert a space before colon in an assert statement
+// * - option id: "org.eclipse.cdt.core.formatter.insert_space_before_colon_in_assert"
+// * - possible values: { INSERT, DO_NOT_INSERT }
+// * - default: INSERT
+// * </pre>
+// * @see CCorePlugin#INSERT
+// * @see CCorePlugin#DO_NOT_INSERT
+// */
+// public static final String FORMATTER_INSERT_SPACE_BEFORE_COLON_IN_ASSERT = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_colon_in_assert"; //$NON-NLS-1$
+// /**
+// * <pre>
+// * FORMATTER / Option to insert a space before colon in a case statement
+// * - option id: "org.eclipse.cdt.core.formatter.insert_space_before_colon_in_case"
+// * - possible values: { INSERT, DO_NOT_INSERT }
+// * - default: INSERT
+// * </pre>
+// * @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$
+// /**
+// * <pre>
+// * FORMATTER / Option to insert a space before colon in a conditional expression
+// * - option id: "org.eclipse.cdt.core.formatter.insert_space_before_colon_in_conditional"
+// * - possible values: { INSERT, DO_NOT_INSERT }
+// * - default: INSERT
+// * </pre>
+// * @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$
+// /**
+// * <pre>
+// * FORMATTER / Option to insert a space before colon in a default statement
+// * - option id: "org.eclipse.cdt.core.formatter.insert_space_before_colon_in_default"
+// * - possible values: { INSERT, DO_NOT_INSERT }
+// * - default: INSERT
+// * </pre>
+// * @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$
+// /**
+// * <pre>
+// * FORMATTER / Option to insert a space before colon in a for statement
+// * - option id: "org.eclipse.cdt.core.formatter.insert_space_before_colon_in_for"
+// * - possible values: { INSERT, DO_NOT_INSERT }
+// * - default: INSERT
+// * </pre>
+// * @see CCorePlugin#INSERT
+// * @see CCorePlugin#DO_NOT_INSERT
+// */
+// public static final String FORMATTER_INSERT_SPACE_BEFORE_COLON_IN_FOR = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_colon_in_for"; //$NON-NLS-1$
+// /**
+// * <pre>
+// * 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
+// * </pre>
+// * @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$
+// /**
+// * <pre>
+// * FORMATTER / Option to insert a space before comma in an allocation expression
+// * - option id: "org.eclipse.cdt.core.formatter.insert_space_before_comma_in_allocation_expression"
+// * - possible values: { INSERT, DO_NOT_INSERT }
+// * - default: DO_NOT_INSERT
+// * </pre>
+// * @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$
+// /**
+// * <pre>
+// * FORMATTER / Option to insert a space before comma in annotation
+// * - option id: "org.eclipse.cdt.core.formatter.insert_space_before_comma_in_annotation"
+// * - possible values: { INSERT, DO_NOT_INSERT }
+// * - default: DO_NOT_INSERT
+// * </pre>
+// * @see CCorePlugin#INSERT
+// * @see CCorePlugin#DO_NOT_INSERT
+// */
+// public static final String FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_ANNOTATION = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_comma_in_annotation"; //$NON-NLS-1$
+// /**
+// * <pre>
+// * FORMATTER / Option to insert a space before comma in an array initializer
+// * - option id: "org.eclipse.cdt.core.formatter.insert_space_before_comma_in_array_initializer"
+// * - possible values: { INSERT, DO_NOT_INSERT }
+// * - default: DO_NOT_INSERT
+// * </pre>
+// * @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$
+// /**
+// * <pre>
+// * FORMATTER / Option to insert a space before comma in the parameters of a constructor declaration
+// * - option id: "org.eclipse.cdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters"
+// * - possible values: { INSERT, DO_NOT_INSERT }
+// * - default: DO_NOT_INSERT
+// * </pre>
+// * @see CCorePlugin#INSERT
+// * @see CCorePlugin#DO_NOT_INSERT
+// */
+// public static final String FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_CONSTRUCTOR_DECLARATION_PARAMETERS = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_comma_in_constructor_declaration_parameters"; //$NON-NLS-1$
+// /**
+// * <pre>
+// * FORMATTER / Option to insert a space before comma in the exception names of the throws clause of a constructor declaration
+// * - option id: "org.eclipse.cdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws"
+// * - possible values: { INSERT, DO_NOT_INSERT }
+// * - default: DO_NOT_INSERT
+// * </pre>
+// * @see CCorePlugin#INSERT
+// * @see CCorePlugin#DO_NOT_INSERT
+// */
+// public static final String FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_CONSTRUCTOR_DECLARATION_THROWS = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_comma_in_constructor_declaration_throws"; //$NON-NLS-1$
+// /**
+// * <pre>
+// * FORMATTER / Option to insert a space before comma in the arguments of enum constant
+// * - option id: "org.eclipse.cdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments"
+// * - possible values: { INSERT, DO_NOT_INSERT }
+// * - default: DO_NOT_INSERT
+// * </pre>
+// * @see CCorePlugin#INSERT
+// * @see CCorePlugin#DO_NOT_INSERT
+// */
+// public static final String FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_ENUM_CONSTANT_ARGUMENTS = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_comma_in_enum_constant_arguments"; //$NON-NLS-1$
+// /**
+// * <pre>
+// * 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
+// * </pre>
+// * @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$
+// /**
+// * <pre>
+// * FORMATTER / Option to insert a space before comma in the arguments of an explicit constructor call
+// * - option id: "org.eclipse.cdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments"
+// * - possible values: { INSERT, DO_NOT_INSERT }
+// * - default: DO_NOT_INSERT
+// * </pre>
+// * @see CCorePlugin#INSERT
+// * @see CCorePlugin#DO_NOT_INSERT
+// */
+// public static final String FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_EXPLICIT_CONSTRUCTOR_CALL_ARGUMENTS = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_comma_in_explicitconstructorcall_arguments"; //$NON-NLS-1$
+// /**
+// * <pre>
+// * 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
+// * </pre>
+// * @see CCorePlugin#INSERT
+// * @see CCorePlugin#DO_NOT_INSERT
+// */
+// 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$
+// /**
+// * <pre>
+// * FORMATTER / Option to insert a space before comma in the initializations of a for statement
+// * - option id: "org.eclipse.cdt.core.formatter.insert_space_before_comma_in_for_inits"
+// * - possible values: { INSERT, DO_NOT_INSERT }
+// * - default: DO_NOT_INSERT
+// * </pre>
+// * @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$
+// /**
+// * <pre>
+// * FORMATTER / Option to insert a space before comma in the parameters of a method declaration
+// * - option id: "org.eclipse.cdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters"
+// * - possible values: { INSERT, DO_NOT_INSERT }
+// * - default: DO_NOT_INSERT
+// * </pre>
+// * @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$
+// /**
+// * <pre>
+// * FORMATTER / Option to insert a space before comma in the exception names of the throws clause of a method declaration
+// * - option id: "org.eclipse.cdt.core.formatter.insert_space_before_comma_in_method_declaration_throws"
+// * - possible values: { INSERT, DO_NOT_INSERT }
+// * - default: DO_NOT_INSERT
+// * </pre>
+// * @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$
+// /**
+// * <pre>
+// * FORMATTER / Option to insert a space before comma in the arguments of a method invocation
+// * - option id: "org.eclipse.cdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments"
+// * - possible values: { INSERT, DO_NOT_INSERT }
+// * - default: DO_NOT_INSERT
+// * </pre>
+// * @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$
+// /**
+// * <pre>
+// * 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
+// * </pre>
+// * @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$
+// /**
+// * <pre>
+// * 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
+// * </pre>
+// * @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$
+// /**
+// * <pre>
+// * 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
+// * </pre>
+// * @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$
+// /**
+// * <pre>
+// * FORMATTER / Option to insert a space before comma in the superinterfaces names in a type header
+// * - option id: "org.eclipse.cdt.core.formatter.insert_space_before_comma_in_superinterfaces"
+// * - possible values: { INSERT, DO_NOT_INSERT }
+// * - default: DO_NOT_INSERT
+// * </pre>
+// * @see CCorePlugin#INSERT
+// * @see CCorePlugin#DO_NOT_INSERT
+// */
+// public static final String FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_SUPERINTERFACES = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_comma_in_superinterfaces"; //$NON-NLS-1$
+// /**
+// * <pre>
+// * 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
+// * </pre>
+// * @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$
+// /**
+// * <pre>
+// * 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
+// * </pre>
+// * @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$
+// /**
+// * <pre>
+// * FORMATTER / Option to insert a space before ellipsis
+// * - option id: "org.eclipse.cdt.core.formatter.insert_space_before_ellipsis"
+// * - possible values: { INSERT, DO_NOT_INSERT }
+// * - default: DO_NOT_INSERT
+// * </pre>
+// * @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$
+// /**
+// * <pre>
+// * 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
+// * </pre>
+// * @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$
+// /**
+// * <pre>
+// * 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
+// * </pre>
+// * @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$
+// /**
+// * <pre>
+// * 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
+// * </pre>
+// * @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$
+// /**
+// * <pre>
+// * FORMATTER / Option to insert a space before the opening brace in an annotation type declaration
+// * - option id: "org.eclipse.cdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration"
+// * - possible values: { INSERT, DO_NOT_INSERT }
+// * - default: INSERT
+// * </pre>
+// * @see CCorePlugin#INSERT
+// * @see CCorePlugin#DO_NOT_INSERT
+// */
+// public static final String FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACE_IN_ANNOTATION_TYPE_DECLARATION = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_opening_brace_in_annotation_type_declaration"; //$NON-NLS-1$
+// /**
+// * <pre>
+// * 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
+// * </pre>
+// * @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$
+// /**
+// * <pre>
+// * FORMATTER / Option to insert a space before the opening brace in an array initializer
+// * - 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
+// * </pre>
+// * @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$
+// /**
+// * <pre>
+// * FORMATTER / Option to insert a space before the opening brace in a block
+// * - option id: "org.eclipse.cdt.core.formatter.insert_space_before_opening_brace_in_block"
+// * - possible values: { INSERT, DO_NOT_INSERT }
+// * - default: INSERT
+// * </pre>
+// * @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$
+// /**
+// * <pre>
+// * FORMATTER / Option to insert a space before the opening brace in a constructor declaration
+// * - option id: "org.eclipse.cdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration"
+// * - possible values: { INSERT, DO_NOT_INSERT }
+// * - default: INSERT
+// * </pre>
+// * @see CCorePlugin#INSERT
+// * @see CCorePlugin#DO_NOT_INSERT
+// */
+// public static final String FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACE_IN_CONSTRUCTOR_DECLARATION = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_opening_brace_in_constructor_declaration"; //$NON-NLS-1$
+// /**
+// * <pre>
+// * FORMATTER / Option to insert a space before the opening brace in an enum constant
+// * - option id: "org.eclipse.cdt.core.formatter.insert_space_before_opening_brace_in_enum_constant"
+// * - possible values: { INSERT, DO_NOT_INSERT }
+// * - default: INSERT
+// * </pre>
+// * @see CCorePlugin#INSERT
+// * @see CCorePlugin#DO_NOT_INSERT
+// */
+// public static final String FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACE_IN_ENUM_CONSTANT = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_opening_brace_in_enum_constant"; //$NON-NLS-1$
+// /**
+// * <pre>
+// * 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
+// * </pre>
+// * @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$
+// /**
+// * <pre>
+// * FORMATTER / Option to insert a space before the opening brace in a method declaration
+// * - option id: "org.eclipse.cdt.core.formatter.insert_space_before_opening_brace_in_method_declaration"
+// * - possible values: { INSERT, DO_NOT_INSERT }
+// * - default: INSERT
+// * </pre>
+// * @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$
+// /**
+// * <pre>
+// * FORMATTER / Option to insert a space before the opening brace in a switch statement
+// * - option id: "org.eclipse.cdt.core.formatter.insert_space_before_opening_brace_in_switch"
+// * - possible values: { INSERT, DO_NOT_INSERT }
+// * - default: INSERT
+// * </pre>
+// * @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$
+// /**
+// * <pre>
+// * FORMATTER / Option to insert a space before the opening brace in a type declaration
+// * - option id: "org.eclipse.cdt.core.formatter.insert_space_before_opening_brace_in_type_declaration"
+// * - possible values: { INSERT, DO_NOT_INSERT }
+// * - default: INSERT
+// * </pre>
+// * @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$
+// /**
+// * <pre>
+// * 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
+// * </pre>
+// * @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$
+// /**
+// * <pre>
+// * 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
+// * </pre>
+// * @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$
+// /**
+// * <pre>
+// * 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
+// * </pre>
+// * @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$
+// /**
+// * <pre>
+// * FORMATTER / Option to insert a space before the opening parenthesis in annotation
+// * - option id: "org.eclipse.cdt.core.formatter.insert_space_before_opening_paren_in_annotation"
+// * - possible values: { INSERT, DO_NOT_INSERT }
+// * - default: DO_NOT_INSERT
+// * </pre>
+// * @see CCorePlugin#INSERT
+// * @see CCorePlugin#DO_NOT_INSERT
+// */
+// public static final String FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_ANNOTATION = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_opening_paren_in_annotation"; //$NON-NLS-1$
+// /**
+// * <pre>
+// * FORMATTER / Option to insert a space before the opening parenthesis in annotation type member declaration
+// * - option id: "org.eclipse.cdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration"
+// * - possible values: { INSERT, DO_NOT_INSERT }
+// * - default: DO_NOT_INSERT
+// * </pre>
+// * @see CCorePlugin#INSERT
+// * @see CCorePlugin#DO_NOT_INSERT
+// */
+// public static final String FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_ANNOTATION_TYPE_MEMBER_DECLARATION = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration"; //$NON-NLS-1$
+// /**
+// * <pre>
+// * 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
+// * </pre>
+// * @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$
+// /**
+// * <pre>
+// * FORMATTER / Option to insert a space before the opening parenthesis in a constructor declaration
+// * - option id: "org.eclipse.cdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration"
+// * - possible values: { INSERT, DO_NOT_INSERT }
+// * - default: DO_NOT_INSERT
+// * </pre>
+// * @see CCorePlugin#INSERT
+// * @see CCorePlugin#DO_NOT_INSERT
+// */
+// public static final String FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_CONSTRUCTOR_DECLARATION = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_opening_paren_in_constructor_declaration"; //$NON-NLS-1$
+// /**
+// * <pre>
+// * FORMATTER / Option to insert a space before the opening parenthesis in enum constant
+// * - option id: "org.eclipse.cdt.core.formatter.insert_space_before_opening_paren_in_enum_constant"
+// * - possible values: { INSERT, DO_NOT_INSERT }
+// * - default: DO_NOT_INSERT
+// * </pre>
+// * @see CCorePlugin#INSERT
+// * @see CCorePlugin#DO_NOT_INSERT
+// */
+// public static final String FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_ENUM_CONSTANT = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_opening_paren_in_enum_constant"; //$NON-NLS-1$
+// /**
+// * <pre>
+// * FORMATTER / Option to insert a space before the opening parenthesis in a for statement
+// * - option id: "org.eclipse.cdt.core.formatter.insert_space_before_opening_paren_in_for"
+// * - possible values: { INSERT, DO_NOT_INSERT }
+// * - default: INSERT
+// * </pre>
+// * @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$
+// /**
+// * <pre>
+// * FORMATTER / Option to insert a space before the opening parenthesis in an if statement
+// * - option id: "org.eclipse.cdt.core.formatter.insert_space_before_opening_paren_in_if"
+// * - possible values: { INSERT, DO_NOT_INSERT }
+// * - default: INSERT
+// * </pre>
+// * @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$
+// /**
+// * <pre>
+// * FORMATTER / Option to insert a space before the opening parenthesis in a method declaration
+// * - option id: "org.eclipse.cdt.core.formatter.insert_space_before_opening_paren_in_method_declaration"
+// * - possible values: { INSERT, DO_NOT_INSERT }
+// * - default: DO_NOT_INSERT
+// * </pre>
+// * @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$
+// /**
+// * <pre>
+// * FORMATTER / Option to insert a space before the opening parenthesis in a method invocation
+// * - option id: "org.eclipse.cdt.core.formatter.insert_space_before_opening_paren_in_method_invocation"
+// * - possible values: { INSERT, DO_NOT_INSERT }
+// * - default: DO_NOT_INSERT
+// * </pre>
+// * @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$
+// /**
+// * <pre>
+// * 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
+// * </pre>
+// * @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$
+// /**
+// * <pre>
+// * FORMATTER / Option to insert a space before the opening parenthesis in a switch statement
+// * - option id: "org.eclipse.cdt.core.formatter.insert_space_before_opening_paren_in_switch"
+// * - possible values: { INSERT, DO_NOT_INSERT }
+// * - default: INSERT
+// * </pre>
+// * @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$
+// /**
+// * <pre>
+// * FORMATTER / Option to insert a space before the opening parenthesis in a synchronized statement
+// * - option id: "org.eclipse.cdt.core.formatter.insert_space_before_opening_paren_in_synchronized"
+// * - possible values: { INSERT, DO_NOT_INSERT }
+// * - default: INSERT
+// * </pre>
+// * @see CCorePlugin#INSERT
+// * @see CCorePlugin#DO_NOT_INSERT
+// */
+// public static final String FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_SYNCHRONIZED = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_opening_paren_in_synchronized"; //$NON-NLS-1$
+// /**
+// * <pre>
+// * FORMATTER / Option to insert a space before the opening parenthesis in a while statement
+// * - option id: "org.eclipse.cdt.core.formatter.insert_space_before_opening_paren_in_while"
+// * - possible values: { INSERT, DO_NOT_INSERT }
+// * - default: INSERT
+// * </pre>
+// * @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$
+// /**
+// * <pre>
+// * FORMATTER / Option to insert a space before parenthesized expression in return statement
+// * - option id: "org.eclipse.cdt.core.formatter.insert_space_before_parenthesized_expression_in_return"
+// * - possible values: { INSERT, DO_NOT_INSERT }
+// * - default: INSERT
+// * </pre>
+// *
+// * @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$
+// /**
+// * <pre>
+// * 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
+// * </pre>
+// * @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$
+// /**
+// * <pre>
+// * 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
+// * </pre>
+// * @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$
+// /**
+// * <pre>
+// * FORMATTER / Option to insert a space before question mark in a conditional expression
+// * - option id: "org.eclipse.cdt.core.formatter.insert_space_before_question_in_conditional"
+// * - possible values: { INSERT, DO_NOT_INSERT }
+// * - default: INSERT
+// * </pre>
+// * @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$
+// /**
+// * <pre>
+// * FORMATTER / Option to insert a space before question mark in a wildcard
+// * - option id: "org.eclipse.cdt.core.formatter.insert_space_before_question_in_wildcard"
+// * - possible values: { INSERT, DO_NOT_INSERT }
+// * - default: DO_NOT_INSERT
+// * </pre>
+// * @see CCorePlugin#INSERT
+// * @see CCorePlugin#DO_NOT_INSERT
+// */
+// public static final String FORMATTER_INSERT_SPACE_BEFORE_QUESTION_IN_WILDCARD = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_question_in_wildcard"; //$NON-NLS-1$
+// /**
+// * <pre>
+// * FORMATTER / Option to insert a space before semicolon
+// * - option id: "org.eclipse.cdt.core.formatter.insert_space_before_semicolon"
+// * - possible values: { INSERT, DO_NOT_INSERT }
+// * - default: DO_NOT_INSERT
+// * </pre>
+// * @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$
+// /**
+// * <pre>
+// * FORMATTER / Option to insert a space before semicolon in for statement
+// * - option id: "org.eclipse.cdt.core.formatter.insert_space_before_semicolon_in_for"
+// * - possible values: { INSERT, DO_NOT_INSERT }
+// * - default: DO_NOT_INSERT
+// * </pre>
+// * @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$
+// /**
+// * <pre>
+// * 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
+// * </pre>
+// * @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$
+//
+// /**
+// * <pre>
+// * 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
+// * </pre>
+// * @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$
+// /**
+// * <pre>
+// * FORMATTER / Option to insert a space between empty braces in an array initializer
+// * - 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
+// * </pre>
+// * @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$
+// /**
+// * <pre>
+// * 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
+// * </pre>
+// * @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$
+// /**
+// * <pre>
+// * FORMATTER / Option to insert a space between empty parenthesis in an annotation type member declaration
+// * - option id: "org.eclipse.cdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration"
+// * - possible values: { INSERT, DO_NOT_INSERT }
+// * - default: DO_NOT_INSERT
+// * </pre>
+// * @see CCorePlugin#INSERT
+// * @see CCorePlugin#DO_NOT_INSERT
+// */
+// public static final String FORMATTER_INSERT_SPACE_BETWEEN_EMPTY_PARENS_IN_ANNOTATION_TYPE_MEMBER_DECLARATION = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration"; //$NON-NLS-1$
+// /**
+// * <pre>
+// * FORMATTER / Option to insert a space between empty parenthesis in a constructor declaration
+// * - option id: "org.eclipse.cdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration"
+// * - possible values: { INSERT, DO_NOT_INSERT }
+// * - default: DO_NOT_INSERT
+// * </pre>
+// * @see CCorePlugin#INSERT
+// * @see CCorePlugin#DO_NOT_INSERT
+// */
+// public static final String FORMATTER_INSERT_SPACE_BETWEEN_EMPTY_PARENS_IN_CONSTRUCTOR_DECLARATION = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_between_empty_parens_in_constructor_declaration"; //$NON-NLS-1$
+// /**
+// * <pre>
+// * FORMATTER / Option to insert a space between empty parenthesis in enum constant
+// * - option id: "org.eclipse.cdt.core.formatter.insert_space_between_empty_parens_in_enum_constant"
+// * - possible values: { INSERT, DO_NOT_INSERT }
+// * - default: DO_NOT_INSERT
+// * </pre>
+// * @see CCorePlugin#INSERT
+// * @see CCorePlugin#DO_NOT_INSERT
+// */
+// public static final String FORMATTER_INSERT_SPACE_BETWEEN_EMPTY_PARENS_IN_ENUM_CONSTANT = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_between_empty_parens_in_enum_constant"; //$NON-NLS-1$
+// /**
+// * <pre>
+// * FORMATTER / Option to insert a space between empty parenthesis in a method declaration
+// * - option id: "org.eclipse.cdt.core.formatter.insert_space_between_empty_parens_in_method_declaration"
+// * - possible values: { INSERT, DO_NOT_INSERT }
+// * - default: DO_NOT_INSERT
+// * </pre>
+// * @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$
+// /**
+// * <pre>
+// * 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
+// * </pre>
+// * @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$
+// /**
+// * <pre>
+// * FORMATTER / Option to keep else statement on the same line
+// * - option id: "org.eclipse.cdt.core.formatter.keep_else_statement_on_same_line"
+// * - possible values: { TRUE, FALSE }
+// * - default: FALSE
+// * </pre>
+// * @see #TRUE
+// * @see #FALSE
+// */
+// public static final String FORMATTER_KEEP_ELSE_STATEMENT_ON_SAME_LINE = CCorePlugin.PLUGIN_ID + ".formatter.keep_else_statement_on_same_line"; //$NON-NLS-1$
+// /**
+// * <pre>
+// * FORMATTER / Option to keep empty array initializer one one line
+// * - option id: "org.eclipse.cdt.core.formatter.keep_empty_array_initializer_on_one_line"
+// * - possible values: { TRUE, FALSE }
+// * - default: FALSE
+// * </pre>
+// * @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$
+// /**
+// * <pre>
+// * FORMATTER / Option to keep guardian clause on one line
+// * - option id: "org.eclipse.cdt.core.formatter.format_guardian_clause_on_one_line"
+// * - possible values: { TRUE, FALSE }
+// * - default: FALSE
+// * </pre>
+// * @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$
+// /**
+// * <pre>
+// * FORMATTER / Option to keep simple if statement on the one line
+// * - option id: "org.eclipse.cdt.core.formatter.keep_imple_if_on_one_line"
+// * - possible values: { TRUE, FALSE }
+// * - default: FALSE
+// * </pre>
+// * @see #TRUE
+// * @see #FALSE
+// */
+// public static final String FORMATTER_KEEP_SIMPLE_IF_ON_ONE_LINE = CCorePlugin.PLUGIN_ID + ".formatter.keep_imple_if_on_one_line"; //$NON-NLS-1$
+// /**
+// * <pre>
+// * FORMATTER / Option to keep then statement on the same line
+// * - option id: "org.eclipse.cdt.core.formatter.keep_then_statement_on_same_line"
+// * - possible values: { TRUE, FALSE }
+// * - default: FALSE
+// * </pre>
+// * @see #TRUE
+// * @see #FALSE
+// */
+// public static final String FORMATTER_KEEP_THEN_STATEMENT_ON_SAME_LINE = CCorePlugin.PLUGIN_ID + ".formatter.keep_then_statement_on_same_line";//$NON-NLS-1$
+
+ /**
+ * <pre>
+ * FORMATTER / Option to specify the length of the page. Beyond this length, the formatter will try to split the code
+ * - option id: "org.eclipse.cdt.core.formatter.lineSplit"
+ * - possible values: "&lt;n&gt;", where n is zero or a positive integer
+ * - default: "80"
+ * </pre>
+ */
+ public static final String FORMATTER_LINE_SPLIT = CCorePlugin.PLUGIN_ID + ".formatter.lineSplit"; //$NON-NLS-1$
+//
+// /**
+// * <pre>
+// * FORMATTER / Option to specify the number of empty lines to preserve
+// * - option id: "org.eclipse.cdt.core.formatter.number_of_empty_lines_to_preserve"
+// * - possible values: "&lt;n&gt;", where n is zero or a positive integer
+// * - default: "0"
+// * </pre>
+// */
+// public static final String FORMATTER_NUMBER_OF_EMPTY_LINES_TO_PRESERVE = CCorePlugin.PLUGIN_ID + ".formatter.number_of_empty_lines_to_preserve"; //$NON-NLS-1$
+// /**
+// * <pre>
+// * FORMATTER / Option to specify whether or not empty statement should be on a new line
+// * - option id: "org.eclipse.cdt.core.formatter.put_empty_statement_on_new_line"
+// * - possible values: { TRUE, FALSE }
+// * - default: FALSE
+// * </pre>
+// * @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$
+ /**
+ * <pre>
+ * FORMATTER / Option to specify the tabulation size
+ * - option id: "org.eclipse.cdt.core.formatter.tabulation.char"
+ * - possible values: { TAB, SPACE, MIXED }
+ * - default: TAB
+ * </pre>
+ * More values may be added in the future.
+ *
+ * @see CCorePlugin#TAB
+ * @see CCorePlugin#SPACE
+ * @see #MIXED
+ */
+ public static final String FORMATTER_TAB_CHAR = CCorePlugin.PLUGIN_ID + ".formatter.tabulation.char"; //$NON-NLS-1$
+ /**
+ * <pre>
+ * FORMATTER / Option to specify the equivalent number of spaces that represents one tabulation
+ * - option id: "org.eclipse.cdt.core.formatter.tabulation.size"
+ * - possible values: "&lt;n&gt;", where n is zero or a positive integer
+ * - default: "4"
+ * </pre>
+ */
+ public static final String FORMATTER_TAB_SIZE = CCorePlugin.PLUGIN_ID + ".formatter.tabulation.size"; //$NON-NLS-1$
+
+ /**
+ * <pre>
+ * FORMATTER / Option to use tabulations only for leading indentations
+ * - option id: "org.eclipse.cdt.core.formatter.use_tabs_only_for_leading_indentations"
+ * - possible values: { TRUE, FALSE }
+ * - default: FALSE
+ * </pre>
+ * @see #TRUE
+ * @see #FALSE
+ */
+ public static final String FORMATTER_USE_TABS_ONLY_FOR_LEADING_INDENTATIONS = CCorePlugin.PLUGIN_ID + ".formatter.use_tabs_only_for_leading_indentations"; //$NON-NLS-1$
+
+ /**
+ * <pre>
+ * FORMATTER / The wrapping is done by indenting by one compare to the current indentation.
+ * </pre>
+ */
+ public static final int INDENT_BY_ONE= 2;
+
+ /**
+ * <pre>
+ * FORMATTER / The wrapping is done by using the current indentation.
+ * </pre>
+ */
+ public static final int INDENT_DEFAULT= 0;
+ /**
+ * <pre>
+ * FORMATTER / The wrapping is done by indenting on column under the splitting location.
+ * </pre>
+ */
+ public static final int INDENT_ON_COLUMN = 1;
+
+ /**
+ * <pre>
+ * FORMATTER / Possible value for the option FORMATTER_TAB_CHAR
+ * </pre>
+ * @see CCorePlugin#TAB
+ * @see CCorePlugin#SPACE
+ * @see #FORMATTER_TAB_CHAR
+ */
+ public static final String MIXED = "mixed"; //$NON-NLS-1$
+// /**
+// * <pre>
+// * FORMATTER / Value to set a brace location at the start of the next line with
+// * the right indentation.
+// * </pre>
+// * @see #FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION
+// * @see #FORMATTER_BRACE_POSITION_FOR_ARRAY_INITIALIZER
+// * @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 = "next_line"; //$NON-NLS-1$
+// /**
+// * <pre>
+// * FORMATTER / Value to set a brace location at the start of the next line if a wrapping
+// * occured.
+// * </pre>
+// * @see #FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION
+// * @see #FORMATTER_BRACE_POSITION_FOR_ARRAY_INITIALIZER
+// * @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_ON_WRAP = "next_line_on_wrap"; //$NON-NLS-1$
+ /**
+ * <pre>
+ * FORMATTER / Value to set a brace location at the start of the next line with
+ * an extra indentation.
+ * </pre>
+ * @see #FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION
+ * @see #FORMATTER_BRACE_POSITION_FOR_ARRAY_INITIALIZER
+ * @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$
+ /**
+ * <pre>
+ * FORMATTER / Value to set an option to true.
+ * </pre>
+ */
+ public static final String TRUE = "true"; //$NON-NLS-1$
+ /**
+ * <pre>
+ * FORMATTER / The wrapping is done using as few lines as possible.
+ * </pre>
+ */
+ public static final int WRAP_COMPACT= 1;
+ /**
+ * <pre>
+ * FORMATTER / The wrapping is done putting the first element on a new
+ * line and then wrapping next elements using as few lines as possible.
+ * </pre>
+ */
+ public static final int WRAP_COMPACT_FIRST_BREAK= 2;
+ /**
+ * <pre>
+ * FORMATTER / The wrapping is done by putting each element on its own line
+ * except the first element.
+ * </pre>
+ */
+ public static final int WRAP_NEXT_PER_LINE= 5;
+ /**
+ * <pre>
+ * FORMATTER / The wrapping is done by putting each element on its own line.
+ * All elements are indented by one except the first element.
+ * </pre>
+ */
+ public static final int WRAP_NEXT_SHIFTED= 4;
+
+ /**
+ * <pre>
+ * FORMATTER / Value to disable alignment.
+ * </pre>
+ */
+ public static final int WRAP_NO_SPLIT= 0;
+ /**
+ * <pre>
+ * FORMATTER / The wrapping is done by putting each element on its own line.
+ * </pre>
+ */
+ public static final int WRAP_ONE_PER_LINE= 3;
+
+ /*
+ * Private constants.
+ */
+ private static final IllegalArgumentException WRONG_ARGUMENT = new IllegalArgumentException();
+
+ /**
+ * Create a new alignment value according to the given values. This must be used to set up
+ * the alignment options.
+ *
+ * @param forceSplit the given force value
+ * @param wrapStyle the given wrapping style
+ * @param indentStyle the given indent style
+ *
+ * @return the new alignement value
+ */
+ public static String createAlignmentValue(boolean forceSplit, int wrapStyle, int indentStyle) {
+ int alignmentValue = 0;
+ switch(wrapStyle) {
+ case WRAP_COMPACT :
+ alignmentValue |= Alignment.M_COMPACT_SPLIT;
+ break;
+ case WRAP_COMPACT_FIRST_BREAK :
+ alignmentValue |= Alignment.M_COMPACT_FIRST_BREAK_SPLIT;
+ break;
+ case WRAP_NEXT_PER_LINE :
+ alignmentValue |= Alignment.M_NEXT_PER_LINE_SPLIT;
+ break;
+ case WRAP_NEXT_SHIFTED :
+ alignmentValue |= Alignment.M_NEXT_SHIFTED_SPLIT;
+ break;
+ case WRAP_ONE_PER_LINE :
+ alignmentValue |= Alignment.M_ONE_PER_LINE_SPLIT;
+ break;
+ }
+ if (forceSplit) {
+ alignmentValue |= Alignment.M_FORCE;
+ }
+ switch(indentStyle) {
+ case INDENT_BY_ONE :
+ alignmentValue |= Alignment.M_INDENT_BY_ONE;
+ break;
+ case INDENT_ON_COLUMN :
+ alignmentValue |= Alignment.M_INDENT_ON_COLUMN;
+ }
+ return String.valueOf(alignmentValue);
+ }
+
+ /**
+ * Returns the default Eclipse formatter settings
+ *
+ * @return the Eclipse default settings
+ */
+ public static Map getEclipseDefaultSettings() {
+ return DefaultCodeFormatterOptions.getEclipseDefaultSettings().getMap();
+ }
+
+ /**
+ * <p>Return the force value of the given alignment value.
+ * The given alignment value should be created using the <code>createAlignmentValue(boolean, int, int)</code>
+ * API.
+ * </p>
+ *
+ * @param value the given alignment value
+ * @return the force value of the given alignment value
+ * @see #createAlignmentValue(boolean, int, int)
+ * @exception IllegalArgumentException if the given alignment value is null, or if it
+ * doesn't have a valid format.
+ */
+ public static boolean getForceWrapping(String value) {
+ if (value == null) {
+ throw WRONG_ARGUMENT;
+ }
+ try {
+ int existingValue = Integer.parseInt(value);
+ return (existingValue & Alignment.M_FORCE) != 0;
+ } catch (NumberFormatException e) {
+ throw WRONG_ARGUMENT;
+ }
+ }
+ /**
+ * <p>Return the indentation style of the given alignment value.
+ * The given alignment value should be created using the <code>createAlignmentValue(boolean, int, int)</code>
+ * API.
+ * </p>
+ *
+ * @param value the given alignment value
+ * @return the indentation style of the given alignment value
+ * @see #createAlignmentValue(boolean, int, int)
+ * @exception IllegalArgumentException if the given alignment value is null, or if it
+ * doesn't have a valid format.
+ */
+ public static int getIndentStyle(String value) {
+ if (value == null) {
+ throw WRONG_ARGUMENT;
+ }
+ try {
+ int existingValue = Integer.parseInt(value);
+ if ((existingValue & Alignment.M_INDENT_BY_ONE) != 0) {
+ return INDENT_BY_ONE;
+ } else if ((existingValue & Alignment.M_INDENT_ON_COLUMN) != 0) {
+ return INDENT_ON_COLUMN;
+ } else {
+ return INDENT_DEFAULT;
+ }
+ } catch (NumberFormatException e) {
+ throw WRONG_ARGUMENT;
+ }
+ }
+ /**
+ * <p>Return the wrapping style of the given alignment value.
+ * The given alignment value should be created using the <code>createAlignmentValue(boolean, int, int)</code>
+ * API.
+ * </p>
+ *
+ * @param value the given alignment value
+ * @return the wrapping style of the given alignment value
+ * @see #createAlignmentValue(boolean, int, int)
+ * @exception IllegalArgumentException if the given alignment value is null, or if it
+ * doesn't have a valid format.
+ */
+ public static int getWrappingStyle(String value) {
+ if (value == null) {
+ throw WRONG_ARGUMENT;
+ }
+ try {
+ int existingValue = Integer.parseInt(value) & Alignment.SPLIT_MASK;
+ switch(existingValue) {
+ case Alignment.M_COMPACT_SPLIT :
+ return WRAP_COMPACT;
+ case Alignment.M_COMPACT_FIRST_BREAK_SPLIT :
+ return WRAP_COMPACT_FIRST_BREAK;
+ case Alignment.M_NEXT_PER_LINE_SPLIT :
+ return WRAP_NEXT_PER_LINE;
+ case Alignment.M_NEXT_SHIFTED_SPLIT :
+ return WRAP_NEXT_SHIFTED;
+ case Alignment.M_ONE_PER_LINE_SPLIT :
+ return WRAP_ONE_PER_LINE;
+ default:
+ return WRAP_NO_SPLIT;
+ }
+ } catch (NumberFormatException e) {
+ throw WRONG_ARGUMENT;
+ }
+ }
+ /**
+ * <p>Set the force value of the given alignment value and return the new value.
+ * The given alignment value should be created using the <code>createAlignmentValue(boolean, int, int)</code>
+ * API.
+ * </p>
+ *
+ * @param value the given alignment value
+ * @param force the given force value
+ * @return the new alignment value
+ * @see #createAlignmentValue(boolean, int, int)
+ * @exception IllegalArgumentException if the given alignment value is null, or if it
+ * doesn't have a valid format.
+ */
+ public static String setForceWrapping(String value, boolean force) {
+ if (value == null) {
+ throw WRONG_ARGUMENT;
+ }
+ try {
+ int existingValue = Integer.parseInt(value);
+ // clear existing force bit
+ existingValue &= ~Alignment.M_FORCE;
+ if (force) {
+ existingValue |= Alignment.M_FORCE;
+ }
+ return String.valueOf(existingValue);
+ } catch (NumberFormatException e) {
+ throw WRONG_ARGUMENT;
+ }
+ }
+
+ /**
+ * <p>Set the indentation style of the given alignment value and return the new value.
+ * The given value should be created using the <code>createAlignmentValue(boolean, int, int)</code>
+ * API.
+ * </p>
+ *
+ * @param value the given alignment value
+ * @param indentStyle the given indentation style
+ * @return the new alignment value
+ * @see #INDENT_BY_ONE
+ * @see #INDENT_DEFAULT
+ * @see #INDENT_ON_COLUMN
+ * @see #createAlignmentValue(boolean, int, int)
+ * @exception IllegalArgumentException if the given alignment value is null, if the given
+ * indentation style is not one of the possible indentation styles, or if the given
+ * alignment value doesn't have a valid format.
+ */
+ public static String setIndentStyle(String value, int indentStyle) {
+ if (value == null) {
+ throw WRONG_ARGUMENT;
+ }
+ switch(indentStyle) {
+ case INDENT_BY_ONE :
+ case INDENT_DEFAULT :
+ case INDENT_ON_COLUMN :
+ break;
+ default :
+ throw WRONG_ARGUMENT;
+ }
+ try {
+ int existingValue = Integer.parseInt(value);
+ // clear existing indent bits
+ existingValue &= ~(Alignment.M_INDENT_BY_ONE | Alignment.M_INDENT_ON_COLUMN);
+ switch(indentStyle) {
+ case INDENT_BY_ONE :
+ existingValue |= Alignment.M_INDENT_BY_ONE;
+ break;
+ case INDENT_ON_COLUMN :
+ existingValue |= Alignment.M_INDENT_ON_COLUMN;
+ }
+ return String.valueOf(existingValue);
+ } catch (NumberFormatException e) {
+ throw WRONG_ARGUMENT;
+ }
+ }
+ /**
+ * <p>Set the wrapping style of the given alignment value and return the new value.
+ * The given value should be created using the <code>createAlignmentValue(boolean, int, int)</code>
+ * API.
+ * </p>
+ *
+ * @param value the given alignment value
+ * @param wrappingStyle the given wrapping style
+ * @return the new alignment value
+ * @see #WRAP_COMPACT
+ * @see #WRAP_COMPACT_FIRST_BREAK
+ * @see #WRAP_NEXT_PER_LINE
+ * @see #WRAP_NEXT_SHIFTED
+ * @see #WRAP_NO_SPLIT
+ * @see #WRAP_ONE_PER_LINE
+ * @see #createAlignmentValue(boolean, int, int)
+ * @exception IllegalArgumentException if the given alignment value is null, if the given
+ * wrapping style is not one of the possible wrapping styles, or if the given
+ * alignment value doesn't have a valid format.
+ */
+ public static String setWrappingStyle(String value, int wrappingStyle) {
+ if (value == null) {
+ throw WRONG_ARGUMENT;
+ }
+ switch(wrappingStyle) {
+ case WRAP_COMPACT :
+ case WRAP_COMPACT_FIRST_BREAK :
+ case WRAP_NEXT_PER_LINE :
+ case WRAP_NEXT_SHIFTED :
+ case WRAP_NO_SPLIT :
+ case WRAP_ONE_PER_LINE :
+ break;
+ default:
+ throw WRONG_ARGUMENT;
+ }
+ try {
+ int existingValue = Integer.parseInt(value);
+ // clear existing split bits
+ existingValue &= ~(Alignment.SPLIT_MASK);
+ switch(wrappingStyle) {
+ case WRAP_COMPACT :
+ existingValue |= Alignment.M_COMPACT_SPLIT;
+ break;
+ case WRAP_COMPACT_FIRST_BREAK :
+ existingValue |= Alignment.M_COMPACT_FIRST_BREAK_SPLIT;
+ break;
+ case WRAP_NEXT_PER_LINE :
+ existingValue |= Alignment.M_NEXT_PER_LINE_SPLIT;
+ break;
+ case WRAP_NEXT_SHIFTED :
+ existingValue |= Alignment.M_NEXT_SHIFTED_SPLIT;
+ break;
+ case WRAP_ONE_PER_LINE :
+ existingValue |= Alignment.M_ONE_PER_LINE_SPLIT;
+ break;
+ }
+ return String.valueOf(existingValue);
+ } catch (NumberFormatException e) {
+ throw WRONG_ARGUMENT;
+ }
+ }
}
diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/CCorePreferenceInitializer.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/CCorePreferenceInitializer.java
index 645c0eff336..b862e51b204 100644
--- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/CCorePreferenceInitializer.java
+++ b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/CCorePreferenceInitializer.java
@@ -7,16 +7,23 @@
*
* Contributors:
* QNX Software Systems - Initial API and implementation
+ * Sergey Prigogin, Google
*******************************************************************************/
package org.eclipse.cdt.internal.core;
import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Map;
import org.eclipse.cdt.core.CCorePlugin;
import org.eclipse.cdt.core.CCorePreferenceConstants;
+import org.eclipse.cdt.core.formatter.CodeFormatterConstants;
import org.eclipse.cdt.internal.core.model.CModelManager;
-import org.eclipse.core.runtime.Preferences;
+//import org.eclipse.core.runtime.Preferences;
import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer;
+import org.eclipse.core.runtime.preferences.DefaultScope;
+import org.eclipse.core.runtime.preferences.IEclipsePreferences;
+import org.eclipse.core.runtime.preferences.IScopeContext;
public class CCorePreferenceInitializer extends AbstractPreferenceInitializer {
@@ -25,19 +32,24 @@ public class CCorePreferenceInitializer extends AbstractPreferenceInitializer {
* @see org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer#initializeDefaultPreferences()
*/
public void initializeDefaultPreferences() {
- Preferences preferences = CCorePlugin.getDefault().getPluginPreferences();
HashSet optionNames = CModelManager.OptionNames;
- // Compiler settings
- preferences.setDefault(CCorePreferenceConstants.TRANSLATION_TASK_TAGS, CCorePreferenceConstants.DEFAULT_TASK_TAG);
- optionNames.add(CCorePreferenceConstants.TRANSLATION_TASK_TAGS);
+ // Formatter settings
+ Map defaultOptionsMap = CodeFormatterConstants.getEclipseDefaultSettings(); // code formatter defaults
- preferences.setDefault(CCorePreferenceConstants.TRANSLATION_TASK_PRIORITIES, CCorePreferenceConstants.DEFAULT_TASK_PRIORITY);
- optionNames.add(CCorePreferenceConstants.TRANSLATION_TASK_PRIORITIES);
-
- preferences.setDefault(CCorePreferenceConstants.CODE_FORMATTER, CCorePreferenceConstants.DEFAULT_CODE_FORMATTER);
- optionNames.add(CCorePreferenceConstants.CODE_FORMATTER);
+ // Compiler settings
+ defaultOptionsMap.put(CCorePreferenceConstants.TRANSLATION_TASK_TAGS, CCorePreferenceConstants.DEFAULT_TASK_TAG);
+ defaultOptionsMap.put(CCorePreferenceConstants.TRANSLATION_TASK_PRIORITIES, CCorePreferenceConstants.DEFAULT_TASK_PRIORITY);
+ defaultOptionsMap.put(CCorePreferenceConstants.CODE_FORMATTER, CCorePreferenceConstants.DEFAULT_CODE_FORMATTER);
+ // Store default values to default preferences
+ IEclipsePreferences defaultPreferences = ((IScopeContext) new DefaultScope()).getNode(CCorePlugin.PLUGIN_ID);
+ for (Iterator iter = defaultOptionsMap.entrySet().iterator(); iter.hasNext();) {
+ Map.Entry entry = (Map.Entry) iter.next();
+ String optionName = (String) entry.getKey();
+ defaultPreferences.put(optionName, (String)entry.getValue());
+ optionNames.add(optionName);
+ }
}
}
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
new file mode 100644
index 00000000000..b1bc38660fd
--- /dev/null
+++ b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/formatter/DefaultCodeFormatterOptions.java
@@ -0,0 +1,2158 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2006 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
+ * Sergey Prigogin, Google
+ *******************************************************************************/
+package org.eclipse.cdt.internal.formatter;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.eclipse.cdt.core.formatter.CodeFormatterConstants;
+import org.eclipse.cdt.core.CCorePlugin;
+import org.eclipse.cdt.internal.formatter.align.Alignment;
+
+
+public class DefaultCodeFormatterOptions {
+ public static final int TAB = 1;
+ public static final int SPACE = 2;
+ public static final int MIXED = 4;
+
+ public static DefaultCodeFormatterOptions getDefaultSettings() {
+ DefaultCodeFormatterOptions options = new DefaultCodeFormatterOptions();
+ options.setDefaultSettings();
+ return options;
+ }
+
+ public static DefaultCodeFormatterOptions getEclipseDefaultSettings() {
+ DefaultCodeFormatterOptions options = new DefaultCodeFormatterOptions();
+ options.setEclipseDefaultSettings();
+ return options;
+ }
+
+ public int alignment_for_arguments_in_allocation_expression;
+ public int alignment_for_arguments_in_enum_constant;
+ public int alignment_for_arguments_in_explicit_constructor_call;
+ public int alignment_for_arguments_in_method_invocation;
+ public int alignment_for_arguments_in_qualified_allocation_expression;
+ 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_enum_constants;
+ public int alignment_for_expressions_in_array_initializer;
+ public int alignment_for_multiple_fields;
+ public int alignment_for_parameters_in_constructor_declaration;
+ 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_superinterfaces_in_enum_declaration;
+ public int alignment_for_superinterfaces_in_type_declaration;
+ public int alignment_for_throws_clause_in_constructor_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_block;
+ public String brace_position_for_block_in_case;
+ public String brace_position_for_constructor_declaration;
+ public String brace_position_for_enum_constant;
+ public String brace_position_for_enum_declaration;
+ public String brace_position_for_method_declaration;
+ public String brace_position_for_type_declaration;
+ public String brace_position_for_switch;
+
+ public int continuation_indentation;
+ public int continuation_indentation_for_array_initializer;
+
+// public int blank_lines_after_imports;
+// public int blank_lines_after_package;
+// public int blank_lines_before_field;
+// public int blank_lines_before_first_class_body_declaration;
+// public int blank_lines_before_imports;
+// public int blank_lines_before_member_type;
+// public int blank_lines_before_method;
+// public int blank_lines_before_new_chunk;
+// public int blank_lines_before_package;
+// public int blank_lines_between_type_declarations;
+// public int blank_lines_at_beginning_of_method_body;
+
+// public boolean comment_clear_blank_lines;
+// public boolean comment_format;
+// public boolean comment_format_header;
+// public boolean comment_format_html;
+// public boolean comment_format_source;
+// public int comment_line_length;
+
+ public boolean indent_statements_compare_to_block;
+ public boolean indent_statements_compare_to_body;
+ public boolean indent_body_declarations_compare_to_enum_constant_header;
+ public boolean indent_body_declarations_compare_to_enum_declaration_header;
+ public boolean indent_body_declarations_compare_to_type_header;
+ public boolean indent_breaks_compare_to_cases;
+ public boolean indent_empty_lines;
+ public boolean indent_switchstatements_compare_to_cases;
+ 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_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_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_constant;
+// 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_closing_brace_in_block;
+// public boolean insert_space_after_colon_in_assert;
+// 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_comma_in_allocation_expression;
+// public boolean insert_space_after_comma_in_array_initializer;
+// public boolean insert_space_after_comma_in_constructor_declaration_parameters;
+// public boolean insert_space_after_comma_in_constructor_declaration_throws;
+// public boolean insert_space_after_comma_in_enum_constant_arguments;
+// public boolean insert_space_after_comma_in_enum_declarations;
+// public boolean insert_space_after_comma_in_explicit_constructor_call_arguments;
+// 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_superinterfaces;
+// public boolean insert_space_after_comma_in_type_arguments;
+// public boolean insert_space_after_comma_in_type_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_paren_in_constructor_declaration;
+// public boolean insert_space_after_opening_paren_in_enum_constant;
+// 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_switch;
+// public boolean insert_space_after_opening_paren_in_synchronized;
+// 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_question_in_conditional;
+// public boolean insert_space_after_question_in_wilcard;
+// 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_before_closing_paren_in_constructor_declaration;
+// public boolean insert_space_before_closing_paren_in_enum_constant;
+// 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_switch;
+// public boolean insert_space_before_closing_paren_in_synchronized;
+// public boolean insert_space_before_closing_paren_in_while;
+// public boolean insert_space_before_colon_in_assert;
+// 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_comma_in_allocation_expression;
+// public boolean insert_space_before_comma_in_array_initializer;
+// public boolean insert_space_before_comma_in_constructor_declaration_parameters;
+// public boolean insert_space_before_comma_in_constructor_declaration_throws;
+// public boolean insert_space_before_comma_in_enum_constant_arguments;
+// public boolean insert_space_before_comma_in_enum_declarations;
+// public boolean insert_space_before_comma_in_explicit_constructor_call_arguments;
+// 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_superinterfaces;
+// public boolean insert_space_before_comma_in_type_arguments;
+// public boolean insert_space_before_comma_in_type_parameters;
+// public boolean insert_space_before_ellipsis;
+// public boolean insert_space_before_parenthesized_expression_in_return;
+// public boolean insert_space_before_question_in_wilcard;
+// 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_brace_in_block;
+// public boolean insert_space_before_opening_brace_in_constructor_declaration;
+// public boolean insert_space_before_opening_brace_in_enum_constant;
+// 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_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_paren_in_constructor_declaration;
+// public boolean insert_space_before_opening_paren_in_enum_constant;
+// 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_synchronized;
+// 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_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_between_empty_parens_in_constructor_declaration;
+// public boolean insert_space_between_empty_parens_in_enum_constant;
+// public boolean insert_space_between_empty_parens_in_method_declaration;
+// 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_simple_if_on_one_line;
+// public boolean keep_then_statement_on_same_line;
+// public int number_of_empty_lines_to_preserve;
+// public boolean put_empty_statement_on_new_line;
+ public int tab_size;
+ public final char filling_space = ' ';
+ public int page_width;
+ public int tab_char = TAB;
+ public boolean use_tabs_only_for_leading_indentations;
+
+ public int initial_indentation_level;
+ public String line_separator;
+
+ private DefaultCodeFormatterOptions() {
+ // cannot be instantiated
+ }
+
+ public DefaultCodeFormatterOptions(Map settings) {
+ setDefaultSettings();
+ if (settings == null) return;
+ set(settings);
+ }
+
+ private String getAlignment(int alignment) {
+ return Integer.toString(alignment);
+ }
+
+ public Map getMap() {
+ Map options = new HashMap();
+ options.put(CodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_ARGUMENTS_IN_ALLOCATION_EXPRESSION, getAlignment(this.alignment_for_arguments_in_allocation_expression));
+ options.put(CodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_ARGUMENTS_IN_ENUM_CONSTANT, getAlignment(this.alignment_for_arguments_in_enum_constant));
+ options.put(CodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_ARGUMENTS_IN_EXPLICIT_CONSTRUCTOR_CALL, getAlignment(this.alignment_for_arguments_in_explicit_constructor_call));
+ options.put(CodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_ARGUMENTS_IN_METHOD_INVOCATION, getAlignment(this.alignment_for_arguments_in_method_invocation));
+ options.put(CodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_ARGUMENTS_IN_QUALIFIED_ALLOCATION_EXPRESSION, getAlignment(this.alignment_for_arguments_in_qualified_allocation_expression));
+ options.put(CodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_ASSIGNMENT, getAlignment(this.alignment_for_assignment));
+ options.put(CodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_BINARY_EXPRESSION, getAlignment(this.alignment_for_binary_expression));
+ options.put(CodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_COMPACT_IF, getAlignment(this.alignment_for_compact_if));
+ options.put(CodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_CONDITIONAL_EXPRESSION, getAlignment(this.alignment_for_conditional_expression));
+ options.put(CodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_ENUM_CONSTANTS, getAlignment(this.alignment_for_enum_constants));
+ options.put(CodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_EXPRESSIONS_IN_ARRAY_INITIALIZER, getAlignment(this.alignment_for_expressions_in_array_initializer));
+ options.put(CodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_MULTIPLE_FIELDS, getAlignment(this.alignment_for_multiple_fields));
+ options.put(CodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_PARAMETERS_IN_CONSTRUCTOR_DECLARATION, getAlignment(this.alignment_for_parameters_in_constructor_declaration));
+ options.put(CodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_PARAMETERS_IN_METHOD_DECLARATION, getAlignment(this.alignment_for_parameters_in_method_declaration));
+ options.put(CodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_SELECTOR_IN_METHOD_INVOCATION, getAlignment(this.alignment_for_selector_in_method_invocation));
+ options.put(CodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_SUPERCLASS_IN_TYPE_DECLARATION, getAlignment(this.alignment_for_superclass_in_type_declaration));
+ options.put(CodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_SUPERINTERFACES_IN_ENUM_DECLARATION, getAlignment(this.alignment_for_superinterfaces_in_enum_declaration));
+ options.put(CodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_SUPERINTERFACES_IN_TYPE_DECLARATION, getAlignment(this.alignment_for_superinterfaces_in_type_declaration));
+ options.put(CodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_THROWS_CLAUSE_IN_CONSTRUCTOR_DECLARATION, getAlignment(this.alignment_for_throws_clause_in_constructor_declaration));
+ options.put(CodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_THROWS_CLAUSE_IN_METHOD_DECLARATION, getAlignment(this.alignment_for_throws_clause_in_method_declaration));
+ options.put(CodeFormatterConstants.FORMATTER_ALIGN_TYPE_MEMBERS_ON_COLUMNS, this.align_type_members_on_columns ? CodeFormatterConstants.TRUE : CodeFormatterConstants.FALSE);
+ options.put(CodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ARRAY_INITIALIZER, this.brace_position_for_array_initializer);
+ options.put(CodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, this.brace_position_for_block);
+ options.put(CodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK_IN_CASE, this.brace_position_for_block_in_case);
+ options.put(CodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION, this.brace_position_for_constructor_declaration);
+ options.put(CodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ENUM_CONSTANT, this.brace_position_for_enum_constant);
+ options.put(CodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ENUM_DECLARATION, this.brace_position_for_enum_declaration);
+ options.put(CodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, this.brace_position_for_method_declaration);
+ options.put(CodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, this.brace_position_for_type_declaration);
+ options.put(CodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, this.brace_position_for_switch);
+// options.put(CodeFormatterConstants.FORMATTER_COMMENT_CLEAR_BLANK_LINES, this.comment_clear_blank_lines ? CodeFormatterConstants.TRUE : CodeFormatterConstants.FALSE);
+// options.put(CodeFormatterConstants.FORMATTER_COMMENT_FORMAT, this.comment_format ? CodeFormatterConstants.TRUE : CodeFormatterConstants.FALSE);
+// options.put(CodeFormatterConstants.FORMATTER_COMMENT_FORMAT_HEADER, this.comment_format_header ? CodeFormatterConstants.TRUE : CodeFormatterConstants.FALSE);
+// options.put(CodeFormatterConstants.FORMATTER_COMMENT_FORMAT_HTML, this.comment_format_html ? CodeFormatterConstants.TRUE : CodeFormatterConstants.FALSE);
+// options.put(CodeFormatterConstants.FORMATTER_COMMENT_FORMAT_SOURCE, this.comment_format_source ? CodeFormatterConstants.TRUE : CodeFormatterConstants.FALSE);
+// options.put(CodeFormatterConstants.FORMATTER_COMMENT_LINE_LENGTH, Integer.toString(this.comment_line_length));
+ options.put(CodeFormatterConstants.FORMATTER_CONTINUATION_INDENTATION, Integer.toString(this.continuation_indentation));
+ options.put(CodeFormatterConstants.FORMATTER_CONTINUATION_INDENTATION_FOR_ARRAY_INITIALIZER, Integer.toString(this.continuation_indentation_for_array_initializer));
+// options.put(CodeFormatterConstants.FORMATTER_BLANK_LINES_AFTER_IMPORTS, Integer.toString(this.blank_lines_after_imports));
+// options.put(CodeFormatterConstants.FORMATTER_BLANK_LINES_AFTER_PACKAGE, Integer.toString(this.blank_lines_after_package));
+// options.put(CodeFormatterConstants.FORMATTER_BLANK_LINES_BEFORE_FIELD, Integer.toString(this.blank_lines_before_field));
+// options.put(CodeFormatterConstants.FORMATTER_BLANK_LINES_BEFORE_FIRST_CLASS_BODY_DECLARATION, Integer.toString(this.blank_lines_before_first_class_body_declaration));
+// options.put(CodeFormatterConstants.FORMATTER_BLANK_LINES_BEFORE_IMPORTS, Integer.toString(this.blank_lines_before_imports));
+// options.put(CodeFormatterConstants.FORMATTER_BLANK_LINES_BEFORE_MEMBER_TYPE, Integer.toString(this.blank_lines_before_member_type));
+// options.put(CodeFormatterConstants.FORMATTER_BLANK_LINES_BEFORE_METHOD, Integer.toString(this.blank_lines_before_method));
+// options.put(CodeFormatterConstants.FORMATTER_BLANK_LINES_BEFORE_NEW_CHUNK, Integer.toString(this.blank_lines_before_new_chunk));
+// options.put(CodeFormatterConstants.FORMATTER_BLANK_LINES_BEFORE_PACKAGE, Integer.toString(this.blank_lines_before_package));
+// options.put(CodeFormatterConstants.FORMATTER_BLANK_LINES_BETWEEN_TYPE_DECLARATIONS, Integer.toString(this.blank_lines_between_type_declarations));
+// options.put(CodeFormatterConstants.FORMATTER_BLANK_LINES_AT_BEGINNING_OF_METHOD_BODY, Integer.toString(this.blank_lines_at_beginning_of_method_body));
+ options.put(CodeFormatterConstants.FORMATTER_INDENT_STATEMENTS_COMPARE_TO_BLOCK, this.indent_statements_compare_to_block ? CodeFormatterConstants.TRUE : CodeFormatterConstants.FALSE);
+ options.put(CodeFormatterConstants.FORMATTER_INDENT_STATEMENTS_COMPARE_TO_BODY, this.indent_statements_compare_to_body ? CodeFormatterConstants.TRUE : CodeFormatterConstants.FALSE);
+ options.put(CodeFormatterConstants.FORMATTER_INDENT_BODY_DECLARATIONS_COMPARE_TO_ENUM_CONSTANT_HEADER, this.indent_body_declarations_compare_to_enum_constant_header ? CodeFormatterConstants.TRUE : CodeFormatterConstants.FALSE);
+ options.put(CodeFormatterConstants.FORMATTER_INDENT_BODY_DECLARATIONS_COMPARE_TO_ENUM_DECLARATION_HEADER, this.indent_body_declarations_compare_to_enum_declaration_header ? CodeFormatterConstants.TRUE : CodeFormatterConstants.FALSE);
+ options.put(CodeFormatterConstants.FORMATTER_INDENT_BODY_DECLARATIONS_COMPARE_TO_TYPE_HEADER, this.indent_body_declarations_compare_to_type_header ? CodeFormatterConstants.TRUE : CodeFormatterConstants.FALSE);
+ options.put(CodeFormatterConstants.FORMATTER_INDENT_BREAKS_COMPARE_TO_CASES, this.indent_breaks_compare_to_cases ? CodeFormatterConstants.TRUE : CodeFormatterConstants.FALSE);
+ options.put(CodeFormatterConstants.FORMATTER_INDENT_EMPTY_LINES, this.indent_empty_lines ? CodeFormatterConstants.TRUE : CodeFormatterConstants.FALSE);
+ options.put(CodeFormatterConstants.FORMATTER_INDENT_SWITCHSTATEMENTS_COMPARE_TO_CASES, this.indent_switchstatements_compare_to_cases ? CodeFormatterConstants.TRUE : CodeFormatterConstants.FALSE);
+ options.put(CodeFormatterConstants.FORMATTER_INDENT_SWITCHSTATEMENTS_COMPARE_TO_SWITCH, this.indent_switchstatements_compare_to_switch ? CodeFormatterConstants.TRUE : CodeFormatterConstants.FALSE);
+ options.put(CodeFormatterConstants.FORMATTER_INDENTATION_SIZE, Integer.toString(this.indentation_size));
+// options.put(CodeFormatterConstants.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(CodeFormatterConstants.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(CodeFormatterConstants.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(CodeFormatterConstants.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(CodeFormatterConstants.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(CodeFormatterConstants.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(CodeFormatterConstants.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(CodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_IN_EMPTY_BLOCK, this.insert_new_line_in_empty_block? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
+// options.put(CodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_IN_EMPTY_ENUM_CONSTANT, this.insert_new_line_in_empty_enum_constant? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
+// options.put(CodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_IN_EMPTY_ENUM_DECLARATION, this.insert_new_line_in_empty_enum_declaration? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
+// options.put(CodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_IN_EMPTY_METHOD_BODY, this.insert_new_line_in_empty_method_body? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
+// options.put(CodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_IN_EMPTY_TYPE_DECLARATION, this.insert_new_line_in_empty_type_declaration? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
+// options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_AND_IN_TYPE_PARAMETER, this.insert_space_after_and_in_type_parameter? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
+// options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_ASSIGNMENT_OPERATOR, this.insert_space_after_assignment_operator? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
+// options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_BINARY_OPERATOR, this.insert_space_after_binary_operator? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
+// options.put(CodeFormatterConstants.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(CodeFormatterConstants.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(CodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_CLOSING_PAREN_IN_CAST, this.insert_space_after_closing_paren_in_cast? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
+// options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_CLOSING_BRACE_IN_BLOCK, this.insert_space_after_closing_brace_in_block? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
+// options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COLON_IN_ASSERT, this.insert_space_after_colon_in_assert ? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
+// options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COLON_IN_CASE, this.insert_space_after_colon_in_case ? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
+// options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COLON_IN_CONDITIONAL, this.insert_space_after_colon_in_conditional ? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
+// options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COLON_IN_FOR, this.insert_space_after_colon_in_for ? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
+// options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COLON_IN_LABELED_STATEMENT, this.insert_space_after_colon_in_labeled_statement? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
+// options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_ALLOCATION_EXPRESSION, this.insert_space_after_comma_in_allocation_expression? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
+// options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_ARRAY_INITIALIZER, this.insert_space_after_comma_in_array_initializer? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
+// options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_CONSTRUCTOR_DECLARATION_PARAMETERS, this.insert_space_after_comma_in_constructor_declaration_parameters? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
+// options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_CONSTRUCTOR_DECLARATION_THROWS, this.insert_space_after_comma_in_constructor_declaration_throws? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
+// options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_ENUM_CONSTANT_ARGUMENTS, this.insert_space_after_comma_in_enum_constant_arguments ? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
+// options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_ENUM_DECLARATIONS, this.insert_space_after_comma_in_enum_declarations ? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
+// options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_EXPLICIT_CONSTRUCTOR_CALL_ARGUMENTS, this.insert_space_after_comma_in_explicit_constructor_call_arguments? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
+// options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_FOR_INCREMENTS, this.insert_space_after_comma_in_for_increments? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
+// options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_FOR_INITS, this.insert_space_after_comma_in_for_inits? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
+// options.put(CodeFormatterConstants.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(CodeFormatterConstants.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(CodeFormatterConstants.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(CodeFormatterConstants.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(CodeFormatterConstants.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(CodeFormatterConstants.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(CodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_SUPERINTERFACES, this.insert_space_after_comma_in_superinterfaces? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
+// options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_TYPE_ARGUMENTS, this.insert_space_after_comma_in_type_arguments ? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
+// options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_TYPE_PARAMETERS, this.insert_space_after_comma_in_type_parameters ? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
+// options.put(CodeFormatterConstants.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(CodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_ELLIPSIS, this.insert_space_after_ellipsis ? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
+// options.put(CodeFormatterConstants.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(CodeFormatterConstants.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(CodeFormatterConstants.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(CodeFormatterConstants.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(CodeFormatterConstants.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(CodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_CAST, this.insert_space_after_opening_paren_in_cast? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
+// options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_CATCH, this.insert_space_after_opening_paren_in_catch? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
+// options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_CONSTRUCTOR_DECLARATION, this.insert_space_after_opening_paren_in_constructor_declaration? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
+// options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_ENUM_CONSTANT, this.insert_space_after_opening_paren_in_enum_constant? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
+// options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_FOR, this.insert_space_after_opening_paren_in_for? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
+// options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_IF, this.insert_space_after_opening_paren_in_if? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
+// options.put(CodeFormatterConstants.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(CodeFormatterConstants.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(CodeFormatterConstants.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(CodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_SWITCH, this.insert_space_after_opening_paren_in_switch? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
+// options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_SYNCHRONIZED, this.insert_space_after_opening_paren_in_synchronized? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
+// options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_WHILE, this.insert_space_after_opening_paren_in_while? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
+// options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_POSTFIX_OPERATOR, this.insert_space_after_postfix_operator? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
+// options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_PREFIX_OPERATOR, this.insert_space_after_prefix_operator? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
+// options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_QUESTION_IN_CONDITIONAL, this.insert_space_after_question_in_conditional? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
+// options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_QUESTION_IN_WILDCARD, this.insert_space_after_question_in_wilcard? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
+// options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_SEMICOLON_IN_FOR, this.insert_space_after_semicolon_in_for? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
+// options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_UNARY_OPERATOR, this.insert_space_after_unary_operator? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
+// options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_AND_IN_TYPE_PARAMETER, this.insert_space_before_and_in_type_parameter ? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
+// options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_ASSIGNMENT_OPERATOR, this.insert_space_before_assignment_operator? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
+// options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_BINARY_OPERATOR, this.insert_space_before_binary_operator? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
+// options.put(CodeFormatterConstants.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(CodeFormatterConstants.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(CodeFormatterConstants.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(CodeFormatterConstants.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(CodeFormatterConstants.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(CodeFormatterConstants.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(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_CAST, this.insert_space_before_closing_paren_in_cast? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
+// options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_CATCH, this.insert_space_before_closing_paren_in_catch? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
+// options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_CONSTRUCTOR_DECLARATION, this.insert_space_before_closing_paren_in_constructor_declaration? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
+// options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_ENUM_CONSTANT, this.insert_space_before_closing_paren_in_enum_constant? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
+// options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_FOR, this.insert_space_before_closing_paren_in_for? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
+// options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_IF, this.insert_space_before_closing_paren_in_if? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
+// options.put(CodeFormatterConstants.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(CodeFormatterConstants.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(CodeFormatterConstants.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(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_SWITCH, this.insert_space_before_closing_paren_in_switch? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
+// options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_SYNCHRONIZED, this.insert_space_before_closing_paren_in_synchronized? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
+// options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_WHILE, this.insert_space_before_closing_paren_in_while? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
+// options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COLON_IN_ASSERT, this.insert_space_before_colon_in_assert? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
+// options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COLON_IN_CASE, this.insert_space_before_colon_in_case? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
+// options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COLON_IN_CONDITIONAL, this.insert_space_before_colon_in_conditional? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
+// options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COLON_IN_DEFAULT, this.insert_space_before_colon_in_default? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
+// options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COLON_IN_FOR, this.insert_space_before_colon_in_for ? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
+// options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COLON_IN_LABELED_STATEMENT, this.insert_space_before_colon_in_labeled_statement? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
+// options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_ALLOCATION_EXPRESSION, this.insert_space_before_comma_in_allocation_expression? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
+// options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_ARRAY_INITIALIZER, this.insert_space_before_comma_in_array_initializer? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
+// options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_CONSTRUCTOR_DECLARATION_PARAMETERS, this.insert_space_before_comma_in_constructor_declaration_parameters? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
+// options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_CONSTRUCTOR_DECLARATION_THROWS, this.insert_space_before_comma_in_constructor_declaration_throws? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
+// options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_ENUM_CONSTANT_ARGUMENTS, this.insert_space_before_comma_in_enum_constant_arguments? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
+// options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_ENUM_DECLARATIONS, this.insert_space_before_comma_in_enum_declarations? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
+// options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_EXPLICIT_CONSTRUCTOR_CALL_ARGUMENTS, this.insert_space_before_comma_in_explicit_constructor_call_arguments? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
+// options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_FOR_INCREMENTS, this.insert_space_before_comma_in_for_increments? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
+// options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_FOR_INITS, this.insert_space_before_comma_in_for_inits? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
+// options.put(CodeFormatterConstants.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(CodeFormatterConstants.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(CodeFormatterConstants.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(CodeFormatterConstants.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(CodeFormatterConstants.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(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_SUPERINTERFACES, this.insert_space_before_comma_in_superinterfaces? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
+// options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_TYPE_ARGUMENTS, this.insert_space_before_comma_in_type_arguments ? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
+// options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_TYPE_PARAMETERS, this.insert_space_before_comma_in_type_parameters? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
+// options.put(CodeFormatterConstants.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(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_ELLIPSIS, this.insert_space_before_ellipsis ? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
+// options.put(CodeFormatterConstants.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(CodeFormatterConstants.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(CodeFormatterConstants.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(CodeFormatterConstants.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(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACE_IN_BLOCK, this.insert_space_before_opening_brace_in_block? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
+// options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACE_IN_CONSTRUCTOR_DECLARATION, this.insert_space_before_opening_brace_in_constructor_declaration? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
+// options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACE_IN_ENUM_CONSTANT, this.insert_space_before_opening_brace_in_enum_constant? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
+// options.put(CodeFormatterConstants.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(CodeFormatterConstants.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(CodeFormatterConstants.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(CodeFormatterConstants.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(CodeFormatterConstants.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(CodeFormatterConstants.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(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_CATCH, this.insert_space_before_opening_paren_in_catch? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
+// options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_CONSTRUCTOR_DECLARATION, this.insert_space_before_opening_paren_in_constructor_declaration? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
+// options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_ENUM_CONSTANT, this.insert_space_before_opening_paren_in_enum_constant? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
+// options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_FOR, this.insert_space_before_opening_paren_in_for? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
+// options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_IF, this.insert_space_before_opening_paren_in_if? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
+// options.put(CodeFormatterConstants.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(CodeFormatterConstants.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(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_SWITCH, this.insert_space_before_opening_paren_in_switch? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
+// options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACE_IN_SWITCH, this.insert_space_before_opening_brace_in_switch? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
+// options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_SYNCHRONIZED, this.insert_space_before_opening_paren_in_synchronized? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
+// options.put(CodeFormatterConstants.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(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_WHILE, this.insert_space_before_opening_paren_in_while? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
+// options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_PARENTHESIZED_EXPRESSION_IN_RETURN, this.insert_space_before_parenthesized_expression_in_return ? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
+// options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_POSTFIX_OPERATOR, this.insert_space_before_postfix_operator? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
+// options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_PREFIX_OPERATOR, this.insert_space_before_prefix_operator? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
+// options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_QUESTION_IN_CONDITIONAL, this.insert_space_before_question_in_conditional? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
+// options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_QUESTION_IN_WILDCARD, this.insert_space_before_question_in_wilcard? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
+// options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_SEMICOLON, this.insert_space_before_semicolon? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
+// options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_SEMICOLON_IN_FOR, this.insert_space_before_semicolon_in_for? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
+// options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_UNARY_OPERATOR, this.insert_space_before_unary_operator? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
+// options.put(CodeFormatterConstants.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(CodeFormatterConstants.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(CodeFormatterConstants.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(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BETWEEN_EMPTY_PARENS_IN_CONSTRUCTOR_DECLARATION, this.insert_space_between_empty_parens_in_constructor_declaration? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
+// options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BETWEEN_EMPTY_PARENS_IN_ENUM_CONSTANT, this.insert_space_between_empty_parens_in_enum_constant? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
+// options.put(CodeFormatterConstants.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(CodeFormatterConstants.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(CodeFormatterConstants.FORMATTER_COMPACT_ELSE_IF, this.compact_else_if ? CodeFormatterConstants.TRUE : CodeFormatterConstants.FALSE);
+// options.put(CodeFormatterConstants.FORMATTER_KEEP_GUARDIAN_CLAUSE_ON_ONE_LINE, this.keep_guardian_clause_on_one_line ? CodeFormatterConstants.TRUE : CodeFormatterConstants.FALSE);
+// options.put(CodeFormatterConstants.FORMATTER_KEEP_ELSE_STATEMENT_ON_SAME_LINE, this.keep_else_statement_on_same_line ? CodeFormatterConstants.TRUE : CodeFormatterConstants.FALSE);
+// options.put(CodeFormatterConstants.FORMATTER_KEEP_EMPTY_ARRAY_INITIALIZER_ON_ONE_LINE, this.keep_empty_array_initializer_on_one_line ? CodeFormatterConstants.TRUE : CodeFormatterConstants.FALSE);
+// options.put(CodeFormatterConstants.FORMATTER_KEEP_SIMPLE_IF_ON_ONE_LINE, this.keep_simple_if_on_one_line ? CodeFormatterConstants.TRUE : CodeFormatterConstants.FALSE);
+// options.put(CodeFormatterConstants.FORMATTER_KEEP_THEN_STATEMENT_ON_SAME_LINE, this.keep_then_statement_on_same_line ? CodeFormatterConstants.TRUE : CodeFormatterConstants.FALSE);
+// options.put(CodeFormatterConstants.FORMATTER_NUMBER_OF_EMPTY_LINES_TO_PRESERVE, Integer.toString(this.number_of_empty_lines_to_preserve));
+// options.put(CodeFormatterConstants.FORMATTER_PUT_EMPTY_STATEMENT_ON_NEW_LINE, this.put_empty_statement_on_new_line ? CodeFormatterConstants.TRUE : CodeFormatterConstants.FALSE);
+// options.put(CodeFormatterConstants.FORMATTER_LINE_SPLIT, Integer.toString(this.page_width));
+ switch(this.tab_char) {
+ case SPACE :
+ options.put(CodeFormatterConstants.FORMATTER_TAB_CHAR, CCorePlugin.SPACE);
+ break;
+ case TAB :
+ options.put(CodeFormatterConstants.FORMATTER_TAB_CHAR, CCorePlugin.TAB);
+ break;
+ case MIXED :
+ options.put(CodeFormatterConstants.FORMATTER_TAB_CHAR, CodeFormatterConstants.MIXED);
+ break;
+ }
+ options.put(CodeFormatterConstants.FORMATTER_TAB_SIZE, Integer.toString(this.tab_size));
+ options.put(CodeFormatterConstants.FORMATTER_USE_TABS_ONLY_FOR_LEADING_INDENTATIONS, this.use_tabs_only_for_leading_indentations ? CodeFormatterConstants.TRUE : CodeFormatterConstants.FALSE);
+ return options;
+ }
+
+ public void set(Map settings) {
+ final Object alignmentForArgumentsInAllocationExpressionOption = settings.get(CodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_ARGUMENTS_IN_ALLOCATION_EXPRESSION);
+ if (alignmentForArgumentsInAllocationExpressionOption != null) {
+ try {
+ this.alignment_for_arguments_in_allocation_expression = Integer.parseInt((String) alignmentForArgumentsInAllocationExpressionOption);
+ } catch (NumberFormatException e) {
+ this.alignment_for_arguments_in_allocation_expression = Alignment.M_COMPACT_SPLIT;
+ } catch (ClassCastException e) {
+ this.alignment_for_arguments_in_allocation_expression = Alignment.M_COMPACT_SPLIT;
+ }
+ }
+ final Object alignmentForArgumentsInEnumConstantOption = settings.get(CodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_ARGUMENTS_IN_ENUM_CONSTANT);
+ if (alignmentForArgumentsInEnumConstantOption != null) {
+ try {
+ this.alignment_for_arguments_in_enum_constant = Integer.parseInt((String) alignmentForArgumentsInEnumConstantOption);
+ } catch (NumberFormatException e) {
+ this.alignment_for_arguments_in_enum_constant = Alignment.M_COMPACT_SPLIT;
+ } catch (ClassCastException e) {
+ this.alignment_for_arguments_in_enum_constant = Alignment.M_COMPACT_SPLIT;
+ }
+ }
+ final Object alignmentForArgumentsInExplicitConstructorCallOption = settings.get(CodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_ARGUMENTS_IN_EXPLICIT_CONSTRUCTOR_CALL);
+ if (alignmentForArgumentsInExplicitConstructorCallOption != null) {
+ try {
+ this.alignment_for_arguments_in_explicit_constructor_call = Integer.parseInt((String) alignmentForArgumentsInExplicitConstructorCallOption);
+ } catch (NumberFormatException e) {
+ this.alignment_for_arguments_in_explicit_constructor_call = Alignment.M_COMPACT_SPLIT;
+ } catch (ClassCastException e) {
+ this.alignment_for_arguments_in_explicit_constructor_call = Alignment.M_COMPACT_SPLIT;
+ }
+ }
+ final Object alignmentForArgumentsInMethodInvocationOption = settings.get(CodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_ARGUMENTS_IN_METHOD_INVOCATION);
+ if (alignmentForArgumentsInMethodInvocationOption != null) {
+ try {
+ this.alignment_for_arguments_in_method_invocation = Integer.parseInt((String) alignmentForArgumentsInMethodInvocationOption);
+ } catch (NumberFormatException e) {
+ this.alignment_for_arguments_in_method_invocation = Alignment.M_COMPACT_SPLIT;
+ } catch (ClassCastException e) {
+ this.alignment_for_arguments_in_method_invocation = Alignment.M_COMPACT_SPLIT;
+ }
+ }
+ final Object alignmentForArgumentsInQualifiedAllocationExpressionOption = settings.get(CodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_ARGUMENTS_IN_QUALIFIED_ALLOCATION_EXPRESSION);
+ if (alignmentForArgumentsInQualifiedAllocationExpressionOption != null) {
+ try {
+ this.alignment_for_arguments_in_qualified_allocation_expression = Integer.parseInt((String) alignmentForArgumentsInQualifiedAllocationExpressionOption);
+ } catch (NumberFormatException e) {
+ this.alignment_for_arguments_in_qualified_allocation_expression = Alignment.M_COMPACT_SPLIT;
+ } catch (ClassCastException e) {
+ this.alignment_for_arguments_in_qualified_allocation_expression = Alignment.M_COMPACT_SPLIT;
+ }
+ }
+ final Object alignmentForAssignmentOption = settings.get(CodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_ASSIGNMENT);
+ if (alignmentForAssignmentOption != null) {
+ try {
+ this.alignment_for_assignment = Integer.parseInt((String) alignmentForAssignmentOption);
+ } catch (NumberFormatException e) {
+ this.alignment_for_assignment = Alignment.M_ONE_PER_LINE_SPLIT;
+ } catch (ClassCastException e) {
+ this.alignment_for_assignment = Alignment.M_ONE_PER_LINE_SPLIT;
+ }
+ }
+ final Object alignmentForBinaryExpressionOption = settings.get(CodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_BINARY_EXPRESSION);
+ if (alignmentForBinaryExpressionOption != null) {
+ try {
+ this.alignment_for_binary_expression = Integer.parseInt((String) alignmentForBinaryExpressionOption);
+ } catch (NumberFormatException e) {
+ this.alignment_for_binary_expression = Alignment.M_COMPACT_SPLIT;
+ } catch (ClassCastException e) {
+ this.alignment_for_binary_expression = Alignment.M_COMPACT_SPLIT;
+ }
+ }
+ final Object alignmentForCompactIfOption = settings.get(CodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_COMPACT_IF);
+ if (alignmentForCompactIfOption != null) {
+ try {
+ this.alignment_for_compact_if = Integer.parseInt((String) alignmentForCompactIfOption);
+ } catch (NumberFormatException e) {
+ this.alignment_for_compact_if = Alignment.M_ONE_PER_LINE_SPLIT | Alignment.M_INDENT_BY_ONE;
+ } catch (ClassCastException e) {
+ this.alignment_for_compact_if = Alignment.M_ONE_PER_LINE_SPLIT | Alignment.M_INDENT_BY_ONE;
+ }
+ }
+ final Object alignmentForConditionalExpressionOption = settings.get(CodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_CONDITIONAL_EXPRESSION);
+ if (alignmentForConditionalExpressionOption != null) {
+ try {
+ this.alignment_for_conditional_expression = Integer.parseInt((String) alignmentForConditionalExpressionOption);
+ } catch (NumberFormatException e) {
+ this.alignment_for_conditional_expression = Alignment.M_ONE_PER_LINE_SPLIT;
+ } catch (ClassCastException e) {
+ this.alignment_for_conditional_expression = Alignment.M_ONE_PER_LINE_SPLIT;
+ }
+ }
+ final Object alignmentForEnumConstantsOption = settings.get(CodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_ENUM_CONSTANTS);
+ if (alignmentForEnumConstantsOption != null) {
+ try {
+ this.alignment_for_enum_constants = Integer.parseInt((String) alignmentForEnumConstantsOption);
+ } catch (NumberFormatException e) {
+ this.alignment_for_enum_constants = Alignment.NONE;
+ } catch (ClassCastException e) {
+ this.alignment_for_enum_constants = Alignment.NONE;
+ }
+ }
+ final Object alignmentForExpressionsInArrayInitializerOption = settings.get(CodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_EXPRESSIONS_IN_ARRAY_INITIALIZER);
+ if (alignmentForExpressionsInArrayInitializerOption != null) {
+ try {
+ this.alignment_for_expressions_in_array_initializer = Integer.parseInt((String) alignmentForExpressionsInArrayInitializerOption);
+ } catch (NumberFormatException e) {
+ this.alignment_for_expressions_in_array_initializer = Alignment.M_COMPACT_SPLIT;
+ } catch (ClassCastException e) {
+ this.alignment_for_expressions_in_array_initializer = Alignment.M_COMPACT_SPLIT;
+ }
+ }
+ final Object alignmentForMultipleFieldsOption = settings.get(CodeFormatterConstants.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 alignmentForParametersInConstructorDeclarationOption = settings.get(CodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_PARAMETERS_IN_CONSTRUCTOR_DECLARATION);
+ if (alignmentForParametersInConstructorDeclarationOption != null) {
+ try {
+ this.alignment_for_parameters_in_constructor_declaration = Integer.parseInt((String) alignmentForParametersInConstructorDeclarationOption);
+ } catch (NumberFormatException e) {
+ this.alignment_for_parameters_in_constructor_declaration = Alignment.M_COMPACT_SPLIT;
+ } catch (ClassCastException e) {
+ this.alignment_for_parameters_in_constructor_declaration = Alignment.M_COMPACT_SPLIT;
+ }
+ }
+ final Object alignmentForParametersInMethodDeclarationOption = settings.get(CodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_PARAMETERS_IN_METHOD_DECLARATION);
+ if (alignmentForParametersInMethodDeclarationOption != null) {
+ try {
+ this.alignment_for_parameters_in_method_declaration = Integer.parseInt((String) alignmentForParametersInMethodDeclarationOption);
+ } catch (NumberFormatException e) {
+ this.alignment_for_parameters_in_method_declaration = Alignment.M_COMPACT_SPLIT;
+ } catch(ClassCastException e) {
+ this.alignment_for_parameters_in_method_declaration = Alignment.M_COMPACT_SPLIT;
+ }
+ }
+ final Object alignmentForSelectorInMethodInvocationOption = settings.get(CodeFormatterConstants.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(CodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_SUPERCLASS_IN_TYPE_DECLARATION);
+ if (alignmentForSuperclassInTypeDeclarationOption != null) {
+ try {
+ this.alignment_for_superclass_in_type_declaration = Integer.parseInt((String) alignmentForSuperclassInTypeDeclarationOption);
+ } catch (NumberFormatException e) {
+ this.alignment_for_superclass_in_type_declaration = Alignment.M_NEXT_SHIFTED_SPLIT;
+ } catch(ClassCastException e) {
+ this.alignment_for_superclass_in_type_declaration = Alignment.M_NEXT_SHIFTED_SPLIT;
+ }
+ }
+ final Object alignmentForSuperinterfacesInEnumDeclarationOption = settings.get(CodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_SUPERINTERFACES_IN_ENUM_DECLARATION);
+ if (alignmentForSuperinterfacesInEnumDeclarationOption != null) {
+ try {
+ this.alignment_for_superinterfaces_in_enum_declaration = Integer.parseInt((String) alignmentForSuperinterfacesInEnumDeclarationOption);
+ } catch (NumberFormatException e) {
+ this.alignment_for_superinterfaces_in_enum_declaration = Alignment.M_NEXT_SHIFTED_SPLIT;
+ } catch(ClassCastException e) {
+ this.alignment_for_superinterfaces_in_enum_declaration = Alignment.M_NEXT_SHIFTED_SPLIT;
+ }
+ }
+ final Object alignmentForSuperinterfacesInTypeDeclarationOption = settings.get(CodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_SUPERINTERFACES_IN_TYPE_DECLARATION);
+ if (alignmentForSuperinterfacesInTypeDeclarationOption != null) {
+ try {
+ this.alignment_for_superinterfaces_in_type_declaration = Integer.parseInt((String) alignmentForSuperinterfacesInTypeDeclarationOption);
+ } catch (NumberFormatException e) {
+ this.alignment_for_superinterfaces_in_type_declaration = Alignment.M_NEXT_SHIFTED_SPLIT;
+ } catch(ClassCastException e) {
+ this.alignment_for_superinterfaces_in_type_declaration = Alignment.M_NEXT_SHIFTED_SPLIT;
+ }
+ }
+ final Object alignmentForThrowsClauseInConstructorDeclarationOption = settings.get(CodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_THROWS_CLAUSE_IN_CONSTRUCTOR_DECLARATION);
+ if (alignmentForThrowsClauseInConstructorDeclarationOption != null) {
+ try {
+ this.alignment_for_throws_clause_in_constructor_declaration = Integer.parseInt((String) alignmentForThrowsClauseInConstructorDeclarationOption);
+ } catch (NumberFormatException e) {
+ this.alignment_for_throws_clause_in_constructor_declaration = Alignment.M_COMPACT_SPLIT;
+ } catch(ClassCastException e) {
+ this.alignment_for_throws_clause_in_constructor_declaration = Alignment.M_COMPACT_SPLIT;
+ }
+ }
+ final Object alignmentForThrowsClauseInMethodDeclarationOption = settings.get(CodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_THROWS_CLAUSE_IN_METHOD_DECLARATION);
+ if (alignmentForThrowsClauseInMethodDeclarationOption != null) {
+ try {
+ this.alignment_for_throws_clause_in_method_declaration = Integer.parseInt((String) alignmentForThrowsClauseInMethodDeclarationOption);
+ } catch (NumberFormatException e) {
+ this.alignment_for_throws_clause_in_method_declaration = Alignment.M_COMPACT_SPLIT;
+ } catch(ClassCastException e) {
+ this.alignment_for_throws_clause_in_method_declaration = Alignment.M_COMPACT_SPLIT;
+ }
+ }
+ final Object alignTypeMembersOnColumnsOption = settings.get(CodeFormatterConstants.FORMATTER_ALIGN_TYPE_MEMBERS_ON_COLUMNS);
+ if (alignTypeMembersOnColumnsOption != null) {
+ this.align_type_members_on_columns = CodeFormatterConstants.TRUE.equals(alignTypeMembersOnColumnsOption);
+ }
+ final Object bracePositionForArrayInitializerOption = settings.get(CodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ARRAY_INITIALIZER);
+ if (bracePositionForArrayInitializerOption != null) {
+ try {
+ this.brace_position_for_array_initializer = (String) bracePositionForArrayInitializerOption;
+ } catch(ClassCastException e) {
+ this.brace_position_for_array_initializer = CodeFormatterConstants.END_OF_LINE;
+ }
+ }
+ final Object bracePositionForBlockOption = settings.get(CodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK);
+ if (bracePositionForBlockOption != null) {
+ try {
+ this.brace_position_for_block = (String) bracePositionForBlockOption;
+ } catch(ClassCastException e) {
+ this.brace_position_for_block = CodeFormatterConstants.END_OF_LINE;
+ }
+ }
+ final Object bracePositionForBlockInCaseOption = settings.get(CodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK_IN_CASE);
+ if (bracePositionForBlockInCaseOption != null) {
+ try {
+ this.brace_position_for_block_in_case = (String) bracePositionForBlockInCaseOption;
+ } catch(ClassCastException e) {
+ this.brace_position_for_block_in_case = CodeFormatterConstants.END_OF_LINE;
+ }
+ }
+ final Object bracePositionForConstructorDeclarationOption = settings.get(CodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION);
+ if (bracePositionForConstructorDeclarationOption != null) {
+ try {
+ this.brace_position_for_constructor_declaration = (String) bracePositionForConstructorDeclarationOption;
+ } catch(ClassCastException e) {
+ this.brace_position_for_constructor_declaration = CodeFormatterConstants.END_OF_LINE;
+ }
+ }
+ final Object bracePositionForEnumConstantOption = settings.get(CodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ENUM_CONSTANT);
+ if (bracePositionForEnumConstantOption != null) {
+ try {
+ this.brace_position_for_enum_constant = (String) bracePositionForEnumConstantOption;
+ } catch(ClassCastException e) {
+ this.brace_position_for_enum_constant = CodeFormatterConstants.END_OF_LINE;
+ }
+ }
+ final Object bracePositionForEnumDeclarationOption = settings.get(CodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ENUM_DECLARATION);
+ if (bracePositionForEnumDeclarationOption != null) {
+ try {
+ this.brace_position_for_enum_declaration = (String) bracePositionForEnumDeclarationOption;
+ } catch(ClassCastException e) {
+ this.brace_position_for_enum_declaration = CodeFormatterConstants.END_OF_LINE;
+ }
+ }
+ final Object bracePositionForMethodDeclarationOption = settings.get(CodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION);
+ if (bracePositionForMethodDeclarationOption != null) {
+ try {
+ this.brace_position_for_method_declaration = (String) bracePositionForMethodDeclarationOption;
+ } catch(ClassCastException e) {
+ this.brace_position_for_method_declaration = CodeFormatterConstants.END_OF_LINE;
+ }
+ }
+ final Object bracePositionForSwitchOption = settings.get(CodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH);
+ if (bracePositionForSwitchOption != null) {
+ try {
+ this.brace_position_for_switch = (String) bracePositionForSwitchOption;
+ } catch(ClassCastException e) {
+ this.brace_position_for_switch = CodeFormatterConstants.END_OF_LINE;
+ }
+ }
+ final Object bracePositionForTypeDeclarationOption = settings.get(CodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION);
+ if (bracePositionForTypeDeclarationOption != null) {
+ try {
+ this.brace_position_for_type_declaration = (String) bracePositionForTypeDeclarationOption;
+ } catch(ClassCastException e) {
+ this.brace_position_for_type_declaration = CodeFormatterConstants.END_OF_LINE;
+ }
+ }
+ final Object continuationIndentationOption = settings.get(CodeFormatterConstants.FORMATTER_CONTINUATION_INDENTATION);
+ if (continuationIndentationOption != null) {
+ try {
+ this.continuation_indentation = Integer.parseInt((String) continuationIndentationOption);
+ } catch (NumberFormatException e) {
+ this.continuation_indentation = 2;
+ } catch(ClassCastException e) {
+ this.continuation_indentation = 2;
+ }
+ }
+ final Object continuationIndentationForArrayInitializerOption = settings.get(CodeFormatterConstants.FORMATTER_CONTINUATION_INDENTATION_FOR_ARRAY_INITIALIZER);
+ if (continuationIndentationForArrayInitializerOption != null) {
+ try {
+ this.continuation_indentation_for_array_initializer = Integer.parseInt((String) continuationIndentationForArrayInitializerOption);
+ } catch (NumberFormatException e) {
+ this.continuation_indentation_for_array_initializer = 2;
+ } catch(ClassCastException e) {
+ this.continuation_indentation_for_array_initializer = 2;
+ }
+ }
+// final Object blankLinesAfterImportsOption = settings.get(CodeFormatterConstants.FORMATTER_BLANK_LINES_AFTER_IMPORTS);
+// if (blankLinesAfterImportsOption != null) {
+// try {
+// this.blank_lines_after_imports = Integer.parseInt((String) blankLinesAfterImportsOption);
+// } catch (NumberFormatException e) {
+// this.blank_lines_after_imports = 0;
+// } catch(ClassCastException e) {
+// this.blank_lines_after_imports = 0;
+// }
+// }
+// final Object blankLinesAfterPackageOption = settings.get(CodeFormatterConstants.FORMATTER_BLANK_LINES_AFTER_PACKAGE);
+// if (blankLinesAfterPackageOption != null) {
+// try {
+// this.blank_lines_after_package = Integer.parseInt((String) blankLinesAfterPackageOption);
+// } catch (NumberFormatException e) {
+// this.blank_lines_after_package = 0;
+// } catch(ClassCastException e) {
+// this.blank_lines_after_package = 0;
+// }
+// }
+// final Object blankLinesBeforeFieldOption = settings.get(CodeFormatterConstants.FORMATTER_BLANK_LINES_BEFORE_FIELD);
+// if (blankLinesBeforeFieldOption != null) {
+// try {
+// this.blank_lines_before_field = Integer.parseInt((String) blankLinesBeforeFieldOption);
+// } catch (NumberFormatException e) {
+// this.blank_lines_before_field = 0;
+// } catch(ClassCastException e) {
+// this.blank_lines_before_field = 0;
+// }
+// }
+// final Object blankLinesBeforeFirstClassBodyDeclarationOption = settings.get(CodeFormatterConstants.FORMATTER_BLANK_LINES_BEFORE_FIRST_CLASS_BODY_DECLARATION);
+// if (blankLinesBeforeFirstClassBodyDeclarationOption != null) {
+// try {
+// this.blank_lines_before_first_class_body_declaration = Integer.parseInt((String) blankLinesBeforeFirstClassBodyDeclarationOption);
+// } catch (NumberFormatException e) {
+// this.blank_lines_before_first_class_body_declaration = 0;
+// } catch(ClassCastException e) {
+// this.blank_lines_before_first_class_body_declaration = 0;
+// }
+// }
+// final Object blankLinesBeforeImportsOption = settings.get(CodeFormatterConstants.FORMATTER_BLANK_LINES_BEFORE_IMPORTS);
+// if (blankLinesBeforeImportsOption != null) {
+// try {
+// this.blank_lines_before_imports = Integer.parseInt((String) blankLinesBeforeImportsOption);
+// } catch (NumberFormatException e) {
+// this.blank_lines_before_imports = 0;
+// } catch(ClassCastException e) {
+// this.blank_lines_before_imports = 0;
+// }
+// }
+// final Object blankLinesBeforeMemberTypeOption = settings.get(CodeFormatterConstants.FORMATTER_BLANK_LINES_BEFORE_MEMBER_TYPE);
+// if (blankLinesBeforeMemberTypeOption != null) {
+// try {
+// this.blank_lines_before_member_type = Integer.parseInt((String) blankLinesBeforeMemberTypeOption);
+// } catch (NumberFormatException e) {
+// this.blank_lines_before_member_type = 0;
+// } catch(ClassCastException e) {
+// this.blank_lines_before_member_type = 0;
+// }
+// }
+// final Object blankLinesBeforeMethodOption = settings.get(CodeFormatterConstants.FORMATTER_BLANK_LINES_BEFORE_METHOD);
+// if (blankLinesBeforeMethodOption != null) {
+// try {
+// this.blank_lines_before_method = Integer.parseInt((String) blankLinesBeforeMethodOption);
+// } catch (NumberFormatException e) {
+// this.blank_lines_before_method = 0;
+// } catch(ClassCastException e) {
+// this.blank_lines_before_method = 0;
+// }
+// }
+// final Object blankLinesBeforeNewChunkOption = settings.get(CodeFormatterConstants.FORMATTER_BLANK_LINES_BEFORE_NEW_CHUNK);
+// if (blankLinesBeforeNewChunkOption != null) {
+// try {
+// this.blank_lines_before_new_chunk = Integer.parseInt((String) blankLinesBeforeNewChunkOption);
+// } catch (NumberFormatException e) {
+// this.blank_lines_before_new_chunk = 0;
+// } catch(ClassCastException e) {
+// this.blank_lines_before_new_chunk = 0;
+// }
+// }
+// final Object blankLinesBeforePackageOption = settings.get(CodeFormatterConstants.FORMATTER_BLANK_LINES_BEFORE_PACKAGE);
+// if (blankLinesBeforePackageOption != null) {
+// try {
+// this.blank_lines_before_package = Integer.parseInt((String) blankLinesBeforePackageOption);
+// } catch (NumberFormatException e) {
+// this.blank_lines_before_package = 0;
+// } catch(ClassCastException e) {
+// this.blank_lines_before_package = 0;
+// }
+// }
+// final Object blankLinesBetweenTypeDeclarationsOption = settings.get(CodeFormatterConstants.FORMATTER_BLANK_LINES_BETWEEN_TYPE_DECLARATIONS);
+// if (blankLinesBetweenTypeDeclarationsOption != null) {
+// try {
+// this.blank_lines_between_type_declarations = Integer.parseInt((String) blankLinesBetweenTypeDeclarationsOption);
+// } catch (NumberFormatException e) {
+// this.blank_lines_between_type_declarations = 0;
+// } catch(ClassCastException e) {
+// this.blank_lines_between_type_declarations = 0;
+// }
+// }
+// final Object blankLinesAtBeginningOfMethodBodyOption = settings.get(CodeFormatterConstants.FORMATTER_BLANK_LINES_AT_BEGINNING_OF_METHOD_BODY);
+// if (blankLinesAtBeginningOfMethodBodyOption != null) {
+// try {
+// this.blank_lines_at_beginning_of_method_body = Integer.parseInt((String) blankLinesAtBeginningOfMethodBodyOption);
+// } catch (NumberFormatException e) {
+// this.blank_lines_at_beginning_of_method_body = 0;
+// } catch(ClassCastException e) {
+// this.blank_lines_at_beginning_of_method_body = 0;
+// }
+// }
+// final Object commentClearBlankLinesOption = settings.get(CodeFormatterConstants.FORMATTER_COMMENT_CLEAR_BLANK_LINES);
+// if (commentClearBlankLinesOption != null) {
+// this.comment_clear_blank_lines = CodeFormatterConstants.TRUE.equals(commentClearBlankLinesOption);
+// }
+// final Object commentFormatOption = settings.get(CodeFormatterConstants.FORMATTER_COMMENT_FORMAT);
+// if (commentFormatOption != null) {
+// this.comment_format = CodeFormatterConstants.TRUE.equals(commentFormatOption);
+// }
+// final Object commentFormatHeaderOption = settings.get(CodeFormatterConstants.FORMATTER_COMMENT_FORMAT_HEADER);
+// if (commentFormatHeaderOption != null) {
+// this.comment_format_header = CodeFormatterConstants.TRUE.equals(commentFormatHeaderOption);
+// }
+// final Object commentFormatHtmlOption = settings.get(CodeFormatterConstants.FORMATTER_COMMENT_FORMAT_HTML);
+// if (commentFormatHtmlOption != null) {
+// this.comment_format_html = CodeFormatterConstants.TRUE.equals(commentFormatHtmlOption);
+// }
+// final Object commentFormatSourceOption = settings.get(CodeFormatterConstants.FORMATTER_COMMENT_FORMAT_SOURCE);
+// if (commentFormatSourceOption != null) {
+// this.comment_format_source = CodeFormatterConstants.TRUE.equals(commentFormatSourceOption);
+// }
+// final Object commentLineLengthOption = settings.get(CodeFormatterConstants.FORMATTER_COMMENT_LINE_LENGTH);
+// if (commentLineLengthOption != null) {
+// try {
+// this.comment_line_length = Integer.parseInt((String) commentLineLengthOption);
+// } catch (NumberFormatException e) {
+// this.comment_line_length = 80;
+// } catch(ClassCastException e) {
+// this.comment_line_length = 80;
+// }
+// }
+ final Object indentStatementsCompareToBlockOption = settings.get(CodeFormatterConstants.FORMATTER_INDENT_STATEMENTS_COMPARE_TO_BLOCK);
+ if (indentStatementsCompareToBlockOption != null) {
+ this.indent_statements_compare_to_block = CodeFormatterConstants.TRUE.equals(indentStatementsCompareToBlockOption);
+ }
+ final Object indentStatementsCompareToBodyOption = settings.get(CodeFormatterConstants.FORMATTER_INDENT_STATEMENTS_COMPARE_TO_BODY);
+ if (indentStatementsCompareToBodyOption != null) {
+ this.indent_statements_compare_to_body = CodeFormatterConstants.TRUE.equals(indentStatementsCompareToBodyOption);
+ }
+ final Object indentBodyDeclarationsCompareToEnumConstantHeaderOption = settings.get(CodeFormatterConstants.FORMATTER_INDENT_BODY_DECLARATIONS_COMPARE_TO_ENUM_CONSTANT_HEADER);
+ if (indentBodyDeclarationsCompareToEnumConstantHeaderOption != null) {
+ this.indent_body_declarations_compare_to_enum_constant_header = CodeFormatterConstants.TRUE.equals(indentBodyDeclarationsCompareToEnumConstantHeaderOption);
+ }
+ final Object indentBodyDeclarationsCompareToEnumDeclarationHeaderOption = settings.get(CodeFormatterConstants.FORMATTER_INDENT_BODY_DECLARATIONS_COMPARE_TO_ENUM_DECLARATION_HEADER);
+ if (indentBodyDeclarationsCompareToEnumDeclarationHeaderOption != null) {
+ this.indent_body_declarations_compare_to_enum_declaration_header = CodeFormatterConstants.TRUE.equals(indentBodyDeclarationsCompareToEnumDeclarationHeaderOption);
+ }
+ final Object indentBodyDeclarationsCompareToTypeHeaderOption = settings.get(CodeFormatterConstants.FORMATTER_INDENT_BODY_DECLARATIONS_COMPARE_TO_TYPE_HEADER);
+ if (indentBodyDeclarationsCompareToTypeHeaderOption != null) {
+ this.indent_body_declarations_compare_to_type_header = CodeFormatterConstants.TRUE.equals(indentBodyDeclarationsCompareToTypeHeaderOption);
+ }
+ final Object indentBreaksCompareToCasesOption = settings.get(CodeFormatterConstants.FORMATTER_INDENT_BREAKS_COMPARE_TO_CASES);
+ if (indentBreaksCompareToCasesOption != null) {
+ this.indent_breaks_compare_to_cases = CodeFormatterConstants.TRUE.equals(indentBreaksCompareToCasesOption);
+ }
+ final Object indentEmptyLinesOption = settings.get(CodeFormatterConstants.FORMATTER_INDENT_EMPTY_LINES);
+ if (indentEmptyLinesOption != null) {
+ this.indent_empty_lines = CodeFormatterConstants.TRUE.equals(indentEmptyLinesOption);
+ }
+ final Object indentSwitchstatementsCompareToCasesOption = settings.get(CodeFormatterConstants.FORMATTER_INDENT_SWITCHSTATEMENTS_COMPARE_TO_CASES);
+ if (indentSwitchstatementsCompareToCasesOption != null) {
+ this.indent_switchstatements_compare_to_cases = CodeFormatterConstants.TRUE.equals(indentSwitchstatementsCompareToCasesOption);
+ }
+ final Object indentSwitchstatementsCompareToSwitchOption = settings.get(CodeFormatterConstants.FORMATTER_INDENT_SWITCHSTATEMENTS_COMPARE_TO_SWITCH);
+ if (indentSwitchstatementsCompareToSwitchOption != null) {
+ this.indent_switchstatements_compare_to_switch = CodeFormatterConstants.TRUE.equals(indentSwitchstatementsCompareToSwitchOption);
+ }
+ final Object indentationSizeOption = settings.get(CodeFormatterConstants.FORMATTER_INDENTATION_SIZE);
+ if (indentationSizeOption != null) {
+ try {
+ this.indentation_size = Integer.parseInt((String) indentationSizeOption);
+ } catch (NumberFormatException e) {
+ this.indentation_size = 4;
+ } catch(ClassCastException e) {
+ this.indentation_size = 4;
+ }
+ }
+// final Object insertNewLineAfterOpeningBraceInArrayInitializerOption = settings.get(CodeFormatterConstants.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 insertNewLineAtEndOfFileIfMissingOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_AT_END_OF_FILE_IF_MISSING);
+// if (insertNewLineAtEndOfFileIfMissingOption != null) {
+// this.insert_new_line_at_end_of_file_if_missing = CCorePlugin.INSERT.equals(insertNewLineAtEndOfFileIfMissingOption);
+// }
+// final Object insertNewLineBeforeCatchInTryStatementOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT);
+// if (insertNewLineBeforeCatchInTryStatementOption != null) {
+// this.insert_new_line_before_catch_in_try_statement = CCorePlugin.INSERT.equals(insertNewLineBeforeCatchInTryStatementOption);
+// }
+// final Object insertNewLineBeforeClosingBraceInArrayInitializerOption = settings.get(CodeFormatterConstants.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 insertNewLineBeforeElseInIfStatementOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT);
+// if (insertNewLineBeforeElseInIfStatementOption != null) {
+// this.insert_new_line_before_else_in_if_statement = CCorePlugin.INSERT.equals(insertNewLineBeforeElseInIfStatementOption);
+// }
+// final Object insertNewLineBeforeFinallyInTryStatementOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT);
+// if (insertNewLineBeforeFinallyInTryStatementOption != null) {
+// this.insert_new_line_before_finally_in_try_statement = CCorePlugin.INSERT.equals(insertNewLineBeforeFinallyInTryStatementOption);
+// }
+// final Object insertNewLineBeforeWhileInDoStatementOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT);
+// if (insertNewLineBeforeWhileInDoStatementOption != null) {
+// this.insert_new_line_before_while_in_do_statement = CCorePlugin.INSERT.equals(insertNewLineBeforeWhileInDoStatementOption);
+// }
+// final Object insertNewLineInEmptyBlockOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_IN_EMPTY_BLOCK);
+// if (insertNewLineInEmptyBlockOption != null) {
+// this.insert_new_line_in_empty_block = CCorePlugin.INSERT.equals(insertNewLineInEmptyBlockOption);
+// }
+// final Object insertNewLineInEmptyEnumConstantOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_IN_EMPTY_ENUM_CONSTANT);
+// if (insertNewLineInEmptyEnumConstantOption != null) {
+// this.insert_new_line_in_empty_enum_constant = CCorePlugin.INSERT.equals(insertNewLineInEmptyEnumConstantOption);
+// }
+// final Object insertNewLineInEmptyEnumDeclarationOption = settings.get(CodeFormatterConstants.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(CodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_IN_EMPTY_METHOD_BODY);
+// if (insertNewLineInEmptyMethodBodyOption != null) {
+// this.insert_new_line_in_empty_method_body = CCorePlugin.INSERT.equals(insertNewLineInEmptyMethodBodyOption);
+// }
+// final Object insertNewLineInEmptyTypeDeclarationOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_IN_EMPTY_TYPE_DECLARATION);
+// if (insertNewLineInEmptyTypeDeclarationOption != null) {
+// this.insert_new_line_in_empty_type_declaration = CCorePlugin.INSERT.equals(insertNewLineInEmptyTypeDeclarationOption);
+// }
+// final Object insertSpaceAfterAndInWildcardOption = settings.get(CodeFormatterConstants.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(CodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_ASSIGNMENT_OPERATOR);
+// if (insertSpaceAfterAssignmentOperatorOption != null) {
+// this.insert_space_after_assignment_operator = CCorePlugin.INSERT.equals(insertSpaceAfterAssignmentOperatorOption);
+// }
+// final Object insertSpaceAfterBinaryOperatorOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_BINARY_OPERATOR);
+// if (insertSpaceAfterBinaryOperatorOption != null) {
+// this.insert_space_after_binary_operator = CCorePlugin.INSERT.equals(insertSpaceAfterBinaryOperatorOption);
+// }
+// final Object insertSpaceAfterClosingAngleBracketInTypeArgumentsOption = settings.get(CodeFormatterConstants.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(CodeFormatterConstants.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(CodeFormatterConstants.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(CodeFormatterConstants.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 insertSpaceAfterColonInAssertOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COLON_IN_ASSERT);
+// if (insertSpaceAfterColonInAssertOption != null) {
+// this.insert_space_after_colon_in_assert = CCorePlugin.INSERT.equals(insertSpaceAfterColonInAssertOption);
+// }
+// final Object insertSpaceAfterColonInCaseOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COLON_IN_CASE);
+// if (insertSpaceAfterColonInCaseOption != null) {
+// this.insert_space_after_colon_in_case = CCorePlugin.INSERT.equals(insertSpaceAfterColonInCaseOption);
+// }
+// final Object insertSpaceAfterColonInConditionalOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COLON_IN_CONDITIONAL);
+// if (insertSpaceAfterColonInConditionalOption != null) {
+// this.insert_space_after_colon_in_conditional = CCorePlugin.INSERT.equals(insertSpaceAfterColonInConditionalOption);
+// }
+// final Object insertSpaceAfterColonInForOption = settings.get(CodeFormatterConstants.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(CodeFormatterConstants.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(CodeFormatterConstants.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(CodeFormatterConstants.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 insertSpaceAfterCommaInConstructorDeclarationParametersOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_CONSTRUCTOR_DECLARATION_PARAMETERS);
+// if (insertSpaceAfterCommaInConstructorDeclarationParametersOption != null) {
+// this.insert_space_after_comma_in_constructor_declaration_parameters = CCorePlugin.INSERT.equals(insertSpaceAfterCommaInConstructorDeclarationParametersOption);
+// }
+// final Object insertSpaceAfterCommaInConstructorDeclarationThrowsOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_CONSTRUCTOR_DECLARATION_THROWS);
+// if (insertSpaceAfterCommaInConstructorDeclarationThrowsOption != null) {
+// this.insert_space_after_comma_in_constructor_declaration_throws = CCorePlugin.INSERT.equals(insertSpaceAfterCommaInConstructorDeclarationThrowsOption);
+// }
+// final Object insertSpaceAfterCommaInEnumConstantArgumentsOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_ENUM_CONSTANT_ARGUMENTS);
+// if (insertSpaceAfterCommaInEnumConstantArgumentsOption != null) {
+// this.insert_space_after_comma_in_enum_constant_arguments = CCorePlugin.INSERT.equals(insertSpaceAfterCommaInEnumConstantArgumentsOption);
+// }
+// final Object insertSpaceAfterCommaInEnumDeclarationsOption = settings.get(CodeFormatterConstants.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 insertSpaceAfterCommaInExplicitConstructorCallArgumentsOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_EXPLICIT_CONSTRUCTOR_CALL_ARGUMENTS);
+// if (insertSpaceAfterCommaInExplicitConstructorCallArgumentsOption != null) {
+// this.insert_space_after_comma_in_explicit_constructor_call_arguments = CCorePlugin.INSERT.equals(insertSpaceAfterCommaInExplicitConstructorCallArgumentsOption);
+// }
+// final Object insertSpaceAfterCommaInForIncrementsOption = settings.get(CodeFormatterConstants.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 insertSpaceAfterCommaInForInitsOption = settings.get(CodeFormatterConstants.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 insertSpaceAfterCommaInMethodInvocationArgumentsOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_METHOD_INVOCATION_ARGUMENTS);
+// if (insertSpaceAfterCommaInMethodInvocationArgumentsOption != null) {
+// this.insert_space_after_comma_in_method_invocation_arguments = CCorePlugin.INSERT.equals(insertSpaceAfterCommaInMethodInvocationArgumentsOption);
+// }
+// final Object insertSpaceAfterCommaInMethodDeclarationParametersOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_METHOD_DECLARATION_PARAMETERS);
+// if (insertSpaceAfterCommaInMethodDeclarationParametersOption != null) {
+// this.insert_space_after_comma_in_method_declaration_parameters = CCorePlugin.INSERT.equals(insertSpaceAfterCommaInMethodDeclarationParametersOption);
+// }
+// final Object insertSpaceAfterCommaInMethodDeclarationThrowsOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_METHOD_DECLARATION_THROWS);
+// if (insertSpaceAfterCommaInMethodDeclarationThrowsOption != null) {
+// this.insert_space_after_comma_in_method_declaration_throws = CCorePlugin.INSERT.equals(insertSpaceAfterCommaInMethodDeclarationThrowsOption);
+// }
+// final Object insertSpaceAfterCommaInMultipleFieldDeclarationsOption = settings.get(CodeFormatterConstants.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(CodeFormatterConstants.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(CodeFormatterConstants.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 insertSpaceAfterCommaInSuperinterfacesOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_SUPERINTERFACES);
+// if (insertSpaceAfterCommaInSuperinterfacesOption != null) {
+// this.insert_space_after_comma_in_superinterfaces = CCorePlugin.INSERT.equals(insertSpaceAfterCommaInSuperinterfacesOption);
+// }
+// final Object insertSpaceAfterCommaInTypeArgumentsOption = settings.get(CodeFormatterConstants.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(CodeFormatterConstants.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 insertSpaceAfterEllipsisOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_ELLIPSIS);
+// if (insertSpaceAfterEllipsisOption != null) {
+// this.insert_space_after_ellipsis = CCorePlugin.INSERT.equals(insertSpaceAfterEllipsisOption);
+// }
+// final Object insertSpaceAfterOpeningAngleBracketInParameterizedTypeReferenceOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_ANGLE_BRACKET_IN_PARAMETERIZED_TYPE_REFERENCE);
+// if (insertSpaceAfterOpeningAngleBracketInParameterizedTypeReferenceOption != null) {
+// this.insert_space_after_opening_angle_bracket_in_parameterized_type_reference = CCorePlugin.INSERT.equals(insertSpaceAfterOpeningAngleBracketInParameterizedTypeReferenceOption);
+// }
+// final Object insertSpaceAfterOpeningAngleBracketInTypeArgumentsOption = settings.get(CodeFormatterConstants.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(CodeFormatterConstants.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(CodeFormatterConstants.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(CodeFormatterConstants.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(CodeFormatterConstants.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 insertSpaceAfterOpeningParenInCastOption = settings.get(CodeFormatterConstants.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(CodeFormatterConstants.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 insertSpaceAfterOpeningParenInConstructorDeclarationOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_CONSTRUCTOR_DECLARATION);
+// if (insertSpaceAfterOpeningParenInConstructorDeclarationOption != null) {
+// this.insert_space_after_opening_paren_in_constructor_declaration = CCorePlugin.INSERT.equals(insertSpaceAfterOpeningParenInConstructorDeclarationOption);
+// }
+// final Object insertSpaceAfterOpeningParenInEnumConstantOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_ENUM_CONSTANT);
+// if (insertSpaceAfterOpeningParenInEnumConstantOption != null) {
+// this.insert_space_after_opening_paren_in_enum_constant = CCorePlugin.INSERT.equals(insertSpaceAfterOpeningParenInEnumConstantOption);
+// }
+// final Object insertSpaceAfterOpeningParenInForOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_FOR);
+// if (insertSpaceAfterOpeningParenInForOption != null) {
+// this.insert_space_after_opening_paren_in_for = CCorePlugin.INSERT.equals(insertSpaceAfterOpeningParenInForOption);
+// }
+// final Object insertSpaceAfterOpeningParenInIfOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_IF);
+// if (insertSpaceAfterOpeningParenInIfOption != null) {
+// this.insert_space_after_opening_paren_in_if = CCorePlugin.INSERT.equals(insertSpaceAfterOpeningParenInIfOption);
+// }
+// final Object insertSpaceAfterOpeningParenInMethodDeclarationOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_METHOD_DECLARATION);
+// if (insertSpaceAfterOpeningParenInMethodDeclarationOption != null) {
+// this.insert_space_after_opening_paren_in_method_declaration = CCorePlugin.INSERT.equals(insertSpaceAfterOpeningParenInMethodDeclarationOption);
+// }
+// final Object insertSpaceAfterOpeningParenInMethodInvocationOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_METHOD_INVOCATION);
+// if (insertSpaceAfterOpeningParenInMethodInvocationOption != null) {
+// this.insert_space_after_opening_paren_in_method_invocation = CCorePlugin.INSERT.equals(insertSpaceAfterOpeningParenInMethodInvocationOption);
+// }
+// final Object insertSpaceAfterOpeningParenInParenthesizedExpressionOption = settings.get(CodeFormatterConstants.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(CodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_SWITCH);
+// if (insertSpaceAfterOpeningParenInSwitchOption != null) {
+// this.insert_space_after_opening_paren_in_switch = CCorePlugin.INSERT.equals(insertSpaceAfterOpeningParenInSwitchOption);
+// }
+// final Object insertSpaceAfterOpeningParenInSynchronizedOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_SYNCHRONIZED);
+// if (insertSpaceAfterOpeningParenInSynchronizedOption != null) {
+// this.insert_space_after_opening_paren_in_synchronized = CCorePlugin.INSERT.equals(insertSpaceAfterOpeningParenInSynchronizedOption);
+// }
+// final Object insertSpaceAfterOpeningParenInWhileOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_WHILE);
+// if (insertSpaceAfterOpeningParenInWhileOption != null) {
+// this.insert_space_after_opening_paren_in_while = CCorePlugin.INSERT.equals(insertSpaceAfterOpeningParenInWhileOption);
+// }
+// final Object insertSpaceAfterPostfixOperatorOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_POSTFIX_OPERATOR);
+// if (insertSpaceAfterPostfixOperatorOption != null) {
+// this.insert_space_after_postfix_operator = CCorePlugin.INSERT.equals(insertSpaceAfterPostfixOperatorOption);
+// }
+// final Object insertSpaceAfterPrefixOperatorOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_PREFIX_OPERATOR);
+// if (insertSpaceAfterPrefixOperatorOption != null) {
+// this.insert_space_after_prefix_operator = CCorePlugin.INSERT.equals(insertSpaceAfterPrefixOperatorOption);
+// }
+// final Object insertSpaceAfterQuestionInConditionalOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_QUESTION_IN_CONDITIONAL);
+// if (insertSpaceAfterQuestionInConditionalOption != null) {
+// this.insert_space_after_question_in_conditional = CCorePlugin.INSERT.equals(insertSpaceAfterQuestionInConditionalOption);
+// }
+// final Object insertSpaceAfterQuestionInWildcardOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_QUESTION_IN_WILDCARD);
+// if (insertSpaceAfterQuestionInWildcardOption != null) {
+// this.insert_space_after_question_in_wilcard = CCorePlugin.INSERT.equals(insertSpaceAfterQuestionInWildcardOption);
+// }
+// final Object insertSpaceAfterSemicolonInForOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_SEMICOLON_IN_FOR);
+// if (insertSpaceAfterSemicolonInForOption != null) {
+// this.insert_space_after_semicolon_in_for = CCorePlugin.INSERT.equals(insertSpaceAfterSemicolonInForOption);
+// }
+// final Object insertSpaceAfterUnaryOperatorOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_UNARY_OPERATOR);
+// if (insertSpaceAfterUnaryOperatorOption != null) {
+// this.insert_space_after_unary_operator = CCorePlugin.INSERT.equals(insertSpaceAfterUnaryOperatorOption);
+// }
+// final Object insertSpaceBeforeAndInWildcardOption = settings.get(CodeFormatterConstants.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(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_ASSIGNMENT_OPERATOR);
+// if (insertSpaceBeforeAssignmentOperatorOption != null) {
+// this.insert_space_before_assignment_operator = CCorePlugin.INSERT.equals(insertSpaceBeforeAssignmentOperatorOption);
+// }
+// final Object insertSpaceBeforeBinaryOperatorOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_BINARY_OPERATOR);
+// if (insertSpaceBeforeBinaryOperatorOption != null) {
+// this.insert_space_before_binary_operator = CCorePlugin.INSERT.equals(insertSpaceBeforeBinaryOperatorOption);
+// }
+// final Object insertSpaceBeforeClosingAngleBracketInParameterizedTypeReferenceOption = settings.get(CodeFormatterConstants.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(CodeFormatterConstants.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(CodeFormatterConstants.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(CodeFormatterConstants.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(CodeFormatterConstants.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(CodeFormatterConstants.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(CodeFormatterConstants.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(CodeFormatterConstants.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 insertSpaceBeforeClosingParenInConstructorDeclarationOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_CONSTRUCTOR_DECLARATION);
+// if (insertSpaceBeforeClosingParenInConstructorDeclarationOption != null) {
+// this.insert_space_before_closing_paren_in_constructor_declaration = CCorePlugin.INSERT.equals(insertSpaceBeforeClosingParenInConstructorDeclarationOption);
+// }
+// final Object insertSpaceBeforeClosingParenInEnumConstantOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_ENUM_CONSTANT);
+// if (insertSpaceBeforeClosingParenInEnumConstantOption != null) {
+// this.insert_space_before_closing_paren_in_enum_constant = CCorePlugin.INSERT.equals(insertSpaceBeforeClosingParenInEnumConstantOption);
+// }
+// final Object insertSpaceBeforeClosingParenInForOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_FOR);
+// if (insertSpaceBeforeClosingParenInForOption != null) {
+// this.insert_space_before_closing_paren_in_for = CCorePlugin.INSERT.equals(insertSpaceBeforeClosingParenInForOption);
+// }
+// final Object insertSpaceBeforeClosingParenInIfOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_IF);
+// if (insertSpaceBeforeClosingParenInIfOption != null) {
+// this.insert_space_before_closing_paren_in_if = CCorePlugin.INSERT.equals(insertSpaceBeforeClosingParenInIfOption);
+// }
+// final Object insertSpaceBeforeClosingParenInMethodDeclarationOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_METHOD_DECLARATION);
+// if (insertSpaceBeforeClosingParenInMethodDeclarationOption != null) {
+// this.insert_space_before_closing_paren_in_method_declaration = CCorePlugin.INSERT.equals(insertSpaceBeforeClosingParenInMethodDeclarationOption);
+// }
+// final Object insertSpaceBeforeClosingParenInMethodInvocationOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_METHOD_INVOCATION);
+// if (insertSpaceBeforeClosingParenInMethodInvocationOption != null) {
+// this.insert_space_before_closing_paren_in_method_invocation = CCorePlugin.INSERT.equals(insertSpaceBeforeClosingParenInMethodInvocationOption);
+// }
+// final Object insertSpaceBeforeClosingParenInParenthesizedExpressionOption = settings.get(CodeFormatterConstants.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(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_SWITCH);
+// if (insertSpaceBeforeClosingParenInSwitchOption != null) {
+// this.insert_space_before_closing_paren_in_switch = CCorePlugin.INSERT.equals(insertSpaceBeforeClosingParenInSwitchOption);
+// }
+// final Object insertSpaceBeforeClosingParenInSynchronizedOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_SYNCHRONIZED);
+// if (insertSpaceBeforeClosingParenInSynchronizedOption != null) {
+// this.insert_space_before_closing_paren_in_synchronized = CCorePlugin.INSERT.equals(insertSpaceBeforeClosingParenInSynchronizedOption);
+// }
+// final Object insertSpaceBeforeClosingParenInWhileOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_WHILE);
+// if (insertSpaceBeforeClosingParenInWhileOption != null) {
+// this.insert_space_before_closing_paren_in_while = CCorePlugin.INSERT.equals(insertSpaceBeforeClosingParenInWhileOption);
+// }
+// final Object insertSpaceBeforeColonInAssertOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COLON_IN_ASSERT);
+// if (insertSpaceBeforeColonInAssertOption != null) {
+// this.insert_space_before_colon_in_assert = CCorePlugin.INSERT.equals(insertSpaceBeforeColonInAssertOption);
+// }
+// final Object insertSpaceBeforeColonInCaseOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COLON_IN_CASE);
+// if (insertSpaceBeforeColonInCaseOption != null) {
+// this.insert_space_before_colon_in_case = CCorePlugin.INSERT.equals(insertSpaceBeforeColonInCaseOption);
+// }
+// final Object insertSpaceBeforeColonInConditionalOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COLON_IN_CONDITIONAL);
+// if (insertSpaceBeforeColonInConditionalOption != null) {
+// this.insert_space_before_colon_in_conditional = CCorePlugin.INSERT.equals(insertSpaceBeforeColonInConditionalOption);
+// }
+// final Object insertSpaceBeforeColonInDefaultOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COLON_IN_DEFAULT);
+// if (insertSpaceBeforeColonInDefaultOption != null) {
+// this.insert_space_before_colon_in_default = CCorePlugin.INSERT.equals(insertSpaceBeforeColonInDefaultOption);
+// }
+// final Object insertSpaceBeforeColonInForOption = settings.get(CodeFormatterConstants.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(CodeFormatterConstants.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(CodeFormatterConstants.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(CodeFormatterConstants.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 insertSpaceBeforeCommaInConstructorDeclarationParametersOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_CONSTRUCTOR_DECLARATION_PARAMETERS);
+// if (insertSpaceBeforeCommaInConstructorDeclarationParametersOption != null) {
+// this.insert_space_before_comma_in_constructor_declaration_parameters = CCorePlugin.INSERT.equals(insertSpaceBeforeCommaInConstructorDeclarationParametersOption);
+// }
+// final Object insertSpaceBeforeCommaInConstructorDeclarationThrowsOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_CONSTRUCTOR_DECLARATION_THROWS);
+// if (insertSpaceBeforeCommaInConstructorDeclarationThrowsOption != null) {
+// this.insert_space_before_comma_in_constructor_declaration_throws = CCorePlugin.INSERT.equals(insertSpaceBeforeCommaInConstructorDeclarationThrowsOption);
+// }
+// final Object insertSpaceBeforeCommaInEnumConstantArgumentsOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_ENUM_CONSTANT_ARGUMENTS);
+// if (insertSpaceBeforeCommaInEnumConstantArgumentsOption != null) {
+// this.insert_space_before_comma_in_enum_constant_arguments = CCorePlugin.INSERT.equals(insertSpaceBeforeCommaInEnumConstantArgumentsOption);
+// }
+// final Object insertSpaceBeforeCommaInEnumDeclarationsOption = settings.get(CodeFormatterConstants.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 insertSpaceBeforeCommaInExplicitConstructorCallArgumentsOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_EXPLICIT_CONSTRUCTOR_CALL_ARGUMENTS);
+// if (insertSpaceBeforeCommaInExplicitConstructorCallArgumentsOption != null) {
+// this.insert_space_before_comma_in_explicit_constructor_call_arguments = CCorePlugin.INSERT.equals(insertSpaceBeforeCommaInExplicitConstructorCallArgumentsOption);
+// }
+// final Object insertSpaceBeforeCommaInForIncrementsOption = settings.get(CodeFormatterConstants.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 insertSpaceBeforeCommaInForInitsOption = settings.get(CodeFormatterConstants.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 insertSpaceBeforeCommaInMethodInvocationArgumentsOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_METHOD_INVOCATION_ARGUMENTS);
+// if (insertSpaceBeforeCommaInMethodInvocationArgumentsOption != null) {
+// this.insert_space_before_comma_in_method_invocation_arguments = CCorePlugin.INSERT.equals(insertSpaceBeforeCommaInMethodInvocationArgumentsOption);
+// }
+// final Object insertSpaceBeforeCommaInMethodDeclarationParametersOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_METHOD_DECLARATION_PARAMETERS);
+// if (insertSpaceBeforeCommaInMethodDeclarationParametersOption != null) {
+// this.insert_space_before_comma_in_method_declaration_parameters = CCorePlugin.INSERT.equals(insertSpaceBeforeCommaInMethodDeclarationParametersOption);
+// }
+// final Object insertSpaceBeforeCommaInMethodDeclarationThrowsOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_METHOD_DECLARATION_THROWS);
+// if (insertSpaceBeforeCommaInMethodDeclarationThrowsOption != null) {
+// this.insert_space_before_comma_in_method_declaration_throws = CCorePlugin.INSERT.equals(insertSpaceBeforeCommaInMethodDeclarationThrowsOption);
+// }
+// final Object insertSpaceBeforeCommaInMultipleFieldDeclarationsOption = settings.get(CodeFormatterConstants.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(CodeFormatterConstants.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(CodeFormatterConstants.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 insertSpaceBeforeCommaInSuperinterfacesOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_SUPERINTERFACES);
+// if (insertSpaceBeforeCommaInSuperinterfacesOption != null) {
+// this.insert_space_before_comma_in_superinterfaces = CCorePlugin.INSERT.equals(insertSpaceBeforeCommaInSuperinterfacesOption);
+// }
+// final Object insertSpaceBeforeCommaInTypeArgumentsOption = settings.get(CodeFormatterConstants.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(CodeFormatterConstants.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 insertSpaceBeforeEllipsisOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_ELLIPSIS);
+// if (insertSpaceBeforeEllipsisOption != null) {
+// this.insert_space_before_ellipsis = CCorePlugin.INSERT.equals(insertSpaceBeforeEllipsisOption);
+// }
+// final Object insertSpaceBeforeOpeningAngleBrackerInParameterizedTypeReferenceOption = settings.get(CodeFormatterConstants.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(CodeFormatterConstants.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(CodeFormatterConstants.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(CodeFormatterConstants.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 insertSpaceBeforeOpeningBraceInBlockOption = settings.get(CodeFormatterConstants.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 insertSpaceBeforeOpeningBraceInConstructorDeclarationOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACE_IN_CONSTRUCTOR_DECLARATION);
+// if (insertSpaceBeforeOpeningBraceInConstructorDeclarationOption != null) {
+// this.insert_space_before_opening_brace_in_constructor_declaration = CCorePlugin.INSERT.equals(insertSpaceBeforeOpeningBraceInConstructorDeclarationOption);
+// }
+// final Object insertSpaceBeforeOpeningBraceInEnumDeclarationOption = settings.get(CodeFormatterConstants.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 insertSpaceBeforeOpeningBraceInEnumConstantOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACE_IN_ENUM_CONSTANT);
+// if (insertSpaceBeforeOpeningBraceInEnumConstantOption != null) {
+// this.insert_space_before_opening_brace_in_enum_constant = CCorePlugin.INSERT.equals(insertSpaceBeforeOpeningBraceInEnumConstantOption);
+// }
+// final Object insertSpaceBeforeOpeningBraceInMethodDeclarationOption = settings.get(CodeFormatterConstants.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);
+// }
+// final Object insertSpaceBeforeOpeningBraceInTypeDeclarationOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACE_IN_TYPE_DECLARATION);
+// if (insertSpaceBeforeOpeningBraceInTypeDeclarationOption != null) {
+// this.insert_space_before_opening_brace_in_type_declaration = CCorePlugin.INSERT.equals(insertSpaceBeforeOpeningBraceInTypeDeclarationOption);
+// }
+// final Object insertSpaceBeforeOpeningBracketInArrayAllocationExpressionOption = settings.get(CodeFormatterConstants.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(CodeFormatterConstants.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(CodeFormatterConstants.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(CodeFormatterConstants.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 insertSpaceBeforeOpeningParenInConstructorDeclarationOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_CONSTRUCTOR_DECLARATION);
+// if (insertSpaceBeforeOpeningParenInConstructorDeclarationOption != null) {
+// this.insert_space_before_opening_paren_in_constructor_declaration = CCorePlugin.INSERT.equals(insertSpaceBeforeOpeningParenInConstructorDeclarationOption);
+// }
+// final Object insertSpaceBeforeOpeningParenInEnumConstantOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_ENUM_CONSTANT);
+// if (insertSpaceBeforeOpeningParenInEnumConstantOption != null) {
+// this.insert_space_before_opening_paren_in_enum_constant = CCorePlugin.INSERT.equals(insertSpaceBeforeOpeningParenInEnumConstantOption);
+// }
+// final Object insertSpaceBeforeOpeningParenInForOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_FOR);
+// if (insertSpaceBeforeOpeningParenInForOption != null) {
+// this.insert_space_before_opening_paren_in_for = CCorePlugin.INSERT.equals(insertSpaceBeforeOpeningParenInForOption);
+// }
+// final Object insertSpaceBeforeOpeningParenInIfOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_IF);
+// if (insertSpaceBeforeOpeningParenInIfOption != null) {
+// this.insert_space_before_opening_paren_in_if = CCorePlugin.INSERT.equals(insertSpaceBeforeOpeningParenInIfOption);
+// }
+// final Object insertSpaceBeforeOpeningParenInMethodInvocationOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_METHOD_INVOCATION);
+// if (insertSpaceBeforeOpeningParenInMethodInvocationOption != null) {
+// this.insert_space_before_opening_paren_in_method_invocation = CCorePlugin.INSERT.equals(insertSpaceBeforeOpeningParenInMethodInvocationOption);
+// }
+// final Object insertSpaceBeforeOpeningParenInMethodDeclarationOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_METHOD_DECLARATION);
+// if (insertSpaceBeforeOpeningParenInMethodDeclarationOption != null) {
+// this.insert_space_before_opening_paren_in_method_declaration = CCorePlugin.INSERT.equals(insertSpaceBeforeOpeningParenInMethodDeclarationOption);
+// }
+// final Object insertSpaceBeforeOpeningParenInSwitchOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_SWITCH);
+// if (insertSpaceBeforeOpeningParenInSwitchOption != null) {
+// this.insert_space_before_opening_paren_in_switch = CCorePlugin.INSERT.equals(insertSpaceBeforeOpeningParenInSwitchOption);
+// }
+// final Object insertSpaceBeforeOpeningBraceInSwitchOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACE_IN_SWITCH);
+// if (insertSpaceBeforeOpeningBraceInSwitchOption != null) {
+// this.insert_space_before_opening_brace_in_switch = CCorePlugin.INSERT.equals(insertSpaceBeforeOpeningBraceInSwitchOption);
+// }
+// final Object insertSpaceBeforeOpeningParenInSynchronizedOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_SYNCHRONIZED);
+// if (insertSpaceBeforeOpeningParenInSynchronizedOption != null) {
+// this.insert_space_before_opening_paren_in_synchronized = CCorePlugin.INSERT.equals(insertSpaceBeforeOpeningParenInSynchronizedOption);
+// }
+// final Object insertSpaceBeforeOpeningParenInParenthesizedExpressionOption = settings.get(CodeFormatterConstants.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(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_WHILE);
+// if (insertSpaceBeforeOpeningParenInWhileOption != null) {
+// this.insert_space_before_opening_paren_in_while = CCorePlugin.INSERT.equals(insertSpaceBeforeOpeningParenInWhileOption);
+// }
+// final Object insertSpaceBeforeParenthesizedExpressionInReturnOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_PARENTHESIZED_EXPRESSION_IN_RETURN);
+// if (insertSpaceBeforeParenthesizedExpressionInReturnOption != null) {
+// this.insert_space_before_parenthesized_expression_in_return = CCorePlugin.INSERT.equals(insertSpaceBeforeParenthesizedExpressionInReturnOption);
+// }
+// final Object insertSpaceBeforePostfixOperatorOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_POSTFIX_OPERATOR);
+// if (insertSpaceBeforePostfixOperatorOption != null) {
+// this.insert_space_before_postfix_operator = CCorePlugin.INSERT.equals(insertSpaceBeforePostfixOperatorOption);
+// }
+// final Object insertSpaceBeforePrefixOperatorOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_PREFIX_OPERATOR);
+// if (insertSpaceBeforePrefixOperatorOption != null) {
+// this.insert_space_before_prefix_operator = CCorePlugin.INSERT.equals(insertSpaceBeforePrefixOperatorOption);
+// }
+// final Object insertSpaceBeforeQuestionInConditionalOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_QUESTION_IN_CONDITIONAL);
+// if (insertSpaceBeforeQuestionInConditionalOption != null) {
+// this.insert_space_before_question_in_conditional = CCorePlugin.INSERT.equals(insertSpaceBeforeQuestionInConditionalOption);
+// }
+// final Object insertSpaceBeforeQuestionInWildcardOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_QUESTION_IN_WILDCARD);
+// if (insertSpaceBeforeQuestionInWildcardOption != null) {
+// this.insert_space_before_question_in_wilcard = CCorePlugin.INSERT.equals(insertSpaceBeforeQuestionInWildcardOption);
+// }
+// final Object insertSpaceBeforeSemicolonOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_SEMICOLON);
+// if (insertSpaceBeforeSemicolonOption != null) {
+// this.insert_space_before_semicolon = CCorePlugin.INSERT.equals(insertSpaceBeforeSemicolonOption);
+// }
+// final Object insertSpaceBeforeSemicolonInForOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_SEMICOLON_IN_FOR);
+// if (insertSpaceBeforeSemicolonInForOption != null) {
+// this.insert_space_before_semicolon_in_for = CCorePlugin.INSERT.equals(insertSpaceBeforeSemicolonInForOption);
+// }
+// final Object insertSpaceBeforeUnaryOperatorOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_UNARY_OPERATOR);
+// if (insertSpaceBeforeUnaryOperatorOption != null) {
+// this.insert_space_before_unary_operator = CCorePlugin.INSERT.equals(insertSpaceBeforeUnaryOperatorOption);
+// }
+// final Object insertSpaceBetweenBracketsInArrayTypeReferenceOption = settings.get(CodeFormatterConstants.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(CodeFormatterConstants.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(CodeFormatterConstants.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 insertSpaceBetweenEmptyParensInConstructorDeclarationOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BETWEEN_EMPTY_PARENS_IN_CONSTRUCTOR_DECLARATION);
+// if (insertSpaceBetweenEmptyParensInConstructorDeclarationOption != null) {
+// this.insert_space_between_empty_parens_in_constructor_declaration = CCorePlugin.INSERT.equals(insertSpaceBetweenEmptyParensInConstructorDeclarationOption);
+// }
+// final Object insertSpaceBetweenEmptyParensInEnumConstantOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BETWEEN_EMPTY_PARENS_IN_ENUM_CONSTANT);
+// if (insertSpaceBetweenEmptyParensInEnumConstantOption != null) {
+// this.insert_space_between_empty_parens_in_enum_constant = CCorePlugin.INSERT.equals(insertSpaceBetweenEmptyParensInEnumConstantOption);
+// }
+// final Object insertSpaceBetweenEmptyParensInMethodDeclarationOption = settings.get(CodeFormatterConstants.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(CodeFormatterConstants.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(CodeFormatterConstants.FORMATTER_COMPACT_ELSE_IF);
+// if (compactElseIfOption != null) {
+// this.compact_else_if = CodeFormatterConstants.TRUE.equals(compactElseIfOption);
+// }
+// final Object keepGuardianClauseOnOneLineOption = settings.get(CodeFormatterConstants.FORMATTER_KEEP_GUARDIAN_CLAUSE_ON_ONE_LINE);
+// if (keepGuardianClauseOnOneLineOption != null) {
+// this.keep_guardian_clause_on_one_line = CodeFormatterConstants.TRUE.equals(keepGuardianClauseOnOneLineOption);
+// }
+// final Object keepElseStatementOnSameLineOption = settings.get(CodeFormatterConstants.FORMATTER_KEEP_ELSE_STATEMENT_ON_SAME_LINE);
+// if (keepElseStatementOnSameLineOption != null) {
+// this.keep_else_statement_on_same_line = CodeFormatterConstants.TRUE.equals(keepElseStatementOnSameLineOption);
+// }
+// final Object keepEmptyArrayInitializerOnOneLineOption = settings.get(CodeFormatterConstants.FORMATTER_KEEP_EMPTY_ARRAY_INITIALIZER_ON_ONE_LINE);
+// if (keepEmptyArrayInitializerOnOneLineOption != null) {
+// this.keep_empty_array_initializer_on_one_line = CodeFormatterConstants.TRUE.equals(keepEmptyArrayInitializerOnOneLineOption);
+// }
+// final Object keepSimpleIfOnOneLineOption = settings.get(CodeFormatterConstants.FORMATTER_KEEP_SIMPLE_IF_ON_ONE_LINE);
+// if (keepSimpleIfOnOneLineOption != null) {
+// this.keep_simple_if_on_one_line = CodeFormatterConstants.TRUE.equals(keepSimpleIfOnOneLineOption);
+// }
+// final Object keepThenStatementOnSameLineOption = settings.get(CodeFormatterConstants.FORMATTER_KEEP_THEN_STATEMENT_ON_SAME_LINE);
+// if (keepThenStatementOnSameLineOption != null) {
+// this.keep_then_statement_on_same_line = CodeFormatterConstants.TRUE.equals(keepThenStatementOnSameLineOption);
+// }
+// final Object numberOfEmptyLinesToPreserveOption = settings.get(CodeFormatterConstants.FORMATTER_NUMBER_OF_EMPTY_LINES_TO_PRESERVE);
+// if (numberOfEmptyLinesToPreserveOption != null) {
+// try {
+// this.number_of_empty_lines_to_preserve = Integer.parseInt((String) numberOfEmptyLinesToPreserveOption);
+// } catch (NumberFormatException e) {
+// this.number_of_empty_lines_to_preserve = 0;
+// } catch(ClassCastException e) {
+// this.number_of_empty_lines_to_preserve = 0;
+// }
+// }
+// final Object putEmptyStatementOnNewLineOption = settings.get(CodeFormatterConstants.FORMATTER_PUT_EMPTY_STATEMENT_ON_NEW_LINE);
+// if (putEmptyStatementOnNewLineOption != null) {
+// this.put_empty_statement_on_new_line = CodeFormatterConstants.TRUE.equals(putEmptyStatementOnNewLineOption);
+// }
+ final Object tabSizeOption = settings.get(CodeFormatterConstants.FORMATTER_TAB_SIZE);
+ if (tabSizeOption != null) {
+ try {
+ this.tab_size = Integer.parseInt((String) tabSizeOption);
+ } catch (NumberFormatException e) {
+ this.tab_size = 4;
+ } catch(ClassCastException e) {
+ this.tab_size = 4;
+ }
+ }
+ final Object useTabsOnlyForLeadingIndentationsOption = settings.get(CodeFormatterConstants.FORMATTER_USE_TABS_ONLY_FOR_LEADING_INDENTATIONS);
+ if (useTabsOnlyForLeadingIndentationsOption != null) {
+ this.use_tabs_only_for_leading_indentations = CodeFormatterConstants.TRUE.equals(useTabsOnlyForLeadingIndentationsOption);
+ }
+ final Object pageWidthOption = settings.get(CodeFormatterConstants.FORMATTER_LINE_SPLIT);
+ if (pageWidthOption != null) {
+ try {
+ this.page_width = Integer.parseInt((String) pageWidthOption);
+ } catch (NumberFormatException e) {
+ this.page_width = 80;
+ } catch(ClassCastException e) {
+ this.page_width = 80;
+ }
+ }
+ final Object useTabOption = settings.get(CodeFormatterConstants.FORMATTER_TAB_CHAR);
+ if (useTabOption != null) {
+ if (CCorePlugin.TAB.equals(useTabOption)) {
+ this.tab_char = TAB;
+ } else if (CCorePlugin.SPACE.equals(useTabOption)) {
+ this.tab_char = SPACE;
+ } else {
+ this.tab_char = MIXED;
+ }
+ }
+ }
+
+ public void setDefaultSettings() {
+ this.alignment_for_arguments_in_allocation_expression = Alignment.M_COMPACT_SPLIT;
+ this.alignment_for_arguments_in_enum_constant = Alignment.M_COMPACT_SPLIT;
+ this.alignment_for_arguments_in_explicit_constructor_call = Alignment.M_COMPACT_SPLIT;
+ this.alignment_for_arguments_in_method_invocation = Alignment.M_COMPACT_SPLIT;
+ this.alignment_for_arguments_in_qualified_allocation_expression = Alignment.M_COMPACT_SPLIT;
+ this.alignment_for_assignment = Alignment.M_NO_ALIGNMENT;
+ this.alignment_for_binary_expression = Alignment.M_COMPACT_SPLIT;
+ this.alignment_for_compact_if = Alignment.M_ONE_PER_LINE_SPLIT | Alignment.M_INDENT_BY_ONE;
+ this.alignment_for_conditional_expression = Alignment.M_ONE_PER_LINE_SPLIT;
+ this.alignment_for_enum_constants = Alignment.NONE;
+ this.alignment_for_expressions_in_array_initializer = Alignment.M_COMPACT_SPLIT;
+ this.alignment_for_multiple_fields = Alignment.M_COMPACT_SPLIT;
+ this.alignment_for_parameters_in_constructor_declaration = Alignment.M_COMPACT_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_NEXT_SHIFTED_SPLIT;
+ this.alignment_for_superinterfaces_in_enum_declaration = Alignment.M_NEXT_SHIFTED_SPLIT;
+ this.alignment_for_superinterfaces_in_type_declaration = Alignment.M_NEXT_SHIFTED_SPLIT;
+ this.alignment_for_throws_clause_in_constructor_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 = CodeFormatterConstants.END_OF_LINE;
+ this.brace_position_for_block = CodeFormatterConstants.END_OF_LINE;
+ this.brace_position_for_block_in_case = CodeFormatterConstants.END_OF_LINE;
+ this.brace_position_for_constructor_declaration = CodeFormatterConstants.END_OF_LINE;
+ this.brace_position_for_enum_constant = CodeFormatterConstants.END_OF_LINE;
+ this.brace_position_for_enum_declaration = CodeFormatterConstants.END_OF_LINE;
+ this.brace_position_for_method_declaration = CodeFormatterConstants.END_OF_LINE;
+ this.brace_position_for_type_declaration = CodeFormatterConstants.END_OF_LINE;
+ this.brace_position_for_switch = CodeFormatterConstants.END_OF_LINE;
+// this.comment_clear_blank_lines = false;
+// this.comment_format = true;
+// this.comment_format_header = false;
+// this.comment_format_html = true;
+// this.comment_format_source = true;
+// this.comment_indent_parameter_description = true;
+// this.comment_indent_root_tags = true;
+// this.comment_insert_empty_line_before_root_tags = true;
+// 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.blank_lines_after_imports = 0;
+// this.blank_lines_after_package = 0;
+// this.blank_lines_before_field = 0;
+// this.blank_lines_before_first_class_body_declaration = 0;
+// this.blank_lines_before_imports = 0;
+// this.blank_lines_before_member_type = 0;
+// this.blank_lines_before_method = 0;
+// this.blank_lines_before_new_chunk = 0;
+// this.blank_lines_before_package = 0;
+// this.blank_lines_between_type_declarations = 0;
+// this.blank_lines_at_beginning_of_method_body = 0;
+ this.indent_statements_compare_to_block = true;
+ this.indent_statements_compare_to_body = true;
+ this.indent_body_declarations_compare_to_enum_constant_header = true;
+ this.indent_body_declarations_compare_to_enum_declaration_header = true;
+ this.indent_body_declarations_compare_to_type_header = true;
+ this.indent_breaks_compare_to_cases = true;
+ this.indent_empty_lines = false;
+ this.indent_switchstatements_compare_to_cases = true;
+ this.indent_switchstatements_compare_to_switch = true;
+ this.indentation_size = 4;
+// this.insert_new_line_after_opening_brace_in_array_initializer = 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_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_constant = 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_closing_brace_in_block = true;
+// this.insert_space_after_colon_in_assert = 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_comma_in_allocation_expression = true;
+// this.insert_space_after_comma_in_array_initializer = true;
+// this.insert_space_after_comma_in_constructor_declaration_parameters = true;
+// this.insert_space_after_comma_in_constructor_declaration_throws = true;
+// this.insert_space_after_comma_in_enum_constant_arguments = true;
+// this.insert_space_after_comma_in_enum_declarations = true;
+// this.insert_space_after_comma_in_explicit_constructor_call_arguments = true;
+// this.insert_space_after_comma_in_for_increments = true;
+// this.insert_space_after_comma_in_for_inits = 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_superinterfaces = true;
+// this.insert_space_after_comma_in_type_arguments = true;
+// this.insert_space_after_comma_in_type_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 = false;
+// 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_constructor_declaration = false;
+// this.insert_space_after_opening_paren_in_enum_constant = 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_switch = false;
+// this.insert_space_after_opening_paren_in_synchronized = 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_question_in_conditional = true;
+// this.insert_space_after_question_in_wilcard = false;
+// 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 = false;
+// 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_before_closing_paren_in_constructor_declaration = false;
+// this.insert_space_before_closing_paren_in_enum_constant = 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_switch = false;
+// this.insert_space_before_closing_paren_in_synchronized = false;
+// this.insert_space_before_closing_paren_in_while = false;
+// this.insert_space_before_colon_in_assert = true;
+// this.insert_space_before_colon_in_case = true;
+// this.insert_space_before_colon_in_conditional = true;
+// this.insert_space_before_colon_in_default = true;
+// this.insert_space_before_colon_in_for = true;
+// this.insert_space_before_colon_in_labeled_statement = true;
+// this.insert_space_before_comma_in_allocation_expression = false;
+// this.insert_space_before_comma_in_array_initializer = false;
+// this.insert_space_before_comma_in_constructor_declaration_parameters = false;
+// this.insert_space_before_comma_in_constructor_declaration_throws = false;
+// this.insert_space_before_comma_in_enum_constant_arguments = false;
+// this.insert_space_before_comma_in_enum_declarations = false;
+// this.insert_space_before_comma_in_explicit_constructor_call_arguments = 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_superinterfaces = false;
+// this.insert_space_before_comma_in_type_arguments = false;
+// this.insert_space_before_comma_in_type_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 = false;
+// this.insert_space_before_opening_brace_in_block = true;
+// this.insert_space_before_opening_brace_in_constructor_declaration = true;
+// this.insert_space_before_opening_brace_in_enum_constant = 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_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_paren_in_constructor_declaration = false;
+// this.insert_space_before_opening_paren_in_enum_constant = false;
+// 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_synchronized = true;
+// 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_question_in_conditional = true;
+// this.insert_space_before_question_in_wilcard = false;
+// 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_between_empty_parens_in_constructor_declaration = false;
+// this.insert_space_between_empty_parens_in_enum_constant = false;
+// this.insert_space_between_empty_parens_in_method_declaration = 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_simple_if_on_one_line = false;
+// this.keep_then_statement_on_same_line = false;
+// this.number_of_empty_lines_to_preserve = 1;
+// this.put_empty_statement_on_new_line = false;
+ this.tab_size = 4;
+ this.page_width = 80;
+ this.tab_char = TAB; // see https://bugs.eclipse.org/bugs/show_bug.cgi?id=49081
+ this.use_tabs_only_for_leading_indentations = false;
+ }
+
+ public void setEclipseDefaultSettings() {
+ this.alignment_for_arguments_in_allocation_expression = Alignment.M_COMPACT_SPLIT;
+ this.alignment_for_arguments_in_enum_constant = Alignment.M_COMPACT_SPLIT;
+ this.alignment_for_arguments_in_explicit_constructor_call = Alignment.M_COMPACT_SPLIT;
+ this.alignment_for_arguments_in_method_invocation = Alignment.M_COMPACT_SPLIT;
+ this.alignment_for_arguments_in_qualified_allocation_expression = Alignment.M_COMPACT_SPLIT;
+ this.alignment_for_assignment = Alignment.M_NO_ALIGNMENT;
+ 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_enum_constants = Alignment.NONE;
+ this.alignment_for_expressions_in_array_initializer = Alignment.M_COMPACT_SPLIT;
+ this.alignment_for_multiple_fields = Alignment.M_COMPACT_SPLIT;
+ this.alignment_for_parameters_in_constructor_declaration = Alignment.M_COMPACT_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_superinterfaces_in_enum_declaration = Alignment.M_COMPACT_SPLIT;
+ this.alignment_for_superinterfaces_in_type_declaration = Alignment.M_COMPACT_SPLIT;
+ this.alignment_for_throws_clause_in_constructor_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 = CodeFormatterConstants.END_OF_LINE;
+ this.brace_position_for_block = CodeFormatterConstants.END_OF_LINE;
+ this.brace_position_for_block_in_case = CodeFormatterConstants.END_OF_LINE;
+ this.brace_position_for_constructor_declaration = CodeFormatterConstants.END_OF_LINE;
+ this.brace_position_for_enum_constant = CodeFormatterConstants.END_OF_LINE;
+ this.brace_position_for_enum_declaration = CodeFormatterConstants.END_OF_LINE;
+ this.brace_position_for_method_declaration = CodeFormatterConstants.END_OF_LINE;
+ this.brace_position_for_type_declaration = CodeFormatterConstants.END_OF_LINE;
+ this.brace_position_for_switch = CodeFormatterConstants.END_OF_LINE;
+// this.comment_clear_blank_lines = false;
+// this.comment_format = true;
+// this.comment_format_header = false;
+// this.comment_format_html = true;
+// this.comment_format_source = true;
+// this.comment_indent_parameter_description = true;
+// this.comment_indent_root_tags = true;
+// this.comment_insert_empty_line_before_root_tags = true;
+// 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.blank_lines_after_imports = 1;
+// this.blank_lines_after_package = 1;
+// this.blank_lines_before_field = 1;
+// this.blank_lines_before_first_class_body_declaration = 0;
+// this.blank_lines_before_imports = 1;
+// this.blank_lines_before_member_type = 1;
+// this.blank_lines_before_method = 1;
+// this.blank_lines_before_new_chunk = 1;
+// this.blank_lines_before_package = 0;
+// this.blank_lines_between_type_declarations = 1;
+// this.blank_lines_at_beginning_of_method_body = 0;
+ this.indent_statements_compare_to_block = true;
+ this.indent_statements_compare_to_body = true;
+ this.indent_body_declarations_compare_to_enum_constant_header = true;
+ this.indent_body_declarations_compare_to_enum_declaration_header = true;
+ this.indent_body_declarations_compare_to_type_header = true;
+ this.indent_breaks_compare_to_cases = true;
+ this.indent_empty_lines = false;
+ 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_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_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_constant = 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_closing_brace_in_block = true;
+// this.insert_space_after_colon_in_assert = 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_comma_in_allocation_expression = true;
+// this.insert_space_after_comma_in_array_initializer = true;
+// this.insert_space_after_comma_in_constructor_declaration_parameters = true;
+// this.insert_space_after_comma_in_constructor_declaration_throws = true;
+// this.insert_space_after_comma_in_enum_constant_arguments = true;
+// this.insert_space_after_comma_in_enum_declarations = true;
+// this.insert_space_after_comma_in_explicit_constructor_call_arguments = true;
+// this.insert_space_after_comma_in_for_increments = true;
+// this.insert_space_after_comma_in_for_inits = 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_superinterfaces = true;
+// this.insert_space_after_comma_in_type_arguments = true;
+// this.insert_space_after_comma_in_type_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_paren_in_constructor_declaration = false;
+// this.insert_space_after_opening_paren_in_enum_constant = 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_switch = false;
+// this.insert_space_after_opening_paren_in_synchronized = 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_question_in_conditional = true;
+// this.insert_space_after_question_in_wilcard = false;
+// 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_before_closing_paren_in_constructor_declaration = false;
+// this.insert_space_before_closing_paren_in_enum_constant = 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_switch = false;
+// this.insert_space_before_closing_paren_in_synchronized = false;
+// this.insert_space_before_closing_paren_in_while = false;
+// this.insert_space_before_colon_in_assert = true;
+// 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_comma_in_allocation_expression = false;
+// this.insert_space_before_comma_in_array_initializer = false;
+// this.insert_space_before_comma_in_constructor_declaration_parameters = false;
+// this.insert_space_before_comma_in_constructor_declaration_throws = false;
+// this.insert_space_before_comma_in_enum_constant_arguments = false;
+// this.insert_space_before_comma_in_enum_declarations = false;
+// this.insert_space_before_comma_in_explicit_constructor_call_arguments = 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_superinterfaces = false;
+// this.insert_space_before_comma_in_type_arguments = false;
+// this.insert_space_before_comma_in_type_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_brace_in_block = true;
+// this.insert_space_before_opening_brace_in_constructor_declaration = true;
+// this.insert_space_before_opening_brace_in_enum_constant = 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_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_paren_in_constructor_declaration = false;
+// this.insert_space_before_opening_paren_in_enum_constant = false;
+// 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_synchronized = true;
+// 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_question_in_conditional = true;
+// this.insert_space_before_question_in_wilcard = false;
+// 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_between_empty_parens_in_constructor_declaration = false;
+// this.insert_space_between_empty_parens_in_enum_constant = false;
+// this.insert_space_between_empty_parens_in_method_declaration = 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_simple_if_on_one_line = false;
+// this.keep_then_statement_on_same_line = false;
+// this.number_of_empty_lines_to_preserve = 1;
+// this.put_empty_statement_on_new_line = true;
+ this.tab_size = 4;
+ this.page_width = 80;
+ this.tab_char = TAB;
+ this.use_tabs_only_for_leading_indentations = false;
+ }
+}
diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/formatter/align/Alignment.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/formatter/align/Alignment.java
new file mode 100644
index 00000000000..c6599e2c5b3
--- /dev/null
+++ b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/formatter/align/Alignment.java
@@ -0,0 +1,124 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2005 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
+ *******************************************************************************/
+package org.eclipse.cdt.internal.formatter.align;
+
+
+/**
+ * Alignment management
+ */
+public class Alignment {
+
+ // name of alignment
+ public String name;
+
+ // link to enclosing alignment
+ public Alignment enclosing;
+
+ // indentation management
+ public int fragmentIndex;
+ public int fragmentCount;
+ public int[] fragmentIndentations;
+ public boolean needRedoColumnAlignment;
+
+ // chunk management
+ public int chunkStartIndex;
+ public int chunkKind;
+
+ // break management
+ public int originalIndentationLevel;
+ public int breakIndentationLevel;
+ public int shiftBreakIndentationLevel;
+ public int[] fragmentBreaks;
+ public boolean wasSplit;
+
+ /*
+ * Alignment modes
+ */
+ public static final int M_FORCE = 1; // if bit set, then alignment will be non-optional (default is optional)
+ public static final int M_INDENT_ON_COLUMN = 2; // if bit set, broken fragments will be aligned on current location column (default is to break at current indentation level)
+ public static final int M_INDENT_BY_ONE = 4; // if bit set, broken fragments will be indented one level below current (not using continuation indentation)
+
+ // split modes can be combined either with M_FORCE or M_INDENT_ON_COLUMN
+
+ /** foobar(#fragment1, #fragment2, <ul>
+ * <li> #fragment3, #fragment4 </li>
+ * </ul>
+ */
+ public static final int M_COMPACT_SPLIT = 16; // fill each line with all possible fragments
+
+ /** foobar(<ul>
+ * <li> #fragment1, #fragment2, </li>
+ * <li> #fragment5, #fragment4, </li>
+ * </ul>
+ */
+ public static final int M_COMPACT_FIRST_BREAK_SPLIT = 32; // compact mode, but will first try to break before first fragment
+
+ /** foobar(<ul>
+ * <li> #fragment1, </li>
+ * <li> #fragment2, </li>
+ * <li> #fragment3 </li>
+ * <li> #fragment4, </li>
+ * </ul>
+ */
+ public static final int M_ONE_PER_LINE_SPLIT = 32+16; // one fragment per line
+
+ /**
+ * foobar(<ul>
+ * <li> #fragment1, </li>
+ * <li> #fragment2, </li>
+ * <li> #fragment3 </li>
+ * <li> #fragment4, </li>
+ * </ul>
+ */
+ public static final int M_NEXT_SHIFTED_SPLIT = 64; // one fragment per line, subsequent are indented further
+
+ /** foobar(#fragment1, <ul>
+ * <li> #fragment2, </li>
+ * <li> #fragment3 </li>
+ * <li> #fragment4, </li>
+ * </ul>
+ */
+ public static final int M_NEXT_PER_LINE_SPLIT = 64+16; // one per line, except first fragment (if possible)
+
+ //64+32
+ //64+32+16
+
+ // mode controlling column alignments
+ /**
+ * <table BORDER COLS=4 WIDTH="100%" >
+ * <tr><td>#fragment1A</td> <td>#fragment2A</td> <td>#fragment3A</td> <td>#very-long-fragment4A</td></tr>
+ * <tr><td>#fragment1B</td> <td>#long-fragment2B</td> <td>#fragment3B</td> <td>#fragment4B</td></tr>
+ * <tr><td>#very-long-fragment1C</td> <td>#fragment2C</td> <td>#fragment3C</td> <td>#fragment4C</td></tr>
+ * </table>
+ */
+ public static final int M_MULTICOLUMN = 256; // fragments are on same line, but multiple line of fragments will be aligned vertically
+
+ public static final int M_NO_ALIGNMENT = 0;
+
+ public int mode;
+
+ public static final int SPLIT_MASK = M_ONE_PER_LINE_SPLIT | M_NEXT_SHIFTED_SPLIT | M_COMPACT_SPLIT | M_COMPACT_FIRST_BREAK_SPLIT | M_NEXT_PER_LINE_SPLIT;
+
+ // alignment tie-break rules - when split is needed, will decide whether innermost/outermost alignment is to be chosen
+ public static final int R_OUTERMOST = 1;
+ public static final int R_INNERMOST = 2;
+ public int tieBreakRule;
+
+ // alignment effects on a per fragment basis
+ public static int NONE = 0;
+ public static int BREAK = 1;
+
+ // chunk kind
+ public static final int CHUNK_FIELD = 1;
+ public static final int CHUNK_METHOD = 2;
+ public static final int CHUNK_TYPE = 3;
+ public static final int CHUNK_ENUM = 4;
+}
diff --git a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/CAutoIndentTest.java b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/CAutoIndentTest.java
index 1768684c63f..3211888b111 100644
--- a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/CAutoIndentTest.java
+++ b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/CAutoIndentTest.java
@@ -19,11 +19,6 @@ import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;
-import org.eclipse.cdt.internal.ui.text.CAutoIndentStrategy;
-import org.eclipse.cdt.internal.ui.text.CCommentAutoIndentStrategy;
-import org.eclipse.cdt.internal.ui.text.CTextTools;
-import org.eclipse.cdt.internal.ui.text.ICPartitions;
-import org.eclipse.cdt.ui.CUIPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.jface.text.BadLocationException;
import org.eclipse.jface.text.Document;
@@ -32,6 +27,15 @@ import org.eclipse.jface.text.IAutoEditStrategy;
import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.IRegion;
import org.eclipse.jface.text.TextUtilities;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.PlatformUI;
+
+import org.eclipse.cdt.ui.CUIPlugin;
+import org.eclipse.cdt.ui.text.ICPartitions;
+
+import org.eclipse.cdt.internal.ui.text.CAutoIndentStrategy;
+import org.eclipse.cdt.internal.ui.text.CCommentAutoIndentStrategy;
+import org.eclipse.cdt.internal.ui.text.CTextTools;
/**
* Testing the auto indent strategies.
@@ -71,7 +75,7 @@ public class CAutoIndentTest extends TestCase {
public void type(char c) throws BadLocationException {
TestDocumentCommand command = new TestDocumentCommand(fCaretOffset, 0, new String(new char[] { c }));
customizeDocumentCommand(command);
- fCaretOffset += command.exec(fDoc);
+ fCaretOffset = command.exec(fDoc);
}
private void customizeDocumentCommand(TestDocumentCommand command) throws BadLocationException {
@@ -94,7 +98,7 @@ public class CAutoIndentTest extends TestCase {
public void paste(String text) throws BadLocationException {
TestDocumentCommand command = new TestDocumentCommand(fCaretOffset, 0, text);
customizeDocumentCommand(command);
- fCaretOffset += command.exec(fDoc);
+ fCaretOffset = command.exec(fDoc);
}
public void paste(int offset, String text) throws BadLocationException {
@@ -110,13 +114,32 @@ public class CAutoIndentTest extends TestCase {
public void backspace() throws BadLocationException {
TestDocumentCommand command = new TestDocumentCommand(fCaretOffset-1, 1, ""); //$NON-NLS-1$
customizeDocumentCommand(command);
- fCaretOffset += command.exec(fDoc);
+ fCaretOffset = command.exec(fDoc);
}
public int getCaretOffset() {
return fCaretOffset;
}
+ public int setCaretOffset(int offset) {
+ fCaretOffset = offset;
+ if (fCaretOffset < 0)
+ fCaretOffset = 0;
+ else if (fCaretOffset > fDoc.getLength())
+ fCaretOffset = fDoc.getLength();
+ return fCaretOffset;
+ }
+
+ /**
+ * Moves caret right or left by the given number of characters.
+ *
+ * @param shift Move distance.
+ * @return New caret offset.
+ */
+ public int moveCaret(int shift) {
+ return setCaretOffset(fCaretOffset + shift);
+ }
+
public int getCaretLine() throws BadLocationException {
return fDoc.getLineOfOffset(fCaretOffset);
}
@@ -167,12 +190,16 @@ public class CAutoIndentTest extends TestCase {
owner = null;
caretOffset = -1;
-
}
+ /**
+ * Returns new caret position.
+ */
public int exec(IDocument doc) throws BadLocationException {
doc.replace(offset, length, text);
- return text.length() - length;
+ return caretOffset != -1 ?
+ caretOffset :
+ offset + (text == null ? 0 : text.length());
}
}
@@ -188,13 +215,21 @@ public class CAutoIndentTest extends TestCase {
return new TestSuite(CAutoIndentTest.class);
}
+ protected void setUp() throws Exception {
+ super.setUp();
+ Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
+ shell.forceActive();
+ shell.forceFocus();
+ }
+
private AutoEditTester createAutoEditTester() {
CTextTools textTools = CUIPlugin.getDefault().getTextTools();
IDocument doc = new Document();
textTools.setupCDocument(doc);
AutoEditTester tester = new AutoEditTester(doc, textTools.getDocumentPartitioning());
- tester.setAutoEditStrategy(IDocument.DEFAULT_CONTENT_TYPE, new CAutoIndentStrategy());
- tester.setAutoEditStrategy(ICPartitions.C_MULTILINE_COMMENT, new CCommentAutoIndentStrategy());
+ tester.setAutoEditStrategy(IDocument.DEFAULT_CONTENT_TYPE,
+ new CAutoIndentStrategy(textTools.getDocumentPartitioning(), null));
+ tester.setAutoEditStrategy(ICPartitions.C_MULTI_LINE_COMMENT, new CCommentAutoIndentStrategy());
return tester;
}
@@ -202,10 +237,38 @@ public class CAutoIndentTest extends TestCase {
AutoEditTester tester = createAutoEditTester(); //$NON-NLS-1$
tester.type("void main() {\n"); //$NON-NLS-1$
assertEquals(1, tester.getCaretLine());
+ // Nested statement is indented by one.
assertEquals(1, tester.getCaretColumn());
- tester.type("}\n"); //$NON-NLS-1$
+ // The brace was closed automatically.
+ assertEquals("}", tester.getLine(1)); //$NON-NLS-1$
+ tester.type("if (expression1 &&\n"); //$NON-NLS-1$
assertEquals(2, tester.getCaretLine());
- assertEquals(0, tester.getCaretColumn());
+ // Continuation line is indented by two relative to the statement.
+ assertEquals(3, tester.getCaretColumn());
+ tester.type("expression2 &&\n"); //$NON-NLS-1$
+ assertEquals(3, tester.getCaretLine());
+ // Second continuation line is also indented by two relative to the statement.
+ assertEquals(3, tester.getCaretColumn());
+ tester.type("expression3) {"); //$NON-NLS-1$
+ // Remember caret position.
+ int offset = tester.getCaretOffset();
+ // Press Enter
+ tester.type("\n"); //$NON-NLS-1$
+ assertEquals(4, tester.getCaretLine());
+ // Nested statement is indented by one relative to the containing statement.
+ assertEquals(2, tester.getCaretColumn());
+ // The brace was closed automatically.
+ assertEquals("\t}", tester.getLine(1)); //$NON-NLS-1$
+ tester.type("int x = 5;"); //$NON-NLS-1$
+ // Move caret back after the opening brace.
+ tester.setCaretOffset(offset);
+ // Press Enter
+ tester.type("\n"); //$NON-NLS-1$
+ assertEquals(4, tester.getCaretLine());
+ // Nested statement is indented by one relative to the containing statement.
+ assertEquals(2, tester.getCaretColumn());
+ // No auto closing brace since the braces are already balanced.
+ assertEquals("\t\tint x = 5;", tester.getLine(1)); //$NON-NLS-1$
}
public void testDefaultAutoIndent() throws IOException, CoreException, BadLocationException {
@@ -233,7 +296,7 @@ public class CAutoIndentTest extends TestCase {
public void testCCommentAutoIndent() throws IOException, CoreException, BadLocationException {
AutoEditTester tester = createAutoEditTester(); //$NON-NLS-1$
tester.type("/*\n"); //$NON-NLS-1$
- assertEquals(ICPartitions.C_MULTILINE_COMMENT, tester.getContentType(-1));
+ assertEquals(ICPartitions.C_MULTI_LINE_COMMENT, tester.getContentType(-1));
assertEquals(1, tester.getCaretLine());
assertEquals(3, tester.getCaretColumn());
assertEquals(" * ", tester.getLine()); //$NON-NLS-1$
diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/util/CodeFormatterUtil.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/util/CodeFormatterUtil.java
index 32daf455f99..d6185d28a33 100644
--- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/util/CodeFormatterUtil.java
+++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/util/CodeFormatterUtil.java
@@ -12,9 +12,13 @@ package org.eclipse.cdt.internal.corext.util;
import java.util.Map;
+import org.eclipse.cdt.core.CCorePlugin;
import org.eclipse.cdt.core.ToolFactory;
import org.eclipse.cdt.core.formatter.CodeFormatter;
+import org.eclipse.cdt.core.formatter.CodeFormatterConstants;
+import org.eclipse.cdt.core.model.ICProject;
import org.eclipse.cdt.ui.CUIPlugin;
+
import org.eclipse.core.runtime.Assert;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.jface.text.BadLocationException;
@@ -34,7 +38,82 @@ public class CodeFormatterUtil {
// String str= format(CodeFormatter.K_EXPRESSION, "x", indent, null, "", (Map) null); //$NON-NLS-1$ //$NON-NLS-2$
// return str.substring(0, str.indexOf('x'));
// }
+
+ /**
+ * Gets the current tab width.
+ *
+ * @param project The project where the source is used, used for project
+ * specific options or <code>null</code> if the project is unknown
+ * and the workspace default should be used
+ * @return The tab width
+ */
+ public static int getTabWidth(ICProject project) {
+ /*
+ * If the tab-char is SPACE, FORMATTER_INDENTATION_SIZE is not used
+ * by the core formatter.
+ * We piggy back the visual tab length setting in that preference in
+ * that case.
+ */
+ String key;
+ if (CCorePlugin.SPACE.equals(getCoreOption(project, CodeFormatterConstants.FORMATTER_TAB_CHAR)))
+ key= CodeFormatterConstants.FORMATTER_INDENTATION_SIZE;
+ else
+ key= CodeFormatterConstants.FORMATTER_TAB_SIZE;
+ return getCoreOption(project, key, 4);
+ }
+
+ /**
+ * Returns the current indent width.
+ *
+ * @param project the project where the source is used or <code>null</code>
+ * if the project is unknown and the workspace default should be used
+ * @return the indent width
+ */
+ public static int getIndentWidth(ICProject project) {
+ String key;
+ if (CodeFormatterConstants.MIXED.equals(getCoreOption(project, CodeFormatterConstants.FORMATTER_TAB_CHAR)))
+ key= CodeFormatterConstants.FORMATTER_INDENTATION_SIZE;
+ else
+ key= CodeFormatterConstants.FORMATTER_TAB_SIZE;
+
+ return getCoreOption(project, key, 4);
+ }
+
+ /**
+ * Returns the possibly <code>project</code>-specific core preference
+ * defined under <code>key</code>.
+ *
+ * @param project the project to get the preference from, or
+ * <code>null</code> to get the global preference
+ * @param key the key of the preference
+ * @return the value of the preference
+ */
+ private static String getCoreOption(ICProject project, String key) {
+ if (project == null)
+ return CCorePlugin.getOption(key);
+ return project.getOption(key, true);
+ }
+
+ /**
+ * Returns the possibly <code>project</code>-specific core preference
+ * defined under <code>key</code>, or <code>def</code> if the value is
+ * not a integer.
+ *
+ * @param project the project to get the preference from, or
+ * <code>null</code> to get the global preference
+ * @param key the key of the preference
+ * @param def the default value
+ * @return the value of the preference
+ */
+ private static int getCoreOption(ICProject project, String key, int def) {
+ try {
+ return Integer.parseInt(getCoreOption(project, key));
+ } catch (NumberFormatException e) {
+ return def;
+ }
+ }
+
/**
* Evaluates the edit on the given string.
* @throws IllegalArgumentException If the positions are not inside the string, a
diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/actions/AddBlockCommentAction.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/actions/AddBlockCommentAction.java
index d1a444e8b86..08b313c3a15 100644
--- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/actions/AddBlockCommentAction.java
+++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/actions/AddBlockCommentAction.java
@@ -15,7 +15,6 @@ import java.util.LinkedList;
import java.util.List;
import java.util.ResourceBundle;
-import org.eclipse.cdt.internal.ui.text.ICPartitions;
import org.eclipse.jface.text.Assert;
import org.eclipse.jface.text.BadLocationException;
import org.eclipse.jface.text.BadPartitioningException;
@@ -25,6 +24,8 @@ import org.eclipse.jface.text.ITextSelection;
import org.eclipse.jface.text.ITypedRegion;
import org.eclipse.ui.texteditor.ITextEditor;
+import org.eclipse.cdt.ui.text.ICPartitions;
+
/**
* Action that encloses the editor's current selection with Java block comment terminators
* (<code>&#47;&#42;</code> and <code>&#42;&#47;</code>).
@@ -109,7 +110,7 @@ public class AddBlockCommentAction extends BlockCommentAction {
int partEndOffset= partition.getOffset() + partition.getLength();
int tokenLength= getCommentStart().length();
- if (partType == ICPartitions.C_MULTILINE_COMMENT) {
+ if (partType == ICPartitions.C_MULTI_LINE_COMMENT) {
// already in a comment - remove ending mark
edits.add(factory.createEdit(partEndOffset - tokenLength, tokenLength, "")); //$NON-NLS-1$
}
@@ -119,7 +120,7 @@ public class AddBlockCommentAction extends BlockCommentAction {
partType= partition.getType();
// start of next partition
- if (partType == ICPartitions.C_MULTILINE_COMMENT) {
+ if (partType == ICPartitions.C_MULTI_LINE_COMMENT) {
// already in a comment - remove startToken
edits.add(factory.createEdit(partition.getOffset(), getCommentStart().length(), "")); //$NON-NLS-1$
}
diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/actions/RemoveBlockCommentAction.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/actions/RemoveBlockCommentAction.java
index e5ba8cbf413..331853af49e 100644
--- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/actions/RemoveBlockCommentAction.java
+++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/actions/RemoveBlockCommentAction.java
@@ -15,7 +15,6 @@ import java.util.LinkedList;
import java.util.List;
import java.util.ResourceBundle;
-import org.eclipse.cdt.internal.ui.text.ICPartitions;
import org.eclipse.jface.text.BadLocationException;
import org.eclipse.jface.text.BadPartitioningException;
import org.eclipse.jface.text.IDocumentExtension3;
@@ -23,6 +22,8 @@ import org.eclipse.jface.text.ITextSelection;
import org.eclipse.jface.text.ITypedRegion;
import org.eclipse.ui.texteditor.ITextEditor;
+import org.eclipse.cdt.ui.text.ICPartitions;
+
/**
* Action that removes the enclosing comment marks from a Java block comment.
*
@@ -59,7 +60,7 @@ public class RemoveBlockCommentAction extends BlockCommentAction {
while (partEndOffset < endOffset) {
- if (partition.getType() == ICPartitions.C_MULTILINE_COMMENT) {
+ if (partition.getType() == ICPartitions.C_MULTI_LINE_COMMENT) {
edits.add(factory.createEdit(partOffset, tokenLength, "")); //$NON-NLS-1$
edits.add(factory.createEdit(partEndOffset - tokenLength, tokenLength, "")); //$NON-NLS-1$
}
@@ -69,7 +70,7 @@ public class RemoveBlockCommentAction extends BlockCommentAction {
partEndOffset= partOffset + partition.getLength();
}
- if (partition.getType() == ICPartitions.C_MULTILINE_COMMENT) {
+ if (partition.getType() == ICPartitions.C_MULTI_LINE_COMMENT) {
edits.add(factory.createEdit(partOffset, tokenLength, "")); //$NON-NLS-1$
edits.add(factory.createEdit(partEndOffset - tokenLength, tokenLength, "")); //$NON-NLS-1$
}
diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/CEditor.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/CEditor.java
index 03f3ac7b135..61a9edc6c28 100644
--- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/CEditor.java
+++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/CEditor.java
@@ -129,6 +129,7 @@ import org.eclipse.cdt.ui.CUIPlugin;
import org.eclipse.cdt.ui.IWorkingCopyManager;
import org.eclipse.cdt.ui.PreferenceConstants;
import org.eclipse.cdt.ui.actions.ShowInCViewAction;
+import org.eclipse.cdt.ui.text.ICPartitions;
import org.eclipse.cdt.ui.text.folding.ICFoldingStructureProvider;
import org.eclipse.cdt.internal.ui.ICHelpContextIds;
@@ -149,7 +150,6 @@ import org.eclipse.cdt.internal.ui.text.CTextTools;
import org.eclipse.cdt.internal.ui.text.CWordIterator;
import org.eclipse.cdt.internal.ui.text.DocumentCharacterIterator;
import org.eclipse.cdt.internal.ui.text.HTMLTextPresenter;
-import org.eclipse.cdt.internal.ui.text.ICPartitions;
import org.eclipse.cdt.internal.ui.text.c.hover.SourceViewerInformationControl;
import org.eclipse.cdt.internal.ui.text.contentassist.ContentAssistPreference;
import org.eclipse.cdt.internal.ui.util.CUIHelp;
@@ -1481,52 +1481,50 @@ public class CEditor extends TextEditor implements ISelectionChangedListener, IS
}
public void customizeDocumentCommand(IDocument document, DocumentCommand command) {
- String text= command.text;
+ String text = command.text;
if (text == null)
return;
- int index= text.indexOf('\t');
+ int index = text.indexOf('\t');
if (index > -1) {
-
- StringBuffer buffer= new StringBuffer();
+ StringBuffer buffer = new StringBuffer();
fLineTracker.set(command.text);
- int lines= fLineTracker.getNumberOfLines();
+ int lines = fLineTracker.getNumberOfLines();
try {
+ for (int i = 0; i < lines; i++) {
+ int offset = fLineTracker.getLineOffset(i);
+ int endOffset = offset + fLineTracker.getLineLength(i);
+ String line = text.substring(offset, endOffset);
- for (int i= 0; i < lines; i++) {
-
- int offset= fLineTracker.getLineOffset(i);
- int endOffset= offset + fLineTracker.getLineLength(i);
- String line= text.substring(offset, endOffset);
-
- int position= 0;
- if (i == 0) {
- IRegion firstLine= document.getLineInformationOfOffset(command.offset);
- position= command.offset - firstLine.getOffset();
- }
-
- int length= line.length();
- for (int j= 0; j < length; j++) {
- char c= line.charAt(j);
- if (c == '\t') {
- position += insertTabString(buffer, position);
- } else {
- buffer.append(c);
- ++ position;
+ int position= 0;
+ if (i == 0) {
+ IRegion firstLine = document.getLineInformationOfOffset(command.offset);
+ position = command.offset - firstLine.getOffset();
+ }
+
+ int length = line.length();
+ for (int j = 0; j < length; j++) {
+ char c = line.charAt(j);
+ if (c == '\t') {
+ int oldPosition = position;
+ position += insertTabString(buffer, position);
+ if (command.caretOffset > command.offset + oldPosition) {
+ command.caretOffset += position - oldPosition - 1;
}
+ } else {
+ buffer.append(c);
+ ++position;
}
-
}
+ }
- command.text= buffer.toString();
-
+ command.text = buffer.toString();
} catch (BadLocationException x) {
}
}
}
-
}
/*
diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/asm/AsmSourceViewerConfiguration.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/asm/AsmSourceViewerConfiguration.java
index 53f02570c80..96252ea8385 100644
--- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/asm/AsmSourceViewerConfiguration.java
+++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/asm/AsmSourceViewerConfiguration.java
@@ -20,7 +20,7 @@ import org.eclipse.jface.text.rules.RuleBasedScanner;
import org.eclipse.jface.text.source.ISourceViewer;
import org.eclipse.ui.editors.text.TextSourceViewerConfiguration;
-import org.eclipse.cdt.internal.ui.text.ICPartitions;
+import org.eclipse.cdt.ui.text.ICPartitions;
public class AsmSourceViewerConfiguration extends TextSourceViewerConfiguration {
@@ -83,8 +83,8 @@ public class AsmSourceViewerConfiguration extends TextSourceViewerConfiguration
reconciler.setRepairer(dr, IDocument.DEFAULT_CONTENT_TYPE);
dr= new DefaultDamagerRepairer(getMultilineCommentScanner());
- reconciler.setDamager(dr, ICPartitions.C_MULTILINE_COMMENT);
- reconciler.setRepairer(dr, ICPartitions.C_MULTILINE_COMMENT);
+ reconciler.setDamager(dr, ICPartitions.C_MULTI_LINE_COMMENT);
+ reconciler.setRepairer(dr, ICPartitions.C_MULTI_LINE_COMMENT);
dr= new DefaultDamagerRepairer(getSinglelineCommentScanner());
reconciler.setDamager(dr, ICPartitions.C_SINGLE_LINE_COMMENT);
@@ -108,7 +108,7 @@ public class AsmSourceViewerConfiguration extends TextSourceViewerConfiguration
public String[] getConfiguredContentTypes(ISourceViewer sourceViewer) {
return new String[] {
IDocument.DEFAULT_CONTENT_TYPE,
- ICPartitions.C_MULTILINE_COMMENT,
+ ICPartitions.C_MULTI_LINE_COMMENT,
ICPartitions.C_SINGLE_LINE_COMMENT,
ICPartitions.C_STRING,
ICPartitions.C_CHARACTER };
diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/CAutoIndentStrategy.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/CAutoIndentStrategy.java
index 6efa1b17908..52900e3da5d 100644
--- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/CAutoIndentStrategy.java
+++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/CAutoIndentStrategy.java
@@ -9,33 +9,66 @@
* IBM Corporation - initial API and implementation
* QNX Software System
* Anton Leherbauer (Wind River Systems) - Fixed bug 48339
+ * Sergey Prigogin, Google
*******************************************************************************/
package org.eclipse.cdt.internal.ui.text;
+import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.jface.text.BadLocationException;
import org.eclipse.jface.text.DefaultIndentLineAutoEditStrategy;
import org.eclipse.jface.text.DocumentCommand;
import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.IRegion;
+import org.eclipse.jface.text.TextUtilities;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.texteditor.ITextEditorExtension3;
-
+import org.eclipse.cdt.core.model.ICProject;
import org.eclipse.cdt.ui.CUIPlugin;
+import org.eclipse.cdt.ui.PreferenceConstants;
+import org.eclipse.cdt.ui.text.ICPartitions;
/**
* Auto indent strategy sensitive to brackets.
*/
public class CAutoIndentStrategy extends DefaultIndentLineAutoEditStrategy {
+ private static final String MULTILINE_COMMENT_CLOSE = "*/"; //$NON-NLS-1$
+// private static final GCCScannerExtensionConfiguration C_GNU_SCANNER_EXTENSION = new GCCScannerExtensionConfiguration();
- private final static String MULTILINE_COMMENT_CLOSE = "*/"; //$NON-NLS-1$
+ private static class CompilationUnitInfo {
+ char[] buffer;
+ int delta;
- public CAutoIndentStrategy() {
+ CompilationUnitInfo(char[] buffer, int delta) {
+ this.buffer = buffer;
+ this.delta = delta;
+ }
}
+ private boolean fCloseBrace;
+ private boolean fIsSmartMode;
+
+ private String fPartitioning;
+ private final ICProject fProject;
+
+ /**
+ * Creates a new C auto indent strategy for the given document partitioning.
+ *
+ * @param partitioning the document partitioning
+ * @param project the project to get formatting preferences from, or null to use default preferences
+ */
+ public CAutoIndentStrategy(String partitioning, ICProject project) {
+ fPartitioning = partitioning;
+ fProject = project;
+ }
+
// evaluate the line with the opening bracket that matches the closing bracket on the given line
protected int findMatchingOpenBracket(IDocument d, int line, int end, int closingBracketIncrease) throws BadLocationException {
- int start= d.getLineOffset(line);
- int brackcount= getBracketCount(d, start, end, false) - closingBracketIncrease;
+ int start = d.getLineOffset(line);
+ int brackcount = getBracketCount(d, start, end, false) - closingBracketIncrease;
// sum up the brackets counts of each line (closing brackets count negative,
@@ -45,8 +78,8 @@ public class CAutoIndentStrategy extends DefaultIndentLineAutoEditStrategy {
if (line < 0) {
return -1;
}
- start= d.getLineOffset(line);
- end= start + d.getLineLength(line) - 1;
+ start = d.getLineOffset(line);
+ end = start + d.getLineLength(line) - 1;
brackcount += getBracketCount(d, start, end, false);
}
return line;
@@ -54,36 +87,36 @@ public class CAutoIndentStrategy extends DefaultIndentLineAutoEditStrategy {
private int getBracketCount(IDocument d, int start, int end, boolean ignoreCloseBrackets) throws BadLocationException {
- int bracketcount= 0;
+ int bracketcount = 0;
while (start < end) {
- char curr= d.getChar(start);
+ char curr = d.getChar(start);
start++;
switch (curr) {
case '/' :
if (start < end) {
- char next= d.getChar(start);
+ char next = d.getChar(start);
if (next == '*') {
// a comment starts, advance to the comment end
- start= getCommentEnd(d, start + 1, end);
+ start = getCommentEnd(d, start + 1, end);
} else if (next == '/') {
// '//'-comment: nothing to do anymore on this line
- start= end;
+ start = end;
}
}
break;
case '*' :
if (start < end) {
- char next= d.getChar(start);
+ char next = d.getChar(start);
if (next == '/') {
// we have been in a comment: forget what we read before
- bracketcount= 0;
+ bracketcount = 0;
start++;
}
}
break;
case '{' :
bracketcount++;
- ignoreCloseBrackets= false;
+ ignoreCloseBrackets = false;
break;
case '}' :
if (!ignoreCloseBrackets) {
@@ -92,7 +125,7 @@ public class CAutoIndentStrategy extends DefaultIndentLineAutoEditStrategy {
break;
case '"' :
case '\'' :
- start= getStringEnd(d, start, end, curr);
+ start = getStringEnd(d, start, end, curr);
break;
default :
}
@@ -105,7 +138,7 @@ public class CAutoIndentStrategy extends DefaultIndentLineAutoEditStrategy {
private int getCommentEnd(IDocument d, int pos, int end) throws BadLocationException {
while (pos < end) {
- char curr= d.getChar(pos);
+ char curr = d.getChar(pos);
pos++;
if (curr == '*') {
if (pos < end && d.getChar(pos) == '/') {
@@ -118,9 +151,9 @@ public class CAutoIndentStrategy extends DefaultIndentLineAutoEditStrategy {
protected String getIndentOfLine(IDocument d, int line) throws BadLocationException {
if (line > -1) {
- int start= d.getLineOffset(line);
- int end= start + d.getLineLength(line) - 1;
- int whiteend= findEndOfWhiteSpace(d, start, end);
+ int start = d.getLineOffset(line);
+ int end = start + d.getLineLength(line) - 1;
+ int whiteend = findEndOfWhiteSpace(d, start, end);
return d.get(start, whiteend - start);
}
return ""; //$NON-NLS-1$
@@ -128,7 +161,7 @@ public class CAutoIndentStrategy extends DefaultIndentLineAutoEditStrategy {
private int getStringEnd(IDocument d, int pos, int end, char ch) throws BadLocationException {
while (pos < end) {
- char curr= d.getChar(pos);
+ char curr = d.getChar(pos);
pos++;
if (curr == '\\') {
// ignore escaped characters
@@ -145,26 +178,26 @@ public class CAutoIndentStrategy extends DefaultIndentLineAutoEditStrategy {
return;
try {
- int p= (c.offset == d.getLength() ? c.offset - 1 : c.offset);
- int line= d.getLineOfOffset(p);
- int start= d.getLineOffset(line);
- int whiteend= findEndOfWhiteSpace(d, start, c.offset);
+ int p = (c.offset == d.getLength() ? c.offset - 1 : c.offset);
+ int line = d.getLineOfOffset(p);
+ int start = d.getLineOffset(line);
+ int whiteend = findEndOfWhiteSpace(d, start, c.offset);
// shift only when line does not contain any text up to the closing bracket
if (whiteend == c.offset) {
// evaluate the line with the opening bracket that matches out closing bracket
- int indLine= findMatchingOpenBracket(d, line, c.offset, 1);
+ int indLine = findMatchingOpenBracket(d, line, c.offset, 1);
if (indLine != -1 && indLine != line) {
// take the indent of the found line
- StringBuffer replaceText= new StringBuffer(getIndentOfLine(d, indLine));
+ StringBuffer replaceText = new StringBuffer(getIndentOfLine(d, indLine));
// add the rest of the current line including the just added close bracket
replaceText.append(d.get(whiteend, c.offset - whiteend));
replaceText.append(c.text);
// modify document command
- c.length= c.offset - start;
- c.offset= start;
- c.text= replaceText.toString();
+ c.length = c.offset - start;
+ c.offset = start;
+ c.text = replaceText.toString();
}
}
} catch (BadLocationException excp) {
@@ -172,69 +205,453 @@ public class CAutoIndentStrategy extends DefaultIndentLineAutoEditStrategy {
}
}
- protected void smartIndentAfterNewLine(IDocument d, DocumentCommand c) {
- int docLength= d.getLength();
- if (c.offset == -1 || docLength == 0)
+ private void smartIndentAfterClosingBracket(IDocument d, DocumentCommand c) {
+ if (c.offset == -1 || d.getLength() == 0)
return;
try {
- int p= (c.offset == docLength ? c.offset - 1 : c.offset);
- int line= d.getLineOfOffset(p);
+ int p = (c.offset == d.getLength() ? c.offset - 1 : c.offset);
+ int line = d.getLineOfOffset(p);
+ int start = d.getLineOffset(line);
+ int whiteend = findEndOfWhiteSpace(d, start, c.offset);
+ CHeuristicScanner scanner = new CHeuristicScanner(d);
+ CIndenter indenter = new CIndenter(d, scanner, fProject);
- StringBuffer buf= new StringBuffer(c.text);
- if (c.offset < docLength && d.getChar(c.offset) == '}') {
- int indLine= findMatchingOpenBracket(d, line, c.offset, 0);
- if (indLine == -1) {
- indLine= line;
+ // shift only when line does not contain any text up to the closing bracket
+ if (whiteend == c.offset) {
+ // evaluate the line with the opening bracket that matches out closing bracket
+ int reference = indenter.findReferencePosition(c.offset, false, true, false, false);
+ int indLine = d.getLineOfOffset(reference);
+ if (indLine != -1 && indLine != line) {
+ // take the indent of the found line
+ StringBuffer replaceText = new StringBuffer(getIndentOfLine(d, indLine));
+ // add the rest of the current line including the just added close bracket
+ replaceText.append(d.get(whiteend, c.offset - whiteend));
+ replaceText.append(c.text);
+ // modify document command
+ c.length += c.offset - start;
+ c.offset = start;
+ c.text = replaceText.toString();
}
- buf.append(getIndentOfLine(d, indLine));
- } else {
- int start= d.getLineOffset(line);
- int whiteend= findEndOfWhiteSpace(d, start, c.offset);
- buf.append(d.get(start, whiteend - start));
- if (getBracketCount(d, start, c.offset, true) > 0) {
- buf.append('\t');
+ }
+ } catch (BadLocationException e) {
+ CUIPlugin.getDefault().log(e);
+ }
+ }
+
+ private void smartIndentAfterOpeningBracket(IDocument d, DocumentCommand c) {
+ if (c.offset < 1 || d.getLength() == 0)
+ return;
+
+ CHeuristicScanner scanner = new CHeuristicScanner(d);
+
+ int p = (c.offset == d.getLength() ? c.offset - 1 : c.offset);
+
+ try {
+ // current line
+ int line = d.getLineOfOffset(p);
+ int lineOffset = d.getLineOffset(line);
+
+ // make sure we don't have any leading comments etc.
+ if (d.get(lineOffset, p - lineOffset).trim().length() != 0)
+ return;
+
+ // line of last javacode
+ int pos = scanner.findNonWhitespaceBackward(p, CHeuristicScanner.UNBOUND);
+ if (pos == -1)
+ return;
+ int lastLine = d.getLineOfOffset(pos);
+
+ // only shift if the last java line is further up and is a braceless block candidate
+ if (lastLine < line) {
+ CIndenter indenter = new CIndenter(d, scanner, fProject);
+ StringBuffer indent = indenter.computeIndentation(p, true);
+ String toDelete = d.get(lineOffset, c.offset - lineOffset);
+ if (indent != null && !indent.toString().equals(toDelete)) {
+ c.text = indent.append(c.text).toString();
+ c.length += c.offset - lineOffset;
+ c.offset = lineOffset;
}
}
- c.text= buf.toString();
+ } catch (BadLocationException e) {
+ CUIPlugin.getDefault().log(e);
+ }
+ }
- } catch (BadLocationException excp) {
- CUIPlugin.getDefault().log(excp);
+ private void smartIndentAfterNewLine(IDocument d, DocumentCommand c) {
+ CHeuristicScanner scanner = new CHeuristicScanner(d);
+ CIndenter indenter = new CIndenter(d, scanner, fProject);
+ StringBuffer indent = indenter.computeIndentation(c.offset);
+ if (indent == null)
+ indent = new StringBuffer();
+
+ int docLength = d.getLength();
+ if (c.offset == -1 || docLength == 0)
+ return;
+
+ try {
+ int p = (c.offset == docLength ? c.offset - 1 : c.offset);
+ int line = d.getLineOfOffset(p);
+
+ StringBuffer buf = new StringBuffer(c.text + indent);
+
+ IRegion reg = d.getLineInformation(line);
+ int lineEnd = reg.getOffset() + reg.getLength();
+
+ int contentStart = findEndOfWhiteSpace(d, c.offset, lineEnd);
+ c.length = Math.max(contentStart - c.offset, 0);
+
+ int start = reg.getOffset();
+
+ // insert closing brace on new line after an unclosed opening brace
+ if (getBracketCount(d, start, c.offset, true) > 0 && fCloseBrace && !isClosedBrace(d, c.offset, c.length)) {
+ c.caretOffset = c.offset + buf.length();
+ c.shiftsCaret = false;
+
+ // copy old content of line behind insertion point to new line
+ // unless we think we are inserting an anonymous type definition
+ if (c.offset == 0 || !(computeAnonymousPosition(d, c.offset - 1, fPartitioning, lineEnd) != -1)) {
+ if (lineEnd - contentStart > 0) {
+ c.length = lineEnd - c.offset;
+ buf.append(d.get(contentStart, lineEnd - contentStart).toCharArray());
+ }
+ }
+
+ buf.append(TextUtilities.getDefaultLineDelimiter(d));
+ StringBuffer reference = null;
+ int nonWS = findEndOfWhiteSpace(d, start, lineEnd);
+ if (nonWS < c.offset && d.getChar(nonWS) == '{')
+ reference = new StringBuffer(d.get(start, nonWS - start));
+ else
+ reference = indenter.getReferenceIndentation(c.offset);
+ if (reference != null)
+ buf.append(reference);
+ buf.append('}');
+ }
+ // insert extra line upon new line between two braces
+ else if (c.offset > start && contentStart < lineEnd && d.getChar(contentStart) == '}') {
+ int firstCharPos = scanner.findNonWhitespaceBackward(c.offset - 1, start);
+ if (firstCharPos != CHeuristicScanner.NOT_FOUND && d.getChar(firstCharPos) == '{') {
+ c.caretOffset = c.offset + buf.length();
+ c.shiftsCaret = false;
+
+ StringBuffer reference = null;
+ int nonWS = findEndOfWhiteSpace(d, start, lineEnd);
+ if (nonWS < c.offset && d.getChar(nonWS) == '{')
+ reference = new StringBuffer(d.get(start, nonWS - start));
+ else
+ reference = indenter.getReferenceIndentation(c.offset);
+
+ buf.append(TextUtilities.getDefaultLineDelimiter(d));
+
+ if (reference != null)
+ buf.append(reference);
+ }
+ }
+ c.text = buf.toString();
+
+ } catch (BadLocationException e) {
+ CUIPlugin.getDefault().log(e);
}
}
/**
- * Returns whether the text ends with one of the given search strings.
+ * Computes an insert position for an opening brace if <code>offset</code> maps to a position in
+ * <code>document</code> with a expression in parenthesis that will take a block after the closing parenthesis.
+ *
+ * @param document the document being modified
+ * @param offset the offset of the caret position, relative to the line start.
+ * @param partitioning the document partitioning
+ * @param max the max position
+ * @return an insert position relative to the line start if <code>line</code> contains a parenthesized expression that can be followed by a block, -1 otherwise
*/
- private boolean endsWithDelimiter(IDocument d, String txt) {
- String[] delimiters= d.getLegalLineDelimiters();
-
- for (int i= 0; i < delimiters.length; i++) {
- if (txt.endsWith(delimiters[i]))
- return true;
+ private static int computeAnonymousPosition(IDocument document, int offset, String partitioning, int max) {
+ // find the opening parenthesis for every closing parenthesis on the current line after offset
+ // return the position behind the closing parenthesis if it looks like a method declaration
+ // or an expression for an if, while, for, catch statement
+
+ CHeuristicScanner scanner = new CHeuristicScanner(document);
+ int pos = offset;
+ int length = max;
+ int scanTo = scanner.scanForward(pos, length, '}');
+ if (scanTo == -1)
+ scanTo = length;
+
+ int closingParen = findClosingParenToLeft(scanner, pos) - 1;
+
+ while (true) {
+ int startScan = closingParen + 1;
+ closingParen = scanner.scanForward(startScan, scanTo, ')');
+ if (closingParen == -1)
+ break;
+
+ int openingParen = scanner.findOpeningPeer(closingParen - 1, '(', ')');
+
+ // no way an expression at the beginning of the document can mean anything
+ if (openingParen < 1)
+ break;
+
+ // only select insert positions for parenthesis currently embracing the caret
+ if (openingParen > pos)
+ continue;
}
+
+ return -1;
+ }
+
+ /**
+ * Finds a closing parenthesis to the left of <code>position</code> in document, where that parenthesis is only
+ * separated by whitespace from <code>position</code>. If no such parenthesis can be found, <code>position</code> is returned.
+ *
+ * @param scanner the java heuristic scanner set up on the document
+ * @param position the first character position in <code>document</code> to be considered
+ * @return the position of a closing parenthesis left to <code>position</code> separated only by whitespace, or <code>position</code> if no parenthesis can be found
+ */
+ private static int findClosingParenToLeft(CHeuristicScanner scanner, int position) {
+ if (position < 1)
+ return position;
+
+ if (scanner.previousToken(position - 1, CHeuristicScanner.UNBOUND) == Symbols.TokenRPAREN)
+ return scanner.getPosition() + 1;
+ return position;
+ }
+
+ private boolean isClosedBrace(IDocument document, int offset, int length) {
+ CompilationUnitInfo info = getCompilationUnitForMethod(document, offset, fPartitioning);
+ if (info == null)
+ return false;
+
+ return getBlockBalance(document, offset, fPartitioning) <= 0;
+ //TODO: Use smarter algorithm based on
+// CodeReader reader = new CodeReader(info.buffer);
+// ICodeReaderFactory fileCreator = CDOM.getInstance().getCodeReaderFactory(CDOM.PARSE_WORKING_COPY_WHENEVER_POSSIBLE);
+//
+// IScanner domScanner = new DOMScanner(reader, new ScannerInfo(), ParserMode.COMPLETE_PARSE,
+// ParserLanguage.C, ParserFactory.createDefaultLogService(),
+// C_GNU_SCANNER_EXTENSION, fileCreator);
+//
+// ISourceCodeParser parser = new GNUCPPSourceParser(
+// domScanner,
+// ParserMode.COMPLETE_PARSE,
+// ParserUtil.getParserLogService(),
+// new GPPParserExtensionConfiguration());
+//
+// IASTTranslationUnit translationUnit = parser.parse();
+// final int relativeOffset = offset - info.delta;
+// IASTNode node = translationUnit.selectNodeForLocation(reader.getPath(), relativeOffset, length);
+//
+// if (node == null)
+// return false;
+//
+// if (node instanceof IASTCompoundStatement) {
+// return getBlockBalance(document, offset, fPartitioning) <= 0;
+// } else if (node instanceof IASTIfStatement) {
+// IASTIfStatement ifStatement = (IASTIfStatement) node;
+// IASTExpression expression = ifStatement.getConditionExpression();
+// IRegion expressionRegion = createRegion(expression, info.delta);
+// IASTStatement thenStatement = ifStatement.getThenClause();
+// IRegion thenRegion = createRegion(thenStatement, info.delta);
+//
+// // Between expression and then statement
+// if (expressionRegion.getOffset() + expressionRegion.getLength() <= offset && offset + length <= thenRegion.getOffset())
+// return thenStatement != null;
+//
+// IASTStatement elseStatement = ifStatement.getElseClause();
+// IRegion elseRegion = createRegion(elseStatement, info.delta);
+//
+// if (elseStatement != null) {
+// int sourceOffset = thenRegion.getOffset() + thenRegion.getLength();
+// int sourceLength = elseRegion.getOffset() - sourceOffset;
+// CHeuristicScanner scanner = new CHeuristicScanner(new SimpleDocument(info.buffer));
+// int pos = sourceOffset;
+// int id;
+// while ((id = scanner.nextToken(pos, sourceOffset + sourceLength - pos)) != CHeuristicScanner.TokenEOF) {
+// if (id == CHeuristicScanner.TokenELSE) {
+// pos = scanner.getPosition();
+// // Between 'else' token and else statement.
+// return pos <= offset && offset + length < elseRegion.getOffset();
+// }
+// }
+//
+// return true;
+// }
+// } else if (node instanceof IASTForStatement) {
+// IASTExpression expression = ((IASTForStatement) node).getConditionExpression();
+// IRegion expressionRegion = createRegion(expression, info.delta);
+// IASTStatement body = ((IASTForStatement) node).getBody();
+// IRegion bodyRegion = createRegion(body, info.delta);
+//
+// // Between expression and body statement
+// if (expressionRegion.getOffset() + expressionRegion.getLength() <= offset && offset + length <= bodyRegion.getOffset()) {
+// return body != null;
+// }
+// } else if (node instanceof IASTWhileStatement) {
+// IASTExpression expression = ((IASTWhileStatement) node).getCondition();
+// IRegion expressionRegion = createRegion(expression, info.delta);
+// IASTStatement body = ((IASTWhileStatement) node).getBody();
+// IRegion bodyRegion = createRegion(body, info.delta);
+//
+// // Between expression and body statement
+// if (expressionRegion.getOffset() + expressionRegion.getLength() <= offset && offset + length <= bodyRegion.getOffset()) {
+// return body != null;
+// }
+// } else if (node instanceof IASTDoStatement) {
+// IASTDoStatement doStatement = (IASTDoStatement) node;
+// IRegion doRegion = createRegion(doStatement, info.delta);
+// IASTStatement body = doStatement.getBody();
+// IRegion bodyRegion = createRegion(body, info.delta);
+//
+// // Between 'do' and body statement.
+// if (doRegion.getOffset() + doRegion.getLength() <= offset && offset + length <= bodyRegion.getOffset()) {
+// return body != null;
+// }
+// }
+//
+// return true;
+ }
+
+ private boolean isLineDelimiter(IDocument document, String text) {
+ String[] delimiters = document.getLegalLineDelimiters();
+ if (delimiters != null)
+ return TextUtilities.equals(delimiters, text) > -1;
return false;
- }
+ }
+
+ private void smartIndentOnKeypress(IDocument document, DocumentCommand command) {
+ switch (command.text.charAt(0)) {
+ case '}':
+ smartIndentAfterClosingBracket(document, command);
+ break;
+ case '{':
+ smartIndentAfterOpeningBracket(document, command);
+ break;
+ case 'e':
+ smartIndentUponE(document, command);
+ break;
+ }
+ }
+
+ private void smartIndentUponE(IDocument d, DocumentCommand c) {
+ if (c.offset < 4 || d.getLength() == 0)
+ return;
+
+ try {
+ String content = d.get(c.offset - 3, 3);
+ if (content.equals("els")) { //$NON-NLS-1$
+ CHeuristicScanner scanner = new CHeuristicScanner(d);
+ int p = c.offset - 3;
+
+ // current line
+ int line = d.getLineOfOffset(p);
+ int lineOffset = d.getLineOffset(line);
+
+ // make sure we don't have any leading comments etc.
+ if (d.get(lineOffset, p - lineOffset).trim().length() != 0)
+ return;
+
+ // line of last javacode
+ int pos = scanner.findNonWhitespaceBackward(p - 1, CHeuristicScanner.UNBOUND);
+ if (pos == -1)
+ return;
+ int lastLine = d.getLineOfOffset(pos);
+
+ // only shift if the last java line is further up and is a braceless block candidate
+ if (lastLine < line) {
+
+ CIndenter indenter = new CIndenter(d, scanner, fProject);
+ int ref = indenter.findReferencePosition(p, true, false, false, false);
+ if (ref == CHeuristicScanner.NOT_FOUND)
+ return;
+ int refLine = d.getLineOfOffset(ref);
+ String indent = getIndentOfLine(d, refLine);
+
+ if (indent != null) {
+ c.text = indent.toString() + "else"; //$NON-NLS-1$
+ c.length += c.offset - lineOffset;
+ c.offset = lineOffset;
+ }
+ }
+
+ return;
+ }
+
+ if (content.equals("cas")) { //$NON-NLS-1$
+ CHeuristicScanner scanner = new CHeuristicScanner(d);
+ int p = c.offset - 3;
+
+ // current line
+ int line = d.getLineOfOffset(p);
+ int lineOffset = d.getLineOffset(line);
+
+ // make sure we don't have any leading comments etc.
+ if (d.get(lineOffset, p - lineOffset).trim().length() != 0)
+ return;
+
+ // line of last javacode
+ int pos = scanner.findNonWhitespaceBackward(p - 1, CHeuristicScanner.UNBOUND);
+ if (pos == -1)
+ return;
+ int lastLine = d.getLineOfOffset(pos);
+
+ // only shift if the last java line is further up and is a braceless block candidate
+ if (lastLine < line) {
+
+ CIndenter indenter = new CIndenter(d, scanner, fProject);
+ int ref = indenter.findReferencePosition(p, false, false, false, true);
+ if (ref == CHeuristicScanner.NOT_FOUND)
+ return;
+ int refLine = d.getLineOfOffset(ref);
+ int nextToken = scanner.nextToken(ref, CHeuristicScanner.UNBOUND);
+ String indent;
+ if (nextToken == Symbols.TokenCASE || nextToken == Symbols.TokenDEFAULT)
+ indent = getIndentOfLine(d, refLine);
+ else // at the brace of the switch
+ indent = indenter.computeIndentation(p).toString();
+
+ if (indent != null) {
+ c.text = indent.toString() + "case"; //$NON-NLS-1$
+ c.length += c.offset - lineOffset;
+ c.offset = lineOffset;
+ }
+ }
+
+ return;
+ }
+ } catch (BadLocationException e) {
+ CUIPlugin.getDefault().log(e);
+ }
+ }
/*
- * @see org.eclipse.jface.text.DefaultIndentLineAutoEditStrategy#customizeDocumentCommand(org.eclipse.jface.text.IDocument, org.eclipse.jface.text.DocumentCommand)
+ * @see org.eclipse.jface.text.IAutoEditStrategy#customizeDocumentCommand(IDocument, DocumentCommand)
*/
public void customizeDocumentCommand(IDocument d, DocumentCommand c) {
- if (c.length == 0 && c.text != null && endsWithDelimiter(d, c.text)) {
+ if (!c.doit)
+ return;
+
+ clearCachedValues();
+ if (!fIsSmartMode) {
+ super.customizeDocumentCommand(d, c);
+ return;
+ }
+
+ if (c.length == 0 && c.text != null && isLineDelimiter(d, c.text)) {
if (isAppendToOpenMultilineComment(d, c)) {
// special case: multi-line comment at end of document (bug 48339)
CCommentAutoIndentStrategy.commentIndentAfterNewLine(d, c);
} else {
smartIndentAfterNewLine(d, c);
}
- } else if ("}".equals(c.text)) { //$NON-NLS-1$
- smartInsertAfterBracket(d, c);
- }
- else if ("/".equals(c.text) && isAppendToOpenMultilineComment(d, c)) { //$NON-NLS-1$
+ } else if ("/".equals(c.text) && isAppendToOpenMultilineComment(d, c)) { //$NON-NLS-1$
// special case: multi-line comment at end of document (bug 48339)
CCommentAutoIndentStrategy.commentIndentForCommentEnd(d, c);
+ } else if (c.text.length() == 1) {
+ smartIndentOnKeypress(d, c);
+// TODO Support smart paste.
+// } else if (c.text.length() > 1 && getPreferenceStore().getBoolean(PreferenceConstants.EDITOR_SMART_PASTE)) {
+// smartPaste(d, c); // no smart backspace for paste
}
}
@@ -244,12 +661,11 @@ public class CAutoIndentStrategy extends DefaultIndentLineAutoEditStrategy {
* @param c the document command
* @return true, if the command appends to an open multi-line comment.
*/
- static boolean isAppendToOpenMultilineComment(IDocument d, DocumentCommand c) {
+ private boolean isAppendToOpenMultilineComment(IDocument d, DocumentCommand c) {
if (d.getLength() >= 2 && c.offset == d.getLength()) {
try {
- String partitioning = CUIPlugin.getDefault().getTextTools().getDocumentPartitioning();
- String contentType = org.eclipse.jface.text.TextUtilities.getContentType(d, partitioning, c.offset - 1, false);
- if (ICPartitions.C_MULTILINE_COMMENT.equals(contentType)) {
+ String contentType = org.eclipse.jface.text.TextUtilities.getContentType(d, fPartitioning, c.offset - 1, false);
+ if (ICPartitions.C_MULTI_LINE_COMMENT.equals(contentType)) {
return !d.get(c.offset - 2, 2).equals(MULTILINE_COMMENT_CLOSE);
}
} catch (BadLocationException exc) {
@@ -259,4 +675,91 @@ public class CAutoIndentStrategy extends DefaultIndentLineAutoEditStrategy {
return false;
}
+ private static IPreferenceStore getPreferenceStore() {
+ return CUIPlugin.getDefault().getCombinedPreferenceStore();
+ }
+
+ private void clearCachedValues() {
+ IPreferenceStore preferenceStore = getPreferenceStore();
+ fCloseBrace = preferenceStore.getBoolean(PreferenceConstants.EDITOR_CLOSE_BRACES);
+ fIsSmartMode = computeSmartMode();
+ }
+
+ private boolean computeSmartMode() {
+ IWorkbenchPage page = CUIPlugin.getActivePage();
+ if (page != null) {
+ IEditorPart part = page.getActiveEditor();
+ if (part instanceof ITextEditorExtension3) {
+ ITextEditorExtension3 extension = (ITextEditorExtension3) part;
+ return extension.getInsertMode() == ITextEditorExtension3.SMART_INSERT;
+ }
+ if (part == null) {
+ // TODO: Remove this if statement once CAutoIndentTest is fixed so that getActiveEditor does not return null.
+ return true;
+ }
+ }
+ return false;
+ }
+
+ private static CompilationUnitInfo getCompilationUnitForMethod(IDocument document, int offset, String partitioning) {
+ try {
+ CHeuristicScanner scanner = new CHeuristicScanner(document);
+
+ IRegion sourceRange = scanner.findSurroundingBlock(offset);
+ if (sourceRange == null)
+ return null;
+ String source = document.get(sourceRange.getOffset(), sourceRange.getLength());
+
+ StringBuffer contents = new StringBuffer();
+ contents.append("class ____C{void ____m()"); //$NON-NLS-1$
+ final int methodOffset = contents.length();
+ contents.append(source);
+ contents.append("};"); //$NON-NLS-1$
+
+ char[] buffer = contents.toString().toCharArray();
+ return new CompilationUnitInfo(buffer, sourceRange.getOffset() - methodOffset);
+ } catch (BadLocationException e) {
+ CUIPlugin.getDefault().log(e);
+ }
+
+ return null;
+ }
+
+ /**
+ * Returns the block balance, i.e. zero if the blocks are balanced at
+ * <code>offset</code>, a negative number if there are more closing than opening
+ * braces, and a positive number if there are more opening than closing braces.
+ *
+ * @param document
+ * @param offset
+ * @param partitioning
+ * @return the block balance
+ */
+ private static int getBlockBalance(IDocument document, int offset, String partitioning) {
+ if (offset < 1)
+ return -1;
+ if (offset >= document.getLength())
+ return 1;
+
+ int begin = offset;
+ int end = offset - 1;
+
+ CHeuristicScanner scanner = new CHeuristicScanner(document);
+
+ while (true) {
+ begin = scanner.findOpeningPeer(begin - 1, '{', '}');
+ end = scanner.findClosingPeer(end + 1, '{', '}');
+ if (begin == -1 && end == -1)
+ return 0;
+ if (begin == -1)
+ return -1;
+ if (end == -1)
+ return 1;
+ }
+ }
+
+// private static IRegion createRegion(IASTNode node, int delta) {
+// IASTNodeLocation nodeLocation = node.getNodeLocations()[0];
+// return node == null ? null : new Region(nodeLocation.getNodeOffset() + delta, nodeLocation.getNodeLength());
+// }
}
diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/CHeuristicScanner.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/CHeuristicScanner.java
new file mode 100644
index 00000000000..259ca885476
--- /dev/null
+++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/CHeuristicScanner.java
@@ -0,0 +1,867 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2006 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
+ *******************************************************************************/
+package org.eclipse.cdt.internal.ui.text;
+
+import java.util.Arrays;
+
+import org.eclipse.cdt.ui.text.ICPartitions;
+
+import org.eclipse.jface.text.Assert;
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.IRegion;
+import org.eclipse.jface.text.ITypedRegion;
+import org.eclipse.jface.text.Region;
+import org.eclipse.jface.text.TextUtilities;
+import org.eclipse.jface.text.TypedRegion;
+
+/**
+ * Utility methods for heuristic based C manipulations in an incomplete C source file.
+ *
+ * <p>An instance holds some internal position in the document and is therefore not threadsafe.</p>
+ */
+public final class CHeuristicScanner implements Symbols {
+ /**
+ * Returned by all methods when the requested position could not be found, or if a
+ * {@link BadLocationException} was thrown while scanning.
+ */
+ public static final int NOT_FOUND= -1;
+
+ /**
+ * Special bound parameter that means either -1 (backward scanning) or
+ * <code>fDocument.getLength()</code> (forward scanning).
+ */
+ public static final int UNBOUND= -2;
+
+
+ /* character constants */
+ private static final char LBRACE= '{';
+ private static final char RBRACE= '}';
+ private static final char LPAREN= '(';
+ private static final char RPAREN= ')';
+ private static final char SEMICOLON= ';';
+ private static final char COLON= ':';
+ private static final char COMMA= ',';
+ private static final char LBRACKET= '[';
+ private static final char RBRACKET= ']';
+ private static final char QUESTIONMARK= '?';
+ private static final char EQUAL= '=';
+ private static final char LANGLE= '<';
+ private static final char RANGLE= '>';
+
+ /**
+ * Specifies the stop condition, upon which the <code>scanXXX</code> methods will decide whether
+ * to keep scanning or not. This interface may implemented by clients.
+ */
+ private static abstract class StopCondition {
+ /**
+ * Instructs the scanner to return the current position.
+ *
+ * @param ch the char at the current position
+ * @param position the current position
+ * @param forward the iteration direction
+ * @return <code>true</code> if the stop condition is met.
+ */
+ public abstract boolean stop(char ch, int position, boolean forward);
+
+ /**
+ * Asks the condition to return the next position to query. The default
+ * is to return the next/previous position.
+ *
+ * @return the next position to scan
+ */
+ public int nextPosition(int position, boolean forward) {
+ return forward ? position + 1 : position - 1;
+ }
+ }
+
+ /**
+ * Stops upon a non-whitespace (as defined by {@link Character#isWhitespace(char)}) character.
+ */
+ private static class NonWhitespace extends StopCondition {
+ /*
+ * @see org.eclipse.jdt.internal.ui.text.JavaHeuristicScanner.StopCondition#stop(char)
+ */
+ public boolean stop(char ch, int position, boolean forward) {
+ return !Character.isWhitespace(ch);
+ }
+ }
+
+ /**
+ * Stops upon a non-whitespace character in the default partition.
+ *
+ * @see NonWhitespace
+ */
+ private final class NonWhitespaceDefaultPartition extends NonWhitespace {
+ /*
+ * @see org.eclipse.jdt.internal.ui.text.JavaHeuristicScanner.StopCondition#stop(char)
+ */
+ public boolean stop(char ch, int position, boolean forward) {
+ return super.stop(ch, position, true) && isDefaultPartition(position);
+ }
+
+ /*
+ * @see org.eclipse.jdt.internal.ui.text.JavaHeuristicScanner.StopCondition#nextPosition(int, boolean)
+ */
+ public int nextPosition(int position, boolean forward) {
+ ITypedRegion partition= getPartition(position);
+ if (fPartition.equals(partition.getType()))
+ return super.nextPosition(position, forward);
+
+ if (forward) {
+ int end= partition.getOffset() + partition.getLength();
+ if (position < end)
+ return end;
+ } else {
+ int offset= partition.getOffset();
+ if (position > offset)
+ return offset - 1;
+ }
+ return super.nextPosition(position, forward);
+ }
+ }
+
+ /**
+ * Stops upon a non-java identifier (as defined by {@link Character#isJavaIdentifierPart(char)}) character.
+ */
+ private static class NonJavaIdentifierPart extends StopCondition {
+ /*
+ * @see org.eclipse.jdt.internal.ui.text.JavaHeuristicScanner.StopCondition#stop(char)
+ */
+ public boolean stop(char ch, int position, boolean forward) {
+ return !Character.isJavaIdentifierPart(ch);
+ }
+ }
+
+ /**
+ * Stops upon a non-java identifier character in the default partition.
+ *
+ * @see NonJavaIdentifierPart
+ */
+ private final class NonJavaIdentifierPartDefaultPartition extends NonJavaIdentifierPart {
+ /*
+ * @see org.eclipse.jdt.internal.ui.text.JavaHeuristicScanner.StopCondition#stop(char)
+ */
+ public boolean stop(char ch, int position, boolean forward) {
+ return super.stop(ch, position, true) || !isDefaultPartition(position);
+ }
+
+ /*
+ * @see org.eclipse.jdt.internal.ui.text.JavaHeuristicScanner.StopCondition#nextPosition(int, boolean)
+ */
+ public int nextPosition(int position, boolean forward) {
+ ITypedRegion partition= getPartition(position);
+ if (fPartition.equals(partition.getType()))
+ return super.nextPosition(position, forward);
+
+ if (forward) {
+ int end= partition.getOffset() + partition.getLength();
+ if (position < end)
+ return end;
+ } else {
+ int offset= partition.getOffset();
+ if (position > offset)
+ return offset - 1;
+ }
+ return super.nextPosition(position, forward);
+ }
+ }
+
+ /**
+ * Stops upon a character in the default partition that matches the given character list.
+ */
+ private final class CharacterMatch extends StopCondition {
+ private final char[] fChars;
+
+ /**
+ * Creates a new instance.
+ * @param ch the single character to match
+ */
+ public CharacterMatch(char ch) {
+ this(new char[] {ch});
+ }
+
+ /**
+ * Creates a new instance.
+ * @param chars the chars to match.
+ */
+ public CharacterMatch(char[] chars) {
+ Assert.isNotNull(chars);
+ Assert.isTrue(chars.length > 0);
+ fChars= chars;
+ Arrays.sort(chars);
+ }
+
+ /*
+ * @see org.eclipse.jdt.internal.ui.text.JavaHeuristicScanner.StopCondition#stop(char, int)
+ */
+ public boolean stop(char ch, int position, boolean forward) {
+ return Arrays.binarySearch(fChars, ch) >= 0 && isDefaultPartition(position);
+ }
+
+ /*
+ * @see org.eclipse.jdt.internal.ui.text.JavaHeuristicScanner.StopCondition#nextPosition(int, boolean)
+ */
+ public int nextPosition(int position, boolean forward) {
+ ITypedRegion partition= getPartition(position);
+ if (fPartition.equals(partition.getType()))
+ return super.nextPosition(position, forward);
+
+ if (forward) {
+ int end= partition.getOffset() + partition.getLength();
+ if (position < end)
+ return end;
+ } else {
+ int offset= partition.getOffset();
+ if (position > offset)
+ return offset - 1;
+ }
+ return super.nextPosition(position, forward);
+ }
+ }
+
+ /** The document being scanned. */
+ private final IDocument fDocument;
+ /** The partitioning being used for scanning. */
+ private final String fPartitioning;
+ /** The partition to scan in. */
+ private final String fPartition;
+
+ /* internal scan state */
+
+ /** the most recently read character. */
+ private char fChar;
+ /** the most recently read position. */
+ private int fPos;
+ /**
+ * The most recently used partition.
+ */
+ private ITypedRegion fCachedPartition= new TypedRegion(-1, 0, "__no_partition_at_all"); //$NON-NLS-1$
+
+ /* preset stop conditions */
+ private final StopCondition fNonWSDefaultPart= new NonWhitespaceDefaultPartition();
+ private final static StopCondition fNonWS= new NonWhitespace();
+ private final StopCondition fNonIdent= new NonJavaIdentifierPartDefaultPartition();
+
+ /**
+ * Creates a new instance.
+ *
+ * @param document the document to scan
+ * @param partitioning the partitioning to use for scanning
+ * @param partition the partition to scan in
+ */
+ public CHeuristicScanner(IDocument document, String partitioning, String partition) {
+ Assert.isLegal(document != null);
+ Assert.isLegal(partitioning != null);
+ Assert.isLegal(partition != null);
+ fDocument= document;
+ fPartitioning= partitioning;
+ fPartition= partition;
+ }
+
+ /**
+ * Calls <code>this(document, IJavaPartitions.JAVA_PARTITIONING, IDocument.DEFAULT_CONTENT_TYPE)</code>.
+ *
+ * @param document the document to scan.
+ */
+ public CHeuristicScanner(IDocument document) {
+ this(document, ICPartitions.C_PARTITIONING, IDocument.DEFAULT_CONTENT_TYPE);
+ }
+
+ /**
+ * Returns the most recent internal scan position.
+ *
+ * @return the most recent internal scan position.
+ */
+ public int getPosition() {
+ return fPos;
+ }
+
+ /**
+ * Returns the next token in forward direction, starting at <code>start</code>, and not extending
+ * further than <code>bound</code>. The return value is one of the constants defined in {@link Symbols}.
+ * After a call, {@link #getPosition()} will return the position just after the scanned token
+ * (i.e. the next position that will be scanned).
+ *
+ * @param start the first character position in the document to consider
+ * @param bound the first position not to consider any more
+ * @return a constant from {@link Symbols} describing the next token
+ */
+ public int nextToken(int start, int bound) {
+ int pos= scanForward(start, bound, fNonWSDefaultPart);
+ if (pos == NOT_FOUND)
+ return TokenEOF;
+
+ fPos++;
+
+ switch (fChar) {
+ case LBRACE:
+ return TokenLBRACE;
+ case RBRACE:
+ return TokenRBRACE;
+ case LBRACKET:
+ return TokenLBRACKET;
+ case RBRACKET:
+ return TokenRBRACKET;
+ case LPAREN:
+ return TokenLPAREN;
+ case RPAREN:
+ return TokenRPAREN;
+ case SEMICOLON:
+ return TokenSEMICOLON;
+ case COMMA:
+ return TokenCOMMA;
+ case QUESTIONMARK:
+ return TokenQUESTIONMARK;
+ case EQUAL:
+ return TokenEQUAL;
+ case LANGLE:
+ return TokenLESSTHAN;
+ case RANGLE:
+ return TokenGREATERTHAN;
+ }
+
+ // else
+ if (Character.isJavaIdentifierPart(fChar)) {
+ // assume an identifier or keyword
+ int from= pos, to;
+ pos= scanForward(pos + 1, bound, fNonIdent);
+ if (pos == NOT_FOUND)
+ to= bound == UNBOUND ? fDocument.getLength() : bound;
+ else
+ to= pos;
+
+ String identOrKeyword;
+ try {
+ identOrKeyword= fDocument.get(from, to - from);
+ } catch (BadLocationException e) {
+ return TokenEOF;
+ }
+
+ return getToken(identOrKeyword);
+
+
+ } else {
+ // operators, number literals etc
+ return TokenOTHER;
+ }
+ }
+
+ /**
+ * Returns the next token in backward direction, starting at <code>start</code>, and not extending
+ * further than <code>bound</code>. The return value is one of the constants defined in {@link Symbols}.
+ * After a call, {@link #getPosition()} will return the position just before the scanned token
+ * starts (i.e. the next position that will be scanned).
+ *
+ * @param start the first character position in the document to consider
+ * @param bound the first position not to consider any more
+ * @return a constant from {@link Symbols} describing the previous token
+ */
+ public int previousToken(int start, int bound) {
+ int pos= scanBackward(start, bound, fNonWSDefaultPart);
+ if (pos == NOT_FOUND)
+ return TokenEOF;
+
+ fPos--;
+
+ switch (fChar) {
+ case LBRACE:
+ return TokenLBRACE;
+ case RBRACE:
+ return TokenRBRACE;
+ case LBRACKET:
+ return TokenLBRACKET;
+ case RBRACKET:
+ return TokenRBRACKET;
+ case LPAREN:
+ return TokenLPAREN;
+ case RPAREN:
+ return TokenRPAREN;
+ case SEMICOLON:
+ return TokenSEMICOLON;
+ case COLON:
+ return TokenCOLON;
+ case COMMA:
+ return TokenCOMMA;
+ case QUESTIONMARK:
+ return TokenQUESTIONMARK;
+ case EQUAL:
+ return TokenEQUAL;
+ case LANGLE:
+ return TokenLESSTHAN;
+ case RANGLE:
+ return TokenGREATERTHAN;
+ }
+
+ // else
+ if (Character.isJavaIdentifierPart(fChar)) {
+ // assume an ident or keyword
+ int from, to= pos + 1;
+ pos= scanBackward(pos - 1, bound, fNonIdent);
+ if (pos == NOT_FOUND)
+ from= bound == UNBOUND ? 0 : bound + 1;
+ else
+ from= pos + 1;
+
+ String identOrKeyword;
+ try {
+ identOrKeyword= fDocument.get(from, to - from);
+ } catch (BadLocationException e) {
+ return TokenEOF;
+ }
+
+ return getToken(identOrKeyword);
+
+
+ } else {
+ // operators, number literals etc
+ return TokenOTHER;
+ }
+
+ }
+
+ /**
+ * Returns one of the keyword constants or <code>TokenIDENT</code> for a scanned identifier.
+ *
+ * @param s a scanned identifier
+ * @return one of the constants defined in {@link Symbols}
+ */
+ private int getToken(String s) {
+ Assert.isNotNull(s);
+
+ switch (s.length()) {
+ case 2:
+ if ("if".equals(s)) //$NON-NLS-1$
+ return TokenIF;
+ if ("do".equals(s)) //$NON-NLS-1$
+ return TokenDO;
+ break;
+ case 3:
+ if ("for".equals(s)) //$NON-NLS-1$
+ return TokenFOR;
+ if ("try".equals(s)) //$NON-NLS-1$
+ return TokenTRY;
+ if ("new".equals(s)) //$NON-NLS-1$
+ return TokenNEW;
+ break;
+ case 4:
+ if ("case".equals(s)) //$NON-NLS-1$
+ return TokenCASE;
+ if ("else".equals(s)) //$NON-NLS-1$
+ return TokenELSE;
+ if ("enum".equals(s)) //$NON-NLS-1$
+ return TokenENUM;
+ if ("goto".equals(s)) //$NON-NLS-1$
+ return TokenGOTO;
+ break;
+ case 5:
+ if ("break".equals(s)) //$NON-NLS-1$
+ return TokenBREAK;
+ if ("catch".equals(s)) //$NON-NLS-1$
+ return TokenCATCH;
+ if ("class".equals(s)) //$NON-NLS-1$
+ return TokenCLASS;
+ if ("while".equals(s)) //$NON-NLS-1$
+ return TokenWHILE;
+ break;
+ case 6:
+ if ("return".equals(s)) //$NON-NLS-1$
+ return TokenRETURN;
+ if ("static".equals(s)) //$NON-NLS-1$
+ return TokenSTATIC;
+ if ("switch".equals(s)) //$NON-NLS-1$
+ return TokenSWITCH;
+ break;
+ case 7:
+ if ("default".equals(s)) //$NON-NLS-1$
+ return TokenDEFAULT;
+ break;
+ }
+ return TokenIDENT;
+ }
+
+ /**
+ * Returns the position of the closing peer character (forward search). Any scopes introduced by opening peers
+ * are skipped. All peers accounted for must reside in the default partition.
+ *
+ * <p>Note that <code>start</code> must not point to the opening peer, but to the first
+ * character being searched.</p>
+ *
+ * @param start the start position
+ * @param openingPeer the opening peer character (e.g. '{')
+ * @param closingPeer the closing peer character (e.g. '}')
+ * @return the matching peer character position, or <code>NOT_FOUND</code>
+ */
+ public int findClosingPeer(int start, final char openingPeer, final char closingPeer) {
+ Assert.isLegal(start >= 0);
+
+ try {
+ int depth= 1;
+ start -= 1;
+ while (true) {
+ start= scanForward(start + 1, UNBOUND, new CharacterMatch(new char[] {openingPeer, closingPeer}));
+ if (start == NOT_FOUND)
+ return NOT_FOUND;
+
+ if (fDocument.getChar(start) == openingPeer)
+ depth++;
+ else
+ depth--;
+
+ if (depth == 0)
+ return start;
+ }
+
+ } catch (BadLocationException e) {
+ return NOT_FOUND;
+ }
+ }
+
+ /**
+ * Returns the position of the opening peer character (backward search). Any scopes introduced by closing peers
+ * are skipped. All peers accounted for must reside in the default partition.
+ *
+ * <p>Note that <code>start</code> must not point to the closing peer, but to the first
+ * character being searched.</p>
+ *
+ * @param start the start position
+ * @param openingPeer the opening peer character (e.g. '{')
+ * @param closingPeer the closing peer character (e.g. '}')
+ * @return the matching peer character position, or <code>NOT_FOUND</code>
+ */
+ public int findOpeningPeer(int start, char openingPeer, char closingPeer) {
+ Assert.isLegal(start < fDocument.getLength());
+
+ try {
+ int depth= 1;
+ start += 1;
+ while (true) {
+ start= scanBackward(start - 1, UNBOUND, new CharacterMatch(new char[] {openingPeer, closingPeer}));
+ if (start == NOT_FOUND)
+ return NOT_FOUND;
+
+ if (fDocument.getChar(start) == closingPeer)
+ depth++;
+ else
+ depth--;
+
+ if (depth == 0)
+ return start;
+ }
+
+ } catch (BadLocationException e) {
+ return NOT_FOUND;
+ }
+ }
+
+ /**
+ * Computes the surrounding block around <code>offset</code>. The search is started at the
+ * beginning of <code>offset</code>, i.e. an opening brace at <code>offset</code> will not be
+ * part of the surrounding block, but a closing brace will.
+ *
+ * @param offset the offset for which the surrounding block is computed
+ * @return a region describing the surrounding block, or <code>null</code> if none can be found
+ */
+ public IRegion findSurroundingBlock(int offset) {
+ if (offset < 1 || offset >= fDocument.getLength())
+ return null;
+
+ int begin= findOpeningPeer(offset - 1, LBRACE, RBRACE);
+ int end= findClosingPeer(offset, LBRACE, RBRACE);
+ if (begin == NOT_FOUND || end == NOT_FOUND)
+ return null;
+ return new Region(begin, end + 1 - begin);
+ }
+
+ /**
+ * Finds the smallest position in <code>fDocument</code> such that the position is &gt;= <code>position</code>
+ * and &lt; <code>bound</code> and <code>Character.isWhitespace(fDocument.getChar(pos))</code> evaluates to <code>false</code>
+ * and the position is in the default partition.
+ *
+ * @param position the first character position in <code>fDocument</code> to be considered
+ * @param bound the first position in <code>fDocument</code> to not consider any more, with <code>bound</code> &gt; <code>position</code>, or <code>UNBOUND</code>
+ * @return the smallest position of a non-whitespace character in [<code>position</code>, <code>bound</code>) that resides in a C partition, or <code>NOT_FOUND</code> if none can be found
+ */
+ public int findNonWhitespaceForward(int position, int bound) {
+ return scanForward(position, bound, fNonWSDefaultPart);
+ }
+
+ /**
+ * Finds the smallest position in <code>fDocument</code> such that the position is &gt;= <code>position</code>
+ * and &lt; <code>bound</code> and <code>Character.isWhitespace(fDocument.getChar(pos))</code> evaluates to <code>false</code>.
+ *
+ * @param position the first character position in <code>fDocument</code> to be considered
+ * @param bound the first position in <code>fDocument</code> to not consider any more, with <code>bound</code> &gt; <code>position</code>, or <code>UNBOUND</code>
+ * @return the smallest position of a non-whitespace character in [<code>position</code>, <code>bound</code>), or <code>NOT_FOUND</code> if none can be found
+ */
+ public int findNonWhitespaceForwardInAnyPartition(int position, int bound) {
+ return scanForward(position, bound, fNonWS);
+ }
+
+ /**
+ * Finds the highest position in <code>fDocument</code> such that the position is &lt;= <code>position</code>
+ * and &gt; <code>bound</code> and <code>Character.isWhitespace(fDocument.getChar(pos))</code> evaluates to <code>false</code>
+ * and the position is in the default partition.
+ *
+ * @param position the first character position in <code>fDocument</code> to be considered
+ * @param bound the first position in <code>fDocument</code> to not consider any more, with <code>bound</code> &lt; <code>position</code>, or <code>UNBOUND</code>
+ * @return the highest position of a non-whitespace character in (<code>bound</code>, <code>position</code>] that resides in a C partition, or <code>NOT_FOUND</code> if none can be found
+ */
+ public int findNonWhitespaceBackward(int position, int bound) {
+ return scanBackward(position, bound, fNonWSDefaultPart);
+ }
+
+ /**
+ * Finds the lowest position <code>p</code> in <code>fDocument</code> such that <code>start</code> &lt;= p &lt;
+ * <code>bound</code> and <code>condition.stop(fDocument.getChar(p), p)</code> evaluates to <code>true</code>.
+ *
+ * @param start the first character position in <code>fDocument</code> to be considered
+ * @param bound the first position in <code>fDocument</code> to not consider any more, with <code>bound</code> &gt; <code>start</code>, or <code>UNBOUND</code>
+ * @param condition the <code>StopCondition</code> to check
+ * @return the lowest position in [<code>start</code>, <code>bound</code>) for which <code>condition</code> holds, or <code>NOT_FOUND</code> if none can be found
+ */
+ public int scanForward(int start, int bound, StopCondition condition) {
+ Assert.isLegal(start >= 0);
+
+ if (bound == UNBOUND)
+ bound= fDocument.getLength();
+
+ Assert.isLegal(bound <= fDocument.getLength());
+
+ try {
+ fPos= start;
+ while (fPos < bound) {
+
+ fChar= fDocument.getChar(fPos);
+ if (condition.stop(fChar, fPos, true))
+ return fPos;
+
+ fPos= condition.nextPosition(fPos, true);
+ }
+ } catch (BadLocationException e) {
+ }
+ return NOT_FOUND;
+ }
+
+
+ /**
+ * Finds the lowest position in <code>fDocument</code> such that the position is &gt;= <code>position</code>
+ * and &lt; <code>bound</code> and <code>fDocument.getChar(position) == ch</code> evaluates to <code>true</code>
+ * and the position is in the default partition.
+ *
+ * @param position the first character position in <code>fDocument</code> to be considered
+ * @param bound the first position in <code>fDocument</code> to not consider any more, with <code>bound</code> &gt; <code>position</code>, or <code>UNBOUND</code>
+ * @param ch the <code>char</code> to search for
+ * @return the lowest position of <code>ch</code> in (<code>bound</code>, <code>position</code>] that resides in a C partition, or <code>NOT_FOUND</code> if none can be found
+ */
+ public int scanForward(int position, int bound, char ch) {
+ return scanForward(position, bound, new CharacterMatch(ch));
+ }
+
+ /**
+ * Finds the lowest position in <code>fDocument</code> such that the position is &gt;= <code>position</code>
+ * and &lt; <code>bound</code> and <code>fDocument.getChar(position) == ch</code> evaluates to <code>true</code> for at least one
+ * ch in <code>chars</code> and the position is in the default partition.
+ *
+ * @param position the first character position in <code>fDocument</code> to be considered
+ * @param bound the first position in <code>fDocument</code> to not consider any more, with <code>bound</code> &gt; <code>position</code>, or <code>UNBOUND</code>
+ * @param chars an array of <code>char</code> to search for
+ * @return the lowest position of a non-whitespace character in [<code>position</code>, <code>bound</code>) that resides in a C partition, or <code>NOT_FOUND</code> if none can be found
+ */
+ public int scanForward(int position, int bound, char[] chars) {
+ return scanForward(position, bound, new CharacterMatch(chars));
+ }
+
+ /**
+ * Finds the highest position <code>p</code> in <code>fDocument</code> such that <code>bound</code> &lt; <code>p</code> &lt;= <code>start</code>
+ * and <code>condition.stop(fDocument.getChar(p), p)</code> evaluates to <code>true</code>.
+ *
+ * @param start the first character position in <code>fDocument</code> to be considered
+ * @param bound the first position in <code>fDocument</code> to not consider any more, with <code>bound</code> &lt; <code>start</code>, or <code>UNBOUND</code>
+ * @param condition the <code>StopCondition</code> to check
+ * @return the highest position in (<code>bound</code>, <code>start</code> for which <code>condition</code> holds, or <code>NOT_FOUND</code> if none can be found
+ */
+ public int scanBackward(int start, int bound, StopCondition condition) {
+ if (bound == UNBOUND)
+ bound= -1;
+
+ Assert.isLegal(bound >= -1);
+ Assert.isLegal(start < fDocument.getLength() );
+
+ try {
+ fPos= start;
+ while (fPos > bound) {
+
+ fChar= fDocument.getChar(fPos);
+ if (condition.stop(fChar, fPos, false))
+ return fPos;
+
+ fPos= condition.nextPosition(fPos, false);
+ }
+ } catch (BadLocationException e) {
+ }
+ return NOT_FOUND;
+ }
+
+ /**
+ * Finds the highest position in <code>fDocument</code> such that the position is &lt;= <code>position</code>
+ * and &gt; <code>bound</code> and <code>fDocument.getChar(position) == ch</code> evaluates to <code>true</code> for at least one
+ * ch in <code>chars</code> and the position is in the default partition.
+ *
+ * @param position the first character position in <code>fDocument</code> to be considered
+ * @param bound the first position in <code>fDocument</code> to not consider any more, with <code>bound</code> &lt; <code>position</code>, or <code>UNBOUND</code>
+ * @param ch the <code>char</code> to search for
+ * @return the highest position of one element in <code>chars</code> in (<code>bound</code>, <code>position</code>] that resides in a C partition, or <code>NOT_FOUND</code> if none can be found
+ */
+ public int scanBackward(int position, int bound, char ch) {
+ return scanBackward(position, bound, new CharacterMatch(ch));
+ }
+
+ /**
+ * Finds the highest position in <code>fDocument</code> such that the position is &lt;= <code>position</code>
+ * and &gt; <code>bound</code> and <code>fDocument.getChar(position) == ch</code> evaluates to <code>true</code> for at least one
+ * ch in <code>chars</code> and the position is in the default partition.
+ *
+ * @param position the first character position in <code>fDocument</code> to be considered
+ * @param bound the first position in <code>fDocument</code> to not consider any more, with <code>bound</code> &lt; <code>position</code>, or <code>UNBOUND</code>
+ * @param chars an array of <code>char</code> to search for
+ * @return the highest position of one element in <code>chars</code> in (<code>bound</code>, <code>position</code>] that resides in a C partition, or <code>NOT_FOUND</code> if none can be found
+ */
+ public int scanBackward(int position, int bound, char[] chars) {
+ return scanBackward(position, bound, new CharacterMatch(chars));
+ }
+
+ /**
+ * Checks whether <code>position</code> resides in a default (C) partition of <code>fDocument</code>.
+ *
+ * @param position the position to be checked
+ * @return <code>true</code> if <code>position</code> is in the default partition of <code>fDocument</code>, <code>false</code> otherwise
+ */
+ public boolean isDefaultPartition(int position) {
+ return fPartition.equals(getPartition(position).getType());
+ }
+
+ /**
+ * Returns the partition at <code>position</code>.
+ *
+ * @param position the position to get the partition for
+ * @return the partition at <code>position</code> or a dummy zero-length
+ * partition if accessing the document fails
+ */
+ private ITypedRegion getPartition(int position) {
+ if (!contains(fCachedPartition, position)) {
+ Assert.isTrue(position >= 0);
+ Assert.isTrue(position <= fDocument.getLength());
+
+ try {
+ fCachedPartition= TextUtilities.getPartition(fDocument, fPartitioning, position, false);
+ } catch (BadLocationException e) {
+ fCachedPartition= new TypedRegion(position, 0, "__no_partition_at_all"); //$NON-NLS-1$
+ }
+ }
+
+ return fCachedPartition;
+ }
+
+ /**
+ * Returns <code>true</code> if <code>region</code> contains <code>position</code>.
+ *
+ * @param region a region
+ * @param position an offset
+ * @return <code>true</code> if <code>region</code> contains <code>position</code>
+ */
+ private boolean contains(IRegion region, int position) {
+ int offset= region.getOffset();
+ return offset <= position && position < offset + region.getLength();
+ }
+
+ /**
+ * Checks if the line seems to be an open condition not followed by a block (i.e. an if, while,
+ * or for statement with just one following statement, see example below).
+ *
+ * <pre>
+ * if (condition)
+ * doStuff();
+ * </pre>
+ *
+ * <p>Algorithm: if the last non-WS, non-Comment code on the line is an if (condition), while (condition),
+ * for( expression), do, else, and there is no statement after that </p>
+ *
+ * @param position the insert position of the new character
+ * @param bound the lowest position to consider
+ * @return <code>true</code> if the code is a conditional statement or loop without a block, <code>false</code> otherwise
+ */
+ public boolean isBracelessBlockStart(int position, int bound) {
+ if (position < 1)
+ return false;
+
+ switch (previousToken(position, bound)) {
+ case TokenDO:
+ case TokenELSE:
+ return true;
+ case TokenRPAREN:
+ position= findOpeningPeer(fPos, LPAREN, RPAREN);
+ if (position > 0) {
+ switch (previousToken(position - 1, bound)) {
+ case TokenIF:
+ case TokenFOR:
+ case TokenWHILE:
+ return true;
+ }
+ }
+ }
+
+ return false;
+ }
+
+ /**
+ * Returns <code>true</code> if the document, when scanned backwards from <code>start</code>
+ * appears to contain a class instance creation, i.e. a possibly qualified name preceded by a
+ * <code>new</code> keyword. The <code>start</code> must be at the end of the type name, and
+ * before any generic signature or constructor parameter list. The heuristic will return
+ * <code>true</code> if <code>start</code> is at the following positions (|):
+ *
+ * <pre>
+ * new java.util. ArrayList|&lt;String&gt;(10)
+ * new ArrayList |(10)
+ * new / * comment * / ArrayList |(10)
+ * </pre>
+ *
+ * but not the following:
+ *
+ * <pre>
+ * new java.util. ArrayList&lt;String&gt;(10)|
+ * new java.util. ArrayList&lt;String&gt;|(10)
+ * new ArrayList (10)|
+ * ArrayList |(10)
+ * </pre>
+ *
+ * @param start the position where the type name of the class instance creation supposedly ends
+ * @param bound the first position in <code>fDocument</code> to not consider any more, with
+ * <code>bound</code> &lt; <code>start</code>, or <code>UNBOUND</code>
+ * @return <code>true</code> if the current position looks like after the type name of a class
+ * instance creation
+ */
+ public boolean looksLikeClassInstanceCreationBackward(int start, int bound) {
+ int token= previousToken(start - 1, bound);
+ if (token == Symbols.TokenIDENT) { // type name
+ token= previousToken(getPosition(), bound);
+ while (token == Symbols.TokenOTHER) { // dot of qualification
+ token= previousToken(getPosition(), bound);
+ if (token != Symbols.TokenIDENT) // qualification name
+ return false;
+ token= previousToken(getPosition(), bound);
+ }
+ return token == Symbols.TokenNEW;
+ }
+ return false;
+ }
+}
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
new file mode 100644
index 00000000000..652c2c0e00b
--- /dev/null
+++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/CIndenter.java
@@ -0,0 +1,1615 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2006 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
+ *******************************************************************************/
+package org.eclipse.cdt.internal.ui.text;
+
+import org.eclipse.cdt.core.CCorePlugin;
+import org.eclipse.cdt.core.formatter.CodeFormatterConstants;
+import org.eclipse.cdt.core.model.ICProject;
+import org.eclipse.cdt.internal.corext.util.CodeFormatterUtil;
+
+import org.eclipse.jface.text.Assert;
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.IRegion;
+
+
+/**
+ * Uses the {@link org.eclipse.cdt.internal.ui.text.CHeuristicScanner} to
+ * get the indentation level for a certain position in a document.
+ *
+ * <p>
+ * An instance holds some internal position in the document and is therefore
+ * not threadsafe.
+ * </p>
+ */
+public final class CIndenter {
+
+ /**
+ * The CDT Core preferences.
+ */
+ private final class CorePrefs {
+ final boolean prefUseTabs;
+ final int prefTabSize;
+ final int prefIndentationSize;
+ final boolean prefArrayDimensionsDeepIndent;
+ final int prefArrayIndent;
+ final boolean prefArrayDeepIndent;
+ final boolean prefTernaryDeepAlign;
+ final int prefTernaryIndent;
+ final int prefCaseIndent;
+ final int prefAssignmentIndent;
+ final int prefCaseBlockIndent;
+ final int prefSimpleIndent;
+ final int prefBracketIndent;
+ final boolean prefMethodDeclDeepIndent;
+ final int prefMethodDeclIndent;
+ final boolean prefMethodCallDeepIndent;
+ final int prefMethodCallIndent;
+ final boolean prefParenthesisDeepIndent;
+ final int prefParenthesisIndent;
+ final int prefBlockIndent;
+ final int prefMethodBodyIndent;
+ final int prefTypeIndent;
+ final boolean prefIndentBracesForBlocks;
+ final boolean prefIndentBracesForArrays;
+ final boolean prefIndentBracesForMethods;
+ final boolean prefIndentBracesForTypes;
+ final int prefContinuationIndent;
+ final boolean prefHasGenerics;
+ final String prefTabChar;
+
+ private final ICProject fProject;
+
+ /**
+ * Returns the possibly project-specific core preference defined under <code>key</code>.
+ *
+ * @param key the key of the preference
+ * @return the value of the preference
+ */
+ private String getCoreFormatterOption(String key) {
+ if (fProject == null)
+ return CCorePlugin.getOption(key);
+ return fProject.getOption(key, true);
+ }
+
+ CorePrefs(ICProject project) {
+ fProject= project;
+ prefUseTabs= prefUseTabs();
+ prefTabSize= prefTabSize();
+ prefIndentationSize= prefIndentationSize();
+ prefArrayDimensionsDeepIndent= prefArrayDimensionsDeepIndent();
+ prefContinuationIndent= prefContinuationIndent();
+ prefBlockIndent= prefBlockIndent();
+ prefArrayIndent= prefArrayIndent();
+ prefArrayDeepIndent= prefArrayDeepIndent();
+ prefTernaryDeepAlign= prefTernaryDeepAlign();
+ prefTernaryIndent= prefTernaryIndent();
+ prefCaseIndent= prefCaseIndent();
+ prefAssignmentIndent= prefAssignmentIndent();
+ prefCaseBlockIndent= prefCaseBlockIndent();
+ prefIndentBracesForBlocks= prefIndentBracesForBlocks();
+ prefSimpleIndent= prefSimpleIndent();
+ prefBracketIndent= prefBracketIndent();
+ prefMethodDeclDeepIndent= prefMethodDeclDeepIndent();
+ prefMethodDeclIndent= prefMethodDeclIndent();
+ prefMethodCallDeepIndent= prefMethodCallDeepIndent();
+ prefMethodCallIndent= prefMethodCallIndent();
+ prefParenthesisDeepIndent= prefParenthesisDeepIndent();
+ prefParenthesisIndent= prefParenthesisIndent();
+ prefMethodBodyIndent= prefMethodBodyIndent();
+ prefTypeIndent= prefTypeIndent();
+ prefIndentBracesForArrays= prefIndentBracesForArrays();
+ prefIndentBracesForMethods= prefIndentBracesForMethods();
+ prefIndentBracesForTypes= prefIndentBracesForTypes();
+ prefHasGenerics= hasGenerics();
+ prefTabChar= getCoreFormatterOption(CodeFormatterConstants.FORMATTER_TAB_CHAR);
+ }
+
+ private boolean prefUseTabs() {
+ return !CCorePlugin.SPACE.equals(getCoreFormatterOption(CodeFormatterConstants.FORMATTER_TAB_CHAR));
+ }
+
+ private int prefTabSize() {
+ return CodeFormatterUtil.getTabWidth(fProject);
+ }
+
+ private int prefIndentationSize() {
+ return CodeFormatterUtil.getIndentWidth(fProject);
+ }
+
+ private boolean prefArrayDimensionsDeepIndent() {
+ return true; // sensible default, no formatter setting
+ }
+
+ private int prefArrayIndent() {
+ String option= getCoreFormatterOption(CodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_EXPRESSIONS_IN_ARRAY_INITIALIZER);
+ try {
+ if (CodeFormatterConstants.getIndentStyle(option) == CodeFormatterConstants.INDENT_BY_ONE)
+ return 1;
+ } catch (IllegalArgumentException e) {
+ // ignore and return default
+ }
+
+ return prefContinuationIndent(); // default
+ }
+
+ private boolean prefArrayDeepIndent() {
+ String option= getCoreFormatterOption(CodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_EXPRESSIONS_IN_ARRAY_INITIALIZER);
+ try {
+ return CodeFormatterConstants.getIndentStyle(option) == CodeFormatterConstants.INDENT_ON_COLUMN;
+ } catch (IllegalArgumentException e) {
+ // ignore and return default
+ }
+
+ return true;
+ }
+
+ private boolean prefTernaryDeepAlign() {
+ String option= getCoreFormatterOption(CodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_CONDITIONAL_EXPRESSION);
+ try {
+ return CodeFormatterConstants.getIndentStyle(option) == CodeFormatterConstants.INDENT_ON_COLUMN;
+ } catch (IllegalArgumentException e) {
+ // ignore and return default
+ }
+ return false;
+ }
+
+ private int prefTernaryIndent() {
+ String option= getCoreFormatterOption(CodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_CONDITIONAL_EXPRESSION);
+ try {
+ if (CodeFormatterConstants.getIndentStyle(option) == CodeFormatterConstants.INDENT_BY_ONE)
+ return 1;
+ else
+ return prefContinuationIndent();
+ } catch (IllegalArgumentException e) {
+ // ignore and return default
+ }
+
+ return prefContinuationIndent();
+ }
+
+ private int prefCaseIndent() {
+ if (CodeFormatterConstants.TRUE.equals(getCoreFormatterOption(CodeFormatterConstants.FORMATTER_INDENT_SWITCHSTATEMENTS_COMPARE_TO_SWITCH)))
+ return prefBlockIndent();
+ else
+ return 0;
+ }
+
+ private int prefAssignmentIndent() {
+ return prefBlockIndent();
+ }
+
+ private int prefCaseBlockIndent() {
+ if (true)
+ return prefBlockIndent();
+
+ if (CodeFormatterConstants.TRUE.equals(getCoreFormatterOption(CodeFormatterConstants.FORMATTER_INDENT_SWITCHSTATEMENTS_COMPARE_TO_CASES)))
+ return prefBlockIndent();
+ else
+ return 0;
+ }
+
+ private int prefSimpleIndent() {
+ if (prefIndentBracesForBlocks() && prefBlockIndent() == 0)
+ return 1;
+ else return prefBlockIndent();
+ }
+
+ private int prefBracketIndent() {
+ return prefBlockIndent();
+ }
+
+ private boolean prefMethodDeclDeepIndent() {
+ String option= getCoreFormatterOption(CodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_PARAMETERS_IN_METHOD_DECLARATION);
+ try {
+ return CodeFormatterConstants.getIndentStyle(option) == CodeFormatterConstants.INDENT_ON_COLUMN;
+ } catch (IllegalArgumentException e) {
+ // ignore and return default
+ }
+
+ return true;
+ }
+
+ private int prefMethodDeclIndent() {
+ String option= getCoreFormatterOption(CodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_PARAMETERS_IN_METHOD_DECLARATION);
+ try {
+ if (CodeFormatterConstants.getIndentStyle(option) == CodeFormatterConstants.INDENT_BY_ONE)
+ return 1;
+ else
+ return prefContinuationIndent();
+ } catch (IllegalArgumentException e) {
+ // ignore and return default
+ }
+ return 1;
+ }
+
+ private boolean prefMethodCallDeepIndent() {
+ String option= getCoreFormatterOption(CodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_ARGUMENTS_IN_METHOD_INVOCATION);
+ try {
+ return CodeFormatterConstants.getIndentStyle(option) == CodeFormatterConstants.INDENT_ON_COLUMN;
+ } catch (IllegalArgumentException e) {
+ // ignore and return default
+ }
+ return false; // sensible default
+ }
+
+ private int prefMethodCallIndent() {
+ String option= getCoreFormatterOption(CodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_ARGUMENTS_IN_METHOD_INVOCATION);
+ try {
+ if (CodeFormatterConstants.getIndentStyle(option) == CodeFormatterConstants.INDENT_BY_ONE)
+ return 1;
+ else
+ return prefContinuationIndent();
+ } catch (IllegalArgumentException e) {
+ // ignore and return default
+ }
+
+ return 1; // sensible default
+ }
+
+ private boolean prefParenthesisDeepIndent() {
+ if (true) // don't do parenthesis deep indentation
+ return false;
+
+ String option= getCoreFormatterOption(CodeFormatterConstants.FORMATTER_CONTINUATION_INDENTATION);
+ try {
+ return CodeFormatterConstants.getIndentStyle(option) == CodeFormatterConstants.INDENT_ON_COLUMN;
+ } catch (IllegalArgumentException e) {
+ // ignore and return default
+ }
+
+ return false; // sensible default
+ }
+
+ private int prefParenthesisIndent() {
+ return prefContinuationIndent();
+ }
+
+ private int prefBlockIndent() {
+ String option= getCoreFormatterOption(CodeFormatterConstants.FORMATTER_INDENT_STATEMENTS_COMPARE_TO_BLOCK);
+ if (CodeFormatterConstants.FALSE.equals(option))
+ return 0;
+
+ return 1; // sensible default
+ }
+
+ private int prefMethodBodyIndent() {
+ if (CodeFormatterConstants.FALSE.equals(getCoreFormatterOption(CodeFormatterConstants.FORMATTER_INDENT_STATEMENTS_COMPARE_TO_BODY)))
+ return 0;
+
+ return 1; // sensible default
+ }
+
+ private int prefTypeIndent() {
+ String option= getCoreFormatterOption(CodeFormatterConstants.FORMATTER_INDENT_BODY_DECLARATIONS_COMPARE_TO_TYPE_HEADER);
+ if (CodeFormatterConstants.FALSE.equals(option))
+ return 0;
+
+ return 1; // sensible default
+ }
+
+ private boolean prefIndentBracesForBlocks() {
+ return CodeFormatterConstants.NEXT_LINE_SHIFTED.equals(getCoreFormatterOption(CodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK));
+ }
+
+ private boolean prefIndentBracesForArrays() {
+ return CodeFormatterConstants.NEXT_LINE_SHIFTED.equals(getCoreFormatterOption(CodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ARRAY_INITIALIZER));
+ }
+
+ private boolean prefIndentBracesForMethods() {
+ return CodeFormatterConstants.NEXT_LINE_SHIFTED.equals(getCoreFormatterOption(CodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION));
+ }
+
+ private boolean prefIndentBracesForTypes() {
+ return CodeFormatterConstants.NEXT_LINE_SHIFTED.equals(getCoreFormatterOption(CodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION));
+ }
+
+ private int prefContinuationIndent() {
+ try {
+ return Integer.parseInt(getCoreFormatterOption(CodeFormatterConstants.FORMATTER_CONTINUATION_INDENTATION));
+ } catch (NumberFormatException e) {
+ // ignore and return default
+ }
+
+ return 2; // sensible default
+ }
+ private boolean hasGenerics() {
+ return true;
+ }
+ }
+
+ /** The document being scanned. */
+ private final IDocument fDocument;
+ /** The indentation accumulated by <code>findReferencePosition</code>. */
+ private int fIndent;
+ /**
+ * The absolute (character-counted) indentation offset for special cases
+ * (method defs, array initializers)
+ */
+ private int fAlign;
+ /** The stateful scanposition for the indentation methods. */
+ private int fPosition;
+ /** The previous position. */
+ private int fPreviousPos;
+ /** The most recent token. */
+ private int fToken;
+ /** The line of <code>fPosition</code>. */
+ private int fLine;
+ /**
+ * The scanner we will use to scan the document. It has to be installed
+ * on the same document as the one we get.
+ */
+ private final CHeuristicScanner fScanner;
+ /**
+ * The CDT Core preferences.
+ */
+ private final CorePrefs fPrefs;
+
+ /**
+ * Creates a new instance.
+ *
+ * @param document the document to scan
+ * @param scanner the {@link CHeuristicScanner} to be used for scanning
+ * the document. It must be installed on the same <code>IDocument</code>.
+ */
+ public CIndenter(IDocument document, CHeuristicScanner scanner) {
+ this(document, scanner, null);
+ }
+
+ /**
+ * Creates a new instance.
+ *
+ * @param document the document to scan
+ * @param scanner the {@link CHeuristicScanner} to be used for scanning
+ * the document. It must be installed on the same
+ * <code>IDocument</code>.
+ * @param project the C/C++ project to get the formatter preferences from, or
+ * <code>null</code> to use the workspace settings
+ */
+ public CIndenter(IDocument document, CHeuristicScanner scanner, ICProject project) {
+ Assert.isNotNull(document);
+ Assert.isNotNull(scanner);
+ fDocument= document;
+ fScanner= scanner;
+ fPrefs= new CorePrefs(project);
+ }
+
+ /**
+ * Computes the indentation at the reference point of <code>position</code>.
+ *
+ * @param offset the offset in the document
+ * @return a String which reflects the indentation at the line in which the
+ * reference position to <code>offset</code> resides, or <code>null</code>
+ * if it cannot be determined
+ */
+ public StringBuffer getReferenceIndentation(int offset) {
+ return getReferenceIndentation(offset, false);
+ }
+
+ /**
+ * Computes the indentation at the reference point of <code>position</code>.
+ *
+ * @param offset the offset in the document
+ * @param assumeOpeningBrace <code>true</code> if an opening brace should be assumed
+ * @return a String which reflects the indentation at the line in which the
+ * reference position to <code>offset</code> resides, or <code>null</code>
+ * if it cannot be determined
+ */
+ private StringBuffer getReferenceIndentation(int offset, boolean assumeOpeningBrace) {
+
+ int unit;
+ if (assumeOpeningBrace)
+ unit= findReferencePosition(offset, Symbols.TokenLBRACE);
+ else
+ unit= findReferencePosition(offset, peekChar(offset));
+
+ // if we were unable to find anything, return null
+ if (unit == CHeuristicScanner.NOT_FOUND)
+ return null;
+
+ return getLeadingWhitespace(unit);
+
+ }
+
+ /**
+ * Computes the indentation at <code>offset</code>.
+ *
+ * @param offset the offset in the document
+ * @return a String which reflects the correct indentation for the line in
+ * which offset resides, or <code>null</code> if it cannot be
+ * determined
+ */
+ public StringBuffer computeIndentation(int offset) {
+ return computeIndentation(offset, false);
+ }
+
+ /**
+ * Computes the indentation at <code>offset</code>.
+ *
+ * @param offset the offset in the document
+ * @param assumeOpeningBrace <code>true</code> if an opening brace should be assumed
+ * @return a String which reflects the correct indentation for the line in
+ * which offset resides, or <code>null</code> if it cannot be
+ * determined
+ */
+ public StringBuffer computeIndentation(int offset, boolean assumeOpeningBrace) {
+
+ StringBuffer reference= getReferenceIndentation(offset, assumeOpeningBrace);
+
+ // handle special alignment
+ if (fAlign != CHeuristicScanner.NOT_FOUND) {
+ try {
+ // a special case has been detected.
+ IRegion line= fDocument.getLineInformationOfOffset(fAlign);
+ int lineOffset= line.getOffset();
+ return createIndent(lineOffset, fAlign, false);
+ } catch (BadLocationException e) {
+ return null;
+ }
+ }
+
+ if (reference == null)
+ return null;
+
+ // add additional indent
+ return createReusingIndent(reference, fIndent);
+ }
+
+ /**
+ * Computes the length of a <code>CharacterSequence</code>, counting
+ * a tab character as the size until the next tab stop and every other
+ * character as one.
+ *
+ * @param indent the string to measure
+ * @return the visual length in characters
+ */
+ private int computeVisualLength(CharSequence indent) {
+ final int tabSize= fPrefs.prefTabSize;
+ int length= 0;
+ for (int i= 0; i < indent.length(); i++) {
+ char ch= indent.charAt(i);
+ switch (ch) {
+ case '\t':
+ if (tabSize > 0) {
+ int reminder= length % tabSize;
+ length += tabSize - reminder;
+ }
+ break;
+ case ' ':
+ length++;
+ break;
+ }
+ }
+ return length;
+ }
+
+ /**
+ * Strips any characters off the end of <code>reference</code> that exceed
+ * <code>indentLength</code>.
+ *
+ * @param reference the string to measure
+ * @param indentLength the maximum visual indentation length
+ * @return the stripped <code>reference</code>
+ */
+ private StringBuffer stripExceedingChars(StringBuffer reference, int indentLength) {
+ final int tabSize= fPrefs.prefTabSize;
+ int measured= 0;
+ int chars= reference.length();
+ int i= 0;
+ for (; measured < indentLength && i < chars; i++) {
+ char ch= reference.charAt(i);
+ switch (ch) {
+ case '\t':
+ if (tabSize > 0) {
+ int reminder= measured % tabSize;
+ measured += tabSize - reminder;
+ }
+ break;
+ case ' ':
+ measured++;
+ break;
+ }
+ }
+ int deleteFrom= measured > indentLength ? i - 1 : i;
+
+ return reference.delete(deleteFrom, chars);
+ }
+
+ /**
+ * Returns the indentation of the line at <code>offset</code> as a
+ * <code>StringBuffer</code>. If the offset is not valid, the empty string
+ * is returned.
+ *
+ * @param offset the offset in the document
+ * @return the indentation (leading whitespace) of the line in which
+ * <code>offset</code> is located
+ */
+ private StringBuffer getLeadingWhitespace(int offset) {
+ StringBuffer indent= new StringBuffer();
+ try {
+ IRegion line= fDocument.getLineInformationOfOffset(offset);
+ int lineOffset= line.getOffset();
+ int nonWS= fScanner.findNonWhitespaceForwardInAnyPartition(lineOffset, lineOffset + line.getLength());
+ indent.append(fDocument.get(lineOffset, nonWS - lineOffset));
+ return indent;
+ } catch (BadLocationException e) {
+ return indent;
+ }
+ }
+
+ /**
+ * Creates an indentation string of the length indent - start, consisting of
+ * the content in <code>fDocument</code> in the range [start, indent),
+ * with every character replaced by a space except for tabs, which are kept
+ * as such.
+ * <p>
+ * If <code>convertSpaceRunsToTabs</code> is <code>true</code>, every
+ * run of the number of spaces that make up a tab are replaced by a tab
+ * character. If it is not set, no conversion takes place, but tabs in the
+ * original range are still copied verbatim.
+ * </p>
+ *
+ * @param start the start of the document region to copy the indent from
+ * @param indent the exclusive end of the document region to copy the indent
+ * from
+ * @param convertSpaceRunsToTabs whether to convert consecutive runs of
+ * spaces to tabs
+ * @return the indentation corresponding to the document content specified
+ * by <code>start</code> and <code>indent</code>
+ */
+ private StringBuffer createIndent(int start, final int indent, final boolean convertSpaceRunsToTabs) {
+ final boolean convertTabs= fPrefs.prefUseTabs && convertSpaceRunsToTabs;
+ final int tabLen= fPrefs.prefTabSize;
+ final StringBuffer ret= new StringBuffer();
+ try {
+ int spaces= 0;
+ while (start < indent) {
+
+ char ch= fDocument.getChar(start);
+ if (ch == '\t') {
+ ret.append('\t');
+ spaces= 0;
+ } else if (convertTabs) {
+ spaces++;
+ if (spaces == tabLen) {
+ ret.append('\t');
+ spaces= 0;
+ }
+ } else {
+ ret.append(' ');
+ }
+
+ start++;
+ }
+ // remainder
+ while (spaces-- > 0)
+ ret.append(' ');
+
+ } catch (BadLocationException e) {
+ }
+
+ return ret;
+ }
+
+ /**
+ * Creates a string with a visual length of the given
+ * <code>indentationSize</code>.
+ *
+ * @param buffer the original indent to reuse if possible
+ * @param additional the additional indentation units to add or subtract to
+ * reference
+ * @return the modified <code>buffer</code> reflecting the indentation
+ * adapted to <code>additional</code>
+ */
+ private StringBuffer createReusingIndent(StringBuffer buffer, int additional) {
+ int refLength= computeVisualLength(buffer);
+ int addLength= fPrefs.prefIndentationSize * additional; // may be < 0
+ int totalLength= Math.max(0, refLength + addLength);
+
+
+ // copy the reference indentation for the indent up to the last tab
+ // stop within the maxCopy area
+ int minLength= Math.min(totalLength, refLength);
+ int tabSize= fPrefs.prefTabSize;
+ int maxCopyLength= tabSize > 0 ? minLength - minLength % tabSize : minLength; // maximum indent to copy
+ stripExceedingChars(buffer, maxCopyLength);
+
+
+ // add additional indent
+ int missing= totalLength - maxCopyLength;
+ final int tabs, spaces;
+ if (CCorePlugin.SPACE.equals(fPrefs.prefTabChar)) {
+ tabs= 0;
+ spaces= missing;
+ } else if (CCorePlugin.TAB.equals(fPrefs.prefTabChar)) {
+ tabs= tabSize > 0 ? missing / tabSize : 0;
+ spaces= tabSize > 0 ? missing % tabSize : missing;
+ } else if (CodeFormatterConstants.MIXED.equals(fPrefs.prefTabChar)) {
+ tabs= tabSize > 0 ? missing / tabSize : 0;
+ spaces= tabSize > 0 ? missing % tabSize : missing;
+ } else {
+ Assert.isTrue(false);
+ return null;
+ }
+ for(int i= 0; i < tabs; i++)
+ buffer.append('\t');
+ for(int i= 0; i < spaces; i++)
+ buffer.append(' ');
+ return buffer;
+ }
+
+ /**
+ * Returns the reference position regarding to indentation for <code>offset</code>,
+ * or <code>NOT_FOUND</code>. This method calls
+ * {@link #findReferencePosition(int, int) findReferencePosition(offset, nextChar)} where
+ * <code>nextChar</code> is the next character after <code>offset</code>.
+ *
+ * @param offset the offset for which the reference is computed
+ * @return the reference statement relative to which <code>offset</code>
+ * should be indented, or {@link CHeuristicScanner#NOT_FOUND}
+ */
+ public int findReferencePosition(int offset) {
+ return findReferencePosition(offset, peekChar(offset));
+ }
+
+ /**
+ * Peeks the next char in the document that comes after <code>offset</code>
+ * on the same line as <code>offset</code>.
+ *
+ * @param offset the offset into document
+ * @return the token symbol of the next element, or TokenEOF if there is none
+ */
+ private int peekChar(int offset) {
+ if (offset < fDocument.getLength()) {
+ try {
+ IRegion line= fDocument.getLineInformationOfOffset(offset);
+ int lineOffset= line.getOffset();
+ int next= fScanner.nextToken(offset, lineOffset + line.getLength());
+ return next;
+ } catch (BadLocationException e) {
+ }
+ }
+ return Symbols.TokenEOF;
+ }
+
+ /**
+ * Returns the reference position regarding to indentation for <code>position</code>,
+ * or <code>NOT_FOUND</code>.
+ *
+ * <p>If <code>peekNextChar</code> is <code>true</code>, the next token after
+ * <code>offset</code> is read and taken into account when computing the
+ * indentation. Currently, if the next token is the first token on the line
+ * (i.e. only preceded by whitespace), the following tokens are specially
+ * handled:
+ * <ul>
+ * <li><code>switch</code> labels are indented relative to the switch block</li>
+ * <li>opening curly braces are aligned correctly with the introducing code</li>
+ * <li>closing curly braces are aligned properly with the introducing code of
+ * the matching opening brace</li>
+ * <li>closing parenthesis' are aligned with their opening peer</li>
+ * <li>the <code>else</code> keyword is aligned with its <code>if</code>, anything
+ * else is aligned normally (i.e. with the base of any introducing statements).</li>
+ * <li>if there is no token on the same line after <code>offset</code>, the indentation
+ * is the same as for an <code>else</code> keyword</li>
+ * </ul>
+ *
+ * @param offset the offset for which the reference is computed
+ * @param nextToken the next token to assume in the document
+ * @return the reference statement relative to which <code>offset</code>
+ * should be indented, or {@link CHeuristicScanner#NOT_FOUND}
+ */
+ public int findReferencePosition(int offset, int nextToken) {
+ boolean danglingElse= false;
+ boolean unindent= false;
+ boolean indent= false;
+ boolean matchBrace= false;
+ boolean matchParen= false;
+ boolean matchCase= false;
+
+ // account for un-indentation characters already typed in, but after position
+ // if they are on a line by themselves, the indentation gets adjusted
+ // accordingly
+ //
+ // also account for a dangling else
+ if (offset < fDocument.getLength()) {
+ try {
+ IRegion line= fDocument.getLineInformationOfOffset(offset);
+ int lineOffset= line.getOffset();
+ int prevPos= Math.max(offset - 1, 0);
+ boolean isFirstTokenOnLine= fDocument.get(lineOffset, prevPos + 1 - lineOffset).trim().length() == 0;
+ int prevToken= fScanner.previousToken(prevPos, CHeuristicScanner.UNBOUND);
+ boolean bracelessBlockStart= fScanner.isBracelessBlockStart(prevPos, CHeuristicScanner.UNBOUND);
+
+ switch (nextToken) {
+ case Symbols.TokenELSE:
+ danglingElse= true;
+ break;
+ case Symbols.TokenCASE:
+ case Symbols.TokenDEFAULT:
+ if (isFirstTokenOnLine)
+ matchCase= true;
+ break;
+ case Symbols.TokenLBRACE: // for opening-brace-on-new-line style
+ if (bracelessBlockStart && !fPrefs.prefIndentBracesForBlocks)
+ unindent= true;
+ else if ((prevToken == Symbols.TokenCOLON || prevToken == Symbols.TokenEQUAL || prevToken == Symbols.TokenRBRACKET) && !fPrefs.prefIndentBracesForArrays)
+ unindent= true;
+ else if (!bracelessBlockStart && fPrefs.prefIndentBracesForMethods)
+ indent= true;
+ break;
+ case Symbols.TokenRBRACE: // closing braces get unindented
+ if (isFirstTokenOnLine)
+ matchBrace= true;
+ break;
+ case Symbols.TokenRPAREN:
+ if (isFirstTokenOnLine)
+ matchParen= true;
+ break;
+ }
+ } catch (BadLocationException e) {
+ }
+ } else {
+ // don't assume an else could come if we are at the end of file
+ danglingElse= false;
+ }
+
+ int ref= findReferencePosition(offset, danglingElse, matchBrace, matchParen, matchCase);
+ if (unindent)
+ fIndent--;
+ if (indent)
+ fIndent++;
+ return ref;
+ }
+
+ /**
+ * Returns the reference position regarding to indentation for <code>position</code>,
+ * or <code>NOT_FOUND</code>.<code>fIndent</code> will contain the
+ * relative indentation (in indentation units, not characters) after the
+ * call. If there is a special alignment (e.g. for a method declaration
+ * where parameters should be aligned), <code>fAlign</code> will contain
+ * the absolute position of the alignment reference in <code>fDocument</code>,
+ * otherwise <code>fAlign</code> is set to <code>CHeuristicScanner.NOT_FOUND</code>.
+ *
+ * @param offset the offset for which the reference is computed
+ * @param danglingElse whether a dangling else should be assumed at <code>position</code>
+ * @param matchBrace whether the position of the matching brace should be
+ * returned instead of doing code analysis
+ * @param matchParen whether the position of the matching parenthesis
+ * should be returned instead of doing code analysis
+ * @param matchCase whether the position of a switch statement reference
+ * should be returned (either an earlier case statement or the
+ * switch block brace)
+ * @return the reference statement relative to which <code>position</code>
+ * should be indented, or {@link CHeuristicScanner#NOT_FOUND}
+ */
+ public int findReferencePosition(int offset, boolean danglingElse, boolean matchBrace, boolean matchParen, boolean matchCase) {
+ fIndent= 0; // the indentation modification
+ fAlign= CHeuristicScanner.NOT_FOUND;
+ fPosition= offset;
+
+ // forward cases
+ // an unindentation happens sometimes if the next token is special, namely on braces, parens and case labels
+ // align braces, but handle the case where we align with the method declaration start instead of
+ // the opening brace.
+ if (matchBrace) {
+ if (skipScope(Symbols.TokenLBRACE, Symbols.TokenRBRACE)) {
+ try {
+ // align with the opening brace that is on a line by its own
+ int lineOffset= fDocument.getLineOffset(fLine);
+ if (lineOffset <= fPosition && fDocument.get(lineOffset, fPosition - lineOffset).trim().length() == 0)
+ return fPosition;
+ } catch (BadLocationException e) {
+ // concurrent modification - walk default path
+ }
+ // if the opening brace is not on the start of the line, skip to the start
+ int pos= skipToStatementStart(true, true);
+ fIndent= 0; // indent is aligned with reference position
+ return pos;
+ } else {
+ // if we can't find the matching brace, the heuristic is to unindent
+ // by one against the normal position
+ int pos= findReferencePosition(offset, danglingElse, false, matchParen, matchCase);
+ fIndent--;
+ return pos;
+ }
+ }
+
+ // align parenthesis'
+ if (matchParen) {
+ if (skipScope(Symbols.TokenLPAREN, Symbols.TokenRPAREN))
+ return fPosition;
+ else {
+ // if we can't find the matching paren, the heuristic is to unindent
+ // by one against the normal position
+ int pos= findReferencePosition(offset, danglingElse, matchBrace, false, matchCase);
+ fIndent--;
+ return pos;
+ }
+ }
+
+ // the only reliable way to get case labels aligned (due to many different styles of using braces in a block)
+ // is to go for another case statement, or the scope opening brace
+ if (matchCase) {
+ return matchCaseAlignment();
+ }
+
+ nextToken();
+ switch (fToken) {
+ case Symbols.TokenGREATERTHAN:
+ case Symbols.TokenRBRACE:
+ // skip the block and fall through
+ // if we can't complete the scope, reset the scan position
+ int pos= fPosition;
+ if (!skipScope())
+ fPosition= pos;
+ case Symbols.TokenSEMICOLON:
+ // this is the 90% case: after a statement block
+ // the end of the previous statement / block previous.end
+ // search to the end of the statement / block before the previous; the token just after that is previous.start
+ return skipToStatementStart(danglingElse, false);
+
+ // scope introduction: special treat who special is
+ case Symbols.TokenLPAREN:
+ case Symbols.TokenLBRACE:
+ case Symbols.TokenLBRACKET:
+ return handleScopeIntroduction(offset + 1);
+
+ case Symbols.TokenEOF:
+ // trap when hitting start of document
+ return CHeuristicScanner.NOT_FOUND;
+
+ case Symbols.TokenEQUAL:
+ // indent assignments
+ fIndent= fPrefs.prefAssignmentIndent;
+ return fPosition;
+
+ case Symbols.TokenCOLON:
+ // TODO handle ternary deep indentation
+ fIndent= fPrefs.prefCaseBlockIndent;
+ return fPosition;
+
+ case Symbols.TokenQUESTIONMARK:
+ if (fPrefs.prefTernaryDeepAlign) {
+ setFirstElementAlignment(fPosition, offset + 1);
+ return fPosition;
+ } else {
+ fIndent= fPrefs.prefTernaryIndent;
+ return fPosition;
+ }
+
+ // indentation for blockless introducers:
+ case Symbols.TokenDO:
+ case Symbols.TokenWHILE:
+ case Symbols.TokenELSE:
+ fIndent= fPrefs.prefSimpleIndent;
+ return fPosition;
+
+ case Symbols.TokenTRY:
+ return skipToStatementStart(danglingElse, false);
+ case Symbols.TokenRPAREN:
+ int line= fLine;
+ if (skipScope(Symbols.TokenLPAREN, Symbols.TokenRPAREN)) {
+ int scope= fPosition;
+ nextToken();
+ if (fToken == Symbols.TokenIF || fToken == Symbols.TokenWHILE || fToken == Symbols.TokenFOR) {
+ fIndent= fPrefs.prefSimpleIndent;
+ return fPosition;
+ }
+ fPosition= scope;
+ if (looksLikeMethodDecl()) {
+ return skipToStatementStart(danglingElse, false);
+ }
+ if (fToken == Symbols.TokenCATCH) {
+ return skipToStatementStart(danglingElse, false);
+ }
+ fPosition= scope;
+ if (looksLikeAnonymousTypeDecl()) {
+ return skipToStatementStart(danglingElse, false);
+ }
+ }
+ // restore
+ fPosition= offset;
+ fLine= line;
+ // else: fall through to default
+
+ case Symbols.TokenCOMMA:
+ // inside a list of some type
+ // easy if there is already a list item before with its own indentation - we just align
+ // if not: take the start of the list ( LPAREN, LBRACE, LBRACKET ) and either align or
+ // indent by list-indent
+ default:
+ // inside whatever we don't know about: similar to the list case:
+ // if we are inside a continued expression, then either align with a previous line that has indentation
+ // or indent from the expression start line (either a scope introducer or the start of the expr).
+ return skipToPreviousListItemOrListStart();
+
+ }
+ }
+
+ /**
+ * Skips to the start of a statement that ends at the current position.
+ *
+ * @param danglingElse whether to indent aligned with the last <code>if</code>
+ * @param isInBlock whether the current position is inside a block, which limits the search scope to the next scope introducer
+ * @return the reference offset of the start of the statement
+ */
+ private int skipToStatementStart(boolean danglingElse, boolean isInBlock) {
+ final int NOTHING= 0;
+ final int READ_PARENS= 1;
+ final int READ_IDENT= 2;
+ int mayBeMethodBody= NOTHING;
+ boolean isTypeBody= false;
+ while (true) {
+ nextToken();
+
+ if (isInBlock) {
+ switch (fToken) {
+ // exit on all block introducers
+ case Symbols.TokenIF:
+ case Symbols.TokenELSE:
+ case Symbols.TokenCATCH:
+ case Symbols.TokenDO:
+ case Symbols.TokenWHILE:
+ case Symbols.TokenFOR:
+ case Symbols.TokenTRY:
+ return fPosition;
+
+ case Symbols.TokenSTATIC:
+ mayBeMethodBody= READ_IDENT; // treat static blocks like methods
+ break;
+
+ case Symbols.TokenCLASS:
+ case Symbols.TokenENUM:
+ isTypeBody= true;
+ break;
+
+ case Symbols.TokenSWITCH:
+ fIndent= fPrefs.prefCaseIndent;
+ return fPosition;
+ }
+ }
+
+ switch (fToken) {
+ // scope introduction through: LPAREN, LBRACE, LBRACKET
+ // search stop on SEMICOLON, RBRACE, COLON, EOF
+ // -> the next token is the start of the statement (i.e. previousPos when backward scanning)
+ case Symbols.TokenLPAREN:
+ case Symbols.TokenLBRACE:
+ case Symbols.TokenLBRACKET:
+ case Symbols.TokenSEMICOLON:
+ case Symbols.TokenEOF:
+ if (isInBlock)
+ fIndent= getBlockIndent(mayBeMethodBody == READ_IDENT, isTypeBody);
+ // else: fIndent set by previous calls
+ return fPreviousPos;
+
+ case Symbols.TokenCOLON:
+ int pos= fPreviousPos;
+ if (!isConditional())
+ return pos;
+ break;
+
+ case Symbols.TokenRBRACE:
+ // RBRACE is a little tricky: it can be the end of an array definition, but
+ // usually it is the end of a previous block
+ pos= fPreviousPos; // store state
+ if (skipScope() && looksLikeArrayInitializerIntro()) {
+ continue; // it's an array
+ } else {
+ if (isInBlock)
+ fIndent= getBlockIndent(mayBeMethodBody == READ_IDENT, isTypeBody);
+ return pos; // it's not - do as with all the above
+ }
+
+ // scopes: skip them
+ case Symbols.TokenRPAREN:
+ if (isInBlock)
+ mayBeMethodBody= READ_PARENS;
+ case Symbols.TokenRBRACKET:
+ case Symbols.TokenGREATERTHAN:
+ pos= fPreviousPos;
+ if (skipScope())
+ break;
+ else
+ return pos;
+
+ // IF / ELSE: align the position after the conditional block with the if
+ // so we are ready for an else, except if danglingElse is false
+ // in order for this to work, we must skip an else to its if
+ case Symbols.TokenIF:
+ if (danglingElse)
+ return fPosition;
+ else
+ break;
+ case Symbols.TokenELSE:
+ // skip behind the next if, as we have that one covered
+ pos= fPosition;
+ if (skipNextIF())
+ break;
+ else
+ return pos;
+
+ case Symbols.TokenDO:
+ // align the WHILE position with its do
+ return fPosition;
+
+ case Symbols.TokenWHILE:
+ // this one is tricky: while can be the start of a while loop
+ // or the end of a do - while
+ pos= fPosition;
+ if (hasMatchingDo()) {
+ // continue searching from the DO on
+ break;
+ } else {
+ // continue searching from the WHILE on
+ fPosition= pos;
+ break;
+ }
+ case Symbols.TokenIDENT:
+ if (mayBeMethodBody == READ_PARENS)
+ mayBeMethodBody= READ_IDENT;
+ break;
+
+ default:
+ // keep searching
+
+ }
+
+ }
+ }
+
+ private int getBlockIndent(boolean isMethodBody, boolean isTypeBody) {
+ if (isTypeBody)
+ return fPrefs.prefTypeIndent + (fPrefs.prefIndentBracesForTypes ? 1 : 0);
+ else if (isMethodBody)
+ return fPrefs.prefMethodBodyIndent + (fPrefs.prefIndentBracesForMethods ? 1 : 0);
+ else
+ return fIndent;
+ }
+
+ /**
+ * Returns true if the colon at the current position is part of a conditional
+ * (ternary) expression, false otherwise.
+ *
+ * @return true if the colon at the current position is part of a conditional
+ */
+ private boolean isConditional() {
+ while (true) {
+ nextToken();
+ switch (fToken) {
+
+ // search for case labels, which consist of (possibly qualified) identifiers or numbers
+ case Symbols.TokenIDENT:
+ case Symbols.TokenOTHER: // dots for qualified constants
+ continue;
+ case Symbols.TokenCASE:
+ return false;
+
+ default:
+ return true;
+ }
+ }
+ }
+
+ /**
+ * Returns as a reference any previous <code>switch</code> labels (<code>case</code>
+ * or <code>default</code>) or the offset of the brace that scopes the switch
+ * statement. Sets <code>fIndent</code> to <code>prefCaseIndent</code> upon
+ * a match.
+ *
+ * @return the reference offset for a <code>switch</code> label
+ */
+ private int matchCaseAlignment() {
+ while (true) {
+ nextToken();
+ switch (fToken) {
+ // invalid cases: another case label or an LBRACE must come before a case
+ // -> bail out with the current position
+ case Symbols.TokenLPAREN:
+ case Symbols.TokenLBRACKET:
+ case Symbols.TokenEOF:
+ return fPosition;
+ case Symbols.TokenLBRACE:
+ // opening brace of switch statement
+ fIndent= fPrefs.prefCaseIndent;
+ return fPosition;
+ case Symbols.TokenCASE:
+ case Symbols.TokenDEFAULT:
+ // align with previous label
+ fIndent= 0;
+ return fPosition;
+
+ // scopes: skip them
+ case Symbols.TokenRPAREN:
+ case Symbols.TokenRBRACKET:
+ case Symbols.TokenRBRACE:
+ case Symbols.TokenGREATERTHAN:
+ skipScope();
+ break;
+
+ default:
+ // keep searching
+ continue;
+
+ }
+ }
+ }
+
+ /**
+ * Returns the reference position for a list element. The algorithm
+ * tries to match any previous indentation on the same list. If there is none,
+ * the reference position returned is determined depending on the type of list:
+ * The indentation will either match the list scope introducer (e.g. for
+ * method declarations), so called deep indents, or simply increase the
+ * indentation by a number of standard indents. See also {@link #handleScopeIntroduction(int)}.
+ *
+ * @return the reference position for a list item: either a previous list item
+ * that has its own indentation, or the list introduction start.
+ */
+ private int skipToPreviousListItemOrListStart() {
+ int startLine= fLine;
+ int startPosition= fPosition;
+ while (true) {
+ nextToken();
+
+ // if any line item comes with its own indentation, adapt to it
+ if (fLine < startLine) {
+ try {
+ int lineOffset= fDocument.getLineOffset(startLine);
+ int bound= Math.min(fDocument.getLength(), startPosition + 1);
+ fAlign= fScanner.findNonWhitespaceForwardInAnyPartition(lineOffset, bound);
+ } catch (BadLocationException e) {
+ // ignore and return just the position
+ }
+ return startPosition;
+ }
+
+ switch (fToken) {
+ // scopes: skip them
+ case Symbols.TokenRPAREN:
+ case Symbols.TokenRBRACKET:
+ case Symbols.TokenRBRACE:
+ case Symbols.TokenGREATERTHAN:
+ skipScope();
+ break;
+
+ // scope introduction: special treat who special is
+ case Symbols.TokenLPAREN:
+ case Symbols.TokenLBRACE:
+ case Symbols.TokenLBRACKET:
+ return handleScopeIntroduction(startPosition + 1);
+
+ case Symbols.TokenSEMICOLON:
+ return fPosition;
+ case Symbols.TokenQUESTIONMARK:
+ if (fPrefs.prefTernaryDeepAlign) {
+ setFirstElementAlignment(fPosition - 1, fPosition + 1);
+ return fPosition;
+ } else {
+ fIndent= fPrefs.prefTernaryIndent;
+ return fPosition;
+ }
+ case Symbols.TokenEOF:
+ return 0;
+
+ }
+ }
+ }
+
+ /**
+ * Skips a scope and positions the cursor (<code>fPosition</code>) on the
+ * token that opens the scope. Returns <code>true</code> if a matching peer
+ * could be found, <code>false</code> otherwise. The current token when calling
+ * must be one out of <code>Symbols.TokenRPAREN</code>, <code>Symbols.TokenRBRACE</code>,
+ * and <code>Symbols.TokenRBRACKET</code>.
+ *
+ * @return <code>true</code> if a matching peer was found, <code>false</code> otherwise
+ */
+ private boolean skipScope() {
+ switch (fToken) {
+ case Symbols.TokenRPAREN:
+ return skipScope(Symbols.TokenLPAREN, Symbols.TokenRPAREN);
+ case Symbols.TokenRBRACKET:
+ return skipScope(Symbols.TokenLBRACKET, Symbols.TokenRBRACKET);
+ case Symbols.TokenRBRACE:
+ return skipScope(Symbols.TokenLBRACE, Symbols.TokenRBRACE);
+ case Symbols.TokenGREATERTHAN:
+ if (!fPrefs.prefHasGenerics)
+ return false;
+ int storedPosition= fPosition;
+ int storedToken= fToken;
+ nextToken();
+ switch (fToken) {
+ case Symbols.TokenIDENT:
+ if (!isGenericStarter(getTokenContent()))
+ break;
+ case Symbols.TokenQUESTIONMARK:
+ case Symbols.TokenGREATERTHAN:
+ if (skipScope(Symbols.TokenLESSTHAN, Symbols.TokenGREATERTHAN))
+ return true;
+ }
+ // <> are harder to detect - restore the position if we fail
+ fPosition= storedPosition;
+ fToken= storedToken;
+ return false;
+
+ default:
+ Assert.isTrue(false);
+ return false;
+ }
+ }
+
+ /**
+ * Returns the contents of the current token.
+ *
+ * @return the contents of the current token
+ */
+ private CharSequence getTokenContent() {
+ return new DocumentCharacterIterator(fDocument, fPosition, fPreviousPos);
+ }
+
+ /**
+ * Returns <code>true</code> if <code>identifier</code> is probably a
+ * type variable or type name, <code>false</code> if it is rather not.
+ * This is a heuristic.
+ *
+ * @param identifier the identifier to check
+ * @return <code>true</code> if <code>identifier</code> is probably a
+ * type variable or type name, <code>false</code> if not
+ */
+ private boolean isGenericStarter(CharSequence identifier) {
+ /* This heuristic allows any identifiers if they start with an upper
+ * case. This will fail when a comparison is made with constants:
+ *
+ * if (MAX > foo)
+ *
+ * will try to find the matching '<' which will never come
+ *
+ * Also, it will fail on lower case types and type variables
+ */
+ int length= identifier.length();
+ if (length > 0 && Character.isUpperCase(identifier.charAt(0))) {
+ for (int i= 0; i < length; i++) {
+ if (identifier.charAt(i) == '_')
+ return false;
+ }
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * Handles the introduction of a new scope. The current token must be one out
+ * of <code>Symbols.TokenLPAREN</code>, <code>Symbols.TokenLBRACE</code>,
+ * and <code>Symbols.TokenLBRACKET</code>. Returns as the reference position
+ * either the token introducing the scope or - if available - the first
+ * token after that.
+ *
+ * <p>Depending on the type of scope introduction, the indentation will align
+ * (deep indenting) with the reference position (<code>fAlign</code> will be
+ * set to the reference position) or <code>fIndent</code> will be set to
+ * the number of indentation units.
+ * </p>
+ *
+ * @param bound the bound for the search for the first token after the scope
+ * introduction.
+ * @return the indent
+ */
+ private int handleScopeIntroduction(int bound) {
+ switch (fToken) {
+ // scope introduction: special treat who special is
+ case Symbols.TokenLPAREN:
+ int pos= fPosition; // store
+
+ // special: method declaration deep indentation
+ if (looksLikeMethodDecl()) {
+ if (fPrefs.prefMethodDeclDeepIndent)
+ return setFirstElementAlignment(pos, bound);
+ else {
+ fIndent= fPrefs.prefMethodDeclIndent;
+ return pos;
+ }
+ } else {
+ fPosition= pos;
+ if (looksLikeMethodCall()) {
+ if (fPrefs.prefMethodCallDeepIndent)
+ return setFirstElementAlignment(pos, bound);
+ else {
+ fIndent= fPrefs.prefMethodCallIndent;
+ return pos;
+ }
+ } else if (fPrefs.prefParenthesisDeepIndent)
+ return setFirstElementAlignment(pos, bound);
+ }
+
+ // normal: return the parenthesis as reference
+ fIndent= fPrefs.prefParenthesisIndent;
+ return pos;
+
+ case Symbols.TokenLBRACE:
+ pos= fPosition; // store
+
+ // special: array initializer
+ if (looksLikeArrayInitializerIntro())
+ if (fPrefs.prefArrayDeepIndent)
+ return setFirstElementAlignment(pos, bound);
+ else
+ fIndent= fPrefs.prefArrayIndent;
+ else
+ fIndent= fPrefs.prefBlockIndent;
+
+ // normal: skip to the statement start before the scope introducer
+ // opening braces are often on differently ending indents than e.g. a method definition
+ if (looksLikeArrayInitializerIntro() && !fPrefs.prefIndentBracesForArrays
+ || !fPrefs.prefIndentBracesForBlocks) {
+ fPosition= pos; // restore
+ return skipToStatementStart(true, true); // set to true to match the first if
+ } else {
+ return pos;
+ }
+
+ case Symbols.TokenLBRACKET:
+ pos= fPosition; // store
+
+ // special: method declaration deep indentation
+ if (fPrefs.prefArrayDimensionsDeepIndent) {
+ return setFirstElementAlignment(pos, bound);
+ }
+
+ // normal: return the bracket as reference
+ fIndent= fPrefs.prefBracketIndent;
+ return pos; // restore
+
+ default:
+ Assert.isTrue(false);
+ return -1; // dummy
+ }
+ }
+
+ /**
+ * Sets the deep indent offset (<code>fAlign</code>) to either the offset
+ * right after <code>scopeIntroducerOffset</code> or - if available - the
+ * first C token after <code>scopeIntroducerOffset</code>, but before
+ * <code>bound</code>.
+ *
+ * @param scopeIntroducerOffset the offset of the scope introducer
+ * @param bound the bound for the search for another element
+ * @return the reference position
+ */
+ private int setFirstElementAlignment(int scopeIntroducerOffset, int bound) {
+ int firstPossible= scopeIntroducerOffset + 1; // align with the first position after the scope intro
+ fAlign= fScanner.findNonWhitespaceForwardInAnyPartition(firstPossible, bound);
+ if (fAlign == CHeuristicScanner.NOT_FOUND)
+ fAlign= firstPossible;
+ return fAlign;
+ }
+
+
+ /**
+ * Returns <code>true</code> if the next token received after calling
+ * <code>nextToken</code> is either an equal sign or an array designator ('[]').
+ *
+ * @return <code>true</code> if the next elements look like the start of an array definition
+ */
+ private boolean looksLikeArrayInitializerIntro() {
+ nextToken();
+ if (fToken == Symbols.TokenEQUAL || skipBrackets()) {
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * Skips over the next <code>if</code> keyword. The current token when calling
+ * this method must be an <code>else</code> keyword. Returns <code>true</code>
+ * if a matching <code>if</code> could be found, <code>false</code> otherwise.
+ * The cursor (<code>fPosition</code>) is set to the offset of the <code>if</code>
+ * token.
+ *
+ * @return <code>true</code> if a matching <code>if</code> token was found, <code>false</code> otherwise
+ */
+ private boolean skipNextIF() {
+ Assert.isTrue(fToken == Symbols.TokenELSE);
+
+ while (true) {
+ nextToken();
+ switch (fToken) {
+ // scopes: skip them
+ case Symbols.TokenRPAREN:
+ case Symbols.TokenRBRACKET:
+ case Symbols.TokenRBRACE:
+ case Symbols.TokenGREATERTHAN:
+ skipScope();
+ break;
+
+ case Symbols.TokenIF:
+ // found it, return
+ return true;
+ case Symbols.TokenELSE:
+ // recursively skip else-if blocks
+ skipNextIF();
+ break;
+
+ // shortcut scope starts
+ case Symbols.TokenLPAREN:
+ case Symbols.TokenLBRACE:
+ case Symbols.TokenLBRACKET:
+ case Symbols.TokenEOF:
+ return false;
+ }
+ }
+ }
+
+
+ /**
+ * while(condition); is ambiguous when parsed backwardly, as it is a valid
+ * statement by its own, so we have to check whether there is a matching
+ * do. A <code>do</code> can either be separated from the while by a
+ * block, or by a single statement, which limits our search distance.
+ *
+ * @return <code>true</code> if the <code>while</code> currently in
+ * <code>fToken</code> has a matching <code>do</code>.
+ */
+ private boolean hasMatchingDo() {
+ Assert.isTrue(fToken == Symbols.TokenWHILE);
+ nextToken();
+ switch (fToken) {
+ case Symbols.TokenRBRACE:
+ skipScope(); // and fall thru
+ case Symbols.TokenSEMICOLON:
+ skipToStatementStart(false, false);
+ return fToken == Symbols.TokenDO;
+ }
+ return false;
+ }
+
+ /**
+ * Skips brackets if the current token is a RBRACKET. There can be nothing
+ * but whitespace in between, this is only to be used for <code>[]</code> elements.
+ *
+ * @return <code>true</code> if a <code>[]</code> could be scanned, the
+ * current token is left at the LBRACKET.
+ */
+ private boolean skipBrackets() {
+ if (fToken == Symbols.TokenRBRACKET) {
+ nextToken();
+ if (fToken == Symbols.TokenLBRACKET) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ /**
+ * Reads the next token in backward direction from the heuristic scanner
+ * and sets the fields <code>fToken, fPreviousPosition</code> and <code>fPosition</code>
+ * accordingly.
+ */
+ private void nextToken() {
+ nextToken(fPosition);
+ }
+
+ /**
+ * Reads the next token in backward direction of <code>start</code> from
+ * the heuristic scanner and sets the fields <code>fToken, fPreviousPosition</code>
+ * and <code>fPosition</code> accordingly.
+ *
+ * @param start the start offset from which to scan backwards
+ */
+ private void nextToken(int start) {
+ fToken= fScanner.previousToken(start - 1, CHeuristicScanner.UNBOUND);
+ fPreviousPos= start;
+ fPosition= fScanner.getPosition() + 1;
+ try {
+ fLine= fDocument.getLineOfOffset(fPosition);
+ } catch (BadLocationException e) {
+ fLine= -1;
+ }
+ }
+
+ /**
+ * Returns <code>true</code> if the current tokens look like a method
+ * declaration header (i.e. only the return type and method name). The
+ * heuristic calls <code>nextToken</code> and expects an identifier
+ * (method name) and a type declaration (an identifier with optional
+ * brackets) which also covers the visibility modifier of constructors; it
+ * does not recognize package visible constructors.
+ *
+ * @return <code>true</code> if the current position looks like a method
+ * declaration header.
+ */
+ private boolean looksLikeMethodDecl() {
+ /*
+ * TODO This heuristic does not recognize package private constructors
+ * since those do have neither type nor visibility keywords.
+ * One option would be to go over the parameter list, but that might
+ * be empty as well, or not typed in yet - hard to do without an AST...
+ */
+
+ nextToken();
+ if (fToken == Symbols.TokenIDENT) { // method name
+ do nextToken();
+ while (skipBrackets()); // optional brackets for array valued return types
+
+ return fToken == Symbols.TokenIDENT; // return type name
+
+ }
+ return false;
+ }
+
+ /**
+ * Returns <code>true</code> if the current tokens look like an anonymous type declaration
+ * header (i.e. a type name (potentially qualified) and a new keyword). The heuristic calls
+ * <code>nextToken</code> and expects a possibly qualified identifier (type name) and a new
+ * keyword
+ *
+ * @return <code>true</code> if the current position looks like a anonymous type declaration
+ * header.
+ */
+ private boolean looksLikeAnonymousTypeDecl() {
+ nextToken();
+ if (fToken == Symbols.TokenIDENT) { // type name
+ nextToken();
+ while (fToken == Symbols.TokenOTHER) { // dot of qualification
+ nextToken();
+ if (fToken != Symbols.TokenIDENT) // qualificating name
+ return false;
+ nextToken();
+ }
+ return fToken == Symbols.TokenNEW;
+ }
+ return false;
+ }
+
+ /**
+ * Returns <code>true</code> if the current tokens look like a method
+ * call header (i.e. an identifier as opposed to a keyword taking parenthesized
+ * parameters such as <code>if</code>).
+ * <p>The heuristic calls <code>nextToken</code> and expects an identifier
+ * (method name).
+ *
+ * @return <code>true</code> if the current position looks like a method call
+ * header.
+ */
+ private boolean looksLikeMethodCall() {
+ // TODO add awareness for constructor calls with generic types: new ArrayList<String>()
+ nextToken();
+ return fToken == Symbols.TokenIDENT; // method name
+ }
+
+ /**
+ * Scans tokens for the matching opening peer. The internal cursor
+ * (<code>fPosition</code>) is set to the offset of the opening peer if found.
+ *
+ * @param openToken the opening peer token
+ * @param closeToken the closing peer token
+ * @return <code>true</code> if a matching token was found, <code>false</code>
+ * otherwise
+ */
+ private boolean skipScope(int openToken, int closeToken) {
+
+ int depth= 1;
+
+ while (true) {
+ nextToken();
+
+ if (fToken == closeToken) {
+ depth++;
+ } else if (fToken == openToken) {
+ depth--;
+ if (depth == 0)
+ return true;
+ } else if (fToken == Symbols.TokenEOF) {
+ return false;
+ }
+ }
+ }
+}
diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/CPartitionScanner.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/CPartitionScanner.java
index 59a0ff351e0..87594c786b4 100644
--- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/CPartitionScanner.java
+++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/CPartitionScanner.java
@@ -25,6 +25,8 @@ import org.eclipse.jface.text.rules.SingleLineRule;
import org.eclipse.jface.text.rules.Token;
import org.eclipse.jface.text.rules.WordRule;
+import org.eclipse.cdt.ui.text.ICPartitions;
+
/**
* This scanner is not actually use in the code it was relace by
@@ -90,7 +92,7 @@ public class CPartitionScanner extends RuleBasedPartitionScanner implements ICPa
public CPartitionScanner() {
super();
- IToken comment= new Token(C_MULTILINE_COMMENT);
+ IToken comment= new Token(C_MULTI_LINE_COMMENT);
IToken single_comment= new Token(C_SINGLE_LINE_COMMENT);
IToken string= new Token(C_STRING);
IToken character = new Token(C_CHARACTER);
diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/CSourceViewerConfiguration.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/CSourceViewerConfiguration.java
index e6c9806bff4..5148df68d1a 100644
--- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/CSourceViewerConfiguration.java
+++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/CSourceViewerConfiguration.java
@@ -44,17 +44,23 @@ import org.eclipse.jface.text.source.SourceViewerConfiguration;
import org.eclipse.jface.util.PropertyChangeEvent;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.editors.text.TextSourceViewerConfiguration;
import org.eclipse.ui.texteditor.AbstractDecoratedTextEditorPreferenceConstants;
+import org.eclipse.ui.texteditor.IDocumentProvider;
import org.eclipse.ui.texteditor.ITextEditor;
import org.eclipse.cdt.core.dom.ast.gnu.c.GCCLanguage;
import org.eclipse.cdt.core.dom.ast.gnu.cpp.GPPLanguage;
+import org.eclipse.cdt.core.model.ICElement;
+import org.eclipse.cdt.core.model.ICProject;
import org.eclipse.cdt.core.model.ILanguage;
import org.eclipse.cdt.ui.CElementContentProvider;
import org.eclipse.cdt.ui.CUIPlugin;
import org.eclipse.cdt.ui.ILanguageUI;
+import org.eclipse.cdt.ui.text.ICPartitions;
+import org.eclipse.cdt.internal.ui.editor.CDocumentProvider;
import org.eclipse.cdt.internal.ui.editor.CEditor;
import org.eclipse.cdt.internal.ui.editor.CElementHyperlinkDetector;
import org.eclipse.cdt.internal.ui.editor.CSourceViewer;
@@ -64,7 +70,6 @@ import org.eclipse.cdt.internal.ui.text.contentassist.CCompletionProcessor2;
import org.eclipse.cdt.internal.ui.text.contentassist.ContentAssistPreference;
-
/**
* Configuration for an <code>SourceViewer</code> which shows C code.
*/
@@ -144,7 +149,7 @@ public class CSourceViewerConfiguration extends TextSourceViewerConfiguration {
presenter.setDocumentPartitioning(getConfiguredDocumentPartitioning(null));
final IInformationProvider provider = new CElementContentProvider(getEditor());
presenter.setInformationProvider(provider, IDocument.DEFAULT_CONTENT_TYPE);
- presenter.setInformationProvider(provider, ICPartitions.C_MULTILINE_COMMENT);
+ presenter.setInformationProvider(provider, ICPartitions.C_MULTI_LINE_COMMENT);
presenter.setInformationProvider(provider, ICPartitions.C_SINGLE_LINE_COMMENT);
presenter.setInformationProvider(provider, ICPartitions.C_STRING);
presenter.setInformationProvider(provider, ICPartitions.C_CHARACTER);
@@ -190,8 +195,8 @@ public class CSourceViewerConfiguration extends TextSourceViewerConfiguration {
reconciler.setRepairer(dr, ICPartitions.C_SINGLE_LINE_COMMENT);
dr= new DefaultDamagerRepairer(getMultilineCommentScanner());
- reconciler.setDamager(dr, ICPartitions.C_MULTILINE_COMMENT);
- reconciler.setRepairer(dr, ICPartitions.C_MULTILINE_COMMENT);
+ reconciler.setDamager(dr, ICPartitions.C_MULTI_LINE_COMMENT);
+ reconciler.setRepairer(dr, ICPartitions.C_MULTI_LINE_COMMENT);
dr= new DefaultDamagerRepairer(getStringScanner());
reconciler.setDamager(dr, ICPartitions.C_STRING);
@@ -247,10 +252,13 @@ public class CSourceViewerConfiguration extends TextSourceViewerConfiguration {
* @see org.eclipse.jface.text.source.SourceViewerConfiguration#getAutoEditStrategies(org.eclipse.jface.text.source.ISourceViewer, java.lang.String)
*/
public IAutoEditStrategy[] getAutoEditStrategies(ISourceViewer sourceViewer, String contentType) {
- if(ICPartitions.C_MULTILINE_COMMENT.equals(contentType)) {
- return new IAutoEditStrategy[] {new CCommentAutoIndentStrategy()};
- }
- return new IAutoEditStrategy[] {new CAutoIndentStrategy()};
+ String partitioning= getConfiguredDocumentPartitioning(sourceViewer);
+ if (ICPartitions.C_MULTI_LINE_COMMENT.equals(contentType))
+ return new IAutoEditStrategy[] { new CCommentAutoIndentStrategy() };
+// else if (ICPartitions.C_STRING.equals(contentType))
+// return new IAutoEditStrategy[] { new SmartSemicolonAutoEditStrategy(partitioning), new JavaStringAutoIndentStrategy(partitioning) };
+ else
+ return new IAutoEditStrategy[] { new CAutoIndentStrategy(partitioning, getProject()) };
}
/**
@@ -303,6 +311,25 @@ public class CSourceViewerConfiguration extends TextSourceViewerConfiguration {
return (String[]) vector.toArray(new String[vector.size()]);
}
+ private ICProject getProject() {
+ ITextEditor editor= getEditor();
+ if (editor == null)
+ return null;
+
+ ICElement element= null;
+ IEditorInput input= editor.getEditorInput();
+ IDocumentProvider provider= editor.getDocumentProvider();
+ if (provider instanceof CDocumentProvider) {
+ CDocumentProvider cudp= (CDocumentProvider) provider;
+ element= cudp.getWorkingCopy(input);
+ }
+
+ if (element == null)
+ return null;
+
+ return element.getCProject();
+ }
+
/**
* @see SourceViewerConfiguration#getAnnotationHover(ISourceViewer)
*/
@@ -370,7 +397,7 @@ public class CSourceViewerConfiguration extends TextSourceViewerConfiguration {
public String[] getConfiguredContentTypes(ISourceViewer sourceViewer) {
return new String[] {
IDocument.DEFAULT_CONTENT_TYPE,
- ICPartitions.C_MULTILINE_COMMENT,
+ ICPartitions.C_MULTI_LINE_COMMENT,
ICPartitions.C_SINGLE_LINE_COMMENT,
ICPartitions.C_STRING,
ICPartitions.C_CHARACTER};
diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/CTextTools.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/CTextTools.java
index 81b4dcdc46f..56d432e64dd 100644
--- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/CTextTools.java
+++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/CTextTools.java
@@ -11,11 +11,7 @@
*******************************************************************************/
package org.eclipse.cdt.internal.ui.text;
-import org.eclipse.cdt.internal.ui.text.util.CColorManager;
-import org.eclipse.cdt.ui.CUIPlugin;
-
import org.eclipse.core.runtime.Preferences;
-
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.IDocumentExtension3;
@@ -26,6 +22,11 @@ import org.eclipse.jface.text.rules.RuleBasedScanner;
import org.eclipse.jface.util.IPropertyChangeListener;
import org.eclipse.jface.util.PropertyChangeEvent;
+import org.eclipse.cdt.ui.CUIPlugin;
+import org.eclipse.cdt.ui.text.ICPartitions;
+
+import org.eclipse.cdt.internal.ui.text.util.CColorManager;
+
/**
* This type shares all scanners and the color manager between
@@ -178,7 +179,7 @@ public class CTextTools {
public IDocumentPartitioner createDocumentPartitioner() {
String[] types= new String[] {
- ICPartitions.C_MULTILINE_COMMENT,
+ ICPartitions.C_MULTI_LINE_COMMENT,
ICPartitions.C_SINGLE_LINE_COMMENT,
ICPartitions.C_STRING,
ICPartitions.C_CHARACTER
diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/FastCPartitionScanner.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/FastCPartitionScanner.java
index 7dc69f9d420..386ebb8acf4 100644
--- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/FastCPartitionScanner.java
+++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/FastCPartitionScanner.java
@@ -18,6 +18,8 @@ import org.eclipse.jface.text.rules.IPartitionTokenScanner;
import org.eclipse.jface.text.rules.IToken;
import org.eclipse.jface.text.rules.Token;
+import org.eclipse.cdt.ui.text.ICPartitions;
+
/**
* This scanner recognizes the C multi line comments, C single line comments,
@@ -59,7 +61,7 @@ public class FastCPartitionScanner implements IPartitionTokenScanner, ICPartitio
private final IToken[] fTokens= new IToken[] {
new Token(null),
new Token(C_SINGLE_LINE_COMMENT),
- new Token(C_MULTILINE_COMMENT),
+ new Token(C_MULTI_LINE_COMMENT),
new Token(C_CHARACTER),
new Token(C_STRING)
};
@@ -340,7 +342,7 @@ public class FastCPartitionScanner implements IPartitionTokenScanner, ICPartitio
else if (contentType.equals(C_SINGLE_LINE_COMMENT))
return SINGLE_LINE_COMMENT;
- else if (contentType.equals(C_MULTILINE_COMMENT))
+ else if (contentType.equals(C_MULTI_LINE_COMMENT))
return MULTI_LINE_COMMENT;
else if (contentType.equals(C_STRING))
diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/SimpleDocument.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/SimpleDocument.java
new file mode 100644
index 00000000000..87c218b7bc9
--- /dev/null
+++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/SimpleDocument.java
@@ -0,0 +1,374 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2006 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
+ *******************************************************************************/
+package org.eclipse.cdt.internal.ui.text;
+
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.IDocumentListener;
+import org.eclipse.jface.text.IDocumentPartitioner;
+import org.eclipse.jface.text.IDocumentPartitioningListener;
+import org.eclipse.jface.text.IPositionUpdater;
+import org.eclipse.jface.text.IRegion;
+import org.eclipse.jface.text.ITypedRegion;
+import org.eclipse.jface.text.Position;
+
+/**
+ * Minimal implementation of IDocument to apply text edit onto a string.
+ */
+public class SimpleDocument implements IDocument {
+
+ private StringBuffer buffer;
+
+ public SimpleDocument(String source) {
+ buffer = new StringBuffer(source);
+ }
+
+ public SimpleDocument(char[] source) {
+ buffer = new StringBuffer(source.length);
+ buffer.append(source);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.text.IDocument#getChar(int)
+ */
+ public char getChar(int offset) {
+ return 0;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.text.IDocument#getLength()
+ */
+ public int getLength() {
+ return this.buffer.length();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.text.IDocument#get()
+ */
+ public String get() {
+ return this.buffer.toString();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.text.IDocument#get(int, int)
+ */
+ public String get(int offset, int length) {
+ return this.buffer.substring(offset, offset + length);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.text.IDocument#set(java.lang.String)
+ */
+ public void set(String text) {
+ // defining interface method
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.text.IDocument#replace(int, int, java.lang.String)
+ */
+ public void replace(int offset, int length, String text) {
+
+ this.buffer.replace(offset, offset + length, text);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.text.IDocument#addDocumentListener(org.eclipse.jface.text.IDocumentListener)
+ */
+ public void addDocumentListener(IDocumentListener listener) {
+ // defining interface method
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.text.IDocument#removeDocumentListener(org.eclipse.jface.text.IDocumentListener)
+ */
+ public void removeDocumentListener(IDocumentListener listener) {
+ // defining interface method
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.text.IDocument#addPrenotifiedDocumentListener(org.eclipse.jface.text.IDocumentListener)
+ */
+ public void addPrenotifiedDocumentListener(IDocumentListener documentAdapter) {
+ // defining interface method
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.text.IDocument#removePrenotifiedDocumentListener(org.eclipse.jface.text.IDocumentListener)
+ */
+ public void removePrenotifiedDocumentListener(IDocumentListener documentAdapter) {
+ // defining interface method
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.text.IDocument#addPositionCategory(java.lang.String)
+ */
+ public void addPositionCategory(String category) {
+ // defining interface method
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.text.IDocument#removePositionCategory(java.lang.String)
+ */
+ public void removePositionCategory(String category) {
+ // defining interface method
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.text.IDocument#getPositionCategories()
+ */
+ public String[] getPositionCategories() {
+ // defining interface method
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.text.IDocument#containsPositionCategory(java.lang.String)
+ */
+ public boolean containsPositionCategory(String category) {
+ // defining interface method
+ return false;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.text.IDocument#addPosition(org.eclipse.jface.text.Position)
+ */
+ public void addPosition(Position position) {
+ // defining interface method
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.text.IDocument#removePosition(org.eclipse.jface.text.Position)
+ */
+ public void removePosition(Position position) {
+ // defining interface method
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.text.IDocument#addPosition(java.lang.String, org.eclipse.jface.text.Position)
+ */
+ public void addPosition(String category, Position position) {
+ // defining interface method
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.text.IDocument#removePosition(java.lang.String, org.eclipse.jface.text.Position)
+ */
+ public void removePosition(String category, Position position) {
+ // defining interface method
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.text.IDocument#getPositions(java.lang.String)
+ */
+ public Position[] getPositions(String category) {
+ // defining interface method
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.text.IDocument#containsPosition(java.lang.String, int, int)
+ */
+ public boolean containsPosition(String category, int offset, int length) {
+ // defining interface method
+ return false;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.text.IDocument#computeIndexInCategory(java.lang.String, int)
+ */
+ public int computeIndexInCategory(String category, int offset) {
+ // defining interface method
+ return 0;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.text.IDocument#addPositionUpdater(org.eclipse.jface.text.IPositionUpdater)
+ */
+ public void addPositionUpdater(IPositionUpdater updater) {
+ // defining interface method
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.text.IDocument#removePositionUpdater(org.eclipse.jface.text.IPositionUpdater)
+ */
+ public void removePositionUpdater(IPositionUpdater updater) {
+ // defining interface method
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.text.IDocument#insertPositionUpdater(org.eclipse.jface.text.IPositionUpdater, int)
+ */
+ public void insertPositionUpdater(IPositionUpdater updater, int index) {
+ // defining interface method
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.text.IDocument#getPositionUpdaters()
+ */
+ public IPositionUpdater[] getPositionUpdaters() {
+ // defining interface method
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.text.IDocument#getLegalContentTypes()
+ */
+ public String[] getLegalContentTypes() {
+ // defining interface method
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.text.IDocument#getContentType(int)
+ */
+ public String getContentType(int offset) {
+ // defining interface method
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.text.IDocument#getPartition(int)
+ */
+ public ITypedRegion getPartition(int offset) {
+ // defining interface method
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.text.IDocument#computePartitioning(int, int)
+ */
+ public ITypedRegion[] computePartitioning(int offset, int length) {
+ // defining interface method
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.text.IDocument#addDocumentPartitioningListener(org.eclipse.jface.text.IDocumentPartitioningListener)
+ */
+ public void addDocumentPartitioningListener(IDocumentPartitioningListener listener) {
+ // defining interface method
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.text.IDocument#removeDocumentPartitioningListener(org.eclipse.jface.text.IDocumentPartitioningListener)
+ */
+ public void removeDocumentPartitioningListener(IDocumentPartitioningListener listener) {
+ // defining interface method
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.text.IDocument#setDocumentPartitioner(org.eclipse.jface.text.IDocumentPartitioner)
+ */
+ public void setDocumentPartitioner(IDocumentPartitioner partitioner) {
+ // defining interface method
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.text.IDocument#getDocumentPartitioner()
+ */
+ public IDocumentPartitioner getDocumentPartitioner() {
+ // defining interface method
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.text.IDocument#getLineLength(int)
+ */
+ public int getLineLength(int line) {
+ // defining interface method
+ return 0;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.text.IDocument#getLineOfOffset(int)
+ */
+ public int getLineOfOffset(int offset) {
+ // defining interface method
+ return 0;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.text.IDocument#getLineOffset(int)
+ */
+ public int getLineOffset(int line) {
+ // defining interface method
+ return 0;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.text.IDocument#getLineInformation(int)
+ */
+ public IRegion getLineInformation(int line) {
+ // defining interface method
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.text.IDocument#getLineInformationOfOffset(int)
+ */
+ public IRegion getLineInformationOfOffset(int offset) {
+ // defining interface method
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.text.IDocument#getNumberOfLines()
+ */
+ public int getNumberOfLines() {
+ // defining interface method
+ return 0;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.text.IDocument#getNumberOfLines(int, int)
+ */
+ public int getNumberOfLines(int offset, int length) {
+ // defining interface method
+ return 0;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.text.IDocument#computeNumberOfLines(java.lang.String)
+ */
+ public int computeNumberOfLines(String text) {
+ // defining interface method
+ return 0;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.text.IDocument#getLegalLineDelimiters()
+ */
+ public String[] getLegalLineDelimiters() {
+ // defining interface method
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.text.IDocument#getLineDelimiter(int)
+ */
+ public String getLineDelimiter(int line) {
+ // defining interface method
+ return null;
+ }
+
+ /**
+ * @see org.eclipse.jface.text.IDocument#search(int, java.lang.String, boolean, boolean, boolean)
+ * @deprecated
+ */
+ public int search(
+ int startOffset,
+ String findString,
+ boolean forwardSearch,
+ boolean caseSensitive,
+ boolean wholeWord) {
+ // defining interface method
+ return 0;
+ }
+}
diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/Symbols.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/Symbols.java
new file mode 100644
index 00000000000..68c823fa8cf
--- /dev/null
+++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/Symbols.java
@@ -0,0 +1,53 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2005 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
+ *******************************************************************************/
+package org.eclipse.cdt.internal.ui.text;
+
+/**
+ * Symbols for the heuristic C/C++ scanner.
+ */
+public interface Symbols {
+ int TokenEOF= -1;
+ int TokenLBRACE= 1;
+ int TokenRBRACE= 2;
+ int TokenLBRACKET= 3;
+ int TokenRBRACKET= 4;
+ int TokenLPAREN= 5;
+ int TokenRPAREN= 6;
+ int TokenSEMICOLON= 7;
+ int TokenOTHER= 8;
+ int TokenCOLON= 9;
+ int TokenQUESTIONMARK= 10;
+ int TokenCOMMA= 11;
+ int TokenEQUAL= 12;
+ int TokenLESSTHAN= 13;
+ int TokenGREATERTHAN= 14;
+ int TokenIF= 109;
+ int TokenDO= 1010;
+ int TokenFOR= 1011;
+ int TokenTRY= 1012;
+ int TokenCASE= 1013;
+ int TokenELSE= 1014;
+ int TokenBREAK= 1015;
+ int TokenCATCH= 1016;
+ int TokenWHILE= 1017;
+ int TokenRETURN= 1018;
+ int TokenSTATIC= 1019;
+ int TokenSWITCH= 1020;
+// int TokenFINALLY= 1021;
+// int TokenSYNCHRONIZED= 1022;
+ int TokenGOTO= 1023;
+ int TokenDEFAULT= 1024;
+ int TokenNEW= 1025;
+ int TokenCLASS= 1026;
+// int TokenINTERFACE= 1027;
+ int TokenENUM= 1028;
+ int TokenIDENT= 2000;
+}
diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/PreferenceConstants.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/PreferenceConstants.java
index 35d2fd1ec4e..460cd545453 100644
--- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/PreferenceConstants.java
+++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/PreferenceConstants.java
@@ -161,6 +161,51 @@ public class PreferenceConstants {
public static final String EDITOR_TEXT_HOVER_MODIFIER_MASKS= "hoverModifierMasks"; //$NON-NLS-1$
/**
+ * A named preference that controls whether the 'close strings' feature
+ * is enabled.
+ * <p>
+ * Value is of type <code>Boolean</code>.
+ * </p>
+ */
+ public final static String EDITOR_CLOSE_STRINGS= "closeStrings"; //$NON-NLS-1$
+
+ /**
+ * A named preference that controls whether the 'wrap strings' feature is
+ * enabled.
+ * <p>
+ * Value is of type <code>Boolean</code>.
+ * </p>
+ */
+ public final static String EDITOR_WRAP_STRINGS= "wrapStrings"; //$NON-NLS-1$
+
+ /**
+ * A named preference that controls whether the 'escape strings' feature is
+ * enabled.
+ * <p>
+ * Value is of type <code>Boolean</code>.
+ * </p>
+ */
+ public final static String EDITOR_ESCAPE_STRINGS= "escapeStrings"; //$NON-NLS-1$
+
+ /**
+ * A named preference that controls whether the 'close brackets' feature is
+ * enabled.
+ * <p>
+ * Value is of type <code>Boolean</code>.
+ * </p>
+ */
+ public final static String EDITOR_CLOSE_BRACKETS= "closeBrackets"; //$NON-NLS-1$
+
+ /**
+ * A named preference that controls whether the 'close braces' feature is
+ * enabled.
+ * <p>
+ * Value is of type <code>Boolean</code>.
+ * </p>
+ */
+ public final static String EDITOR_CLOSE_BRACES= "closeBraces"; //$NON-NLS-1$
+
+ /**
* The id of the best match hover contributed for extension point
* <code>javaEditorTextHovers</code>.
*
@@ -412,6 +457,10 @@ public class PreferenceConstants {
store.setDefault(PreferenceConstants.EDITOR_FOLDING_METHODS, false);
store.setDefault(PreferenceConstants.EDITOR_FOLDING_MACROS, true);
-
+ store.setDefault(PreferenceConstants.EDITOR_CLOSE_STRINGS, true);
+ store.setDefault(PreferenceConstants.EDITOR_CLOSE_BRACKETS, true);
+ store.setDefault(PreferenceConstants.EDITOR_CLOSE_BRACES, true);
+ store.setDefault(PreferenceConstants.EDITOR_WRAP_STRINGS, true);
+ store.setDefault(PreferenceConstants.EDITOR_ESCAPE_STRINGS, false);
}
}
diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/ICPartitions.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/text/ICPartitions.java
index c437b0c1e1f..77278139f57 100644
--- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/ICPartitions.java
+++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/text/ICPartitions.java
@@ -1,49 +1,42 @@
/*******************************************************************************
- * Copyright (c) 2000, 2006 QNX Software Systems and others.
+ * Copyright (c) 2000, 2006 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:
- * QNX Software Systems - Initial API and implementation
- * IBM Corporation
+ * IBM Corporation - initial API and implementation
*******************************************************************************/
-
-package org.eclipse.cdt.internal.ui.text;
+package org.eclipse.cdt.ui.text;
/**
- *
- * The name of the C partitioning.
- * @since 3.0
+ * Definition of C partitioning and its partitions.
*/
public interface ICPartitions {
- String SKIP= "__skip"; //$NON-NLS-1$
/**
- * The identifier multi-line (JLS2: TraditionalComment) comment partition content type.
+ * The identifier of the C partitioning.
*/
- String C_MULTILINE_COMMENT= "c_multi_line_comment"; //$NON-NLS-1$
+ String C_PARTITIONING= "___c_partitioning"; //$NON-NLS-1$
/**
- * The identifier of the single-line (JLS2: EndOfLineComment) end comment partition content type.
+ * The identifier of the single-line end comment partition content type.
*/
- String C_SINGLE_LINE_COMMENT= "c_single_line_comment"; //$NON-NLS-1$
-
+ String C_SINGLE_LINE_COMMENT= "__c_singleline_comment"; //$NON-NLS-1$
+
/**
- * The identifier of the C string partition content type.
+ * The identifier multi-line comment partition content type.
*/
- String C_STRING= "c_string"; //$NON-NLS-1$
-
+ String C_MULTI_LINE_COMMENT= "__c_multiline_comment"; //$NON-NLS-1$
+
/**
- * The identifier of the C character partition content type.
+ * The identifier of the C string partition content type.
*/
- String C_CHARACTER= "c_character"; //$NON-NLS-1$
-
+ String C_STRING= "__c_string"; //$NON-NLS-1$
+
/**
- * The identifier of the C partitioning.
+ * The identifier of the C character partition content type.
*/
- String C_PARTITIONING= "___c_partitioning"; //$NON-NLS-1$
-
-
+ String C_CHARACTER= "__c_character"; //$NON-NLS-1$
}

Back to the top