diff options
Diffstat (limited to 'plugins/facet/org.eclipse.papyrus.emf.facet.common.ui')
23 files changed, 1543 insertions, 1543 deletions
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/.classpath b/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/.classpath index 2d1a4302f04..64c5e31b7a2 100644 --- a/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/.classpath +++ b/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/.classpath @@ -1,7 +1,7 @@ -<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
+<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/> + <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> + <classpathentry kind="src" path="src"/> + <classpathentry kind="output" path="bin"/> +</classpath> diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/.settings/org.eclipse.jdt.core.prefs b/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/.settings/org.eclipse.jdt.core.prefs index 4759947300a..c585cc455ae 100644 --- a/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/.settings/org.eclipse.jdt.core.prefs +++ b/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/.settings/org.eclipse.jdt.core.prefs @@ -1,291 +1,291 @@ -eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
-org.eclipse.jdt.core.compiler.compliance=1.5
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.5
-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=260
-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=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=false
-org.eclipse.jdt.core.formatter.join_wrapped_lines=false
-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=260
-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=5
-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
+eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 +org.eclipse.jdt.core.compiler.compliance=1.5 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.5 +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=260 +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=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=false +org.eclipse.jdt.core.formatter.join_wrapped_lines=false +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=260 +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=5 +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 diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/API.README.txt b/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/API.README.txt index b31caf7d2fb..117e2d34ed8 100644 --- a/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/API.README.txt +++ b/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/API.README.txt @@ -1,22 +1,22 @@ -/*******************************************************************************
- * Copyright (c) 2011 Mia-Software.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Nicolas Guyomar (Mia-Software) - Bug 339723 - Add x-friend on EMF Facet internal package
- * Gregoire Dupe (Mia-Software) - Bug 339710 - org.eclipse.papyrus.emf.facet.common.ui API Cleaning
- *******************************************************************************/
-
- org.eclipse.papyrus.emf.facet.common.ui.internal.controls
- x-internal:=used by org.eclipse.papyrus.emf.facet.infra.*. No x-friends because we don't care about the warning in the "infra" plug-ins.
-
- org.eclipse.papyrus.emf.facet.common.ui.internal.views
- x-friends:="org.eclipse.papyrus.emf.facet.util.emf.ui" for EMF Facet internal utilization
-
-org.eclipse.papyrus.emf.facet.common.ui.internal.widgets
- x-friends:="org.eclipse.papyrus.emf.facet.efacet.ui" for EMF Facet internal utilization
+/******************************************************************************* + * Copyright (c) 2011 Mia-Software. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Nicolas Guyomar (Mia-Software) - Bug 339723 - Add x-friend on EMF Facet internal package + * Gregoire Dupe (Mia-Software) - Bug 339710 - org.eclipse.papyrus.emf.facet.common.ui API Cleaning + *******************************************************************************/ + + org.eclipse.papyrus.emf.facet.common.ui.internal.controls + x-internal:=used by org.eclipse.papyrus.emf.facet.infra.*. No x-friends because we don't care about the warning in the "infra" plug-ins. + + org.eclipse.papyrus.emf.facet.common.ui.internal.views + x-friends:="org.eclipse.papyrus.emf.facet.util.emf.ui" for EMF Facet internal utilization + +org.eclipse.papyrus.emf.facet.common.ui.internal.widgets + x-friends:="org.eclipse.papyrus.emf.facet.efacet.ui" for EMF Facet internal utilization x-friends:="org.eclipse.papyrus.emf.facet.util.emf.ui" for EMF Facet internal utilization
\ No newline at end of file diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/OSGI-INF/l10n/bundle.properties b/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/OSGI-INF/l10n/bundle.properties index c465e665162..a033350c825 100644 --- a/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/OSGI-INF/l10n/bundle.properties +++ b/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/OSGI-INF/l10n/bundle.properties @@ -1,17 +1,17 @@ -###############################################################################
-# Copyright (c) 2011 Mia-Software.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Gregoire Dupe (Mia-Software) - Bug 366804 - [Restructuring] Table widget upgrade
-# Grégoire Dupé (Mia-Software) - Bug 388422 - [Table] Queries for InstanciationMethod needs to have 2 parameters
-###############################################################################
-#Properties file for org.eclipse.papyrus.emf.facet.common.ui
-page.name = EMF Facet
-Bundle-Vendor = Eclipse Modeling Project
-Bundle-Name = Papyrus EMF Facet Common UI
-category.name = EMF Facet
+############################################################################### +# Copyright (c) 2011 Mia-Software. +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Eclipse Public License v1.0 +# which accompanies this distribution, and is available at +# http://www.eclipse.org/legal/epl-v10.html +# +# Contributors: +# Gregoire Dupe (Mia-Software) - Bug 366804 - [Restructuring] Table widget upgrade +# Grégoire Dupé (Mia-Software) - Bug 388422 - [Table] Queries for InstanciationMethod needs to have 2 parameters +############################################################################### +#Properties file for org.eclipse.papyrus.emf.facet.common.ui +page.name = EMF Facet +Bundle-Vendor = Eclipse Modeling Project +Bundle-Name = Papyrus EMF Facet Common UI +category.name = EMF Facet emf.facet.examples = EMF Facet Examples
\ No newline at end of file diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/about.html b/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/about.html index d1714826b27..ac9323c1c04 100644 --- a/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/about.html +++ b/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/about.html @@ -1,28 +1,28 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
-<title>About</title>
-</head>
-<body lang="EN-US">
-<h2>About This Content</h2>
-
-<p>January 4, 2011</p>
-<h3>License</h3>
-
-<p>The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise
-indicated below, the Content is provided to you under the terms and conditions of the
-Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available
-at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
-For purposes of the EPL, "Program" will mean the Content.</p>
-
-<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
-being redistributed by another party ("Redistributor") and different terms and conditions may
-apply to your use of any object code in the Content. Check the Redistributor's license that was
-provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
-indicated below, the terms and conditions of the EPL still apply to any source code in the Content
-and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p>
-
-</body>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/> +<title>About</title> +</head> +<body lang="EN-US"> +<h2>About This Content</h2> + +<p>January 4, 2011</p> +<h3>License</h3> + +<p>The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise +indicated below, the Content is provided to you under the terms and conditions of the +Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available +at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>. +For purposes of the EPL, "Program" will mean the Content.</p> + +<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is +being redistributed by another party ("Redistributor") and different terms and conditions may +apply to your use of any object code in the Content. Check the Redistributor's license that was +provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise +indicated below, the terms and conditions of the EPL still apply to any source code in the Content +and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p> + +</body> </html>
\ No newline at end of file diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/build.properties b/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/build.properties index 39bc3dbc812..dd3e3114ee2 100644 --- a/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/build.properties +++ b/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/build.properties @@ -1,17 +1,17 @@ -###############################################################################
-# Copyright (c) 2011 Mia-Software.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Nicolas Guyomar (Mia-Software) - Bug 333652 Extension point offering the possibility to declare an EPackage browser
-###############################################################################
-source.. = src/
-output.. = bin/
-bin.includes = META-INF/,\
- .,\
- about.html,\
- OSGI-INF/
-src.includes = about.html
+############################################################################### +# Copyright (c) 2011 Mia-Software. +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Eclipse Public License v1.0 +# which accompanies this distribution, and is available at +# http://www.eclipse.org/legal/epl-v10.html +# +# Contributors: +# Nicolas Guyomar (Mia-Software) - Bug 333652 Extension point offering the possibility to declare an EPackage browser +############################################################################### +source.. = src/ +output.. = bin/ +bin.includes = META-INF/,\ + .,\ + about.html,\ + OSGI-INF/ +src.includes = about.html diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/src/org/eclipse/papyrus/emf/facet/common/ui/internal/Activator.java b/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/src/org/eclipse/papyrus/emf/facet/common/ui/internal/Activator.java index 18bf6ccddbc..a9c1c785156 100644 --- a/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/src/org/eclipse/papyrus/emf/facet/common/ui/internal/Activator.java +++ b/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/src/org/eclipse/papyrus/emf/facet/common/ui/internal/Activator.java @@ -1,53 +1,53 @@ -/**
- * Copyright (c) 2011 Mia-Software.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Nicolas Guyomar (Mia-Software) - Bug 333652 Extension point offering the possibility to declare an EPackage browser
- */
-package org.eclipse.papyrus.emf.facet.common.ui.internal;
-
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.osgi.framework.BundleContext;
-
-/**
- * The activator class controls the plug-in life cycle
- */
-public class Activator extends AbstractUIPlugin {
-
- public static final String PLUGIN_ID = "org.eclipse.papyrus.emf.facet.common.ui"; //$NON-NLS-1$
-
- private static Activator plugin;
-
- /**
- * The constructor
- */
- public Activator() {
- }
-
- @Override
- public void start(final BundleContext context) throws Exception {
- super.start(context);
- Activator.plugin = this;
- }
-
- @Override
- public void stop(final BundleContext context) throws Exception {
- Activator.plugin = null;
- super.stop(context);
- }
-
- /**
- * Returns the shared instance
- *
- * @return the shared instance
- */
- public static Activator getDefault() {
- return Activator.plugin;
- }
-
-}
+/** + * Copyright (c) 2011 Mia-Software. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Nicolas Guyomar (Mia-Software) - Bug 333652 Extension point offering the possibility to declare an EPackage browser + */ +package org.eclipse.papyrus.emf.facet.common.ui.internal; + +import org.eclipse.ui.plugin.AbstractUIPlugin; +import org.osgi.framework.BundleContext; + +/** + * The activator class controls the plug-in life cycle + */ +public class Activator extends AbstractUIPlugin { + + public static final String PLUGIN_ID = "org.eclipse.papyrus.emf.facet.common.ui"; //$NON-NLS-1$ + + private static Activator plugin; + + /** + * The constructor + */ + public Activator() { + } + + @Override + public void start(final BundleContext context) throws Exception { + super.start(context); + Activator.plugin = this; + } + + @Override + public void stop(final BundleContext context) throws Exception { + Activator.plugin = null; + super.stop(context); + } + + /** + * Returns the shared instance + * + * @return the shared instance + */ + public static Activator getDefault() { + return Activator.plugin; + } + +} diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/src/org/eclipse/papyrus/emf/facet/common/ui/internal/Messages.java b/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/src/org/eclipse/papyrus/emf/facet/common/ui/internal/Messages.java index 4cf3eb89dc8..fa34766d34c 100644 --- a/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/src/org/eclipse/papyrus/emf/facet/common/ui/internal/Messages.java +++ b/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/src/org/eclipse/papyrus/emf/facet/common/ui/internal/Messages.java @@ -1,25 +1,25 @@ -/*******************************************************************************
- * Copyright (c) 2012 CEA LIST.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Nicolas Bros (Mia-Software) - Bug 372732 - [Facet] Rewrite the catalog views for 0.2
- *******************************************************************************/
-package org.eclipse.papyrus.emf.facet.common.ui.internal;
-
-import org.eclipse.osgi.util.NLS;
-
-public class Messages extends NLS {
- private static final String BUNDLE_NAME = "org.eclipse.papyrus.emf.facet.common.ui.internal.messages"; //$NON-NLS-1$
- public static String ElementsView_refreshJobTitle;
- static {
- // initialize resource bundle
- NLS.initializeMessages(BUNDLE_NAME, Messages.class);
- }
-
- private Messages() {
- }
-}
+/******************************************************************************* + * Copyright (c) 2012 CEA LIST. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Nicolas Bros (Mia-Software) - Bug 372732 - [Facet] Rewrite the catalog views for 0.2 + *******************************************************************************/ +package org.eclipse.papyrus.emf.facet.common.ui.internal; + +import org.eclipse.osgi.util.NLS; + +public class Messages extends NLS { + private static final String BUNDLE_NAME = "org.eclipse.papyrus.emf.facet.common.ui.internal.messages"; //$NON-NLS-1$ + public static String ElementsView_refreshJobTitle; + static { + // initialize resource bundle + NLS.initializeMessages(BUNDLE_NAME, Messages.class); + } + + private Messages() { + } +} diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/src/org/eclipse/papyrus/emf/facet/common/ui/internal/controls/PersistableColumn.java b/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/src/org/eclipse/papyrus/emf/facet/common/ui/internal/controls/PersistableColumn.java index bc101a23d7f..6a5c19eddb6 100644 --- a/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/src/org/eclipse/papyrus/emf/facet/common/ui/internal/controls/PersistableColumn.java +++ b/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/src/org/eclipse/papyrus/emf/facet/common/ui/internal/controls/PersistableColumn.java @@ -1,216 +1,216 @@ -/*******************************************************************************
- * Copyright (c) 2011 Mia-Software.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Nicolas Bros (Mia-Software) - initial API and implementation
- * Nicolas Bros (Mia-Software) - Bug 334116 - common tree view with columns
- *******************************************************************************/
-package org.eclipse.papyrus.emf.facet.common.ui.internal.controls;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.jface.viewers.ColumnLabelProvider;
-import org.eclipse.jface.viewers.TableViewer;
-import org.eclipse.jface.viewers.TableViewerColumn;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.jface.viewers.TreeViewerColumn;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.viewers.ViewerColumn;
-import org.eclipse.jface.viewers.ViewerSorter;
-import org.eclipse.papyrus.emf.facet.common.ui.internal.controls.wrappers.Column;
-import org.eclipse.papyrus.emf.facet.common.ui.internal.controls.wrappers.SortableTable;
-import org.eclipse.papyrus.emf.facet.common.ui.internal.controls.wrappers.SortableTree;
-import org.eclipse.papyrus.emf.facet.common.ui.internal.controls.wrappers.SortableWidget;
-import org.eclipse.papyrus.emf.facet.common.ui.internal.controls.wrappers.SortableWidgetFactory;
-import org.eclipse.papyrus.emf.facet.common.ui.internal.controls.wrappers.TableColumn;
-import org.eclipse.papyrus.emf.facet.common.ui.internal.controls.wrappers.TreeColumn;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ControlAdapter;
-import org.eclipse.swt.events.ControlEvent;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.ui.IMemento;
-import org.eclipse.ui.part.ViewPart;
-
-/**
- * A column in a {@link TreeViewer} or {@link TableViewer} that is sortable (using the given {@link ColumnLabelProvider}) and can save its width to an {@link IMemento}.
- */
-public class PersistableColumn {
-
- /**
- * Saved column widths, static because we want to be able to save column widths during the
- * session (if a view is closed and re-opened), instead of only when the workbench is closed
- * (which is the case with {@link ViewPart#saveState(org.eclipse.ui.IMemento)})
- */
- private static final Map<String, Integer> COLUMN_WIDTHS = new HashMap<String, Integer>();
-
- /** The unique id associated to this column */
- private String fUniqueID;
-
- /** The underlying JFace column */
- private final ViewerColumn fViewerColumn;
-
- private Column getColumn() {
- if (this.fViewerColumn instanceof TreeViewerColumn) {
- TreeViewerColumn treeViewerColumn = (TreeViewerColumn) this.fViewerColumn;
- return new TreeColumn(treeViewerColumn.getColumn());
- } else if (this.fViewerColumn instanceof TableViewerColumn) {
- TableViewerColumn tableViewerColumn = (TableViewerColumn) this.fViewerColumn;
- return new TableColumn(tableViewerColumn.getColumn());
- }
- throw new IllegalStateException("neither a table nor tree column"); //$NON-NLS-1$
- }
-
- /**
- * Initialize a sortable column that can be persisted to an {@link IMemento} .
- *
- * @param columnText
- * the title of the column
- * @param uniqueID
- * a unique id used to persist the column width
- * @param defaultWidth
- * the width to use if no previous information was saved
- * @param columnLabelProvider
- * the label provider for this column
- */
- protected void init(final String columnText, final String uniqueID, final int defaultWidth,
- final ColumnLabelProvider columnLabelProvider) {
- this.fUniqueID = uniqueID;
- final Column column = getColumn();
- column.setText(columnText);
-
- Integer width = PersistableColumn.getColumnWidths().get(uniqueID);
- if (width != null) {
- column.setWidth(width.intValue());
- } else {
- column.setWidth(defaultWidth);
- }
- column.addControlListener(new ControlAdapter() {
- @Override
- public void controlResized(final ControlEvent e) {
- PersistableColumn.getColumnWidths().put(uniqueID, new Integer(column.getWidth()));
- }
- });
-
- this.fViewerColumn.setLabelProvider(columnLabelProvider);
- }
-
- /**
- * Create a sortable column that can be persisted to an {@link IMemento}.
- *
- * @param columnText
- * the title of the column
- * @param uniqueID
- * a unique id used to persist the column width
- * @param defaultWidth
- * the width to use if no previous information was saved
- * @param columnLabelProvider
- * the label provider for this column
- * @param treeViewer
- * the {@link TreeViewer} in which to create the column
- */
- public PersistableColumn(final String columnText, final String uniqueID,
- final int defaultWidth, final ColumnLabelProvider columnLabelProvider,
- final TreeViewer treeViewer) {
- TreeViewerColumn treeViewerColumn = new TreeViewerColumn(treeViewer, SWT.NONE);
- this.fViewerColumn = treeViewerColumn;
- init(columnText, uniqueID, defaultWidth, columnLabelProvider);
-
- addSorter(new TreeColumn(treeViewerColumn.getColumn()),
- getViewerSorter(columnLabelProvider), new SortableTree(treeViewer));
- }
-
- /**
- * Create a sortable column that can be persisted to an {@link IMemento}.
- *
- * @param columnText
- * the title of the column
- * @param uniqueID
- * a unique id used to persist the column width
- * @param defaultWidth
- * the width to use if no previous information was saved
- * @param columnLabelProvider
- * the label provider for this column
- * @param tableViewer
- * the {@link TableViewer} in which to create the column
- */
- public PersistableColumn(final String columnText, final String uniqueID,
- final int defaultWidth, final ColumnLabelProvider columnLabelProvider,
- final TableViewer tableViewer) {
- TableViewerColumn tableViewerColumn = new TableViewerColumn(tableViewer, SWT.NONE);
- this.fViewerColumn = tableViewerColumn;
- init(columnText, uniqueID, defaultWidth, columnLabelProvider);
-
- addSorter(new TableColumn(tableViewerColumn.getColumn()),
- getViewerSorter(columnLabelProvider), new SortableTable(tableViewer));
- }
-
- private static ViewerSorter getViewerSorter(final ColumnLabelProvider columnLabelProvider) {
- return new ViewerSorter() {
- @Override
- public int compare(final Viewer viewer, final Object e1, final Object e2) {
- String text1 = columnLabelProvider.getText(e1);
- String text2 = columnLabelProvider.getText(e2);
- if (text1 == null) {
- return -1;
- }
- int compare = text1.compareTo(text2);
- SortableWidget sortableWidget = SortableWidgetFactory.createSortableWidget(viewer);
- if (sortableWidget.getSortDirection() == SWT.DOWN) {
- compare = compare * -1;
- }
- return compare;
- }
- };
- }
-
- private static void addSorter(final Column column, final ViewerSorter viewerSorter,
- final SortableWidget sortableWidget) {
- column.addSelectionListener(new SelectionAdapter() {
- @Override
- public void widgetSelected(final SelectionEvent e) {
- sortableWidget.setSorter(viewerSorter);
- sortableWidget.setSortColumn(column);
- if (sortableWidget.getSortDirection() == SWT.UP) {
- sortableWidget.setSortDirection(SWT.DOWN);
- } else if (sortableWidget.getSortDirection() == SWT.DOWN) {
- sortableWidget.setSortDirection(SWT.UP);
- } else {
- sortableWidget.setSortDirection(SWT.UP);
- }
- sortableWidget.refresh();
- }
- });
- }
-
- public void saveState(final IMemento memento) {
- Integer width = PersistableColumn.getColumnWidths().get(this.fUniqueID);
- if (width != null) {
- memento.putInteger(this.fUniqueID, width.intValue());
- }
- }
-
- /**
- * Loads the saved state from the given {@link IMemento}. Columns created using the given id
- * after this call will have their width set to the value that was loaded.
- */
- public static void loadState(final IMemento memento, final String columnID) {
- Integer width = memento.getInteger(columnID);
- if (width != null) {
- PersistableColumn.getColumnWidths().put(columnID, width);
- }
- }
-
- public void setWidth(final int width) {
- getColumn().setWidth(width);
- }
-
- protected static Map<String, Integer> getColumnWidths() {
- return PersistableColumn.COLUMN_WIDTHS;
- }
-}
+/******************************************************************************* + * Copyright (c) 2011 Mia-Software. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Nicolas Bros (Mia-Software) - initial API and implementation + * Nicolas Bros (Mia-Software) - Bug 334116 - common tree view with columns + *******************************************************************************/ +package org.eclipse.papyrus.emf.facet.common.ui.internal.controls; + +import java.util.HashMap; +import java.util.Map; + +import org.eclipse.jface.viewers.ColumnLabelProvider; +import org.eclipse.jface.viewers.TableViewer; +import org.eclipse.jface.viewers.TableViewerColumn; +import org.eclipse.jface.viewers.TreeViewer; +import org.eclipse.jface.viewers.TreeViewerColumn; +import org.eclipse.jface.viewers.Viewer; +import org.eclipse.jface.viewers.ViewerColumn; +import org.eclipse.jface.viewers.ViewerSorter; +import org.eclipse.papyrus.emf.facet.common.ui.internal.controls.wrappers.Column; +import org.eclipse.papyrus.emf.facet.common.ui.internal.controls.wrappers.SortableTable; +import org.eclipse.papyrus.emf.facet.common.ui.internal.controls.wrappers.SortableTree; +import org.eclipse.papyrus.emf.facet.common.ui.internal.controls.wrappers.SortableWidget; +import org.eclipse.papyrus.emf.facet.common.ui.internal.controls.wrappers.SortableWidgetFactory; +import org.eclipse.papyrus.emf.facet.common.ui.internal.controls.wrappers.TableColumn; +import org.eclipse.papyrus.emf.facet.common.ui.internal.controls.wrappers.TreeColumn; +import org.eclipse.swt.SWT; +import org.eclipse.swt.events.ControlAdapter; +import org.eclipse.swt.events.ControlEvent; +import org.eclipse.swt.events.SelectionAdapter; +import org.eclipse.swt.events.SelectionEvent; +import org.eclipse.ui.IMemento; +import org.eclipse.ui.part.ViewPart; + +/** + * A column in a {@link TreeViewer} or {@link TableViewer} that is sortable (using the given {@link ColumnLabelProvider}) and can save its width to an {@link IMemento}. + */ +public class PersistableColumn { + + /** + * Saved column widths, static because we want to be able to save column widths during the + * session (if a view is closed and re-opened), instead of only when the workbench is closed + * (which is the case with {@link ViewPart#saveState(org.eclipse.ui.IMemento)}) + */ + private static final Map<String, Integer> COLUMN_WIDTHS = new HashMap<String, Integer>(); + + /** The unique id associated to this column */ + private String fUniqueID; + + /** The underlying JFace column */ + private final ViewerColumn fViewerColumn; + + private Column getColumn() { + if (this.fViewerColumn instanceof TreeViewerColumn) { + TreeViewerColumn treeViewerColumn = (TreeViewerColumn) this.fViewerColumn; + return new TreeColumn(treeViewerColumn.getColumn()); + } else if (this.fViewerColumn instanceof TableViewerColumn) { + TableViewerColumn tableViewerColumn = (TableViewerColumn) this.fViewerColumn; + return new TableColumn(tableViewerColumn.getColumn()); + } + throw new IllegalStateException("neither a table nor tree column"); //$NON-NLS-1$ + } + + /** + * Initialize a sortable column that can be persisted to an {@link IMemento} . + * + * @param columnText + * the title of the column + * @param uniqueID + * a unique id used to persist the column width + * @param defaultWidth + * the width to use if no previous information was saved + * @param columnLabelProvider + * the label provider for this column + */ + protected void init(final String columnText, final String uniqueID, final int defaultWidth, + final ColumnLabelProvider columnLabelProvider) { + this.fUniqueID = uniqueID; + final Column column = getColumn(); + column.setText(columnText); + + Integer width = PersistableColumn.getColumnWidths().get(uniqueID); + if (width != null) { + column.setWidth(width.intValue()); + } else { + column.setWidth(defaultWidth); + } + column.addControlListener(new ControlAdapter() { + @Override + public void controlResized(final ControlEvent e) { + PersistableColumn.getColumnWidths().put(uniqueID, new Integer(column.getWidth())); + } + }); + + this.fViewerColumn.setLabelProvider(columnLabelProvider); + } + + /** + * Create a sortable column that can be persisted to an {@link IMemento}. + * + * @param columnText + * the title of the column + * @param uniqueID + * a unique id used to persist the column width + * @param defaultWidth + * the width to use if no previous information was saved + * @param columnLabelProvider + * the label provider for this column + * @param treeViewer + * the {@link TreeViewer} in which to create the column + */ + public PersistableColumn(final String columnText, final String uniqueID, + final int defaultWidth, final ColumnLabelProvider columnLabelProvider, + final TreeViewer treeViewer) { + TreeViewerColumn treeViewerColumn = new TreeViewerColumn(treeViewer, SWT.NONE); + this.fViewerColumn = treeViewerColumn; + init(columnText, uniqueID, defaultWidth, columnLabelProvider); + + addSorter(new TreeColumn(treeViewerColumn.getColumn()), + getViewerSorter(columnLabelProvider), new SortableTree(treeViewer)); + } + + /** + * Create a sortable column that can be persisted to an {@link IMemento}. + * + * @param columnText + * the title of the column + * @param uniqueID + * a unique id used to persist the column width + * @param defaultWidth + * the width to use if no previous information was saved + * @param columnLabelProvider + * the label provider for this column + * @param tableViewer + * the {@link TableViewer} in which to create the column + */ + public PersistableColumn(final String columnText, final String uniqueID, + final int defaultWidth, final ColumnLabelProvider columnLabelProvider, + final TableViewer tableViewer) { + TableViewerColumn tableViewerColumn = new TableViewerColumn(tableViewer, SWT.NONE); + this.fViewerColumn = tableViewerColumn; + init(columnText, uniqueID, defaultWidth, columnLabelProvider); + + addSorter(new TableColumn(tableViewerColumn.getColumn()), + getViewerSorter(columnLabelProvider), new SortableTable(tableViewer)); + } + + private static ViewerSorter getViewerSorter(final ColumnLabelProvider columnLabelProvider) { + return new ViewerSorter() { + @Override + public int compare(final Viewer viewer, final Object e1, final Object e2) { + String text1 = columnLabelProvider.getText(e1); + String text2 = columnLabelProvider.getText(e2); + if (text1 == null) { + return -1; + } + int compare = text1.compareTo(text2); + SortableWidget sortableWidget = SortableWidgetFactory.createSortableWidget(viewer); + if (sortableWidget.getSortDirection() == SWT.DOWN) { + compare = compare * -1; + } + return compare; + } + }; + } + + private static void addSorter(final Column column, final ViewerSorter viewerSorter, + final SortableWidget sortableWidget) { + column.addSelectionListener(new SelectionAdapter() { + @Override + public void widgetSelected(final SelectionEvent e) { + sortableWidget.setSorter(viewerSorter); + sortableWidget.setSortColumn(column); + if (sortableWidget.getSortDirection() == SWT.UP) { + sortableWidget.setSortDirection(SWT.DOWN); + } else if (sortableWidget.getSortDirection() == SWT.DOWN) { + sortableWidget.setSortDirection(SWT.UP); + } else { + sortableWidget.setSortDirection(SWT.UP); + } + sortableWidget.refresh(); + } + }); + } + + public void saveState(final IMemento memento) { + Integer width = PersistableColumn.getColumnWidths().get(this.fUniqueID); + if (width != null) { + memento.putInteger(this.fUniqueID, width.intValue()); + } + } + + /** + * Loads the saved state from the given {@link IMemento}. Columns created using the given id + * after this call will have their width set to the value that was loaded. + */ + public static void loadState(final IMemento memento, final String columnID) { + Integer width = memento.getInteger(columnID); + if (width != null) { + PersistableColumn.getColumnWidths().put(columnID, width); + } + } + + public void setWidth(final int width) { + getColumn().setWidth(width); + } + + protected static Map<String, Integer> getColumnWidths() { + return PersistableColumn.COLUMN_WIDTHS; + } +} diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/src/org/eclipse/papyrus/emf/facet/common/ui/internal/controls/wrappers/Column.java b/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/src/org/eclipse/papyrus/emf/facet/common/ui/internal/controls/wrappers/Column.java index 02a8d2aae95..c0f4fd0c49e 100644 --- a/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/src/org/eclipse/papyrus/emf/facet/common/ui/internal/controls/wrappers/Column.java +++ b/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/src/org/eclipse/papyrus/emf/facet/common/ui/internal/controls/wrappers/Column.java @@ -1,33 +1,33 @@ -/*******************************************************************************
- * Copyright (c) 2011 Mia-Software.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Nicolas Bros (Mia-Software) - initial API and implementation
- * Nicolas Bros (Mia-Software) - Bug 334116 - common tree view with columns
- *******************************************************************************/
-package org.eclipse.papyrus.emf.facet.common.ui.internal.controls.wrappers;
-
-import org.eclipse.swt.events.ControlListener;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.widgets.Item;
-import org.eclipse.swt.widgets.TableColumn;
-import org.eclipse.swt.widgets.TreeColumn;
-
-/** Provides a unified API over both SWT {@link TreeColumn} and {@link TableColumn} */
-public interface Column {
- void setText(String columnText);
-
- void addControlListener(ControlListener controlListener);
-
- void addSelectionListener(SelectionListener selectionListener);
-
- void setWidth(int width);
-
- int getWidth();
-
- Item getColumn();
+/******************************************************************************* + * Copyright (c) 2011 Mia-Software. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Nicolas Bros (Mia-Software) - initial API and implementation + * Nicolas Bros (Mia-Software) - Bug 334116 - common tree view with columns + *******************************************************************************/ +package org.eclipse.papyrus.emf.facet.common.ui.internal.controls.wrappers; + +import org.eclipse.swt.events.ControlListener; +import org.eclipse.swt.events.SelectionListener; +import org.eclipse.swt.widgets.Item; +import org.eclipse.swt.widgets.TableColumn; +import org.eclipse.swt.widgets.TreeColumn; + +/** Provides a unified API over both SWT {@link TreeColumn} and {@link TableColumn} */ +public interface Column { + void setText(String columnText); + + void addControlListener(ControlListener controlListener); + + void addSelectionListener(SelectionListener selectionListener); + + void setWidth(int width); + + int getWidth(); + + Item getColumn(); }
\ No newline at end of file diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/src/org/eclipse/papyrus/emf/facet/common/ui/internal/controls/wrappers/SortableTable.java b/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/src/org/eclipse/papyrus/emf/facet/common/ui/internal/controls/wrappers/SortableTable.java index 88f5753d3f8..031c234b4e8 100644 --- a/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/src/org/eclipse/papyrus/emf/facet/common/ui/internal/controls/wrappers/SortableTable.java +++ b/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/src/org/eclipse/papyrus/emf/facet/common/ui/internal/controls/wrappers/SortableTable.java @@ -1,47 +1,47 @@ -/*******************************************************************************
- * Copyright (c) 2011 Mia-Software.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Nicolas Bros (Mia-Software) - initial API and implementation
- * Nicolas Bros (Mia-Software) - Bug 334116 - common tree view with columns
- *******************************************************************************/
-package org.eclipse.papyrus.emf.facet.common.ui.internal.controls.wrappers;
-
-import org.eclipse.jface.viewers.TableViewer;
-import org.eclipse.jface.viewers.ViewerSorter;
-
-/**
- * Implements {@link SortableWidget}'s unified API for the JFace {@link TableViewer}.
- */
-public class SortableTable implements SortableWidget {
- private final TableViewer tableViewer;
-
- public SortableTable(final TableViewer tableViewer) {
- this.tableViewer = tableViewer;
- }
-
- public void setSorter(final ViewerSorter viewerSorter) {
- this.tableViewer.setSorter(viewerSorter);
- }
-
- public int getSortDirection() {
- return this.tableViewer.getTable().getSortDirection();
- }
-
- public void setSortDirection(final int direction) {
- this.tableViewer.getTable().setSortDirection(direction);
- }
-
- public void setSortColumn(final Column column) {
- this.tableViewer.getTable().setSortColumn(
- (org.eclipse.swt.widgets.TableColumn) column.getColumn());
- }
-
- public void refresh() {
- this.tableViewer.refresh();
- }
+/******************************************************************************* + * Copyright (c) 2011 Mia-Software. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Nicolas Bros (Mia-Software) - initial API and implementation + * Nicolas Bros (Mia-Software) - Bug 334116 - common tree view with columns + *******************************************************************************/ +package org.eclipse.papyrus.emf.facet.common.ui.internal.controls.wrappers; + +import org.eclipse.jface.viewers.TableViewer; +import org.eclipse.jface.viewers.ViewerSorter; + +/** + * Implements {@link SortableWidget}'s unified API for the JFace {@link TableViewer}. + */ +public class SortableTable implements SortableWidget { + private final TableViewer tableViewer; + + public SortableTable(final TableViewer tableViewer) { + this.tableViewer = tableViewer; + } + + public void setSorter(final ViewerSorter viewerSorter) { + this.tableViewer.setSorter(viewerSorter); + } + + public int getSortDirection() { + return this.tableViewer.getTable().getSortDirection(); + } + + public void setSortDirection(final int direction) { + this.tableViewer.getTable().setSortDirection(direction); + } + + public void setSortColumn(final Column column) { + this.tableViewer.getTable().setSortColumn( + (org.eclipse.swt.widgets.TableColumn) column.getColumn()); + } + + public void refresh() { + this.tableViewer.refresh(); + } }
\ No newline at end of file diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/src/org/eclipse/papyrus/emf/facet/common/ui/internal/controls/wrappers/SortableTree.java b/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/src/org/eclipse/papyrus/emf/facet/common/ui/internal/controls/wrappers/SortableTree.java index b031edab28f..06b0dd6229d 100644 --- a/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/src/org/eclipse/papyrus/emf/facet/common/ui/internal/controls/wrappers/SortableTree.java +++ b/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/src/org/eclipse/papyrus/emf/facet/common/ui/internal/controls/wrappers/SortableTree.java @@ -1,47 +1,47 @@ -/*******************************************************************************
- * Copyright (c) 2011 Mia-Software.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Nicolas Bros (Mia-Software) - initial API and implementation
- * Nicolas Bros (Mia-Software) - Bug 334116 - common tree view with columns
- *******************************************************************************/
-package org.eclipse.papyrus.emf.facet.common.ui.internal.controls.wrappers;
-
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.jface.viewers.ViewerSorter;
-
-/**
- * Implements {@link SortableWidget}'s unified API for the JFace {@link TreeViewer}.
- */
-public class SortableTree implements SortableWidget {
- private final TreeViewer treeViewer;
-
- public SortableTree(final TreeViewer treeViewer) {
- this.treeViewer = treeViewer;
- }
-
- public void setSorter(final ViewerSorter viewerSorter) {
- this.treeViewer.setSorter(viewerSorter);
- }
-
- public int getSortDirection() {
- return this.treeViewer.getTree().getSortDirection();
- }
-
- public void setSortDirection(final int direction) {
- this.treeViewer.getTree().setSortDirection(direction);
- }
-
- public void setSortColumn(final Column column) {
- this.treeViewer.getTree().setSortColumn(
- (org.eclipse.swt.widgets.TreeColumn) column.getColumn());
- }
-
- public void refresh() {
- this.treeViewer.refresh();
- }
+/******************************************************************************* + * Copyright (c) 2011 Mia-Software. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Nicolas Bros (Mia-Software) - initial API and implementation + * Nicolas Bros (Mia-Software) - Bug 334116 - common tree view with columns + *******************************************************************************/ +package org.eclipse.papyrus.emf.facet.common.ui.internal.controls.wrappers; + +import org.eclipse.jface.viewers.TreeViewer; +import org.eclipse.jface.viewers.ViewerSorter; + +/** + * Implements {@link SortableWidget}'s unified API for the JFace {@link TreeViewer}. + */ +public class SortableTree implements SortableWidget { + private final TreeViewer treeViewer; + + public SortableTree(final TreeViewer treeViewer) { + this.treeViewer = treeViewer; + } + + public void setSorter(final ViewerSorter viewerSorter) { + this.treeViewer.setSorter(viewerSorter); + } + + public int getSortDirection() { + return this.treeViewer.getTree().getSortDirection(); + } + + public void setSortDirection(final int direction) { + this.treeViewer.getTree().setSortDirection(direction); + } + + public void setSortColumn(final Column column) { + this.treeViewer.getTree().setSortColumn( + (org.eclipse.swt.widgets.TreeColumn) column.getColumn()); + } + + public void refresh() { + this.treeViewer.refresh(); + } }
\ No newline at end of file diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/src/org/eclipse/papyrus/emf/facet/common/ui/internal/controls/wrappers/SortableWidget.java b/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/src/org/eclipse/papyrus/emf/facet/common/ui/internal/controls/wrappers/SortableWidget.java index d13cb9c8f2b..e9056f12915 100644 --- a/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/src/org/eclipse/papyrus/emf/facet/common/ui/internal/controls/wrappers/SortableWidget.java +++ b/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/src/org/eclipse/papyrus/emf/facet/common/ui/internal/controls/wrappers/SortableWidget.java @@ -1,30 +1,30 @@ -/*******************************************************************************
- * Copyright (c) 2011 Mia-Software.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Nicolas Bros (Mia-Software) - initial API and implementation
- * Nicolas Bros (Mia-Software) - Bug 334116 - common tree view with columns
- *******************************************************************************/
-package org.eclipse.papyrus.emf.facet.common.ui.internal.controls.wrappers;
-
-import org.eclipse.jface.viewers.ViewerSorter;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.Tree;
-
-/** Provides a unified API over both SWT {@link Tree} and {@link Table} */
-public interface SortableWidget {
- void setSorter(ViewerSorter viewerSorter);
-
- int getSortDirection();
-
- void setSortDirection(int direction);
-
- void setSortColumn(Column column);
-
- void refresh();
-
+/******************************************************************************* + * Copyright (c) 2011 Mia-Software. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Nicolas Bros (Mia-Software) - initial API and implementation + * Nicolas Bros (Mia-Software) - Bug 334116 - common tree view with columns + *******************************************************************************/ +package org.eclipse.papyrus.emf.facet.common.ui.internal.controls.wrappers; + +import org.eclipse.jface.viewers.ViewerSorter; +import org.eclipse.swt.widgets.Table; +import org.eclipse.swt.widgets.Tree; + +/** Provides a unified API over both SWT {@link Tree} and {@link Table} */ +public interface SortableWidget { + void setSorter(ViewerSorter viewerSorter); + + int getSortDirection(); + + void setSortDirection(int direction); + + void setSortColumn(Column column); + + void refresh(); + }
\ No newline at end of file diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/src/org/eclipse/papyrus/emf/facet/common/ui/internal/controls/wrappers/SortableWidgetFactory.java b/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/src/org/eclipse/papyrus/emf/facet/common/ui/internal/controls/wrappers/SortableWidgetFactory.java index 8ac2f5018e5..e8ade4ccb9a 100644 --- a/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/src/org/eclipse/papyrus/emf/facet/common/ui/internal/controls/wrappers/SortableWidgetFactory.java +++ b/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/src/org/eclipse/papyrus/emf/facet/common/ui/internal/controls/wrappers/SortableWidgetFactory.java @@ -1,46 +1,46 @@ -/*******************************************************************************
- * Copyright (c) 2011 Mia-Software.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Nicolas Bros (Mia-Software) - initial API and implementation
- * Nicolas Bros (Mia-Software) - Bug 334116 - common tree view with columns
- *******************************************************************************/
-package org.eclipse.papyrus.emf.facet.common.ui.internal.controls.wrappers;
-
-import org.eclipse.jface.viewers.TableViewer;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.Tree;
-
-/**
- * A factory to obtain a {@link SortableWidget}, that provides a unified API over both SWT {@link Tree} and {@link Table}.
- */
-public final class SortableWidgetFactory {
-
- private SortableWidgetFactory() {
- // utility class
- }
-
- /**
- * Get a {@link SortableWidget} for the given {@link Viewer}, that can be either a {@link TreeViewer} or a {@link TableViewer}.
- *
- * @param viewer
- * a {@link TreeViewer} or a {@link TableViewer}
- * @return a {@link SortableWidget} that delegates to the given viewer
- */
- public static SortableWidget createSortableWidget(final Viewer viewer) {
- if (viewer instanceof TreeViewer) {
- TreeViewer treeViewer = (TreeViewer) viewer;
- return new SortableTree(treeViewer);
- } else if (viewer instanceof TableViewer) {
- TableViewer tableViewer = (TableViewer) viewer;
- return new SortableTable(tableViewer);
- }
- throw new IllegalArgumentException();
- }
+/******************************************************************************* + * Copyright (c) 2011 Mia-Software. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Nicolas Bros (Mia-Software) - initial API and implementation + * Nicolas Bros (Mia-Software) - Bug 334116 - common tree view with columns + *******************************************************************************/ +package org.eclipse.papyrus.emf.facet.common.ui.internal.controls.wrappers; + +import org.eclipse.jface.viewers.TableViewer; +import org.eclipse.jface.viewers.TreeViewer; +import org.eclipse.jface.viewers.Viewer; +import org.eclipse.swt.widgets.Table; +import org.eclipse.swt.widgets.Tree; + +/** + * A factory to obtain a {@link SortableWidget}, that provides a unified API over both SWT {@link Tree} and {@link Table}. + */ +public final class SortableWidgetFactory { + + private SortableWidgetFactory() { + // utility class + } + + /** + * Get a {@link SortableWidget} for the given {@link Viewer}, that can be either a {@link TreeViewer} or a {@link TableViewer}. + * + * @param viewer + * a {@link TreeViewer} or a {@link TableViewer} + * @return a {@link SortableWidget} that delegates to the given viewer + */ + public static SortableWidget createSortableWidget(final Viewer viewer) { + if (viewer instanceof TreeViewer) { + TreeViewer treeViewer = (TreeViewer) viewer; + return new SortableTree(treeViewer); + } else if (viewer instanceof TableViewer) { + TableViewer tableViewer = (TableViewer) viewer; + return new SortableTable(tableViewer); + } + throw new IllegalArgumentException(); + } }
\ No newline at end of file diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/src/org/eclipse/papyrus/emf/facet/common/ui/internal/controls/wrappers/TableColumn.java b/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/src/org/eclipse/papyrus/emf/facet/common/ui/internal/controls/wrappers/TableColumn.java index ee83b33fb76..92c755660db 100644 --- a/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/src/org/eclipse/papyrus/emf/facet/common/ui/internal/controls/wrappers/TableColumn.java +++ b/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/src/org/eclipse/papyrus/emf/facet/common/ui/internal/controls/wrappers/TableColumn.java @@ -1,49 +1,49 @@ -/*******************************************************************************
- * Copyright (c) 2011 Mia-Software.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Nicolas Bros (Mia-Software) - initial API and implementation
- * Nicolas Bros (Mia-Software) - Bug 334116 - common tree view with columns
- *******************************************************************************/
-package org.eclipse.papyrus.emf.facet.common.ui.internal.controls.wrappers;
-
-import org.eclipse.swt.events.ControlListener;
-import org.eclipse.swt.events.SelectionListener;
-
-/** Implements {@link Column}'s unified API for the SWT {@link org.eclipse.swt.widgets.TableColumn} */
-public class TableColumn implements Column {
- private final org.eclipse.swt.widgets.TableColumn column;
-
- public TableColumn(final org.eclipse.swt.widgets.TableColumn column) {
- this.column = column;
- }
-
- public void setText(final String columnText) {
- this.column.setText(columnText);
- }
-
- public void setWidth(final int width) {
- this.column.setWidth(width);
-
- }
-
- public void addControlListener(final ControlListener controlListener) {
- this.column.addControlListener(controlListener);
- }
-
- public void addSelectionListener(final SelectionListener selectionListener) {
- this.column.addSelectionListener(selectionListener);
- }
-
- public int getWidth() {
- return this.column.getWidth();
- }
-
- public org.eclipse.swt.widgets.TableColumn getColumn() {
- return this.column;
- }
+/******************************************************************************* + * Copyright (c) 2011 Mia-Software. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Nicolas Bros (Mia-Software) - initial API and implementation + * Nicolas Bros (Mia-Software) - Bug 334116 - common tree view with columns + *******************************************************************************/ +package org.eclipse.papyrus.emf.facet.common.ui.internal.controls.wrappers; + +import org.eclipse.swt.events.ControlListener; +import org.eclipse.swt.events.SelectionListener; + +/** Implements {@link Column}'s unified API for the SWT {@link org.eclipse.swt.widgets.TableColumn} */ +public class TableColumn implements Column { + private final org.eclipse.swt.widgets.TableColumn column; + + public TableColumn(final org.eclipse.swt.widgets.TableColumn column) { + this.column = column; + } + + public void setText(final String columnText) { + this.column.setText(columnText); + } + + public void setWidth(final int width) { + this.column.setWidth(width); + + } + + public void addControlListener(final ControlListener controlListener) { + this.column.addControlListener(controlListener); + } + + public void addSelectionListener(final SelectionListener selectionListener) { + this.column.addSelectionListener(selectionListener); + } + + public int getWidth() { + return this.column.getWidth(); + } + + public org.eclipse.swt.widgets.TableColumn getColumn() { + return this.column; + } }
\ No newline at end of file diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/src/org/eclipse/papyrus/emf/facet/common/ui/internal/controls/wrappers/TreeColumn.java b/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/src/org/eclipse/papyrus/emf/facet/common/ui/internal/controls/wrappers/TreeColumn.java index abf8f5d4d16..ab5f7aae1e5 100644 --- a/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/src/org/eclipse/papyrus/emf/facet/common/ui/internal/controls/wrappers/TreeColumn.java +++ b/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/src/org/eclipse/papyrus/emf/facet/common/ui/internal/controls/wrappers/TreeColumn.java @@ -1,49 +1,49 @@ -/*******************************************************************************
- * Copyright (c) 2011 Mia-Software.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Nicolas Bros (Mia-Software) - initial API and implementation
- * Nicolas Bros (Mia-Software) - Bug 334116 - common tree view with columns
- *******************************************************************************/
-package org.eclipse.papyrus.emf.facet.common.ui.internal.controls.wrappers;
-
-import org.eclipse.swt.events.ControlListener;
-import org.eclipse.swt.events.SelectionListener;
-
-/** Implements {@link Column}'s unified API for the SWT {@link org.eclipse.swt.widgets.TreeColumn} */
-public class TreeColumn implements Column {
- private final org.eclipse.swt.widgets.TreeColumn column;
-
- public TreeColumn(final org.eclipse.swt.widgets.TreeColumn column) {
- this.column = column;
- }
-
- public void setText(final String columnText) {
- this.column.setText(columnText);
- }
-
- public void setWidth(final int width) {
- this.column.setWidth(width);
-
- }
-
- public void addControlListener(final ControlListener controlListener) {
- this.column.addControlListener(controlListener);
- }
-
- public void addSelectionListener(final SelectionListener selectionListener) {
- this.column.addSelectionListener(selectionListener);
- }
-
- public int getWidth() {
- return this.column.getWidth();
- }
-
- public org.eclipse.swt.widgets.TreeColumn getColumn() {
- return this.column;
- }
+/******************************************************************************* + * Copyright (c) 2011 Mia-Software. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Nicolas Bros (Mia-Software) - initial API and implementation + * Nicolas Bros (Mia-Software) - Bug 334116 - common tree view with columns + *******************************************************************************/ +package org.eclipse.papyrus.emf.facet.common.ui.internal.controls.wrappers; + +import org.eclipse.swt.events.ControlListener; +import org.eclipse.swt.events.SelectionListener; + +/** Implements {@link Column}'s unified API for the SWT {@link org.eclipse.swt.widgets.TreeColumn} */ +public class TreeColumn implements Column { + private final org.eclipse.swt.widgets.TreeColumn column; + + public TreeColumn(final org.eclipse.swt.widgets.TreeColumn column) { + this.column = column; + } + + public void setText(final String columnText) { + this.column.setText(columnText); + } + + public void setWidth(final int width) { + this.column.setWidth(width); + + } + + public void addControlListener(final ControlListener controlListener) { + this.column.addControlListener(controlListener); + } + + public void addSelectionListener(final SelectionListener selectionListener) { + this.column.addSelectionListener(selectionListener); + } + + public int getWidth() { + return this.column.getWidth(); + } + + public org.eclipse.swt.widgets.TreeColumn getColumn() { + return this.column; + } }
\ No newline at end of file diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/src/org/eclipse/papyrus/emf/facet/common/ui/internal/exported/views/IColumnDescription.java b/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/src/org/eclipse/papyrus/emf/facet/common/ui/internal/exported/views/IColumnDescription.java index 073c8310c54..ecd8feab70e 100644 --- a/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/src/org/eclipse/papyrus/emf/facet/common/ui/internal/exported/views/IColumnDescription.java +++ b/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/src/org/eclipse/papyrus/emf/facet/common/ui/internal/exported/views/IColumnDescription.java @@ -1,34 +1,34 @@ -/*******************************************************************************
- * Copyright (c) 2012 CEA LIST.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Nicolas Bros (Mia-Software) - Bug 372732 - [Facet] Rewrite the catalog views for 0.2
- *******************************************************************************/
-package org.eclipse.papyrus.emf.facet.common.ui.internal.exported.views;
-
-import org.eclipse.jface.viewers.ColumnLabelProvider;
-
-/**
- * Contains the data necessary to create a column in a view created by
- * {@link IElementsViewFactory#createElementsView(java.util.Collection, org.eclipse.jface.viewers.ITreeContentProvider, Object, String, org.eclipse.swt.graphics.Image, org.eclipse.jface.viewers.IOpenListener) IElementsViewFactory#createElementsView}
- */
-public interface IColumnDescription {
- /** The column's label */
- String getTitle();
-
- /** A unique id for the column */
- String getUniqueID();
-
- /** The default width that will be used the first time the column is displayed */
- int getDefaultWidth();
-
- /**
- * A label provider that returns the text (and optionally image and other font attributes) for each element in this
- * column
- */
- ColumnLabelProvider getColumnLabelProvider();
-}
+/******************************************************************************* + * Copyright (c) 2012 CEA LIST. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Nicolas Bros (Mia-Software) - Bug 372732 - [Facet] Rewrite the catalog views for 0.2 + *******************************************************************************/ +package org.eclipse.papyrus.emf.facet.common.ui.internal.exported.views; + +import org.eclipse.jface.viewers.ColumnLabelProvider; + +/** + * Contains the data necessary to create a column in a view created by + * {@link IElementsViewFactory#createElementsView(java.util.Collection, org.eclipse.jface.viewers.ITreeContentProvider, Object, String, org.eclipse.swt.graphics.Image, org.eclipse.jface.viewers.IOpenListener) IElementsViewFactory#createElementsView} + */ +public interface IColumnDescription { + /** The column's label */ + String getTitle(); + + /** A unique id for the column */ + String getUniqueID(); + + /** The default width that will be used the first time the column is displayed */ + int getDefaultWidth(); + + /** + * A label provider that returns the text (and optionally image and other font attributes) for each element in this + * column + */ + ColumnLabelProvider getColumnLabelProvider(); +} diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/src/org/eclipse/papyrus/emf/facet/common/ui/internal/exported/views/IElementsViewFactory.java b/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/src/org/eclipse/papyrus/emf/facet/common/ui/internal/exported/views/IElementsViewFactory.java index 115792630df..83f632b015d 100644 --- a/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/src/org/eclipse/papyrus/emf/facet/common/ui/internal/exported/views/IElementsViewFactory.java +++ b/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/src/org/eclipse/papyrus/emf/facet/common/ui/internal/exported/views/IElementsViewFactory.java @@ -1,67 +1,67 @@ -/*******************************************************************************
- * Copyright (c) 2012 CEA LIST.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Nicolas Bros (Mia-Software) - Bug 372732 - [Facet] Rewrite the catalog views for 0.2
- *******************************************************************************/
-
-package org.eclipse.papyrus.emf.facet.common.ui.internal.exported.views;
-
-import java.util.Collection;
-
-import org.eclipse.jface.viewers.ColumnLabelProvider;
-import org.eclipse.jface.viewers.IOpenListener;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.papyrus.emf.facet.common.ui.internal.views.ElementsViewFactory;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.part.ViewPart;
-
-/**
- * Creates Eclipse views to display lists of elements. To be able to register this view in a non-RCP Eclipse, you will
- * have to register an IExecutableExtensionFactory that will do the actual instantiation.
- */
-public interface IElementsViewFactory {
- IElementsViewFactory DEFAULT = new ElementsViewFactory();
-
- /**
- * Creates a view with columns. Each column has a default width, and memorizes its width once resized.
- *
- * @param columnDescriptions
- * describes the columns
- * @param contentProvider
- * provides the content from the input
- * @param input
- * the view's input
- * @param title
- * the part's label
- * @param titleImage
- * the part's image
- * @param openListener
- * a listener called when hitting Enter or double-clicking on an element in the view
- * @return the view part
- */
- ViewPart createElementsView(Collection<? extends IColumnDescription> columnDescriptions,
- ITreeContentProvider contentProvider, Object input, String title, Image titleImage, IOpenListener openListener);
-
- /**
- * Creates a column description for {@link IElementsViewFactory#createElementsView(Collection, ITreeContentProvider, Object, String, Image, IOpenListener)
- * createElementsView}
- *
- * @param title
- * the column label
- * @param uniqueID
- * a unique ID that will identify the column (used for serialization)
- * @param defaultWidth
- * the initial width of the column, before the user resizes it
- * @param columnLabelProvider
- * A label provider that returns the text (and optionally image and other font attributes) for each
- * element in this column
- * @return a column description
- */
- IColumnDescription createColumnDescription(String title, String uniqueID,
- int defaultWidth, ColumnLabelProvider columnLabelProvider);
-}
+/******************************************************************************* + * Copyright (c) 2012 CEA LIST. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Nicolas Bros (Mia-Software) - Bug 372732 - [Facet] Rewrite the catalog views for 0.2 + *******************************************************************************/ + +package org.eclipse.papyrus.emf.facet.common.ui.internal.exported.views; + +import java.util.Collection; + +import org.eclipse.jface.viewers.ColumnLabelProvider; +import org.eclipse.jface.viewers.IOpenListener; +import org.eclipse.jface.viewers.ITreeContentProvider; +import org.eclipse.papyrus.emf.facet.common.ui.internal.views.ElementsViewFactory; +import org.eclipse.swt.graphics.Image; +import org.eclipse.ui.part.ViewPart; + +/** + * Creates Eclipse views to display lists of elements. To be able to register this view in a non-RCP Eclipse, you will + * have to register an IExecutableExtensionFactory that will do the actual instantiation. + */ +public interface IElementsViewFactory { + IElementsViewFactory DEFAULT = new ElementsViewFactory(); + + /** + * Creates a view with columns. Each column has a default width, and memorizes its width once resized. + * + * @param columnDescriptions + * describes the columns + * @param contentProvider + * provides the content from the input + * @param input + * the view's input + * @param title + * the part's label + * @param titleImage + * the part's image + * @param openListener + * a listener called when hitting Enter or double-clicking on an element in the view + * @return the view part + */ + ViewPart createElementsView(Collection<? extends IColumnDescription> columnDescriptions, + ITreeContentProvider contentProvider, Object input, String title, Image titleImage, IOpenListener openListener); + + /** + * Creates a column description for {@link IElementsViewFactory#createElementsView(Collection, ITreeContentProvider, Object, String, Image, IOpenListener) + * createElementsView} + * + * @param title + * the column label + * @param uniqueID + * a unique ID that will identify the column (used for serialization) + * @param defaultWidth + * the initial width of the column, before the user resizes it + * @param columnLabelProvider + * A label provider that returns the text (and optionally image and other font attributes) for each + * element in this column + * @return a column description + */ + IColumnDescription createColumnDescription(String title, String uniqueID, + int defaultWidth, ColumnLabelProvider columnLabelProvider); +} diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/src/org/eclipse/papyrus/emf/facet/common/ui/internal/messages.properties b/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/src/org/eclipse/papyrus/emf/facet/common/ui/internal/messages.properties index 8505a5f4b7a..74227d7a523 100644 --- a/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/src/org/eclipse/papyrus/emf/facet/common/ui/internal/messages.properties +++ b/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/src/org/eclipse/papyrus/emf/facet/common/ui/internal/messages.properties @@ -1,11 +1,11 @@ -###############################################################################
-# Copyright (c) 2012 CEA LIST.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Nicolas Bros (Mia-Software) - Bug 372732 - [Facet] Rewrite the catalog views for 0.2
-###############################################################################
-ElementsView_refreshJobTitle=Refreshing view {0}
+############################################################################### +# Copyright (c) 2012 CEA LIST. +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Eclipse Public License v1.0 +# which accompanies this distribution, and is available at +# http://www.eclipse.org/legal/epl-v10.html +# +# Contributors: +# Nicolas Bros (Mia-Software) - Bug 372732 - [Facet] Rewrite the catalog views for 0.2 +############################################################################### +ElementsView_refreshJobTitle=Refreshing view {0} diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/src/org/eclipse/papyrus/emf/facet/common/ui/internal/views/AbstractTreeView.java b/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/src/org/eclipse/papyrus/emf/facet/common/ui/internal/views/AbstractTreeView.java index 5876f75d1c6..84ec20b0fa7 100644 --- a/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/src/org/eclipse/papyrus/emf/facet/common/ui/internal/views/AbstractTreeView.java +++ b/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/src/org/eclipse/papyrus/emf/facet/common/ui/internal/views/AbstractTreeView.java @@ -1,176 +1,176 @@ -/*******************************************************************************
- * Copyright (c) 2010 Mia-Software.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Nicolas Bros (Mia-Software) - initial API and implementation
- * Nicolas Bros (Mia-Software) - Bug 334116 - common tree view with columns
- *******************************************************************************/
-
-package org.eclipse.papyrus.emf.facet.common.ui.internal.views;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.jface.action.GroupMarker;
-import org.eclipse.jface.action.MenuManager;
-import org.eclipse.jface.viewers.ColumnLabelProvider;
-import org.eclipse.jface.viewers.IContentProvider;
-import org.eclipse.jface.viewers.IOpenListener;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.OpenEvent;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.papyrus.emf.facet.common.ui.internal.Activator;
-import org.eclipse.papyrus.emf.facet.common.ui.internal.controls.PersistableColumn;
-import org.eclipse.papyrus.emf.facet.util.core.Logger;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.FillLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Menu;
-import org.eclipse.ui.IMemento;
-import org.eclipse.ui.IViewSite;
-import org.eclipse.ui.IWorkbenchActionConstants;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.part.ViewPart;
-
-/** An abstract Eclipse view that displays a list of elements. */
-public abstract class AbstractTreeView extends ViewPart {
-
- private final List<PersistableColumn> columns = new ArrayList<PersistableColumn>();
- private final Map<String, Integer> persistedValues = new HashMap<String, Integer>();
-
- private static final int JOB_SCHEDULE_DELAY = 500;
- private Job fRefreshJob = null;
-
- private TreeViewer fTreeViewer;
-
- public TreeViewer getViewer() {
- return this.fTreeViewer;
- }
-
- @Override
- public void createPartControl(final Composite parent) {
- parent.setLayout(new FillLayout());
-
- this.fTreeViewer = new TreeViewer(parent, SWT.H_SCROLL | SWT.V_SCROLL | SWT.SINGLE
- | SWT.FULL_SELECTION);
- this.fTreeViewer.getTree().setLinesVisible(true);
- this.fTreeViewer.getTree().setHeaderVisible(true);
-
- this.fTreeViewer.addOpenListener(new IOpenListener() {
- public void open(final OpenEvent event) {
- IStructuredSelection selection = (IStructuredSelection) AbstractTreeView.this
- .getViewer().getSelection();
- openElement(selection.getFirstElement());
- }
- });
-
- createColumns();
-
- this.fTreeViewer.setContentProvider(getContentProvider());
-
- createContextMenu();
- getSite().setSelectionProvider(this.fTreeViewer);
- refresh(false);
- }
-
- protected void createContextMenu() {
- final MenuManager contextMenu = new MenuManager("#PopUp"); //$NON-NLS-1$
- contextMenu.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
- final Menu menu = contextMenu.createContextMenu(getViewer().getControl());
- getViewer().getControl().setMenu(menu);
- getSite().registerContextMenu(contextMenu, getViewer());
- }
-
- protected abstract void createColumns();
-
- protected abstract IContentProvider getContentProvider();
-
- protected abstract void openElement(Object element);
-
- @Override
- public void setFocus() {
- this.fTreeViewer.getControl().setFocus();
- }
-
- /** Optionally delayed refresh */
- protected void refresh(final boolean delayed) {
- if (this.fRefreshJob == null) {
- this.fRefreshJob = new Job(getRefreshMessage()) {
- @Override
- protected IStatus run(final IProgressMonitor monitor) {
- doRefresh();
- return Status.OK_STATUS;
- }
- };
- }
- // delayed until it stops changing
- this.fRefreshJob.cancel();
- if (delayed) {
- this.fRefreshJob.setPriority(Job.DECORATE);
- this.fRefreshJob.schedule(AbstractTreeView.JOB_SCHEDULE_DELAY);
- } else {
- this.fRefreshJob.setPriority(Job.INTERACTIVE);
- this.fRefreshJob.schedule();
- }
- }
-
- protected abstract String getRefreshMessage();
-
- protected abstract Object getInput();
-
- protected void doRefresh() {
- // Accesses the catalog, which can block if done inside the UI thread.
- final Object input = getInput();
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- getViewer().setInput(input);
- getViewer().refresh();
- }
- });
- }
-
- protected void createColumn(final String columnText, final String uniqueID,
- final int defaultWidth, final ColumnLabelProvider columnLabelProvider) {
- PersistableColumn persistableColumn = new PersistableColumn(columnText, uniqueID,
- defaultWidth, columnLabelProvider, this.fTreeViewer);
- this.columns.add(persistableColumn);
- Integer width = this.persistedValues.get(uniqueID);
- if (width != null) {
- persistableColumn.setWidth(width.intValue());
- }
- }
-
- @Override
- public void saveState(final IMemento memento) {
- super.saveState(memento);
- try {
- for (PersistableColumn column : this.columns) {
- column.saveState(memento);
- }
- } catch (Exception e) {
- Logger.logError(e, "Error saving view state", Activator.getDefault()); //$NON-NLS-1$
- }
- }
-
- @Override
- public void init(final IViewSite site, final IMemento memento) throws PartInitException {
- super.init(site, memento);
- if (memento != null) {
- String[] attributeKeys = memento.getAttributeKeys();
- for (String key : attributeKeys) {
- this.persistedValues.put(key, memento.getInteger(key));
- }
- }
- }
-}
+/******************************************************************************* + * Copyright (c) 2010 Mia-Software. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Nicolas Bros (Mia-Software) - initial API and implementation + * Nicolas Bros (Mia-Software) - Bug 334116 - common tree view with columns + *******************************************************************************/ + +package org.eclipse.papyrus.emf.facet.common.ui.internal.views; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Status; +import org.eclipse.core.runtime.jobs.Job; +import org.eclipse.jface.action.GroupMarker; +import org.eclipse.jface.action.MenuManager; +import org.eclipse.jface.viewers.ColumnLabelProvider; +import org.eclipse.jface.viewers.IContentProvider; +import org.eclipse.jface.viewers.IOpenListener; +import org.eclipse.jface.viewers.IStructuredSelection; +import org.eclipse.jface.viewers.OpenEvent; +import org.eclipse.jface.viewers.TreeViewer; +import org.eclipse.papyrus.emf.facet.common.ui.internal.Activator; +import org.eclipse.papyrus.emf.facet.common.ui.internal.controls.PersistableColumn; +import org.eclipse.papyrus.emf.facet.util.core.Logger; +import org.eclipse.swt.SWT; +import org.eclipse.swt.layout.FillLayout; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Display; +import org.eclipse.swt.widgets.Menu; +import org.eclipse.ui.IMemento; +import org.eclipse.ui.IViewSite; +import org.eclipse.ui.IWorkbenchActionConstants; +import org.eclipse.ui.PartInitException; +import org.eclipse.ui.part.ViewPart; + +/** An abstract Eclipse view that displays a list of elements. */ +public abstract class AbstractTreeView extends ViewPart { + + private final List<PersistableColumn> columns = new ArrayList<PersistableColumn>(); + private final Map<String, Integer> persistedValues = new HashMap<String, Integer>(); + + private static final int JOB_SCHEDULE_DELAY = 500; + private Job fRefreshJob = null; + + private TreeViewer fTreeViewer; + + public TreeViewer getViewer() { + return this.fTreeViewer; + } + + @Override + public void createPartControl(final Composite parent) { + parent.setLayout(new FillLayout()); + + this.fTreeViewer = new TreeViewer(parent, SWT.H_SCROLL | SWT.V_SCROLL | SWT.SINGLE + | SWT.FULL_SELECTION); + this.fTreeViewer.getTree().setLinesVisible(true); + this.fTreeViewer.getTree().setHeaderVisible(true); + + this.fTreeViewer.addOpenListener(new IOpenListener() { + public void open(final OpenEvent event) { + IStructuredSelection selection = (IStructuredSelection) AbstractTreeView.this + .getViewer().getSelection(); + openElement(selection.getFirstElement()); + } + }); + + createColumns(); + + this.fTreeViewer.setContentProvider(getContentProvider()); + + createContextMenu(); + getSite().setSelectionProvider(this.fTreeViewer); + refresh(false); + } + + protected void createContextMenu() { + final MenuManager contextMenu = new MenuManager("#PopUp"); //$NON-NLS-1$ + contextMenu.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS)); + final Menu menu = contextMenu.createContextMenu(getViewer().getControl()); + getViewer().getControl().setMenu(menu); + getSite().registerContextMenu(contextMenu, getViewer()); + } + + protected abstract void createColumns(); + + protected abstract IContentProvider getContentProvider(); + + protected abstract void openElement(Object element); + + @Override + public void setFocus() { + this.fTreeViewer.getControl().setFocus(); + } + + /** Optionally delayed refresh */ + protected void refresh(final boolean delayed) { + if (this.fRefreshJob == null) { + this.fRefreshJob = new Job(getRefreshMessage()) { + @Override + protected IStatus run(final IProgressMonitor monitor) { + doRefresh(); + return Status.OK_STATUS; + } + }; + } + // delayed until it stops changing + this.fRefreshJob.cancel(); + if (delayed) { + this.fRefreshJob.setPriority(Job.DECORATE); + this.fRefreshJob.schedule(AbstractTreeView.JOB_SCHEDULE_DELAY); + } else { + this.fRefreshJob.setPriority(Job.INTERACTIVE); + this.fRefreshJob.schedule(); + } + } + + protected abstract String getRefreshMessage(); + + protected abstract Object getInput(); + + protected void doRefresh() { + // Accesses the catalog, which can block if done inside the UI thread. + final Object input = getInput(); + Display.getDefault().asyncExec(new Runnable() { + public void run() { + getViewer().setInput(input); + getViewer().refresh(); + } + }); + } + + protected void createColumn(final String columnText, final String uniqueID, + final int defaultWidth, final ColumnLabelProvider columnLabelProvider) { + PersistableColumn persistableColumn = new PersistableColumn(columnText, uniqueID, + defaultWidth, columnLabelProvider, this.fTreeViewer); + this.columns.add(persistableColumn); + Integer width = this.persistedValues.get(uniqueID); + if (width != null) { + persistableColumn.setWidth(width.intValue()); + } + } + + @Override + public void saveState(final IMemento memento) { + super.saveState(memento); + try { + for (PersistableColumn column : this.columns) { + column.saveState(memento); + } + } catch (Exception e) { + Logger.logError(e, "Error saving view state", Activator.getDefault()); //$NON-NLS-1$ + } + } + + @Override + public void init(final IViewSite site, final IMemento memento) throws PartInitException { + super.init(site, memento); + if (memento != null) { + String[] attributeKeys = memento.getAttributeKeys(); + for (String key : attributeKeys) { + this.persistedValues.put(key, memento.getInteger(key)); + } + } + } +} diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/src/org/eclipse/papyrus/emf/facet/common/ui/internal/views/ElementsView.java b/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/src/org/eclipse/papyrus/emf/facet/common/ui/internal/views/ElementsView.java index b5a01c715dd..477bb163c6d 100644 --- a/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/src/org/eclipse/papyrus/emf/facet/common/ui/internal/views/ElementsView.java +++ b/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/src/org/eclipse/papyrus/emf/facet/common/ui/internal/views/ElementsView.java @@ -1,208 +1,208 @@ -/*******************************************************************************
- * Copyright (c) 2010-2012 Mia-Software.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Nicolas Bros (Mia-Software) - initial API and implementation
- * Nicolas Bros (Mia-Software) - Bug 334116 - common tree view with columns
- * Nicolas Bros (Mia-Software) - Bug 372732 - [Facet] Rewrite the catalog views for 0.2
- *******************************************************************************/
-package org.eclipse.papyrus.emf.facet.common.ui.internal.views;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.jface.action.GroupMarker;
-import org.eclipse.jface.action.MenuManager;
-import org.eclipse.jface.viewers.ColumnLabelProvider;
-import org.eclipse.jface.viewers.IContentProvider;
-import org.eclipse.jface.viewers.IOpenListener;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.OpenEvent;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.papyrus.emf.facet.common.ui.internal.Activator;
-import org.eclipse.papyrus.emf.facet.common.ui.internal.Messages;
-import org.eclipse.papyrus.emf.facet.common.ui.internal.controls.PersistableColumn;
-import org.eclipse.papyrus.emf.facet.common.ui.internal.exported.views.IColumnDescription;
-import org.eclipse.papyrus.emf.facet.util.core.Logger;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.layout.FillLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Menu;
-import org.eclipse.ui.IMemento;
-import org.eclipse.ui.IViewSite;
-import org.eclipse.ui.IWorkbenchActionConstants;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.part.ViewPart;
-
-public class ElementsView extends ViewPart {
-
- private static final int JOB_SCHEDULE_DELAY = 500;
- private final Collection<? extends IColumnDescription> columnDescriptions;
- private final ITreeContentProvider contentProvider;
- private final Object input;
- private final List<PersistableColumn> columns = new ArrayList<PersistableColumn>();
- private final Map<String, Integer> persistedValues = new HashMap<String, Integer>();
- private TreeViewer treeViewer;
- private Job refreshJob = null;
- private final IOpenListener openListener;
- private final String title;
- private final Image titleImage;
-
- public ElementsView(final Collection<? extends IColumnDescription> columnDescriptions,
- final ITreeContentProvider contentProvider, final Object input, final String title, final Image titleImage, final IOpenListener openListener) {
- this.columnDescriptions = columnDescriptions;
- this.contentProvider = contentProvider;
- this.input = input;
- this.title = title;
- this.titleImage = titleImage;
- this.openListener = openListener;
- }
-
- public TreeViewer getViewer() {
- return this.treeViewer;
- }
-
- @Override
- public void createPartControl(final Composite parent) {
- setPartName(this.title);
- setTitleImage(this.titleImage);
- parent.setLayout(new FillLayout());
-
- this.treeViewer = new TreeViewer(parent, SWT.H_SCROLL | SWT.V_SCROLL | SWT.SINGLE
- | SWT.FULL_SELECTION);
- this.treeViewer.getTree().setLinesVisible(true);
- this.treeViewer.getTree().setHeaderVisible(true);
-
- this.treeViewer.addOpenListener(new IOpenListener() {
- public void open(final OpenEvent event) {
- ElementsView.this.open(event);
- }
- });
-
- createColumns();
- this.treeViewer.setContentProvider(getContentProvider());
- createContextMenu();
- getSite().setSelectionProvider(this.treeViewer);
- refresh(false);
- }
-
- protected void createContextMenu() {
- final MenuManager contextMenu = new MenuManager("#PopUp"); //$NON-NLS-1$
- contextMenu.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
- final Menu menu = contextMenu.createContextMenu(getViewer().getControl());
- getViewer().getControl().setMenu(menu);
- getSite().registerContextMenu(contextMenu, getViewer());
- }
-
- protected void createColumns() {
- for (IColumnDescription columnDescription : this.columnDescriptions) {
- createColumn(columnDescription.getTitle(), columnDescription.getUniqueID(),
- columnDescription.getDefaultWidth(), columnDescription.getColumnLabelProvider());
- }
- }
-
- protected IContentProvider getContentProvider() {
- return this.contentProvider;
- }
-
- protected void open(final OpenEvent event) {
- if (this.openListener != null) {
- this.openListener.open(event);
- }
- }
-
- @Override
- public void setFocus() {
- this.treeViewer.getControl().setFocus();
- }
-
- /** Optionally delayed refresh */
- protected void refresh(final boolean delayed) {
- if (this.refreshJob == null) {
- this.refreshJob = new Job(getRefreshMessage()) {
- @Override
- protected IStatus run(final IProgressMonitor monitor) {
- doRefresh();
- return Status.OK_STATUS;
- }
- };
- }
- // delayed until it stops changing
- this.refreshJob.cancel();
- if (delayed) {
- this.refreshJob.setPriority(Job.DECORATE);
- this.refreshJob.schedule(ElementsView.JOB_SCHEDULE_DELAY);
- } else {
- this.refreshJob.setPriority(Job.INTERACTIVE);
- this.refreshJob.schedule();
- }
- }
-
- protected String getRefreshMessage() {
- return NLS.bind(Messages.ElementsView_refreshJobTitle, this.title);
- }
-
- protected Object getInput() {
- return this.input;
- }
-
- protected void doRefresh() {
- // Accesses the catalog, which can block if done inside the UI thread.
- final Object viewerInput = getInput();
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- getViewer().setInput(viewerInput);
- getViewer().refresh();
- }
- });
- }
-
- protected void createColumn(final String columnText, final String uniqueID,
- final int defaultWidth, final ColumnLabelProvider columnLabelProvider) {
- PersistableColumn persistableColumn = new PersistableColumn(columnText, uniqueID,
- defaultWidth, columnLabelProvider, this.treeViewer);
- this.columns.add(persistableColumn);
- Integer width = this.persistedValues.get(uniqueID);
- if (width != null) {
- persistableColumn.setWidth(width.intValue());
- }
- }
-
- @Override
- public void saveState(final IMemento memento) {
- super.saveState(memento);
- try {
- for (PersistableColumn column : this.columns) {
- column.saveState(memento);
- }
- } catch (Exception e) {
- Logger.logError(e, "Error saving view state", Activator.getDefault()); //$NON-NLS-1$
- }
- }
-
- @Override
- public void init(final IViewSite site, final IMemento memento) throws PartInitException {
- super.init(site, memento);
- if (memento != null) {
- String[] attributeKeys = memento.getAttributeKeys();
- for (String key : attributeKeys) {
- this.persistedValues.put(key, memento.getInteger(key));
- }
- }
- }
-
-}
+/******************************************************************************* + * Copyright (c) 2010-2012 Mia-Software. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Nicolas Bros (Mia-Software) - initial API and implementation + * Nicolas Bros (Mia-Software) - Bug 334116 - common tree view with columns + * Nicolas Bros (Mia-Software) - Bug 372732 - [Facet] Rewrite the catalog views for 0.2 + *******************************************************************************/ +package org.eclipse.papyrus.emf.facet.common.ui.internal.views; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Status; +import org.eclipse.core.runtime.jobs.Job; +import org.eclipse.jface.action.GroupMarker; +import org.eclipse.jface.action.MenuManager; +import org.eclipse.jface.viewers.ColumnLabelProvider; +import org.eclipse.jface.viewers.IContentProvider; +import org.eclipse.jface.viewers.IOpenListener; +import org.eclipse.jface.viewers.ITreeContentProvider; +import org.eclipse.jface.viewers.OpenEvent; +import org.eclipse.jface.viewers.TreeViewer; +import org.eclipse.osgi.util.NLS; +import org.eclipse.papyrus.emf.facet.common.ui.internal.Activator; +import org.eclipse.papyrus.emf.facet.common.ui.internal.Messages; +import org.eclipse.papyrus.emf.facet.common.ui.internal.controls.PersistableColumn; +import org.eclipse.papyrus.emf.facet.common.ui.internal.exported.views.IColumnDescription; +import org.eclipse.papyrus.emf.facet.util.core.Logger; +import org.eclipse.swt.SWT; +import org.eclipse.swt.graphics.Image; +import org.eclipse.swt.layout.FillLayout; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Display; +import org.eclipse.swt.widgets.Menu; +import org.eclipse.ui.IMemento; +import org.eclipse.ui.IViewSite; +import org.eclipse.ui.IWorkbenchActionConstants; +import org.eclipse.ui.PartInitException; +import org.eclipse.ui.part.ViewPart; + +public class ElementsView extends ViewPart { + + private static final int JOB_SCHEDULE_DELAY = 500; + private final Collection<? extends IColumnDescription> columnDescriptions; + private final ITreeContentProvider contentProvider; + private final Object input; + private final List<PersistableColumn> columns = new ArrayList<PersistableColumn>(); + private final Map<String, Integer> persistedValues = new HashMap<String, Integer>(); + private TreeViewer treeViewer; + private Job refreshJob = null; + private final IOpenListener openListener; + private final String title; + private final Image titleImage; + + public ElementsView(final Collection<? extends IColumnDescription> columnDescriptions, + final ITreeContentProvider contentProvider, final Object input, final String title, final Image titleImage, final IOpenListener openListener) { + this.columnDescriptions = columnDescriptions; + this.contentProvider = contentProvider; + this.input = input; + this.title = title; + this.titleImage = titleImage; + this.openListener = openListener; + } + + public TreeViewer getViewer() { + return this.treeViewer; + } + + @Override + public void createPartControl(final Composite parent) { + setPartName(this.title); + setTitleImage(this.titleImage); + parent.setLayout(new FillLayout()); + + this.treeViewer = new TreeViewer(parent, SWT.H_SCROLL | SWT.V_SCROLL | SWT.SINGLE + | SWT.FULL_SELECTION); + this.treeViewer.getTree().setLinesVisible(true); + this.treeViewer.getTree().setHeaderVisible(true); + + this.treeViewer.addOpenListener(new IOpenListener() { + public void open(final OpenEvent event) { + ElementsView.this.open(event); + } + }); + + createColumns(); + this.treeViewer.setContentProvider(getContentProvider()); + createContextMenu(); + getSite().setSelectionProvider(this.treeViewer); + refresh(false); + } + + protected void createContextMenu() { + final MenuManager contextMenu = new MenuManager("#PopUp"); //$NON-NLS-1$ + contextMenu.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS)); + final Menu menu = contextMenu.createContextMenu(getViewer().getControl()); + getViewer().getControl().setMenu(menu); + getSite().registerContextMenu(contextMenu, getViewer()); + } + + protected void createColumns() { + for (IColumnDescription columnDescription : this.columnDescriptions) { + createColumn(columnDescription.getTitle(), columnDescription.getUniqueID(), + columnDescription.getDefaultWidth(), columnDescription.getColumnLabelProvider()); + } + } + + protected IContentProvider getContentProvider() { + return this.contentProvider; + } + + protected void open(final OpenEvent event) { + if (this.openListener != null) { + this.openListener.open(event); + } + } + + @Override + public void setFocus() { + this.treeViewer.getControl().setFocus(); + } + + /** Optionally delayed refresh */ + protected void refresh(final boolean delayed) { + if (this.refreshJob == null) { + this.refreshJob = new Job(getRefreshMessage()) { + @Override + protected IStatus run(final IProgressMonitor monitor) { + doRefresh(); + return Status.OK_STATUS; + } + }; + } + // delayed until it stops changing + this.refreshJob.cancel(); + if (delayed) { + this.refreshJob.setPriority(Job.DECORATE); + this.refreshJob.schedule(ElementsView.JOB_SCHEDULE_DELAY); + } else { + this.refreshJob.setPriority(Job.INTERACTIVE); + this.refreshJob.schedule(); + } + } + + protected String getRefreshMessage() { + return NLS.bind(Messages.ElementsView_refreshJobTitle, this.title); + } + + protected Object getInput() { + return this.input; + } + + protected void doRefresh() { + // Accesses the catalog, which can block if done inside the UI thread. + final Object viewerInput = getInput(); + Display.getDefault().asyncExec(new Runnable() { + public void run() { + getViewer().setInput(viewerInput); + getViewer().refresh(); + } + }); + } + + protected void createColumn(final String columnText, final String uniqueID, + final int defaultWidth, final ColumnLabelProvider columnLabelProvider) { + PersistableColumn persistableColumn = new PersistableColumn(columnText, uniqueID, + defaultWidth, columnLabelProvider, this.treeViewer); + this.columns.add(persistableColumn); + Integer width = this.persistedValues.get(uniqueID); + if (width != null) { + persistableColumn.setWidth(width.intValue()); + } + } + + @Override + public void saveState(final IMemento memento) { + super.saveState(memento); + try { + for (PersistableColumn column : this.columns) { + column.saveState(memento); + } + } catch (Exception e) { + Logger.logError(e, "Error saving view state", Activator.getDefault()); //$NON-NLS-1$ + } + } + + @Override + public void init(final IViewSite site, final IMemento memento) throws PartInitException { + super.init(site, memento); + if (memento != null) { + String[] attributeKeys = memento.getAttributeKeys(); + for (String key : attributeKeys) { + this.persistedValues.put(key, memento.getInteger(key)); + } + } + } + +} diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/src/org/eclipse/papyrus/emf/facet/common/ui/internal/views/ElementsViewFactory.java b/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/src/org/eclipse/papyrus/emf/facet/common/ui/internal/views/ElementsViewFactory.java index 2fa57ccc31f..84046cae285 100644 --- a/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/src/org/eclipse/papyrus/emf/facet/common/ui/internal/views/ElementsViewFactory.java +++ b/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/src/org/eclipse/papyrus/emf/facet/common/ui/internal/views/ElementsViewFactory.java @@ -1,52 +1,52 @@ -/*******************************************************************************
- * Copyright (c) 2012 CEA LIST.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Nicolas Bros (Mia-Software) - Bug 372732 - [Facet] Rewrite the catalog views for 0.2
- *******************************************************************************/
-
-package org.eclipse.papyrus.emf.facet.common.ui.internal.views;
-
-import java.util.Collection;
-
-import org.eclipse.jface.viewers.ColumnLabelProvider;
-import org.eclipse.jface.viewers.IOpenListener;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.papyrus.emf.facet.common.ui.internal.exported.views.IColumnDescription;
-import org.eclipse.papyrus.emf.facet.common.ui.internal.exported.views.IElementsViewFactory;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.part.ViewPart;
-
-public class ElementsViewFactory implements IElementsViewFactory {
-
- public ViewPart createElementsView(final Collection<? extends IColumnDescription> columns,
- final ITreeContentProvider contentProvider, final Object input, final String title, final Image titleImage, final IOpenListener openListener) {
- return new ElementsView(columns, contentProvider, input, title, titleImage, openListener);
- }
-
- public IColumnDescription createColumnDescription(final String columnText,
- final String uniqueID, final int defaultWidth,
- final ColumnLabelProvider columnLabelProvider) {
- return new IColumnDescription() {
- public String getUniqueID() {
- return uniqueID;
- }
-
- public int getDefaultWidth() {
- return defaultWidth;
- }
-
- public String getTitle() {
- return columnText;
- }
-
- public ColumnLabelProvider getColumnLabelProvider() {
- return columnLabelProvider;
- }
- };
- }
-}
+/******************************************************************************* + * Copyright (c) 2012 CEA LIST. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Nicolas Bros (Mia-Software) - Bug 372732 - [Facet] Rewrite the catalog views for 0.2 + *******************************************************************************/ + +package org.eclipse.papyrus.emf.facet.common.ui.internal.views; + +import java.util.Collection; + +import org.eclipse.jface.viewers.ColumnLabelProvider; +import org.eclipse.jface.viewers.IOpenListener; +import org.eclipse.jface.viewers.ITreeContentProvider; +import org.eclipse.papyrus.emf.facet.common.ui.internal.exported.views.IColumnDescription; +import org.eclipse.papyrus.emf.facet.common.ui.internal.exported.views.IElementsViewFactory; +import org.eclipse.swt.graphics.Image; +import org.eclipse.ui.part.ViewPart; + +public class ElementsViewFactory implements IElementsViewFactory { + + public ViewPart createElementsView(final Collection<? extends IColumnDescription> columns, + final ITreeContentProvider contentProvider, final Object input, final String title, final Image titleImage, final IOpenListener openListener) { + return new ElementsView(columns, contentProvider, input, title, titleImage, openListener); + } + + public IColumnDescription createColumnDescription(final String columnText, + final String uniqueID, final int defaultWidth, + final ColumnLabelProvider columnLabelProvider) { + return new IColumnDescription() { + public String getUniqueID() { + return uniqueID; + } + + public int getDefaultWidth() { + return defaultWidth; + } + + public String getTitle() { + return columnText; + } + + public ColumnLabelProvider getColumnLabelProvider() { + return columnLabelProvider; + } + }; + } +} diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/src/org/eclipse/papyrus/emf/facet/common/ui/internal/widgets/AnywhereFilterMatcher.java b/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/src/org/eclipse/papyrus/emf/facet/common/ui/internal/widgets/AnywhereFilterMatcher.java index 0ea62c756f7..4d99552b99b 100644 --- a/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/src/org/eclipse/papyrus/emf/facet/common/ui/internal/widgets/AnywhereFilterMatcher.java +++ b/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/src/org/eclipse/papyrus/emf/facet/common/ui/internal/widgets/AnywhereFilterMatcher.java @@ -1,28 +1,28 @@ -/*******************************************************************************
- * Copyright (c) 2010 Mia-Software.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Nicolas Bros (Mia-Software)
- *******************************************************************************/
-package org.eclipse.papyrus.emf.facet.common.ui.internal.widgets;
-
-import org.eclipse.papyrus.emf.facet.common.core.internal.utils.StringMatcher;
-import org.eclipse.ui.dialogs.FilteredList.FilterMatcher;
-
-/** This is a matcher that matches anywhere, not just at the beginning. */
-public class AnywhereFilterMatcher implements FilterMatcher {
- private StringMatcher fMatcher;
-
- public void setFilter(final String pattern, final boolean ignoreCase,
- final boolean ignoreWildCards) {
- this.fMatcher = new StringMatcher('*' + pattern + '*', ignoreCase, ignoreWildCards);
- }
-
- public boolean match(final Object element) {
- return this.fMatcher.match(element.toString());
- }
-}
+/******************************************************************************* + * Copyright (c) 2010 Mia-Software. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Nicolas Bros (Mia-Software) + *******************************************************************************/ +package org.eclipse.papyrus.emf.facet.common.ui.internal.widgets; + +import org.eclipse.papyrus.emf.facet.common.core.internal.utils.StringMatcher; +import org.eclipse.ui.dialogs.FilteredList.FilterMatcher; + +/** This is a matcher that matches anywhere, not just at the beginning. */ +public class AnywhereFilterMatcher implements FilterMatcher { + private StringMatcher fMatcher; + + public void setFilter(final String pattern, final boolean ignoreCase, + final boolean ignoreWildCards) { + this.fMatcher = new StringMatcher('*' + pattern + '*', ignoreCase, ignoreWildCards); + } + + public boolean match(final Object element) { + return this.fMatcher.match(element.toString()); + } +} |