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. |
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$ |
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; |
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); |
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 |
|
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); |