Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 150314 | Differences between
and this patch

Collapse All | Expand All

(-)formatter/org/eclipse/jdt/core/formatter/DefaultCodeFormatterConstants.java (+10 lines)
Lines 3134-3139 Link Here
3134
		return DefaultCodeFormatterOptions.getEclipseDefaultSettings().getMap();
3134
		return DefaultCodeFormatterOptions.getEclipseDefaultSettings().getMap();
3135
	}
3135
	}
3136
3136
3137
  /**
3138
   * Returns the default GNU formatter settings
3139
   * 
3140
   * @return the GNU default settings
3141
   * @since 3.1
3142
   */
3143
  public static Map getGNUSettings() {
3144
    return DefaultCodeFormatterOptions.getGNUSettings().getMap();
3145
  }
3146
  
3137
	/**
3147
	/**
3138
	 * <p>Return the force value of the given alignment value.
3148
	 * <p>Return the force value of the given alignment value.
3139
	 * The given alignment value should be created using the <code>createAlignmentValue(boolean, int, int)</code>
3149
	 * The given alignment value should be created using the <code>createAlignmentValue(boolean, int, int)</code>
(-)formatter/org/eclipse/jdt/internal/formatter/DefaultCodeFormatterOptions.java (+190 lines)
Lines 39-44 Link Here
39
		return options;
39
		return options;
40
	}
40
	}
41
41
42
  public static DefaultCodeFormatterOptions getGNUSettings() {
43
    DefaultCodeFormatterOptions options = new DefaultCodeFormatterOptions();
44
    options.setGNUDefaultSettings();
45
    return options;
46
  }
47
  
42
	public static DefaultCodeFormatterOptions getJavaConventionsSettings() {
48
	public static DefaultCodeFormatterOptions getJavaConventionsSettings() {
43
		DefaultCodeFormatterOptions options = new DefaultCodeFormatterOptions();
49
		DefaultCodeFormatterOptions options = new DefaultCodeFormatterOptions();
44
		options.setJavaConventionsSettings();
50
		options.setJavaConventionsSettings();
Lines 2036-2041 Link Here
2036
		this.tab_size = 4;
2042
		this.tab_size = 4;
2037
	}
2043
	}
2038
2044
2045
  public void setGNUDefaultSettings() {
2046
    this.comment_clear_blank_lines = true;
2047
    this.comment_format = true;
2048
    this.comment_format_header = false;
2049
    this.comment_format_html = true;
2050
    this.comment_format_source = true;
2051
    this.comment_indent_parameter_description = true;
2052
    this.comment_indent_root_tags = true;
2053
    this.comment_line_length = 80;
2054
    this.comment_insert_new_line_for_parameter = true;
2055
    this.comment_indent_root_tags = true;
2056
    this.align_type_members_on_columns = false;
2057
    this.alignment_for_arguments_in_allocation_expression = 18;
2058
    this.alignment_for_arguments_in_explicit_constructor_call = 18;
2059
    this.alignment_for_arguments_in_method_invocation = 18;
2060
    this.alignment_for_arguments_in_qualified_allocation_expression = 18;
2061
    this.alignment_for_binary_expression = 18;
2062
    this.alignment_for_compact_if = 16;
2063
    this.alignment_for_conditional_expression = 82;
2064
    this.alignment_for_expressions_in_array_initializer = 18;
2065
    this.alignment_for_multiple_fields = 16;
2066
    this.alignment_for_parameters_in_constructor_declaration = 18;
2067
    this.alignment_for_parameters_in_method_declaration = 18;
2068
    this.alignment_for_selector_in_method_invocation = 0;
2069
    this.alignment_for_superclass_in_type_declaration = 16;
2070
    this.alignment_for_superinterfaces_in_type_declaration = 16;
2071
    this.alignment_for_throws_clause_in_constructor_declaration = 16;
2072
    this.alignment_for_throws_clause_in_method_declaration = 16;
2073
    this.blank_lines_after_imports = 1;
2074
    this.blank_lines_after_package = 1;
2075
    this.blank_lines_before_field = 1;
2076
    this.blank_lines_before_first_class_body_declaration = 0;
2077
    this.blank_lines_before_imports = 1;
2078
    this.blank_lines_before_member_type = 1;
2079
    this.blank_lines_before_method = 1;
2080
    this.blank_lines_before_new_chunk = 1;
2081
    this.blank_lines_before_package = 2;
2082
    this.blank_lines_between_type_declarations = 1;
2083
    this.brace_position_for_anonymous_type_declaration = DefaultCodeFormatterConstants.NEXT_LINE;
2084
    this.brace_position_for_array_initializer = DefaultCodeFormatterConstants.END_OF_LINE;
2085
    this.brace_position_for_block = DefaultCodeFormatterConstants.NEXT_LINE_SHIFTED;
2086
    this.brace_position_for_block_in_case = DefaultCodeFormatterConstants.NEXT_LINE;
2087
    this.brace_position_for_constructor_declaration = DefaultCodeFormatterConstants.NEXT_LINE;
2088
    this.brace_position_for_method_declaration = DefaultCodeFormatterConstants.NEXT_LINE;
2089
    this.brace_position_for_switch = DefaultCodeFormatterConstants.NEXT_LINE_SHIFTED;
2090
    this.brace_position_for_type_declaration = DefaultCodeFormatterConstants.NEXT_LINE;
2091
    this.compact_else_if = true;
2092
    this.continuation_indentation = 2;
2093
    this.continuation_indentation_for_array_initializer = 2;
2094
    this.keep_guardian_clause_on_one_line = false;
2095
    this.indent_body_declarations_compare_to_type_header = true;
2096
    this.indent_breaks_compare_to_cases = true;
2097
    this.indent_statements_compare_to_block = true;
2098
    this.indent_statements_compare_to_body = true;
2099
    this.indent_switchstatements_compare_to_cases = true;
2100
    this.indent_switchstatements_compare_to_switch = false;
2101
    this.insert_new_line_after_opening_brace_in_array_initializer = false;
2102
    this.insert_new_line_before_catch_in_try_statement = true;
2103
    this.insert_new_line_before_closing_brace_in_array_initializer = false;
2104
    this.insert_new_line_before_else_in_if_statement = true;
2105
    this.insert_new_line_before_finally_in_try_statement = true;
2106
    this.insert_new_line_before_while_in_do_statement = true;
2107
    this.insert_new_line_in_empty_anonymous_type_declaration = true;
2108
    this.insert_new_line_in_empty_block = true;
2109
    this.insert_new_line_in_empty_method_body = true;
2110
    this.insert_new_line_in_empty_type_declaration = true;
2111
    this.insert_space_after_assignment_operator = true;
2112
    this.insert_space_after_binary_operator = true;
2113
    this.insert_space_after_closing_brace_in_block = true;
2114
    this.insert_space_after_closing_paren_in_cast = true;
2115
    this.insert_space_after_colon_in_assert = true;
2116
    this.insert_space_after_colon_in_case = true;
2117
    this.insert_space_after_colon_in_conditional = true;
2118
    this.insert_space_after_colon_in_labeled_statement = true;
2119
    this.insert_space_after_comma_in_allocation_expression = true;
2120
    this.insert_space_after_comma_in_array_initializer = true;
2121
    this.insert_space_after_comma_in_constructor_declaration_parameters = true;
2122
    this.insert_space_after_comma_in_constructor_declaration_throws = true;
2123
    this.insert_space_after_comma_in_explicit_constructor_call_arguments = true;
2124
    this.insert_space_after_comma_in_for_increments = true;
2125
    this.insert_space_after_comma_in_for_inits = true;
2126
    this.insert_space_after_comma_in_method_declaration_parameters = true;
2127
    this.insert_space_after_comma_in_method_declaration_throws = true;
2128
    this.insert_space_after_comma_in_method_invocation_arguments = true;
2129
    this.insert_space_after_comma_in_multiple_field_declarations = true;
2130
    this.insert_space_after_comma_in_multiple_local_declarations = true;
2131
    this.insert_space_after_comma_in_superinterfaces = true;
2132
    this.insert_space_after_opening_brace_in_array_initializer = true;
2133
    this.insert_space_after_opening_bracket_in_array_allocation_expression = false;
2134
    this.insert_space_after_opening_bracket_in_array_reference = false;
2135
    this.insert_space_after_opening_paren_in_cast = false;
2136
    this.insert_space_after_opening_paren_in_catch = false;
2137
    this.insert_space_after_opening_paren_in_constructor_declaration = false;
2138
    this.insert_space_after_opening_paren_in_for = false;
2139
    this.insert_space_after_opening_paren_in_if = false;
2140
    this.insert_space_after_opening_paren_in_method_declaration = false;
2141
    this.insert_space_after_opening_paren_in_method_invocation = false;
2142
    this.insert_space_after_opening_paren_in_parenthesized_expression = false;
2143
    this.insert_space_after_opening_paren_in_switch = false;
2144
    this.insert_space_after_opening_paren_in_synchronized = false;
2145
    this.insert_space_after_opening_paren_in_while = false;
2146
    this.insert_space_after_postfix_operator = false;
2147
    this.insert_space_after_prefix_operator = false;
2148
    this.insert_space_after_question_in_conditional = true;
2149
    this.insert_space_after_semicolon_in_for = true;
2150
    this.insert_space_after_unary_operator = false;
2151
    this.insert_space_before_assignment_operator = true;
2152
    this.insert_space_before_binary_operator = true;
2153
    this.insert_space_before_closing_brace_in_array_initializer = true;
2154
    this.insert_space_before_closing_bracket_in_array_allocation_expression = false;
2155
    this.insert_space_before_closing_bracket_in_array_reference = false;
2156
    this.insert_space_before_closing_paren_in_cast = false;
2157
    this.insert_space_before_closing_paren_in_catch = false;
2158
    this.insert_space_before_closing_paren_in_constructor_declaration = false;
2159
    this.insert_space_before_closing_paren_in_for = false;
2160
    this.insert_space_before_closing_paren_in_if = false;
2161
    this.insert_space_before_closing_paren_in_method_declaration = false;
2162
    this.insert_space_before_closing_paren_in_method_invocation = false;
2163
    this.insert_space_before_closing_paren_in_parenthesized_expression = false;
2164
    this.insert_space_before_closing_paren_in_switch = false;
2165
    this.insert_space_before_closing_paren_in_synchronized = false;
2166
    this.insert_space_before_closing_paren_in_while = false;
2167
    this.insert_space_before_colon_in_assert = true;
2168
    this.insert_space_before_colon_in_case = false;
2169
    this.insert_space_before_colon_in_conditional = true;
2170
    this.insert_space_before_colon_in_default = false;
2171
    this.insert_space_before_colon_in_labeled_statement = false;
2172
    this.insert_space_before_comma_in_allocation_expression = false;
2173
    this.insert_space_before_comma_in_array_initializer = false;
2174
    this.insert_space_before_comma_in_constructor_declaration_parameters = false;
2175
    this.insert_space_before_comma_in_constructor_declaration_throws = false;
2176
    this.insert_space_before_comma_in_explicit_constructor_call_arguments = false;
2177
    this.insert_space_before_comma_in_for_increments = false;
2178
    this.insert_space_before_comma_in_for_inits = false;
2179
    this.insert_space_before_comma_in_method_declaration_parameters = false;
2180
    this.insert_space_before_comma_in_method_declaration_throws = false;
2181
    this.insert_space_before_comma_in_method_invocation_arguments = false;
2182
    this.insert_space_before_comma_in_multiple_field_declarations = false;
2183
    this.insert_space_before_comma_in_multiple_local_declarations = false;
2184
    this.insert_space_before_comma_in_superinterfaces = false;
2185
    this.insert_space_before_opening_brace_in_anonymous_type_declaration = true;
2186
    this.insert_space_before_opening_brace_in_array_initializer = true;
2187
    this.insert_space_before_opening_brace_in_block = true;
2188
    this.insert_space_before_opening_brace_in_constructor_declaration = true;
2189
    this.insert_space_before_opening_brace_in_method_declaration = true;
2190
    this.insert_space_before_opening_brace_in_switch = true;
2191
    this.insert_space_before_opening_brace_in_type_declaration = true;
2192
    this.insert_space_before_opening_bracket_in_array_allocation_expression = false;
2193
    this.insert_space_before_opening_bracket_in_array_reference = false;
2194
    this.insert_space_before_opening_bracket_in_array_type_reference = false;
2195
    this.insert_space_before_opening_paren_in_catch = true;
2196
    this.insert_space_before_opening_paren_in_constructor_declaration = false;
2197
    this.insert_space_before_opening_paren_in_for = true;
2198
    this.insert_space_before_opening_paren_in_if = true;
2199
    this.insert_space_before_opening_paren_in_method_declaration = false;
2200
    this.insert_space_before_opening_paren_in_method_invocation = false;
2201
    this.insert_space_before_opening_paren_in_parenthesized_expression = false;
2202
    this.insert_space_before_opening_paren_in_switch = true;
2203
    this.insert_space_before_opening_paren_in_synchronized = true;
2204
    this.insert_space_before_opening_paren_in_while = true;
2205
    this.insert_space_before_postfix_operator = false;
2206
    this.insert_space_before_prefix_operator = false;
2207
    this.insert_space_before_question_in_conditional = true;
2208
    this.insert_space_before_semicolon = false;
2209
    this.insert_space_before_semicolon_in_for = false;
2210
    this.insert_space_before_unary_operator = false;
2211
    this.insert_space_between_brackets_in_array_type_reference = false;
2212
    this.insert_space_between_empty_braces_in_array_initializer = false;
2213
    this.insert_space_between_empty_brackets_in_array_allocation_expression = false;
2214
    this.insert_space_between_empty_parens_in_constructor_declaration = false;
2215
    this.insert_space_between_empty_parens_in_method_declaration = false;
2216
    this.insert_space_between_empty_parens_in_method_invocation = false;
2217
    this.keep_else_statement_on_same_line = false;
2218
    this.keep_empty_array_initializer_on_one_line = true;
2219
    this.keep_simple_if_on_one_line = false;
2220
    this.keep_then_statement_on_same_line = false;
2221
    this.page_width = 80;
2222
    this.blank_lines_at_beginning_of_method_body = 0;
2223
    this.number_of_empty_lines_to_preserve = 1;
2224
    this.put_empty_statement_on_new_line = true;
2225
    this.tab_char = SPACE;
2226
    this.tab_size = 2;
2227
  }
2228
  
2039
	public void setJavaConventionsSettings() {
2229
	public void setJavaConventionsSettings() {
2040
		this.alignment_for_arguments_in_allocation_expression = Alignment.M_COMPACT_SPLIT;
2230
		this.alignment_for_arguments_in_allocation_expression = Alignment.M_COMPACT_SPLIT;
2041
		this.alignment_for_arguments_in_enum_constant = Alignment.M_COMPACT_SPLIT;
2231
		this.alignment_for_arguments_in_enum_constant = Alignment.M_COMPACT_SPLIT;

Return to bug 150314