Index: FormatterMessages.java =================================================================== RCS file: /home/eclipse/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/formatter/FormatterMessages.java,v retrieving revision 1.7 diff -u -r1.7 FormatterMessages.java --- FormatterMessages.java 13 Sep 2005 12:58:28 -0000 1.7 +++ FormatterMessages.java 6 Oct 2005 15:28:58 -0000 @@ -19,7 +19,7 @@ */ final class FormatterMessages extends NLS { - private static final String BUNDLE_NAME= FormatterMessages.class.getName(); + private static final String BUNDLE_NAME= FormatterMessages.class.getName(); private FormatterMessages() { // Do not instantiate @@ -139,6 +139,8 @@ public static String WhiteSpaceTabPage_enum_const_before_opening_brace; public static String WhiteSpaceTabPage_annot_type_method_before_opening_paren; public static String WhiteSpaceTabPage_annot_type_method_between_empty_parens; + public static String WhiteSpaceTabPage_before_parentesized_expressions; + public static String WhiteSpaceOptions_return; public static String WhiteSpaceOptions_before; public static String WhiteSpaceOptions_after; public static String WhiteSpaceOptions_operator; @@ -243,6 +245,7 @@ public static String WhiteSpaceOptions_before_ellipsis; public static String WhiteSpaceOptions_after_ellipsis; public static String WhiteSpaceTabPage_insert_space; + public static String WhiteSpaceOptions_return_with_parenthesized_expression; public static String LineWrappingTabPage_compact_if_else; public static String LineWrappingTabPage_extends_clause; public static String LineWrappingTabPage_enum_constant_arguments; @@ -452,4 +455,6 @@ static { NLS.initializeMessages(BUNDLE_NAME, FormatterMessages.class); } + + } \ No newline at end of file Index: FormatterMessages.properties =================================================================== RCS file: /home/eclipse/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/formatter/FormatterMessages.properties,v retrieving revision 1.48 diff -u -r1.48 FormatterMessages.properties --- FormatterMessages.properties 13 Sep 2005 12:58:28 -0000 1.48 +++ FormatterMessages.properties 6 Oct 2005 15:28:59 -0000 @@ -145,6 +145,7 @@ WhiteSpaceTabPage_after_closing_angle_bracket=after closing angle bracket WhiteSpaceTabPage_before_opening_angle_bracket=before opening angle bracket WhiteSpaceTabPage_before_closing_angle_bracket=before closing angle bracket +WhiteSpaceTabPage_before_parentesized_expressions=before parentesized expressions WhiteSpaceTabPage_before_and_list=before '&' in type bounds WhiteSpaceTabPage_after_and_list=after '&' in type bounds @@ -231,6 +232,7 @@ WhiteSpaceOptions_mult_decls=Multiple declarations WhiteSpaceOptions_local_vars=Local variables WhiteSpaceOptions_fields=Fields +WhiteSpaceOptions_return='return' WhiteSpaceOptions_implements_clause='extends'/'implements' clause WhiteSpaceOptions_colon=Colon WhiteSpaceOptions_conditional=Conditional @@ -267,6 +269,7 @@ WhiteSpaceOptions_before_opening_angle_bracket=Before opening angle bracket WhiteSpaceOptions_after_opening_angle_bracket=After opening angle bracket WhiteSpaceOptions_before_closing_angle_bracket=Before closing angle bracket +WhiteSpaceOptions_return_with_parenthesized_expression=parenthesized expression WhiteSpaceOptions_after_closing_angle_bracket=After closing angle bracket WhiteSpaceOptions_before_operator=Before operator Index: WhiteSpaceOptions.java =================================================================== RCS file: /home/eclipse/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/formatter/WhiteSpaceOptions.java,v retrieving revision 1.19 diff -u -r1.19 WhiteSpaceOptions.java --- WhiteSpaceOptions.java 18 Apr 2005 10:07:34 -0000 1.19 +++ WhiteSpaceOptions.java 6 Oct 2005 15:29:00 -0000 @@ -262,6 +262,11 @@ "assert condition : reportError();" //$NON-NLS-1$ ); + private final static PreviewSnippet RETURN_PREVIEW= new PreviewSnippet( + CodeFormatter.K_STATEMENTS, + "return (o);" //$NON-NLS-1$ + ); + private final static PreviewSnippet ANNOTATION_DECL_PREVIEW= new PreviewSnippet( CodeFormatter.K_CLASS_BODY_DECLARATIONS, "@interface MyAnnotation { String value(); }\n@interface OtherAnnotation { }\n" //$NON-NLS-1$ @@ -528,6 +533,7 @@ createSynchronizedTree(workingValues, statements); createTryStatementTree(workingValues, statements); createAssertTree(workingValues, statements); + createReturnTree(workingValues, statements); final InnerNode expressions= new InnerNode(null, workingValues, FormatterMessages.WhiteSpaceTabPage_expressions); createFunctionCallTree(workingValues, expressions); @@ -709,7 +715,9 @@ createOption(parent, workingValues, FormatterMessages.WhiteSpaceOptions_if, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_IF, IF_PREVIEW); createOption(parent, workingValues, FormatterMessages.WhiteSpaceOptions_switch, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_SWITCH, SWITCH_PREVIEW); createOption(parent, workingValues, FormatterMessages.WhiteSpaceOptions_synchronized, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_SYNCHRONIZED, SYNCHRONIZED_PREVIEW); - createOption(parent, workingValues, FormatterMessages.WhiteSpaceOptions_while, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_WHILE, WHILE_PREVIEW); + createOption(parent, workingValues, FormatterMessages.WhiteSpaceOptions_while, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_WHILE, WHILE_PREVIEW); + final InnerNode returns= createChild(parent, workingValues, FormatterMessages.WhiteSpaceOptions_return); + createOption(returns, workingValues, FormatterMessages.WhiteSpaceOptions_return_with_parenthesized_expression, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_PARENTHESIZED_EXPRESSION_IN_RETURN, RETURN_PREVIEW); final InnerNode decls= createChild(parent, workingValues, FormatterMessages.WhiteSpaceOptions_member_function_declaration); createOption(decls, workingValues, FormatterMessages.WhiteSpaceOptions_constructor, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_CONSTRUCTOR_DECLARATION, CONSTRUCTOR_DECL_PREVIEW); @@ -1095,6 +1103,12 @@ return root; } + private static InnerNode createReturnTree(Map workingValues, InnerNode parent) { + final InnerNode root= new InnerNode(parent, workingValues, FormatterMessages.WhiteSpaceOptions_return); + createOption(root, workingValues, FormatterMessages.WhiteSpaceTabPage_before_parentesized_expressions, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_PARENTHESIZED_EXPRESSION_IN_RETURN, RETURN_PREVIEW); + return root; + } + private static InnerNode createLabelTree(Map workingValues, InnerNode parent) { final InnerNode root= new InnerNode(parent, workingValues, FormatterMessages.WhiteSpaceTabPage_labels); createOption(root, workingValues, FormatterMessages.WhiteSpaceTabPage_before_colon, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COLON_IN_LABELED_STATEMENT, LABEL_PREVIEW);