Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Vogel2015-11-13 17:30:51 +0000
committerLars Vogel2015-11-13 17:30:51 +0000
commit9b9a750ef18f9ba1f281d843cd321f80bd6a5178 (patch)
tree9c91f830b605f5aee136deb7999ff7e66d13940a
parent5b50421b19dc60fc9f9c6829b827e9d13e538f0b (diff)
downloadorg.eclipse.e4.tools-9b9a750ef18f9ba1f281d843cd321f80bd6a5178.tar.gz
org.eclipse.e4.tools-9b9a750ef18f9ba1f281d843cd321f80bd6a5178.tar.xz
org.eclipse.e4.tools-9b9a750ef18f9ba1f281d843cd321f80bd6a5178.zip
Bug 482141 - Set Eclipse formatter in the e4 spies
Change-Id: I84cdfc2d751c21b0875611fe20ee46298d3d146a Signed-off-by: Lars Vogel <Lars.Vogel@vogella.com>
-rw-r--r--bundles/org.eclipse.e4.tools.css.spy/.settings/org.eclipse.jdt.core.prefs285
-rw-r--r--bundles/org.eclipse.e4.tools.css.spy/.settings/org.eclipse.jdt.ui.prefs10
-rw-r--r--bundles/org.eclipse.e4.tools.css.spy/src/org/eclipse/e4/tools/css/spy/Activator.java38
-rw-r--r--bundles/org.eclipse.e4.tools.css.spy/src/org/eclipse/e4/tools/css/spy/CSSPropertiesContentProvider.java31
-rw-r--r--bundles/org.eclipse.e4.tools.css.spy/src/org/eclipse/e4/tools/css/spy/CSSPropertyProvider.java4
-rw-r--r--bundles/org.eclipse.e4.tools.css.spy/src/org/eclipse/e4/tools/css/spy/CSSScratchPadPart.java33
-rw-r--r--bundles/org.eclipse.e4.tools.css.spy/src/org/eclipse/e4/tools/css/spy/CssSpyPart.java747
-rw-r--r--bundles/org.eclipse.e4.tools.css.spy/src/org/eclipse/e4/tools/css/spy/TextPopupDialog.java8
-rw-r--r--bundles/org.eclipse.e4.tools.css.spy/src/org/eclipse/e4/tools/css/spy/WidgetTreeProvider.java55
9 files changed, 668 insertions, 543 deletions
diff --git a/bundles/org.eclipse.e4.tools.css.spy/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.e4.tools.css.spy/.settings/org.eclipse.jdt.core.prefs
index c537b630..a07b23d4 100644
--- a/bundles/org.eclipse.e4.tools.css.spy/.settings/org.eclipse.jdt.core.prefs
+++ b/bundles/org.eclipse.e4.tools.css.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.css.spy/.settings/org.eclipse.jdt.ui.prefs b/bundles/org.eclipse.e4.tools.css.spy/.settings/org.eclipse.jdt.ui.prefs
index 1de18b45..c15b52b7 100644
--- a/bundles/org.eclipse.e4.tools.css.spy/.settings/org.eclipse.jdt.ui.prefs
+++ b/bundles/org.eclipse.e4.tools.css.spy/.settings/org.eclipse.jdt.ui.prefs
@@ -1,5 +1,7 @@
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=true
sp_cleanup.add_generated_serial_version_id=false
sp_cleanup.add_missing_annotations=true
@@ -13,10 +15,12 @@ sp_cleanup.always_use_blocks=true
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_to_enhanced_for_loop=true
+sp_cleanup.convert_functional_interfaces=false
+sp_cleanup.convert_to_enhanced_for_loop=false
sp_cleanup.correct_indentation=false
sp_cleanup.format_source_code=true
sp_cleanup.format_source_code_changes_only=true
+sp_cleanup.insert_inferred_type_arguments=false
sp_cleanup.make_local_variable_final=true
sp_cleanup.make_parameters_final=false
sp_cleanup.make_private_fields_final=true
@@ -32,6 +36,7 @@ sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=
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=true
+sp_cleanup.remove_redundant_type_arguments=false
sp_cleanup.remove_trailing_whitespaces=true
sp_cleanup.remove_trailing_whitespaces_all=true
sp_cleanup.remove_trailing_whitespaces_ignore_empty=false
@@ -45,10 +50,13 @@ sp_cleanup.remove_unused_private_methods=true
sp_cleanup.remove_unused_private_types=true
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=true
sp_cleanup.use_this_for_non_static_method_access=false
sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true
+sp_cleanup.use_type_arguments=false
diff --git a/bundles/org.eclipse.e4.tools.css.spy/src/org/eclipse/e4/tools/css/spy/Activator.java b/bundles/org.eclipse.e4.tools.css.spy/src/org/eclipse/e4/tools/css/spy/Activator.java
index cf8f4c62..f7ca3980 100644
--- a/bundles/org.eclipse.e4.tools.css.spy/src/org/eclipse/e4/tools/css/spy/Activator.java
+++ b/bundles/org.eclipse.e4.tools.css.spy/src/org/eclipse/e4/tools/css/spy/Activator.java
@@ -23,33 +23,39 @@ public class Activator implements BundleActivator {
/*
* (non-Javadoc)
- * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext)
+ *
+ * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.
+ * BundleContext)
*/
+ @Override
public void start(BundleContext bundleContext) throws Exception {
Activator.context = bundleContext;
}
/*
* (non-Javadoc)
- * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext)
+ *
+ * @see
+ * org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext)
*/
+ @Override
public void stop(BundleContext bundleContext) throws Exception {
Activator.context = null;
}
- public static String join(String[] elements, String glue) {
- StringBuilder sb = new StringBuilder();
- join(sb, elements, glue);
- return sb.toString();
- }
-
- public static void join(StringBuilder sb, String[] elements, String glue) {
- for (int i = 0; i < elements.length; i++) {
- sb.append(elements[i]);
- if (i < elements.length - 1) {
- sb.append(glue);
- }
- }
- }
+ public static String join(String[] elements, String glue) {
+ StringBuilder sb = new StringBuilder();
+ join(sb, elements, glue);
+ return sb.toString();
+ }
+
+ public static void join(StringBuilder sb, String[] elements, String glue) {
+ for (int i = 0; i < elements.length; i++) {
+ sb.append(elements[i]);
+ if (i < elements.length - 1) {
+ sb.append(glue);
+ }
+ }
+ }
}
diff --git a/bundles/org.eclipse.e4.tools.css.spy/src/org/eclipse/e4/tools/css/spy/CSSPropertiesContentProvider.java b/bundles/org.eclipse.e4.tools.css.spy/src/org/eclipse/e4/tools/css/spy/CSSPropertiesContentProvider.java
index 643f8bab..c5666e7f 100644
--- a/bundles/org.eclipse.e4.tools.css.spy/src/org/eclipse/e4/tools/css/spy/CSSPropertiesContentProvider.java
+++ b/bundles/org.eclipse.e4.tools.css.spy/src/org/eclipse/e4/tools/css/spy/CSSPropertiesContentProvider.java
@@ -22,35 +22,34 @@ import org.eclipse.swt.widgets.Widget;
public class CSSPropertiesContentProvider implements IStructuredContentProvider {
- protected CSSEngine cssEngine;
- protected CSSStylableElement input;
+ protected CSSEngine cssEngine;
+ protected CSSStylableElement input;
@Override
public void dispose() {
- cssEngine = null;
- input = null;
- }
+ cssEngine = null;
+ input = null;
+ }
@Override
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- if (newInput instanceof CSSStylableElement) {
- this.input = (CSSStylableElement) newInput;
+ if (newInput instanceof CSSStylableElement) {
+ this.input = (CSSStylableElement) newInput;
this.cssEngine = CssSpyPart.getCSSEngine(input.getNativeWidget());
- } else if (newInput instanceof Widget) {
+ } else if (newInput instanceof Widget) {
this.cssEngine = CssSpyPart.getCSSEngine(newInput);
this.input = (CSSStylableElement) cssEngine.getElement(newInput);
- }
- }
+ }
+ }
@Override
public Object[] getElements(Object inputElement) {
Collection<String> propertyNames = cssEngine.getCSSProperties(input);
- List<CSSPropertyProvider> properties = new ArrayList<CSSPropertyProvider>(
- propertyNames.size());
+ List<CSSPropertyProvider> properties = new ArrayList<CSSPropertyProvider>(propertyNames.size());
for (String propertyName : propertyNames) {
- properties.add(new CSSPropertyProvider(propertyName, input, cssEngine));
- }
- return properties.toArray();
- }
+ properties.add(new CSSPropertyProvider(propertyName, input, cssEngine));
+ }
+ return properties.toArray();
+ }
}
diff --git a/bundles/org.eclipse.e4.tools.css.spy/src/org/eclipse/e4/tools/css/spy/CSSPropertyProvider.java b/bundles/org.eclipse.e4.tools.css.spy/src/org/eclipse/e4/tools/css/spy/CSSPropertyProvider.java
index fbc12b46..10a97452 100644
--- a/bundles/org.eclipse.e4.tools.css.spy/src/org/eclipse/e4/tools/css/spy/CSSPropertyProvider.java
+++ b/bundles/org.eclipse.e4.tools.css.spy/src/org/eclipse/e4/tools/css/spy/CSSPropertyProvider.java
@@ -23,8 +23,7 @@ public class CSSPropertyProvider {
private CSSStylableElement element;
private CSSEngine engine;
- public CSSPropertyProvider(String propertyName, CSSStylableElement element,
- CSSEngine engine) {
+ public CSSPropertyProvider(String propertyName, CSSStylableElement element, CSSEngine engine) {
this.propertyName = propertyName;
this.element = element;
this.engine = engine;
@@ -43,7 +42,6 @@ public class CSSPropertyProvider {
engine.applyCSSProperty(element, propertyName, v, "");
}
-
@Override
public String toString() {
return propertyName;
diff --git a/bundles/org.eclipse.e4.tools.css.spy/src/org/eclipse/e4/tools/css/spy/CSSScratchPadPart.java b/bundles/org.eclipse.e4.tools.css.spy/src/org/eclipse/e4/tools/css/spy/CSSScratchPadPart.java
index aa6c47c2..4f46fc71 100644
--- a/bundles/org.eclipse.e4.tools.css.spy/src/org/eclipse/e4/tools/css/spy/CSSScratchPadPart.java
+++ b/bundles/org.eclipse.e4.tools.css.spy/src/org/eclipse/e4/tools/css/spy/CSSScratchPadPart.java
@@ -34,8 +34,7 @@ import org.w3c.dom.stylesheets.StyleSheet;
import org.w3c.dom.stylesheets.StyleSheetList;
@SuppressWarnings("restriction")
-public class CSSScratchPadPart
-{
+public class CSSScratchPadPart {
@Inject
@Optional
private IThemeEngine themeEngine;
@@ -46,9 +45,9 @@ public class CSSScratchPadPart
* setShellStyle(SWT.DIALOG_TRIM | SWT.RESIZE/* | SWT.PRIMARY_MODAL
*/
// );
- // setShellStyle(SWT.DIALOG_TRIM | SWT.MAX | SWT.RESIZE
- // | getDefaultOrientation());
- //}
+ // setShellStyle(SWT.DIALOG_TRIM | SWT.MAX | SWT.RESIZE
+ // | getDefaultOrientation());
+ // }
/*
* @Override protected void configureShell(Shell newShell) {
@@ -65,8 +64,7 @@ public class CSSScratchPadPart
private Text exceptions;
@PostConstruct
- protected Control createDialogArea(Composite parent)
- {
+ protected Control createDialogArea(Composite parent) {
Composite outer = parent;
outer.setLayout(new GridLayout());
@@ -74,8 +72,7 @@ public class CSSScratchPadPart
SashForm sashForm = new SashForm(outer, SWT.VERTICAL);
- cssText = new Text(sashForm, SWT.BORDER | SWT.MULTI | SWT.WRAP
- | SWT.V_SCROLL);
+ cssText = new Text(sashForm, SWT.BORDER | SWT.MULTI | SWT.WRAP | SWT.V_SCROLL);
exceptions = new Text(sashForm, SWT.BORDER | SWT.MULTI | SWT.READ_ONLY);
@@ -93,8 +90,7 @@ public class CSSScratchPadPart
// IDialogConstants.CANCEL_LABEL, false);
}
- protected Button createButton(Composite parent, int id, String label,
- boolean defaultButton) {
+ protected Button createButton(Composite parent, int id, String label, boolean defaultButton) {
// increment the number of columns in the button bar
((GridLayout) parent.getLayout()).numColumns++;
Button button = new Button(parent, SWT.PUSH);
@@ -114,14 +110,10 @@ public class CSSScratchPadPart
}
}
buttons.put(new Integer(id), button);
- //setButtonLayoutData(button);
+ // setButtonLayoutData(button);
return button;
}
-
-
-
-
protected void buttonPressed(int buttonId) {
switch (buttonId) {
case APPLY_ID:
@@ -151,10 +143,8 @@ public class CSSScratchPadPart
if (count++ > 0) {
sb.append("\n\n");
}
- sb.append("Engine[").append(engine.getClass().getSimpleName())
- .append("]");
- ExtendedDocumentCSS doc = (ExtendedDocumentCSS) engine
- .getDocumentCSS();
+ sb.append("Engine[").append(engine.getClass().getSimpleName()).append("]");
+ ExtendedDocumentCSS doc = (ExtendedDocumentCSS) engine.getDocumentCSS();
List<StyleSheet> sheets = new ArrayList<StyleSheet>();
StyleSheetList list = doc.getStyleSheets();
for (int i = 0; i < list.getLength(); i++) {
@@ -173,8 +163,7 @@ public class CSSScratchPadPart
long nanoDiff = System.nanoTime() - start;
sb.append("\nTime: ").append(nanoDiff / 1000000).append("ms");
} catch (CSSParseException e) {
- sb.append("\nError: line ").append(e.getLineNumber())
- .append(" col ").append(e.getColumnNumber())
+ sb.append("\nError: line ").append(e.getLineNumber()).append(" col ").append(e.getColumnNumber())
.append(": ").append(e.getLocalizedMessage());
} catch (IOException e) {
sb.append("\nError: ").append(e.getLocalizedMessage());
diff --git a/bundles/org.eclipse.e4.tools.css.spy/src/org/eclipse/e4/tools/css/spy/CssSpyPart.java b/bundles/org.eclipse.e4.tools.css.spy/src/org/eclipse/e4/tools/css/spy/CssSpyPart.java
index 9569c123..5302d18e 100644
--- a/bundles/org.eclipse.e4.tools.css.spy/src/org/eclipse/e4/tools/css/spy/CssSpyPart.java
+++ b/bundles/org.eclipse.e4.tools.css.spy/src/org/eclipse/e4/tools/css/spy/CssSpyPart.java
@@ -97,26 +97,21 @@ import org.w3c.dom.css.CSSStyleDeclaration;
import org.w3c.dom.css.CSSValue;
@SuppressWarnings("restriction")
-public class CssSpyPart
-{
+public class CssSpyPart {
@Inject
@Named(IServiceConstants.ACTIVE_SHELL)
private Shell activeShell;
-
-
- /** @return the CSS element corresponding to the argument, or null if none */
- public static CSSStylableElement getCSSElement(Object o)
- {
- if (o instanceof CSSStylableElement)
- {
+ /**
+ * @return the CSS element corresponding to the argument, or null if none
+ */
+ public static CSSStylableElement getCSSElement(Object o) {
+ if (o instanceof CSSStylableElement) {
return (CSSStylableElement) o;
- } else
- {
+ } else {
CSSEngine engine = getCSSEngine(o);
- if (engine != null)
- {
+ if (engine != null) {
return (CSSStylableElement) engine.getElement(o);
}
}
@@ -124,24 +119,19 @@ public class CssSpyPart
}
/** @return the CSS engine governing the argument, or null if none */
- public static CSSEngine getCSSEngine(Object o)
- {
+ public static CSSEngine getCSSEngine(Object o) {
CSSEngine engine = null;
- if (o instanceof CSSStylableElement)
- {
+ if (o instanceof CSSStylableElement) {
CSSStylableElement element = (CSSStylableElement) o;
engine = WidgetElement.getEngine((Widget) element.getNativeWidget());
}
- if (engine == null && o instanceof Widget)
- {
- if (((Widget) o).isDisposed())
- {
+ if (engine == null && o instanceof Widget) {
+ if (((Widget) o).isDisposed()) {
return null;
}
engine = WidgetElement.getEngine((Widget) o);
}
- if (engine == null && Display.getCurrent() != null)
- {
+ if (engine == null && Display.getCurrent() != null) {
engine = new CSSSWTEngineImpl(Display.getCurrent());
}
return engine;
@@ -169,75 +159,60 @@ public class CssSpyPart
private Button showUnsetProperties;
private Button showCssFragment;
- protected ViewerFilter unsetPropertyFilter = new ViewerFilter()
- {
+ protected ViewerFilter unsetPropertyFilter = new ViewerFilter() {
- @Override
- public boolean select(Viewer viewer, Object parentElement, Object element)
- {
- if (element instanceof CSSPropertyProvider)
- {
- try
- {
- return ((CSSPropertyProvider) element).getValue() != null;
- } catch (Exception e)
- {
- return false;
- }
+ @Override
+ public boolean select(Viewer viewer, Object parentElement, Object element) {
+ if (element instanceof CSSPropertyProvider) {
+ try {
+ return ((CSSPropertyProvider) element).getValue() != null;
+ } catch (Exception e) {
+ return false;
}
- return false;
}
- };
+ return false;
+ }
+ };
private Composite outer;
- public Widget getSpecimen()
- {
+ public Widget getSpecimen() {
return specimen;
}
- private boolean isLive()
- {
+ private boolean isLive() {
return specimen == null;
}
- public void setSpecimen(Widget specimen)
- {
+ public void setSpecimen(Widget specimen) {
this.specimen = specimen;
update();
}
- private Widget getActiveSpecimen()
- {
- if (specimen != null)
- {
+ private Widget getActiveSpecimen() {
+ if (specimen != null) {
return specimen;
}
return display.getCursorControl();
}
- protected boolean shouldDismissOnLostFocus()
- {
+ protected boolean shouldDismissOnLostFocus() {
return false;
}
- protected void update()
- {
- if (activeShell == null)
- {
+ protected void update() {
+ if (activeShell == null) {
return;
}
Widget current = getActiveSpecimen();
- if (shown == current)
- {
+ if (shown == current) {
return;
}
shown = current;
CSSEngine engine = getCSSEngine(shown);
CSSStylableElement element = (CSSStylableElement) engine.getElement(shown);
- if (element == null)
- {
+ if (element == null) {
return;
}
@@ -245,60 +220,48 @@ public class CssSpyPart
revealAndSelect(Collections.singletonList(shown));
}
- private <T> void revealAndSelect(List<T> elements)
- {
+ private <T> void revealAndSelect(List<T> elements) {
widgetTreeViewer.setSelection(new StructuredSelection(elements), true);
}
- private void updateForWidgetSelection(ISelection sel)
- {
+ private void updateForWidgetSelection(ISelection sel) {
disposeHighlights();
- if (sel.isEmpty())
- {
+ if (sel.isEmpty()) {
return;
}
StructuredSelection selection = (StructuredSelection) sel;
- for (Object s : selection.toList())
- {
- if (s instanceof Widget)
- {
+ for (Object s : selection.toList()) {
+ if (s instanceof Widget) {
highlightWidget((Widget) s);
}
}
- populate(selection.size() == 1 && selection.getFirstElement() instanceof Widget ? (Widget) selection.getFirstElement()
- : null);
+ populate(selection.size() == 1 && selection.getFirstElement() instanceof Widget
+ ? (Widget) selection.getFirstElement() : null);
}
- private void updateWidgetTreeInput()
- {
- if (showAllShells.getSelection())
- {
+ private void updateWidgetTreeInput() {
+ if (showAllShells.getSelection()) {
widgetTreeViewer.setInput(display);
- } else
- {
+ } else {
widgetTreeViewer.setInput(new Object[] { shown instanceof Control ? ((Control) shown).getShell() : shown });
}
performCSSSearch(new NullProgressMonitor());
}
- protected void populate(Widget selected)
- {
- if (selected == null)
- {
+ protected void populate(Widget selected) {
+ if (selected == null) {
cssPropertiesViewer.setInput(null);
cssRules.setText("");
return;
}
- if (selected.isDisposed())
- {
+ if (selected.isDisposed()) {
cssPropertiesViewer.setInput(null);
cssRules.setText("*DISPOSED*");
return;
}
CSSStylableElement element = getCSSElement(selected);
- if (element == null)
- {
+ if (element == null) {
cssPropertiesViewer.setInput(null);
cssRules.setText("Not a stylable element");
return;
@@ -310,40 +273,32 @@ public class CssSpyPart
CSSEngine engine = getCSSEngine(element);
CSSStyleDeclaration decl = engine.getViewCSS().getComputedStyle(element, null);
- if (element.getCSSStyle() != null)
- {
+ if (element.getCSSStyle() != null) {
sb.append("\nCSS Inline Style(s):\n ");
Activator.join(sb, element.getCSSStyle().split(";"), ";\n ");
}
- if (decl != null)
- {
+ if (decl != null) {
sb.append("\n\nCSS Properties:\n");
- try
- {
- if (decl != null)
- {
+ try {
+ if (decl != null) {
sb.append(decl.getCssText());
}
- } catch (Exception e)
- {
+ } catch (Exception e) {
sb.append(e);
}
}
- if (element.getStaticPseudoInstances().length > 0)
- {
+ if (element.getStaticPseudoInstances().length > 0) {
sb.append("\n\nStatic Pseudoinstances:\n ");
Activator.join(sb, element.getStaticPseudoInstances(), "\n ");
}
- if (element.getCSSClass() != null)
- {
+ if (element.getCSSClass() != null) {
sb.append("\n\nCSS Classes:\n ");
Activator.join(sb, element.getCSSClass().split(" +"), "\n ");
}
- if (element.getAttribute("style") != null)
- {
+ if (element.getAttribute("style") != null) {
sb.append("\n\nSWT Style Bits:\n ");
Activator.join(sb, element.getAttribute("style").split(" +"), "\n ");
}
@@ -351,37 +306,31 @@ public class CssSpyPart
sb.append("\n\nCSS Class Element:\n ").append(element.getClass().getName());
// this is useful for diagnosing issues
- if (element.getNativeWidget() instanceof Shell && ((Shell) element.getNativeWidget()).getParent() != null)
- {
+ if (element.getNativeWidget() instanceof Shell && ((Shell) element.getNativeWidget()).getParent() != null) {
Shell nw = (Shell) element.getNativeWidget();
sb.append("\n\nShell parent: ").append(nw.getParent());
}
- if (element.getNativeWidget() instanceof Composite)
- {
+ if (element.getNativeWidget() instanceof Composite) {
Composite nw = (Composite) element.getNativeWidget();
sb.append("\n\nSWT Layout: ").append(nw.getLayout());
}
Rectangle bounds = getBounds(selected);
- if (bounds != null)
- {
+ if (bounds != null) {
sb.append("\nBounds: x=").append(bounds.x).append(" y=").append(bounds.y);
sb.append(" h=").append(bounds.height).append(" w=").append(bounds.width);
}
- if (element.getNativeWidget() instanceof Widget)
- {
+ if (element.getNativeWidget() instanceof Widget) {
Widget w = (Widget) element.getNativeWidget();
- if (w.getData() != null)
- {
+ if (w.getData() != null) {
sb.append("\nWidget data: ").append(w.getData());
}
- if (w.getData(SWT.SKIN_ID) != null)
- {
+ if (w.getData(SWT.SKIN_ID) != null) {
sb.append("\nWidget Skin ID (").append(SWT.SKIN_ID).append("): ").append(w.getData(SWT.SKIN_ID));
}
- if (w.getData(SWT.SKIN_CLASS) != null)
- {
- sb.append("\nWidget Skin Class (").append(SWT.SKIN_CLASS).append("): ").append(w.getData(SWT.SKIN_CLASS));
+ if (w.getData(SWT.SKIN_CLASS) != null) {
+ sb.append("\nWidget Skin Class (").append(SWT.SKIN_CLASS).append("): ")
+ .append(w.getData(SWT.SKIN_CLASS));
}
}
@@ -391,27 +340,22 @@ public class CssSpyPart
highlightWidget(selected);
}
- private Shell getShell(Widget widget)
- {
- if (widget instanceof Control)
- {
+ private Shell getShell(Widget widget) {
+ if (widget instanceof Control) {
return ((Control) widget).getShell();
}
return null;
}
/** Add a highlight-rectangle for the selected widget */
- private void highlightWidget(Widget selected)
- {
- if (selected == null || selected.isDisposed())
- {
+ private void highlightWidget(Widget selected) {
+ if (selected == null || selected.isDisposed()) {
return;
}
Rectangle bounds = getBounds(selected); // relative to absolute display,
// not the widget
- if (bounds == null /* || bounds.height == 0 || bounds.width == 0 */)
- {
+ if (bounds == null /* || bounds.height == 0 || bounds.width == 0 */) {
return;
}
// emulate a transparent background as per SWT Snippet180
@@ -434,38 +378,30 @@ public class CssSpyPart
highlightRegions.add(highlightRegion);
}
- private void disposeHighlights()
- {
- for (Shell highlight : highlights)
- {
+ private void disposeHighlights() {
+ for (Shell highlight : highlights) {
highlight.dispose();
}
highlights.clear();
- for (Region region : highlightRegions)
- {
+ for (Region region : highlightRegions) {
region.dispose();
}
highlightRegions.clear();
}
- private Rectangle getBounds(Widget widget)
- {
- if (widget instanceof Shell)
- {
+ private Rectangle getBounds(Widget widget) {
+ if (widget instanceof Shell) {
// Shell bounds are already in display coordinates
return ((Shell) widget).getBounds();
- } else if (widget instanceof Control)
- {
+ } else if (widget instanceof Control) {
Control control = (Control) widget;
Rectangle bounds = control.getBounds();
return control.getDisplay().map(control.getParent(), null, bounds);
- } else if (widget instanceof ToolItem)
- {
+ } else if (widget instanceof ToolItem) {
ToolItem item = (ToolItem) widget;
Rectangle bounds = item.getBounds();
return item.getDisplay().map(item.getParent(), null, bounds);
- } else if (widget instanceof CTabItem)
- {
+ } else if (widget instanceof CTabItem) {
CTabItem item = (CTabItem) widget;
Rectangle bounds = item.getBounds();
return item.getDisplay().map(item.getParent(), null, bounds);
@@ -480,8 +416,7 @@ public class CssSpyPart
* @param parent
*/
@PostConstruct
- protected Control createDialogArea(Composite parent, IEclipseContext ctx)
- {
+ protected Control createDialogArea(Composite parent, IEclipseContext ctx) {
outer = parent;
outer.setLayout(new GridLayout());
outer.setLayoutData(new GridData(GridData.FILL_BOTH));
@@ -515,64 +450,54 @@ public class CssSpyPart
TreeViewerColumn widgetTypeColumn = new TreeViewerColumn(widgetTreeViewer, SWT.NONE);
widgetTypeColumn.getColumn().setWidth(100);
widgetTypeColumn.getColumn().setText("Widget");
- widgetTypeColumn.setLabelProvider(new ColumnLabelProvider()
- {
- @Override
- public String getText(Object item)
- {
- CSSStylableElement element = CssSpyPart.getCSSElement(item);
- return element.getLocalName() + " (" + element.getNamespaceURI() + ")";
- }
- });
+ widgetTypeColumn.setLabelProvider(new ColumnLabelProvider() {
+ @Override
+ public String getText(Object item) {
+ CSSStylableElement element = CssSpyPart.getCSSElement(item);
+ return element.getLocalName() + " (" + element.getNamespaceURI() + ")";
+ }
+ });
TreeViewerColumn widgetClassColumn = new TreeViewerColumn(widgetTreeViewer, SWT.NONE);
widgetClassColumn.getColumn().setText("CSS Class");
widgetClassColumn.getColumn().setWidth(100);
- widgetClassColumn.setLabelProvider(new ColumnLabelProvider()
- {
- @Override
- public String getText(Object item)
- {
- CSSStylableElement element = CssSpyPart.getCSSElement(item);
- if (element.getCSSClass() == null)
- {
- return null;
- }
- String classes[] = element.getCSSClass().split(" +");
- return classes.length <= 1 ? classes[0] : classes[0] + " (+" + (classes.length - 1) + " others)";
+ widgetClassColumn.setLabelProvider(new ColumnLabelProvider() {
+ @Override
+ public String getText(Object item) {
+ CSSStylableElement element = CssSpyPart.getCSSElement(item);
+ if (element.getCSSClass() == null) {
+ return null;
}
+ String classes[] = element.getCSSClass().split(" +");
+ return classes.length <= 1 ? classes[0] : classes[0] + " (+" + (classes.length - 1) + " others)";
+ }
- @Override
- public String getToolTipText(Object item)
- {
- CSSStylableElement element = CssSpyPart.getCSSElement(item);
- if (element == null)
- {
- return null;
- }
- StringBuilder sb = new StringBuilder();
- sb.append(element.getLocalName()).append(" (").append(element.getNamespaceURI()).append(")");
- if (element.getCSSClass() != null)
- {
- sb.append("\nClasses:\n ");
- Activator.join(sb, element.getCSSClass().split(" +"), "\n ");
- }
- return sb.toString();
+ @Override
+ public String getToolTipText(Object item) {
+ CSSStylableElement element = CssSpyPart.getCSSElement(item);
+ if (element == null) {
+ return null;
}
- });
+ StringBuilder sb = new StringBuilder();
+ sb.append(element.getLocalName()).append(" (").append(element.getNamespaceURI()).append(")");
+ if (element.getCSSClass() != null) {
+ sb.append("\nClasses:\n ");
+ Activator.join(sb, element.getCSSClass().split(" +"), "\n ");
+ }
+ return sb.toString();
+ }
+ });
TreeViewerColumn widgetIdColumn = new TreeViewerColumn(widgetTreeViewer, SWT.NONE);
widgetIdColumn.getColumn().setWidth(100);
widgetIdColumn.getColumn().setText("CSS Id");
- widgetIdColumn.setLabelProvider(new ColumnLabelProvider()
- {
- @Override
- public String getText(Object item)
- {
- CSSStylableElement element = CssSpyPart.getCSSElement(item);
- return element.getCSSId();
- }
- });
+ widgetIdColumn.setLabelProvider(new ColumnLabelProvider() {
+ @Override
+ public String getText(Object item) {
+ CSSStylableElement element = CssSpyPart.getCSSElement(item);
+ return element.getCSSId();
+ }
+ });
TreeColumnLayout widgetsTableLayout = new TreeColumnLayout();
widgetsTableLayout.setColumnData(widgetTypeColumn.getColumn(), new ColumnWeightData(50));
@@ -598,96 +523,83 @@ public class CssSpyPart
gridData.minimumHeight = 50;
propsComposite.setLayoutData(gridData);
- cssPropertiesViewer = new TableViewer(propsComposite, SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL | SWT.FULL_SELECTION);
+ cssPropertiesViewer = new TableViewer(propsComposite,
+ SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL | SWT.FULL_SELECTION);
cssPropertiesViewer.setContentProvider(new CSSPropertiesContentProvider());
cssPropertiesViewer.getTable().setLinesVisible(true);
cssPropertiesViewer.getTable().setHeaderVisible(true);
cssPropertiesViewer.setComparator(new ViewerComparator());
final TextCellEditor textCellEditor = new TextCellEditor(cssPropertiesViewer.getTable());
- TableViewerEditor.create(cssPropertiesViewer, new TableViewerFocusCellManager(cssPropertiesViewer,
- new FocusCellOwnerDrawHighlighter(cssPropertiesViewer)), new ColumnViewerEditorActivationStrategy(
- cssPropertiesViewer), ColumnViewerEditor.TABBING_HORIZONTAL | ColumnViewerEditor.TABBING_MOVE_TO_ROW_NEIGHBOR
- | ColumnViewerEditor.TABBING_VERTICAL | ColumnViewerEditor.KEYBOARD_ACTIVATION);
+ TableViewerEditor.create(cssPropertiesViewer,
+ new TableViewerFocusCellManager(cssPropertiesViewer,
+ new FocusCellOwnerDrawHighlighter(cssPropertiesViewer)),
+ new ColumnViewerEditorActivationStrategy(cssPropertiesViewer),
+ ColumnViewerEditor.TABBING_HORIZONTAL | ColumnViewerEditor.TABBING_MOVE_TO_ROW_NEIGHBOR
+ | ColumnViewerEditor.TABBING_VERTICAL | ColumnViewerEditor.KEYBOARD_ACTIVATION);
TableViewerColumn propName = new TableViewerColumn(cssPropertiesViewer, SWT.NONE);
propName.getColumn().setWidth(100);
propName.getColumn().setText("Property");
- propName.setLabelProvider(new ColumnLabelProvider()
- {
- @Override
- public String getText(Object element)
- {
- return ((CSSPropertyProvider) element).getPropertyName();
- }
- });
+ propName.setLabelProvider(new ColumnLabelProvider() {
+ @Override
+ public String getText(Object element) {
+ return ((CSSPropertyProvider) element).getPropertyName();
+ }
+ });
TableViewerColumn propValue = new TableViewerColumn(cssPropertiesViewer, SWT.NONE);
propValue.getColumn().setWidth(100);
propValue.getColumn().setText("Value");
- propValue.setLabelProvider(new ColumnLabelProvider()
- {
- @Override
- public String getText(Object element)
- {
- try
- {
- return ((CSSPropertyProvider) element).getValue();
- } catch (Exception e)
- {
- System.err.println("Error fetching property: " + element + ": " + e);
- return null;
- }
- }
- });
- propValue.setEditingSupport(new EditingSupport(cssPropertiesViewer)
- {
- @Override
- protected CellEditor getCellEditor(Object element)
- {
- // do the fancy footwork here to return an appropriate
- // editor to
- // the value-type
- return textCellEditor;
+ propValue.setLabelProvider(new ColumnLabelProvider() {
+ @Override
+ public String getText(Object element) {
+ try {
+ return ((CSSPropertyProvider) element).getValue();
+ } catch (Exception e) {
+ System.err.println("Error fetching property: " + element + ": " + e);
+ return null;
}
+ }
+ });
+ propValue.setEditingSupport(new EditingSupport(cssPropertiesViewer) {
+ @Override
+ protected CellEditor getCellEditor(Object element) {
+ // do the fancy footwork here to return an appropriate
+ // editor to
+ // the value-type
+ return textCellEditor;
+ }
- @Override
- protected boolean canEdit(Object element)
- {
- return true;
- }
+ @Override
+ protected boolean canEdit(Object element) {
+ return true;
+ }
- @Override
- protected Object getValue(Object element)
- {
- try
- {
- String value = ((CSSPropertyProvider) element).getValue();
- return value == null ? "" : value;
- } catch (Exception e)
- {
- return "";
- }
+ @Override
+ protected Object getValue(Object element) {
+ try {
+ String value = ((CSSPropertyProvider) element).getValue();
+ return value == null ? "" : value;
+ } catch (Exception e) {
+ return "";
}
+ }
- @Override
- protected void setValue(Object element, Object value)
- {
- try
- {
- if (value == null || ((String) value).trim().length() == 0)
- {
- return;
- }
- CSSPropertyProvider provider = (CSSPropertyProvider) element;
- provider.setValue((String) value);
- } catch (Exception e)
- {
- MessageDialog.openError(activeShell, "Error", "Unable to set property:\n\n" + e.getMessage());
+ @Override
+ protected void setValue(Object element, Object value) {
+ try {
+ if (value == null || ((String) value).trim().length() == 0) {
+ return;
}
- cssPropertiesViewer.update(element, null);
+ CSSPropertyProvider provider = (CSSPropertyProvider) element;
+ provider.setValue((String) value);
+ } catch (Exception e) {
+ MessageDialog.openError(activeShell, "Error", "Unable to set property:\n\n" + e.getMessage());
}
- });
+ cssPropertiesViewer.update(element, null);
+ }
+ });
TableColumnLayout propsTableLayout = new TableColumnLayout();
propsTableLayout.setColumnData(propName.getColumn(), new ColumnWeightData(50));
@@ -710,75 +622,58 @@ public class CssSpyPart
// / The listeners
- cssSearchBox.addModifyListener(new ModifyListener()
- {
- private Runnable updater;
- private IProgressMonitor monitor;
+ cssSearchBox.addModifyListener(new ModifyListener() {
+ private Runnable updater;
+ private IProgressMonitor monitor;
- @Override
- public void modifyText(ModifyEvent e)
- {
- if (monitor != null)
- {
- monitor.setCanceled(false);
- }
- display.timerExec(200, updater = new Runnable()
- {
- @Override
- public void run()
- {
- if (updater == this)
- {
- performCSSSearch(monitor = new NullProgressMonitor());
- }
- }
- });
+ @Override
+ public void modifyText(ModifyEvent e) {
+ if (monitor != null) {
+ monitor.setCanceled(false);
}
- });
- cssSearchBox.addKeyListener(new KeyAdapter()
- {
- @Override
- public void keyPressed(KeyEvent e)
- {
- if (e.keyCode == SWT.ARROW_DOWN && (e.stateMask & SWT.MODIFIER_MASK) == 0)
- {
- widgetTreeViewer.getControl().setFocus();
+ display.timerExec(200, updater = new Runnable() {
+ @Override
+ public void run() {
+ if (updater == this) {
+ performCSSSearch(monitor = new NullProgressMonitor());
+ }
}
+ });
+ }
+ });
+ cssSearchBox.addKeyListener(new KeyAdapter() {
+ @Override
+ public void keyPressed(KeyEvent e) {
+ if (e.keyCode == SWT.ARROW_DOWN && (e.stateMask & SWT.MODIFIER_MASK) == 0) {
+ widgetTreeViewer.getControl().setFocus();
}
- });
+ }
+ });
- widgetTreeViewer.addSelectionChangedListener(new ISelectionChangedListener()
- {
+ widgetTreeViewer.addSelectionChangedListener(new ISelectionChangedListener() {
+ @Override
+ public void selectionChanged(SelectionChangedEvent event) {
+ updateForWidgetSelection(event.getSelection());
+ showCssFragment.setEnabled(!event.getSelection().isEmpty());
+ }
+ });
+ if (isLive()) {
+ container.addMouseMoveListener(new MouseMoveListener() {
@Override
- public void selectionChanged(SelectionChangedEvent event)
- {
- updateForWidgetSelection(event.getSelection());
- showCssFragment.setEnabled(!event.getSelection().isEmpty());
+ public void mouseMove(MouseEvent e) {
+ update();
}
});
- if (isLive())
- {
- container.addMouseMoveListener(new MouseMoveListener()
- {
- @Override
- public void mouseMove(MouseEvent e)
- {
- update();
- }
- });
}
- if (shouldDismissOnLostFocus())
- {
- container.addFocusListener(new FocusAdapter()
- {
- @Override
- public void focusLost(FocusEvent e)
- {
- // setReturnCode(Window.OK);
- // close();
- }
- });
+ if (shouldDismissOnLostFocus()) {
+ container.addFocusListener(new FocusAdapter() {
+ @Override
+ public void focusLost(FocusEvent e) {
+ // setReturnCode(Window.OK);
+ // close();
+ }
+ });
}
/*
* container.addKeyListener(new KeyAdapter() {
@@ -787,54 +682,43 @@ public class CssSpyPart
* SWT.ESC) { cancelPressed(); } else if (e.character == SWT.CR |
* e.character == SWT.LF) { okPressed(); } } });
*/
- showAllShells.addSelectionListener(new SelectionAdapter()
- {
- @Override
- public void widgetSelected(SelectionEvent e)
- {
- updateWidgetTreeInput();
- }
- });
+ showAllShells.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ updateWidgetTreeInput();
+ }
+ });
- outer.addDisposeListener(new DisposeListener()
- {
- @Override
- public void widgetDisposed(DisposeEvent e)
- {
- dispose();
- }
- });
+ outer.addDisposeListener(new DisposeListener() {
+ @Override
+ public void widgetDisposed(DisposeEvent e) {
+ dispose();
+ }
+ });
showUnsetProperties.setSelection(true);
- showUnsetProperties.addSelectionListener(new SelectionAdapter()
- {
- @Override
- public void widgetSelected(SelectionEvent e)
- {
- if (showUnsetProperties.getSelection())
- {
- cssPropertiesViewer.removeFilter(unsetPropertyFilter);
- } else
- {
- cssPropertiesViewer.addFilter(unsetPropertyFilter);
- }
+ showUnsetProperties.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ if (showUnsetProperties.getSelection()) {
+ cssPropertiesViewer.removeFilter(unsetPropertyFilter);
+ } else {
+ cssPropertiesViewer.addFilter(unsetPropertyFilter);
}
- });
+ }
+ });
- showCssFragment.addSelectionListener(new SelectionAdapter()
- {
- @Override
- public void widgetSelected(SelectionEvent e)
- {
- showCssFragment();
- }
+ showCssFragment.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ showCssFragment();
+ }
- @Override
- public void widgetDefaultSelected(SelectionEvent e)
- {
- widgetSelected(e);
- }
- });
+ @Override
+ public void widgetDefaultSelected(SelectionEvent e) {
+ widgetSelected(e);
+ }
+ });
/*
* if ((specimen != null) && !specimen.isDisposed()) { // Reopen this
@@ -856,13 +740,13 @@ public class CssSpyPart
return outer;
}
- /** This method listen to current part and adapt the contents of spy part. */
+ /**
+ * This method listen to current part and adapt the contents of spy part.
+ */
@Inject
protected void reactOnActivate(@Named(IServiceConstants.ACTIVE_PART) MPart p, MPart cssPart,
- @Named(IServiceConstants.ACTIVE_SHELL) Shell s)
- {
- if (outer == null)
- {
+ @Named(IServiceConstants.ACTIVE_SHELL) Shell s) {
+ if (outer == null) {
// Do nothing if no UI created.
return;
}
@@ -874,36 +758,29 @@ public class CssSpyPart
Shell controlShell = (control == null) ? display.getActiveShell() : control.getShell();
Shell spyPartShell = outer.getShell();
- if (p != cssPart)
- {
+ if (p != cssPart) {
// Must remove the highlights if selected
disposeHighlights();
- } else if (spyPartShell != controlShell)
- {
+ } else if (spyPartShell != controlShell) {
// A widget has been selected in another shell.. We can display the
// corresponding control as a specimen
shown = null;
setSpecimen(control);
}
-
}
- protected void showCssFragment()
- {
- if (!(widgetTreeViewer.getSelection() instanceof IStructuredSelection) || widgetTreeViewer.getSelection().isEmpty())
- {
+ protected void showCssFragment() {
+ if (!(widgetTreeViewer.getSelection() instanceof IStructuredSelection)
+ || widgetTreeViewer.getSelection().isEmpty()) {
return;
}
StringBuilder sb = new StringBuilder();
- for (Object o : ((IStructuredSelection) widgetTreeViewer.getSelection()).toArray())
- {
- if (o instanceof Widget)
- {
- if (sb.length() > 0)
- {
+ for (Object o : ((IStructuredSelection) widgetTreeViewer.getSelection()).toArray()) {
+ if (o instanceof Widget) {
+ if (sb.length() > 0) {
sb.append('\n');
}
addCssFragment((Widget) o, sb);
@@ -914,17 +791,14 @@ public class CssSpyPart
tpd.open();
}
- private void addCssFragment(Widget w, StringBuilder sb)
- {
+ private void addCssFragment(Widget w, StringBuilder sb) {
CSSStylableElement element = getCSSElement(w);
- if (element == null)
- {
+ if (element == null) {
return;
}
sb.append(element.getLocalName());
- if (element.getCSSId() != null)
- {
+ if (element.getCSSId() != null) {
sb.append("#").append(element.getCSSId());
}
sb.append(" {");
@@ -939,32 +813,26 @@ public class CssSpyPart
int count = 0;
// First list the generated properties
- for (Iterator<String> iter = propertyNames.iterator(); iter.hasNext();)
- {
+ for (Iterator<String> iter = propertyNames.iterator(); iter.hasNext();) {
String propertyName = iter.next();
String genValue = trim(engine.retrieveCSSProperty(element, propertyName, ""));
String declValue = null;
- if (genValue == null)
- {
+ if (genValue == null) {
continue;
}
- if (decl != null)
- {
+ if (decl != null) {
CSSValue cssValue = decl.getPropertyCSSValue(propertyName);
- if (cssValue != null)
- {
+ if (cssValue != null) {
declValue = trim(cssValue.getCssText());
}
}
- if (count == 0)
- {
+ if (count == 0) {
sb.append("\n /* actual values */");
}
sb.append("\n ").append(propertyName).append(": ").append(genValue).append(";");
- if (declValue != null)
- {
+ if (declValue != null) {
sb.append("\t/* declared in CSS: ").append(declValue).append(" */");
}
count++;
@@ -973,23 +841,18 @@ public class CssSpyPart
// then list any declared properties; generated properties already
// removed
- if (decl != null)
- {
+ if (decl != null) {
int declCount = 0;
- for (String propertyName : propertyNames)
- {
+ for (String propertyName : propertyNames) {
String declValue = null;
CSSValue cssValue = decl.getPropertyCSSValue(propertyName);
- if (cssValue != null)
- {
+ if (cssValue != null) {
declValue = trim(cssValue.getCssText());
}
- if (declValue == null)
- {
+ if (declValue == null) {
continue;
}
- if (declCount == 0)
- {
+ if (declCount == 0) {
sb.append("\n\n /* declared in CSS rules */");
}
sb.append("\n ").append(propertyName).append(": ").append(declValue).append(";");
@@ -1001,101 +864,81 @@ public class CssSpyPart
}
/** Trim the string; return null if empty */
- private String trim(String s)
- {
- if (s == null)
- {
+ private String trim(String s) {
+ if (s == null) {
return null;
}
s = s.trim();
return s.length() > 0 ? s : null;
}
- protected void performCSSSearch(IProgressMonitor progress)
- {
+ protected void performCSSSearch(IProgressMonitor progress) {
List<Widget> widgets = new ArrayList<Widget>();
performCSSSearch(progress, cssSearchBox.getText(), widgets);
- if (!progress.isCanceled())
- {
+ if (!progress.isCanceled()) {
revealAndSelect(widgets);
}
}
- private void performCSSSearch(IProgressMonitor monitor, String text, Collection<Widget> results)
- {
- if (text.trim().length() == 0)
- {
+ private void performCSSSearch(IProgressMonitor monitor, String text, Collection<Widget> results) {
+ if (text.trim().length() == 0) {
return;
}
widgetTreeViewer.collapseAll();
Object[] roots = widgetTreeProvider.getElements(widgetTreeViewer.getInput());
monitor.beginTask("Searching for \"" + text + "\"", roots.length * 10);
- for (Object root : roots)
- {
- if (monitor.isCanceled())
- {
+ for (Object root : roots) {
+ if (monitor.isCanceled()) {
return;
}
CSSStylableElement element = getCSSElement(root);
- if (element == null)
- {
+ if (element == null) {
continue;
}
CSSEngine engine = getCSSEngine(root);
- try
- {
+ try {
SelectorList selectors = engine.parseSelectors(text);
monitor.worked(2);
processCSSSearch(new SubProgressMonitor(monitor, 8), engine, selectors, element, null, results);
- } catch (CSSParseException e)
- {
+ } catch (CSSParseException e) {
System.out.println(e.toString());
- } catch (IOException e)
- {
+ } catch (IOException e) {
System.out.println(e.toString());
}
}
monitor.done();
}
- private void processCSSSearch(IProgressMonitor monitor, CSSEngine engine, SelectorList selectors, CSSStylableElement element,
- String pseudo, Collection<Widget> results)
- {
- if (monitor.isCanceled())
- {
+ private void processCSSSearch(IProgressMonitor monitor, CSSEngine engine, SelectorList selectors,
+ CSSStylableElement element, String pseudo, Collection<Widget> results) {
+ if (monitor.isCanceled()) {
return;
}
NodeList children = element.getChildNodes();
monitor.beginTask("Searching", 5 + 5 * children.getLength());
boolean matched = false;
- for (int i = 0; i < selectors.getLength(); i++)
- {
- if (matched = engine.matches(selectors.item(i), element, pseudo))
- {
+ for (int i = 0; i < selectors.getLength(); i++) {
+ if (matched = engine.matches(selectors.item(i), element, pseudo)) {
break;
}
}
- if (matched)
- {
+ if (matched) {
results.add((Widget) element.getNativeWidget());
}
monitor.worked(5);
- for (int i = 0; i < children.getLength(); i++)
- {
- if (monitor.isCanceled())
- {
+ for (int i = 0; i < children.getLength(); i++) {
+ if (monitor.isCanceled()) {
return;
}
- processCSSSearch(new SubProgressMonitor(monitor, 5), engine, selectors, (CSSStylableElement) children.item(i), pseudo,
- results);
+ processCSSSearch(new SubProgressMonitor(monitor, 5), engine, selectors,
+ (CSSStylableElement) children.item(i), pseudo, results);
}
monitor.done();
}
- protected void dispose()
- {
+ protected void dispose() {
disposeHighlights();
}
diff --git a/bundles/org.eclipse.e4.tools.css.spy/src/org/eclipse/e4/tools/css/spy/TextPopupDialog.java b/bundles/org.eclipse.e4.tools.css.spy/src/org/eclipse/e4/tools/css/spy/TextPopupDialog.java
index 7f693e7f..32174c38 100644
--- a/bundles/org.eclipse.e4.tools.css.spy/src/org/eclipse/e4/tools/css/spy/TextPopupDialog.java
+++ b/bundles/org.eclipse.e4.tools.css.spy/src/org/eclipse/e4/tools/css/spy/TextPopupDialog.java
@@ -12,8 +12,7 @@ public class TextPopupDialog extends PopupDialog {
private String content;
private boolean contentEditable;
- public TextPopupDialog(Shell shell, String title, String content, boolean editable,
- String infoText) {
+ public TextPopupDialog(Shell shell, String title, String content, boolean editable, String infoText) {
super(shell, SWT.RESIZE | SWT.ON_TOP, true, true, true, false, false, title, infoText);
this.content = content;
this.contentEditable = editable;
@@ -23,13 +22,12 @@ public class TextPopupDialog extends PopupDialog {
protected Control createDialogArea(Composite parent) {
Composite container = (Composite) super.createDialogArea(parent);
int styleBits = SWT.MULTI | SWT.WRAP | SWT.H_SCROLL | SWT.V_SCROLL;
- if(!contentEditable) {
+ if (!contentEditable) {
styleBits |= SWT.READ_ONLY;
}
Text textWidget = new Text(container, styleBits);
textWidget.setText(content);
return container;
}
-
-
+
}
diff --git a/bundles/org.eclipse.e4.tools.css.spy/src/org/eclipse/e4/tools/css/spy/WidgetTreeProvider.java b/bundles/org.eclipse.e4.tools.css.spy/src/org/eclipse/e4/tools/css/spy/WidgetTreeProvider.java
index cf08a8cc..06c03ae0 100644
--- a/bundles/org.eclipse.e4.tools.css.spy/src/org/eclipse/e4/tools/css/spy/WidgetTreeProvider.java
+++ b/bundles/org.eclipse.e4.tools.css.spy/src/org/eclipse/e4/tools/css/spy/WidgetTreeProvider.java
@@ -25,24 +25,23 @@ import org.eclipse.swt.widgets.ToolItem;
import org.w3c.dom.NodeList;
public class WidgetTreeProvider implements ITreeContentProvider {
- private static final Object[] EMPTY_ARRAY = new Object[0];
+ private static final Object[] EMPTY_ARRAY = new Object[0];
- @Override
+ @Override
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- }
+ }
- @Override
+ @Override
public Object[] getElements(Object inputElement) {
- if (inputElement instanceof Object[]) {
- return (Object[]) inputElement;
- } else if (inputElement instanceof Collection< ? >) {
- return ((Collection< ? >) inputElement).toArray();
- }
- return getChildren(inputElement);
- }
-
+ if (inputElement instanceof Object[]) {
+ return (Object[]) inputElement;
+ } else if (inputElement instanceof Collection<?>) {
+ return ((Collection<?>) inputElement).toArray();
+ }
+ return getChildren(inputElement);
+ }
- @Override
+ @Override
public Object[] getChildren(Object parentElement) {
if (parentElement instanceof Display) {
List<Shell> shells = new ArrayList<Shell>();
@@ -54,18 +53,18 @@ public class WidgetTreeProvider implements ITreeContentProvider {
return shells.toArray();
}
CSSStylableElement element = CssSpyPart.getCSSElement(parentElement);
- if (element == null) {
+ if (element == null) {
return EMPTY_ARRAY;
- }
- NodeList kids = element.getChildNodes();
- ArrayList<Object> children = new ArrayList<Object>(kids.getLength());
- for (int i = 0; i < kids.getLength(); i++) {
+ }
+ NodeList kids = element.getChildNodes();
+ ArrayList<Object> children = new ArrayList<Object>(kids.getLength());
+ for (int i = 0; i < kids.getLength(); i++) {
children.add(((CSSStylableElement) kids.item(i)).getNativeWidget());
- }
- return children.toArray();
- }
+ }
+ return children.toArray();
+ }
- @Override
+ @Override
public Object getParent(Object element) {
if (element instanceof Control) {
Control control = (Control) element;
@@ -76,15 +75,15 @@ public class WidgetTreeProvider implements ITreeContentProvider {
return ((ToolItem) element).getParent();
}
return null;
- }
+ }
- @Override
+ @Override
public boolean hasChildren(Object element) {
- return getChildren(element).length > 0;
- }
+ return getChildren(element).length > 0;
+ }
- @Override
+ @Override
public void dispose() {
- }
+ }
}

Back to the top