View | Details | Raw Unified | Return to bug 177796 | Differences between
and this patch

Collapse All | Expand All

(-)ui/org/eclipse/jdt/internal/ui/preferences/formatter/FormatterMessages.java (+3 lines)
Lines 361-367 Link Here
361
	public static String CommentsTabPage_new_line_after_param_tags;
361
	public static String CommentsTabPage_new_line_after_param_tags;
362
	public static String CommentsTabPage_group3_title;
362
	public static String CommentsTabPage_group3_title;
363
	public static String CommentsTabPage_group4_title;
363
	public static String CommentsTabPage_group4_title;
364
	public static String CommentsTabPage_group5_title;
364
	public static String CommentsTabPage_line_width;
365
	public static String CommentsTabPage_line_width;
366
	public static String CommentsTabPage_never_indent_block_comments_on_first_column;
367
	public static String CommentsTabPage_never_indent_line_comments_on_first_column;
365
	public static String ControlStatementsTabPage_preview_header;
368
	public static String ControlStatementsTabPage_preview_header;
366
	public static String ControlStatementsTabPage_general_group_title;
369
	public static String ControlStatementsTabPage_general_group_title;
367
	public static String ControlStatementsTabPage_general_group_insert_new_line_before_else_statements;
370
	public static String ControlStatementsTabPage_general_group_insert_new_line_before_else_statements;
(-)ui/org/eclipse/jdt/internal/ui/preferences/formatter/FormatterMessages.properties (-1 / +5 lines)
Lines 408-413 Link Here
408
408
409
CommentsTabPage_group4_title=Block comment settings
409
CommentsTabPage_group4_title=Block comment settings
410
410
411
CommentsTabPage_group5_title=Indentation settings
412
CommentsTabPage_never_indent_block_comments_on_first_column=Indent &block comment on first column
413
CommentsTabPage_never_indent_line_comments_on_first_column=Indent line &comment on first column
414
411
ControlStatementsTabPage_preview_header=If...else
415
ControlStatementsTabPage_preview_header=If...else
412
ControlStatementsTabPage_general_group_title=General
416
ControlStatementsTabPage_general_group_title=General
413
ControlStatementsTabPage_general_group_insert_new_line_before_else_statements=Insert new line before '&else' in an 'if' statement
417
ControlStatementsTabPage_general_group_insert_new_line_before_else_statements=Insert new line before '&else' in an 'if' statement
Lines 459-465 Link Here
459
ModifyDialog_tabpage_blank_lines_title=Bla&nk Lines
463
ModifyDialog_tabpage_blank_lines_title=Bla&nk Lines
460
ModifyDialog_tabpage_new_lines_title=New &Lines
464
ModifyDialog_tabpage_new_lines_title=New &Lines
461
ModifyDialog_tabpage_control_statements_title=Con&trol Statements
465
ModifyDialog_tabpage_control_statements_title=Con&trol Statements
462
ModifyDialog_tabpage_line_wrapping_title=Line Wra&pping
466
ModifyDialog_tabpage_line_wrapping_title=Line Wr&apping
463
ModifyDialog_tabpage_comments_title=Co&mments
467
ModifyDialog_tabpage_comments_title=Co&mments
464
468
465
NewLinesTabPage_preview_header=New Lines
469
NewLinesTabPage_preview_header=New Lines
(-)ui/org/eclipse/jdt/internal/ui/preferences/formatter/CommentsTabPage.java (-5 / +24 lines)
Lines 37-43 Link Here
37
	private static String[] FALSE_TRUE = {
37
	private static String[] FALSE_TRUE = {
38
		DefaultCodeFormatterConstants.FALSE,
38
		DefaultCodeFormatterConstants.FALSE,
39
		DefaultCodeFormatterConstants.TRUE
39
		DefaultCodeFormatterConstants.TRUE
40
	};	
40
	};
41
	
42
	private static String[] TRUE_FALSE = {
43
		DefaultCodeFormatterConstants.TRUE,
44
		DefaultCodeFormatterConstants.FALSE
45
	};
41
	
46
	
42
    /**
47
    /**
43
     * Constant array for insert / not_insert. 
48
     * Constant array for insert / not_insert. 
Lines 109-115 Link Here
109
		"/**\n" + //$NON-NLS-1$
114
		"/**\n" + //$NON-NLS-1$
110
		" * This is the comment for the example interface.\n" + //$NON-NLS-1$
115
		" * This is the comment for the example interface.\n" + //$NON-NLS-1$
111
		" */\n" + //$NON-NLS-1$
