diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/formatter/FormatterMessages.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/formatter/FormatterMessages.java index 41111a2c1bc..fc22bb5c6d5 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/formatter/FormatterMessages.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/formatter/FormatterMessages.java @@ -262,23 +262,30 @@ final class FormatterMessages extends NLS { // public static String LineWrappingTabPage_enum_constants; // public static String LineWrappingTabPage_implements_clause; public static String LineWrappingTabPage_parameters; + public static String LineWrappingTabPage_parameters_description; public static String LineWrappingTabPage_arguments; + public static String LineWrappingTabPage_arguments_description; // public static String LineWrappingTabPage_qualified_invocations; // public static String LineWrappingTabPage_throws_clause; // public static String LineWrappingTabPage_object_allocation; // public static String LineWrappingTabPage_qualified_object_allocation; public static String LineWrappingTabPage_array_init; + public static String LineWrappingTabPage_array_init_description; // public static String LineWrappingTabPage_explicit_constructor_invocations; public static String LineWrappingTabPage_conditionals; + public static String LineWrappingTabPage_conditionals_description; // public static String LineWrappingTabPage_binary_exprs; public static String LineWrappingTabPage_indentation_default; public static String LineWrappingTabPage_indentation_on_column; public static String LineWrappingTabPage_indentation_by_one; // public static String LineWrappingTabPage_class_decls; public static String LineWrappingTabPage_method_decls; + public static String LineWrappingTabPage_method_decls_description; // public static String LineWrappingTabPage_constructor_decls; public static String LineWrappingTabPage_function_calls; + public static String LineWrappingTabPage_function_calls_description; public static String LineWrappingTabPage_expressions; + public static String LineWrappingTabPage_expressions_description; // public static String LineWrappingTabPage_statements; // public static String LineWrappingTabPage_enum_decls; public static String LineWrappingTabPage_wrapping_policy_label_text; diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/formatter/FormatterMessages.properties b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/formatter/FormatterMessages.properties index 8c6c546109a..998072e6ca0 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/formatter/FormatterMessages.properties +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/formatter/FormatterMessages.properties @@ -304,23 +304,30 @@ #LineWrappingTabPage_enum_constants=Constants #LineWrappingTabPage_implements_clause='implements' clause LineWrappingTabPage_parameters=Parameters +LineWrappingTabPage_parameters_description=parameters LineWrappingTabPage_arguments=Arguments +LineWrappingTabPage_arguments_description=arguments #LineWrappingTabPage_qualified_invocations=Qualified invocations #LineWrappingTabPage_throws_clause='throws' clause #LineWrappingTabPage_object_allocation=Object allocation arguments #LineWrappingTabPage_qualified_object_allocation=Qualified object allocation arguments -LineWrappingTabPage_array_init=Initializer lists +LineWrappingTabPage_array_init=Initializer Lists +LineWrappingTabPage_array_init_description=initializer lists #LineWrappingTabPage_explicit_constructor_invocations=Explicit constructor invocations LineWrappingTabPage_conditionals=Conditionals +LineWrappingTabPage_conditionals_description=conditionals #LineWrappingTabPage_binary_exprs=Binary expressions LineWrappingTabPage_indentation_default=Default indentation LineWrappingTabPage_indentation_on_column=Indent on column LineWrappingTabPage_indentation_by_one=Indent by one #LineWrappingTabPage_class_decls=Class Declarations LineWrappingTabPage_method_decls=Function Declarations +LineWrappingTabPage_method_decls_description=function declarations #LineWrappingTabPage_constructor_decls=Constructor declarations LineWrappingTabPage_function_calls=Function Calls +LineWrappingTabPage_function_calls_description=function calls LineWrappingTabPage_expressions=Expressions +LineWrappingTabPage_expressions_description=expressions #LineWrappingTabPage_statements=Statements #LineWrappingTabPage_enum_decls='enum' declaration LineWrappingTabPage_wrapping_policy_label_text=Lin&e wrapping policy: diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/formatter/LineWrappingTabPage.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/formatter/LineWrappingTabPage.java index 5ceb69e6189..71f42a84d17 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/formatter/LineWrappingTabPage.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/formatter/LineWrappingTabPage.java @@ -61,14 +61,16 @@ public class LineWrappingTabPage extends ModifyDialogTabPage { private final static class Category { public final String key; public final String name; + public final String description; public final String previewText; public final List children; public int index; - public Category(String _key, String _previewText, String _name) { + public Category(String _key, String _previewText, String _name, String _description) { this.key= _key; this.name= _name; + this.description = _description; this.previewText= _previewText != null ? createPreviewHeader(_name) + _previewText : null; children= new ArrayList(); } @@ -76,8 +78,8 @@ public class LineWrappingTabPage extends ModifyDialogTabPage { /** * @param _name Category name */ - public Category(String _name) { - this(null, null, _name); + public Category(String _name, String _description) { + this(null, null, _name, _description); } public String toString() { @@ -137,8 +139,8 @@ public class LineWrappingTabPage extends ModifyDialogTabPage { private String getGroupLabel(Category category) { if (fSelection.size() == 1) { if (fSelectionState.getElements().size() == 1) - return Messages.format(FormatterMessages.LineWrappingTabPage_group, category.name.toLowerCase()); - return Messages.format(FormatterMessages.LineWrappingTabPage_multi_group, new String[] {category.name.toLowerCase(), Integer.toString(fSelectionState.getElements().size())}); + return Messages.format(FormatterMessages.LineWrappingTabPage_group, category.description); + return Messages.format(FormatterMessages.LineWrappingTabPage_multi_group, new String[] {category.description, Integer.toString(fSelectionState.getElements().size())}); } return Messages.format(FormatterMessages.LineWrappingTabPage_multiple_selections, new String[] {Integer.toString(fSelectionState.getElements().size())}); } @@ -387,14 +389,16 @@ public class LineWrappingTabPage extends ModifyDialogTabPage { private final Category fMethodDeclarationsParametersCategory= new Category( DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_PARAMETERS_IN_METHOD_DECLARATION, "class Example {void foo(int arg1, int arg2, int arg3, int arg4, int arg5, int arg6) {}};", //$NON-NLS-1$ - FormatterMessages.LineWrappingTabPage_parameters + FormatterMessages.LineWrappingTabPage_parameters, + FormatterMessages.LineWrappingTabPage_parameters_description ); private final Category fMessageSendArgumentsCategory= new Category( DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_ARGUMENTS_IN_METHOD_INVOCATION, "class Other {static void bar(int arg1, int arg2, int arg3, int arg4, int arg5, int arg6, int arg7, int arg8, int arg9) {}};"+ //$NON-NLS-1$ "void foo() {Other::bar(100, 200, 300, 400, 500, 600, 700, 800, 900);}", //$NON-NLS-1$ - FormatterMessages.LineWrappingTabPage_arguments + FormatterMessages.LineWrappingTabPage_arguments, + FormatterMessages.LineWrappingTabPage_arguments_description ); // private final Category fMessageSendSelectorCategory= new Category( @@ -435,7 +439,8 @@ public class LineWrappingTabPage extends ModifyDialogTabPage { private final Category fArrayInitializerExpressionsCategory= new Category( DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_EXPRESSIONS_IN_ARRAY_INITIALIZER, "int array[]= {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17};", //$NON-NLS-1$ - FormatterMessages.LineWrappingTabPage_array_init + FormatterMessages.LineWrappingTabPage_array_init, + FormatterMessages.LineWrappingTabPage_array_init_description ); // private final Category fExplicitConstructorArgumentsCategory= new Category( @@ -447,7 +452,8 @@ public class LineWrappingTabPage extends ModifyDialogTabPage { private final Category fConditionalExpressionCategory= new Category( DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_CONDITIONAL_EXPRESSION, "int compare(int argument, int argument2) {return argument > argument2 ? 100000 : 200000;}", //$NON-NLS-1$ - FormatterMessages.LineWrappingTabPage_conditionals + FormatterMessages.LineWrappingTabPage_conditionals, + FormatterMessages.LineWrappingTabPage_conditionals_description ); // private final Category fBinaryExpressionCategory= new Category( @@ -584,7 +590,7 @@ public class LineWrappingTabPage extends ModifyDialogTabPage { // constructorDeclarations.children.add(fConstructorDeclarationsParametersCategory); // constructorDeclarations.children.add(fConstructorThrowsClauseCategory); - final Category methodDeclarations= new Category(null, null, FormatterMessages.LineWrappingTabPage_method_decls); + final Category methodDeclarations= new Category(null, null, FormatterMessages.LineWrappingTabPage_method_decls, FormatterMessages.LineWrappingTabPage_method_decls_description); methodDeclarations.children.add(fMethodDeclarationsParametersCategory); // methodDeclarations.children.add(fMethodThrowsClauseCategory); @@ -593,14 +599,14 @@ public class LineWrappingTabPage extends ModifyDialogTabPage { // enumDeclarations.children.add(fEnumDeclInterfacesCategory); // enumDeclarations.children.add(fEnumConstArgumentsCategory); - final Category functionCalls= new Category(FormatterMessages.LineWrappingTabPage_function_calls); + final Category functionCalls= new Category(FormatterMessages.LineWrappingTabPage_function_calls, FormatterMessages.LineWrappingTabPage_function_calls_description); functionCalls.children.add(fMessageSendArgumentsCategory); // functionCalls.children.add(fMessageSendSelectorCategory); // functionCalls.children.add(fExplicitConstructorArgumentsCategory); // functionCalls.children.add(fAllocationExpressionArgumentsCategory); // functionCalls.children.add(fQualifiedAllocationExpressionCategory); - final Category expressions= new Category(FormatterMessages.LineWrappingTabPage_expressions); + final Category expressions= new Category(FormatterMessages.LineWrappingTabPage_expressions, FormatterMessages.LineWrappingTabPage_expressions_description); // expressions.children.add(fBinaryExpressionCategory); expressions.children.add(fConditionalExpressionCategory); expressions.children.add(fArrayInitializerExpressionsCategory);