### Eclipse Workspace Patch 1.0 #P org.eclipse.jdt.ui Index: ui/org/eclipse/jdt/internal/ui/preferences/formatter/FormatterMessages.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/formatter/FormatterMessages.java,v retrieving revision 1.20 diff -u -r1.20 FormatterMessages.java --- ui/org/eclipse/jdt/internal/ui/preferences/formatter/FormatterMessages.java 24 Apr 2007 16:00:14 -0000 1.20 +++ ui/org/eclipse/jdt/internal/ui/preferences/formatter/FormatterMessages.java 24 Apr 2007 16:40:46 -0000 @@ -361,7 +361,10 @@ public static String CommentsTabPage_new_line_after_param_tags; public static String CommentsTabPage_group3_title; public static String CommentsTabPage_group4_title; + public static String CommentsTabPage_group5_title; public static String CommentsTabPage_line_width; + public static String CommentsTabPage_never_indent_block_comments_on_first_column; + public static String CommentsTabPage_never_indent_line_comments_on_first_column; public static String ControlStatementsTabPage_preview_header; public static String ControlStatementsTabPage_general_group_title; public static String ControlStatementsTabPage_general_group_insert_new_line_before_else_statements; Index: ui/org/eclipse/jdt/internal/ui/preferences/formatter/FormatterMessages.properties =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/formatter/FormatterMessages.properties,v retrieving revision 1.69 diff -u -r1.69 FormatterMessages.properties --- ui/org/eclipse/jdt/internal/ui/preferences/formatter/FormatterMessages.properties 24 Apr 2007 16:00:14 -0000 1.69 +++ ui/org/eclipse/jdt/internal/ui/preferences/formatter/FormatterMessages.properties 24 Apr 2007 16:40:46 -0000 @@ -408,6 +408,10 @@ CommentsTabPage_group4_title=Block comment settings +CommentsTabPage_group5_title=Indentation settings +CommentsTabPage_never_indent_block_comments_on_first_column=Indent &block comment on first column +CommentsTabPage_never_indent_line_comments_on_first_column=Indent line &comment on first column + ControlStatementsTabPage_preview_header=If...else ControlStatementsTabPage_general_group_title=General ControlStatementsTabPage_general_group_insert_new_line_before_else_statements=Insert new line before '&else' in an 'if' statement @@ -459,7 +463,7 @@ ModifyDialog_tabpage_blank_lines_title=Bla&nk Lines ModifyDialog_tabpage_new_lines_title=New &Lines ModifyDialog_tabpage_control_statements_title=Con&trol Statements -ModifyDialog_tabpage_line_wrapping_title=Line Wra&pping +ModifyDialog_tabpage_line_wrapping_title=Line Wr&apping ModifyDialog_tabpage_comments_title=Co&mments NewLinesTabPage_preview_header=New Lines Index: ui/org/eclipse/jdt/internal/ui/preferences/formatter/CommentsTabPage.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/formatter/CommentsTabPage.java,v retrieving revision 1.20 diff -u -r1.20 CommentsTabPage.java --- ui/org/eclipse/jdt/internal/ui/preferences/formatter/CommentsTabPage.java 16 Apr 2007 08:54:09 -0000 1.20 +++ ui/org/eclipse/jdt/internal/ui/preferences/formatter/CommentsTabPage.java 24 Apr 2007 16:40:46 -0000 @@ -37,7 +37,12 @@ private static String[] FALSE_TRUE = { DefaultCodeFormatterConstants.FALSE, DefaultCodeFormatterConstants.TRUE - }; + }; + + private static String[] TRUE_FALSE = { + DefaultCodeFormatterConstants.TRUE, + DefaultCodeFormatterConstants.FALSE + }; /** * Constant array for insert / not_insert. @@ -109,7 +114,15 @@ "/**\n" + //$NON-NLS-1$ " * This is the comment for the example interface.\n" + //$NON-NLS-1$ " */\n" + //$NON-NLS-1$ - " interface Example {" + //$NON-NLS-1$ + " interface Example {\n" + //$NON-NLS-1$ + "// 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$ + "int foo3();\n" + //$NON-NLS-1$ + "/*\n" + //$NON-NLS-1$ + "*\n" + //$NON-NLS-1$ + "* These possibilities include:\n" + //$NON-NLS-1$ + "* \n" + //$NON-NLS-1$ + "*/\n" + //$NON-NLS-1$ + "int foo4();\n" + //$NON-NLS-1$ " /**\n" + //$NON-NLS-1$ " *\n" + //$NON-NLS-1$ " * These possibilities include:\n" + //$NON-NLS-1$ @@ -133,7 +146,7 @@ " * @param b The second parameter.\n" + //$NON-NLS-1$ " * @return The result of the foo operation, usually within 0 and 1000.\n" + //$NON-NLS-1$ " */" + //$NON-NLS-1$ - " int foo(int a, int b);" + //$NON-NLS-1$ + " int foo(int a, int b);\n" + //$NON-NLS-1$ "}"; //$NON-NLS-1$ private CompilationUnitPreview fPreview; @@ -149,7 +162,9 @@ final CheckboxPreference javadoc= createPrefTrueFalse(globalGroup, numColumns, FormatterMessages.commentsTabPage_enable_javadoc_comment_formatting, DefaultCodeFormatterConstants.FORMATTER_COMMENT_FORMAT_JAVADOC_COMMENT); final CheckboxPreference blockComment= createPrefTrueFalse(globalGroup, numColumns, FormatterMessages.CommentsTabPage_enable_block_comment_formatting, DefaultCodeFormatterConstants.FORMATTER_COMMENT_FORMAT_BLOCK_COMMENT); final CheckboxPreference singleLineComments= createPrefTrueFalse(globalGroup, numColumns, FormatterMessages.CommentsTabPage_enable_line_comment_formatting, DefaultCodeFormatterConstants.FORMATTER_COMMENT_FORMAT_LINE_COMMENT); - final CheckboxPreference header= createPrefTrueFalse(globalGroup, numColumns, FormatterMessages.CommentsTabPage_format_header, DefaultCodeFormatterConstants.FORMATTER_COMMENT_FORMAT_HEADER); + final CheckboxPreference header= createPrefTrueFalse(globalGroup, numColumns, FormatterMessages.CommentsTabPage_format_header, DefaultCodeFormatterConstants.FORMATTER_COMMENT_FORMAT_HEADER); + createPrefTrueFalseInvert(globalGroup, numColumns, FormatterMessages.CommentsTabPage_never_indent_block_comments_on_first_column, DefaultCodeFormatterConstants.FORMATTER_NEVER_INDENT_BLOCK_COMMENTS_ON_FIRST_COLUMN); + createPrefTrueFalseInvert(globalGroup, numColumns, FormatterMessages.CommentsTabPage_never_indent_line_comments_on_first_column, DefaultCodeFormatterConstants.FORMATTER_NEVER_INDENT_LINE_COMMENTS_ON_FIRST_COLUMN); // javadoc comment formatting settings final Group settingsGroup= createGroup(numColumns, composite, FormatterMessages.CommentsTabPage_group2_title); @@ -162,7 +177,7 @@ final CheckboxPreference nlParam= createPrefInsert(settingsGroup, numColumns, FormatterMessages.CommentsTabPage_new_line_after_param_tags, DefaultCodeFormatterConstants.FORMATTER_COMMENT_INSERT_NEW_LINE_FOR_PARAMETER); final CheckboxPreference blankLinesJavadoc= createPrefTrueFalse(settingsGroup, numColumns, FormatterMessages.CommentsTabPage_clear_blank_lines, DefaultCodeFormatterConstants.FORMATTER_COMMENT_CLEAR_BLANK_LINES_IN_JAVADOC_COMMENT); - // javadoc and block comment settings + // block comment settings final Group blockSettingsGroup= createGroup(numColumns, composite, FormatterMessages.CommentsTabPage_group4_title); final CheckboxPreference blankLinesBlock= createPrefTrueFalse(blockSettingsGroup, numColumns, FormatterMessages.CommentsTabPage_remove_blank_block_comment_lines, DefaultCodeFormatterConstants.FORMATTER_COMMENT_CLEAR_BLANK_LINES_IN_BLOCK_COMMENT); @@ -244,6 +259,10 @@ private CheckboxPreference createPrefTrueFalse(Composite composite, int numColumns, String text, String key) { return createCheckboxPref(composite, numColumns, text, key, FALSE_TRUE); } + + private CheckboxPreference createPrefTrueFalseInvert(Composite composite, int numColumns, String text, String key) { + return createCheckboxPref(composite, numColumns, text, key, TRUE_FALSE); + } private CheckboxPreference createPrefInsert(Composite composite, int numColumns, String text, String key) { return createCheckboxPref(composite, numColumns, text, key, DO_NOT_INSERT_INSERT);