116
		" */\n" + //$NON-NLS-1$
112
		" interface Example {" + //$NON-NLS-1$
117
		" interface Example {\n" + //$NON-NLS-1$
118
		"// This is a long comment that should be split in multiple line comments in case the line comment formatting is enabled\n" + //$NON-NLS-1$
119
		"int foo3();\n" + //$NON-NLS-1$
120
		"/*\n" + //$NON-NLS-1$
121
		"*\n" + //$NON-NLS-1$
122
		"* These possibilities include:\n" + //$NON-NLS-1$
123
		"* <ul><li>Formatting of header comments.</li><li>Formatting of Javadoc tags</li></ul>\n" + //$NON-NLS-1$
124
		"*/\n" + //$NON-NLS-1$
125
		"int foo4();\n" + //$NON-NLS-1$
113
		" /**\n" + //$NON-NLS-1$
126
		" /**\n" + //$NON-NLS-1$
114
		" *\n" + //$NON-NLS-1$
127
		" *\n" + //$NON-NLS-1$
115
		" * These possibilities include:\n" + //$NON-NLS-1$
128
		" * These possibilities include:\n" + //$NON-NLS-1$
Lines 133-139 Link Here
133
		" * @param b The second parameter.\n" + //$NON-NLS-1$
146
		" * @param b The second parameter.\n" + //$NON-NLS-1$
134
		" * @return The result of the foo operation, usually within 0 and 1000.\n" + //$NON-NLS-1$
147
		" * @return The result of the foo operation, usually within 0 and 1000.\n" + //$NON-NLS-1$
135
		" */" + //$NON-NLS-1$
148
		" */" + //$NON-NLS-1$
136
		" int foo(int a, int b);" + //$NON-NLS-1$
149
		" int foo(int a, int b);\n" + //$NON-NLS-1$
137
		"}"; //$NON-NLS-1$
150
		"}"; //$NON-NLS-1$
138
	
151
	
139
	private CompilationUnitPreview fPreview;
152
	private CompilationUnitPreview fPreview;
Lines 149-155 Link Here
149
		final CheckboxPreference javadoc= createPrefTrueFalse(globalGroup, numColumns, FormatterMessages.commentsTabPage_enable_javadoc_comment_formatting, DefaultCodeFormatterConstants.FORMATTER_COMMENT_FORMAT_JAVADOC_COMMENT); 
162
		final CheckboxPreference javadoc= createPrefTrueFalse(globalGroup, numColumns, FormatterMessages.commentsTabPage_enable_javadoc_comment_formatting, DefaultCodeFormatterConstants.FORMATTER_COMMENT_FORMAT_JAVADOC_COMMENT); 
150
		final CheckboxPreference blockComment= createPrefTrueFalse(globalGroup, numColumns, FormatterMessages.CommentsTabPage_enable_block_comment_formatting, DefaultCodeFormatterConstants.FORMATTER_COMMENT_FORMAT_BLOCK_COMMENT);
163
		final CheckboxPreference blockComment= createPrefTrueFalse(globalGroup, numColumns, FormatterMessages.CommentsTabPage_enable_block_comment_formatting, DefaultCodeFormatterConstants.FORMATTER_COMMENT_FORMAT_BLOCK_COMMENT);
151
		final CheckboxPreference singleLineComments= createPrefTrueFalse(globalGroup, numColumns, FormatterMessages.CommentsTabPage_enable_line_comment_formatting, DefaultCodeFormatterConstants.FORMATTER_COMMENT_FORMAT_LINE_COMMENT); 
164
		final CheckboxPreference singleLineComments= createPrefTrueFalse(globalGroup, numColumns, FormatterMessages.CommentsTabPage_enable_line_comment_formatting, DefaultCodeFormatterConstants.FORMATTER_COMMENT_FORMAT_LINE_COMMENT); 
152
		final CheckboxPreference header= createPrefTrueFalse(globalGroup, numColumns, FormatterMessages.CommentsTabPage_format_header, DefaultCodeFormatterConstants.FORMATTER_COMMENT_FORMAT_HEADER); 
165
		final CheckboxPreference header= createPrefTrueFalse(globalGroup, numColumns, FormatterMessages.CommentsTabPage_format_header, DefaultCodeFormatterConstants.FORMATTER_COMMENT_FORMAT_HEADER);
