diff options
author | Lars Vogel | 2015-11-13 17:32:18 +0000 |
---|---|---|
committer | Lars Vogel | 2015-11-13 17:32:18 +0000 |
commit | 6aed4cd772020e04d3f85a3b646128276e067a1a (patch) | |
tree | a3a8657aef2de6e3800de905cd2b7e0cca6ea5d1 | |
parent | 9b9a750ef18f9ba1f281d843cd321f80bd6a5178 (diff) | |
download | org.eclipse.e4.tools-6aed4cd772020e04d3f85a3b646128276e067a1a.tar.gz org.eclipse.e4.tools-6aed4cd772020e04d3f85a3b646128276e067a1a.tar.xz org.eclipse.e4.tools-6aed4cd772020e04d3f85a3b646128276e067a1a.zip |
Bug 482141 - Set Eclipse formatter in the e4 spies
Change-Id: Id75dafb1732240ed877c12d231769c57ad2c9d1e
Signed-off-by: Lars Vogel <Lars.Vogel@vogella.com>
8 files changed, 553 insertions, 324 deletions
diff --git a/bundles/org.eclipse.e4.tools.context.spy/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.e4.tools.context.spy/.settings/org.eclipse.jdt.core.prefs index c537b630..a07b23d4 100644 --- a/bundles/org.eclipse.e4.tools.context.spy/.settings/org.eclipse.jdt.core.prefs +++ b/bundles/org.eclipse.e4.tools.context.spy/.settings/org.eclipse.jdt.core.prefs @@ -5,3 +5,288 @@ org.eclipse.jdt.core.compiler.compliance=1.6 org.eclipse.jdt.core.compiler.problem.assertIdentifier=error org.eclipse.jdt.core.compiler.problem.enumIdentifier=error org.eclipse.jdt.core.compiler.source=1.6 +org.eclipse.jdt.core.formatter.align_type_members_on_columns=false +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16 +org.eclipse.jdt.core.formatter.alignment_for_assignment=0 +org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16 +org.eclipse.jdt.core.formatter.alignment_for_compact_if=16 +org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80 +org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0 +org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16 +org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0 +org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16 +org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80 +org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16 +org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16 +org.eclipse.jdt.core.formatter.blank_lines_after_imports=1 +org.eclipse.jdt.core.formatter.blank_lines_after_package=1 +org.eclipse.jdt.core.formatter.blank_lines_before_field=0 +org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0 +org.eclipse.jdt.core.formatter.blank_lines_before_imports=1 +org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1 +org.eclipse.jdt.core.formatter.blank_lines_before_method=1 +org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1 +org.eclipse.jdt.core.formatter.blank_lines_before_package=0 +org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1 +org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1 +org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_lambda_body=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false +org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false +org.eclipse.jdt.core.formatter.comment.format_block_comments=true +org.eclipse.jdt.core.formatter.comment.format_header=false +org.eclipse.jdt.core.formatter.comment.format_html=true +org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true +org.eclipse.jdt.core.formatter.comment.format_line_comments=true +org.eclipse.jdt.core.formatter.comment.format_source_code=true +org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true +org.eclipse.jdt.core.formatter.comment.indent_root_tags=true +org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert +org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert +org.eclipse.jdt.core.formatter.comment.line_length=80 +org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true +org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true +org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false +org.eclipse.jdt.core.formatter.compact_else_if=true +org.eclipse.jdt.core.formatter.continuation_indentation=2 +org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2 +org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off +org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on +org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false +org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true +org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true +org.eclipse.jdt.core.formatter.indent_empty_lines=false +org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true +org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true +org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true +org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false +org.eclipse.jdt.core.formatter.indentation.size=4 +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_after_type_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert +org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert +org.eclipse.jdt.core.formatter.insert_space_after_lambda_arrow=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert +org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert +org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_lambda_arrow=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert +org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert +org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert +org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.join_lines_in_comments=true +org.eclipse.jdt.core.formatter.join_wrapped_lines=true +org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false +org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false +org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false +org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false +org.eclipse.jdt.core.formatter.lineSplit=120 +org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false +org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false +org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0 +org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1 +org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true +org.eclipse.jdt.core.formatter.tabulation.char=tab +org.eclipse.jdt.core.formatter.tabulation.size=4 +org.eclipse.jdt.core.formatter.use_on_off_tags=false +org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false +org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true +org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true +org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true +org.eclipse.jdt.core.javaFormatter=org.eclipse.jdt.core.defaultJavaFormatter diff --git a/bundles/org.eclipse.e4.tools.context.spy/.settings/org.eclipse.jdt.ui.prefs b/bundles/org.eclipse.e4.tools.context.spy/.settings/org.eclipse.jdt.ui.prefs new file mode 100644 index 00000000..54f297e0 --- /dev/null +++ b/bundles/org.eclipse.e4.tools.context.spy/.settings/org.eclipse.jdt.ui.prefs @@ -0,0 +1,62 @@ +eclipse.preferences.version=1 +editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true +formatter_profile=org.eclipse.jdt.ui.default.eclipse_profile +formatter_settings_version=12 +sp_cleanup.add_default_serial_version_id=false +sp_cleanup.add_generated_serial_version_id=false +sp_cleanup.add_missing_annotations=true +sp_cleanup.add_missing_deprecated_annotations=true +sp_cleanup.add_missing_methods=false +sp_cleanup.add_missing_nls_tags=false +sp_cleanup.add_missing_override_annotations=true +sp_cleanup.add_missing_override_annotations_interface_methods=true +sp_cleanup.add_serial_version_id=false +sp_cleanup.always_use_blocks=false +sp_cleanup.always_use_parentheses_in_expressions=false +sp_cleanup.always_use_this_for_non_static_field_access=false +sp_cleanup.always_use_this_for_non_static_method_access=false +sp_cleanup.convert_functional_interfaces=false +sp_cleanup.convert_to_enhanced_for_loop=false +sp_cleanup.correct_indentation=false +sp_cleanup.format_source_code=false +sp_cleanup.format_source_code_changes_only=true +sp_cleanup.insert_inferred_type_arguments=false +sp_cleanup.make_local_variable_final=false +sp_cleanup.make_parameters_final=false +sp_cleanup.make_private_fields_final=false +sp_cleanup.make_type_abstract_if_missing_method=false +sp_cleanup.make_variable_declarations_final=false +sp_cleanup.never_use_blocks=false +sp_cleanup.never_use_parentheses_in_expressions=false +sp_cleanup.on_save_use_additional_actions=true +sp_cleanup.organize_imports=true +sp_cleanup.qualify_static_field_accesses_with_declaring_class=false +sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=false +sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=false +sp_cleanup.qualify_static_member_accesses_with_declaring_class=false +sp_cleanup.qualify_static_method_accesses_with_declaring_class=false +sp_cleanup.remove_private_constructors=false +sp_cleanup.remove_redundant_type_arguments=false +sp_cleanup.remove_trailing_whitespaces=true +sp_cleanup.remove_trailing_whitespaces_all=false +sp_cleanup.remove_trailing_whitespaces_ignore_empty=false +sp_cleanup.remove_unnecessary_casts=true +sp_cleanup.remove_unnecessary_nls_tags=false +sp_cleanup.remove_unused_imports=true +sp_cleanup.remove_unused_local_variables=false +sp_cleanup.remove_unused_private_fields=false +sp_cleanup.remove_unused_private_members=false +sp_cleanup.remove_unused_private_methods=false +sp_cleanup.remove_unused_private_types=false +sp_cleanup.sort_members=false +sp_cleanup.sort_members_all=false +sp_cleanup.use_anonymous_class_creation=false +sp_cleanup.use_blocks=true +sp_cleanup.use_blocks_only_for_return_and_throw=false +sp_cleanup.use_lambda=false +sp_cleanup.use_parentheses_in_expressions=false +sp_cleanup.use_this_for_non_static_field_access=false +sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=false +sp_cleanup.use_this_for_non_static_method_access=false +sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=false +sp_cleanup.use_type_arguments=false diff --git a/bundles/org.eclipse.e4.tools.context.spy/src/org/eclipse/e4/internal/tools/context/spy/ContextDataFilter.java b/bundles/org.eclipse.e4.tools.context.spy/src/org/eclipse/e4/internal/tools/context/spy/ContextDataFilter.java index 54ee7fe3..e35a1947 100644 --- a/bundles/org.eclipse.e4.tools.context.spy/src/org/eclipse/e4/internal/tools/context/spy/ContextDataFilter.java +++ b/bundles/org.eclipse.e4.tools.context.spy/src/org/eclipse/e4/internal/tools/context/spy/ContextDataFilter.java @@ -29,9 +29,8 @@ import org.eclipse.jface.viewers.ViewerFilter; @Creatable @Singleton -public class ContextDataFilter extends ViewerFilter -{ - +public class ContextDataFilter extends ViewerFilter { + @Inject Logger log; @@ -39,9 +38,9 @@ public class ContextDataFilter extends ViewerFilter // Implements the filter for the data table content @Override - public boolean select(Viewer viewer, Object parentElement, Object element) - { - if ((element == ContextDataProvider.LOCAL_VALUE_NODE) || (element == ContextDataProvider.INHERITED_INJECTED_VALUE_NODE)) + public boolean select(Viewer viewer, Object parentElement, Object element) { + if ((element == ContextDataProvider.LOCAL_VALUE_NODE) + || (element == ContextDataProvider.INHERITED_INJECTED_VALUE_NODE)) return true; // Must only select objects matching the pattern or objects under a kept @@ -68,11 +67,8 @@ public class ContextDataFilter extends ViewerFilter } - - /** Set the pattern and use it as lowercase */ - public void setPattern(String newPattern) - { + public void setPattern(String newPattern) { if ((newPattern == null) || (newPattern.length() == 0)) pattern = null; else @@ -83,8 +79,7 @@ public class ContextDataFilter extends ViewerFilter * This method search for an object and check if it contains the text or a * pattern matching this text */ - public boolean containsText(IEclipseContext ctx) - { + public boolean containsText(IEclipseContext ctx) { // It is useless to store the values in a map, because context changes // everytime and it should be tracked. Collection<String> values = computeValues(ctx); @@ -92,10 +87,8 @@ public class ContextDataFilter extends ViewerFilter // Search if string is just in one of the values... manage ignore case // and contain... boolean found = false; - for (String s : values) - { - if (matchText(s)) - { + for (String s : values) { + if (matchText(s)) { found = true; break; } @@ -103,23 +96,20 @@ public class ContextDataFilter extends ViewerFilter return found; } - public boolean matchText(String text) - { + public boolean matchText(String text) { return ((text == null) || (pattern == null)) ? false : text.toLowerCase().contains(pattern); } /** * Extract all string values in context - * + * * @param ctx * @return */ @SuppressWarnings("restriction") - private Collection<String> computeValues(IEclipseContext ctx) - { + private Collection<String> computeValues(IEclipseContext ctx) { Collection<String> result = new ArrayList<String>(); - if (ctx instanceof EclipseContext) - { + if (ctx instanceof EclipseContext) { // Search for all strings in this context (values and context // function) @@ -137,38 +127,33 @@ public class ContextDataFilter extends ViewerFilter Collection<String> localKeys = currentContext.localData().keySet(); Collection<String> localContextFunctionsKeys = currentContext.localContextFunction().keySet(); - if (currentContext.getRawListenerNames() != null) - { - for (String name : currentContext.getRawListenerNames()) - { + if (currentContext.getRawListenerNames() != null) { + for (String name : currentContext.getRawListenerNames()) { if (!localKeys.contains(name) && !localContextFunctionsKeys.contains(name)) result.add(name); } } - } else - { - log.warn("Warning : the received EclipseContext has not the expected type. It is a : " + ctx.getClass().toString()); + } else { + log.warn("Warning : the received EclipseContext has not the expected type. It is a : " + + ctx.getClass().toString()); } return result; } /** - * + * * @param map * the map to extract the strings (keys and values) * @param result * the result to fill with strings */ - private void extractStringsFromMap(Map<String, Object> map, Collection<String> result) - { - for (Map.Entry<String, Object> entry : map.entrySet()) - { + private void extractStringsFromMap(Map<String, Object> map, Collection<String> result) { + for (Map.Entry<String, Object> entry : map.entrySet()) { result.add(entry.getKey().toString()); Object value = entry.getValue(); - if (value != null) - { + if (value != null) { result.add(value.toString()); } } diff --git a/bundles/org.eclipse.e4.tools.context.spy/src/org/eclipse/e4/internal/tools/context/spy/ContextDataPart.java b/bundles/org.eclipse.e4.tools.context.spy/src/org/eclipse/e4/internal/tools/context/spy/ContextDataPart.java index 5f557044..84622bd4 100644 --- a/bundles/org.eclipse.e4.tools.context.spy/src/org/eclipse/e4/internal/tools/context/spy/ContextDataPart.java +++ b/bundles/org.eclipse.e4.tools.context.spy/src/org/eclipse/e4/internal/tools/context/spy/ContextDataPart.java @@ -38,25 +38,23 @@ import org.eclipse.swt.widgets.Tree; import org.eclipse.swt.widgets.TreeColumn; /** - * This part listen to selection, and if it is an EclipseContext, - * it displays its information It is used in the integrated ContextSpyPart - * and (in the future) it could be used outside to display the context of focused part for instance - * */ -public class ContextDataPart -{ + * This part listen to selection, and if it is an EclipseContext, it displays + * its information It is used in the integrated ContextSpyPart and (in the + * future) it could be used outside to display the context of focused part for + * instance + */ +public class ContextDataPart { private TreeViewer contextDataViewer; private ContextDataProvider dataProvider; private ContextEntryComparator comparator; - /** * Create contents of the view part. */ @PostConstruct - public void createControls(Composite parent, IEclipseContext ctx) - { + public void createControls(Composite parent, IEclipseContext ctx) { parent.setLayout(new GridLayout(1, false)); @@ -107,24 +105,21 @@ public class ContextDataPart } @PreDestroy - public void dispose() - { + public void dispose() { } @Focus - public void setFocus() - { + public void setFocus() { contextDataViewer.getControl().setFocus(); } @SuppressWarnings("restriction") @Inject @Optional - public void listenToContext(@Named(IServiceConstants.ACTIVE_SELECTION) EclipseContext ctx) - { - // Must check if dataviewer is created or not (when we reopen the window @postconstruct has not been called yet) - if ((ctx == null) || (contextDataViewer == null)) - { + public void listenToContext(@Named(IServiceConstants.ACTIVE_SELECTION) EclipseContext ctx) { + // Must check if dataviewer is created or not (when we reopen the window + // @postconstruct has not been called yet) + if ((ctx == null) || (contextDataViewer == null)) { return; } contextDataViewer.setInput(ctx); @@ -135,33 +130,27 @@ public class ContextDataPart * An entry comparator for the table, dealing with column index, keys and * values */ - public class ContextEntryComparator extends ViewerComparator - { + public class ContextEntryComparator extends ViewerComparator { private int columnIndex; private int direction; private ILabelProvider labelProvider; - public ContextEntryComparator(int columnIndex, ILabelProvider defaultLabelProvider) - { + public ContextEntryComparator(int columnIndex, ILabelProvider defaultLabelProvider) { this.columnIndex = columnIndex; direction = SWT.UP; labelProvider = defaultLabelProvider; } - public int getDirection() - { + public int getDirection() { return direction; } /** Called when click on table header, reverse order */ - public void setColumn(int column) - { - if (column == columnIndex) - { + public void setColumn(int column) { + if (column == columnIndex) { // Same column as last sort; toggle the direction direction = (direction == SWT.UP) ? SWT.DOWN : SWT.UP; - } else - { + } else { // New column; do a descending sort columnIndex = column; direction = SWT.DOWN; @@ -169,8 +158,7 @@ public class ContextDataPart } @Override - public int compare(Viewer viewer, Object e1, Object e2) - { + public int compare(Viewer viewer, Object e1, Object e2) { // For root elements at first level, we keep Local before Inherited if ((e1 == ContextDataProvider.LOCAL_VALUE_NODE) || (e2 == ContextDataProvider.LOCAL_VALUE_NODE)) return -1; @@ -185,42 +173,36 @@ public class ContextDataPart return (direction == SWT.DOWN) ? -rc : rc; } - public void setLabelProvider(ILabelProvider textProvider) - { + public void setLabelProvider(ILabelProvider textProvider) { labelProvider = textProvider; } } - private SelectionAdapter getHeaderSelectionAdapter(final TreeViewer viewer, final TreeColumn column, final int columnIndex, - final ILabelProvider textProvider) - { - SelectionAdapter selectionAdapter = new SelectionAdapter() - { - @Override - public void widgetSelected(SelectionEvent e) - { - viewer.setComparator(comparator); - comparator.setColumn(columnIndex); - comparator.setLabelProvider(textProvider); - viewer.getTree().setSortDirection(comparator.getDirection()); - viewer.getTree().setSortColumn(column); - viewer.refresh(); - } - }; + private SelectionAdapter getHeaderSelectionAdapter(final TreeViewer viewer, final TreeColumn column, + final int columnIndex, final ILabelProvider textProvider) { + SelectionAdapter selectionAdapter = new SelectionAdapter() { + @Override + public void widgetSelected(SelectionEvent e) { + viewer.setComparator(comparator); + comparator.setColumn(columnIndex); + comparator.setLabelProvider(textProvider); + viewer.getTree().setSortDirection(comparator.getDirection()); + viewer.getTree().setSortColumn(column); + viewer.refresh(); + } + }; return selectionAdapter; } - public void refresh(boolean refreshLabel) - { + public void refresh(boolean refreshLabel) { contextDataViewer.refresh(refreshLabel); } - private static final ViewerFilter[] NO_FILTER = new ViewerFilter[0]; - public void setFilter(ViewerFilter filter) - { - + + public void setFilter(ViewerFilter filter) { + contextDataViewer.setFilters((filter == null) ? NO_FILTER : new ViewerFilter[] { filter }); } diff --git a/bundles/org.eclipse.e4.tools.context.spy/src/org/eclipse/e4/internal/tools/context/spy/ContextDataProvider.java b/bundles/org.eclipse.e4.tools.context.spy/src/org/eclipse/e4/internal/tools/context/spy/ContextDataProvider.java index 22d4a4c8..cbb87ac1 100644 --- a/bundles/org.eclipse.e4.tools.context.spy/src/org/eclipse/e4/internal/tools/context/spy/ContextDataProvider.java +++ b/bundles/org.eclipse.e4.tools.context.spy/src/org/eclipse/e4/internal/tools/context/spy/ContextDataProvider.java @@ -40,11 +40,10 @@ import org.osgi.framework.FrameworkUtil; * The column Label and content Provider used to display information in context * data TreeViewer. Two instances for label provider are created : one for key, * one for values - * + * * @see ContextDataPart */ -public class ContextDataProvider extends ColumnLabelProvider implements ITreeContentProvider -{ +public class ContextDataProvider extends ColumnLabelProvider implements ITreeContentProvider { private static final String NO_VALUE_COULD_BE_COMPUTED = "No value could be yet computed"; private static final Color COLOR_IF_FOUND = Display.getCurrent().getSystemColor(SWT.COLOR_BLUE); @@ -81,39 +80,36 @@ public class ContextDataProvider extends ColumnLabelProvider implements ITreeCon private boolean displayKey = false; @Inject - public ContextDataProvider() - { + public ContextDataProvider() { super(); initFonts(); initializeImageRegistry(); } @Override - public void dispose() - { + public void dispose() { selectedContext = null; imgReg = null; } + @Override @SuppressWarnings("restriction") - public void inputChanged(Viewer viewer, Object oldInput, Object newInput) - { + public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { selectedContext = (newInput instanceof EclipseContext) ? (EclipseContext) newInput : null; } - public Object[] getElements(Object inputElement) - { + @Override + public Object[] getElements(Object inputElement) { return new String[] { LOCAL_VALUE_NODE, INHERITED_INJECTED_VALUE_NODE }; } + @Override @SuppressWarnings("restriction") - public Object[] getChildren(Object inputElement) - { + public Object[] getChildren(Object inputElement) { if (selectedContext == null) return EMPTY_RESULT; - if (inputElement == LOCAL_VALUE_NODE) - { + if (inputElement == LOCAL_VALUE_NODE) { Collection<Object> result = new ArrayList<Object>(); result.addAll(selectedContext.localData().entrySet()); @@ -122,18 +118,15 @@ public class ContextDataProvider extends ColumnLabelProvider implements ITreeCon // and display it as a standard value Map<String, Object> cfValues = new HashMap<String, Object>(); for (String key : selectedContext.localContextFunction().keySet()) - try - { + try { cfValues.put(key, selectedContext.get(key)); - } catch (Exception e) - { + } catch (Exception e) { cfValues.put(key, NO_VALUE_COULD_BE_COMPUTED + " (Exception : " + e.getClass().getName() + ")"); } result.addAll(cfValues.entrySet()); return result.toArray(); - } else if (inputElement == INHERITED_INJECTED_VALUE_NODE) - { + } else if (inputElement == INHERITED_INJECTED_VALUE_NODE) { // Search for all values injected using this context but defined in // parent Collection<Object> result = new ArrayList<Object>(); @@ -143,22 +136,18 @@ public class ContextDataProvider extends ColumnLabelProvider implements ITreeCon Collection<String> localKeys = selectedContext.localData().keySet(); Collection<String> localContextFunctionsKeys = selectedContext.localContextFunction().keySet(); - if (selectedContext.getRawListenerNames() != null) - { - for (String name : selectedContext.getRawListenerNames()) - { + if (selectedContext.getRawListenerNames() != null) { + for (String name : selectedContext.getRawListenerNames()) { if (!localKeys.contains(name) && !localContextFunctionsKeys.contains(name)) result.add(name); } } return result.size() == 0 ? new String[] { NO_VALUES_FOUND } : result.toArray(); - } else if (inputElement instanceof Map.Entry) - { + } else if (inputElement instanceof Map.Entry) { Set<Computation> listeners = getListeners(inputElement); return (listeners == null) ? null : listeners.toArray(); - } else if (inputElement instanceof String) - { + } else if (inputElement instanceof String) { // This is the name of a raw listener in the inherited injected // value part return selectedContext.getListeners((String) inputElement).toArray(); @@ -167,31 +156,25 @@ public class ContextDataProvider extends ColumnLabelProvider implements ITreeCon return EMPTY_RESULT; } - - public void setDisplayKey(boolean k) - { + public void setDisplayKey(boolean k) { displayKey = k; } @Override @SuppressWarnings({ "unchecked", "restriction" }) - public String getText(Object element) - { + public String getText(Object element) { if (selectedContext == null) return null; - - if (element instanceof Map.Entry) - { + + if (element instanceof Map.Entry) { Map.Entry<String, Object> mapEntry = (Map.Entry<String, Object>) element; Object o = displayKey ? mapEntry.getKey() : mapEntry.getValue(); return (o == null) ? "null" : o.toString(); - } else if (element instanceof Computation) - { + } else if (element instanceof Computation) { // For a computation : display field or method in key column and the // value in value String txt = super.getText(element); - if (displayKey) - { + if (displayKey) { if (txt.contains("#")) return INJECTED_IN_METHOD; else if (txt.contains("@")) @@ -206,9 +189,9 @@ public class ContextDataProvider extends ColumnLabelProvider implements ITreeCon } @Override - public Color getForeground(Object element) - { - // Return magenta color if the value could not be yet computed (for context functions) + public Color getForeground(Object element) { + // Return magenta color if the value could not be yet computed (for + // context functions) String s = getText(element); if ((s != null) && s.startsWith(NO_VALUE_COULD_BE_COMPUTED)) return COLOR_IF_NOT_COMPUTED; @@ -218,30 +201,27 @@ public class ContextDataProvider extends ColumnLabelProvider implements ITreeCon } /** Get the bold font for keys that are computed with ContextFunction */ - public Font getFont(Object element) - { + @Override + public Font getFont(Object element) { return (element == LOCAL_VALUE_NODE || element == INHERITED_INJECTED_VALUE_NODE) ? boldFont : null; } @SuppressWarnings("restriction") @Override - public Image getImage(Object element) - { + public Image getImage(Object element) { if (!displayKey) // No image in value column, only in key column return null; - if (element == LOCAL_VALUE_NODE) - { + if (element == LOCAL_VALUE_NODE) { return selectedContext == null ? null : imgReg.get(LOCAL_VARIABLE_IMG_KEY); - } else if (element == INHERITED_INJECTED_VALUE_NODE) - { + } else if (element == INHERITED_INJECTED_VALUE_NODE) { return selectedContext == null ? null : imgReg.get(INHERITED_VARIABLE_IMG_KEY); - } else if (element instanceof Computation) - { - // For a computation : display field, method or class in key column and + } else if (element instanceof Computation) { + // For a computation : display field, method or class in key column + // and // value in value column String txt = super.getText(element); @@ -252,12 +232,10 @@ public class ContextDataProvider extends ColumnLabelProvider implements ITreeCon else return imgReg.get(PUBLIC_FIELD_IMG_KEY); - } else if (element instanceof Map.Entry) - { + } else if (element instanceof Map.Entry) { if (isAContextKeyFunction(element)) return imgReg.get(CONTEXT_FUNCTION_IMG_KEY); - else - { + else { // It is a value. If it is injected somewhere, display the // inject image return hasChildren(element) ? imgReg.get(INJECT_IMG_KEY) : imgReg.get(VALUE_IN_CONTEXT_IMG_KEY); @@ -271,61 +249,51 @@ public class ContextDataProvider extends ColumnLabelProvider implements ITreeCon @SuppressWarnings("restriction") @Override - public String getToolTipText(Object element) - { - if (element == LOCAL_VALUE_NODE) - { + public String getToolTipText(Object element) { + if (element == LOCAL_VALUE_NODE) { return "This part contains values set in this context and then injected here or in children\n\n" + "If the value is injected using this context, you can expand the node to see where\n\n" + "If the value is injected using a child context you can find it in the second part for this child "; - } else if (element == INHERITED_INJECTED_VALUE_NODE) - { + } else if (element == INHERITED_INJECTED_VALUE_NODE) { return "This part contains the values injected or updated using this context, but initialized in a parent context\n\n" + "Expand nodes to see where values are injected or updated"; - } else if (isAContextKeyFunction(element)) - { + } else if (isAContextKeyFunction(element)) { String key = (String) ((Map.Entry<?, ?>) element).getKey(); String fname = (String) selectedContext.localContextFunction().get(key).getClass().getCanonicalName(); return "This value is created by the Context Function : " + fname; - } else - { + } else { if (hasChildren(element)) return "Expand this node to see where this value is injected or updated"; - else - { + else { if (element instanceof Map.Entry) return "This value is set here but not injected using this context (look in children context)"; } } - + return super.getToolTipText(element); } @Override - public Image getToolTipImage(Object object) - { + public Image getToolTipImage(Object object) { return getImage(object); } @Override - public int getToolTipStyle(Object object) - { + public int getToolTipStyle(Object object) { return SWT.SHADOW_OUT; } /** * Compute it the current entry in context is a context function - * + * * @param element * @return true if element is a context function */ @SuppressWarnings({ "restriction", "unchecked" }) - boolean isAContextKeyFunction(Object element) - { - if (selectedContext != null && element instanceof Map.Entry) - { + boolean isAContextKeyFunction(Object element) { + if (selectedContext != null && element instanceof Map.Entry) { // Just check if key in element is a key in the map of context // functions. Map.Entry<String, Object> mapEntry = (Map.Entry<String, Object>) element; @@ -336,8 +304,7 @@ public class ContextDataProvider extends ColumnLabelProvider implements ITreeCon } @Override - public Object getParent(Object element) - { + public Object getParent(Object element) { if (element == LOCAL_VALUE_NODE || element == INHERITED_INJECTED_VALUE_NODE) return null; @@ -348,10 +315,8 @@ public class ContextDataProvider extends ColumnLabelProvider implements ITreeCon @SuppressWarnings("restriction") @Override - public boolean hasChildren(Object element) - { - if ((element == INHERITED_INJECTED_VALUE_NODE) || (element == LOCAL_VALUE_NODE)) - { + public boolean hasChildren(Object element) { + if ((element == INHERITED_INJECTED_VALUE_NODE) || (element == LOCAL_VALUE_NODE)) { return true; // Intermediate nodes returns true } @@ -360,19 +325,15 @@ public class ContextDataProvider extends ColumnLabelProvider implements ITreeCon } @SuppressWarnings({ "restriction", "unchecked" }) - Set<Computation> getListeners(Object element) - { - if (selectedContext != null) - { - if (element instanceof Map.Entry) - { + Set<Computation> getListeners(Object element) { + if (selectedContext != null) { + if (element instanceof Map.Entry) { // Ask the context to know if there are listeners for this value Map.Entry<String, Object> mapEntry = (Map.Entry<String, Object>) element; String key = mapEntry.getKey(); return selectedContext.getListeners(key); - } else if (element instanceof String) - { + } else if (element instanceof String) { // Ask the context to know if there are listeners for this raw // listener name return selectedContext.getListeners((String) element); @@ -382,9 +343,7 @@ public class ContextDataProvider extends ColumnLabelProvider implements ITreeCon } - - private void initializeImageRegistry() - { + private void initializeImageRegistry() { Bundle b = FrameworkUtil.getBundle(this.getClass()); imgReg = new ImageRegistry(); @@ -399,8 +358,7 @@ public class ContextDataProvider extends ColumnLabelProvider implements ITreeCon } - private void initFonts() - { + private void initFonts() { FontData[] fontData = Display.getCurrent().getSystemFont().getFontData(); String fontName = fontData[0].getName(); FontRegistry registry = JFaceResources.getFontRegistry(); diff --git a/bundles/org.eclipse.e4.tools.context.spy/src/org/eclipse/e4/internal/tools/context/spy/ContextSpyHelper.java b/bundles/org.eclipse.e4.tools.context.spy/src/org/eclipse/e4/internal/tools/context/spy/ContextSpyHelper.java index 460b9c87..8f2a6e00 100644 --- a/bundles/org.eclipse.e4.tools.context.spy/src/org/eclipse/e4/internal/tools/context/spy/ContextSpyHelper.java +++ b/bundles/org.eclipse.e4.tools.context.spy/src/org/eclipse/e4/internal/tools/context/spy/ContextSpyHelper.java @@ -21,26 +21,23 @@ import org.osgi.framework.BundleContext; /** * A helper class to get information inside context management system. This - * class uses internal fields or methods defined in EclipseContext - * Could be updated in the future. - * + * class uses internal fields or methods defined in EclipseContext Could be + * updated in the future. + * * @author olivier - * + * */ -public class ContextSpyHelper -{ +public class ContextSpyHelper { /** * Get all the contexts created by EclipseContextFactory. It get values from * field introspection. Should be rewritten if internal structure changes - * + * * @return a collection of contexts created by EclipseContextFactory */ - public static Collection<IEclipseContext> getAllBundleContexts() - { + public static Collection<IEclipseContext> getAllBundleContexts() { Collection<IEclipseContext> result = Collections.emptyList(); - try - { + try { // Must use introspection to get the weak hash map (no getter). Field f = EclipseContextFactory.class.getDeclaredField("serviceContexts"); f.setAccessible(true); @@ -48,25 +45,18 @@ public class ContextSpyHelper Map<BundleContext, IEclipseContext> ctxs = (Map<BundleContext, IEclipseContext>) f.get(null); result = ctxs.values(); - } catch (SecurityException e) - { + } catch (SecurityException e) { e.printStackTrace(); - } catch (NoSuchFieldException e) - { + } catch (NoSuchFieldException e) { e.printStackTrace(); - } catch (IllegalArgumentException e) - { + } catch (IllegalArgumentException e) { e.printStackTrace(); - } catch (IllegalAccessException e) - { + } catch (IllegalAccessException e) { e.printStackTrace(); } return result; } - - - } diff --git a/bundles/org.eclipse.e4.tools.context.spy/src/org/eclipse/e4/internal/tools/context/spy/ContextSpyProvider.java b/bundles/org.eclipse.e4.tools.context.spy/src/org/eclipse/e4/internal/tools/context/spy/ContextSpyProvider.java index 6d82469e..5608b185 100644 --- a/bundles/org.eclipse.e4.tools.context.spy/src/org/eclipse/e4/internal/tools/context/spy/ContextSpyProvider.java +++ b/bundles/org.eclipse.e4.tools.context.spy/src/org/eclipse/e4/internal/tools/context/spy/ContextSpyProvider.java @@ -26,41 +26,36 @@ import org.eclipse.swt.graphics.Color; import org.eclipse.swt.widgets.Display; @SuppressWarnings("restriction") -/** This label and treecontent provider is used by ContextSpyPart to display +/** + * This label and treecontent provider is used by ContextSpyPart to display * available contexts. + * * @author olivier * */ -public class ContextSpyProvider extends LabelProvider implements ITreeContentProvider, IColorProvider -{ +public class ContextSpyProvider extends LabelProvider implements ITreeContentProvider, IColorProvider { @Inject private ContextDataFilter contextFilter; @Inject - public ContextSpyProvider() - { + public ContextSpyProvider() { } @Override - public void dispose() - { + public void dispose() { } @Override - public void inputChanged(Viewer viewer, Object oldInput, Object newInput) - { + public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { } @Override - public Object[] getElements(Object inputElement) - { - if (inputElement instanceof MApplication) - { + public Object[] getElements(Object inputElement) { + if (inputElement instanceof MApplication) { return new Object[] { ((MApplication) inputElement).getContext().getParent() }; - } else if (inputElement instanceof Collection<?>) - { + } else if (inputElement instanceof Collection<?>) { return ((Collection<?>) inputElement).toArray(); } @@ -68,51 +63,42 @@ public class ContextSpyProvider extends LabelProvider implements ITreeContentPro } @Override - public Object[] getChildren(Object parentElement) - { - if (parentElement instanceof EclipseContext) - { + public Object[] getChildren(Object parentElement) { + if (parentElement instanceof EclipseContext) { return ((EclipseContext) parentElement).getChildren().toArray(); } return null; } @Override - public Object getParent(Object element) - { - if (element instanceof EclipseContext) - { + public Object getParent(Object element) { + if (element instanceof EclipseContext) { return ((EclipseContext) element).getParent(); - } + } return null; } @Override - public boolean hasChildren(Object element) - { + public boolean hasChildren(Object element) { return ((element instanceof EclipseContext) && !(((EclipseContext) element).getChildren().isEmpty())); } @Override - public String getText(Object element) - { + public String getText(Object element) { return super.getText(element); } @Override - public Color getForeground(Object element) - { + public Color getForeground(Object element) { // Return a color if a text contained in this node contains the text. - if (element instanceof IEclipseContext && contextFilter.containsText((IEclipseContext) element)) - { + if (element instanceof IEclipseContext && contextFilter.containsText((IEclipseContext) element)) { return Display.getCurrent().getSystemColor(SWT.COLOR_BLUE); } return null; } @Override - public Color getBackground(Object element) - { + public Color getBackground(Object element) { return null; } diff --git a/bundles/org.eclipse.e4.tools.context.spy/src/org/eclipse/e4/tools/context/spy/ContextSpyPart.java b/bundles/org.eclipse.e4.tools.context.spy/src/org/eclipse/e4/tools/context/spy/ContextSpyPart.java index 55f29dfb..ebe4ca0f 100644 --- a/bundles/org.eclipse.e4.tools.context.spy/src/org/eclipse/e4/tools/context/spy/ContextSpyPart.java +++ b/bundles/org.eclipse.e4.tools.context.spy/src/org/eclipse/e4/tools/context/spy/ContextSpyPart.java @@ -49,8 +49,7 @@ import org.osgi.framework.FrameworkUtil; * This class is the main part of the context spy. It creates a treeviewer and * the context data part listening to context selection */ -public class ContextSpyPart -{ +public class ContextSpyPart { private static final String ICON_COLLAPSEALL = "icons/collapseall.gif"; private static final String ICON_EXPANDALL = "icons/expandall.gif"; @@ -68,7 +67,6 @@ public class ContextSpyPart private ImageRegistry imgReg; - @Inject private ContextDataFilter contextFilter; @@ -81,8 +79,7 @@ public class ContextSpyPart private static boolean lastShowFiltered = false; @Inject - private void initializeImageRegistry() - { + private void initializeImageRegistry() { Bundle b = FrameworkUtil.getBundle(this.getClass()); imgReg = new ImageRegistry(); imgReg.put(ICON_COLLAPSEALL, ImageDescriptor.createFromURL(b.getEntry(ICON_COLLAPSEALL))); @@ -94,8 +91,7 @@ public class ContextSpyPart * Create contents of the view part. */ @PostConstruct - public void createControls(Composite parent, MApplication a, IEclipseContext ctx) - { + public void createControls(Composite parent, MApplication a, IEclipseContext ctx) { parent.setLayout(new GridLayout(1, false)); final Composite comp = new Composite(parent, SWT.NONE); @@ -104,39 +100,33 @@ public class ContextSpyPart Button refreshButton = new Button(comp, SWT.FLAT); refreshButton.setImage(imgReg.get(ICON_REFRESH)); refreshButton.setToolTipText("Refresh the contexts"); - refreshButton.addSelectionListener(new SelectionAdapter() - { - @Override - public void widgetSelected(SelectionEvent e) - { - contextTreeViewer.refresh(true); - contextDataPart.refresh(true); - } - }); + refreshButton.addSelectionListener(new SelectionAdapter() { + @Override + public void widgetSelected(SelectionEvent e) { + contextTreeViewer.refresh(true); + contextDataPart.refresh(true); + } + }); Button expandAll = new Button(comp, SWT.FLAT); expandAll.setImage(imgReg.get(ICON_EXPANDALL)); expandAll.setToolTipText("Expand context nodes"); - expandAll.addSelectionListener(new SelectionAdapter() - { - @Override - public void widgetSelected(SelectionEvent e) - { - contextTreeViewer.expandAll(); - } - }); + expandAll.addSelectionListener(new SelectionAdapter() { + @Override + public void widgetSelected(SelectionEvent e) { + contextTreeViewer.expandAll(); + } + }); Button collapseAll = new Button(comp, SWT.FLAT); collapseAll.setImage(imgReg.get(ICON_COLLAPSEALL)); collapseAll.setToolTipText("Collapse context nodes"); - collapseAll.addSelectionListener(new SelectionAdapter() - { - @Override - public void widgetSelected(SelectionEvent e) - { - contextTreeViewer.collapseAll(); - } + collapseAll.addSelectionListener(new SelectionAdapter() { + @Override + public void widgetSelected(SelectionEvent e) { + contextTreeViewer.collapseAll(); + } - }); + }); filterText = new Text(comp, SWT.SEARCH | SWT.ICON_SEARCH); GridDataFactory.fillDefaults().hint(200, SWT.DEFAULT).applyTo(filterText); @@ -146,40 +136,36 @@ public class ContextSpyPart if (lastFilterText != null) filterText.setText(lastFilterText); contextFilter.setPattern(lastFilterText); - filterText.addKeyListener(new KeyAdapter() - { - @Override - public void keyReleased(KeyEvent e) - { - String textToSearch = filterText.getText(); - lastFilterText = textToSearch; - boolean enableButton = textToSearch.length() > 0; - // Enable/disable button for filtering - showOnlyFilteredElements.setEnabled(enableButton); - - // Then update filters and viewers - contextFilter.setPattern(textToSearch); - setFilter(); - contextTreeViewer.refresh(true); - contextDataPart.refresh(true); - } - - }); + filterText.addKeyListener(new KeyAdapter() { + @Override + public void keyReleased(KeyEvent e) { + String textToSearch = filterText.getText(); + lastFilterText = textToSearch; + boolean enableButton = textToSearch.length() > 0; + // Enable/disable button for filtering + showOnlyFilteredElements.setEnabled(enableButton); + + // Then update filters and viewers + contextFilter.setPattern(textToSearch); + setFilter(); + contextTreeViewer.refresh(true); + contextDataPart.refresh(true); + } + + }); showOnlyFilteredElements = new Button(comp, SWT.CHECK); showOnlyFilteredElements.setText("Show Only Filtered"); showOnlyFilteredElements.setToolTipText("Show only the filtered items in the table view"); showOnlyFilteredElements.setEnabled((lastFilterText != null) && (lastFilterText.length() > 0)); showOnlyFilteredElements.setSelection(lastShowFiltered); - showOnlyFilteredElements.addSelectionListener(new SelectionAdapter() - { - @Override - public void widgetSelected(SelectionEvent e) - { - lastShowFiltered = showOnlyFilteredElements.getSelection(); - setFilter(); - } - }); + showOnlyFilteredElements.addSelectionListener(new SelectionAdapter() { + @Override + public void widgetSelected(SelectionEvent e) { + lastShowFiltered = showOnlyFilteredElements.getSelection(); + setFilter(); + } + }); SashForm sashForm = new SashForm(parent, SWT.VERTICAL | SWT.V_SCROLL | SWT.H_SCROLL); sashForm.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); @@ -194,15 +180,13 @@ public class ContextSpyPart // tv.setInput(a); contextTreeViewer.setInput(ContextSpyHelper.getAllBundleContexts()); - contextTreeViewer.addSelectionChangedListener(new ISelectionChangedListener() - { - @Override - public void selectionChanged(SelectionChangedEvent event) - { - IStructuredSelection ss = (IStructuredSelection) event.getSelection(); - selService.setSelection((ss.size() == 1) ? ss.getFirstElement() : ss.toArray()); - } - }); + contextTreeViewer.addSelectionChangedListener(new ISelectionChangedListener() { + @Override + public void selectionChanged(SelectionChangedEvent event) { + IStructuredSelection ss = (IStructuredSelection) event.getSelection(); + selService.setSelection((ss.size() == 1) ? ss.getFirstElement() : ss.toArray()); + } + }); IEclipseContext subCtx = ctx.createChild("Context for ContextDataPart"); subCtx.set(Composite.class, sashForm); @@ -218,8 +202,7 @@ public class ContextSpyPart } /** Set the filter on context data part */ - public void setFilter() - { + public void setFilter() { if (showOnlyFilteredElements.isEnabled() && showOnlyFilteredElements.getSelection()) contextDataPart.setFilter(contextFilter); else @@ -227,13 +210,11 @@ public class ContextSpyPart } @PreDestroy - public void dispose() - { + public void dispose() { } @Focus - public void setFocus() - { + public void setFocus() { contextTreeViewer.getControl().setFocus(); } |