166
		createPrefTrueFalseInvert(globalGroup, numColumns, FormatterMessages.CommentsTabPage_never_indent_block_comments_on_first_column, DefaultCodeFormatterConstants.FORMATTER_NEVER_INDENT_BLOCK_COMMENTS_ON_FIRST_COLUMN);
167
		createPrefTrueFalseInvert(globalGroup, numColumns, FormatterMessages.CommentsTabPage_never_indent_line_comments_on_first_column, DefaultCodeFormatterConstants.FORMATTER_NEVER_INDENT_LINE_COMMENTS_ON_FIRST_COLUMN);
153
168
154
		// javadoc comment formatting settings
169
		// javadoc comment formatting settings
155
		final Group settingsGroup= createGroup(numColumns, composite, FormatterMessages.CommentsTabPage_group2_title); 
170
		final Group settingsGroup= createGroup(numColumns, composite, FormatterMessages.CommentsTabPage_group2_title); 
Lines 162-168 Link Here
162
		final CheckboxPreference nlParam= createPrefInsert(settingsGroup, numColumns, FormatterMessages.CommentsTabPage_new_line_after_param_tags, DefaultCodeFormatterConstants.FORMATTER_COMMENT_INSERT_NEW_LINE_FOR_PARAMETER); 
177
		final CheckboxPreference nlParam= createPrefInsert(settingsGroup, numColumns, FormatterMessages.CommentsTabPage_new_line_after_param_tags, DefaultCodeFormatterConstants.FORMATTER_COMMENT_INSERT_NEW_LINE_FOR_PARAMETER); 
163
		final CheckboxPreference blankLinesJavadoc= createPrefTrueFalse(settingsGroup, numColumns, FormatterMessages.CommentsTabPage_clear_blank_lines, DefaultCodeFormatterConstants.FORMATTER_COMMENT_CLEAR_BLANK_LINES_IN_JAVADOC_COMMENT); 
178
		final CheckboxPreference blankLinesJavadoc= createPrefTrueFalse(settingsGroup, numColumns, FormatterMessages.CommentsTabPage_clear_blank_lines, DefaultCodeFormatterConstants.FORMATTER_COMMENT_CLEAR_BLANK_LINES_IN_JAVADOC_COMMENT); 
164
		
179
		
165
		// javadoc and block comment settings
180
		// block comment settings
166
		final Group blockSettingsGroup= createGroup(numColumns, composite, FormatterMessages.CommentsTabPage_group4_title);
181
		final Group blockSettingsGroup= createGroup(numColumns, composite, FormatterMessages.CommentsTabPage_group4_title);
167
		final CheckboxPreference blankLinesBlock= createPrefTrueFalse(blockSettingsGroup, numColumns, FormatterMessages.CommentsTabPage_remove_blank_block_comment_lines, DefaultCodeFormatterConstants.FORMATTER_COMMENT_CLEAR_BLANK_LINES_IN_BLOCK_COMMENT);
182
		final CheckboxPreference blankLinesBlock= createPrefTrueFalse(blockSettingsGroup, numColumns, FormatterMessages.CommentsTabPage_remove_blank_block_comment_lines, DefaultCodeFormatterConstants.FORMATTER_COMMENT_CLEAR_BLANK_LINES_IN_BLOCK_COMMENT);
168
		
183
		
Lines 244-249 Link Here
244
	private CheckboxPreference createPrefTrueFalse(Composite composite, int numColumns, String text, String key) {
259
	private CheckboxPreference createPrefTrueFalse(Composite composite, int numColumns, String text, String key) {
245
		return createCheckboxPref(composite, numColumns, text, key, FALSE_TRUE);
260
		return createCheckboxPref(composite, numColumns, text, key, FALSE_TRUE);
246
	}
261
	}
262
	
263
	private CheckboxPreference createPrefTrueFalseInvert(Composite composite, int numColumns, String text, String key) {
264
		return createCheckboxPref(composite, numColumns, text, key, TRUE_FALSE);
265
	}
247
    
266
    
248
    private CheckboxPreference createPrefInsert(Composite composite, int numColumns, String text, String key) {
267
    private CheckboxPreference createPrefInsert(Composite composite, int numColumns, String text, String key) {
249
        return createCheckboxPref(composite, numColumns, text, key, DO_NOT_INSERT_INSERT);
268
        return createCheckboxPref(composite, numColumns, text, key, DO_NOT_INSERT_INSERT);

Return to bug 177796