moved old sources to other repo
diff --git a/old/ECPDeveloper/.project b/old/ECPDeveloper/.project
new file mode 100644
index 0000000..56f0028
--- /dev/null
+++ b/old/ECPDeveloper/.project
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>ECPDeveloper</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.pde.FeatureBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.FeatureNature</nature>
+ </natures>
+</projectDescription>
diff --git a/old/ECPDeveloper/build.properties b/old/ECPDeveloper/build.properties
new file mode 100644
index 0000000..82ab19c
--- /dev/null
+++ b/old/ECPDeveloper/build.properties
@@ -0,0 +1 @@
+bin.includes = feature.xml
diff --git a/old/ECPDeveloper/coding/emfcpFormatter.xml b/old/ECPDeveloper/coding/emfcpFormatter.xml
new file mode 100644
index 0000000..7079afd
--- /dev/null
+++ b/old/ECPDeveloper/coding/emfcpFormatter.xml
@@ -0,0 +1,279 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<profiles version="11">
+<profile kind="CodeFormatterProfile" name="emfstoreFormatter" version="11">
+<setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.disabling_tag" value="@formatter:off"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration" value="end_of_line"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_field" value="0"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.use_on_off_tags" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line" value="false"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_ellipsis" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_multiple_fields" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_conditional_expression" value="80"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_binary_operator" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.brace_position_for_array_initializer" value="end_of_line"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.blank_lines_after_package" value="1"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.continuation_indentation" value="1"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk" value="1"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_binary_operator" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_package" value="0"/>
+<setting id="org.eclipse.jdt.core.compiler.source" value="1.5"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.format_line_comments" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.join_wrapped_lines" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_member_type" value="1"/>
+<setting id="org.eclipse.jdt.core.formatter.align_type_members_on_columns" value="false"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_unary_operator" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.indent_parameter_description" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.lineSplit" value="120"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration" value="0"/>
+<setting id="org.eclipse.jdt.core.formatter.indentation.size" value="4"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.enabling_tag" value="@formatter:on"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_assignment" value="0"/>
+<setting id="org.eclipse.jdt.core.compiler.problem.assertIdentifier" value="error"/>
+<setting id="org.eclipse.jdt.core.formatter.tabulation.char" value="tab"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.indent_statements_compare_to_body" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_method" value="1"/>
+<setting id="org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line" value="false"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration" value="end_of_line"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_method_declaration" value="0"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.brace_position_for_switch" value="end_of_line"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.compiler.problem.enumIdentifier" value="error"/>
+<setting id="org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch" value="false"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_ellipsis" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.brace_position_for_block" value="end_of_line"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.brace_position_for_method_declaration" value="end_of_line"/>
+<setting id="org.eclipse.jdt.core.formatter.compact_else_if" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.brace_position_for_enum_constant" value="end_of_line"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.indent_root_tags" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.tabulation.size" value="4"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment" value="false"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.indent_empty_lines" value="false"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.brace_position_for_block_in_case" value="end_of_line"/>
+<setting id="org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve" value="1"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression" value="16"/>
+<setting id="org.eclipse.jdt.core.compiler.compliance" value="1.5"/>
+<setting id="org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer" value="1"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_unary_operator" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line" value="false"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line" value="false"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_binary_expression" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration" value="end_of_line"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode" value="enabled"/>
+<setting id="org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_label" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.format_javadoc_comments" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.line_length" value="120"/>
+<setting id="org.eclipse.jdt.core.formatter.blank_lines_between_import_groups" value="1"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration" value="end_of_line"/>
+<setting id="org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body" value="0"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.wrap_before_binary_operator" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations" value="1"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.indent_statements_compare_to_block" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.join_lines_in_comments" value="false"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_compact_if" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_imports" value="1"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.format_html" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.format_source_code" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer" value="insert"/>
+<setting id="org.eclipse.jdt.core.compiler.codegen.targetPlatform" value="1.5"/>
+<setting id="org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations" value="false"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation" value="0"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_member" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.format_header" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.format_block_comments" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_enum_constants" value="0"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.brace_position_for_type_declaration" value="end_of_line"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.blank_lines_after_imports" value="1"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column" value="false"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column" value="false"/>
+<setting id="org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line" value="false"/>
+</profile>
+</profiles>
diff --git a/old/ECPDeveloper/coding/emfcpStyle5.xml b/old/ECPDeveloper/coding/emfcpStyle5.xml
new file mode 100644
index 0000000..f3c99fd
--- /dev/null
+++ b/old/ECPDeveloper/coding/emfcpStyle5.xml
@@ -0,0 +1,227 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE module PUBLIC "-//Puppy Crawl//DTD Check Configuration 1.3//EN" "http://www.puppycrawl.com/dtds/configuration_1_3.dtd">
+
+<!--
+ This configuration file was written by the eclipse-cs plugin configuration editor
+-->
+<!--
+ Checkstyle-Configuration: emfcpStyle
+ Description: none
+-->
+<module name="Checker">
+ <property name="severity" value="warning"/>
+ <module name="TreeWalker">
+ <property name="tabWidth" value="4"/>
+ <module name="FileContentsHolder"/>
+ <module name="JavadocMethod">
+ <property name="scope" value="package"/>
+ </module>
+ <module name="JavadocType">
+ <property name="allowUnknownTags" value="true"/>
+ </module>
+ <module name="JavadocVariable">
+ <property name="scope" value="package"/>
+ </module>
+ <module name="JavadocStyle"/>
+ <module name="ConstantName"/>
+ <module name="LocalFinalVariableName"/>
+ <module name="LocalVariableName"/>
+ <module name="MemberName"/>
+ <module name="MethodName"/>
+ <module name="PackageName"/>
+ <module name="ParameterName"/>
+ <module name="StaticVariableName"/>
+ <module name="TypeName"/>
+ <module name="AvoidStarImport"/>
+ <module name="IllegalImport"/>
+ <module name="RedundantImport"/>
+ <module name="UnusedImports"/>
+ <module name="LineLength">
+ <property name="severity" value="ignore"/>
+ <metadata name="net.sf.eclipsecs.core.lastEnabledSeverity" value="inherit"/>
+ </module>
+ <module name="MethodLength"/>
+ <module name="ParameterNumber"/>
+ <module name="EmptyForIteratorPad">
+ <property name="severity" value="ignore"/>
+ <metadata name="net.sf.eclipsecs.core.lastEnabledSeverity" value="inherit"/>
+ </module>
+ <module name="MethodParamPad">
+ <property name="severity" value="ignore"/>
+ <metadata name="net.sf.eclipsecs.core.lastEnabledSeverity" value="inherit"/>
+ </module>
+ <module name="NoWhitespaceAfter">
+ <property name="severity" value="ignore"/>
+ <property name="tokens" value="BNOT,DEC,DOT,INC,LNOT,UNARY_MINUS,UNARY_PLUS"/>
+ <metadata name="net.sf.eclipsecs.core.lastEnabledSeverity" value="inherit"/>
+ </module>
+ <module name="NoWhitespaceBefore">
+ <property name="severity" value="ignore"/>
+ <metadata name="net.sf.eclipsecs.core.lastEnabledSeverity" value="inherit"/>
+ </module>
+ <module name="OperatorWrap">
+ <property name="severity" value="ignore"/>
+ <metadata name="net.sf.eclipsecs.core.lastEnabledSeverity" value="inherit"/>
+ </module>
+ <module name="ParenPad">
+ <property name="severity" value="ignore"/>
+ <metadata name="net.sf.eclipsecs.core.lastEnabledSeverity" value="inherit"/>
+ </module>
+ <module name="TypecastParenPad">
+ <property name="severity" value="ignore"/>
+ <metadata name="net.sf.eclipsecs.core.lastEnabledSeverity" value="inherit"/>
+ </module>
+ <module name="WhitespaceAfter">
+ <property name="severity" value="ignore"/>
+ <metadata name="net.sf.eclipsecs.core.lastEnabledSeverity" value="inherit"/>
+ </module>
+ <module name="WhitespaceAround">
+ <property name="severity" value="ignore"/>
+ <metadata name="net.sf.eclipsecs.core.lastEnabledSeverity" value="inherit"/>
+ </module>
+ <module name="ModifierOrder"/>
+ <module name="RedundantModifier"/>
+ <module name="AvoidNestedBlocks">
+ <property name="severity" value="ignore"/>
+ <metadata name="net.sf.eclipsecs.core.lastEnabledSeverity" value="inherit"/>
+ </module>
+ <module name="EmptyBlock">
+ <property name="severity" value="ignore"/>
+ <metadata name="net.sf.eclipsecs.core.lastEnabledSeverity" value="inherit"/>
+ </module>
+ <module name="LeftCurly">
+ <property name="severity" value="ignore"/>
+ <metadata name="net.sf.eclipsecs.core.lastEnabledSeverity" value="inherit"/>
+ </module>
+ <module name="NeedBraces"/>
+ <module name="RightCurly">
+ <property name="severity" value="ignore"/>
+ <metadata name="net.sf.eclipsecs.core.lastEnabledSeverity" value="inherit"/>
+ </module>
+ <module name="AvoidInlineConditionals">
+ <property name="severity" value="ignore"/>
+ <metadata name="net.sf.eclipsecs.core.lastEnabledSeverity" value="inherit"/>
+ </module>
+ <module name="DoubleCheckedLocking"/>
+ <module name="EmptyStatement"/>
+ <module name="EqualsHashCode"/>
+ <module name="HiddenField">
+ <property name="severity" value="ignore"/>
+ <metadata name="net.sf.eclipsecs.core.lastEnabledSeverity" value="inherit"/>
+ </module>
+ <module name="IllegalInstantiation"/>
+ <module name="InnerAssignment"/>
+ <module name="MagicNumber">
+ <property name="severity" value="ignore"/>
+ <metadata name="net.sf.eclipsecs.core.lastEnabledSeverity" value="inherit"/>
+ </module>
+ <module name="MissingSwitchDefault"/>
+ <module name="RedundantThrows">
+ <property name="allowUnchecked" value="true"/>
+ <property name="allowSubclasses" value="true"/>
+ </module>
+ <module name="SimplifyBooleanExpression"/>
+ <module name="SimplifyBooleanReturn"/>
+ <module name="DesignForExtension">
+ <property name="severity" value="ignore"/>
+ <metadata name="net.sf.eclipsecs.core.lastEnabledSeverity" value="inherit"/>
+ </module>
+ <module name="FinalClass"/>
+ <module name="HideUtilityClassConstructor"/>
+ <module name="InterfaceIsType"/>
+ <module name="VisibilityModifier"/>
+ <module name="ArrayTypeStyle"/>
+ <module name="FinalParameters">
+ <property name="severity" value="ignore"/>
+ <metadata name="net.sf.eclipsecs.core.lastEnabledSeverity" value="inherit"/>
+ </module>
+ <module name="GenericIllegalRegexp">
+ <property name="severity" value="ignore"/>
+ <metadata name="net.sf.eclipsecs.core.lastEnabledSeverity" value="inherit"/>
+ </module>
+ <module name="TodoComment">
+ <property name="severity" value="ignore"/>
+ <metadata name="net.sf.eclipsecs.core.lastEnabledSeverity" value="inherit"/>
+ </module>
+ <module name="UpperEll"/>
+ <module name="BooleanExpressionComplexity">
+ <property name="max" value="5"/>
+ </module>
+ <module name="CyclomaticComplexity">
+ <property name="max" value="15"/>
+ </module>
+ <module name="NPathComplexity">
+ <property name="max" value="220"/>
+ </module>
+ <module name="SuperClone"/>
+ <module name="SuperFinalize"/>
+ <module name="PackageDeclaration"/>
+ <module name="NestedIfDepth">
+ <property name="max" value="2"/>
+ </module>
+ <module name="IllegalCatch">
+ <property name="id" value="IllegalExceptionCatch"/>
+ </module>
+ <module name="IllegalThrows">
+ <property name="illegalClassNames" value="java.lang.Throwable, java.lang.Error, java.lang.RuntimeException, java.lang.Exception"/>
+ </module>
+ <module name="CovariantEquals"/>
+ <module name="DefaultComesLast"/>
+ <module name="ExplicitInitialization"/>
+ <module name="FallThrough"/>
+ <module name="AnonInnerLength">
+ <property name="max" value="30"/>
+ </module>
+ <module name="ThrowsCount">
+ <property name="max" value="3"/>
+ </module>
+ <module name="UncommentedMain"/>
+ <module name="CyclomaticComplexity">
+ <property name="id" value="complexity"/>
+ <property name="max" value="15"/>
+ </module>
+ <module name="PackageHtml">
+ <property name="severity" value="ignore"/>
+ <metadata name="net.sf.eclipsecs.core.lastEnabledSeverity" value="inherit"/>
+ </module>
+ </module>
+ <module name="FileLength">
+ <property name="severity" value="info"/>
+ </module>
+ <module name="FileTabCharacter">
+ <property name="severity" value="ignore"/>
+ <metadata name="net.sf.eclipsecs.core.lastEnabledSeverity" value="inherit"/>
+ </module>
+ <module name="NewlineAtEndOfFile">
+ <property name="severity" value="ignore"/>
+ <metadata name="net.sf.eclipsecs.core.lastEnabledSeverity" value="inherit"/>
+ </module>
+ <module name="Translation"/>
+ <module name="SuppressionCommentFilter">
+ <property name="offCommentFormat" value="(@generated$)|(// end of custom code$)"/>
+ <property name="onCommentFormat" value="(@generated NOT$)|(// begin of custom code$)"/>
+ <metadata name="com.atlassw.tools.eclipse.checkstyle.customMessage" value="Warning suppressed because code is generated by EMF. Warning enabled on custom code"/>
+ <metadata name="com.atlassw.tools.eclipse.checkstyle.comment" value="Supress Warnings on EMF generated code. No Supress Warning on manual code"/>
+ </module>
+ <module name="SuppressionCommentFilter">
+ <property name="offCommentFormat" value="// BEGIN SUPRESS CATCH EXCEPTION"/>
+ <property name="onCommentFormat" value="// END SUPRESS CATCH EXCEPTION"/>
+ <property name="messageFormat" value=".*Exception.*"/>
+ <metadata name="com.atlassw.tools.eclipse.checkstyle.comment" value="SupressCatchExceptionWarning"/>
+ </module>
+ <module name="SuppressionCommentFilter">
+ <property name="offCommentFormat" value="// BEGIN IGNORE UNNECCESSARY IMPORT"/>
+ <property name="onCommentFormat" value="// END IGNORE UNNECCESSARY IMPORT"/>
+ <property name="messageFormat" value=".*import.*"/>
+ <metadata name="com.atlassw.tools.eclipse.checkstyle.comment" value="Ignore unneccessary import warnings"/>
+ </module>
+ <module name="SuppressionCommentFilter">
+ <property name="offCommentFormat" value="// BEGIN COMPLEX CODE"/>
+ <property name="onCommentFormat" value="// END COMPLEX CODE"/>
+ <metadata name="com.atlassw.tools.eclipse.checkstyle.comment" value="High Complexity Code Warning Suppression"/>
+ </module>
+ <module name="RegexpHeader">
+ <property name="headerFile" value="${samedir}/header.txt"/>
+ <property name="fileExtensions" value="java"/>
+ </module>
+</module>
diff --git a/old/ECPDeveloper/coding/header.txt b/old/ECPDeveloper/coding/header.txt
new file mode 100644
index 0000000..cbfa297
--- /dev/null
+++ b/old/ECPDeveloper/coding/header.txt
@@ -0,0 +1,9 @@
+^\/\*+$
+^ \* Copyright( \(c\))? \d\d\d\d(-\d\d\d\d)? ((Chair for Applied Software Engineering\,)|(Florian Pirchner \(Vienna\, Austria\) and others\.)|(EclipseSource Muenchen GmbH\.))$
+^ \* ((Technische Universitaet Muenchen\.)|())$
+^ \* 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\:.*$
\ No newline at end of file
diff --git a/old/ECPDeveloper/feature.xml b/old/ECPDeveloper/feature.xml
new file mode 100644
index 0000000..7ce10e1
--- /dev/null
+++ b/old/ECPDeveloper/feature.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<feature
+ id="ECPDeveloper"
+ label="ECPDeveloper"
+ version="1.0.0.qualifier">
+
+ <description url="http://www.example.com/description">
+ [Enter Feature Description here.]
+ </description>
+
+ <copyright url="http://www.example.com/copyright">
+ [Enter Copyright Description here.]
+ </copyright>
+
+ <license url="http://www.example.com/license">
+ [Enter License Description here.]
+ </license>
+
+</feature>
diff --git a/old/org.eclipse.emf.ecp.common.model/.checkstyle b/old/org.eclipse.emf.ecp.common.model/.checkstyle
new file mode 100644
index 0000000..d4fa17e
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.common.model/.checkstyle
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<fileset-config file-format-version="1.2.0" simple-config="true" sync-formatter="false">
+ <fileset name="all" enabled="true" check-config-name="emfcpStyle" local="false">
+ <file-match-pattern match-pattern="." include-pattern="true"/>
+ </fileset>
+</fileset-config>
diff --git a/old/org.eclipse.emf.ecp.common.model/.classpath b/old/org.eclipse.emf.ecp.common.model/.classpath
new file mode 100644
index 0000000..304e861
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.common.model/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <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="output" path="bin"/>
+</classpath>
diff --git a/old/org.eclipse.emf.ecp.common.model/.project b/old/org.eclipse.emf.ecp.common.model/.project
new file mode 100644
index 0000000..846e37d
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.common.model/.project
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.emf.ecp.common.model</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>net.sf.eclipsecs.core.CheckstyleBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>net.sf.eclipsecs.core.CheckstyleNature</nature>
+ </natures>
+</projectDescription>
diff --git a/old/org.eclipse.emf.ecp.common.model/.settings/org.eclipse.jdt.core.prefs b/old/org.eclipse.emf.ecp.common.model/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 0000000..d92bc31
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.common.model/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,8 @@
+#Tue Dec 07 12:39:51 CET 2010
+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
diff --git a/old/org.eclipse.emf.ecp.common.model/META-INF/MANIFEST.MF b/old/org.eclipse.emf.ecp.common.model/META-INF/MANIFEST.MF
new file mode 100644
index 0000000..93e9c9b
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.common.model/META-INF/MANIFEST.MF
@@ -0,0 +1,15 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: ECP Model
+Bundle-SymbolicName: org.eclipse.emf.ecp.common.model;singleton:=true
+Bundle-Version: 0.9.3.qualifier
+Bundle-Activator: org.eclipse.emf.ecp.common.model.Activator
+Require-Bundle: org.eclipse.emf.ecp.common.util;visibility:=reexport
+Bundle-ActivationPolicy: lazy
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Export-Package: org.eclipse.emf.ecp.common.model,
+ org.eclipse.emf.ecp.common.model.workSpaceModel,
+ org.eclipse.emf.ecp.common.model.workSpaceModel.impl,
+ org.eclipse.emf.ecp.common.model.workSpaceModel.provider,
+ org.eclipse.emf.ecp.common.model.workSpaceModel.util
+Bundle-Vendor: Eclipse Modeling Project
diff --git a/old/org.eclipse.emf.ecp.common.model/build.properties b/old/org.eclipse.emf.ecp.common.model/build.properties
new file mode 100644
index 0000000..5952bfe
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.common.model/build.properties
@@ -0,0 +1,7 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ plugin.xml,\
+ schema/
+src.includes = schema/
diff --git a/old/org.eclipse.emf.ecp.common.model/model/workspaceModel.ecore b/old/org.eclipse.emf.ecp.common.model/model/workspaceModel.ecore
new file mode 100644
index 0000000..f46f2b4
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.common.model/model/workspaceModel.ecore
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ecore:EPackage xmi:version="2.0"
+ xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="workSpaceModel"
+ nsURI="http://eclipse.org/emf/ecp/common/model/workspaceModel" nsPrefix="org.eclipse.emf.ecp.common.model">
+ <eClassifiers xsi:type="ecore:EClass" name="ECPWorkspace">
+ <eStructuralFeatures xsi:type="ecore:EReference" name="projects" upperBound="-1"
+ eType="#//ECPProject" containment="true" eOpposite="#//ECPProject/workspace"/>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="activeProject" eType="#//ECPProject"/>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="ECPProject" abstract="true">
+ <eStructuralFeatures xsi:type="ecore:EReference" name="workspace" eType="#//ECPWorkspace"
+ eOpposite="#//ECPWorkspace/projects"/>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="rootObject" eType="ecore:EClass http://www.eclipse.org/emf/2002/Ecore#//EObject"/>
+ </eClassifiers>
+</ecore:EPackage>
diff --git a/old/org.eclipse.emf.ecp.common.model/model/workspaceModel.genmodel b/old/org.eclipse.emf.ecp.common.model/model/workspaceModel.genmodel
new file mode 100644
index 0000000..0eb8130
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.common.model/model/workspaceModel.genmodel
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<genmodel:GenModel xmi:version="2.0"
+ xmlns:xmi="http://www.omg.org/XMI" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
+ xmlns:genmodel="http://www.eclipse.org/emf/2002/GenModel" copyrightText="Copyright 2011 Chair for Applied Software Engineering,
Technische Universitaet Muenchen.
All rights reserved. This program and the accompanying materials
are made available under the Eclipse Public License v1.0
which accompanies this distribution, and is available at
http://www.eclipse.org/legal/epl-v10.html

Contributors:"
+ modelDirectory="/org.eclipse.emf.ecp.common.model/src" editDirectory="/org.eclipse.emf.ecp.common.model/src/"
+ editorDirectory="/org.eclipse.emf.ecp.common.model.editor/src" modelPluginID="org.eclipse.emf.ecp.common.model"
+ modelName="WorkspaceModel" modelPluginClass="" editPluginClass="org.eclipse.emf.ecp.common.model.workSpaceModel.provider.WorkspaceModelEditPlugin"
+ editorPluginClass="org.eclipse.emf.ecp.common.model.workSpaceModel.presentation.WorkspaceModelEditorPlugin"
+ testSuiteClass="org.eclipse.emf.ecp.common.model.workSpaceModel.tests.WorkspaceModelAllTests"
+ importerID="org.eclipse.emf.importer.ecore" complianceLevel="5.0" copyrightFields="false"
+ editPluginID="org.eclipse.emf.ecp.common.model" editorPluginID="org.eclipse.emf.ecp.common.model.editor">
+ <foreignModel>workspaceModel.ecore</foreignModel>
+ <genPackages prefix="WorkSpaceModel" basePackage="org.eclipse.emf.ecp.common.model"
+ disposableProviderFactory="true" ecorePackage="workspaceModel.ecore#/">
+ <genClasses image="false" ecoreClass="workspaceModel.ecore#//ECPWorkspace">
+ <genFeatures children="true" createChild="true" propertySortChoices="true" ecoreFeature="ecore:EReference workspaceModel.ecore#//ECPWorkspace/projects"/>
+ <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference workspaceModel.ecore#//ECPWorkspace/activeProject"/>
+ </genClasses>
+ <genClasses image="false" ecoreClass="workspaceModel.ecore#//ECPProject">
+ <genFeatures property="None" notify="false" createChild="false" ecoreFeature="ecore:EReference workspaceModel.ecore#//ECPProject/workspace"/>
+ <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference workspaceModel.ecore#//ECPProject/rootObject"/>
+ </genClasses>
+ </genPackages>
+</genmodel:GenModel>
diff --git a/old/org.eclipse.emf.ecp.common.model/plugin.properties b/old/org.eclipse.emf.ecp.common.model/plugin.properties
new file mode 100644
index 0000000..08eaa49
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.common.model/plugin.properties
@@ -0,0 +1,10 @@
+# * Copyright (c) 2008-2011 Chair for Applied Software Engineering, Technische Universitaet Muenchen.
+# * 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:
+
+pluginName = WorkspaceModel Model
+providerName = www.example.org
diff --git a/old/org.eclipse.emf.ecp.common.model/plugin.xml b/old/org.eclipse.emf.ecp.common.model/plugin.xml
new file mode 100644
index 0000000..e9bd302
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.common.model/plugin.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+<plugin>
+
+ <extension-point id="org.eclipse.emf.ecp.model.workspaceprovider" name="ECP Workspace" schema="schema/org.eclipse.emf.ecp.model.workspaceprovider.exsd"/>
+ <extension-point id="org.eclipse.emf.ecp.model.postinit" name="ECP Workspace Init Complete" schema="schema/org.eclipse.emf.ecp.model.postinit.exsd"/>
+ <extension-point id="org.eclipse.emf.ecp.model.ecppackage" name="ECP Model Package" schema="schema/org.eclipse.emf.ecp.model.ecppackage.exsd"/>
+
+ <extension
+ point="org.eclipse.emf.edit.itemProviderAdapterFactories">
+ <factory
+ class="org.eclipse.emf.ecp.common.model.workSpaceModel.provider.WorkSpaceModelItemProviderAdapterFactory"
+ supportedTypes="org.eclipse.emf.edit.provider.IEditingDomainItemProvider org.eclipse.emf.edit.provider.IStructuredItemContentProvider org.eclipse.emf.edit.provider.ITreeItemContentProvider org.eclipse.emf.edit.provider.IItemLabelProvider org.eclipse.emf.edit.provider.IItemPropertySource"
+ uri="http://eclipse.org/emf/ecp/common/model/workspaceModel">
+ </factory>
+ </extension>
+ <extension
+ point="org.eclipse.emf.ecore.generated_package">
+ <package
+ class="org.eclipse.emf.ecp.common.model.workSpaceModel.WorkSpaceModelPackage"
+ genModel="model/workspaceModel.gemodel"
+ uri="http://eclipse.org/emf/ecp/common/model/workspaceModel">
+ </package>
+ </extension>
+</plugin>
diff --git a/old/org.eclipse.emf.ecp.common.model/pom.xml b/old/org.eclipse.emf.ecp.common.model/pom.xml
new file mode 100644
index 0000000..4ede6b4
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.common.model/pom.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.eclipse.emf.emfstore</groupId>
+ <artifactId>emfstore-parent</artifactId>
+ <version>0.9.3-SNAPSHOT</version>
+ <relativePath>../../org.eclipse.emf.emfstore.releng/emfstore-parent/</relativePath>
+ </parent>
+ <groupId>org.eclipse.emf.emfstore</groupId>
+ <artifactId>org.eclipse.emf.ecp.common.model</artifactId>
+ <version>0.9.3-SNAPSHOT</version>
+ <packaging>eclipse-plugin</packaging>
+</project>
diff --git a/old/org.eclipse.emf.ecp.common.model/schema/org.eclipse.emf.ecp.model.ecppackage.exsd b/old/org.eclipse.emf.ecp.common.model/schema/org.eclipse.emf.ecp.model.ecppackage.exsd
new file mode 100644
index 0000000..7115ca6
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.common.model/schema/org.eclipse.emf.ecp.model.ecppackage.exsd
@@ -0,0 +1,99 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- Schema file written by PDE -->
+<schema targetNamespace="org.eclipse.emf.ecp.model" xmlns="http://www.w3.org/2001/XMLSchema">
+<annotation>
+ <appinfo>
+ <meta.schema plugin="org.eclipse.emf.ecp.model" id="org.eclipse.emf.ecp.model.ecppackage" name="ECP Package"/>
+ </appinfo>
+ <documentation>
+ Allows to register a EPackage which is displayed by EMF client platform. EMF Client Platform allows to create entities of the registered packages.
+ </documentation>
+ </annotation>
+
+ <element name="extension">
+ <annotation>
+ <appinfo>
+ <meta.element />
+ </appinfo>
+ </annotation>
+ <complexType>
+ <sequence>
+ <element ref="modelPackage" minOccurs="1" maxOccurs="unbounded"/>
+ </sequence>
+ <attribute name="point" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="id" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="name" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appinfo>
+ <meta.attribute translatable="true"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="modelPackage">
+ <complexType>
+ <attribute name="modelPackage" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="since"/>
+ </appinfo>
+ <documentation>
+ 0.6.7.nightly
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="examples"/>
+ </appinfo>
+ <documentation>
+ [Enter extension point usage example here.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="apiinfo"/>
+ </appinfo>
+ <documentation>
+ [Enter API information here.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="implementation"/>
+ </appinfo>
+ <documentation>
+ [Enter information about supplied implementation of this extension point.]
+ </documentation>
+ </annotation>
+
+
+</schema>
diff --git a/old/org.eclipse.emf.ecp.common.model/schema/org.eclipse.emf.ecp.model.postinit.exsd b/old/org.eclipse.emf.ecp.common.model/schema/org.eclipse.emf.ecp.model.postinit.exsd
new file mode 100644
index 0000000..44c06f2
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.common.model/schema/org.eclipse.emf.ecp.model.postinit.exsd
@@ -0,0 +1,102 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- Schema file written by PDE -->
+<schema targetNamespace="org.eclipse.emf.ecp.model" xmlns="http://www.w3.org/2001/XMLSchema">
+<annotation>
+ <appinfo>
+ <meta.schema plugin="org.eclipse.emf.ecp.model" id="org.eclipse.emf.ecp.model.postinit" name="ECPWorkspace Init Complete"/>
+ </appinfo>
+ <documentation>
+ [Enter description of this extension point.]
+ </documentation>
+ </annotation>
+
+ <element name="extension">
+ <annotation>
+ <appinfo>
+ <meta.element />
+ </appinfo>
+ </annotation>
+ <complexType>
+ <sequence>
+ <element ref="initiator" minOccurs="1" maxOccurs="unbounded"/>
+ </sequence>
+ <attribute name="point" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="id" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="name" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appinfo>
+ <meta.attribute translatable="true"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="initiator">
+ <complexType>
+ <attribute name="class" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appinfo>
+ <meta.attribute kind="java" basedOn=":org.eclipse.emf.ecp.model.PostECPWorkspaceInitiator"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="since"/>
+ </appinfo>
+ <documentation>
+ [Enter the first release in which this extension point appears.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="examples"/>
+ </appinfo>
+ <documentation>
+ [Enter extension point usage example here.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="apiinfo"/>
+ </appinfo>
+ <documentation>
+ [Enter API information here.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="implementation"/>
+ </appinfo>
+ <documentation>
+ [Enter information about supplied implementation of this extension point.]
+ </documentation>
+ </annotation>
+
+
+</schema>
diff --git a/old/org.eclipse.emf.ecp.common.model/schema/org.eclipse.emf.ecp.model.workspaceprovider.exsd b/old/org.eclipse.emf.ecp.common.model/schema/org.eclipse.emf.ecp.model.workspaceprovider.exsd
new file mode 100644
index 0000000..873f0ef
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.common.model/schema/org.eclipse.emf.ecp.model.workspaceprovider.exsd
@@ -0,0 +1,102 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- Schema file written by PDE -->
+<schema targetNamespace="org.eclipse.emf.ecp.model" xmlns="http://www.w3.org/2001/XMLSchema">
+<annotation>
+ <appinfo>
+ <meta.schema plugin="org.eclipse.emf.ecp.model" id="org.eclipse.emf.ecp.model.ecpWorkspaceProvider" name="ECP Workspace Provider"/>
+ </appinfo>
+ <documentation>
+ Provides a workspace for the ECP navigator
+ </documentation>
+ </annotation>
+
+ <element name="extension">
+ <annotation>
+ <appinfo>
+ <meta.element />
+ </appinfo>
+ </annotation>
+ <complexType>
+ <sequence>
+ <element ref="WorkspaceProvider"/>
+ </sequence>
+ <attribute name="point" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="id" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="name" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appinfo>
+ <meta.attribute translatable="true"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="WorkspaceProvider">
+ <complexType>
+ <attribute name="class" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appinfo>
+ <meta.attribute kind="java" basedOn=":org.eclipse.emf.ecp.model.workSpaceModel.util.ECPWorkspaceProvider"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="since"/>
+ </appinfo>
+ <documentation>
+ [Enter the first release in which this extension point appears.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="examples"/>
+ </appinfo>
+ <documentation>
+ [Enter extension point usage example here.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="apiinfo"/>
+ </appinfo>
+ <documentation>
+ [Enter API information here.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="implementation"/>
+ </appinfo>
+ <documentation>
+ [Enter information about supplied implementation of this extension point.]
+ </documentation>
+ </annotation>
+
+
+</schema>
diff --git a/old/org.eclipse.emf.ecp.common.model/src/org/eclipse/emf/ecp/common/model/AbstractECPMetaModelElementContext.java b/old/org.eclipse.emf.ecp.common.model/src/org/eclipse/emf/ecp/common/model/AbstractECPMetaModelElementContext.java
new file mode 100644
index 0000000..d781017
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.common.model/src/org/eclipse/emf/ecp/common/model/AbstractECPMetaModelElementContext.java
@@ -0,0 +1,295 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2011 Chair for Applied Software Engineering,
+ * Technische Universitaet Muenchen.
+ * 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:
+ ******************************************************************************/
+package org.eclipse.emf.ecp.common.model;
+
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map.Entry;
+import java.util.Set;
+
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EClassifier;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.ecore.EPackage.Registry;
+import org.eclipse.emf.ecore.EReference;
+import org.eclipse.emf.ecore.EcorePackage;
+
+/**
+ * MetaModelContext used by the editor to determine which model elements belong to the model.
+ *
+ * @author helming
+ */
+public abstract class AbstractECPMetaModelElementContext implements ECPMetaModelElementContext {
+
+ private Set<EClass> modelElementEClasses;
+ private static Set<EClass> guessedPackages;
+
+ /**
+ * {@inheritDoc}
+ */
+ public boolean isNonDomainElement(EObject eObject) {
+ return isNonDomainElement(eObject.eClass());
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.ecp.model.MetaModelElementContext#isNonDomainElement(org.eclipse.emf.ecore.EClass)
+ */
+ public abstract boolean isNonDomainElement(EClass eClass);
+
+ /**
+ * {@inheritDoc}
+ */
+ public Set<EClass> getAllSubEClasses(EClass eClass, boolean association) {
+ return getAllSubEClasses(eClass, association, false);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public Set<EClass> getAllSubEClasses(EClass eClass, boolean association, boolean includeNonDomainElements) {
+
+ Set<EClass> allEClasses = getAllModelElementEClasses(association, includeNonDomainElements);
+ Set<EClass> result = new HashSet<EClass>();
+
+ for (EClass subClass : allEClasses) {
+ if ((eClass.equals(EcorePackage.eINSTANCE.getEObject()) || eClass.isSuperTypeOf(subClass))
+ && (!subClass.isAbstract()) && (!subClass.isInterface())) {
+ result.add(subClass);
+ }
+ }
+
+ return result;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public Set<EClass> getAllModelElementEClasses(boolean association) {
+ return getAllModelElementEClasses(association, false);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public Set<EClass> getAllModelElementEClasses(boolean association, boolean includeNonDomainElemnts) {
+
+ Set<EClass> result = new HashSet<EClass>();
+
+ for (EClass subClass : getAllModelElementEClassesImpl()) {
+ if (association || !isAssociationClassElement(subClass)) {
+ if (includeNonDomainElemnts || !isNonDomainElement(subClass)) {
+ result.add(subClass);
+ }
+ }
+ }
+
+ return result;
+ }
+
+ /**
+ * @param newMEInstance {@link EObject} the new modelElement instance.
+ * @return EReference the Container
+ * @param parent The EObject to get containment references from
+ */
+ public EReference getPossibleContainingReference(final EObject newMEInstance, EObject parent) {
+ // the value of the 'EAll Containments' reference list.
+ List<EReference> eallcontainments = parent.eClass().getEAllContainments();
+ EReference reference = null;
+ for (EReference containmentitem : eallcontainments) {
+
+ EClass eReferenceType = containmentitem.getEReferenceType();
+ if (eReferenceType.equals(newMEInstance)) {
+ reference = containmentitem;
+
+ break;
+ } else if (eReferenceType.equals(EcorePackage.eINSTANCE.getEObject())
+ || eReferenceType.isSuperTypeOf(newMEInstance.eClass())) {
+ reference = containmentitem;
+ break;
+ }
+ }
+ return reference;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public boolean isGuessed() {
+ IConfigurationElement[] packages = Platform.getExtensionRegistry().getConfigurationElementsFor(
+ "org.eclipse.emf.ecp.model.ecppackage");
+ return (packages.length == 0);
+ }
+
+ /**
+ * Returns all types of model elements in this context.
+ *
+ * @return a set of {@link EClass}es
+ */
+ protected Set<EClass> getAllModelElementEClassesImpl() {
+
+ if (modelElementEClasses != null) {
+ return new HashSet<EClass>(modelElementEClasses);
+ }
+
+ Set<EClass> result = new HashSet<EClass>();
+ Set<String> registeredPackages = new HashSet<String>();
+ Registry registry = EPackage.Registry.INSTANCE;
+ IConfigurationElement[] packages = Platform.getExtensionRegistry().getConfigurationElementsFor(
+ "org.eclipse.emf.ecp.model.ecppackage");
+
+ for (IConfigurationElement element : packages) {
+ String packageName = element.getAttribute("modelPackage");
+ registeredPackages.add(packageName);
+ }
+
+ if (registeredPackages.isEmpty()) {
+ return guessPackages(new HashSet<Entry<String, Object>>(registry.entrySet()));
+ }
+
+ for (Entry<String, Object> entry : new HashSet<Entry<String, Object>>(registry.entrySet())) {
+
+ if (!registeredPackages.contains(entry.getKey())) {
+ continue;
+ }
+
+ try {
+ EPackage ePackage = EPackage.Registry.INSTANCE.getEPackage(entry.getKey());
+ result.addAll(getAllModelElementEClasses(ePackage));
+ }
+ // BEGIN SUPRESS CATCH EXCEPTION
+ catch (RuntimeException exception) {
+ // END SUPRESS CATCH EXCEPTION
+ String message = "Failed to load model package " + entry.getKey();
+ Activator.getDefault().logException(message, exception);
+ }
+ }
+
+ modelElementEClasses = result;
+ return result;
+ }
+
+ private Set<EClass> guessPackages(HashSet<Entry<String, Object>> entries) {
+ if (guessedPackages == null) {
+ guessedPackages = new HashSet<EClass>();
+ for (Entry<String, Object> entry : entries) {
+
+ if (!isKnownPackage(entry.getKey())) {
+ // This is used to discover known packages which can be added to
+ // know packages then.
+// System.out.println("\"" + entry.getKey() + "\"" + ",");
+ try {
+ EPackage ePackage = EPackage.Registry.INSTANCE.getEPackage(entry.getKey());
+ guessedPackages.addAll(getAllModelElementEClasses(ePackage));
+ // BEGIN SUPRESS CATCH EXCEPTION
+ } catch (RuntimeException e) {
+ // END SUPRESS CATCH EXCEPTION
+ String message = "Failed to load model package: " + entry.getKey();
+ Activator.getDefault().logWarning(message, e);
+ }
+ }
+ }
+ }
+ return guessedPackages;
+ }
+
+ private boolean isKnownPackage(String key) {
+
+ String[] elements = { "http://www.eclipse.org/m2t/xpand/Trace",
+ "http://www.eclipse.org/emf/eef/mapping/filters/1.0.0", "http://www.cs.tum.edu/cope/history/0.1.42",
+ "http://www.eclipse.org/acceleo/profiler/3.0", "http://www.eclipse.org/emf/compare/epatch/0.1",
+ "http://www.eclipse.org/ocl/1.1.0/UML", "http://www.eclipse.org/emf/eef/components/1.0.0",
+ "http://www.eclipse.org/amalgamation/discovery/1.0", "http://www.eclipse.org/emf/compare/match/1.1",
+ "http://www.eclipse.org/emf/eef/views/1.0.0",
+ "http://www.eclipse.org/gmf/examples/runtime/1.0.0/logicsemantic",
+ "http://www.eclipse.org/acceleo/mtl/3.0", "http://www.eclipse.org/acceleo/mt/2.6.0/statements",
+ "http://www.eclipse.org/acceleo/traceability/1.0", "http://www.eclipse.org/acceleo/mt/2.6.0",
+ "http:///org/eclipse/emf/examples/library/extlibrary.ecore/1.0.0",
+ "http://www.cs.tum.edu/cope/migration/test", "http://www.eclipse.org/uml2/1.1.0/GenModel",
+ "http://www.eclipse.org/acceleo/mt/2.6.0/expressions", "http://www.eclipse.org/acceleo/mtl/3.0/",
+ "http://www.eclipse.org/emf/CDO/Eresource/2.0.0",
+ "http://www.eclipse.org/emf/eef/mapping/navigation/1.0.0",
+ "http://www.eclipse.org/emf/eef/views/toolkits/1.0.0", "http://www.eclipse.org/acceleo/mtl/cst/3.0",
+ "http://www.eclipse.org/emf/eef/generation/1.0.0", "http://www.eclipse.org/emf/2009/Validation",
+ "http://www.eclipse.org/emf/eef/mapping/1.0.0", "http://www.eclipse.org/emf/compare/diff/1.1",
+ "http://www.eclipse.org/acceleo/mt/2.6.0/core", "http://www.eclipse.org/gmf/2008/mappings",
+ "http://www.w3.org/XML/1998/namespace", "http://www.eclipse.org/ocl/1.1.0/OCL",
+ "http://www.eclipse.org/ocl/1.1.0/OCL/Expressions", "http://www.eclipse.org/emf/2002/GenModel",
+ "http://www.eclipse.org/qvt/1.0/ImperativeOCL", "http://unicase.org/emfstore/esmodel",
+ "http://www.cs.tum.edu/cope/migration", "http://unicase.org/esmodel/accesscontrol/roles",
+ "http:///com/ibm/etools/dtd.ecore", "http:///www.eclipse.org/m2m/qvt/operational/trace.ecore",
+ "http://www.eclipse.org/qvt/1.0.0/Operational/Expressions", "http://www.eclipse.org/gmf/2006/GenModel",
+ "http://www.eclipse.org/uml2/3.0.0/UML", "http://www.eclipse.org/uml2/2.0.0/UML",
+ "http://www.eclipse.org/gmf/runtime/1.0.0/notation", "http://www.eclipse.org/emf/2002/Tree",
+ "http://www.eclipse.org/OCL2/1.0.0/ocl/uml", "http://www.eclipse.org/OCL2/1.0.0/ocl/types",
+ "http://unicase.org/esmodel/versioning/events", "http://www.eclipse.org/emf/2003/Change",
+ "http://www.eclipse.org/OCL2/1.0.0/ocl/query", "http://www.eclipse.org/gmf/2006/Trace",
+ "http://www.eclipse.org/QVT2/1.0.0/Operational/cst", "http://unicase.org/esmodel/accesscontrol",
+ "http://www.eclipse.org/emf/2005/Ecore2XML", "http://unicase.org/esmodel/versioning/operations",
+ "http://www.eclipse.org/emf/2002/Ecore", "http://www.eclipse.org/QVT2/1.0.0/Operational/cst/temp",
+ "http://www.eclipse.org/gmf/2005/GenModel/2.0", "http://www.eclipse.org/gmf/2005/ToolDefinition",
+ "http://unicase.org/esmodel/versioning", "http://www.cs.tum.edu/cope/declaration",
+ "http://www.eclipse.org/gmf/2005/GenModel", "http://www.eclipse.org/gmf/2005/mappings",
+ "http://unicase.org/workspace", "http://www.eclipse.org/gmf/2006/GraphicalDefinition",
+ "http://www.eclipse.org/gmf/runtime/1.0.1/notation", "http://www.eclipse.org/emf/2003/XMLType",
+ "http://www.eclipse.org/uml2/2.1.0/UML", "http://www.eclipse.org/gmf/2005/mappings/2.0",
+ "http://www.eclipse.org/ocl/1.1.0/OCL/Types", "http://www.eclipse.org/QVT/1.0.0/Operational",
+ "http://www.eclipse.org/gmf/runtime/1.0.2/notation", "http://www.eclipse.org/ocl/1.1.0/OCL/Utilities",
+ "moduleCore.xmi", "http://www.eclipse.org/emf/2002/XSD2Ecore", "http://unicase.org/workspaceModel",
+ "http://www.eclipse.org/emf/2004/Ecore2Ecore", "http://www.eclipse.org/gmf/2005/GraphicalDefinition",
+ "http://www.eclipse.org/gmf/2009/GenModel", "http://www.eclipse.org/xsd/2002/XSD",
+ "http://www.eclipse.org/emf/2002/Mapping", "http://unicase.org/metamodel",
+ "http://www.eclipse.org/gmf/2008/GenModel", "DTD.xmi", "http://www.eclipse.org/ocl/1.1.0/OCL/CST",
+ "http://www.eclipse.org/OCL2/1.0.0/ocl/expressions", "componentcore.xmi",
+ "http://www.eclipse.org/ocl/1.1.0/Ecore", "http://unicase.org/esmodel/notification",
+ "http://www.eclipse.org/OCL2/1.0.0/oclstdlib", "http://unicase.org/esmodel/versioning/events/server/",
+ "http://unicase.org/emfstore/esmodel/url", "http://www.eclipse.org/gmf/2006/mappings",
+ "http://www.eclipse.org/OCL2/1.0.0/ocl", "http://unicase.org/esmodel/versioning/operations/semantic",
+ "http://www.eclipse.org/OCL2/1.0.0/ocl/utilities", "http://www.eclipse.org/uml2/2.2.0/GenModel",
+ "http://eclipse.org/emf/emfstore/server/model/versioning", "http://eclipse.org/emf/emfstore/server/model/url",
+ "http://eclipse.org/emf/emfstore/client/model", "urn:model.ecore", "http://eclipse.org/emf/emfstore/server/model/notification",
+ "http://eclipse.org/emf/ecp/common/model/workspaceModel", "http://eclipse.org/emf/emfstore/server/model/versioning/events",
+ "http://eclipse.org/emf/emfstore/server/model/roles", "http://eclipse.org/emf/emfstore/server/model/versioning/operations",
+ "http://eclipse.org/emf/emfstore/server/model/versioning/events/server/", "http://eclipse.org/emf/emfstore/server/model",
+ "http://eclipse.org/emf/emfstore/server/model/accesscontrol", "http://eclipse.org/emf/emfstore/common/model",
+ "http://eclipse.org/emf/emfstore/server/model/versioning/operations/semantic",
+ "http://www.eclipse.org/emf/edapt/declaration/0.3",
+ "http://www.eclipse.org/emf/edapt/history/0.3",
+ "http://www.eclipse.org/emf/edapt/migration/0.3" };
+ Set<String> knownPackages = new HashSet<String>(Arrays.asList(elements));
+ return knownPackages.contains(key);
+ }
+
+ /**
+ * Retrieve all EClasses from the Ecore package that are model element subclasses.
+ *
+ * @param ePackage the package to get the classes from
+ * @return a set of EClasses
+ */
+ private static Set<EClass> getAllModelElementEClasses(EPackage ePackage) {
+ Set<EClass> result = new HashSet<EClass>();
+ for (EPackage subPackage : ePackage.getESubpackages()) {
+ result.addAll(getAllModelElementEClasses(subPackage));
+ }
+ for (EClassifier classifier : ePackage.getEClassifiers()) {
+ if (classifier instanceof EClass) {
+ EClass subEClass = (EClass) classifier;
+ result.add(subEClass);
+ }
+ }
+ return result;
+ }
+}
\ No newline at end of file
diff --git a/old/org.eclipse.emf.ecp.common.model/src/org/eclipse/emf/ecp/common/model/AbstractECPModelElementContext.java b/old/org.eclipse.emf.ecp.common.model/src/org/eclipse/emf/ecp/common/model/AbstractECPModelElementContext.java
new file mode 100644
index 0000000..92130e3
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.common.model/src/org/eclipse/emf/ecp/common/model/AbstractECPModelElementContext.java
@@ -0,0 +1,43 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2011 Chair for Applied Software Engineering,
+ * Technische Universitaet Muenchen.
+ * 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:
+ ******************************************************************************/
+package org.eclipse.emf.ecp.common.model;
+
+import java.util.HashSet;
+import java.util.Set;
+
+/**
+ * The context of a certain EObject.
+ * Subclasses shall call modelelementDeleted and contextDeleted.
+ *
+ * @author helming
+ */
+public abstract class AbstractECPModelElementContext implements ECPModelelementContext {
+
+ private Set<ModelElementContextListener> modelElementContextListeners = new HashSet<ModelElementContextListener>();
+
+ /**
+ * Adds a {@link ModelElementContextListener}.
+ *
+ * @param modelElementContextListener the {@link ModelElementContextListener}
+ */
+ public void addModelElementContextListener(ModelElementContextListener modelElementContextListener) {
+ modelElementContextListeners.add(modelElementContextListener);
+ }
+
+ /**
+ * Removes a {@link ModelElementContextListener}.
+ *
+ * @param modelElementContextListener the {@link ModelElementContextListener}
+ */
+ public void removeModelElementContextListener(ModelElementContextListener modelElementContextListener) {
+ modelElementContextListeners.remove(modelElementContextListener);
+ }
+}
\ No newline at end of file
diff --git a/old/org.eclipse.emf.ecp.common.model/src/org/eclipse/emf/ecp/common/model/Activator.java b/old/org.eclipse.emf.ecp.common.model/src/org/eclipse/emf/ecp/common/model/Activator.java
new file mode 100644
index 0000000..3e5a0e9
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.common.model/src/org/eclipse/emf/ecp/common/model/Activator.java
@@ -0,0 +1,69 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2011 Chair for Applied Software Engineering,
+ * Technische Universitaet Muenchen.
+ * 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:
+ ******************************************************************************/
+package org.eclipse.emf.ecp.common.model;
+
+import org.eclipse.emf.ecp.common.util.AbstractECPPlugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle.
+ */
+public class Activator extends AbstractECPPlugin {
+
+ /**
+ * The plug-in ID.
+ */
+ public static final String PLUGIN_ID = "org.eclipse.emf.ecp.model";
+
+ /**
+ * The shared instance.
+ */
+ private static Activator plugin;
+
+ /**
+ * The constructor.
+ */
+ public Activator() {
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ // BEGIN SUPRESS CATCH EXCEPTION
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ plugin = this;
+ }
+
+ // END SUPRESS CATCH EXCEPTION
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+ */
+ // BEGIN SUPRESS CATCH EXCEPTION
+ public void stop(BundleContext context) throws Exception {
+ plugin = null;
+ super.stop(context);
+ }
+
+ // END SUPRESS CATCH EXCEPTION
+
+ /**
+ * Returns the shared instance.
+ *
+ * @return the shared instance
+ */
+ public static Activator getDefault() {
+ return plugin;
+ }
+
+}
\ No newline at end of file
diff --git a/old/org.eclipse.emf.ecp.common.model/src/org/eclipse/emf/ecp/common/model/ECPAssociationClassElement.java b/old/org.eclipse.emf.ecp.common.model/src/org/eclipse/emf/ecp/common/model/ECPAssociationClassElement.java
new file mode 100644
index 0000000..9d403de
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.common.model/src/org/eclipse/emf/ecp/common/model/ECPAssociationClassElement.java
@@ -0,0 +1,69 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2011 Chair for Applied Software Engineering,
+ * Technische Universitaet Muenchen.
+ * 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:
+ ******************************************************************************/
+package org.eclipse.emf.ecp.common.model;
+
+import java.util.List;
+
+import org.eclipse.emf.ecore.EReference;
+import org.eclipse.emf.ecore.EStructuralFeature;
+
+/**
+ * Represents an association class.
+ * @author Maximilian Koegel
+ *
+ */
+public class ECPAssociationClassElement {
+ private EReference targetFeature;
+ private EReference sourceFeature;
+ private List<EStructuralFeature> associationFeatures;
+
+ /**
+ * Constructor.
+ * @param sourceFeature the feature pointing to the source element
+ * @param targetFeature the feature pointing to the target element
+ * @param associationFeatures the other features
+ */
+ public ECPAssociationClassElement(EReference sourceFeature, EReference targetFeature,
+ List<EStructuralFeature> associationFeatures) {
+ this.sourceFeature = sourceFeature;
+ this.targetFeature = targetFeature;
+ this.associationFeatures = associationFeatures;
+ }
+
+ /**
+ * Return the feature in which the source element of this link is contained.
+ *
+ * @return the source feature
+ */
+ public EReference getSourceFeature() {
+ return sourceFeature;
+ }
+
+ /**
+ * Return the feature in which the target element of this link is contained.
+ *
+ * @return the source feature
+ */
+ public EReference getTargetFeature() {
+ return targetFeature;
+ }
+
+ /**
+ * Return the features which constitute the features of this link that contain information about the link, other
+ * than source and target. The list should be ordered by priority of the feature, important features first.
+ *
+ * @return a list of features
+ */
+ public List<EStructuralFeature> getAssociationFeatures() {
+ return associationFeatures;
+ }
+
+}
\ No newline at end of file
diff --git a/old/org.eclipse.emf.ecp.common.model/src/org/eclipse/emf/ecp/common/model/ECPMetaModelElementContext.java b/old/org.eclipse.emf.ecp.common.model/src/org/eclipse/emf/ecp/common/model/ECPMetaModelElementContext.java
new file mode 100644
index 0000000..e883aa5
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.common.model/src/org/eclipse/emf/ecp/common/model/ECPMetaModelElementContext.java
@@ -0,0 +1,119 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2011 Chair for Applied Software Engineering,
+ * Technische Universitaet Muenchen.
+ * 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:
+ ******************************************************************************/
+package org.eclipse.emf.ecp.common.model;
+
+import java.util.Set;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EReference;
+
+/**
+ * Represents the met context of the EMF Client Platform describing involved EClasses and their properties.
+ * @author Jonas Helming
+ *
+ */
+public interface ECPMetaModelElementContext {
+
+ /**
+ * Returns all types of model elements in this context. Could exclude {@link AssociationClassElement}s.
+ *
+ * @param association whether to include {@link AssociationClassElement}
+ * @return a set of {@link EClass}es
+ */
+ Set<EClass> getAllModelElementEClasses(boolean association);
+
+ /**
+ * Returns all types of model elements in this context. Could exclude {@link AssociationClassElement}s.
+ *
+ * @param association whether to include {@link AssociationClassElement}
+ * @param includeNonDomainElemnts whether to include non-domain elements in the resulting set
+ * @return a set of {@link EClass}es
+ */
+ Set<EClass> getAllModelElementEClasses(boolean association, boolean includeNonDomainElemnts);
+
+
+ /**
+ * Retrieve all EClasses from the EcorePackage registry that are subclasses of the given {@link EClass}.
+ * Does not include abstract classes or interfaces. Could exclude {@link AssociationClassElement}s.
+ *
+ * @param eClass the superClass of the subClasses to retrieve
+ * @param association whether to include {@link AssociationClassElement}
+ * @return a set of EClasses
+ */
+ Set<EClass> getAllSubEClasses(EClass eClass, boolean association);
+
+ /**
+ * Retrieve all EClasses from the EcorePackage registry that are subclasses of the given {@link EClass}.
+ * Does not include abstract classes or interfaces. Could exclude {@link AssociationClassElement}s.
+ *
+ * @param eClass the superClass of the subClasses to retrieve
+ * @param association whether to include {@link AssociationClassElement}
+ * @param includeNonDomainElements whether to include non-domain elements in the resulting set
+ * @return a set of EClasses
+ */
+ Set<EClass> getAllSubEClasses(EClass eClass, boolean association, boolean includeNonDomainElements);
+
+ /**
+ * Whether a {@link EClass} is a domain element. Non Domain Elements are not root nodes of the model and
+ * do not exist on their own. They have the following characteristic behavior: they don't appear in the openME
+ * dialog,
+ * they are deleted if the last link to them is deleted, and they are not shown in the new element wizard and
+ * the METyselection dialog (Table View).
+ *
+ * @param clazz the EClass
+ * @return whether the given class is is a non domain element
+ */
+ boolean isNonDomainElement(EClass clazz);
+
+ /**
+ * Whether a {@link EObject} is a association class. Association classes are not displayed as dedicated elements. A
+ * link from one element to another which goes over an association class is displayed by a dedicated widget. This
+ * widgets allows to trace transparently without seeing the association class.
+ *
+ * @param eObject the {@link EObject}
+ * @return true, if it is an association
+ */
+ boolean isAssociationClassElement(EObject eObject);
+
+ /**
+ * Whether a {@link EClass} is a association class. Association classes are not displayed as dedicated elements. A
+ * link from one element to another which goes over an association class is displayed by a dedicated widget. This
+ * widgets allows to trace transparently without seeing the association class.
+ *
+ * @param eClazz the {@link EClass}
+ * @return true, if it is an association
+ */
+ boolean isAssociationClassElement(EClass eClazz);
+
+ /**
+ * Returns an {@link ECPAssociationClassElement} wrapper for a {@link EObject}.
+ *
+ * @param eObject the {@link EObject}
+ * @return the wrapper, {@code null} if {@link EObject} not exists
+ */
+ ECPAssociationClassElement getAssociationClassElement(EObject eObject);
+
+ /**
+ * @param newMEInstance {@link EObject} the new modelElement instance.
+ * @return EReference the Container
+ * @param parent The EObject to get containment references from
+ */
+ EReference getPossibleContainingReference(final EObject newMEInstance, EObject parent);
+
+ /**
+ * If the meta model context is guessing the packages. Happens if no model package is registered for EMF Client
+ * Platform.
+ *
+ * @return if the context is guessed.
+ */
+ boolean isGuessed();
+}
\ No newline at end of file
diff --git a/old/org.eclipse.emf.ecp.common.model/src/org/eclipse/emf/ecp/common/model/ECPModelelementContext.java b/old/org.eclipse.emf.ecp.common.model/src/org/eclipse/emf/ecp/common/model/ECPModelelementContext.java
new file mode 100644
index 0000000..bf16243
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.common.model/src/org/eclipse/emf/ecp/common/model/ECPModelelementContext.java
@@ -0,0 +1,84 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2011 Chair for Applied Software Engineering,
+ * Technische Universitaet Muenchen.
+ * 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:
+ ******************************************************************************/
+package org.eclipse.emf.ecp.common.model;
+
+import java.util.Collection;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.edit.domain.EditingDomain;
+
+/**
+ * Context for a modelelement.
+ *
+ * @author helming
+ */
+public interface ECPModelelementContext {
+
+ /**
+ * Adds a {@link ModelElementContextListener}.
+ *
+ * @param modelElementContextListener the {@link ModelElementContextListener}
+ */
+ void addModelElementContextListener(ModelElementContextListener modelElementContextListener);
+
+ /**
+ * Removes a {@link ModelElementContextListener}.
+ *
+ * @param modelElementContextListener the {@link ModelElementContextListener}
+ */
+ void removeModelElementContextListener(ModelElementContextListener modelElementContextListener);
+
+ /**
+ * Returns all model elements in this context.
+ *
+ * @return a list of model elements
+ */
+ Collection<EObject> getAllModelElements();
+
+ /**
+ * Returns all {@link EObject} in the context, which are of a certain type. Could exclude
+ * {@link AssociationClassElement}'s.
+ *
+ * @param clazz the type
+ * @param association whether to include {@link AssociationClassElement}
+ * @return a {@link Collection} of {@link EObject}
+ */
+ Collection<EObject> getAllModelElementsbyClass(EClass clazz, boolean association);
+
+ /**
+ * Returns the editing domain.
+ *
+ * @return the editing domain
+ */
+ EditingDomain getEditingDomain();
+
+ /**
+ * Returns the {@link ECPMetaModelElementContext}.
+ *
+ * @return the {@link ECPMetaModelElementContext}.
+ */
+ ECPMetaModelElementContext getMetaModelElementContext();
+
+ /**
+ * If a {@link EObject} is contained in this context and can be therefore referenced by the {@link EObject} defining
+ * the context.
+ *
+ * @param eObject the {@link EObject}
+ * @return if the {@link EObject} is contained in the context
+ */
+ boolean contains(EObject eObject);
+
+ /**
+ * Called if the context is not used anymore. Use for cleanup.
+ */
+ void dispose();
+}
\ No newline at end of file
diff --git a/old/org.eclipse.emf.ecp.common.model/src/org/eclipse/emf/ecp/common/model/ECPWorkspaceManager.java b/old/org.eclipse.emf.ecp.common.model/src/org/eclipse/emf/ecp/common/model/ECPWorkspaceManager.java
new file mode 100644
index 0000000..6c68d02
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.common.model/src/org/eclipse/emf/ecp/common/model/ECPWorkspaceManager.java
@@ -0,0 +1,161 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2011 Chair for Applied Software Engineering,
+ * Technische Universitaet Muenchen.
+ * 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:
+ ******************************************************************************/
+package org.eclipse.emf.ecp.common.model;
+
+import java.lang.reflect.Method;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecp.common.model.workSpaceModel.ECPProject;
+import org.eclipse.emf.ecp.common.model.workSpaceModel.ECPWorkspace;
+import org.eclipse.emf.ecp.common.model.workSpaceModel.util.ECPWorkspaceProvider;
+import org.eclipse.emf.emfstore.common.observer.ObserverBus;
+
+/**
+ * Class to provide access to a registered Workspace.
+ *
+ * @author helming
+ */
+public final class ECPWorkspaceManager {
+
+ private static ObserverBus observerBus;
+
+ /**
+ * Initializes the singleton instance statically.
+ */
+ private static class SingletonHolder {
+ public static final ECPWorkspaceManager INSTANCE = new ECPWorkspaceManager();
+ static {
+ INSTANCE.init();
+ INSTANCE.notifyECPPostWorkspaceInitiators();
+ }
+ }
+
+ private ECPWorkspace currentWorkspace;
+
+ /**
+ * Singleton Pattern.
+ *
+ * @return the instance
+ */
+ public static ECPWorkspaceManager getInstance() {
+ return SingletonHolder.INSTANCE;
+ }
+
+ private void init() {
+ IConfigurationElement[] confs = Platform.getExtensionRegistry().getConfigurationElementsFor(
+ "org.eclipse.emf.ecp.model.workspaceprovider");
+ if (confs.length == 1) {
+ try {
+ currentWorkspace = ((ECPWorkspaceProvider) confs[0].createExecutableExtension("class"))
+ .getECPWorkspace();
+ } catch (CoreException e) {
+ Activator.getDefault().logException(e.getMessage(), e);
+ }
+ }
+ if (confs.length > 1) {
+ try {
+ currentWorkspace = ((ECPWorkspaceProvider) confs[0].createExecutableExtension("class"))
+ .getECPWorkspace();
+ Exception exception = new IllegalStateException("Duplicate Workspace registered. Default selected: "
+ + currentWorkspace.getClass().getName()
+ + " Please make sure to only include one Workspace in your target platform.");
+ Activator.getDefault().logException(exception.getMessage(), exception);
+ } catch (CoreException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
+ if (confs.length < 1) {
+ throw new IllegalStateException("No Workspace registered");
+ }
+
+ initObserverBus();
+ }
+
+ private void initObserverBus() {
+ // TODO make more general
+ if ("org.eclipse.emf.ecp.emfstorebridge.EMFECPWorkspace".equals(currentWorkspace.getClass().getName())) {
+ try {
+ Method method = currentWorkspace.getClass().getMethod("getObserverBus");
+ Object invoke = method.invoke(currentWorkspace);
+ if (invoke instanceof ObserverBus) {
+ observerBus = (ObserverBus) invoke;
+ }
+ // BEGIN SUPRESS CATCH EXCEPTION
+ } catch (Exception e) {
+ // fail silently
+ }
+ // END SUPRESS CATCH EXCEPTION
+ }
+ if (observerBus == null) {
+ observerBus = new ObserverBus();
+ }
+ }
+
+ private ECPWorkspaceManager() {
+ }
+
+ /**
+ * Returns the registered workspace.
+ *
+ * @return workspace
+ * @throws NoWorkspaceException
+ * if there is no workspace
+ */
+ public ECPWorkspace getWorkSpace() throws NoWorkspaceException {
+ if (currentWorkspace == null) {
+ throw new NoWorkspaceException();
+ }
+ return currentWorkspace;
+ }
+
+ /**
+ * Uses the Workspace to lookup a modelement. This method delegates to {@link ECPWorkspace#getProject(EObject)}.
+ *
+ * @param modelElement
+ * me
+ * @return project or null
+ */
+ public static ECPProject getECPProject(EObject modelElement) {
+ try {
+ return getInstance().getWorkSpace().getProject(modelElement);
+ } catch (NoWorkspaceException e) {
+ // TODO make NoWorkspaceException a runtime exception?
+ throw new RuntimeException(e);
+ }
+ }
+
+ /**
+ * Get the observer bus.
+ * @return the observer bus
+ */
+ public static ObserverBus getObserverBus() {
+ return observerBus;
+ }
+
+ private void notifyECPPostWorkspaceInitiators() {
+ IConfigurationElement[] workspaceObservers = Platform.getExtensionRegistry().getConfigurationElementsFor(
+ "org.eclipse.emf.ecp.model.postinit");
+ for (IConfigurationElement element : workspaceObservers) {
+ try {
+ PostECPWorkspaceInitiator workspaceObserver = (PostECPWorkspaceInitiator) element
+ .createExecutableExtension("class");
+ workspaceObserver.workspaceInitComplete(currentWorkspace);
+ } catch (CoreException e) {
+ Activator.getDefault().logException(e.getMessage(), e);
+ }
+ }
+ }
+
+}
\ No newline at end of file
diff --git a/old/org.eclipse.emf.ecp.common.model/src/org/eclipse/emf/ecp/common/model/ModelElementContextListener.java b/old/org.eclipse.emf.ecp.common.model/src/org/eclipse/emf/ecp/common/model/ModelElementContextListener.java
new file mode 100644
index 0000000..627dc44
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.common.model/src/org/eclipse/emf/ecp/common/model/ModelElementContextListener.java
@@ -0,0 +1,34 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2011 Chair for Applied Software Engineering,
+ * Technische Universitaet Muenchen.
+ * 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:
+ ******************************************************************************/
+package org.eclipse.emf.ecp.common.model;
+
+import org.eclipse.emf.ecore.EObject;
+
+/**
+ * Listens to the changes of a context.
+ *
+ * @author helming
+ */
+public abstract class ModelElementContextListener {
+
+ /**
+ * Called if a model element is deleted. Is only called for the root node if a tree of model elements is deleted.
+ *
+ * @param deleted the deleted element
+ */
+ public abstract void onModelElementDeleted(EObject deleted);
+
+ /**
+ * Call if the context gets deleted.
+ */
+ public abstract void onContextDeleted();
+
+}
\ No newline at end of file
diff --git a/old/org.eclipse.emf.ecp.common.model/src/org/eclipse/emf/ecp/common/model/NoWorkspaceException.java b/old/org.eclipse.emf.ecp.common.model/src/org/eclipse/emf/ecp/common/model/NoWorkspaceException.java
new file mode 100644
index 0000000..d222327
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.common.model/src/org/eclipse/emf/ecp/common/model/NoWorkspaceException.java
@@ -0,0 +1,22 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2011 Chair for Applied Software Engineering,
+ * Technische Universitaet Muenchen.
+ * 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:
+ ******************************************************************************/
+package org.eclipse.emf.ecp.common.model;
+
+/**
+ * Exception if there is no workspace.
+ *
+ * @author helming
+ */
+public class NoWorkspaceException extends Exception {
+
+ private static final long serialVersionUID = 3400798238003196616L;
+
+}
\ No newline at end of file
diff --git a/old/org.eclipse.emf.ecp.common.model/src/org/eclipse/emf/ecp/common/model/PostECPWorkspaceInitiator.java b/old/org.eclipse.emf.ecp.common.model/src/org/eclipse/emf/ecp/common/model/PostECPWorkspaceInitiator.java
new file mode 100644
index 0000000..70379ed
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.common.model/src/org/eclipse/emf/ecp/common/model/PostECPWorkspaceInitiator.java
@@ -0,0 +1,28 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2011 Chair for Applied Software Engineering,
+ * Technische Universitaet Muenchen.
+ * 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:
+ ******************************************************************************/
+package org.eclipse.emf.ecp.common.model;
+
+import org.eclipse.emf.ecp.common.model.workSpaceModel.ECPWorkspace;
+
+/**
+ * Listener for ECP workspace init.
+ * @author Jonas Helming
+ *
+ */
+public interface PostECPWorkspaceInitiator {
+
+ /**
+ * Called to notify about workspace init completion.
+ * @param currentWorkspace the current workspace
+ */
+ void workspaceInitComplete(ECPWorkspace currentWorkspace);
+
+}
\ No newline at end of file
diff --git a/old/org.eclipse.emf.ecp.common.model/src/org/eclipse/emf/ecp/common/model/workSpaceModel/ECPProject.java b/old/org.eclipse.emf.ecp.common.model/src/org/eclipse/emf/ecp/common/model/workSpaceModel/ECPProject.java
new file mode 100644
index 0000000..aea2226
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.common.model/src/org/eclipse/emf/ecp/common/model/workSpaceModel/ECPProject.java
@@ -0,0 +1,162 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2011 Chair for Applied Software Engineering,
+ * Technische Universitaet Muenchen.
+ * 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:
+ ******************************************************************************/
+package org.eclipse.emf.ecp.common.model.workSpaceModel;
+
+import java.util.Collection;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecp.common.model.ECPModelelementContext;
+
+/**
+ * <!-- begin-user-doc --> A representation of the model object ' <em><b>ECP Project</b></em>'.
+ *
+ * @implements ECPModelelementContext <!-- end-user-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * <ul>
+ * <li>{@link org.eclipse.emf.ecp.common.model.workSpaceModel.ECPProject#getWorkspace <em>Workspace</em>}</li>
+ * <li>{@link org.eclipse.emf.ecp.common.model.workSpaceModel.ECPProject#getRootObject <em>Root Object</em>}
+ * </li>
+ * </ul>
+ * </p>
+ *
+ * @see org.eclipse.emf.ecp.common.model.workSpaceModel.WorkSpaceModelPackage#getECPProject()
+ * @model abstract="true"
+ * @generated
+ */
+public interface ECPProject extends EObject, ECPModelelementContext {
+
+ /**
+ * Returns the value of the '<em><b>Workspace</b></em>' container reference.
+ * It is bidirectional and its opposite is '
+ * {@link org.eclipse.emf.ecp.common.model.workSpaceModel.ECPWorkspace#getProjects <em>Projects</em>}'.
+ * <!-- begin-user-doc
+ * -->
+ * <p>
+ * If the meaning of the '<em>Workspace</em>' container reference isn't clear, there really should be more of a
+ * description here...
+ * </p>
+ * <!-- end-user-doc -->
+ *
+ * @return the value of the '<em>Workspace</em>' container reference.
+ * @see #setWorkspace(ECPWorkspace)
+ * @see org.eclipse.emf.ecp.common.model.workSpaceModel.WorkSpaceModelPackage#getECPProject_Workspace()
+ * @see org.eclipse.emf.ecp.common.model.workSpaceModel.ECPWorkspace#getProjects
+ * @model opposite="projects" transient="false"
+ * @generated
+ */
+ ECPWorkspace getWorkspace();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.emf.ecp.common.model.workSpaceModel.ECPProject#getWorkspace
+ * <em>Workspace</em>}' container reference.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @param value the new value of the '<em>Workspace</em>' container reference.
+ * @see #getWorkspace()
+ * @generated
+ */
+ void setWorkspace(ECPWorkspace value);
+
+ /**
+ * Checks whether an EObject is contained in the project.
+ *
+ * @param eObject EObject
+ * @return true if is contained
+ * @generated not
+ */
+ boolean contains(EObject eObject);
+
+ /**
+ * Returns all model elements contained in the project. Don't add elements to this collection. Instead use
+ * {@link #addModelElementToRoot(EObject)} or attach it as a child of an element of this collection.
+ *
+ * @return all model elements
+ * @generated not
+ */
+ Collection<EObject> getAllModelElements();
+
+ void dispose();
+
+ /**
+ * Allows to add an {@link ECPProjectListener}.
+ *
+ * @param listener listener
+ * @generated not
+ */
+ void addECPProjectListener(ECPProjectListener listener);
+
+ /**
+ * Allows to remove an {@link ECPProjectListener}.
+ *
+ * @param listener listener
+ * @generated not
+ */
+ void removeECPProjectListener(ECPProjectListener listener);
+
+ /**
+ * Notifies listeners about changes in the project.
+ *
+ * @generated not
+ */
+ void projectChanged();
+
+ /**
+ * Notifies about deletion of a project.
+ *
+ * @generated not
+ */
+ void projectDeleted();
+
+ /**
+ * Notifies about deletion of an model element.
+ *
+ * @param eobject
+ */
+ void modelelementDeleted(EObject eobject);
+
+ /**
+ * Lets you add an element to the RootObject. This method is necessary since you don't know which feature of the
+ * RootObject to use.
+ *
+ * @param eObject
+ * @generated not
+ */
+ void addModelElementToRoot(EObject eObject);
+
+ /**
+ * Returns the root object of the model, which is visible to the user. In general it is some sort of project.
+ *
+ * @return eobject
+ */
+ EObject getRootObject();
+
+ /**
+ * Returns the root container of all EObjects contained in the project. This can but does not need to be identical
+ * with the root object return by getRootObject().
+ *
+ * @return
+ */
+ EObject getRootContainer();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.emf.ecp.common.model.workSpaceModel.ECPProject#getRootObject
+ * <em>Root Object</em>}' reference.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @param value the new value of the '<em>Root Object</em>' reference.
+ * @see #getRootObject()
+ * @generated
+ */
+ void setRootObject(EObject value);
+
+} // ECPProject
\ No newline at end of file
diff --git a/old/org.eclipse.emf.ecp.common.model/src/org/eclipse/emf/ecp/common/model/workSpaceModel/ECPProjectListener.java b/old/org.eclipse.emf.ecp.common.model/src/org/eclipse/emf/ecp/common/model/workSpaceModel/ECPProjectListener.java
new file mode 100644
index 0000000..18aace4
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.common.model/src/org/eclipse/emf/ecp/common/model/workSpaceModel/ECPProjectListener.java
@@ -0,0 +1,38 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2011 Chair for Applied Software Engineering,
+ * Technische Universitaet Muenchen.
+ * 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:
+ ******************************************************************************/
+package org.eclipse.emf.ecp.common.model.workSpaceModel;
+
+import org.eclipse.emf.ecore.EObject;
+
+/**
+ * Listens to any change in a project.
+ *
+ * @author helming
+ */
+public interface ECPProjectListener {
+ /**
+ * called if a project changes.
+ */
+ void projectChanged();
+
+ /**
+ * Called if a modelelement gets deleted.
+ *
+ * @param eobject the deleted eobject
+ */
+ void modelelementDeleted(EObject eobject);
+
+ /**
+ * called if the project gets deleted.
+ */
+ void projectDeleted();
+
+}
\ No newline at end of file
diff --git a/old/org.eclipse.emf.ecp.common.model/src/org/eclipse/emf/ecp/common/model/workSpaceModel/ECPWorkspace.java b/old/org.eclipse.emf.ecp.common.model/src/org/eclipse/emf/ecp/common/model/workSpaceModel/ECPWorkspace.java
new file mode 100644
index 0000000..eca4ac2
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.common.model/src/org/eclipse/emf/ecp/common/model/workSpaceModel/ECPWorkspace.java
@@ -0,0 +1,94 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2011 Chair for Applied Software Engineering,
+ * Technische Universitaet Muenchen.
+ * 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:
+ ******************************************************************************/
+package org.eclipse.emf.ecp.common.model.workSpaceModel;
+
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.edit.domain.EditingDomain;
+
+/**
+ * <!-- begin-user-doc --> A representation of the model object '<em><b>ECP Workspace</b></em>'. <!-- end-user-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * <ul>
+ * <li>{@link org.eclipse.emf.ecp.common.model.workSpaceModel.ECPWorkspace#getProjects <em>Projects</em>}</li>
+ * <li>{@link org.eclipse.emf.ecp.common.model.workSpaceModel.ECPWorkspace#getActiveProject <em>Active Project</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @see org.eclipse.emf.ecp.common.model.workSpaceModel.WorkSpaceModelPackage#getECPWorkspace()
+ * @model
+ * @generated
+ */
+public interface ECPWorkspace extends EObject {
+ /**
+ * Returns the value of the '<em><b>Projects</b></em>' containment reference list.
+ * The list contents are of type {@link org.eclipse.emf.ecp.common.model.workSpaceModel.ECPProject}.
+ * It is bidirectional and its opposite is '
+ * {@link org.eclipse.emf.ecp.common.model.workSpaceModel.ECPProject#getWorkspace <em>Workspace</em>}'.
+ * <!-- begin-user-doc
+ * -->
+ * <p>
+ * If the meaning of the '<em>Projects</em>' containment reference isn't clear, there really should be more of a
+ * description here...
+ * </p>
+ * <!-- end-user-doc -->
+ *
+ * @return the value of the '<em>Projects</em>' containment reference list.
+ * @see org.eclipse.emf.ecp.common.model.workSpaceModel.WorkSpaceModelPackage#getECPWorkspace_Projects()
+ * @see org.eclipse.emf.ecp.common.model.workSpaceModel.ECPProject#getWorkspace
+ * @model opposite="workspace" containment="true"
+ * @generated
+ */
+ EList<ECPProject> getProjects();
+
+ public ECPProject getProject(EObject me);
+
+ public ECPProject getActiveProject();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.emf.ecp.common.model.workSpaceModel.ECPWorkspace#getActiveProject
+ * <em>Active Project</em>}' reference.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @param value the new value of the '<em>Active Project</em>' reference.
+ * @see #getActiveProject()
+ * @generated
+ */
+ void setActiveProject(ECPProject value);
+
+ public void setActiveModelelement(EObject eobject);
+
+ /**
+ * Returns the editing domain.
+ *
+ * @return the editing domain
+ */
+ public EditingDomain getEditingDomain();
+
+ /**
+ * Sets the editing domain.
+ *
+ * @param editingDomain the editing domain
+ */
+ public void setEditingDomain(EditingDomain editingDomain);
+
+ /**
+ * Checks if the eobject is a root object in this workspace. Root objects are not the ECPProjects, but the wrapper
+ * objects, returned by ecpproject.getRootObject.
+ *
+ * @param eObject the object to check if it is a root object
+ * @return if the object is a root object;
+ */
+ public boolean isRootObject(EObject eObject);
+
+} // ECPWorkspace
\ No newline at end of file
diff --git a/old/org.eclipse.emf.ecp.common.model/src/org/eclipse/emf/ecp/common/model/workSpaceModel/WorkSpaceModelFactory.java b/old/org.eclipse.emf.ecp.common.model/src/org/eclipse/emf/ecp/common/model/workSpaceModel/WorkSpaceModelFactory.java
new file mode 100644
index 0000000..9ede686
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.common.model/src/org/eclipse/emf/ecp/common/model/workSpaceModel/WorkSpaceModelFactory.java
@@ -0,0 +1,51 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2011 Chair for Applied Software Engineering,
+ * Technische Universitaet Muenchen.
+ * 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:
+ ******************************************************************************/
+package org.eclipse.emf.ecp.common.model.workSpaceModel;
+
+import org.eclipse.emf.ecore.EFactory;
+
+/**
+ * <!-- begin-user-doc --> The <b>Factory</b> for the model. It provides a create method for each non-abstract class of
+ * the model. <!-- end-user-doc -->
+ *
+ * @see org.eclipse.emf.ecp.common.model.workSpaceModel.WorkSpaceModelPackage
+ * @generated
+ */
+public interface WorkSpaceModelFactory extends EFactory {
+ /**
+ * The singleton instance of the factory.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ WorkSpaceModelFactory eINSTANCE = org.eclipse.emf.ecp.common.model.workSpaceModel.impl.WorkSpaceModelFactoryImpl
+ .init();
+
+ /**
+ * Returns a new object of class '<em>ECP Workspace</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @return a new object of class '<em>ECP Workspace</em>'.
+ * @generated
+ */
+ ECPWorkspace createECPWorkspace();
+
+ /**
+ * Returns the package supported by this factory.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @return the package supported by this factory.
+ * @generated
+ */
+ WorkSpaceModelPackage getWorkSpaceModelPackage();
+
+} // WorkSpaceModelFactory
\ No newline at end of file
diff --git a/old/org.eclipse.emf.ecp.common.model/src/org/eclipse/emf/ecp/common/model/workSpaceModel/WorkSpaceModelPackage.java b/old/org.eclipse.emf.ecp.common.model/src/org/eclipse/emf/ecp/common/model/workSpaceModel/WorkSpaceModelPackage.java
new file mode 100644
index 0000000..6f35873
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.common.model/src/org/eclipse/emf/ecp/common/model/workSpaceModel/WorkSpaceModelPackage.java
@@ -0,0 +1,302 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2011 Chair for Applied Software Engineering,
+ * Technische Universitaet Muenchen.
+ * 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:
+ ******************************************************************************/
+package org.eclipse.emf.ecp.common.model.workSpaceModel;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.ecore.EReference;
+
+/**
+ * <!-- begin-user-doc --> The <b>Package</b> for the model. It contains accessors for the meta objects to represent
+ * <ul>
+ * <li>each class,</li>
+ * <li>each feature of each class,</li>
+ * <li>each enum,</li>
+ * <li>and each data type</li>
+ * </ul>
+ * <!-- end-user-doc -->
+ *
+ * @see org.eclipse.emf.ecp.common.model.workSpaceModel.WorkSpaceModelFactory
+ * @model kind="package"
+ * @generated
+ */
+public interface WorkSpaceModelPackage extends EPackage {
+ /**
+ * The package name.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ String eNAME = "workSpaceModel";
+
+ /**
+ * The package namespace URI.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ String eNS_URI = "http://eclipse.org/emf/ecp/common/model/workspaceModel";
+
+ /**
+ * The package namespace name.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ String eNS_PREFIX = "org.eclipse.emf.ecp.common.model";
+
+ /**
+ * The singleton instance of the package.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ WorkSpaceModelPackage eINSTANCE = org.eclipse.emf.ecp.common.model.workSpaceModel.impl.WorkSpaceModelPackageImpl
+ .init();
+
+ /**
+ * The meta object id for the '{@link org.eclipse.emf.ecp.common.model.workSpaceModel.impl.ECPWorkspaceImpl
+ * <em>ECP Workspace</em>}' class.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see org.eclipse.emf.ecp.common.model.workSpaceModel.impl.ECPWorkspaceImpl
+ * @see org.eclipse.emf.ecp.common.model.workSpaceModel.impl.WorkSpaceModelPackageImpl#getECPWorkspace()
+ * @generated
+ */
+ int ECP_WORKSPACE = 0;
+
+ /**
+ * The feature id for the '<em><b>Projects</b></em>' containment reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int ECP_WORKSPACE__PROJECTS = 0;
+
+ /**
+ * The feature id for the '<em><b>Active Project</b></em>' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int ECP_WORKSPACE__ACTIVE_PROJECT = 1;
+
+ /**
+ * The number of structural features of the '<em>ECP Workspace</em>' class.
+ * <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int ECP_WORKSPACE_FEATURE_COUNT = 2;
+
+ /**
+ * The meta object id for the '{@link org.eclipse.emf.ecp.common.model.workSpaceModel.impl.ECPProjectImpl
+ * <em>ECP Project</em>}' class.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see org.eclipse.emf.ecp.common.model.workSpaceModel.impl.ECPProjectImpl
+ * @see org.eclipse.emf.ecp.common.model.workSpaceModel.impl.WorkSpaceModelPackageImpl#getECPProject()
+ * @generated
+ */
+ int ECP_PROJECT = 1;
+
+ /**
+ * The feature id for the '<em><b>Workspace</b></em>' container reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int ECP_PROJECT__WORKSPACE = 0;
+
+ /**
+ * The feature id for the '<em><b>Root Object</b></em>' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int ECP_PROJECT__ROOT_OBJECT = 1;
+
+ /**
+ * The number of structural features of the '<em>ECP Project</em>' class. <!-- begin-user-doc --> <!-- end-user-doc
+ * -->
+ *
+ * @generated
+ * @ordered
+ */
+ int ECP_PROJECT_FEATURE_COUNT = 2;
+
+ /**
+ * Returns the meta object for class '{@link org.eclipse.emf.ecp.common.model.workSpaceModel.ECPWorkspace
+ * <em>ECP Workspace</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @return the meta object for class '<em>ECP Workspace</em>'.
+ * @see org.eclipse.emf.ecp.common.model.workSpaceModel.ECPWorkspace
+ * @generated
+ */
+ EClass getECPWorkspace();
+
+ /**
+ * Returns the meta object for the containment reference list '
+ * {@link org.eclipse.emf.ecp.common.model.workSpaceModel.ECPWorkspace#getProjects <em>Projects</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @return the meta object for the containment reference list '<em>Projects</em>'.
+ * @see org.eclipse.emf.ecp.common.model.workSpaceModel.ECPWorkspace#getProjects()
+ * @see #getECPWorkspace()
+ * @generated
+ */
+ EReference getECPWorkspace_Projects();
+
+ /**
+ * Returns the meta object for the reference '
+ * {@link org.eclipse.emf.ecp.common.model.workSpaceModel.ECPWorkspace#getActiveProject <em>Active Project</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @return the meta object for the reference '<em>Active Project</em>'.
+ * @see org.eclipse.emf.ecp.common.model.workSpaceModel.ECPWorkspace#getActiveProject()
+ * @see #getECPWorkspace()
+ * @generated
+ */
+ EReference getECPWorkspace_ActiveProject();
+
+ /**
+ * Returns the meta object for class '{@link org.eclipse.emf.ecp.common.model.workSpaceModel.ECPProject
+ * <em>ECP Project</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @return the meta object for class '<em>ECP Project</em>'.
+ * @see org.eclipse.emf.ecp.common.model.workSpaceModel.ECPProject
+ * @generated
+ */
+ EClass getECPProject();
+
+ /**
+ * Returns the meta object for the container reference '
+ * {@link org.eclipse.emf.ecp.common.model.workSpaceModel.ECPProject#getWorkspace <em>Workspace</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @return the meta object for the container reference '<em>Workspace</em>'.
+ * @see org.eclipse.emf.ecp.common.model.workSpaceModel.ECPProject#getWorkspace()
+ * @see #getECPProject()
+ * @generated
+ */
+ EReference getECPProject_Workspace();
+
+ /**
+ * Returns the meta object for the reference '
+ * {@link org.eclipse.emf.ecp.common.model.workSpaceModel.ECPProject#getRootObject <em>Root Object</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @return the meta object for the reference '<em>Root Object</em>'.
+ * @see org.eclipse.emf.ecp.common.model.workSpaceModel.ECPProject#getRootObject()
+ * @see #getECPProject()
+ * @generated
+ */
+ EReference getECPProject_RootObject();
+
+ /**
+ * Returns the factory that creates the instances of the model.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @return the factory that creates the instances of the model.
+ * @generated
+ */
+ WorkSpaceModelFactory getWorkSpaceModelFactory();
+
+ /**
+ * <!-- begin-user-doc --> Defines literals for the meta objects that represent
+ * <ul>
+ * <li>each class,</li>
+ * <li>each feature of each class,</li>
+ * <li>each enum,</li>
+ * <li>and each data type</li>
+ * </ul>
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ interface Literals {
+ /**
+ * The meta object literal for the '
+ * {@link org.eclipse.emf.ecp.common.model.workSpaceModel.impl.ECPWorkspaceImpl <em>ECP Workspace</em>}' class.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see org.eclipse.emf.ecp.common.model.workSpaceModel.impl.ECPWorkspaceImpl
+ * @see org.eclipse.emf.ecp.common.model.workSpaceModel.impl.WorkSpaceModelPackageImpl#getECPWorkspace()
+ * @generated
+ */
+ EClass ECP_WORKSPACE = eINSTANCE.getECPWorkspace();
+
+ /**
+ * The meta object literal for the '<em><b>Projects</b></em>' containment reference list feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ EReference ECP_WORKSPACE__PROJECTS = eINSTANCE.getECPWorkspace_Projects();
+
+ /**
+ * The meta object literal for the '<em><b>Active Project</b></em>' reference feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ EReference ECP_WORKSPACE__ACTIVE_PROJECT = eINSTANCE.getECPWorkspace_ActiveProject();
+
+ /**
+ * The meta object literal for the '{@link org.eclipse.emf.ecp.common.model.workSpaceModel.impl.ECPProjectImpl
+ * <em>ECP Project</em>}' class.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see org.eclipse.emf.ecp.common.model.workSpaceModel.impl.ECPProjectImpl
+ * @see org.eclipse.emf.ecp.common.model.workSpaceModel.impl.WorkSpaceModelPackageImpl#getECPProject()
+ * @generated
+ */
+ EClass ECP_PROJECT = eINSTANCE.getECPProject();
+
+ /**
+ * The meta object literal for the '<em><b>Workspace</b></em>' container reference feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ EReference ECP_PROJECT__WORKSPACE = eINSTANCE.getECPProject_Workspace();
+
+ /**
+ * The meta object literal for the '<em><b>Root Object</b></em>' reference feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ EReference ECP_PROJECT__ROOT_OBJECT = eINSTANCE.getECPProject_RootObject();
+
+ }
+
+} // WorkSpaceModelPackage
\ No newline at end of file
diff --git a/old/org.eclipse.emf.ecp.common.model/src/org/eclipse/emf/ecp/common/model/workSpaceModel/impl/ECPProjectImpl.java b/old/org.eclipse.emf.ecp.common.model/src/org/eclipse/emf/ecp/common/model/workSpaceModel/impl/ECPProjectImpl.java
new file mode 100644
index 0000000..e23fa6f
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.common.model/src/org/eclipse/emf/ecp/common/model/workSpaceModel/impl/ECPProjectImpl.java
@@ -0,0 +1,360 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2011 Chair for Applied Software Engineering,
+ * Technische Universitaet Muenchen.
+ * 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:
+ ******************************************************************************/
+package org.eclipse.emf.ecp.common.model.workSpaceModel.impl;
+
+import java.util.ArrayList;
+import java.util.Collection;
+
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.notify.NotificationChain;
+import org.eclipse.emf.common.util.BasicEList;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.InternalEObject;
+import org.eclipse.emf.ecore.impl.ENotificationImpl;
+import org.eclipse.emf.ecore.impl.EObjectImpl;
+import org.eclipse.emf.ecore.util.EcoreUtil;
+import org.eclipse.emf.ecp.common.model.ModelElementContextListener;
+import org.eclipse.emf.ecp.common.model.workSpaceModel.ECPProject;
+import org.eclipse.emf.ecp.common.model.workSpaceModel.ECPProjectListener;
+import org.eclipse.emf.ecp.common.model.workSpaceModel.ECPWorkspace;
+import org.eclipse.emf.ecp.common.model.workSpaceModel.WorkSpaceModelPackage;
+
+/**
+ * <!-- begin-user-doc --> An implementation of the model object '<em><b>ECP Project</b></em>'. <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * <ul>
+ * <li>{@link org.eclipse.emf.ecp.common.model.workSpaceModel.impl.ECPProjectImpl#getWorkspace <em>Workspace</em>}</li>
+ * <li>{@link org.eclipse.emf.ecp.common.model.workSpaceModel.impl.ECPProjectImpl#getRootObject <em>Root Object</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @generated
+ */
+public abstract class ECPProjectImpl extends EObjectImpl implements ECPProject {
+
+ /**
+ * {@inheritDoc}
+ */
+ public EObject getRootContainer() {
+ // default implementation returns root object
+ return getRootObject();
+ }
+
+ /**
+ * The cached value of the '{@link #getRootObject() <em>Root Object</em>}' reference.
+ * <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @see #getRootObject()
+ * @generated
+ * @ordered
+ */
+ protected EObject rootObject;
+ private ArrayList<ECPProjectListener> listeners = new ArrayList<ECPProjectListener>();
+ private ArrayList<ModelElementContextListener> contextListeners = new ArrayList<ModelElementContextListener>();
+
+ public void addECPProjectListener(ECPProjectListener listener) {
+ listeners.add(listener);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void removeECPProjectListener(ECPProjectListener listener) {
+ listeners.remove(listener);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void modelelementDeleted(EObject eobject) {
+ for (ECPProjectListener listener : listeners) {
+ listener.modelelementDeleted(eobject);
+ }
+ for (ModelElementContextListener listener : contextListeners) {
+ listener.onModelElementDeleted(eobject);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void projectDeleted() {
+ for (ECPProjectListener listener : listeners) {
+ listener.projectDeleted();
+ }
+
+ for (ModelElementContextListener listener : contextListeners) {
+ listener.onContextDeleted();
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void projectChanged() {
+ for (ECPProjectListener listener : listeners) {
+ listener.projectChanged();
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void addModelElementContextListener(ModelElementContextListener modelElementContextListener) {
+ contextListeners.add(modelElementContextListener);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void removeModelElementContextListener(ModelElementContextListener modelElementContextListener) {
+ contextListeners.remove(modelElementContextListener);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public Collection<EObject> getAllModelElementsbyClass(EClass clazz, boolean association) {
+ Collection<EObject> ret = new BasicEList<EObject>();
+
+ for (EObject element : getAllModelElements()) {
+ if ((element.eClass() == clazz || clazz.isInstance(element))
+ && (association || !getMetaModelElementContext().isAssociationClassElement(element))) {
+ ret.add(element);
+ }
+ }
+
+ return ret;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected ECPProjectImpl() {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ protected EClass eStaticClass() {
+ return WorkSpaceModelPackage.Literals.ECP_PROJECT;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public ECPWorkspace getWorkspace() {
+ if (eContainerFeatureID() != WorkSpaceModelPackage.ECP_PROJECT__WORKSPACE)
+ return null;
+ return (ECPWorkspace) eContainer();
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public NotificationChain basicSetWorkspace(ECPWorkspace newWorkspace, NotificationChain msgs) {
+ msgs = eBasicSetContainer((InternalEObject) newWorkspace, WorkSpaceModelPackage.ECP_PROJECT__WORKSPACE, msgs);
+ return msgs;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setWorkspace(ECPWorkspace newWorkspace) {
+ if (newWorkspace != eInternalContainer()
+ || (eContainerFeatureID() != WorkSpaceModelPackage.ECP_PROJECT__WORKSPACE && newWorkspace != null)) {
+ if (EcoreUtil.isAncestor(this, newWorkspace))
+ throw new IllegalArgumentException("Recursive containment not allowed for " + toString());
+ NotificationChain msgs = null;
+ if (eInternalContainer() != null)
+ msgs = eBasicRemoveFromContainer(msgs);
+ if (newWorkspace != null)
+ msgs = ((InternalEObject) newWorkspace).eInverseAdd(this,
+ WorkSpaceModelPackage.ECP_WORKSPACE__PROJECTS, ECPWorkspace.class, msgs);
+ msgs = basicSetWorkspace(newWorkspace, msgs);
+ if (msgs != null)
+ msgs.dispatch();
+ } else if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, WorkSpaceModelPackage.ECP_PROJECT__WORKSPACE,
+ newWorkspace, newWorkspace));
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public EObject getRootObject() {
+ if (rootObject != null && rootObject.eIsProxy()) {
+ InternalEObject oldRootObject = (InternalEObject) rootObject;
+ rootObject = eResolveProxy(oldRootObject);
+ if (rootObject != oldRootObject) {
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.RESOLVE,
+ WorkSpaceModelPackage.ECP_PROJECT__ROOT_OBJECT, oldRootObject, rootObject));
+ }
+ }
+ return rootObject;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public EObject basicGetRootObject() {
+ return rootObject;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setRootObject(EObject newRootObject) {
+ EObject oldRootObject = rootObject;
+ rootObject = newRootObject;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, WorkSpaceModelPackage.ECP_PROJECT__ROOT_OBJECT,
+ oldRootObject, rootObject));
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
+ switch (featureID) {
+ case WorkSpaceModelPackage.ECP_PROJECT__WORKSPACE:
+ if (eInternalContainer() != null)
+ msgs = eBasicRemoveFromContainer(msgs);
+ return basicSetWorkspace((ECPWorkspace) otherEnd, msgs);
+ }
+ return super.eInverseAdd(otherEnd, featureID, msgs);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
+ switch (featureID) {
+ case WorkSpaceModelPackage.ECP_PROJECT__WORKSPACE:
+ return basicSetWorkspace(null, msgs);
+ }
+ return super.eInverseRemove(otherEnd, featureID, msgs);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public NotificationChain eBasicRemoveFromContainerFeature(NotificationChain msgs) {
+ switch (eContainerFeatureID()) {
+ case WorkSpaceModelPackage.ECP_PROJECT__WORKSPACE:
+ return eInternalContainer().eInverseRemove(this, WorkSpaceModelPackage.ECP_WORKSPACE__PROJECTS,
+ ECPWorkspace.class, msgs);
+ }
+ return super.eBasicRemoveFromContainerFeature(msgs);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public Object eGet(int featureID, boolean resolve, boolean coreType) {
+ switch (featureID) {
+ case WorkSpaceModelPackage.ECP_PROJECT__WORKSPACE:
+ return getWorkspace();
+ case WorkSpaceModelPackage.ECP_PROJECT__ROOT_OBJECT:
+ if (resolve)
+ return getRootObject();
+ return basicGetRootObject();
+ }
+ return super.eGet(featureID, resolve, coreType);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public void eSet(int featureID, Object newValue) {
+ switch (featureID) {
+ case WorkSpaceModelPackage.ECP_PROJECT__WORKSPACE:
+ setWorkspace((ECPWorkspace) newValue);
+ return;
+ case WorkSpaceModelPackage.ECP_PROJECT__ROOT_OBJECT:
+ setRootObject((EObject) newValue);
+ return;
+ }
+ super.eSet(featureID, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public void eUnset(int featureID) {
+ switch (featureID) {
+ case WorkSpaceModelPackage.ECP_PROJECT__WORKSPACE:
+ setWorkspace((ECPWorkspace) null);
+ return;
+ case WorkSpaceModelPackage.ECP_PROJECT__ROOT_OBJECT:
+ setRootObject((EObject) null);
+ return;
+ }
+ super.eUnset(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public boolean eIsSet(int featureID) {
+ switch (featureID) {
+ case WorkSpaceModelPackage.ECP_PROJECT__WORKSPACE:
+ return getWorkspace() != null;
+ case WorkSpaceModelPackage.ECP_PROJECT__ROOT_OBJECT:
+ return rootObject != null;
+ }
+ return super.eIsSet(featureID);
+ }
+
+} // ECPProjectImpl
\ No newline at end of file
diff --git a/old/org.eclipse.emf.ecp.common.model/src/org/eclipse/emf/ecp/common/model/workSpaceModel/impl/ECPWorkspaceImpl.java b/old/org.eclipse.emf.ecp.common.model/src/org/eclipse/emf/ecp/common/model/workSpaceModel/impl/ECPWorkspaceImpl.java
new file mode 100644
index 0000000..f253908
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.common.model/src/org/eclipse/emf/ecp/common/model/workSpaceModel/impl/ECPWorkspaceImpl.java
@@ -0,0 +1,273 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2011 Chair for Applied Software Engineering,
+ * Technische Universitaet Muenchen.
+ * 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:
+ ******************************************************************************/
+package org.eclipse.emf.ecp.common.model.workSpaceModel.impl;
+
+import java.util.Collection;
+
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.notify.NotificationChain;
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.InternalEObject;
+import org.eclipse.emf.ecore.impl.ENotificationImpl;
+import org.eclipse.emf.ecore.impl.EObjectImpl;
+import org.eclipse.emf.ecore.util.EObjectContainmentWithInverseEList;
+import org.eclipse.emf.ecore.util.InternalEList;
+import org.eclipse.emf.ecp.common.model.workSpaceModel.ECPProject;
+import org.eclipse.emf.ecp.common.model.workSpaceModel.ECPWorkspace;
+import org.eclipse.emf.ecp.common.model.workSpaceModel.WorkSpaceModelPackage;
+import org.eclipse.emf.edit.domain.EditingDomain;
+
+/**
+ * <!-- begin-user-doc --> An implementation of the model object '<em><b>ECP Workspace</b></em>'. <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * <ul>
+ * <li>{@link org.eclipse.emf.ecp.common.model.workSpaceModel.impl.ECPWorkspaceImpl#getProjects <em>Projects</em>}</li>
+ * <li>{@link org.eclipse.emf.ecp.common.model.workSpaceModel.impl.ECPWorkspaceImpl#getActiveProject <em>Active Project
+ * </em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @generated
+ */
+public class ECPWorkspaceImpl extends EObjectImpl implements ECPWorkspace {
+ /**
+ * The cached value of the '{@link #getProjects() <em>Projects</em>}' containment reference list. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getProjects()
+ * @generated
+ * @ordered
+ */
+ protected EList<ECPProject> projects;
+
+ /**
+ * The cached value of the '{@link #getActiveProject() <em>Active Project</em>}' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @see #getActiveProject()
+ * @generated
+ * @ordered
+ */
+ protected ECPProject activeProject;
+
+ private EditingDomain editingDomain;
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected ECPWorkspaceImpl() {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ protected EClass eStaticClass() {
+ return WorkSpaceModelPackage.Literals.ECP_WORKSPACE;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public EList<ECPProject> getProjects() {
+ if (projects == null) {
+ projects = new EObjectContainmentWithInverseEList<ECPProject>(ECPProject.class, this,
+ WorkSpaceModelPackage.ECP_WORKSPACE__PROJECTS, WorkSpaceModelPackage.ECP_PROJECT__WORKSPACE);
+ }
+ return projects;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public ECPProject getActiveProject() {
+ if (activeProject != null && activeProject.eIsProxy()) {
+ InternalEObject oldActiveProject = (InternalEObject) activeProject;
+ activeProject = (ECPProject) eResolveProxy(oldActiveProject);
+ if (activeProject != oldActiveProject) {
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.RESOLVE,
+ WorkSpaceModelPackage.ECP_WORKSPACE__ACTIVE_PROJECT, oldActiveProject, activeProject));
+ }
+ }
+ return activeProject;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public ECPProject basicGetActiveProject() {
+ return activeProject;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setActiveProject(ECPProject newActiveProject) {
+ ECPProject oldActiveProject = activeProject;
+ activeProject = newActiveProject;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, WorkSpaceModelPackage.ECP_WORKSPACE__ACTIVE_PROJECT,
+ oldActiveProject, activeProject));
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @SuppressWarnings("unchecked")
+ @Override
+ public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
+ switch (featureID) {
+ case WorkSpaceModelPackage.ECP_WORKSPACE__PROJECTS:
+ return ((InternalEList<InternalEObject>) (InternalEList<?>) getProjects()).basicAdd(otherEnd, msgs);
+ }
+ return super.eInverseAdd(otherEnd, featureID, msgs);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
+ switch (featureID) {
+ case WorkSpaceModelPackage.ECP_WORKSPACE__PROJECTS:
+ return ((InternalEList<?>) getProjects()).basicRemove(otherEnd, msgs);
+ }
+ return super.eInverseRemove(otherEnd, featureID, msgs);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public Object eGet(int featureID, boolean resolve, boolean coreType) {
+ switch (featureID) {
+ case WorkSpaceModelPackage.ECP_WORKSPACE__PROJECTS:
+ return getProjects();
+ case WorkSpaceModelPackage.ECP_WORKSPACE__ACTIVE_PROJECT:
+ if (resolve)
+ return getActiveProject();
+ return basicGetActiveProject();
+ }
+ return super.eGet(featureID, resolve, coreType);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @SuppressWarnings("unchecked")
+ @Override
+ public void eSet(int featureID, Object newValue) {
+ switch (featureID) {
+ case WorkSpaceModelPackage.ECP_WORKSPACE__PROJECTS:
+ getProjects().clear();
+ getProjects().addAll((Collection<? extends ECPProject>) newValue);
+ return;
+ case WorkSpaceModelPackage.ECP_WORKSPACE__ACTIVE_PROJECT:
+ setActiveProject((ECPProject) newValue);
+ return;
+ }
+ super.eSet(featureID, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public void eUnset(int featureID) {
+ switch (featureID) {
+ case WorkSpaceModelPackage.ECP_WORKSPACE__PROJECTS:
+ getProjects().clear();
+ return;
+ case WorkSpaceModelPackage.ECP_WORKSPACE__ACTIVE_PROJECT:
+ setActiveProject((ECPProject) null);
+ return;
+ }
+ super.eUnset(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public boolean eIsSet(int featureID) {
+ switch (featureID) {
+ case WorkSpaceModelPackage.ECP_WORKSPACE__PROJECTS:
+ return projects != null && !projects.isEmpty();
+ case WorkSpaceModelPackage.ECP_WORKSPACE__ACTIVE_PROJECT:
+ return activeProject != null;
+ }
+ return super.eIsSet(featureID);
+ }
+
+ public EditingDomain getEditingDomain() {
+ return editingDomain;
+ }
+
+ public ECPProject getProject(EObject me) {
+ for (ECPProject project : getProjects()) {
+ if (project.contains(me)) {
+ return project;
+ }
+ }
+ throw new IllegalStateException("Project for element not found!");
+ }
+
+ public void setActiveModelelement(EObject eobject) {
+ if (eobject instanceof ECPProject) {
+ setActiveProject((ECPProject) eobject);
+ }
+ }
+
+ public void setEditingDomain(EditingDomain editingDomain) {
+ this.editingDomain = editingDomain;
+
+ }
+
+ public boolean isRootObject(EObject eObject) {
+ for (ECPProject ecpProject : getProjects()) {
+ if (ecpProject.getRootObject().equals(eObject)) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+} // ECPWorkspaceImpl
\ No newline at end of file
diff --git a/old/org.eclipse.emf.ecp.common.model/src/org/eclipse/emf/ecp/common/model/workSpaceModel/impl/WorkSpaceModelFactoryImpl.java b/old/org.eclipse.emf.ecp.common.model/src/org/eclipse/emf/ecp/common/model/workSpaceModel/impl/WorkSpaceModelFactoryImpl.java
new file mode 100644
index 0000000..6ad1f1d
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.common.model/src/org/eclipse/emf/ecp/common/model/workSpaceModel/impl/WorkSpaceModelFactoryImpl.java
@@ -0,0 +1,102 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2011 Chair for Applied Software Engineering,
+ * Technische Universitaet Muenchen.
+ * 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:
+ ******************************************************************************/
+package org.eclipse.emf.ecp.common.model.workSpaceModel.impl;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.ecore.impl.EFactoryImpl;
+import org.eclipse.emf.ecore.plugin.EcorePlugin;
+import org.eclipse.emf.ecp.common.model.workSpaceModel.ECPWorkspace;
+import org.eclipse.emf.ecp.common.model.workSpaceModel.WorkSpaceModelFactory;
+import org.eclipse.emf.ecp.common.model.workSpaceModel.WorkSpaceModelPackage;
+
+/**
+ * <!-- begin-user-doc --> An implementation of the model <b>Factory</b>. <!-- end-user-doc -->
+ *
+ * @generated
+ */
+public class WorkSpaceModelFactoryImpl extends EFactoryImpl implements WorkSpaceModelFactory {
+ /**
+ * Creates the default factory implementation.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public static WorkSpaceModelFactory init() {
+ try {
+ WorkSpaceModelFactory theWorkSpaceModelFactory = (WorkSpaceModelFactory) EPackage.Registry.INSTANCE
+ .getEFactory("http://eclipse.org/emf/ecp/common/model/workspaceModel");
+ if (theWorkSpaceModelFactory != null) {
+ return theWorkSpaceModelFactory;
+ }
+ } catch (Exception exception) {
+ EcorePlugin.INSTANCE.log(exception);
+ }
+ return new WorkSpaceModelFactoryImpl();
+ }
+
+ /**
+ * Creates an instance of the factory.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public WorkSpaceModelFactoryImpl() {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public EObject create(EClass eClass) {
+ switch (eClass.getClassifierID()) {
+ case WorkSpaceModelPackage.ECP_WORKSPACE:
+ return createECPWorkspace();
+ default:
+ throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier");
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public ECPWorkspace createECPWorkspace() {
+ ECPWorkspaceImpl ecpWorkspace = new ECPWorkspaceImpl();
+ return ecpWorkspace;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public WorkSpaceModelPackage getWorkSpaceModelPackage() {
+ return (WorkSpaceModelPackage) getEPackage();
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @deprecated
+ * @generated
+ */
+ @Deprecated
+ public static WorkSpaceModelPackage getPackage() {
+ return WorkSpaceModelPackage.eINSTANCE;
+ }
+
+} // WorkSpaceModelFactoryImpl
\ No newline at end of file
diff --git a/old/org.eclipse.emf.ecp.common.model/src/org/eclipse/emf/ecp/common/model/workSpaceModel/impl/WorkSpaceModelPackageImpl.java b/old/org.eclipse.emf.ecp.common.model/src/org/eclipse/emf/ecp/common/model/workSpaceModel/impl/WorkSpaceModelPackageImpl.java
new file mode 100644
index 0000000..a97b4de
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.common.model/src/org/eclipse/emf/ecp/common/model/workSpaceModel/impl/WorkSpaceModelPackageImpl.java
@@ -0,0 +1,249 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2011 Chair for Applied Software Engineering,
+ * Technische Universitaet Muenchen.
+ * 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:
+ ******************************************************************************/
+package org.eclipse.emf.ecp.common.model.workSpaceModel.impl;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.ecore.EReference;
+import org.eclipse.emf.ecore.impl.EPackageImpl;
+import org.eclipse.emf.ecp.common.model.workSpaceModel.ECPProject;
+import org.eclipse.emf.ecp.common.model.workSpaceModel.ECPWorkspace;
+import org.eclipse.emf.ecp.common.model.workSpaceModel.WorkSpaceModelFactory;
+import org.eclipse.emf.ecp.common.model.workSpaceModel.WorkSpaceModelPackage;
+
+/**
+ * <!-- begin-user-doc --> An implementation of the model <b>Package</b>. <!-- end-user-doc -->
+ *
+ * @generated
+ */
+public class WorkSpaceModelPackageImpl extends EPackageImpl implements WorkSpaceModelPackage {
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ private EClass ecpWorkspaceEClass = null;
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ private EClass ecpProjectEClass = null;
+
+ /**
+ * Creates an instance of the model <b>Package</b>, registered with {@link org.eclipse.emf.ecore.EPackage.Registry
+ * EPackage.Registry} by the package package URI value.
+ * <p>
+ * Note: the correct way to create the package is via the static factory method {@link #init init()}, which also
+ * performs initialization of the package, or returns the registered package, if one already exists. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see org.eclipse.emf.ecore.EPackage.Registry
+ * @see org.eclipse.emf.ecp.common.model.workSpaceModel.WorkSpaceModelPackage#eNS_URI
+ * @see #init()
+ * @generated
+ */
+ private WorkSpaceModelPackageImpl() {
+ super(eNS_URI, WorkSpaceModelFactory.eINSTANCE);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ private static boolean isInited = false;
+
+ /**
+ * Creates, registers, and initializes the <b>Package</b> for this model, and for any others upon which it depends.
+ * <p>
+ * This method is used to initialize {@link WorkSpaceModelPackage#eINSTANCE} when that field is accessed. Clients
+ * should not invoke it directly. Instead, they should simply access that field to obtain the package. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #eNS_URI
+ * @see #createPackageContents()
+ * @see #initializePackageContents()
+ * @generated
+ */
+ public static WorkSpaceModelPackage init() {
+ if (isInited)
+ return (WorkSpaceModelPackage) EPackage.Registry.INSTANCE.getEPackage(WorkSpaceModelPackage.eNS_URI);
+
+ // Obtain or create and register package
+ WorkSpaceModelPackageImpl theWorkSpaceModelPackage = (WorkSpaceModelPackageImpl) (EPackage.Registry.INSTANCE
+ .get(eNS_URI) instanceof WorkSpaceModelPackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI)
+ : new WorkSpaceModelPackageImpl());
+
+ isInited = true;
+
+ // Create package meta-data objects
+ theWorkSpaceModelPackage.createPackageContents();
+
+ // Initialize created meta-data
+ theWorkSpaceModelPackage.initializePackageContents();
+
+ // Mark meta-data to indicate it can't be changed
+ theWorkSpaceModelPackage.freeze();
+
+ // Update the registry and return the package
+ EPackage.Registry.INSTANCE.put(WorkSpaceModelPackage.eNS_URI, theWorkSpaceModelPackage);
+ return theWorkSpaceModelPackage;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public EClass getECPWorkspace() {
+ return ecpWorkspaceEClass;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public EReference getECPWorkspace_Projects() {
+ return (EReference) ecpWorkspaceEClass.getEStructuralFeatures().get(0);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public EReference getECPWorkspace_ActiveProject() {
+ return (EReference) ecpWorkspaceEClass.getEStructuralFeatures().get(1);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public EClass getECPProject() {
+ return ecpProjectEClass;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public EReference getECPProject_Workspace() {
+ return (EReference) ecpProjectEClass.getEStructuralFeatures().get(0);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public EReference getECPProject_RootObject() {
+ return (EReference) ecpProjectEClass.getEStructuralFeatures().get(1);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public WorkSpaceModelFactory getWorkSpaceModelFactory() {
+ return (WorkSpaceModelFactory) getEFactoryInstance();
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ private boolean isCreated = false;
+
+ /**
+ * Creates the meta-model objects for the package. This method is
+ * guarded to have no affect on any invocation but its first.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void createPackageContents() {
+ if (isCreated)
+ return;
+ isCreated = true;
+
+ // Create classes and their features
+ ecpWorkspaceEClass = createEClass(ECP_WORKSPACE);
+ createEReference(ecpWorkspaceEClass, ECP_WORKSPACE__PROJECTS);
+ createEReference(ecpWorkspaceEClass, ECP_WORKSPACE__ACTIVE_PROJECT);
+
+ ecpProjectEClass = createEClass(ECP_PROJECT);
+ createEReference(ecpProjectEClass, ECP_PROJECT__WORKSPACE);
+ createEReference(ecpProjectEClass, ECP_PROJECT__ROOT_OBJECT);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ private boolean isInitialized = false;
+
+ /**
+ * Complete the initialization of the package and its meta-model. This
+ * method is guarded to have no affect on any invocation but its first.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void initializePackageContents() {
+ if (isInitialized)
+ return;
+ isInitialized = true;
+
+ // Initialize package
+ setName(eNAME);
+ setNsPrefix(eNS_PREFIX);
+ setNsURI(eNS_URI);
+
+ // Create type parameters
+
+ // Set bounds for type parameters
+
+ // Add supertypes to classes
+
+ // Initialize classes and features; add operations and parameters
+ initEClass(ecpWorkspaceEClass, ECPWorkspace.class, "ECPWorkspace", !IS_ABSTRACT, !IS_INTERFACE,
+ IS_GENERATED_INSTANCE_CLASS);
+ initEReference(getECPWorkspace_Projects(), this.getECPProject(), this.getECPProject_Workspace(), "projects",
+ null, 0, -1, ECPWorkspace.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE,
+ !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEReference(getECPWorkspace_ActiveProject(), this.getECPProject(), null, "activeProject", null, 0, 1,
+ ECPWorkspace.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES,
+ !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+
+ initEClass(ecpProjectEClass, ECPProject.class, "ECPProject", IS_ABSTRACT, !IS_INTERFACE,
+ IS_GENERATED_INSTANCE_CLASS);
+ initEReference(getECPProject_Workspace(), this.getECPWorkspace(), this.getECPWorkspace_Projects(), "workspace",
+ null, 0, 1, ECPProject.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE,
+ !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEReference(getECPProject_RootObject(), ecorePackage.getEObject(), null, "rootObject", null, 0, 1,
+ ECPProject.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES,
+ !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+
+ // Create resource
+ createResource(eNS_URI);
+ }
+
+} // WorkSpaceModelPackageImpl
\ No newline at end of file
diff --git a/old/org.eclipse.emf.ecp.common.model/src/org/eclipse/emf/ecp/common/model/workSpaceModel/provider/ECPProjectItemProvider.java b/old/org.eclipse.emf.ecp.common.model/src/org/eclipse/emf/ecp/common/model/workSpaceModel/provider/ECPProjectItemProvider.java
new file mode 100644
index 0000000..a7b93c0
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.common.model/src/org/eclipse/emf/ecp/common/model/workSpaceModel/provider/ECPProjectItemProvider.java
@@ -0,0 +1,129 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2011 Chair for Applied Software Engineering,
+ * Technische Universitaet Muenchen.
+ * 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:
+ ******************************************************************************/
+package org.eclipse.emf.ecp.common.model.workSpaceModel.provider;
+
+import java.util.Collection;
+import java.util.List;
+
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.util.ResourceLocator;
+import org.eclipse.emf.ecp.common.model.workSpaceModel.WorkSpaceModelPackage;
+import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
+import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
+import org.eclipse.emf.edit.provider.IItemLabelProvider;
+import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
+import org.eclipse.emf.edit.provider.IItemPropertySource;
+import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
+import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
+import org.eclipse.emf.edit.provider.ItemProviderAdapter;
+
+/**
+ * This is the item provider adapter for a {@link org.eclipse.emf.ecp.common.model.workSpaceModel.ECPProject} object.
+ * <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+public class ECPProjectItemProvider extends ItemProviderAdapter implements IEditingDomainItemProvider,
+ IStructuredItemContentProvider, ITreeItemContentProvider, IItemLabelProvider, IItemPropertySource {
+ /**
+ * This constructs an instance from a factory and a notifier.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public ECPProjectItemProvider(AdapterFactory adapterFactory) {
+ super(adapterFactory);
+ }
+
+ /**
+ * This returns the property descriptors for the adapted class.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) {
+ if (itemPropertyDescriptors == null) {
+ super.getPropertyDescriptors(object);
+
+ addRootObjectPropertyDescriptor(object);
+ }
+ return itemPropertyDescriptors;
+ }
+
+ /**
+ * This adds a property descriptor for the Root Object feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected void addRootObjectPropertyDescriptor(Object object) {
+ itemPropertyDescriptors
+ .add(createItemPropertyDescriptor(
+ ((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(),
+ getResourceLocator(),
+ getString("_UI_ECPProject_rootObject_feature"),
+ getString("_UI_PropertyDescriptor_description", "_UI_ECPProject_rootObject_feature",
+ "_UI_ECPProject_type"), WorkSpaceModelPackage.Literals.ECP_PROJECT__ROOT_OBJECT, true, false, true,
+ null, null, null));
+ }
+
+ /**
+ * This returns the label text for the adapted class.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public String getText(Object object) {
+ return getString("_UI_ECPProject_type");
+ }
+
+ /**
+ * This handles model notifications by calling {@link #updateChildren} to update any cached children and by creating
+ * a viewer notification, which it passes to {@link #fireNotifyChanged}. <!-- begin-user-doc --> <!-- end-user-doc
+ * -->
+ *
+ * @generated
+ */
+ @Override
+ public void notifyChanged(Notification notification) {
+ updateChildren(notification);
+ super.notifyChanged(notification);
+ }
+
+ /**
+ * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children
+ * that can be created under this object.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) {
+ super.collectNewChildDescriptors(newChildDescriptors, object);
+ }
+
+ /**
+ * Return the resource locator for this item provider's resources.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public ResourceLocator getResourceLocator() {
+ return WorkspaceModelEditPlugin.INSTANCE;
+ }
+
+}
\ No newline at end of file
diff --git a/old/org.eclipse.emf.ecp.common.model/src/org/eclipse/emf/ecp/common/model/workSpaceModel/provider/ECPWorkspaceItemProvider.java b/old/org.eclipse.emf.ecp.common.model/src/org/eclipse/emf/ecp/common/model/workSpaceModel/provider/ECPWorkspaceItemProvider.java
new file mode 100644
index 0000000..84f8b24
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.common.model/src/org/eclipse/emf/ecp/common/model/workSpaceModel/provider/ECPWorkspaceItemProvider.java
@@ -0,0 +1,201 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2011 Chair for Applied Software Engineering,
+ * Technische Universitaet Muenchen.
+ * 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:
+ ******************************************************************************/
+package org.eclipse.emf.ecp.common.model.workSpaceModel.provider;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.emf.common.util.ResourceLocator;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.ecp.common.model.workSpaceModel.ECPProject;
+import org.eclipse.emf.ecp.common.model.workSpaceModel.ECPWorkspace;
+import org.eclipse.emf.ecp.common.model.workSpaceModel.WorkSpaceModelPackage;
+import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
+import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
+import org.eclipse.emf.edit.provider.IItemLabelProvider;
+import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
+import org.eclipse.emf.edit.provider.IItemPropertySource;
+import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
+import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
+import org.eclipse.emf.edit.provider.ItemProviderAdapter;
+import org.eclipse.emf.edit.provider.ViewerNotification;
+
+/**
+ * This is the item provider adapter for a {@link org.eclipse.emf.ecp.common.model.workSpaceModel.ECPWorkspace} object.
+ * <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+public class ECPWorkspaceItemProvider extends ItemProviderAdapter implements IEditingDomainItemProvider,
+ IStructuredItemContentProvider, ITreeItemContentProvider, IItemLabelProvider, IItemPropertySource {
+ @Override
+ public Collection<?> getChildren(Object object) {
+ if (object instanceof ECPWorkspace) {
+ ArrayList<EObject> ret = new ArrayList<EObject>();
+ EList<ECPProject> projects = ((ECPWorkspace) object).getProjects();
+ for (ECPProject ecpProject : projects) {
+ ret.add(ecpProject.getRootObject());
+ }
+ return ret;
+ }
+ return super.getChildren(object);
+ }
+
+ /**
+ * This constructs an instance from a factory and a notifier.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public ECPWorkspaceItemProvider(AdapterFactory adapterFactory) {
+ super(adapterFactory);
+ }
+
+ /**
+ * This returns the property descriptors for the adapted class.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) {
+ if (itemPropertyDescriptors == null) {
+ super.getPropertyDescriptors(object);
+
+ addProjectsPropertyDescriptor(object);
+ addActiveProjectPropertyDescriptor(object);
+ }
+ return itemPropertyDescriptors;
+ }
+
+ /**
+ * This adds a property descriptor for the Projects feature.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected void addProjectsPropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add(createItemPropertyDescriptor(
+ ((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(),
+ getResourceLocator(),
+ getString("_UI_ECPWorkspace_projects_feature"),
+ getString("_UI_PropertyDescriptor_description", "_UI_ECPWorkspace_projects_feature",
+ "_UI_ECPWorkspace_type"), WorkSpaceModelPackage.Literals.ECP_WORKSPACE__PROJECTS, true, false, true,
+ null, null, null));
+ }
+
+ /**
+ * This adds a property descriptor for the Active Project feature.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected void addActiveProjectPropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add(createItemPropertyDescriptor(
+ ((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(),
+ getResourceLocator(),
+ getString("_UI_ECPWorkspace_activeProject_feature"),
+ getString("_UI_PropertyDescriptor_description", "_UI_ECPWorkspace_activeProject_feature",
+ "_UI_ECPWorkspace_type"), WorkSpaceModelPackage.Literals.ECP_WORKSPACE__ACTIVE_PROJECT, true, false,
+ true, null, null, null));
+ }
+
+ /**
+ * This specifies how to implement {@link #getChildren} and is used to deduce an appropriate feature for an
+ * {@link org.eclipse.emf.edit.command.AddCommand}, {@link org.eclipse.emf.edit.command.RemoveCommand} or
+ * {@link org.eclipse.emf.edit.command.MoveCommand} in {@link #createCommand}.
+ * <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public Collection<? extends EStructuralFeature> getChildrenFeatures(Object object) {
+ if (childrenFeatures == null) {
+ super.getChildrenFeatures(object);
+ childrenFeatures.add(WorkSpaceModelPackage.Literals.ECP_WORKSPACE__PROJECTS);
+ }
+ return childrenFeatures;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ protected EStructuralFeature getChildFeature(Object object, Object child) {
+ // Check the type of the specified child object and return the proper feature to use for
+ // adding (see {@link AddCommand}) it as a child.
+
+ return super.getChildFeature(object, child);
+ }
+
+ /**
+ * This returns the label text for the adapted class.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public String getText(Object object) {
+ return getString("_UI_ECPWorkspace_type");
+ }
+
+ /**
+ * This handles model notifications by calling {@link #updateChildren} to update any cached children and by creating
+ * a viewer notification, which it passes to {@link #fireNotifyChanged}. <!-- begin-user-doc --> <!-- end-user-doc
+ * -->
+ *
+ * @generated
+ */
+ @Override
+ public void notifyChanged(Notification notification) {
+ updateChildren(notification);
+
+ switch (notification.getFeatureID(ECPWorkspace.class)) {
+ case WorkSpaceModelPackage.ECP_WORKSPACE__PROJECTS:
+ fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false));
+ return;
+ }
+ super.notifyChanged(notification);
+ }
+
+ /**
+ * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children
+ * that can be created under this object.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) {
+ super.collectNewChildDescriptors(newChildDescriptors, object);
+ }
+
+ /**
+ * Return the resource locator for this item provider's resources.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public ResourceLocator getResourceLocator() {
+ return WorkspaceModelEditPlugin.INSTANCE;
+ }
+
+}
\ No newline at end of file
diff --git a/old/org.eclipse.emf.ecp.common.model/src/org/eclipse/emf/ecp/common/model/workSpaceModel/provider/WorkSpaceModelItemProviderAdapterFactory.java b/old/org.eclipse.emf.ecp.common.model/src/org/eclipse/emf/ecp/common/model/workSpaceModel/provider/WorkSpaceModelItemProviderAdapterFactory.java
new file mode 100644
index 0000000..18a9e98
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.common.model/src/org/eclipse/emf/ecp/common/model/workSpaceModel/provider/WorkSpaceModelItemProviderAdapterFactory.java
@@ -0,0 +1,212 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2011 Chair for Applied Software Engineering,
+ * Technische Universitaet Muenchen.
+ * 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:
+ ******************************************************************************/
+package org.eclipse.emf.ecp.common.model.workSpaceModel.provider;
+
+import java.util.ArrayList;
+import java.util.Collection;
+
+import org.eclipse.emf.common.notify.Adapter;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.notify.Notifier;
+import org.eclipse.emf.ecp.common.model.workSpaceModel.util.WorkSpaceModelAdapterFactory;
+import org.eclipse.emf.edit.provider.ChangeNotifier;
+import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
+import org.eclipse.emf.edit.provider.ComposedAdapterFactory;
+import org.eclipse.emf.edit.provider.IChangeNotifier;
+import org.eclipse.emf.edit.provider.IDisposable;
+import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
+import org.eclipse.emf.edit.provider.IItemLabelProvider;
+import org.eclipse.emf.edit.provider.IItemPropertySource;
+import org.eclipse.emf.edit.provider.INotifyChangedListener;
+import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
+import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
+
+/**
+ * This is the factory that is used to provide the interfaces needed to support Viewers. The adapters generated by this
+ * factory convert EMF adapter notifications into calls to {@link #fireNotifyChanged fireNotifyChanged}. The adapters
+ * also support Eclipse property sheets. Note that most of the adapters are shared among multiple instances. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+public class WorkSpaceModelItemProviderAdapterFactory extends WorkSpaceModelAdapterFactory implements
+ ComposeableAdapterFactory, IChangeNotifier, IDisposable {
+ /**
+ * This keeps track of the root adapter factory that delegates to this adapter factory.
+ * <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @generated
+ */
+ protected ComposedAdapterFactory parentAdapterFactory;
+
+ /**
+ * This is used to implement {@link org.eclipse.emf.edit.provider.IChangeNotifier}.
+ * <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @generated
+ */
+ protected IChangeNotifier changeNotifier = new ChangeNotifier();
+
+ /**
+ * This keeps track of all the supported types checked by {@link #isFactoryForType isFactoryForType}. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected Collection<Object> supportedTypes = new ArrayList<Object>();
+
+ /**
+ * This constructs an instance.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public WorkSpaceModelItemProviderAdapterFactory() {
+ supportedTypes.add(IEditingDomainItemProvider.class);
+ supportedTypes.add(IStructuredItemContentProvider.class);
+ supportedTypes.add(ITreeItemContentProvider.class);
+ supportedTypes.add(IItemLabelProvider.class);
+ supportedTypes.add(IItemPropertySource.class);
+ }
+
+ /**
+ * This keeps track of the one adapter used for all
+ * {@link org.eclipse.emf.ecp.common.model.workSpaceModel.ECPWorkspace} instances.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected ECPWorkspaceItemProvider ecpWorkspaceItemProvider;
+
+ /**
+ * This creates an adapter for a {@link org.eclipse.emf.ecp.common.model.workSpaceModel.ECPWorkspace}.
+ * <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public Adapter createECPWorkspaceAdapter() {
+ if (ecpWorkspaceItemProvider == null) {
+ ecpWorkspaceItemProvider = new ECPWorkspaceItemProvider(this);
+ }
+
+ return ecpWorkspaceItemProvider;
+ }
+
+ /**
+ * This returns the root adapter factory that contains this factory.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public ComposeableAdapterFactory getRootAdapterFactory() {
+ return parentAdapterFactory == null ? this : parentAdapterFactory.getRootAdapterFactory();
+ }
+
+ /**
+ * This sets the composed adapter factory that contains this factory.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setParentAdapterFactory(ComposedAdapterFactory parentAdapterFactory) {
+ this.parentAdapterFactory = parentAdapterFactory;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public boolean isFactoryForType(Object type) {
+ return supportedTypes.contains(type) || super.isFactoryForType(type);
+ }
+
+ /**
+ * This implementation substitutes the factory itself as the key for the adapter.
+ * <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public Adapter adapt(Notifier notifier, Object type) {
+ return super.adapt(notifier, this);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public Object adapt(Object object, Object type) {
+ if (isFactoryForType(type)) {
+ Object adapter = super.adapt(object, type);
+ if (!(type instanceof Class<?>) || (((Class<?>) type).isInstance(adapter))) {
+ return adapter;
+ }
+ }
+
+ return null;
+ }
+
+ /**
+ * This adds a listener.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void addListener(INotifyChangedListener notifyChangedListener) {
+ changeNotifier.addListener(notifyChangedListener);
+ }
+
+ /**
+ * This removes a listener.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void removeListener(INotifyChangedListener notifyChangedListener) {
+ changeNotifier.removeListener(notifyChangedListener);
+ }
+
+ /**
+ * This delegates to {@link #changeNotifier} and to {@link #parentAdapterFactory}.
+ * <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @generated
+ */
+ public void fireNotifyChanged(Notification notification) {
+ changeNotifier.fireNotifyChanged(notification);
+
+ if (parentAdapterFactory != null) {
+ parentAdapterFactory.fireNotifyChanged(notification);
+ }
+ }
+
+ /**
+ * This disposes all of the item providers created by this factory.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void dispose() {
+ if (ecpWorkspaceItemProvider != null)
+ ecpWorkspaceItemProvider.dispose();
+ }
+
+}
\ No newline at end of file
diff --git a/old/org.eclipse.emf.ecp.common.model/src/org/eclipse/emf/ecp/common/model/workSpaceModel/provider/WorkspaceModelEditPlugin.java b/old/org.eclipse.emf.ecp.common.model/src/org/eclipse/emf/ecp/common/model/workSpaceModel/provider/WorkspaceModelEditPlugin.java
new file mode 100644
index 0000000..f99a54a
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.common.model/src/org/eclipse/emf/ecp/common/model/workSpaceModel/provider/WorkspaceModelEditPlugin.java
@@ -0,0 +1,94 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2011 Chair for Applied Software Engineering,
+ * Technische Universitaet Muenchen.
+ * 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:
+ ******************************************************************************/
+package org.eclipse.emf.ecp.common.model.workSpaceModel.provider;
+
+import org.eclipse.emf.common.EMFPlugin;
+import org.eclipse.emf.common.util.ResourceLocator;
+
+/**
+ * This is the central singleton for the WorkspaceModel edit plugin.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+public final class WorkspaceModelEditPlugin extends EMFPlugin {
+ /**
+ * Keep track of the singleton.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public static final WorkspaceModelEditPlugin INSTANCE = new WorkspaceModelEditPlugin();
+
+ /**
+ * Keep track of the singleton.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ private static Implementation plugin;
+
+ /**
+ * Create the instance.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public WorkspaceModelEditPlugin() {
+ super(new ResourceLocator[] {});
+ }
+
+ /**
+ * Returns the singleton instance of the Eclipse plugin.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @return the singleton instance.
+ * @generated
+ */
+ @Override
+ public ResourceLocator getPluginResourceLocator() {
+ return plugin;
+ }
+
+ /**
+ * Returns the singleton instance of the Eclipse plugin.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @return the singleton instance.
+ * @generated
+ */
+ public static Implementation getPlugin() {
+ return plugin;
+ }
+
+ /**
+ * The actual implementation of the Eclipse <b>Plugin</b>.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public static class Implementation extends EclipsePlugin {
+ /**
+ * Creates an instance.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public Implementation() {
+ super();
+
+ // Remember the static instance.
+ //
+ plugin = this;
+ }
+ }
+
+}
\ No newline at end of file
diff --git a/old/org.eclipse.emf.ecp.common.model/src/org/eclipse/emf/ecp/common/model/workSpaceModel/util/AssociationClassHelper.java b/old/org.eclipse.emf.ecp.common.model/src/org/eclipse/emf/ecp/common/model/workSpaceModel/util/AssociationClassHelper.java
new file mode 100644
index 0000000..1dcd522
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.common.model/src/org/eclipse/emf/ecp/common/model/workSpaceModel/util/AssociationClassHelper.java
@@ -0,0 +1,237 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2011 Chair for Applied Software Engineering,
+ * Technische Universitaet Muenchen.
+ * 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:
+ ******************************************************************************/
+package org.eclipse.emf.ecp.common.model.workSpaceModel.util;
+
+import java.util.LinkedList;
+import java.util.List;
+
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.ecore.EReference;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.ecp.common.model.ECPAssociationClassElement;
+import org.eclipse.emf.ecp.common.model.ECPMetaModelElementContext;
+import org.eclipse.emf.ecp.common.model.ECPModelelementContext;
+
+/**
+ * This class contains some utility methods for adding or deleting elements related to {@link AssociationClassElement}.
+ *
+ * @author Michael Haeger
+ */
+public final class AssociationClassHelper {
+
+ /**
+ * Private constructor.
+ */
+ private AssociationClassHelper() {
+ }
+
+ /**
+ * This method computes the additional {@link AssociationClassElement}'s for a dropped element.
+ *
+ * @param objectsToDrop The dropped element.
+ * @param elements The elements of the diagram the element was dropped on.
+ * @param context The context.
+ * @return The the {@link AssociationClassElement}'s which should be added.
+ */
+ public static List<EObject> getRelatedAssociationClassToDrop(List<EObject> objectsToDrop, List<EObject> elements,
+ ECPMetaModelElementContext context) {
+ List<EObject> result = new LinkedList<EObject>();
+ for (EObject objectToDrop : objectsToDrop) {
+ // get all features and try to find a AssociationClassElement
+ EList<EStructuralFeature> features = objectToDrop.eClass().getEAllStructuralFeatures();
+ for (EStructuralFeature feature : features) {
+ if (feature instanceof EReference
+ && context.isAssociationClassElement(((EReference) feature).getEReferenceType())) {
+ // get the value of the feature
+ Object evaluatedFeatures = objectToDrop.eGet(feature);
+ // feature value is a list
+ if (evaluatedFeatures instanceof List<?>) {
+ for (Object evaluatedFeature : (List<?>) evaluatedFeatures) {
+ handleAssociationClass(objectToDrop, objectsToDrop, (EObject) evaluatedFeature, elements,
+ result, context);
+ }
+ } // feature value is a single AssociationClassElement
+ else if (context.isAssociationClassElement((EObject) evaluatedFeatures)) {
+ handleAssociationClass(objectToDrop, objectsToDrop, (EObject) evaluatedFeatures, elements,
+ result, context);
+ }
+ }
+ }
+ }
+ return result;
+ }
+
+ private static void handleAssociationClass(EObject objectToDrop, List<EObject> objectsToDrop, EObject association,
+ List<EObject> elements, List<EObject> result, ECPMetaModelElementContext context) {
+
+ ECPAssociationClassElement ecpAssociation = context.getAssociationClassElement(association);
+
+ if (!result.contains(association) && !elements.contains(association)) {
+ // if source and target are on the diagram add also the AssociationClassElement
+ Object source = association.eGet(ecpAssociation.getSourceFeature());
+ Object target = association.eGet(ecpAssociation.getTargetFeature());
+
+ if (source.equals(objectToDrop)) {
+ if (elements.contains(target) || objectsToDrop.contains(target)) {
+ result.add(association);
+ }
+ } else if (target.equals(objectToDrop)) {
+ if (elements.contains(source) || objectsToDrop.contains(source)) {
+ result.add(association);
+ }
+ }
+ }
+ }
+
+ /**
+ * This method computes the additional {@link AssociationClassElement}'s for a deleted element.
+ *
+ * @param objectToDelete The deleted element.
+ * @param context The context.
+ * @return The the {@link AssociationClassElement}'s which should be also deleted.
+ */
+ public static List<EObject> getRelatedAssociationClassToDelete(EObject objectToDelete,
+ ECPMetaModelElementContext context) {
+ List<EObject> result = new LinkedList<EObject>();
+ // get all features and try to find a AssociationClassElement
+ EList<EStructuralFeature> features = objectToDelete.eClass().getEAllStructuralFeatures();
+ for (EStructuralFeature feature : features) {
+ if (feature instanceof EReference
+ && context.isAssociationClassElement(((EReference) feature).getEReferenceType())) {
+ // get the value of the feature
+ Object evaluatedFeatures = objectToDelete.eGet(feature);
+ if (evaluatedFeatures == null) {
+ continue;
+ }
+ // feature value is a list
+ if (evaluatedFeatures instanceof List<?>) {
+ for (Object evaluatedFeature : (List<?>) evaluatedFeatures) {
+ if (context.isAssociationClassElement((EObject) evaluatedFeature)) {
+ result.add((EObject) evaluatedFeature);
+ }
+ }
+ } // feature value is a single AssociationClassElement
+ else if (context.isAssociationClassElement((EObject) evaluatedFeatures)) {
+ result.add((EObject) evaluatedFeatures);
+ }
+ }
+ }
+ return result;
+ }
+
+ /**
+ * This method returns the other side of an association as a model element for a given element and association.
+ *
+ * @param element One end of the association
+ * @param association The association
+ * @param context The context.
+ * @return The other side of the association or {@code null} if the element not belongs to the association
+ */
+ public static EObject getRelatedModelElement(EObject element, EObject association, ECPModelelementContext context) {
+
+ ECPAssociationClassElement ecpAssociation = context.getMetaModelElementContext().getAssociationClassElement(
+ association);
+
+ Object source = association.eGet(ecpAssociation.getSourceFeature());
+ Object target = association.eGet(ecpAssociation.getTargetFeature());
+
+ if (element.equals(source)) {
+ return (EObject) target;
+ } else if (element.equals(target)) {
+ return (EObject) source;
+ }
+
+ return null;
+ }
+
+ /**
+ * This method returns the other side of an association as an {@link EReference} for a given reference and
+ * association.
+ *
+ * @param eReference One end of the association
+ * @param association The association
+ * @param context The context.
+ * @return The other side of the association or {@code null} if the reference not belongs to the association
+ */
+ public static EReference getRelatedEReference(EReference eReference, EObject association,
+ ECPMetaModelElementContext context) {
+ ECPAssociationClassElement ecpAssociation = context.getAssociationClassElement(association);
+ if (eReference.equals(ecpAssociation.getTargetFeature().getEOpposite())) {
+ return ecpAssociation.getSourceFeature().getEOpposite();
+ } else if (eReference.equals(ecpAssociation.getSourceFeature().getEOpposite())) {
+ return ecpAssociation.getTargetFeature().getEOpposite();
+ }
+ return null;
+ }
+
+ /**
+ * This method returns all features of a given association.
+ *
+ * @param association the association
+ * @param context the context.
+ * @return a list of features.
+ */
+ public static List<EStructuralFeature> getAssociationFeatures(EObject association,
+ ECPMetaModelElementContext context) {
+
+ ECPAssociationClassElement ecpAssociation = context.getAssociationClassElement(association);
+
+ return ecpAssociation.getAssociationFeatures();
+ }
+
+ /**
+ * This method creates an association model element and setup all references between the given model elements. The
+ * reference is contained in the source model element. The method automatically calculate source and target.
+ *
+ * @param eReference The reference that belongs to {@code modelElement}
+ * @param modelElement One model element
+ * @param relatedModelElement Second model element
+ * @param context The context.
+ */
+ public static void createAssociation(EReference eReference, EObject modelElement, EObject relatedModelElement,
+ ECPMetaModelElementContext context) {
+
+ EClass eClazz = eReference.getEReferenceType();
+ EPackage ePackage = eClazz.getEPackage();
+ final EObject association = ePackage.getEFactoryInstance().create(eClazz);
+
+ ECPAssociationClassElement ecpAssociation = context.getAssociationClassElement(association);
+
+ if (ecpAssociation.getSourceFeature().getEOpposite().equals(eReference)) {
+ association.eSet(ecpAssociation.getSourceFeature(), modelElement);
+ association.eSet(ecpAssociation.getTargetFeature(), relatedModelElement);
+ } else {
+ association.eSet(ecpAssociation.getSourceFeature(), relatedModelElement);
+ association.eSet(ecpAssociation.getTargetFeature(), modelElement);
+ }
+ }
+
+ /**
+ * This methods computes the association features for an association. Use this for standard implementation.
+ *
+ * @param eClazz the {@link EClass}
+ * @param source the source feature
+ * @param target the target feature
+ * @return all association features without source and target
+ */
+ public static List<EStructuralFeature> getAssociationFeatures(EClass eClazz, EReference source, EReference target) {
+
+ LinkedList<EStructuralFeature> result = new LinkedList<EStructuralFeature>();
+ result.addAll(eClazz.getEStructuralFeatures());
+ result.remove(source);
+ result.remove(target);
+
+ return result;
+ }
+}
\ No newline at end of file
diff --git a/old/org.eclipse.emf.ecp.common.model/src/org/eclipse/emf/ecp/common/model/workSpaceModel/util/ECPWorkspaceProvider.java b/old/org.eclipse.emf.ecp.common.model/src/org/eclipse/emf/ecp/common/model/workSpaceModel/util/ECPWorkspaceProvider.java
new file mode 100644
index 0000000..866d18c
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.common.model/src/org/eclipse/emf/ecp/common/model/workSpaceModel/util/ECPWorkspaceProvider.java
@@ -0,0 +1,29 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2011 Chair for Applied Software Engineering,
+ * Technische Universitaet Muenchen.
+ * 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:
+ ******************************************************************************/
+package org.eclipse.emf.ecp.common.model.workSpaceModel.util;
+
+import org.eclipse.emf.ecp.common.model.workSpaceModel.ECPWorkspace;
+
+/**
+ * An ECPWorkspace provider is expected to provide the ECPWorkspace and to save the workspace upon change automatically.
+ * Changes can be changes to the ECPProjects contained in thew workspace or to any EObject contained in the ECPProjects.
+ *
+ * @author koegel
+ */
+public interface ECPWorkspaceProvider {
+
+ /**
+ * Retrieve the ECP Workspace.
+ *
+ * @return the ECPWorkspace
+ */
+ ECPWorkspace getECPWorkspace();
+}
\ No newline at end of file
diff --git a/old/org.eclipse.emf.ecp.common.model/src/org/eclipse/emf/ecp/common/model/workSpaceModel/util/WorkSpaceModelAdapterFactory.java b/old/org.eclipse.emf.ecp.common.model/src/org/eclipse/emf/ecp/common/model/workSpaceModel/util/WorkSpaceModelAdapterFactory.java
new file mode 100644
index 0000000..c5dfbc8
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.common.model/src/org/eclipse/emf/ecp/common/model/workSpaceModel/util/WorkSpaceModelAdapterFactory.java
@@ -0,0 +1,146 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2011 Chair for Applied Software Engineering,
+ * Technische Universitaet Muenchen.
+ * 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:
+ ******************************************************************************/
+package org.eclipse.emf.ecp.common.model.workSpaceModel.util;
+
+import org.eclipse.emf.common.notify.Adapter;
+import org.eclipse.emf.common.notify.Notifier;
+import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecp.common.model.workSpaceModel.ECPProject;
+import org.eclipse.emf.ecp.common.model.workSpaceModel.ECPWorkspace;
+import org.eclipse.emf.ecp.common.model.workSpaceModel.WorkSpaceModelPackage;
+
+/**
+ * <!-- begin-user-doc --> The <b>Adapter Factory</b> for the model. It provides an adapter <code>createXXX</code>
+ * method for each class of the model. <!-- end-user-doc -->
+ *
+ * @see org.eclipse.emf.ecp.common.model.workSpaceModel.WorkSpaceModelPackage
+ * @generated
+ */
+public class WorkSpaceModelAdapterFactory extends AdapterFactoryImpl {
+ /**
+ * The cached model package.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected static WorkSpaceModelPackage modelPackage;
+
+ /**
+ * Creates an instance of the adapter factory.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public WorkSpaceModelAdapterFactory() {
+ if (modelPackage == null) {
+ modelPackage = WorkSpaceModelPackage.eINSTANCE;
+ }
+ }
+
+ /**
+ * Returns whether this factory is applicable for the type of the object.
+ * <!-- begin-user-doc --> This
+ * implementation returns <code>true</code> if the object is either the model's package or is an instance object of
+ * the model. <!-- end-user-doc -->
+ *
+ * @return whether this factory is applicable for the type of the object.
+ * @generated
+ */
+ @Override
+ public boolean isFactoryForType(Object object) {
+ if (object == modelPackage) {
+ return true;
+ }
+ if (object instanceof EObject) {
+ return ((EObject) object).eClass().getEPackage() == modelPackage;
+ }
+ return false;
+ }
+
+ /**
+ * The switch that delegates to the <code>createXXX</code> methods.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected WorkSpaceModelSwitch<Adapter> modelSwitch = new WorkSpaceModelSwitch<Adapter>() {
+ @Override
+ public Adapter caseECPWorkspace(ECPWorkspace object) {
+ return createECPWorkspaceAdapter();
+ }
+
+ @Override
+ public Adapter caseECPProject(ECPProject object) {
+ return createECPProjectAdapter();
+ }
+
+ @Override
+ public Adapter defaultCase(EObject object) {
+ return createEObjectAdapter();
+ }
+ };
+
+ /**
+ * Creates an adapter for the <code>target</code>.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @param target the object to adapt.
+ * @return the adapter for the <code>target</code>.
+ * @generated
+ */
+ @Override
+ public Adapter createAdapter(Notifier target) {
+ return modelSwitch.doSwitch((EObject) target);
+ }
+
+ /**
+ * Creates a new adapter for an object of class '
+ * {@link org.eclipse.emf.ecp.common.model.workSpaceModel.ECPWorkspace
+ * <em>ECP Workspace</em>}'. <!-- begin-user-doc --> This default implementation returns null so that we can easily
+ * ignore cases; it's useful to ignore a case when inheritance will catch all the cases anyway. <!-- end-user-doc
+ * -->
+ *
+ * @return the new adapter.
+ * @see org.eclipse.emf.ecp.common.model.workSpaceModel.ECPWorkspace
+ * @generated
+ */
+ public Adapter createECPWorkspaceAdapter() {
+ return null;
+ }
+
+ /**
+ * Creates a new adapter for an object of class '{@link org.eclipse.emf.ecp.common.model.workSpaceModel.ECPProject
+ * <em>ECP Project</em>}'. <!-- begin-user-doc --> This default implementation returns null so that we can easily
+ * ignore cases; it's useful to ignore a case when inheritance will catch all the cases anyway. <!-- end-user-doc
+ * -->
+ *
+ * @return the new adapter.
+ * @see org.eclipse.emf.ecp.common.model.workSpaceModel.ECPProject
+ * @generated
+ */
+ public Adapter createECPProjectAdapter() {
+ return null;
+ }
+
+ /**
+ * Creates a new adapter for the default case.
+ * <!-- begin-user-doc --> This default implementation returns null.
+ * <!-- end-user-doc -->
+ *
+ * @return the new adapter.
+ * @generated
+ */
+ public Adapter createEObjectAdapter() {
+ return null;
+ }
+
+} // WorkSpaceModelAdapterFactory
\ No newline at end of file
diff --git a/old/org.eclipse.emf.ecp.common.model/src/org/eclipse/emf/ecp/common/model/workSpaceModel/util/WorkSpaceModelSwitch.java b/old/org.eclipse.emf.ecp.common.model/src/org/eclipse/emf/ecp/common/model/workSpaceModel/util/WorkSpaceModelSwitch.java
new file mode 100644
index 0000000..b376f01
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.common.model/src/org/eclipse/emf/ecp/common/model/workSpaceModel/util/WorkSpaceModelSwitch.java
@@ -0,0 +1,152 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2011 Chair for Applied Software Engineering,
+ * Technische Universitaet Muenchen.
+ * 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:
+ ******************************************************************************/
+package org.eclipse.emf.ecp.common.model.workSpaceModel.util;
+
+import java.util.List;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecp.common.model.workSpaceModel.ECPProject;
+import org.eclipse.emf.ecp.common.model.workSpaceModel.ECPWorkspace;
+import org.eclipse.emf.ecp.common.model.workSpaceModel.WorkSpaceModelPackage;
+
+/**
+ * <!-- begin-user-doc --> The <b>Switch</b> for the model's inheritance hierarchy. It supports the call
+ * {@link #doSwitch(EObject) doSwitch(object)} to invoke the <code>caseXXX</code> method for each class of the model,
+ * starting with the actual class of the object and proceeding up the inheritance hierarchy until a non-null result is
+ * returned, which is the result of the switch. <!-- end-user-doc -->
+ *
+ * @see org.eclipse.emf.ecp.common.model.workSpaceModel.WorkSpaceModelPackage
+ * @generated
+ */
+public class WorkSpaceModelSwitch<T> {
+ /**
+ * The cached model package
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected static WorkSpaceModelPackage modelPackage;
+
+ /**
+ * Creates an instance of the switch.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public WorkSpaceModelSwitch() {
+ if (modelPackage == null) {
+ modelPackage = WorkSpaceModelPackage.eINSTANCE;
+ }
+ }
+
+ /**
+ * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that
+ * result.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @return the first non-null result returned by a <code>caseXXX</code> call.
+ * @generated
+ */
+ public T doSwitch(EObject theEObject) {
+ return doSwitch(theEObject.eClass(), theEObject);
+ }
+
+ /**
+ * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that
+ * result.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @return the first non-null result returned by a <code>caseXXX</code> call.
+ * @generated
+ */
+ protected T doSwitch(EClass theEClass, EObject theEObject) {
+ if (theEClass.eContainer() == modelPackage) {
+ return doSwitch(theEClass.getClassifierID(), theEObject);
+ } else {
+ List<EClass> eSuperTypes = theEClass.getESuperTypes();
+ return eSuperTypes.isEmpty() ? defaultCase(theEObject) : doSwitch(eSuperTypes.get(0), theEObject);
+ }
+ }
+
+ /**
+ * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that
+ * result.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @return the first non-null result returned by a <code>caseXXX</code> call.
+ * @generated
+ */
+ protected T doSwitch(int classifierID, EObject theEObject) {
+ switch (classifierID) {
+ case WorkSpaceModelPackage.ECP_WORKSPACE: {
+ ECPWorkspace ecpWorkspace = (ECPWorkspace) theEObject;
+ T result = caseECPWorkspace(ecpWorkspace);
+ if (result == null)
+ result = defaultCase(theEObject);
+ return result;
+ }
+ case WorkSpaceModelPackage.ECP_PROJECT: {
+ ECPProject ecpProject = (ECPProject) theEObject;
+ T result = caseECPProject(ecpProject);
+ if (result == null)
+ result = defaultCase(theEObject);
+ return result;
+ }
+ default:
+ return defaultCase(theEObject);
+ }
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of '<em>ECP Workspace</em>'.
+ * <!-- begin-user-doc -->
+ * This implementation returns null; returning a non-null result will terminate the switch. <!-- end-user-doc -->
+ *
+ * @param object the target of the switch.
+ * @return the result of interpreting the object as an instance of '<em>ECP Workspace</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseECPWorkspace(ECPWorkspace object) {
+ return null;
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of '<em>ECP Project</em>'.
+ * <!-- begin-user-doc -->
+ * This implementation returns null; returning a non-null result will terminate the switch. <!-- end-user-doc -->
+ *
+ * @param object the target of the switch.
+ * @return the result of interpreting the object as an instance of '<em>ECP Project</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseECPProject(ECPProject object) {
+ return null;
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of '<em>EObject</em>'.
+ * <!-- begin-user-doc --> This
+ * implementation returns null; returning a non-null result will terminate the switch, but this is the last case
+ * anyway. <!-- end-user-doc -->
+ *
+ * @param object the target of the switch.
+ * @return the result of interpreting the object as an instance of '<em>EObject</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject)
+ * @generated
+ */
+ public T defaultCase(EObject object) {
+ return null;
+ }
+
+} // WorkSpaceModelSwitch
\ No newline at end of file
diff --git a/old/org.eclipse.emf.ecp.common.rcp/.checkstyle b/old/org.eclipse.emf.ecp.common.rcp/.checkstyle
new file mode 100644
index 0000000..d4fa17e
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.common.rcp/.checkstyle
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<fileset-config file-format-version="1.2.0" simple-config="true" sync-formatter="false">
+ <fileset name="all" enabled="true" check-config-name="emfcpStyle" local="false">
+ <file-match-pattern match-pattern="." include-pattern="true"/>
+ </fileset>
+</fileset-config>
diff --git a/old/org.eclipse.emf.ecp.common.rcp/.classpath b/old/org.eclipse.emf.ecp.common.rcp/.classpath
new file mode 100644
index 0000000..64c5e31
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.common.rcp/.classpath
@@ -0,0 +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>
diff --git a/old/org.eclipse.emf.ecp.common.rcp/.project b/old/org.eclipse.emf.ecp.common.rcp/.project
new file mode 100644
index 0000000..229a0a5
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.common.rcp/.project
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.emf.ecp.common.rcp</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>net.sf.eclipsecs.core.CheckstyleBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>net.sf.eclipsecs.core.CheckstyleNature</nature>
+ </natures>
+</projectDescription>
diff --git a/old/org.eclipse.emf.ecp.common.rcp/.settings/org.eclipse.jdt.core.prefs b/old/org.eclipse.emf.ecp.common.rcp/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 0000000..baa0063
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.common.rcp/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,8 @@
+#Mon Oct 25 17:52:39 CEST 2010
+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
diff --git a/old/org.eclipse.emf.ecp.common.rcp/META-INF/MANIFEST.MF b/old/org.eclipse.emf.ecp.common.rcp/META-INF/MANIFEST.MF
new file mode 100644
index 0000000..9d1ac7e
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.common.rcp/META-INF/MANIFEST.MF
@@ -0,0 +1,8 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-SymbolicName: org.eclipse.emf.ecp.common.rcp
+Bundle-Version: 0.9.3.qualifier
+Fragment-Host: org.eclipse.emf.ecp.common
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Bundle-Name: ECP Common UI Plug-in RCP
+Bundle-Vendor: Eclipse Modeling Project
diff --git a/old/org.eclipse.emf.ecp.common.rcp/build.properties b/old/org.eclipse.emf.ecp.common.rcp/build.properties
new file mode 100644
index 0000000..41eb6ad
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.common.rcp/build.properties
@@ -0,0 +1,4 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .
diff --git a/old/org.eclipse.emf.ecp.common.rcp/pom.xml b/old/org.eclipse.emf.ecp.common.rcp/pom.xml
new file mode 100644
index 0000000..98fded9
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.common.rcp/pom.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.eclipse.emf.emfstore</groupId>
+ <artifactId>emfstore-parent</artifactId>
+ <version>0.9.3-SNAPSHOT</version>
+ <relativePath>../../org.eclipse.emf.emfstore.releng/emfstore-parent/</relativePath>
+ </parent>
+ <groupId>org.eclipse.emf.emfstore</groupId>
+ <artifactId>org.eclipse.emf.ecp.common.rcp</artifactId>
+ <version>0.9.3-SNAPSHOT</version>
+ <packaging>eclipse-plugin</packaging>
+</project>
diff --git a/old/org.eclipse.emf.ecp.common.rcp/src/org/eclipse/emf/ecp/common/utilities/ExtProgramFactoryFacadeImpl.java b/old/org.eclipse.emf.ecp.common.rcp/src/org/eclipse/emf/ecp/common/utilities/ExtProgramFactoryFacadeImpl.java
new file mode 100644
index 0000000..5ebf96e
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.common.rcp/src/org/eclipse/emf/ecp/common/utilities/ExtProgramFactoryFacadeImpl.java
@@ -0,0 +1,35 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2011 Chair for Applied Software Engineering,
+ * Technische Universitaet Muenchen.
+ * 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:
+ ******************************************************************************/
+package org.eclipse.emf.ecp.common.utilities;
+
+import org.eclipse.swt.program.Program;
+
+/**
+ * @author stefan.bleibinhaus
+ *
+ */
+public class ExtProgramFactoryFacadeImpl extends ExtProgramFactoryFacade {
+
+ @Override
+ boolean useEmailIntern(String mailto) {
+ return launch(mailto);
+ }
+
+ @Override
+ boolean launchURLIntern(String url) {
+ return launch(url);
+ }
+
+ private boolean launch(String url) {
+ return Program.launch(url);
+ }
+
+}
\ No newline at end of file
diff --git a/old/org.eclipse.emf.ecp.common.util/.checkstyle b/old/org.eclipse.emf.ecp.common.util/.checkstyle
new file mode 100644
index 0000000..d4fa17e
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.common.util/.checkstyle
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<fileset-config file-format-version="1.2.0" simple-config="true" sync-formatter="false">
+ <fileset name="all" enabled="true" check-config-name="emfcpStyle" local="false">
+ <file-match-pattern match-pattern="." include-pattern="true"/>
+ </fileset>
+</fileset-config>
diff --git a/old/org.eclipse.emf.ecp.common.util/.classpath b/old/org.eclipse.emf.ecp.common.util/.classpath
new file mode 100644
index 0000000..64c5e31
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.common.util/.classpath
@@ -0,0 +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>
diff --git a/old/org.eclipse.emf.ecp.common.util/.project b/old/org.eclipse.emf.ecp.common.util/.project
new file mode 100644
index 0000000..72a1d56
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.common.util/.project
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.emf.ecp.common.util</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>net.sf.eclipsecs.core.CheckstyleBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>net.sf.eclipsecs.core.CheckstyleNature</nature>
+ </natures>
+</projectDescription>
diff --git a/old/org.eclipse.emf.ecp.common.util/.settings/org.eclipse.jdt.core.prefs b/old/org.eclipse.emf.ecp.common.util/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 0000000..8a3504e
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.common.util/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,8 @@
+#Wed Nov 24 18:39:39 CET 2010
+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
diff --git a/old/org.eclipse.emf.ecp.common.util/META-INF/MANIFEST.MF b/old/org.eclipse.emf.ecp.common.util/META-INF/MANIFEST.MF
new file mode 100644
index 0000000..f114c7b
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.common.util/META-INF/MANIFEST.MF
@@ -0,0 +1,18 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Common Util
+Bundle-SymbolicName: org.eclipse.emf.ecp.common.util
+Bundle-Version: 0.9.3.qualifier
+Bundle-Activator: org.eclipse.emf.ecp.common.util.Activator
+Require-Bundle: org.eclipse.core.expressions;bundle-version="[3.4.0,4.0.0)";visibility:=reexport,
+ org.eclipse.ui;bundle-version="[3.5.0,4.0.0)";visibility:=reexport,
+ org.eclipse.ui.forms;bundle-version="[3.4.0,4.0.0)";visibility:=reexport,
+ org.eclipse.jface.databinding;bundle-version="[1.3.0,2.0.0)";visibility:=reexport,
+ org.eclipse.emf.edit.ui;bundle-version="[2.5.0,3.0.0)";visibility:=reexport,
+ org.eclipse.emf.databinding.edit;bundle-version="[1.1.0,2.0.0)";visibility:=reexport,
+ org.eclipse.emf.emfstore.common;visibility:=reexport
+Bundle-ActivationPolicy: lazy
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Export-Package: org.eclipse.emf.ecp.common.util
+Bundle-ClassPath: .
+Bundle-Vendor: Eclipse Modeling Project
diff --git a/old/org.eclipse.emf.ecp.common.util/build.properties b/old/org.eclipse.emf.ecp.common.util/build.properties
new file mode 100644
index 0000000..41eb6ad
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.common.util/build.properties
@@ -0,0 +1,4 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .
diff --git a/old/org.eclipse.emf.ecp.common.util/pom.xml b/old/org.eclipse.emf.ecp.common.util/pom.xml
new file mode 100644
index 0000000..3854b8a
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.common.util/pom.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.eclipse.emf.emfstore</groupId>
+ <artifactId>emfstore-parent</artifactId>
+ <version>0.9.3-SNAPSHOT</version>
+ <relativePath>../../org.eclipse.emf.emfstore.releng/emfstore-parent/</relativePath>
+ </parent>
+ <groupId>org.eclipse.emf.emfstore</groupId>
+ <artifactId>org.eclipse.emf.ecp.common.util</artifactId>
+ <version>0.9.3-SNAPSHOT</version>
+ <packaging>eclipse-plugin</packaging>
+</project>
diff --git a/old/org.eclipse.emf.ecp.common.util/src/org/eclipse/emf/ecp/common/util/AbstractECPPlugin.java b/old/org.eclipse.emf.ecp.common.util/src/org/eclipse/emf/ecp/common/util/AbstractECPPlugin.java
new file mode 100644
index 0000000..d9ca4a3
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.common.util/src/org/eclipse/emf/ecp/common/util/AbstractECPPlugin.java
@@ -0,0 +1,64 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2011 Chair for Applied Software Engineering,
+ * Technische Universitaet Muenchen.
+ * 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:
+ ******************************************************************************/
+package org.eclipse.emf.ecp.common.util;
+
+import org.eclipse.emf.emfstore.common.ILog;
+import org.eclipse.emf.emfstore.internal.common.LogAdapter;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+
+/**
+ * Base class for ECP plugin. Provides logging capabilities.
+ *
+ * @author emueller
+ *
+ */
+public abstract class AbstractECPPlugin extends AbstractUIPlugin implements ILog {
+
+ private LogAdapter logAdapter;
+
+ /**
+ * Default constructor.
+ */
+ public AbstractECPPlugin() {
+ logAdapter = new LogAdapter();
+ }
+
+ /**
+ * Logs the given exception with the given message and an additional status code to the error log.
+ *
+ * @param message the message to log
+ * @param exception the exception to log
+ * @param statusInt a status code
+ */
+ public void log(String message, Exception exception, int statusInt) {
+ logAdapter.log(message, exception, statusInt);
+ }
+
+ /**
+ * Logs an exception to the error log.
+ *
+ * @param message the message
+ * @param e the exception
+ */
+ public void logException(String message, Exception e) {
+ logAdapter.logException(message, e);
+ }
+
+ /**
+ * Logs a warning to the error log.
+ *
+ * @param message the message
+ * @param e the exception
+ */
+ public void logWarning(String message, Exception e) {
+ logAdapter.logWarning(message, e);
+ }
+}
\ No newline at end of file
diff --git a/old/org.eclipse.emf.ecp.common.util/src/org/eclipse/emf/ecp/common/util/Activator.java b/old/org.eclipse.emf.ecp.common.util/src/org/eclipse/emf/ecp/common/util/Activator.java
new file mode 100644
index 0000000..6767710
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.common.util/src/org/eclipse/emf/ecp/common/util/Activator.java
@@ -0,0 +1,64 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2011 Chair for Applied Software Engineering,
+ * Technische Universitaet Muenchen.
+ * 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:
+ ******************************************************************************/
+package org.eclipse.emf.ecp.common.util;
+
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle.
+ */
+public class Activator extends AbstractECPPlugin {
+
+ /**
+ * The plug-in ID.
+ */
+ public static final String PLUGIN_ID = "org.eclipse.emf.ecp.common.util";
+
+ /**
+ * The shared instance.
+ */
+ private static Activator plugin;
+
+ /**
+ * The constructor.
+ */
+ public Activator() {
+ }
+
+ /**
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+ */
+ // BEGIN SUPRESS CATCH EXCEPTION
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ plugin = this;
+ }
+
+ /**
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+ */
+ public void stop(BundleContext context) throws Exception {
+ plugin = null;
+ super.stop(context);
+ }
+
+ // END SUPRESS CATCH EXCEPTION
+
+ /**
+ * Returns the shared instance.
+ *
+ * @return the shared instance
+ */
+ public static Activator getDefault() {
+ return plugin;
+ }
+
+}
\ No newline at end of file
diff --git a/old/org.eclipse.emf.ecp.common.util/src/org/eclipse/emf/ecp/common/util/DialogHandler.java b/old/org.eclipse.emf.ecp.common.util/src/org/eclipse/emf/ecp/common/util/DialogHandler.java
new file mode 100644
index 0000000..83599dc
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.common.util/src/org/eclipse/emf/ecp/common/util/DialogHandler.java
@@ -0,0 +1,69 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2011 Chair for Applied Software Engineering,
+ * Technische Universitaet Muenchen.
+ * 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:
+ ******************************************************************************/
+package org.eclipse.emf.ecp.common.util;
+
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.PlatformUI;
+
+// ZH Implement a proper ExceptionDialog
+/**
+ * This abstract calls is to show exceptions to the user in a unified way.
+ *
+ * @author Helming
+ */
+public final class DialogHandler {
+
+ private DialogHandler() {
+
+ }
+
+ /**
+ * This method opens a standard error dialog displaying an exception to the user.
+ *
+ * @param e the exception to be shown.
+ */
+ public static void showExceptionDialog(Exception e) {
+ showExceptionDialog("Unexpected exception occured", e);
+ }
+
+ /**
+ * This method opens a standard error dialog displaying an exception to the user.
+ *
+ * @param message the message to be shown.
+ */
+ public static void showErrorDialog(String message) {
+ showExceptionDialog(message, null);
+ }
+
+ /**
+ * This method opens a standard error dialog displaying an exception to the user.
+ *
+ * @param cause the exception to be shown.
+ * @param message the message to be shown.
+ */
+ public static void showExceptionDialog(String message, Exception cause) {
+ Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
+
+ StringBuilder stringBuilder = new StringBuilder();
+ stringBuilder.append(message);
+ String title = "Error";
+ if (cause != null) {
+ stringBuilder.append(": ");
+ stringBuilder.append(cause.getMessage());
+ title = cause.getClass().getName();
+ }
+ String string = stringBuilder.toString();
+ MessageDialog.openError(shell, title, string);
+ Activator.getDefault().logWarning("An unexpected error in a ECP plugin occured.", cause);
+ }
+
+}
\ No newline at end of file
diff --git a/old/org.eclipse.emf.ecp.common.util/src/org/eclipse/emf/ecp/common/util/ModelElementOpener.java b/old/org.eclipse.emf.ecp.common.util/src/org/eclipse/emf/ecp/common/util/ModelElementOpener.java
new file mode 100644
index 0000000..58c60fc
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.common.util/src/org/eclipse/emf/ecp/common/util/ModelElementOpener.java
@@ -0,0 +1,42 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2011 Chair for Applied Software Engineering,
+ * Technische Universitaet Muenchen.
+ * 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:
+ ******************************************************************************/
+package org.eclipse.emf.ecp.common.util;
+
+import org.eclipse.emf.ecore.EObject;
+
+/**
+ * Modelelement opener offer the functionality to open a specific model element. Standard opener is the model element
+ * editor. Example for specific opener are the diagrams.
+ *
+ * @author helming
+ */
+public interface ModelElementOpener {
+ /**
+ * Constant to return if the opener should not open the modelelement.
+ */
+ int DONOTOPEN = -1;
+
+ /**
+ * Checks whether the model element should be opened by this opener, depending on the priority. The model element
+ * will be opened with the registered opener with the highest priority.
+ *
+ * @param modelElement the model element to check
+ * @return a priority indicating how well the opener can open the element
+ */
+ int canOpen(EObject modelElement);
+
+ /**
+ * The action to open the model element.
+ *
+ * @param modelElement the model element to open
+ */
+ void openModelElement(EObject modelElement);
+}
\ No newline at end of file
diff --git a/old/org.eclipse.emf.ecp.common.util/src/org/eclipse/emf/ecp/common/util/ModelElementTooltip.java b/old/org.eclipse.emf.ecp.common.util/src/org/eclipse/emf/ecp/common/util/ModelElementTooltip.java
new file mode 100644
index 0000000..b5a405b
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.common.util/src/org/eclipse/emf/ecp/common/util/ModelElementTooltip.java
@@ -0,0 +1,72 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2011 Chair for Applied Software Engineering,
+ * Technische Universitaet Muenchen.
+ * 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:
+ ******************************************************************************/
+package org.eclipse.emf.ecp.common.util;
+
+import org.eclipse.emf.edit.provider.ComposedAdapterFactory;
+import org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider;
+import org.eclipse.jface.window.DefaultToolTip;
+import org.eclipse.jface.window.ToolTip;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Event;
+
+/**
+ * Defines a tooltip support for the model element link widget.
+ *
+ * @author Shterev
+ */
+public class ModelElementTooltip extends DefaultToolTip {
+
+ private static final AdapterFactoryLabelProvider ADAPTER_FACTORY_LABEL_PROVIDER = new AdapterFactoryLabelProvider(new ComposedAdapterFactory(
+ ComposedAdapterFactory.Descriptor.Registry.INSTANCE));
+ private AdapterFactoryLabelProvider labelProvider;
+
+
+ /**
+ * Default constructor.
+ *
+ * @param control the control that should receive the tooltip
+ */
+ public ModelElementTooltip(Control control) {
+ super(control, ToolTip.NO_RECREATE, false);
+ labelProvider = ADAPTER_FACTORY_LABEL_PROVIDER;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected String getText(Event event) {
+ Object o = getElement(event);
+ return labelProvider.getText(o);
+
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected boolean shouldCreateToolTip(Event event) {
+ return (getElement(event) != null && super.shouldCreateToolTip(event));
+ }
+
+ private Object getElement(Event event) {
+ return event.widget.getData();
+ }
+
+ /**
+ * Enable ToolTip support for the control by creating an instance from this class.
+ *
+ * @param control the control
+ */
+ public static void enableFor(Control control) {
+ new ModelElementTooltip(control);
+ }
+}
\ No newline at end of file
diff --git a/old/org.eclipse.emf.ecp.common.util/src/org/eclipse/emf/ecp/common/util/OverlayImageDescriptor.java b/old/org.eclipse.emf.ecp.common.util/src/org/eclipse/emf/ecp/common/util/OverlayImageDescriptor.java
new file mode 100644
index 0000000..e6dd309
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.common.util/src/org/eclipse/emf/ecp/common/util/OverlayImageDescriptor.java
@@ -0,0 +1,120 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2011 Chair for Applied Software Engineering,
+ * Technische Universitaet Muenchen.
+ * 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:
+ ******************************************************************************/
+package org.eclipse.emf.ecp.common.util;
+
+import org.eclipse.jface.resource.CompositeImageDescriptor;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.ImageData;
+import org.eclipse.swt.graphics.Point;
+
+/**
+ * Allows one image descriptor to be overlayed on another image descriptor to generate a new image. Commonly used to
+ * decorate an image with a second image decoration.
+ *
+ * @author Shterev
+ */
+public class OverlayImageDescriptor extends CompositeImageDescriptor {
+
+ /** display the overlay image in the upper left corner. */
+ public static final int UPPER_LEFT = 0;
+
+ /** display the overlay image in the upper right corner. */
+ public static final int UPPER_RIGHT = 1;
+
+ /** display the overlay image in the lower right corner. */
+ public static final int LOWER_RIGHT = 2;
+
+ /** display the overlay image in the lower left corner. */
+ public static final int LOWER_LEFT = 3;
+
+ /** default image width. */
+ private static final int DEFAULT_IMAGE_WIDTH = 19;
+
+ /** default image height. */
+ private static final int DEFAULT_IMAGE_HEIGHT = 19;
+
+ /** base image. */
+ private Image srcImage;
+
+ /** overlay image. */
+ private ImageDescriptor overlayDesc;
+
+ /** the position of the overlay image. */
+ private int overlayPos = LOWER_RIGHT;
+
+ private int offset = 3;
+
+ /**
+ * OverlayImageDescriptor constructor.
+ *
+ * @param srcImage the base image
+ * @param overlayDesc the overlay image
+ * @param overlayPos the overlay position
+ */
+ public OverlayImageDescriptor(Image srcImage, ImageDescriptor overlayDesc, int overlayPos) {
+ assert null != srcImage;
+ assert null != overlayDesc;
+ this.srcImage = srcImage;
+ this.overlayDesc = overlayDesc;
+ }
+
+ /**
+ * Draws the given source image data into this composite image at the given position.
+ *
+ * @param width the width of the image.
+ * @param height the height of the image.
+ * @see org.eclipse.jface.resource.CompositeImageDescriptor#drawCompositeImage(int, int)
+ */
+ @Override
+ protected void drawCompositeImage(int width, int height) {
+ // draw the base image
+ ImageData backgroundData = srcImage.getImageData();
+ if (backgroundData != null) {
+ drawImage(backgroundData, 0, 0);
+ }
+
+ // draw the overlay image
+ ImageData overlayData = overlayDesc.getImageData();
+ if (overlayData != null) {
+ Point pos = null;
+ switch (overlayPos) {
+ case UPPER_LEFT:
+ pos = new Point(-overlayData.width / 2, -overlayData.height / 2);
+ break;
+ case UPPER_RIGHT:
+ pos = new Point(backgroundData.width - overlayData.width / 2, 0);
+ break;
+ case LOWER_RIGHT:
+ pos = new Point(backgroundData.width - overlayData.width / 2, backgroundData.height
+ - overlayData.height / 2);
+ break;
+ // default = LOWER_LEFT
+ default:
+ pos = new Point(0, backgroundData.height - overlayData.height / 2);
+ break;
+ }
+ drawImage(overlayData, pos.x - offset, pos.y - offset);
+ }
+ }
+
+ /**
+ * Retrieve the size of this composite image.
+ *
+ * @return the x and y size of the image expressed as a point object
+ * @see org.eclipse.jface.resource.CompositeImageDescriptor#getSize()
+ */
+ @Override
+ protected Point getSize() {
+ return new Point(DEFAULT_IMAGE_WIDTH, DEFAULT_IMAGE_HEIGHT);
+ }
+
+}
\ No newline at end of file
diff --git a/old/org.eclipse.emf.ecp.common.util/src/org/eclipse/emf/ecp/common/util/PreferenceHelper.java b/old/org.eclipse.emf.ecp.common.util/src/org/eclipse/emf/ecp/common/util/PreferenceHelper.java
new file mode 100644
index 0000000..f06978d
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.common.util/src/org/eclipse/emf/ecp/common/util/PreferenceHelper.java
@@ -0,0 +1,65 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2011 Chair for Applied Software Engineering,
+ * Technische Universitaet Muenchen.
+ * 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:
+ ******************************************************************************/
+package org.eclipse.emf.ecp.common.util;
+
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.preferences.ConfigurationScope;
+import org.osgi.service.prefs.BackingStoreException;
+
+/**
+ * The preference helper aids storing {key, value} pairs.
+ *
+ * @author pfeifferc
+ *
+ */
+public final class PreferenceHelper {
+
+ private PreferenceHelper() {
+ // nothing to do here
+ }
+
+ // TODO: ChainSaw namespace?
+ private static final String PREFERENCE_NODE = "ecp";
+
+ /**
+ * Get a preference value for a specific key.
+ *
+ * @param key the
+ * @param defaultValue the
+ * @return the value if it exists, otherwise the defaultValue
+ */
+ public static String getPreference(String key, String defaultValue) {
+ String value = Platform.getPreferencesService().getRootNode().node(ConfigurationScope.SCOPE)
+ .node(PREFERENCE_NODE).get(key, defaultValue);
+ return value;
+ }
+
+ /**
+ * Set the preference value for a specific key. Key and value must not equal null.
+ *
+ * @param key the
+ * @param value the
+ */
+ public static void setPreference(String key, String value) {
+ if (key != null && value != null) {
+ Platform.getPreferencesService().getRootNode().node(ConfigurationScope.SCOPE).node(PREFERENCE_NODE)
+ .put(key, value);
+ try {
+ Platform.getPreferencesService().getRootNode().node(ConfigurationScope.SCOPE).node(PREFERENCE_NODE)
+ .flush();
+ } catch (BackingStoreException e) {
+ Activator.getDefault().logException(
+ "Could not persist the preference change: {" + key + ", " + value + "}", e);
+ }
+ }
+ }
+
+}
\ No newline at end of file
diff --git a/old/org.eclipse.emf.ecp.common.util/src/org/eclipse/emf/ecp/common/util/UiUtil.java b/old/org.eclipse.emf.ecp.common.util/src/org/eclipse/emf/ecp/common/util/UiUtil.java
new file mode 100644
index 0000000..06b39d4
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.common.util/src/org/eclipse/emf/ecp/common/util/UiUtil.java
@@ -0,0 +1,255 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2011 Chair for Applied Software Engineering,
+ * Technische Universitaet Muenchen.
+ * 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:
+ * Edgar Mueller
+ ******************************************************************************/
+package org.eclipse.emf.ecp.common.util;
+
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.Set;
+
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.edit.provider.DelegatingWrapperItemProvider;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.ISelectionService;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.handlers.HandlerUtil;
+
+/**
+ * Utility class.
+ *
+ * @author shterev
+ * @author hodaie
+ * @author denglerm
+ * @author emueller
+ */
+public final class UiUtil {
+
+ /**
+ * The ID of the ME Editor.
+ */
+ public static final String MEEDITOR_ID = "org.eclipse.emf.ecp.editor";
+
+ /**
+ * Constant for the open model element command.
+ */
+ public static final String MEEDITOR_OPENMODELELEMENT_COMMAND_ID = "org.eclipse.emf.ecp.editor.openModelElement";
+
+ /**
+ * Constant for the model element context.
+ */
+ public static final String MECONTEXT_EVALUATIONCONTEXT_VARIABLE = "meContext";
+
+ /**
+ * Constant for the model element to be opened.
+ */
+ public static final String ME_TO_OPEN_EVALUATIONCONTEXT_VARIABLE = "meToOpen";
+
+ private UiUtil() {
+ // do nothing
+ }
+
+ /**
+ * This extracts active model element. From MEEditor or from any view which is a selection provider.
+ *
+ * @param event the ExecutionEvent given by caller handler
+ * @return active model element
+ */
+ public static EObject getModelElement(ExecutionEvent event) {
+
+ EObject modelElement = null;
+
+ // ZH: determine the place from which
+ // the command is run (UC Navigator context menu or MEEeditor)
+ // This decision is should be made to extract the model element
+ // for attaching action item accordingly.
+ String partId = HandlerUtil.getActivePartId(event);
+
+ if (partId != null && partId.equals(MEEDITOR_ID)) {
+ // extract model element from editor input
+ IEditorInput editorInput = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage()
+ .getActiveEditor().getEditorInput();
+ Object obj = editorInput.getAdapter(EObject.class);
+ modelElement = (EObject) obj;
+ } else {
+ // extract model element from current selection in navigator
+ EObject eObject = UiUtil.getSelection(event);
+ if (eObject == null) {
+ return null;
+ }
+
+ modelElement = eObject;
+ }
+
+ return modelElement;
+ }
+
+
+ /**
+ * Extract the selected ModelElement from a viewer which is selection provider. This will be called from Handler
+ * classes, which pass the ExecutionEvent.
+ *
+ * @param event ExecutionEvent to extract the selection from.
+ * @return the selected EObject or null.
+ */
+ public static EObject getSelection(ExecutionEvent event) {
+ EObject result = null;
+ ISelection sel = HandlerUtil.getCurrentSelection(event);
+ if (!(sel instanceof IStructuredSelection)) {
+ return null;
+ }
+ IStructuredSelection ssel = (IStructuredSelection) sel;
+ if (ssel.isEmpty()) {
+ return null;
+ }
+
+ Object obj = ssel.getFirstElement();
+ if (obj instanceof EObject) {
+ result = (EObject) obj;
+ }
+
+ return result;
+ }
+
+ /**
+ * Extracts the selected Object from the currently active StructuredViewer.<br>
+ * This method uses the general {@link ISelectionService} of the Workbench to extract the selection.
+ * Beware that the part providing the selection should have registered its SelectionProvider.
+ *
+ * @return the selected object or <code>null</code> the if selection is not an {@link IStructuredSelection}
+ */
+ public static Object getSelection() {
+ ISelectionService selectionService = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getSelectionService();
+
+ ISelection sel = selectionService.getSelection();
+ if (!(sel instanceof IStructuredSelection)) {
+ return null;
+ }
+
+ IStructuredSelection ssel = (IStructuredSelection) sel;
+ if (ssel.isEmpty()) {
+ return null;
+ }
+
+ Object o = ssel.getFirstElement();
+ return o;
+ }
+
+ /**
+ * Extracts the selected {@link EObject} from the currently active StructuredViewer.<br>
+ * This method uses the general {@link ISelectionService} of the Workbench to extract the selection.
+ * Beware that the part providing the selection should have registered its SelectionProvider.
+ *
+ * @return the selected {@link EObject} or <code>null</code> the if selection is not an {@link IStructuredSelection}
+ */
+ public static EObject getSelectedModelelement() {
+
+ Object obj = getSelection();
+
+ if (obj instanceof EObject) {
+ return (EObject) obj;
+ } else if (obj instanceof DelegatingWrapperItemProvider) {
+ DelegatingWrapperItemProvider delegatingProvider = (DelegatingWrapperItemProvider) obj;
+ if (delegatingProvider.getValue() instanceof EObject) {
+ return (EObject) delegatingProvider.getValue();
+ } else {
+ return null;
+ }
+
+ } else {
+ return null;
+ }
+ }
+
+ /**
+ * Extracts the selected {@link EObject} from the currently active StructuredViewer.<br>
+ * This method uses the general {@link ISelectionService} of the Workbench to extract the selection.
+ * Beware that the part providing the selection should have registered its SelectionProvider.
+ *
+ * @return the selected {@link EObject} or <code>null</code> the if selection is not an {@link IStructuredSelection}
+ */
+ public static EObject getSelectedEObject() {
+
+ Object obj = getSelection();
+
+ if (obj instanceof EObject) {
+ return (EObject) obj;
+ } else {
+ return null;
+ }
+ }
+
+ /**
+ * Extract the selected ModelElements from a viewer which is selection provider. This will be called from Handler
+ * classes, which pass the ExecutionEvent.
+ *
+ * @param event ExecutionEvent to extract the selection from.
+ * @return the selected EObjects set (may be an empty set).
+ */
+ public static Set<EObject> getSelectedEObjects(ExecutionEvent event) {
+ Set<EObject> result = Collections.emptySet();
+ ISelection sel = HandlerUtil.getCurrentSelection(event);
+ if (!(sel instanceof IStructuredSelection)) {
+ return result;
+ }
+ IStructuredSelection ssel = (IStructuredSelection) sel;
+ if (ssel.isEmpty()) {
+ return result;
+ }
+ result = new HashSet<EObject>();
+ for (Object object : ssel.toArray()) {
+ if (object instanceof EObject) {
+ result.add((EObject) object);
+ }
+ }
+ return result;
+ }
+
+ /**
+ * Extracts an element from an event by its type.
+ *
+ * @param event
+ * the event from which to extract
+ * @param clazz
+ * the class type of the object to be extracted
+ * @param <T> the type of the object to be extracted
+ * @return the extracted object, if any
+ */
+ @SuppressWarnings("unchecked")
+ public static <T> T getEventElementByClass(ExecutionEvent event, Class<T> clazz) {
+
+ ISelection sel = HandlerUtil.getCurrentSelection(event);
+
+ if (sel == null) {
+ sel = HandlerUtil.getActiveMenuSelection(event);
+ }
+
+ if (!(sel instanceof IStructuredSelection)) {
+ return null;
+ }
+
+ IStructuredSelection structuredSelection = (IStructuredSelection) sel;
+ if (structuredSelection.isEmpty()) {
+ return null;
+ }
+
+ Object selectedElement = structuredSelection.getFirstElement();
+
+ if (!(clazz.isInstance(selectedElement))) {
+ return null;
+ }
+
+ return (T) selectedElement;
+ }
+
+}
\ No newline at end of file
diff --git a/old/org.eclipse.emf.ecp.common/.checkstyle b/old/org.eclipse.emf.ecp.common/.checkstyle
new file mode 100644
index 0000000..d4fa17e
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.common/.checkstyle
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<fileset-config file-format-version="1.2.0" simple-config="true" sync-formatter="false">
+ <fileset name="all" enabled="true" check-config-name="emfcpStyle" local="false">
+ <file-match-pattern match-pattern="." include-pattern="true"/>
+ </fileset>
+</fileset-config>
diff --git a/old/org.eclipse.emf.ecp.common/.classpath b/old/org.eclipse.emf.ecp.common/.classpath
new file mode 100644
index 0000000..64c5e31
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.common/.classpath
@@ -0,0 +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>
diff --git a/old/org.eclipse.emf.ecp.common/.project b/old/org.eclipse.emf.ecp.common/.project
new file mode 100644
index 0000000..a3e638d
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.common/.project
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.emf.ecp.common</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>net.sf.eclipsecs.core.CheckstyleBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>net.sf.eclipsecs.core.CheckstyleNature</nature>
+ </natures>
+</projectDescription>
diff --git a/old/org.eclipse.emf.ecp.common/.settings/org.eclipse.jdt.core.prefs b/old/org.eclipse.emf.ecp.common/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 0000000..27495b4
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.common/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,83 @@
+#Wed May 18 17:49:36 CEST 2011
+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.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.doc.comment.support=enabled
+org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
+org.eclipse.jdt.core.compiler.problem.deprecation=warning
+org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
+org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
+org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
+org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.problem.fallthroughCase=warning
+org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled
+org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore
+org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
+org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
+org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
+org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
+org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
+org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore
+org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore
+org.eclipse.jdt.core.compiler.problem.invalidJavadoc=ignore
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTags=disabled
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef=disabled
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef=disabled
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=public
+org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
+org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
+org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=warning
+org.eclipse.jdt.core.compiler.problem.missingJavadocComments=ignore
+org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=disabled
+org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public
+org.eclipse.jdt.core.compiler.problem.missingJavadocTagDescription=return_tag
+org.eclipse.jdt.core.compiler.problem.missingJavadocTags=ignore
+org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled
+org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=public
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=warning
+org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
+org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
+org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
+org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
+org.eclipse.jdt.core.compiler.problem.nullReference=warning
+org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
+org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
+org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore
+org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore
+org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
+org.eclipse.jdt.core.compiler.problem.redundantNullCheck=warning
+org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore
+org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
+org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
+org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
+org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
+org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
+org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
+org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
+org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
+org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning
+org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=warning
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
+org.eclipse.jdt.core.compiler.problem.unusedImport=warning
+org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
+org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
+org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
+org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
+org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
+org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
+org.eclipse.jdt.core.compiler.source=1.5
diff --git a/old/org.eclipse.emf.ecp.common/.settings/org.eclipse.jdt.ui.prefs b/old/org.eclipse.emf.ecp.common/.settings/org.eclipse.jdt.ui.prefs
new file mode 100644
index 0000000..90407ea
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.common/.settings/org.eclipse.jdt.ui.prefs
@@ -0,0 +1,57 @@
+#Thu Mar 31 20:47:36 CEST 2011
+cleanup.add_default_serial_version_id=true
+cleanup.add_generated_serial_version_id=false
+cleanup.add_missing_annotations=true
+cleanup.add_missing_deprecated_annotations=true
+cleanup.add_missing_methods=false
+cleanup.add_missing_nls_tags=false
+cleanup.add_missing_override_annotations=true
+cleanup.add_serial_version_id=false
+cleanup.always_use_blocks=true
+cleanup.always_use_parentheses_in_expressions=false
+cleanup.always_use_this_for_non_static_field_access=false
+cleanup.always_use_this_for_non_static_method_access=false
+cleanup.convert_to_enhanced_for_loop=false
+cleanup.correct_indentation=true
+cleanup.format_source_code=true
+cleanup.format_source_code_changes_only=false
+cleanup.make_local_variable_final=true
+cleanup.make_parameters_final=false
+cleanup.make_private_fields_final=true
+cleanup.make_type_abstract_if_missing_method=false
+cleanup.make_variable_declarations_final=false
+cleanup.never_use_blocks=false
+cleanup.never_use_parentheses_in_expressions=true
+cleanup.organize_imports=true
+cleanup.qualify_static_field_accesses_with_declaring_class=false
+cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true
+cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true
+cleanup.qualify_static_member_accesses_with_declaring_class=true
+cleanup.qualify_static_method_accesses_with_declaring_class=false
+cleanup.remove_private_constructors=true
+cleanup.remove_trailing_whitespaces=true
+cleanup.remove_trailing_whitespaces_all=true
+cleanup.remove_trailing_whitespaces_ignore_empty=false
+cleanup.remove_unnecessary_casts=true
+cleanup.remove_unnecessary_nls_tags=true
+cleanup.remove_unused_imports=true
+cleanup.remove_unused_local_variables=false
+cleanup.remove_unused_private_fields=true
+cleanup.remove_unused_private_members=false
+cleanup.remove_unused_private_methods=true
+cleanup.remove_unused_private_types=true
+cleanup.sort_members=false
+cleanup.sort_members_all=false
+cleanup.use_blocks=true
+cleanup.use_blocks_only_for_return_and_throw=false
+cleanup.use_parentheses_in_expressions=false
+cleanup.use_this_for_non_static_field_access=false
+cleanup.use_this_for_non_static_field_access_only_if_necessary=true
+cleanup.use_this_for_non_static_method_access=false
+cleanup.use_this_for_non_static_method_access_only_if_necessary=true
+cleanup_profile=_unicaseCleanUp
+cleanup_settings_version=2
+eclipse.preferences.version=1
+formatter_settings_version=11
+org.eclipse.jdt.ui.javadoc=false
+org.eclipse.jdt.ui.text.custom_code_templates=<?xml version\="1.0" encoding\="UTF-8" standalone\="no"?><templates><template autoinsert\="true" context\="gettercomment_context" deleted\="false" description\="Comment for getter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.gettercomment" name\="gettercomment">/**\n * @return the ${bare_field_name}\n */</template><template autoinsert\="true" context\="settercomment_context" deleted\="false" description\="Comment for setter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.settercomment" name\="settercomment">/**\n * @param ${param} the ${bare_field_name} to set\n */</template><template autoinsert\="true" context\="constructorcomment_context" deleted\="false" description\="Comment for created constructors" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorcomment" name\="constructorcomment">/**\n * ${tags}\n */</template><template autoinsert\="false" context\="filecomment_context" deleted\="false" description\="Comment for created Java files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.filecomment" name\="filecomment">/**\n * <copyright> Copyright (c) 2008-2009 Jonas Helming, Maximilian Koegel. All rights reserved. This program and the\n * accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this\n * distribution, and is available at http\://www.eclipse.org/legal/epl-v10.html </copyright>\n */</template><template autoinsert\="true" context\="typecomment_context" deleted\="false" description\="Comment for created types" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.typecomment" name\="typecomment">/**\n * @author ${user}\n *\n * ${tags}\n */</template><template autoinsert\="false" context\="fieldcomment_context" deleted\="false" description\="Comment for fields" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.fieldcomment" name\="fieldcomment"/><template autoinsert\="true" context\="methodcomment_context" deleted\="false" description\="Comment for non-overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodcomment" name\="methodcomment">/**\n * ${tags}\n */</template><template autoinsert\="false" context\="overridecomment_context" deleted\="false" description\="Comment for overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.overridecomment" name\="overridecomment">/**\n * {@inheritDoc}\n * ${see_to_overridden}\n */</template><template autoinsert\="true" context\="delegatecomment_context" deleted\="false" description\="Comment for delegate methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.delegatecomment" name\="delegatecomment">/**\n * ${tags}\n * ${see_to_target}\n */</template><template autoinsert\="true" context\="newtype_context" deleted\="false" description\="Newly created files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.newtype" name\="newtype">${filecomment}\n${package_declaration}\n\n${typecomment}\n${type_declaration}</template><template autoinsert\="true" context\="classbody_context" deleted\="false" description\="Code in new class type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.classbody" name\="classbody">\n</template><template autoinsert\="true" context\="interfacebody_context" deleted\="false" description\="Code in new interface type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.interfacebody" name\="interfacebody">\n</template><template autoinsert\="true" context\="enumbody_context" deleted\="false" description\="Code in new enum type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.enumbody" name\="enumbody">\n</template><template autoinsert\="true" context\="annotationbody_context" deleted\="false" description\="Code in new annotation type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.annotationbody" name\="annotationbody">\n</template><template autoinsert\="false" context\="catchblock_context" deleted\="false" description\="Code in new catch blocks" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.catchblock" name\="catchblock">\t\t\t// TODO Auto-generated catch block\n\t\t\t// Do NOT catch all Exceptions ("catch (Exception e)")\n\t\t\t// Log AND handle Exceptions if possible \n //\n // You can just uncomment one of the lines below to log an exception\:\n\t\t\t// logException will show the logged excpetion to the user\n\t\t\t// ModelUtil.logException(${exception_var});\n\t\t\t// ModelUtil.logException("YOUR MESSAGE HERE", ${exception_var});\n\t\t\t// logWarning will only add the message to the error log\n\t\t\t// ModelUtil.logWarning("YOUR MESSAGE HERE", ${exception_var});\n\t\t\t// ModelUtil.logWarning("YOUR MESSAGE HERE");\n\t\t\t//\t\t\t\n\t\t\t// If handling is not possible declare and rethrow Exception</template><template autoinsert\="true" context\="methodbody_context" deleted\="false" description\="Code in created method stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodbody" name\="methodbody">// ${todo} Auto-generated method stub\n${body_statement}</template><template autoinsert\="true" context\="constructorbody_context" deleted\="false" description\="Code in created constructor stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorbody" name\="constructorbody">${body_statement}\n// ${todo} Auto-generated constructor stub</template><template autoinsert\="true" context\="getterbody_context" deleted\="false" description\="Code in created getters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.getterbody" name\="getterbody">return ${field};</template><template autoinsert\="true" context\="setterbody_context" deleted\="false" description\="Code in created setters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.setterbody" name\="setterbody">${field} \= ${param};</template></templates>
diff --git a/old/org.eclipse.emf.ecp.common/.settings/org.eclipse.pde.core.prefs b/old/org.eclipse.emf.ecp.common/.settings/org.eclipse.pde.core.prefs
new file mode 100644
index 0000000..1d74b2c
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.common/.settings/org.eclipse.pde.core.prefs
@@ -0,0 +1,3 @@
+#Mon Jul 07 15:14:43 CEST 2008
+eclipse.preferences.version=1
+resolve.requirebundle=false
diff --git a/old/org.eclipse.emf.ecp.common/META-INF/MANIFEST.MF b/old/org.eclipse.emf.ecp.common/META-INF/MANIFEST.MF
new file mode 100644
index 0000000..7e40caa
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.common/META-INF/MANIFEST.MF
@@ -0,0 +1,51 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: ECP Common UI Plug-in
+Bundle-SymbolicName: org.eclipse.emf.ecp.common;singleton:=true
+Bundle-Version: 0.9.3.qualifier
+Bundle-Activator: org.eclipse.emf.ecp.common.Activator
+Bundle-Vendor: Eclipse Modeling Project
+Require-Bundle: org.eclipse.emf.ecp.common.model;visibility:=reexport
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Bundle-ActivationPolicy: lazy
+Export-Package: org.eclipse.emf.ecp.common;
+ uses:="org.eclipse.jface.resource,
+ org.eclipse.emf.edit.ui.provider,
+ org.eclipse.jface.viewers,
+ org.eclipse.swt.graphics,
+ org.eclipse.emf.ecp.common.util,
+ org.osgi.framework",
+ org.eclipse.emf.ecp.common.commands;
+ uses:="org.eclipse.emf.edit.command,
+ org.eclipse.emf.ecore,
+ org.eclipse.emf.ecp.model,
+ org.eclipse.emf.edit.domain",
+ org.eclipse.emf.ecp.common.dialogs;
+ uses:="org.eclipse.emf.ecore,
+ org.eclipse.core.runtime,
+ org.eclipse.emf.ecp.model,
+ org.eclipse.jface.viewers,
+ org.eclipse.ui.dialogs,
+ org.eclipse.swt.widgets,
+ org.eclipse.jface.dialogs",
+ org.eclipse.emf.ecp.common.dnd;
+ uses:="org.eclipse.emf.ecore,
+ org.eclipse.swt.dnd,
+ org.eclipse.jface.viewers,
+ org.eclipse.emf.edit.ui.dnd",
+ org.eclipse.emf.ecp.common.handler,
+ org.eclipse.emf.ecp.common.observer;uses:="org.eclipse.emf.ecore,org.eclipse.emf.emfstore.common.observer",
+ org.eclipse.emf.ecp.common.preferences;
+ uses:="org.eclipse.jface.preference,
+ org.eclipse.jface.resource,
+ org.eclipse.ui,
+ org.eclipse.swt.widgets",
+ org.eclipse.emf.ecp.common.utilities;
+ uses:="org.eclipse.jface.window,
+ org.eclipse.emf.ecore,
+ org.eclipse.emf.ecp.model,
+ org.eclipse.emf.edit.ui.provider,
+ org.eclipse.jface.viewers,
+ org.eclipse.core.commands,
+ org.eclipse.swt.widgets"
+Bundle-ClassPath: .
diff --git a/old/org.eclipse.emf.ecp.common/build.properties b/old/org.eclipse.emf.ecp.common/build.properties
new file mode 100644
index 0000000..76f0f4d
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.common/build.properties
@@ -0,0 +1,9 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ plugin.xml,\
+ icons/,\
+ schema/
+src.includes = schema/,\
+ icons/
diff --git a/old/org.eclipse.emf.ecp.common/icons/ActionItem.png b/old/org.eclipse.emf.ecp.common/icons/ActionItem.png
new file mode 100644
index 0000000..7fe344e
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.common/icons/ActionItem.png
Binary files differ
diff --git a/old/org.eclipse.emf.ecp.common/icons/AnnotateWithActionItem.gif b/old/org.eclipse.emf.ecp.common/icons/AnnotateWithActionItem.gif
new file mode 100644
index 0000000..d107a10
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.common/icons/AnnotateWithActionItem.gif
Binary files differ
diff --git a/old/org.eclipse.emf.ecp.common/icons/Comment.png b/old/org.eclipse.emf.ecp.common/icons/Comment.png
new file mode 100644
index 0000000..7bc9233
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.common/icons/Comment.png
Binary files differ
diff --git a/old/org.eclipse.emf.ecp.common/icons/Document.gif b/old/org.eclipse.emf.ecp.common/icons/Document.gif
new file mode 100644
index 0000000..3722fea
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.common/icons/Document.gif
Binary files differ
diff --git a/old/org.eclipse.emf.ecp.common/icons/Issue.gif b/old/org.eclipse.emf.ecp.common/icons/Issue.gif
new file mode 100644
index 0000000..4b933ed
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.common/icons/Issue.gif
Binary files differ
diff --git a/old/org.eclipse.emf.ecp.common/icons/ModelElement.png b/old/org.eclipse.emf.ecp.common/icons/ModelElement.png
new file mode 100644
index 0000000..5898c18
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.common/icons/ModelElement.png
Binary files differ
diff --git a/old/org.eclipse.emf.ecp.common/icons/accept.png b/old/org.eclipse.emf.ecp.common/icons/accept.png
new file mode 100644
index 0000000..c96f189
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.common/icons/accept.png
Binary files differ
diff --git a/old/org.eclipse.emf.ecp.common/icons/add.png b/old/org.eclipse.emf.ecp.common/icons/add.png
new file mode 100644
index 0000000..fad166b
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.common/icons/add.png
Binary files differ
diff --git a/old/org.eclipse.emf.ecp.common/icons/add_overlay.png b/old/org.eclipse.emf.ecp.common/icons/add_overlay.png
new file mode 100644
index 0000000..b43ad2c
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.common/icons/add_overlay.png
Binary files differ
diff --git a/old/org.eclipse.emf.ecp.common/icons/application_edit.png b/old/org.eclipse.emf.ecp.common/icons/application_edit.png
new file mode 100644
index 0000000..fb2efb8
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.common/icons/application_edit.png
Binary files differ
diff --git a/old/org.eclipse.emf.ecp.common/icons/blocked.png b/old/org.eclipse.emf.ecp.common/icons/blocked.png
new file mode 100644
index 0000000..1614e28
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.common/icons/blocked.png
Binary files differ
diff --git a/old/org.eclipse.emf.ecp.common/icons/close.png b/old/org.eclipse.emf.ecp.common/icons/close.png
new file mode 100644
index 0000000..400172f
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.common/icons/close.png
Binary files differ
diff --git a/old/org.eclipse.emf.ecp.common/icons/collapsed.png b/old/org.eclipse.emf.ecp.common/icons/collapsed.png
new file mode 100644
index 0000000..8ff65fb
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.common/icons/collapsed.png
Binary files differ
diff --git a/old/org.eclipse.emf.ecp.common/icons/commentReply.png b/old/org.eclipse.emf.ecp.common/icons/commentReply.png
new file mode 100644
index 0000000..9c11450
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.common/icons/commentReply.png
Binary files differ
diff --git a/old/org.eclipse.emf.ecp.common/icons/containment_overlay.png b/old/org.eclipse.emf.ecp.common/icons/containment_overlay.png
new file mode 100644
index 0000000..55618af
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.common/icons/containment_overlay.png
Binary files differ
diff --git a/old/org.eclipse.emf.ecp.common/icons/dark.png b/old/org.eclipse.emf.ecp.common/icons/dark.png
new file mode 100644
index 0000000..d8c71d6
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.common/icons/dark.png
Binary files differ
diff --git a/old/org.eclipse.emf.ecp.common/icons/delete.gif b/old/org.eclipse.emf.ecp.common/icons/delete.gif
new file mode 100644
index 0000000..c5d817c
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.common/icons/delete.gif
Binary files differ
diff --git a/old/org.eclipse.emf.ecp.common/icons/delete_edit.gif b/old/org.eclipse.emf.ecp.common/icons/delete_edit.gif
new file mode 100644
index 0000000..b6922ac
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.common/icons/delete_edit.gif
Binary files differ
diff --git a/old/org.eclipse.emf.ecp.common/icons/delete_overlay.png b/old/org.eclipse.emf.ecp.common/icons/delete_overlay.png
new file mode 100644
index 0000000..61dd861
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.common/icons/delete_overlay.png
Binary files differ
diff --git a/old/org.eclipse.emf.ecp.common/icons/dirty.jpg b/old/org.eclipse.emf.ecp.common/icons/dirty.jpg
new file mode 100644
index 0000000..e63f143
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.common/icons/dirty.jpg
Binary files differ
diff --git a/old/org.eclipse.emf.ecp.common/icons/dirty.png b/old/org.eclipse.emf.ecp.common/icons/dirty.png
new file mode 100644
index 0000000..14ca5ce
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.common/icons/dirty.png
Binary files differ
diff --git a/old/org.eclipse.emf.ecp.common/icons/error.png b/old/org.eclipse.emf.ecp.common/icons/error.png
new file mode 100644
index 0000000..5311e6c
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.common/icons/error.png
Binary files differ
diff --git a/old/org.eclipse.emf.ecp.common/icons/error_decorate.png b/old/org.eclipse.emf.ecp.common/icons/error_decorate.png
new file mode 100644
index 0000000..28847c4
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.common/icons/error_decorate.png
Binary files differ
diff --git a/old/org.eclipse.emf.ecp.common/icons/expanded.png b/old/org.eclipse.emf.ecp.common/icons/expanded.png
new file mode 100644
index 0000000..487e0b7
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.common/icons/expanded.png
Binary files differ
diff --git a/old/org.eclipse.emf.ecp.common/icons/filtertomyteam.png b/old/org.eclipse.emf.ecp.common/icons/filtertomyteam.png
new file mode 100644
index 0000000..7fb4e1f
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.common/icons/filtertomyteam.png
Binary files differ
diff --git a/old/org.eclipse.emf.ecp.common/icons/filtertouser.png b/old/org.eclipse.emf.ecp.common/icons/filtertouser.png
new file mode 100644
index 0000000..79f35cc
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.common/icons/filtertouser.png
Binary files differ
diff --git a/old/org.eclipse.emf.ecp.common/icons/guest_thumb.png b/old/org.eclipse.emf.ecp.common/icons/guest_thumb.png
new file mode 100644
index 0000000..64b8961
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.common/icons/guest_thumb.png
Binary files differ
diff --git a/old/org.eclipse.emf.ecp.common/icons/info.png b/old/org.eclipse.emf.ecp.common/icons/info.png
new file mode 100644
index 0000000..8b24632
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.common/icons/info.png
Binary files differ
diff --git a/old/org.eclipse.emf.ecp.common/icons/link_overlay.png b/old/org.eclipse.emf.ecp.common/icons/link_overlay.png
new file mode 100644
index 0000000..f7a65d3
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.common/icons/link_overlay.png
Binary files differ
diff --git a/old/org.eclipse.emf.ecp.common/icons/magnifier.png b/old/org.eclipse.emf.ecp.common/icons/magnifier.png
new file mode 100644
index 0000000..cf3d97f
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.common/icons/magnifier.png
Binary files differ
diff --git a/old/org.eclipse.emf.ecp.common/icons/modify_overlay.png b/old/org.eclipse.emf.ecp.common/icons/modify_overlay.png
new file mode 100644
index 0000000..b1a1819
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.common/icons/modify_overlay.png
Binary files differ
diff --git a/old/org.eclipse.emf.ecp.common/icons/nocomments.png b/old/org.eclipse.emf.ecp.common/icons/nocomments.png
new file mode 100644
index 0000000..50d1144
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.common/icons/nocomments.png
Binary files differ
diff --git a/old/org.eclipse.emf.ecp.common/icons/open.png b/old/org.eclipse.emf.ecp.common/icons/open.png
new file mode 100644
index 0000000..e2c382b
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.common/icons/open.png
Binary files differ
diff --git a/old/org.eclipse.emf.ecp.common/icons/read_only.gif b/old/org.eclipse.emf.ecp.common/icons/read_only.gif
new file mode 100644
index 0000000..d7c067e
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.common/icons/read_only.gif
Binary files differ
diff --git a/old/org.eclipse.emf.ecp.common/icons/remove.png b/old/org.eclipse.emf.ecp.common/icons/remove.png
new file mode 100644
index 0000000..be1ffc5
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.common/icons/remove.png
Binary files differ
diff --git a/old/org.eclipse.emf.ecp.common/icons/shortcut.png b/old/org.eclipse.emf.ecp.common/icons/shortcut.png
new file mode 100644
index 0000000..e6f19f3
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.common/icons/shortcut.png
Binary files differ
diff --git a/old/org.eclipse.emf.ecp.common/icons/subscribe.png b/old/org.eclipse.emf.ecp.common/icons/subscribe.png
new file mode 100644
index 0000000..b88c857
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.common/icons/subscribe.png
Binary files differ
diff --git a/old/org.eclipse.emf.ecp.common/icons/unicase.png b/old/org.eclipse.emf.ecp.common/icons/unicase.png
new file mode 100644
index 0000000..1e43863
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.common/icons/unicase.png
Binary files differ
diff --git a/old/org.eclipse.emf.ecp.common/icons/user_comment.png b/old/org.eclipse.emf.ecp.common/icons/user_comment.png
new file mode 100644
index 0000000..4ecd99f
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.common/icons/user_comment.png
Binary files differ
diff --git a/old/org.eclipse.emf.ecp.common/icons/validation.png b/old/org.eclipse.emf.ecp.common/icons/validation.png
new file mode 100644
index 0000000..a0ddc00
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.common/icons/validation.png
Binary files differ
diff --git a/old/org.eclipse.emf.ecp.common/icons/warning.png b/old/org.eclipse.emf.ecp.common/icons/warning.png
new file mode 100644
index 0000000..628cf2d
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.common/icons/warning.png
Binary files differ
diff --git a/old/org.eclipse.emf.ecp.common/icons/warning_decorate.png b/old/org.eclipse.emf.ecp.common/icons/warning_decorate.png
new file mode 100644
index 0000000..14caf6c
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.common/icons/warning_decorate.png
Binary files differ
diff --git a/old/org.eclipse.emf.ecp.common/plugin.xml b/old/org.eclipse.emf.ecp.common/plugin.xml
new file mode 100644
index 0000000..9d2d61a
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.common/plugin.xml
@@ -0,0 +1,167 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.2"?>
+<plugin>
+ <extension-point id="org.eclipse.emf.ecp.common.modelelementopener" name="Open Handler for Modelelements" schema="schema/org.eclipse.emf.ecp.common.modelelementopener.exsd"/>
+ <extension-point id="org.eclipse.emf.ecp.common.dropadapter" name="Model element drop adapter" schema="schema/org.eclipse.emf.ecp.common.dropadapter.exsd"/>
+ <extension-point id="org.eclipse.emf.ecp.common.menuContributionEnablement" name="menuContributionEnablement" schema="schema/org.eclipse.emf.ecp.common.menuContributionEnablement.exsd"/>
+ <extension
+ point="org.eclipse.ui.commands">
+ <category
+ id="org.eclipse.emf.ecp.common"
+ name="org.eclipse.emf.ecp.common">
+ </category>
+ <command
+ categoryId="org.eclipse.emf.ecp.common"
+ defaultHandler="org.eclipse.emf.ecp.common.handler.SearchModelElementHandler"
+ id="org.eclipse.emf.ecp.common.handlers.open_me_ID"
+ name="Search for Modelelement">
+ </command>
+ </extension>
+ <extension
+ point="org.eclipse.ui.menus">
+ <menuContribution
+ locationURI="popup:org.eclipse.emf.ecp.navigator.viewer?after=org.eclipse.emf.ecp.navigator.createModelElementCommands">
+ <separator
+ name="org.eclipse.emf.ecp.common.commands.modifyCommands">
+ </separator>
+ </menuContribution>
+ <menuContribution
+ locationURI="popup:org.eclipse.emf.ecp.navigator.viewer?after=additions">
+ <separator
+ name="beforeDeleteSeparator"
+ visible="false">
+ </separator>
+ <command
+ commandId="org.eclipse.emf.ecp.common.deleteModelelement"
+ icon="icons/delete.gif"
+ label="Delete"
+ style="push">
+ <visibleWhen
+ checkEnabled="false">
+ <and>
+ <iterate
+ ifEmpty="false"
+ operator="and">
+ <and>
+ <instanceof value="org.eclipse.emf.ecore.EObject" />
+ <not>
+ <instanceof value="org.eclipse.emf.emfstore.client.model.ProjectSpace" />
+ </not>
+ <not>
+ <instanceof value="org.eclipse.emf.emfstore.common.model.Project"/>
+ </not>
+ </and>
+ </iterate>
+ <test
+ args="org.eclipse.emf.ecp.common.deleteModelelement"
+ property="org.eclipse.emf.ecp.common.menuContributionsEnablement"
+ value="true">
+ </test>
+ </and>
+ </visibleWhen>
+ </command>
+ </menuContribution>
+ <menuContribution
+ locationURI="toolbar:org.eclipse.ui.main.toolbar">
+ <toolbar
+ id="org.eclipse.emf.ecp.common.ECPToolbar">
+ <command
+ commandId="org.eclipse.emf.ecp.common.handlers.open_me_ID"
+ icon="icons/magnifier.png"
+ style="push"
+ tooltip="Search model element">
+ <visibleWhen
+ checkEnabled="false">
+ <and>
+ <iterate
+ ifEmpty="false"
+ operator="and">
+ <and>
+ <instanceof
+ value="org.eclipse.emf.ecore.EObject">
+ </instanceof>
+ <not>
+ <instanceof
+ value="org.eclipse.emf.emfstore.common.model.Project">
+ </instanceof>
+ </not>
+ <not>
+ <instanceof
+ value="org.eclipse.emf.emfstore.client.model.ProjectSpace">
+ </instanceof>
+ </not>
+ </and>
+ </iterate>
+ <count
+ value="1">
+ </count>
+ <test
+ args="org.eclipse.emf.ecp.common.handlers.open_me_ID"
+ property="org.eclipse.emf.ecp.common.menuContributionsEnablement"
+ value="true">
+ </test>
+ </and>
+ </visibleWhen>
+ </command>
+ </toolbar>
+ </menuContribution>
+
+
+
+ </extension>
+ <extension
+ point="org.eclipse.core.expressions.definitions">
+ <definition
+ id="org.eclipse.emf.ecp.common.commands.modelElement">
+ <and>
+ <instanceof
+ value="org.eclipse.emf.ecore.EObject">
+ </instanceof>
+ <not>
+ <instanceof
+ value="org.eclipse.emf.emfstore.client.model.ProjectSpace">
+ </instanceof>
+ </not>
+ <not>
+ <instanceof
+ value="org.eclipse.emf.emfstore.common.model.Project">
+ </instanceof>
+ </not>
+ </and>
+ </definition>
+ </extension>
+ <extension
+ point="org.eclipse.ui.preferencePages">
+ <page
+ class="org.eclipse.emf.ecp.common.preferences.ECPPreferencesPage"
+ id="org.eclipse.emf.ecp"
+ name="ECP">
+ </page>
+ </extension>
+ <extension
+ point="org.eclipse.emf.ecp.common.dropadapter">
+ <MEDropAdapter
+ class="org.eclipse.emf.ecp.common.dnd.DefaultMEDropAdapter">
+ </MEDropAdapter>
+ </extension>
+ <extension
+ point="org.eclipse.ui.bindings">
+ <key
+ commandId="org.eclipse.emf.ecp.common.deleteModelelement"
+ contextId="org.eclipse.ui.contexts.window"
+ schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
+ sequence="Ctrl+Delete">
+ </key>
+ </extension>
+ <extension
+ point="org.eclipse.core.expressions.propertyTesters">
+ <propertyTester
+ class="org.eclipse.emf.ecp.common.commands.ECPMenuContributionsEnablementTester"
+ id="org.eclipse.emf.ecp.common.menuContributionsEnablementTester"
+ namespace="org.eclipse.emf.ecp.common"
+ properties="menuContributionsEnablement"
+ type="java.lang.Object">
+ </propertyTester>
+ </extension>
+</plugin>
+
diff --git a/old/org.eclipse.emf.ecp.common/pom.xml b/old/org.eclipse.emf.ecp.common/pom.xml
new file mode 100644
index 0000000..352109d
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.common/pom.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.eclipse.emf.emfstore</groupId>
+ <artifactId>emfstore-parent</artifactId>
+ <version>0.9.3-SNAPSHOT</version>
+ <relativePath>../../org.eclipse.emf.emfstore.releng/emfstore-parent/</relativePath>
+ </parent>
+ <groupId>org.eclipse.emf.emfstore</groupId>
+ <artifactId>org.eclipse.emf.ecp.common</artifactId>
+ <version>0.9.3-SNAPSHOT</version>
+ <packaging>eclipse-plugin</packaging>
+</project>
diff --git a/old/org.eclipse.emf.ecp.common/schema/org.eclipse.emf.ecp.common.dropadapter.exsd b/old/org.eclipse.emf.ecp.common/schema/org.eclipse.emf.ecp.common.dropadapter.exsd
new file mode 100644
index 0000000..efa68ca
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.common/schema/org.eclipse.emf.ecp.common.dropadapter.exsd
@@ -0,0 +1,102 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- Schema file written by PDE -->
+<schema targetNamespace="org.eclipse.emf.ecp.common" xmlns="http://www.w3.org/2001/XMLSchema">
+<annotation>
+ <appInfo>
+ <meta.schema plugin="org.eclipse.emf.ecp.common" id="org.eclipse.emf.ecp.common.dropadapter" name="Model element drop adapter"/>
+ </appInfo>
+ <documentation>
+ [Enter description of this extension point.]
+ </documentation>
+ </annotation>
+
+ <element name="extension">
+ <annotation>
+ <appInfo>
+ <meta.element />
+ </appInfo>
+ </annotation>
+ <complexType>
+ <sequence>
+ <element ref="MEDropAdapter" minOccurs="1" maxOccurs="unbounded"/>
+ </sequence>
+ <attribute name="point" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="id" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="name" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appInfo>
+ <meta.attribute translatable="true"/>
+ </appInfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="MEDropAdapter">
+ <complexType>
+ <attribute name="class" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appInfo>
+ <meta.attribute kind="java" basedOn="org.eclipse.emf.ecp.common.dnd.MEDropAdapter:"/>
+ </appInfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="since"/>
+ </appInfo>
+ <documentation>
+ [Enter the first release in which this extension point appears.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="examples"/>
+ </appInfo>
+ <documentation>
+ [Enter extension point usage example here.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="apiinfo"/>
+ </appInfo>
+ <documentation>
+ [Enter API information here.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="implementation"/>
+ </appInfo>
+ <documentation>
+ [Enter information about supplied implementation of this extension point.]
+ </documentation>
+ </annotation>
+
+
+</schema>
diff --git a/old/org.eclipse.emf.ecp.common/schema/org.eclipse.emf.ecp.common.menuContributionEnablement.exsd b/old/org.eclipse.emf.ecp.common/schema/org.eclipse.emf.ecp.common.menuContributionEnablement.exsd
new file mode 100644
index 0000000..64f0e5f
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.common/schema/org.eclipse.emf.ecp.common.menuContributionEnablement.exsd
@@ -0,0 +1,92 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- Schema file written by PDE -->
+<schema targetNamespace="org.eclipse.emf.ecp.common" xmlns="http://www.w3.org/2001/XMLSchema">
+<annotation>
+ <appInfo>
+ <meta.schema plugin="org.eclipse.emf.ecp.common" id="org.eclipse.emf.ecp.common.menuContributionEnablement" name="ECP Menu Contribution Enablement"/>
+ </appInfo>
+ <documentation>
+ Allows to disable all ECP menu contributions.
+
+This extension point can be used either in whitelist or blacklist mode. This is configured by setting the enabled setting. Then a list of commands can be added.
+ </documentation>
+ </annotation>
+
+ <element name="extension">
+ <annotation>
+ <appInfo>
+ <meta.element />
+ </appInfo>
+ </annotation>
+ <complexType>
+ <sequence>
+ <element ref="MenuContributionEnablement"/>
+ </sequence>
+ <attribute name="point" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="id" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="name" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appInfo>
+ <meta.attribute translatable="true"/>
+ </appInfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="MenuContributionEnablement">
+ <complexType>
+ <sequence minOccurs="0" maxOccurs="unbounded">
+ <element ref="Command"/>
+ </sequence>
+ <attribute name="enabled" type="boolean" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="Command">
+ <complexType>
+ <attribute name="commandID" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="since"/>
+ </appInfo>
+ <documentation>
+ 0.8.9.qualifier
+ </documentation>
+ </annotation>
+
+
+
+
+
+</schema>
diff --git a/old/org.eclipse.emf.ecp.common/schema/org.eclipse.emf.ecp.common.modelelementopener.exsd b/old/org.eclipse.emf.ecp.common/schema/org.eclipse.emf.ecp.common.modelelementopener.exsd
new file mode 100644
index 0000000..549aba7
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.common/schema/org.eclipse.emf.ecp.common.modelelementopener.exsd
@@ -0,0 +1,101 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- Schema file written by PDE -->
+<schema targetNamespace="org.eclipse.emf.ecp.common" xmlns="http://www.w3.org/2001/XMLSchema">
+<annotation>
+ <appInfo>
+ <meta.schema plugin="org.eclipse.emf.ecp.common" id="org.eclipse.emf.ecp.common.modelelementopener" name="Open Handler for Modelelements"/>
+ </appInfo>
+ <documentation>
+ A model element opener is responsible to handle the double click action in the navigator on a model element.
+ </documentation>
+ </annotation>
+
+ <element name="extension">
+ <annotation>
+ <appInfo>
+ <meta.element />
+ </appInfo>
+ </annotation>
+ <complexType>
+ <sequence minOccurs="1" maxOccurs="unbounded">
+ <element ref="ModelElementOpener"/>
+ </sequence>
+ <attribute name="point" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="id" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="name" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appInfo>
+ <meta.attribute translatable="true"/>
+ </appInfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="ModelElementOpener">
+ <complexType>
+ <attribute name="name" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="class" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appInfo>
+ <meta.attribute kind="java" basedOn=":org.eclipse.emf.ecp.common.util.ModelElementOpener"/>
+ </appInfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="since"/>
+ </appInfo>
+ <documentation>
+ [Enter the first release in which this extension point appears.]
+ </documentation>
+ </annotation>
+
+
+ <annotation>
+ <appInfo>
+ <meta.section type="apiinfo"/>
+ </appInfo>
+ <documentation>
+ [Enter API information here.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="implementation"/>
+ </appInfo>
+ <documentation>
+ [Enter information about supplied implementation of this extension point.]
+ </documentation>
+ </annotation>
+
+
+</schema>
diff --git a/old/org.eclipse.emf.ecp.common/src/org/eclipse/emf/ecp/common/Activator.java b/old/org.eclipse.emf.ecp.common/src/org/eclipse/emf/ecp/common/Activator.java
new file mode 100644
index 0000000..5d70dca
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.common/src/org/eclipse/emf/ecp/common/Activator.java
@@ -0,0 +1,94 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2011 Chair for Applied Software Engineering,
+ * Technische Universitaet Muenchen.
+ * 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:
+ ******************************************************************************/
+package org.eclipse.emf.ecp.common;
+
+import org.eclipse.core.runtime.Status;
+import org.eclipse.emf.ecp.common.util.AbstractECPPlugin;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.osgi.framework.BundleContext;
+
+/**
+ * . The activator class controls the plug-in life cycle
+ */
+public class Activator extends AbstractECPPlugin {
+
+ /**
+ * . The plug-in ID
+ */
+ public static final String PLUGIN_ID = "org.eclipse.emf.ecp.common";
+
+ /**
+ * . The shared instance
+ */
+ private static Activator plugin;
+
+ /**
+ * . The constructor
+ */
+ public Activator() {
+ }
+
+ /**
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+ * {@inheritDoc}
+ */
+ @Override
+ // BEGIN SUPRESS CATCH EXCEPTION
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ plugin = this;
+ }
+
+ /**
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+ */
+ @Override
+ public void stop(BundleContext context) throws Exception {
+ plugin = null;
+ super.stop(context);
+ }
+
+ // END SUPRESS CATCH EXCEPTION
+
+ /**
+ * . Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static Activator getDefault() {
+ return plugin;
+ }
+
+ /**
+ * Returns an image descriptor for the image file at the given. plug-in
+ * relative path
+ *
+ * @param path
+ * the path
+ * @return the image descriptor
+ */
+ public static ImageDescriptor getImageDescriptor(String path) {
+ return imageDescriptorFromPlugin(PLUGIN_ID, path);
+ }
+
+ /**
+ * Logs exception.
+ *
+ * @param e
+ * the exception
+ */
+ public void logException(Exception e) {
+ getDefault().getLog().log(
+ new Status(Status.ERROR, Activator.getDefault().getBundle().getSymbolicName(), e.getMessage(), e));
+
+ }
+
+}
\ No newline at end of file
diff --git a/old/org.eclipse.emf.ecp.common/src/org/eclipse/emf/ecp/common/ColumnViewerSorter.java b/old/org.eclipse.emf.ecp.common/src/org/eclipse/emf/ecp/common/ColumnViewerSorter.java
new file mode 100644
index 0000000..57e0488
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.common/src/org/eclipse/emf/ecp/common/ColumnViewerSorter.java
@@ -0,0 +1,192 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2011 Chair for Applied Software Engineering,
+ * Technische Universitaet Muenchen.
+ * 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:
+ ******************************************************************************/
+package org.eclipse.emf.ecp.common;
+
+import org.eclipse.jface.viewers.ColumnLabelProvider;
+import org.eclipse.jface.viewers.ColumnViewer;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.viewers.ViewerColumn;
+import org.eclipse.jface.viewers.ViewerComparator;
+
+/**
+ * Super-class for sorting column viewer, with ability to turn sorting on and off.
+ *
+ * @author zardosht
+ */
+public abstract class ColumnViewerSorter extends ViewerComparator {
+
+ /**
+ * Direction constant used to show right direction arrow on column header.
+ */
+ public static final int ASC = 1;
+ /**
+ * Direction constant used to show right direction arrow on column header.
+ */
+ public static final int DESC = -1;
+ private int direction = 1;
+ private ColumnLabelProvider columnLabelProvider;
+ private final ColumnViewer viewer;
+ private boolean sortingEnabled;
+
+ /**
+ * Constructor.
+ *
+ * @param viewer ColumnViewer
+ * @param columnLabelProvider ColumnLabelProvider
+ */
+ public ColumnViewerSorter(ColumnViewer viewer, ColumnLabelProvider columnLabelProvider) {
+ this.columnLabelProvider = columnLabelProvider;
+ this.viewer = viewer;
+ }
+
+ /**
+ * . This is used to set the right direction arrow at column header and refresh the viewer.
+ *
+ * @param sorter sorter
+ * @param direction direction
+ */
+ protected void setSorter(ColumnViewerSorter sorter, int direction) {
+ if (!sortingEnabled) {
+ sortingEnabled = true;
+ }
+
+ this.direction = direction;
+
+ if (viewer.getComparator() == sorter) {
+ viewer.refresh();
+ } else {
+ viewer.setComparator(sorter);
+ }
+
+ }
+
+ /**
+ * . {@inheritDoc}
+ */
+ @SuppressWarnings("unchecked")
+ @Override
+ public int compare(Viewer viewer, Object e1, Object e2) {
+
+ if (!sortingEnabled) {
+ return 0;
+ }
+
+ int cat1 = category(e1);
+ int cat2 = category(e2);
+
+ if (cat1 != cat2) {
+ return cat1 - cat2;
+ }
+
+ String str1 = columnLabelProvider.getText(e1);
+ String str2 = columnLabelProvider.getText(e2);
+
+ if (str1 == null) {
+ str1 = "";
+ }
+ if (str2 == null) {
+ str2 = "";
+ }
+
+ // Handle integers
+ if (str1.matches("[0-9]*") || str1.equals("")) {
+ if (str2.matches("[0-9]*") || str2.equals("")) {
+ return compareIntegers(str1, str2);
+ }
+ }
+
+ // use the comparator to compare the strings
+ if (direction == ASC) {
+ return getComparator().compare(str1, str2);
+ } else {
+ return getComparator().compare(str2, str1);
+ }
+
+ }
+
+ private int compareIntegers(String str1, String str2) {
+ if (str1.equals("")) {
+ str1 = "0";
+ }
+ if (str2.equals("")) {
+ str2 = "0";
+ }
+ int int1;
+ int int2;
+ try {
+ int1 = Integer.parseInt(str1);
+ int2 = Integer.parseInt(str2);
+ } catch (NumberFormatException e) {
+ return 0;
+ }
+
+ if (direction == ASC) {
+ return int1 - int2;
+ } else {
+ return int2 - int1;
+ }
+ }
+
+ /**
+ * @param sortingEnabled the sortingEnabled to set
+ */
+ public void setSortingEnabled(boolean sortingEnabled) {
+ this.sortingEnabled = sortingEnabled;
+ }
+
+ /**
+ * @return the sortingEnabled
+ */
+ public boolean isSortingEnabled() {
+ return sortingEnabled;
+ }
+
+ /**
+ * @param direction the direction to set
+ */
+ public void setDirection(int direction) {
+ this.direction = direction;
+ }
+
+ /**
+ * @return the direction
+ */
+ public int getDirection() {
+ return direction;
+ }
+
+ /**
+ * @return viewer column
+ */
+ public abstract ViewerColumn getViewerColumn();
+
+ /**
+ * @param columnLabelProvider the columnLabelProvider to set
+ */
+ public void setColumnLabelProvider(ColumnLabelProvider columnLabelProvider) {
+ this.columnLabelProvider = columnLabelProvider;
+ }
+
+ /**
+ * @return the columnLabelProvider
+ */
+ public ColumnLabelProvider getColumnLabelProvider() {
+ return columnLabelProvider;
+ }
+
+ /**
+ * @return the viewer
+ */
+ public ColumnViewer getViewer() {
+ return viewer;
+ }
+
+}
\ No newline at end of file
diff --git a/old/org.eclipse.emf.ecp.common/src/org/eclipse/emf/ecp/common/EMFColumnLabelProvider.java b/old/org.eclipse.emf.ecp.common/src/org/eclipse/emf/ecp/common/EMFColumnLabelProvider.java
new file mode 100644
index 0000000..08bc2c6
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.common/src/org/eclipse/emf/ecp/common/EMFColumnLabelProvider.java
@@ -0,0 +1,76 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2011 Chair for Applied Software Engineering,
+ * Technische Universitaet Muenchen.
+ * 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:
+ ******************************************************************************/
+package org.eclipse.emf.ecp.common;
+
+import org.eclipse.emf.edit.provider.ComposedAdapterFactory;
+import org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider;
+import org.eclipse.jface.viewers.ColumnLabelProvider;
+import org.eclipse.jface.viewers.DecoratingLabelProvider;
+import org.eclipse.jface.viewers.IColorProvider;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.ui.IDecoratorManager;
+import org.eclipse.ui.PlatformUI;
+
+/**
+ * . LabelProvider for annotated model element column
+ *
+ * @author Helming
+ */
+public class EMFColumnLabelProvider extends ColumnLabelProvider implements IColorProvider {
+
+ private DecoratingLabelProvider decoratingLabelProvider;
+ private ComposedAdapterFactory adapterFactory;
+
+ /**
+ * . Constructor
+ */
+ public EMFColumnLabelProvider() {
+ super();
+ IDecoratorManager decoratorManager = PlatformUI.getWorkbench().getDecoratorManager();
+ adapterFactory = new ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry.INSTANCE);
+ decoratingLabelProvider = new DecoratingLabelProvider(new AdapterFactoryLabelProvider(
+ adapterFactory),
+ decoratorManager.getLabelDecorator());
+ }
+
+ /**
+ * . {@inheritDoc}
+ */
+ @Override
+ public Image getImage(Object element) {
+
+ Image image = decoratingLabelProvider.getImage(element);
+ decoratingLabelProvider.getLabelDecorator().decorateImage(image, element);
+ return image;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.BaseLabelProvider#dispose()
+ */
+ @Override
+ public void dispose() {
+ super.dispose();
+ if (adapterFactory!=null) {
+ adapterFactory.dispose();
+ }
+ }
+
+ /**
+ * . {@inheritDoc}
+ */
+ @Override
+ public String getText(Object element) {
+ return decoratingLabelProvider.getText(element);
+ }
+
+}
\ No newline at end of file
diff --git a/old/org.eclipse.emf.ecp.common/src/org/eclipse/emf/ecp/common/MEClassLabelProvider.java b/old/org.eclipse.emf.ecp.common/src/org/eclipse/emf/ecp/common/MEClassLabelProvider.java
new file mode 100644
index 0000000..2751d5a
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.common/src/org/eclipse/emf/ecp/common/MEClassLabelProvider.java
@@ -0,0 +1,92 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2011 Chair for Applied Software Engineering,
+ * Technische Universitaet Muenchen.
+ * 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:
+ ******************************************************************************/
+package org.eclipse.emf.ecp.common;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.edit.provider.ComposedAdapterFactory;
+import org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider;
+import org.eclipse.swt.graphics.Image;
+
+/**
+ * @author Hodaie LabelProvider for TreeViewer that is shown on ModelTreePage
+ */
+public class MEClassLabelProvider extends AdapterFactoryLabelProvider {
+
+ /**
+ * Constructor.
+ */
+ public MEClassLabelProvider() {
+ super(new ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry.INSTANCE));
+
+ }
+
+ /**
+ * . ({@inheritDoc}) If argument is instance of EClass then return its display name.
+ */
+ @Override
+ public String getText(Object object) {
+ if (object instanceof EPackage) {
+ return super.getText(object);
+ }
+ if (object instanceof EClass) {
+ return ((EClass) object).getName();
+ }
+ return "";
+ }
+
+ /**
+ * . ({@inheritDoc})
+ */
+ @Override
+ public Image getImage(Object object) {
+ if (object instanceof EClass) {
+ EClass eClass = (EClass) object;
+ EPackage ePackage = eClass.getEPackage();
+ if (!eClass.isAbstract() && !eClass.isInterface()) {
+ EObject newMEInstance = ePackage.getEFactoryInstance().create(eClass);
+ return super.getImage(newMEInstance);
+ } else {
+ return super.getImage(object);
+ }
+
+ }
+ return super.getImage(object);
+
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public Image getColumnImage(Object object, int columnIndex) {
+ if (columnIndex == 0) {
+ return getImage(object);
+ } else {
+ return super.getImage(object);
+ }
+
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public String getColumnText(Object object, int columnIndex) {
+ if (columnIndex == 0) {
+ return getText(object);
+ } else {
+ return super.getText(object);
+ }
+ }
+
+}
\ No newline at end of file
diff --git a/old/org.eclipse.emf.ecp.common/src/org/eclipse/emf/ecp/common/TableViewerColumnSorter.java b/old/org.eclipse.emf.ecp.common/src/org/eclipse/emf/ecp/common/TableViewerColumnSorter.java
new file mode 100644
index 0000000..732c857
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.common/src/org/eclipse/emf/ecp/common/TableViewerColumnSorter.java
@@ -0,0 +1,90 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2011 Chair for Applied Software Engineering,
+ * Technische Universitaet Muenchen.
+ * 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:
+ ******************************************************************************/
+package org.eclipse.emf.ecp.common;
+
+import org.eclipse.jface.viewers.ColumnLabelProvider;
+import org.eclipse.jface.viewers.TableViewer;
+import org.eclipse.jface.viewers.TableViewerColumn;
+import org.eclipse.jface.viewers.ViewerColumn;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+
+/**
+ * . This a sorter for TableViewers.
+ *
+ * @author hodaie
+ */
+public class TableViewerColumnSorter extends ColumnViewerSorter {
+
+ private TableViewerColumn column;
+
+ /**
+ * . Constructor
+ *
+ * @param viewer TableViewer to be sorted
+ * @param column TableViewerColumn based on which viewer is sorted
+ * @param columnLabelProvider ColumnLabelProvider used to sort contents
+ */
+ public TableViewerColumnSorter(TableViewer viewer, TableViewerColumn column, ColumnLabelProvider columnLabelProvider) {
+ super(viewer, columnLabelProvider);
+ this.column = column;
+ column.getColumn().addSelectionListener(new SelectionAdapter() {
+
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ if (getViewer().getComparator() != null) {
+ if (getViewer().getComparator() == TableViewerColumnSorter.this) {
+ if (getDirection() == ASC) {
+ setSorter(TableViewerColumnSorter.this, DESC);
+ } else {
+ setSorter(TableViewerColumnSorter.this, ASC);
+ }
+ } else {
+ setSorter(TableViewerColumnSorter.this, ASC);
+ }
+ } else {
+ setSorter(TableViewerColumnSorter.this, ASC);
+ }
+ }
+ });
+ }
+
+ /**
+ * This is used to set the right direction arrow at column header and refresh the viewer.
+ *
+ * @param sorter sorter
+ * @param direction direction
+ */
+ @Override
+ protected void setSorter(ColumnViewerSorter sorter, int direction) {
+
+ super.setSorter(sorter, direction);
+
+ column.getColumn().getParent().setSortColumn(column.getColumn());
+ if (direction == ASC) {
+ column.getColumn().getParent().setSortDirection(SWT.DOWN);
+ } else {
+ column.getColumn().getParent().setSortDirection(SWT.UP);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.ecp.common.ColumnViewerSorter#getViewerColumn()
+ */
+ @Override
+ public ViewerColumn getViewerColumn() {
+ return column;
+ }
+
+}
\ No newline at end of file
diff --git a/old/org.eclipse.emf.ecp.common/src/org/eclipse/emf/ecp/common/commands/DeleteModelElementCommand.java b/old/org.eclipse.emf.ecp.common/src/org/eclipse/emf/ecp/common/commands/DeleteModelElementCommand.java
new file mode 100644
index 0000000..cc28677
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.common/src/org/eclipse/emf/ecp/common/commands/DeleteModelElementCommand.java
@@ -0,0 +1,160 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2011 Chair for Applied Software Engineering,
+ * Technische Universitaet Muenchen.
+ * 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:
+ ******************************************************************************/
+package org.eclipse.emf.ecp.common.commands;
+
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.Set;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.util.EcoreUtil;
+import org.eclipse.emf.ecp.common.model.ECPModelelementContext;
+import org.eclipse.emf.ecp.common.model.workSpaceModel.util.AssociationClassHelper;
+import org.eclipse.emf.edit.provider.ComposedAdapterFactory;
+import org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.dialogs.ProgressMonitorDialog;
+import org.eclipse.ui.PlatformUI;
+
+/**
+ * Command to delete a modelelement.
+ *
+ * @author helming
+ * @author shterev
+ */
+public final class DeleteModelElementCommand {
+
+ private final Set<EObject> toBeDeleted;
+ private final ECPModelelementContext context;
+
+ /**
+ * Default constructor.
+ *
+ * @param element the model element to be deleted.
+ * @param context the model element context
+ */
+ public DeleteModelElementCommand(EObject element, ECPModelelementContext context) {
+ this(Collections.singleton(element), context);
+ }
+
+ /**
+ * Default constructor.
+ *
+ * @param elements the model elements to be deleted.
+ * @param context the model element context
+ */
+ public DeleteModelElementCommand(Set<EObject> elements, ECPModelelementContext context) {
+ this.toBeDeleted = elements;
+ this.context = context;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void run() {
+ // remove already contained model elements to prevent double deletes -> exception
+ removeAnchestorDuplicates(toBeDeleted);
+
+ // collect all association classes to be deleted
+ Set<EObject> additionalMEs = new HashSet<EObject>();
+ for (EObject eObject : toBeDeleted) {
+ additionalMEs.addAll(AssociationClassHelper.getRelatedAssociationClassToDelete(eObject,
+ context.getMetaModelElementContext()));
+ }
+ toBeDeleted.addAll(additionalMEs);
+ // now delete
+ if (askConfirmation()) {
+ ProgressMonitorDialog progressDialog = new ProgressMonitorDialog(PlatformUI.getWorkbench()
+ .getActiveWorkbenchWindow().getShell());
+ progressDialog.open();
+ try {
+ removeElementsWithoutRoot(toBeDeleted);
+
+ if (toBeDeleted.size() > 0) {
+ new ECPCommandWithParameter<Set<EObject>>(toBeDeleted.iterator().next()) {
+
+ @Override
+ protected void doRun(Set<EObject> parameter) {
+ for (EObject eObject : toBeDeleted) {
+ EcoreUtil.delete(eObject, true);
+ }
+ }
+
+ }.run(toBeDeleted);
+ }
+ // Command deleteCommand = DeleteCommand.create(context.getEditingDomain(), toBeDeleted);
+ // context.getEditingDomain().getCommandStack().execute(deleteCommand);
+ } finally {
+ progressDialog.getProgressMonitor().done();
+ progressDialog.close();
+ }
+ }
+ }
+
+ private void removeElementsWithoutRoot(Set<EObject> toBeDeleted) {
+ HashSet<EObject> tmpRemove = new HashSet<EObject>();
+ for (EObject obj : toBeDeleted) {
+ if (obj.eContainer() == null) {
+ obj.eResource().getContents().remove(obj);
+ tmpRemove.add(obj);
+ }
+ }
+ toBeDeleted.removeAll(tmpRemove);
+ }
+
+ private void removeAnchestorDuplicates(Set<EObject> toBeDeleted) {
+ HashSet<EObject> toBeRemoved = new HashSet<EObject>();
+ for (EObject obj : toBeDeleted) {
+ if (parentIsContained(toBeDeleted, obj)) {
+ toBeRemoved.add(obj);
+ }
+ }
+ toBeDeleted.removeAll(toBeRemoved);
+ }
+
+ private boolean parentIsContained(Set<EObject> toBeDeleted, EObject obj) {
+ EObject container = obj.eContainer();
+ if (container == null) {
+ return false;
+ }
+ if (toBeDeleted.contains(container)) {
+ return true;
+ }
+ return parentIsContained(toBeDeleted, container);
+ }
+
+ private boolean askConfirmation() {
+ String question = null;
+ ComposedAdapterFactory adapterFactory = null;
+ if (toBeDeleted.size() == 1) {
+ adapterFactory = new ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry.INSTANCE);
+ AdapterFactoryLabelProvider adapterFactoryLabelProvider = new AdapterFactoryLabelProvider(
+ adapterFactory);
+ String modelElementName = adapterFactoryLabelProvider.getText(toBeDeleted.iterator().next());
+ question = "Do you really want to delete the model element " + modelElementName + "?";
+ } else {
+ question = "Do you really want to delete these " + toBeDeleted.size() + " model elements?";
+ }
+ MessageDialog dialog = new MessageDialog(null, "Confirmation", null, question, MessageDialog.QUESTION,
+ new String[] { "Yes", "No" }, 0);
+
+ boolean confirm=false;
+ if (dialog.open() == MessageDialog.OK) {
+ confirm=true;
+ }
+
+ if (adapterFactory!=null) {
+ adapterFactory.dispose();
+ }
+
+ return confirm;
+ }
+}
\ No newline at end of file
diff --git a/old/org.eclipse.emf.ecp.common/src/org/eclipse/emf/ecp/common/commands/DeleteReferenceCommand.java b/old/org.eclipse.emf.ecp.common/src/org/eclipse/emf/ecp/common/commands/DeleteReferenceCommand.java
new file mode 100644
index 0000000..58adb70
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.common/src/org/eclipse/emf/ecp/common/commands/DeleteReferenceCommand.java
@@ -0,0 +1,76 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2011 Chair for Applied Software Engineering,
+ * Technische Universitaet Muenchen.
+ * 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:
+ ******************************************************************************/
+package org.eclipse.emf.ecp.common.commands;
+
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EReference;
+import org.eclipse.emf.edit.command.RemoveCommand;
+import org.eclipse.emf.edit.command.SetCommand;
+import org.eclipse.emf.edit.domain.EditingDomain;
+
+/**
+ * Command to delete a reference.
+ *
+ * @author helming
+ * @author shterev
+ */
+public final class DeleteReferenceCommand {
+ private EReference reference;
+ private EObject modelElement;
+ private EObject opposite;
+ private final EditingDomain editingDomain;
+
+ /**
+ * Default constructor.
+ *
+ * @param modelElement the initiating modelelement
+ * @param reference the reference
+ * @param opposite the element on the other side - the element to be removed.
+ * @param editingDomain the editing domain to execute the command.
+ */
+ public DeleteReferenceCommand(EObject modelElement, EReference reference, EObject opposite,
+ EditingDomain editingDomain) {
+ this.modelElement = modelElement;
+ this.reference = reference;
+ this.opposite = opposite;
+ this.editingDomain = editingDomain;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void run() {
+ Object object = modelElement.eGet(reference);
+
+ // TODO: Ask user in the following two cases if he really wants to delete the model element
+ // if (reference.isContainer()) {
+ // opposite.getProject().addModelElement(modelElement);
+ // return;
+ // }
+ // if (reference.isContainment()) {
+ // modelElement.getProject().addModelElement(opposite);
+ // return;
+ // }
+ if (object instanceof EList<?>) {
+ @SuppressWarnings("unchecked")
+ EList<EObject> list = (EList<EObject>) object;
+ RemoveCommand removeCommand = new RemoveCommand(editingDomain, list, opposite);
+ editingDomain.getCommandStack().execute(removeCommand);
+ return;
+ } else {
+ SetCommand setCommand = new SetCommand(editingDomain, modelElement, reference, null);
+ editingDomain.getCommandStack().execute(setCommand);
+ return;
+ }
+
+ }
+}
\ No newline at end of file
diff --git a/old/org.eclipse.emf.ecp.common/src/org/eclipse/emf/ecp/common/commands/ECPCommand.java b/old/org.eclipse.emf.ecp.common/src/org/eclipse/emf/ecp/common/commands/ECPCommand.java
new file mode 100644
index 0000000..2c5ea7a
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.common/src/org/eclipse/emf/ecp/common/commands/ECPCommand.java
@@ -0,0 +1,86 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2011 Chair for Applied Software Engineering,
+ * Technische Universitaet Muenchen.
+ * 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:
+ ******************************************************************************/
+package org.eclipse.emf.ecp.common.commands;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.edit.command.ChangeCommand;
+import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain;
+import org.eclipse.emf.edit.domain.EditingDomain;
+
+/**
+ * Command capable of recording changes on a model element.
+ *
+ * @author emueller
+ */
+public abstract class ECPCommand extends ChangeCommand {
+
+ private EObject eObject;
+ private RuntimeException runtimeException;
+
+ /**
+ * Constructor.
+ *
+ * @param eObject the model element whose changes one is interested in
+ */
+ public ECPCommand(EObject eObject) {
+ super(eObject);
+ this.eObject = eObject;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.edit.ChangeCommand#doExecute()
+ */
+ @Override
+ protected final void doExecute() {
+ try {
+ doRun();
+ // BEGIN SUPRESS CATCH EXCEPTION
+ } catch (RuntimeException e) {
+ // END SUPRESS CATCH EXCEPTION
+ runtimeException = e;
+ throw e;
+ }
+ }
+
+ /**
+ * The actual action that is being executed.
+ */
+ protected abstract void doRun();
+
+ /**
+ * Executes the command.
+ *
+ * @param ignoreExceptions true if any thrown exception in the execution of the command should be ignored.
+ */
+ public void run(boolean ignoreExceptions) {
+ runtimeException = null;
+
+ EditingDomain domain = AdapterFactoryEditingDomain.getEditingDomainFor(eObject);
+ domain.getCommandStack().execute(this);
+
+ if (!ignoreExceptions && runtimeException != null) {
+ throw runtimeException;
+ }
+ }
+
+ /**
+ * Executes the command.
+ *
+ * @deprecated use run(boolean) instead.
+ */
+ @Deprecated
+ public void run() {
+ run(true);
+ }
+
+}
\ No newline at end of file
diff --git a/old/org.eclipse.emf.ecp.common/src/org/eclipse/emf/ecp/common/commands/ECPCommandWithParameter.java b/old/org.eclipse.emf.ecp.common/src/org/eclipse/emf/ecp/common/commands/ECPCommandWithParameter.java
new file mode 100644
index 0000000..c3bbc20
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.common/src/org/eclipse/emf/ecp/common/commands/ECPCommandWithParameter.java
@@ -0,0 +1,80 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2011 Chair for Applied Software Engineering,
+ * Technische Universitaet Muenchen.
+ * 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:
+ ******************************************************************************/
+package org.eclipse.emf.ecp.common.commands;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.edit.command.ChangeCommand;
+import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain;
+import org.eclipse.emf.edit.domain.EditingDomain;
+
+/**
+ * Command capable of recording changes on a model element.
+ * @param <T> the type of the parameter
+ *
+ * @author koegel
+ */
+public abstract class ECPCommandWithParameter<T> extends ChangeCommand {
+
+ private EObject eObject;
+ private RuntimeException runtimeException;
+ private T parameter;
+
+ /**
+ * Constructor.
+ *
+ * @param eObject the model element whose changes one is interested in
+ */
+ public ECPCommandWithParameter(EObject eObject) {
+ super(eObject);
+ this.eObject = eObject;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.edit.ChangeCommand#doExecute()
+ */
+ @Override
+ protected final void doExecute() {
+ try {
+ doRun(parameter);
+ // BEGIN SUPRESS CATCH EXCEPTION
+ } catch (RuntimeException e) {
+ // END SUPRESS CATCH EXCEPTION
+ runtimeException = e;
+ throw e;
+ }
+ }
+
+ /**
+ * The actual action that is being executed.
+ *
+ * @param parameter the parameter of type T
+ */
+ protected abstract void doRun(T parameter);
+
+ /**
+ * Executes the command.
+ *
+ * @param parameter the parameter
+ */
+ public void run(T parameter) {
+ runtimeException = null;
+
+ this.parameter=parameter;
+ EditingDomain domain = AdapterFactoryEditingDomain.getEditingDomainFor(eObject);
+ domain.getCommandStack().execute(this);
+
+ if (runtimeException != null) {
+ throw runtimeException;
+ }
+ }
+}
\ No newline at end of file
diff --git a/old/org.eclipse.emf.ecp.common/src/org/eclipse/emf/ecp/common/commands/ECPCommandWithResult.java b/old/org.eclipse.emf.ecp.common/src/org/eclipse/emf/ecp/common/commands/ECPCommandWithResult.java
new file mode 100644
index 0000000..f0936cb
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.common/src/org/eclipse/emf/ecp/common/commands/ECPCommandWithResult.java
@@ -0,0 +1,81 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2011 Chair for Applied Software Engineering,
+ * Technische Universitaet Muenchen.
+ * 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:
+ ******************************************************************************/
+package org.eclipse.emf.ecp.common.commands;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.edit.command.ChangeCommand;
+import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain;
+import org.eclipse.emf.edit.domain.EditingDomain;
+
+/**
+ * Command capable of recording changes on a model element.
+ * @param <T> the type of the return value
+ *
+ * @author koegel
+ */
+public abstract class ECPCommandWithResult<T> extends ChangeCommand {
+
+ private EObject eObject;
+ private RuntimeException runtimeException;
+ private T result;
+
+ /**
+ * Constructor.
+ *
+ * @param eObject the model element whose changes one is interested in
+ */
+ public ECPCommandWithResult(EObject eObject) {
+ super(eObject);
+ this.eObject = eObject;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.edit.ChangeCommand#doExecute()
+ */
+ @Override
+ protected final void doExecute() {
+ try {
+ result = doRun();
+ // BEGIN SUPRESS CATCH EXCEPTION
+ } catch (RuntimeException e) {
+ // END SUPRESS CATCH EXCEPTION
+ runtimeException = e;
+ throw e;
+ }
+ }
+
+ /**
+ * The actual action that is being executed.
+ *
+ * @return the result of type T
+ */
+ protected abstract T doRun();
+
+ /**
+ * Executes the command.
+ *
+ * @return the result of type T
+ */
+ public T run() {
+ runtimeException = null;
+
+ EditingDomain domain = AdapterFactoryEditingDomain.getEditingDomainFor(eObject);
+ domain.getCommandStack().execute(this);
+
+ if (runtimeException != null) {
+ throw runtimeException;
+ }
+ return result;
+ }
+
+}
\ No newline at end of file
diff --git a/old/org.eclipse.emf.ecp.common/src/org/eclipse/emf/ecp/common/commands/ECPMenuContributionsEnablementTester.java b/old/org.eclipse.emf.ecp.common/src/org/eclipse/emf/ecp/common/commands/ECPMenuContributionsEnablementTester.java
new file mode 100644
index 0000000..bd21da9
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.common/src/org/eclipse/emf/ecp/common/commands/ECPMenuContributionsEnablementTester.java
@@ -0,0 +1,59 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2011 Chair for Applied Software Engineering,
+ * Technische Universitaet Muenchen.
+ * 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:
+ ******************************************************************************/
+package org.eclipse.emf.ecp.common.commands;
+
+import org.eclipse.core.expressions.PropertyTester;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.Platform;
+
+/**
+ * Tests the enablement of ECP Menu contributions. The contributions are enabled by default and can be disabled by an extension point.
+ * @author koegel
+ *
+ */
+public class ECPMenuContributionsEnablementTester extends PropertyTester {
+
+
+ /**
+ * {@inheritDoc}
+ * @see org.eclipse.core.expressions.IPropertyTester#test(java.lang.Object, java.lang.String, java.lang.Object[], java.lang.Object)
+ */
+ public boolean test(Object receiver, String property, Object[] args, Object expectedValue) {
+
+ if (expectedValue instanceof Boolean) {
+ //default behavior, display menu contribution
+ Boolean menuContributionEnabled = true;
+ //fetch contribution configuration
+ IConfigurationElement[] elements = Platform.getExtensionRegistry().getConfigurationElementsFor(
+ "org.eclipse.emf.ecp.common.menuContributionEnablement");
+ if (elements != null && elements.length > 0) {
+ IConfigurationElement configurationElement = elements[0];
+ // fetch configured default option. true = blacklist; false = whitelist
+ menuContributionEnabled = Boolean.parseBoolean(configurationElement.getAttribute("enabled"));
+ // iterate over configured exceptions
+ for (IConfigurationElement child: configurationElement.getChildren()) {
+ String commandID = child.getAttribute("commandID");
+ //if blacklist & command on list -> block
+ if(menuContributionEnabled && args[0].equals(commandID)) {
+ return expectedValue.equals(false);
+ // if whitelist & command on list -> don't block
+ } else if(!menuContributionEnabled && args[0].equals(commandID)) {
+ return expectedValue.equals(true);
+ }
+ }
+ }
+
+ return expectedValue.equals(menuContributionEnabled);
+ }
+ return false;
+ }
+
+}
\ No newline at end of file
diff --git a/old/org.eclipse.emf.ecp.common/src/org/eclipse/emf/ecp/common/dialogs/ModelElementSelectionDialog.java b/old/org.eclipse.emf.ecp.common/src/org/eclipse/emf/ecp/common/dialogs/ModelElementSelectionDialog.java
new file mode 100644
index 0000000..d92c070
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.common/src/org/eclipse/emf/ecp/common/dialogs/ModelElementSelectionDialog.java
@@ -0,0 +1,307 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2011 Chair for Applied Software Engineering,
+ * Technische Universitaet Muenchen.
+ * 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:
+ ******************************************************************************/
+package org.eclipse.emf.ecp.common.dialogs;
+
+import java.util.Collection;
+import java.util.Comparator;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecp.common.Activator;
+import org.eclipse.emf.ecp.common.model.ECPModelelementContext;
+import org.eclipse.emf.edit.provider.ComposedAdapterFactory;
+import org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider;
+import org.eclipse.jface.dialogs.IDialogSettings;
+import org.eclipse.jface.viewers.ILabelProvider;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.dialogs.FilteredItemsSelectionDialog;
+
+/**
+ * Abstract Dialog as pattern for all dialogs which show ModelElements for selection. A
+ *
+ * @author mkagel
+ */
+public abstract class ModelElementSelectionDialog extends FilteredItemsSelectionDialog {
+
+ private static final String DIALOG_SETTINGS = "STANDARD_DIALOG_SETTING";
+ private static final String DIALOG_MESSAGE = "Enter model element name prefix or pattern (e.g. *Trun?)";
+ private static final String DIALOG_TITLE = "Search Model Element";
+ private static final String DIALOG_INITIAL_PATTERN = "**";
+
+ private ILabelProvider labelProvider;
+ private Collection<EObject> modelElements;
+ private ComposedAdapterFactory adapterFactory;
+
+ /**
+ * Constructor which calls another constructor with parameter false for multiple selection of elements.
+ */
+ public ModelElementSelectionDialog() {
+ this(false);
+ }
+
+ /**
+ * Contructor which calls another constructor with project parameter and false for multiple selection of elements.
+ *
+ * @param context the context
+ */
+ public ModelElementSelectionDialog(ECPModelelementContext context) {
+ this(context, false);
+ }
+
+ /**
+ * Constructor which calls another constructor with null for project paramter (modelelemnts will be set from
+ * outside) and the given multiSelection behaviour.
+ *
+ * @param multiSelection indicates whether dialog allows to select more than one item
+ */
+ public ModelElementSelectionDialog(boolean multiSelection) {
+ this(null, multiSelection);
+ }
+
+ /**
+ * Default constructor, here will be done the main work.
+ *
+ * @param context The context from where the model elements come from, is null if no context is set an the model
+ * elements come from outside the dialog
+ * @param multiSelection indicates whether dialog allows to select more than one item
+ */
+ public ModelElementSelectionDialog(ECPModelelementContext context, boolean multiSelection) {
+
+ super(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), multiSelection);
+
+ if (context != null) {
+ modelElements = context.getAllModelElements();
+ }
+
+ setLabelProvider(createLabelProvider());
+ this.setListLabelProvider(getLabelProvider());
+ this.setDetailsLabelProvider(getLabelProvider());
+
+ this.setBlockOnOpen(true);
+ this.setTitle(DIALOG_TITLE);
+ this.setMessage(DIALOG_MESSAGE);
+ this.setInitialPattern(DIALOG_INITIAL_PATTERN);
+ }
+
+ /**
+ * Constructor which calls another constructor and sets the model elements collection of the dialog only to a
+ * specified class type.
+ *
+ * @param context from where the model elements come from
+ * @param classType which should be shown in the dialog
+ * @param multiSelection indicates whether dialog allows to select more than one item
+ */
+ public ModelElementSelectionDialog(ECPModelelementContext context, EClass classType, boolean multiSelection) {
+ this(multiSelection);
+ modelElements = context.getAllModelElementsbyClass(classType, true);
+ }
+
+ /**
+ * Constructor which calls another constructor.
+ *
+ * @param context from where the model elements come from
+ * @param classType of the model elements which should be shown in the dialog
+ */
+ public ModelElementSelectionDialog(ECPModelelementContext context, EClass classType) {
+ this(context, classType, false);
+ }
+
+ /**
+ * Creates a new label provider to be used for this dialog.
+ *
+ * @return a label provider for the dialog
+ */
+ protected ILabelProvider createLabelProvider() {
+ adapterFactory = new ComposedAdapterFactory(
+ ComposedAdapterFactory.Descriptor.Registry.INSTANCE);
+ return new AdapterFactoryLabelProvider(adapterFactory);
+ }
+
+
+ @Override
+ public boolean close() {
+ adapterFactory.dispose();
+ return super.close();
+ }
+
+ /**
+ * Sets the labelProvider.
+ *
+ * @param labelProvider is the labelProvider for this class
+ */
+ public void setLabelProvider(ILabelProvider labelProvider) {
+ this.labelProvider = labelProvider;
+ }
+
+ /**
+ * Returns the LabelProvider for this class.
+ *
+ * @return labelProvider
+ */
+ public ILabelProvider getLabelProvider() {
+ return labelProvider;
+ }
+
+ /**
+ * Returns the ModelElement-Collection which contains the modelelements shown in the dialog.
+ *
+ * @return Collection of modelelements for the dialog
+ */
+ public Collection<EObject> getModelElements() {
+ return modelElements;
+ }
+
+ /**
+ * Set the ModelElement-Collection from outside. Necessary if the collection is not set by the dialog but coms from
+ * the caller.
+ *
+ * @param modelElements Collection which modelelements which will be shown in the dialog
+ */
+ public void setModelElements(Collection<EObject> modelElements) {
+ this.modelElements = modelElements;
+ }
+
+ /**
+ * Does nothing.
+ *
+ * @param parent the parent
+ * @return null
+ */
+ @Override
+ protected Control createExtendedContentArea(Composite parent) {
+ return null;
+ }
+
+ /**
+ * Returns a new instance of class ModelElementFilter.
+ *
+ * @return new instance of class ModelElementFilter
+ */
+ @Override
+ protected ItemsFilter createFilter() {
+ return new ModelElementFilter();
+ }
+
+ /**
+ * Fills the content provider with all elements matching the items filter.
+ *
+ * @param contentProvider the content provider which gets added the items
+ * @param itemsFilter the used items filter
+ * @param progressMonitor a progress monitor stating the progress
+ */
+ @Override
+ protected void fillContentProvider(AbstractContentProvider contentProvider, ItemsFilter itemsFilter,
+ IProgressMonitor progressMonitor) {
+
+ progressMonitor.beginTask("Searching", modelElements.size());
+ for (EObject modelElement : modelElements) {
+ contentProvider.add(modelElement, itemsFilter);
+ progressMonitor.worked(1);
+ }
+ progressMonitor.done();
+ }
+
+ /**
+ * Gets the dialog settings.
+ *
+ * @return the dialog settings
+ */
+ @Override
+ protected IDialogSettings getDialogSettings() {
+ IDialogSettings settings = Activator.getDefault().getDialogSettings().getSection(DIALOG_SETTINGS);
+ if (settings == null) {
+ settings = Activator.getDefault().getDialogSettings().addNewSection(DIALOG_SETTINGS);
+ }
+ return settings;
+ }
+
+ /**
+ * Gets the name of an element by asking the labelProvider.
+ *
+ * @return the name as provided by the labelProvider
+ * @param item the element to get the name from
+ */
+ @Override
+ public String getElementName(Object item) {
+ if (item instanceof EObject) {
+ return getLabelProvider().getText(item);
+ } else {
+ return item.toString();
+ }
+ }
+
+ /**
+ * Returns an alphabetical comparator.
+ *
+ * @return an alphabetical comparator
+ */
+ @Override
+ protected Comparator<EObject> getItemsComparator() {
+ return new Comparator<EObject>() {
+ public int compare(EObject arg0, EObject arg1) {
+ return arg0.toString().compareTo(arg1.toString());
+ }
+ };
+ }
+
+ /**
+ * Always returns Status.OK_STATUS.
+ *
+ * @return Status.OK_STATUS
+ * @param item an item
+ */
+ @Override
+ protected IStatus validateItem(Object item) {
+ return Status.OK_STATUS;
+ }
+
+ /**
+ * A filter class for model elements.
+ *
+ * @author mkagel
+ */
+ public class ModelElementFilter extends ItemsFilter {
+
+ /**
+ * @param item the item
+ * @return true
+ * @see org.eclipse.ui.dialogs.FilteredItemsSelectionDialog.ItemsFilter#isConsistentItem(java.lang.Object)
+ */
+ @Override
+ public boolean isConsistentItem(Object item) {
+ return true;
+ }
+
+ /**
+ * Matches ModelElement's toString Methods.
+ *
+ * @param item an WorkPackage
+ * @return bool
+ * @see org.eclipse.ui.dialogs.FilteredItemsSelectionDialog.ItemsFilter#matchItem(java.lang.Object)
+ */
+ @Override
+ public boolean matchItem(Object item) {
+ String label = getLabelProvider().getText(item);
+
+ if (!patternMatcher.getPattern().startsWith("*")) {
+ this.patternMatcher.setPattern("*" + patternMatcher.getPattern() + "*");
+ }
+
+ return matches(label);
+ }
+ }
+
+}
\ No newline at end of file
diff --git a/old/org.eclipse.emf.ecp.common/src/org/eclipse/emf/ecp/common/dialogs/SearchModelElementDialog.java b/old/org.eclipse.emf.ecp.common/src/org/eclipse/emf/ecp/common/dialogs/SearchModelElementDialog.java
new file mode 100644
index 0000000..d8d03d2
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.common/src/org/eclipse/emf/ecp/common/dialogs/SearchModelElementDialog.java
@@ -0,0 +1,55 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2011 Chair for Applied Software Engineering,
+ * Technische Universitaet Muenchen.
+ * 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:
+ ******************************************************************************/
+package org.eclipse.emf.ecp.common.dialogs;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecp.common.model.ECPWorkspaceManager;
+import org.eclipse.emf.ecp.common.model.workSpaceModel.ECPProject;
+
+/**
+ * Dialog to select model elements.
+ *
+ * @author mkagel
+ */
+public class SearchModelElementDialog extends ModelElementSelectionDialog {
+
+ /**
+ * The constructor.
+ *
+ * @param project the project, which contains all the model elements that can be searched for
+ */
+ public SearchModelElementDialog(ECPProject project) {
+ super(project);
+ }
+
+ /**
+ * Fills the content provider with all elements matching the items filter.
+ *
+ * @param contentProvider the content provider which gets added the items
+ * @param itemsFilter the used items filter
+ * @param progressMonitor a progress monitor stating the progress
+ */
+ @Override
+ protected void fillContentProvider(AbstractContentProvider contentProvider, ItemsFilter itemsFilter,
+ IProgressMonitor progressMonitor) {
+
+ progressMonitor.beginTask("Searching", getModelElements().size());
+ for (EObject modelElement : getModelElements()) {
+ ECPProject project = ECPWorkspaceManager.getECPProject(modelElement);
+ if (!(project.getMetaModelElementContext().isNonDomainElement(modelElement.eClass()))) {
+ contentProvider.add(modelElement, itemsFilter);
+ progressMonitor.worked(1);
+ }
+ }
+ progressMonitor.done();
+ }
+}
\ No newline at end of file
diff --git a/old/org.eclipse.emf.ecp.common/src/org/eclipse/emf/ecp/common/dnd/ComposedDropAdapter.java b/old/org.eclipse.emf.ecp.common/src/org/eclipse/emf/ecp/common/dnd/ComposedDropAdapter.java
new file mode 100644
index 0000000..7804e27
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.common/src/org/eclipse/emf/ecp/common/dnd/ComposedDropAdapter.java
@@ -0,0 +1,364 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2011 Chair for Applied Software Engineering,
+ * Technische Universitaet Muenchen.
+ * 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:
+ ******************************************************************************/
+package org.eclipse.emf.ecp.common.dnd;
+
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EcorePackage;
+import org.eclipse.emf.ecp.common.Activator;
+import org.eclipse.emf.ecp.common.commands.ECPCommand;
+import org.eclipse.emf.ecp.common.model.ECPWorkspaceManager;
+import org.eclipse.emf.ecp.common.model.NoWorkspaceException;
+import org.eclipse.emf.ecp.common.model.workSpaceModel.ECPProject;
+import org.eclipse.jface.viewers.StructuredViewer;
+import org.eclipse.swt.dnd.DND;
+import org.eclipse.swt.dnd.DropTargetAdapter;
+import org.eclipse.swt.dnd.DropTargetEvent;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.widgets.TreeItem;
+
+/**
+ * This is the central drop adapter for ECP views. This class acts as a
+ * dispatcher. It has a map of (EClass, MEDropAdapter) which contains a
+ * reference to a specific drop adapter for each model element type.
+ *
+ * @author Hodaie
+ */
+public class ComposedDropAdapter extends DropTargetAdapter {
+
+ private StructuredViewer viewer;
+
+ private List<EObject> source;
+ private EObject target;
+ private EObject targetConatiner;
+ private EObject dropee;
+
+ private Map<EClass, MEDropAdapter> dropAdapters;
+
+ /**
+ * this is used for performance, so that drop method do not need to find the
+ * appropriate drop adapter again.
+ */
+ private MEDropAdapter targetDropAdapter;
+
+ /**
+ * Actually I should be able to get event feedback from event.feedback But
+ * the problem is, the event feedback is correctly set in dragOver() method,
+ * but in drop() method it is set to 1 (only selection). That's why I save
+ * event feedback at the end of dragOver() in a variable, and check this
+ * variable in drop() instead of event.feedback
+ */
+ private int eventFeedback;
+
+ private boolean targetIsRoot;
+
+ /**
+ * Constructor.
+ *
+ * @param viewer
+ * viewer
+ */
+ public ComposedDropAdapter(StructuredViewer viewer) {
+
+ super();
+ this.viewer = viewer;
+
+ dropAdapters = new HashMap<EClass, MEDropAdapter>();
+ IConfigurationElement[] confs = Platform.getExtensionRegistry().getConfigurationElementsFor(
+ "org.eclipse.emf.ecp.common.dropadapter");
+ for (IConfigurationElement element : confs) {
+ try {
+ MEDropAdapter dropAdapter = (MEDropAdapter) element.createExecutableExtension("class");
+ dropAdapter.init(viewer);
+ dropAdapters.put(dropAdapter.isDropAdapterfor(), dropAdapter);
+
+ } catch (CoreException e) {
+ Activator.getDefault().logException(e.getMessage(), e);
+ }
+ }
+
+ }
+
+ /**
+ * @param event
+ * DropTargetEvent
+ */
+ @Override
+ public void drop(final DropTargetEvent event) {
+
+ new ECPCommand(target) {
+
+ @Override
+ protected void doRun() {
+ if (targetIsRoot) {
+ try {
+ ECPProject project = ECPWorkspaceManager.getInstance().getWorkSpace().getProject(target);
+ for (EObject obj : source) {
+ project.addModelElementToRoot(obj);
+ }
+ } catch (NoWorkspaceException e) {
+ }
+ } else if (isInsertAfter(eventFeedback)) {
+ targetDropAdapter.dropMove(targetConatiner, target, source, true);
+ } else if (isInsertBefore(eventFeedback)) {
+ targetDropAdapter.dropMove(targetConatiner, target, source, false);
+ } else {
+ targetDropAdapter.drop(event, target, source);
+ }
+
+ }
+
+ }.run(true);
+
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void dragOver(DropTargetEvent event) {
+ source = null;
+ target = null;
+ targetConatiner = null;
+ targetDropAdapter = null;
+ targetIsRoot = false;
+ eventFeedback = 1;
+
+ event.detail = DND.DROP_COPY;
+ if (!extractDnDSourceAndTarget(event)) {
+ event.detail = DND.DROP_NONE;
+ return;
+ }
+
+ if (targetIsRoot) {
+ event.detail = DND.DROP_NONE;
+ return;
+ }
+
+ setInitialEventFeedback(event);
+ eventFeedback = event.feedback;
+
+ if ((isInsertBefore(eventFeedback) || isInsertAfter(eventFeedback)) && target.eContainer() != null) {
+ targetConatiner = target.eContainer();
+ targetDropAdapter = getTargetDropAdapter(targetConatiner.eClass());
+
+ } else {
+ targetDropAdapter = getTargetDropAdapter(target.eClass());
+
+ }
+ if (targetDropAdapter == null) {
+ event.detail = DND.DROP_NONE;
+ } else if (!targetDropAdapter.canDrop(eventFeedback, event, source, target, dropee)) {
+ event.detail = DND.Drop;
+ } else if (targetDropAdapter.canDrop(eventFeedback, event, source, target, dropee)) {
+ event.detail = DND.DROP_COPY;
+ }
+
+ }
+
+ /**
+ * This is called continually from dragOver() event handler. This checks
+ * drop target and drop source to be not Null, and sets the target, source,
+ * and dropee fields.
+ *
+ * @param event
+ * DropTargetEvent
+ * @return
+ */
+ @SuppressWarnings("unchecked")
+ private boolean extractDnDSourceAndTarget(DropTargetEvent event) {
+ boolean result = true;
+ List<Object> tmpSource = (List<Object>) DragSourcePlaceHolder.getDragSource();
+ if (tmpSource == null) {
+ result = false;
+ }
+
+ for (Object obj : tmpSource) {
+ if (!(obj instanceof EObject)) {
+ result = false;
+ }
+ }
+
+ source = (List<EObject>) DragSourcePlaceHolder.getDragSource();
+ if (source.size() == 0) {
+ return false;
+ }
+
+ // take care that you cannot drop anything on project (project is not a
+ // ModelElement)
+ if (event.item == null || event.item.getData() == null || !(event.item.getData() instanceof EObject)) {
+ result = false;
+ }
+
+ // TODO: ChainSaw - How to retrieve the ECPProject of target and dropee?
+ // check if source and target are in the same project
+
+ if (result) {
+ dropee = source.get(0);
+ target = (EObject) event.item.getData();
+ ECPProject targetProject = null;
+ ECPProject dropeeProject = null;
+ try {
+ targetProject = ECPWorkspaceManager.getInstance().getWorkSpace().getProject(target);
+ dropeeProject = ECPWorkspaceManager.getInstance().getWorkSpace().getProject(dropee);
+ if (targetProject.getRootObject() == target) {
+ targetIsRoot = true;
+ }
+ } catch (NoWorkspaceException e) {
+ Activator.getDefault().logException(e);
+ result = false;
+ }
+
+ if (!targetProject.equals(dropeeProject)) {
+ result = false;
+ }
+ }
+
+ return result;
+ }
+
+ /**
+ * This method searches drop adaptors map recursively to find the
+ * appropriate drop adapter for this model element type or one of its super
+ * types in model hierarchy.
+ *
+ * @param targetEClass
+ * @return specific drop target for this model element type or one of its
+ * super types in model hierarchy.
+ */
+ private MEDropAdapter getTargetDropAdapter(EClass targetEClass) {
+
+ MEDropAdapter ret = dropAdapters.get(targetEClass);
+ if (ret == null) {
+ EClass superTypeHavingADropAdapter = getSuperTypeHavingADropAdapter(targetEClass.getESuperTypes());
+ if (superTypeHavingADropAdapter != null && superTypeHavingADropAdapter != targetEClass) {
+ ret = getTargetDropAdapter(superTypeHavingADropAdapter);
+ }
+ }
+
+ return ret;
+ }
+
+ /**
+ * This is used by getDropTarget() method. It takes super classes of
+ * targetEClass and tries to find a unique drop adapter that matches one of
+ * super types. If there are more than one matching drop adapters, an
+ * exception is thrown. If there is no matching drop adapter, this method
+ * searches recursively until it finds one, or throws the exception.
+ *
+ * @param superClazz
+ * super classes of targetEClass. If there is no match at the
+ * first call of method, this will be a collection of super
+ * classes of each input super class.
+ * @return an EClass that is both super class of targetEClass (directly of
+ * indirectly) and has a drop adapter.
+ */
+ private EClass getSuperTypeHavingADropAdapter(Collection<EClass> superClazz) {
+
+ EClass ret = null;
+ if (superClazz.size() == 0) {
+ return EcorePackage.eINSTANCE.getEObject();
+ }
+
+ Set<EClass> intersection = new HashSet<EClass>(dropAdapters.keySet());
+ intersection.retainAll(superClazz);
+
+ // check if intersection contains many classes, but if they are in an
+ // inheritance hierarchy keep only the
+ // deepest class.
+ // This must be discussed as a potential modeling problem.
+
+ if (intersection.size() > 1) {
+ Set<EClass> toBeRemoved = new HashSet<EClass>();
+ for (EClass eClass1 : intersection) {
+ for (EClass eClass2 : intersection) {
+ if (!eClass2.equals(eClass1)
+ && (eClass2.isSuperTypeOf(eClass1) || eClass2.equals(EcorePackage.eINSTANCE.getEObject()))) {
+ toBeRemoved.add(eClass2);
+ }
+ }
+ }
+ intersection.removeAll(toBeRemoved);
+ }
+
+ if (intersection.size() > 1) {
+ throw new IllegalStateException("More than one drop adapter for this type found!");
+
+ } else if (intersection.size() == 0) {
+ Set<EClass> eclazz = new HashSet<EClass>();
+ for (EClass superClass : superClazz) {
+ eclazz.addAll(superClass.getESuperTypes());
+ }
+ ret = getSuperTypeHavingADropAdapter(eclazz);
+ } else {
+ ret = (EClass) intersection.toArray()[0];
+ }
+
+ return ret;
+ }
+
+ /**
+ * This sets the initial event feedback, and is also responsible for showing
+ * INSERT_AFTER and INSERT_BEFORE feedbacks according to mouse cursor
+ * position.
+ *
+ * @param event
+ * DropTargetEvent
+ */
+ private void setInitialEventFeedback(DropTargetEvent event) {
+ event.feedback = DND.FEEDBACK_SELECT;
+
+ if (event.item != null) {
+ Rectangle rect = ((TreeItem) event.item).getBounds();
+ Point pt = viewer.getControl().toControl(event.x, event.y);
+ if (pt.y < rect.y + 5) {
+ event.feedback = DND.FEEDBACK_INSERT_BEFORE;
+ }
+ if (pt.y > rect.y + rect.height - 5) {
+ event.feedback = DND.FEEDBACK_INSERT_AFTER;
+ }
+
+ }
+ event.feedback |= DND.FEEDBACK_SCROLL | DND.FEEDBACK_EXPAND;
+
+ }
+
+ /**
+ * Checks whether event feedback is a {@link DND#FEEDBACK_INSERT_BEFORE} event.
+ *
+ * @param eventFeedback DropTarget drag under effect
+ * @return true if the event feedback is a {@value DND#FEEDBACK_INSERT_BEFORE} event, false otherwise
+ */
+ public static boolean isInsertBefore(int eventFeedback) {
+ return (eventFeedback & DND.FEEDBACK_INSERT_BEFORE) == DND.FEEDBACK_INSERT_BEFORE;
+ }
+
+ /**
+ * Checks whether event feedback is a {@link DND#FEEDBACK_INSERT_AFTER} event.
+ *
+ * @param eventFeedback DropTarget drag under effect
+ * @return true if the event feedback is a {@value DND#FEEDBACK_INSERT_AFTER} event, false otherwise
+ */
+ public static boolean isInsertAfter(int eventFeedback) {
+ return (eventFeedback & DND.FEEDBACK_INSERT_AFTER) == DND.FEEDBACK_INSERT_AFTER;
+ }
+}
\ No newline at end of file
diff --git a/old/org.eclipse.emf.ecp.common/src/org/eclipse/emf/ecp/common/dnd/DefaultMEDropAdapter.java b/old/org.eclipse.emf.ecp.common/src/org/eclipse/emf/ecp/common/dnd/DefaultMEDropAdapter.java
new file mode 100644
index 0000000..9dfefe6
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.common/src/org/eclipse/emf/ecp/common/dnd/DefaultMEDropAdapter.java
@@ -0,0 +1,33 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2011 Chair for Applied Software Engineering,
+ * Technische Universitaet Muenchen.
+ * 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:
+ ******************************************************************************/
+package org.eclipse.emf.ecp.common.dnd;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EcorePackage;
+
+/**
+ * Default Drag and Drop Adapter for all Model elements.
+ *
+ * @author koegel
+ */
+public class DefaultMEDropAdapter extends MEDropAdapter {
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.ecp.common.dnd.MEDropAdapter#isDropAdapterfor()
+ */
+ @Override
+ public EClass isDropAdapterfor() {
+ return EcorePackage.eINSTANCE.getEObject();
+ }
+
+}
\ No newline at end of file
diff --git a/old/org.eclipse.emf.ecp.common/src/org/eclipse/emf/ecp/common/dnd/DragSourcePlaceHolder.java b/old/org.eclipse.emf.ecp.common/src/org/eclipse/emf/ecp/common/dnd/DragSourcePlaceHolder.java
new file mode 100644
index 0000000..5ad4acc
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.common/src/org/eclipse/emf/ecp/common/dnd/DragSourcePlaceHolder.java
@@ -0,0 +1,79 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2011 Chair for Applied Software Engineering,
+ * Technische Universitaet Muenchen.
+ * 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:
+ ******************************************************************************/
+package org.eclipse.emf.ecp.common.dnd;
+
+import java.util.List;
+
+/**
+ * This class is just a temporary location to hold dragSource in a DnD operation. Typically we should not have used such
+ * a class to keep track of dragSource. Instead, one should use a transfer class. This is not the case because of the following:
+ *
+ * <ol>
+ * <li>Using a transfer is not guaranteed to work on all platforms and always.</li>
+ * <li>On platforms other than Windows, dragSource is not set until drop event fires and we need dragSource during events like dragOver</li>
+ * <li>We are not planning to drop something out of ECP environment, i.e. form ECP navigator on file system.</li>
+ * </ol>
+ *
+ * This class is intended to be used as a singleton.
+ *
+ * @author Hodaie
+ */
+public final class DragSourcePlaceHolder {
+
+ private static Object dragSource;
+
+ /**
+ * Initializes the singleton instance statically.
+ */
+ private static class SingletonHolder {
+ public static final DragSourcePlaceHolder INSTANCE = new DragSourcePlaceHolder();
+ }
+
+ /**
+ * Returns the singleton instance.
+ *
+ * @return The DragSourcePlaceHolder instance
+ */
+ public static DragSourcePlaceHolder getInstance() {
+ return SingletonHolder.INSTANCE;
+ }
+
+ /**
+ * Private constructor.
+ */
+ private DragSourcePlaceHolder() {
+
+ }
+
+ /**
+ * This method will be called from drag adaptors, in dragStart() event. This sets the drag source on which initially
+ * the drag started. This can be a single object of a collection.
+ *
+ * @param dragSource the drag source
+ */
+ @SuppressWarnings("rawtypes")
+ public static void setDragSource(Object dragSource) {
+ if ((dragSource instanceof List) && ((List) dragSource).size() == 0) {
+ DragSourcePlaceHolder.dragSource = null;
+ }
+ DragSourcePlaceHolder.dragSource = dragSource;
+ }
+
+ /**
+ * This will be called from drop adaptors to get the drag source.
+ *
+ * @return drag source; object(s) on which drag started
+ */
+ public static Object getDragSource() {
+ return dragSource;
+ }
+
+}
\ No newline at end of file
diff --git a/old/org.eclipse.emf.ecp.common/src/org/eclipse/emf/ecp/common/dnd/MEDropAdapter.java b/old/org.eclipse.emf.ecp.common/src/org/eclipse/emf/ecp/common/dnd/MEDropAdapter.java
new file mode 100644
index 0000000..d5dd3f7
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.common/src/org/eclipse/emf/ecp/common/dnd/MEDropAdapter.java
@@ -0,0 +1,419 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2011 Chair for Applied Software Engineering,
+ * Technische Universitaet Muenchen.
+ * 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:
+ ******************************************************************************/
+package org.eclipse.emf.ecp.common.dnd;
+
+import java.util.List;
+
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EReference;
+import org.eclipse.emf.ecore.util.EcoreUtil;
+import org.eclipse.jface.viewers.StructuredViewer;
+import org.eclipse.swt.dnd.DND;
+import org.eclipse.swt.dnd.DropTargetEvent;
+
+/**
+ * This is the super class for all model element specific drop adapters. We can
+ * consider this class as if ModelElement was drop target.
+ *
+ * @author Hodaie
+ */
+public abstract class MEDropAdapter {
+
+ private StructuredViewer viewer;
+
+ /**
+ * Constructor.
+ */
+ public MEDropAdapter() {
+
+ }
+
+ /**
+ * Initializes the adapter.
+ *
+ * @param viewer
+ * the viewer
+ */
+ public void init(StructuredViewer viewer) {
+ this.viewer = viewer;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @param source
+ * @param target
+ */
+
+ public void drop(DropTargetEvent event, EObject target, List<EObject> source) {
+
+ dropContainment(target, source);
+
+ }
+
+ /**
+ * Determine the class the Drop adapter is for.
+ *
+ * @return the EClass
+ */
+ public abstract EClass isDropAdapterfor();
+
+ /**
+ * @param targetContainer
+ * target's container
+ * @param target
+ * target
+ * @param source
+ * source
+ */
+ @SuppressWarnings("unchecked")
+ protected void dropAfter(EObject targetContainer, EObject target, List<EObject> source) {
+
+ int targetIndex;
+ EReference theRef = getTargetRef(targetContainer, source.get(0));
+ if (theRef == null) {
+ return;
+ }
+
+ Object object = targetContainer.eGet(theRef);
+ EList<EObject> eList = (EList<EObject>) object;
+ if (eList != null) {
+ targetIndex = eList.indexOf(target);
+ } else {
+ targetIndex = -1;
+ }
+
+ if (targetIndex == -1) {
+ return;
+ }
+
+ if (haveSameEContainer(target, source.get(0))) {
+ // if we are moving some children within the same parent
+ int sourceIndex = eList.indexOf(source.get(0));
+ if (sourceIndex >= 0 && sourceIndex < targetIndex) {
+ targetIndex--;
+ }
+ for (int i = source.size() - 1; i >= 0; i--) {
+ eList.move(targetIndex + 1, source.get(i));
+ }
+
+ } else {
+ // if we are moving some children from another parent here.
+ eList.addAll(targetIndex + 1, source);
+ }
+ }
+
+ /**
+ * This will be used by drop after and drop before. This returns the
+ * EReference of container of the target, matching type of source.
+ *
+ * @param targetContainer
+ * drop target container
+ * @param dropee
+ * first element drag source
+ * @return the reference within container of target, which matches source.
+ * (Have in mind that we are moving elements within container of
+ * target.)
+ */
+ protected EReference getTargetRef(EObject targetContainer, EObject dropee) {
+
+ List<EReference> refs = targetContainer.eClass().getEAllContainments();
+ for (EReference ref : refs) {
+ if (ref.isContainer()) {
+ continue;
+ }
+ // checking for source reference type is based only on first element
+ // of drag source. We suppose that elements with different types are
+ // not allowed to be drag and dropped.
+ if (ref.getEReferenceType().equals(dropee.eClass())
+ || ref.getEReferenceType().isSuperTypeOf(dropee.eClass())) {
+ return ref;
+ }
+ }
+ return null;
+
+ }
+
+ /**
+ * drop before.
+ *
+ * @param targetContainer
+ * target container
+ * @param target
+ * target
+ * @param source
+ * source
+ */
+ @SuppressWarnings("unchecked")
+ protected void dropBefore(EObject targetContainer, EObject target, List<EObject> source) {
+
+ int targetIndex;
+
+ EReference theRef = getTargetRef(targetContainer, source.get(0));
+ if (theRef == null) {
+ return;
+ }
+
+ Object object = target.eContainer().eGet(theRef);
+ EList<EObject> eList = (EList<EObject>) object;
+ if (eList != null) {
+ targetIndex = eList.indexOf(target);
+ } else {
+ targetIndex = -1;
+ }
+
+ if (targetIndex == -1) {
+ return;
+ }
+
+ if (haveSameEContainer(target, source.get(0))) {
+ // We are just changing the order of elements inside the same
+ // container.
+ // In this case the change recording handles a move notification and
+ // creates MultiReferenceMoveOperation.
+ int sourceIndex = eList.indexOf(source.get(0));
+ if (sourceIndex >= 0 && sourceIndex < targetIndex) {
+ targetIndex--;
+ }
+ for (int i = source.size() - 1; i >= 0; i--) {
+ eList.move(targetIndex, source.get(i));
+ }
+
+ } else {
+ // we are moving an element from its old container to new container
+ // and dropping before target.
+ eList.addAll(targetIndex, source);
+ }
+
+ }
+
+ /**
+ * @param target
+ * target
+ * @param dropee
+ * dropee
+ * @return boolean
+ */
+ protected boolean haveSameEContainer(EObject target, EObject dropee) {
+
+ return target.eContainer().equals(dropee.eContainer());
+ }
+
+ /**
+ * Drop containment. Note: if we drop a model element with a bidirectional
+ * reference, we set the parent for drop source, instead of just adding drop
+ * source to target (container). This is because of change recording.
+ *
+ * @param target
+ * target
+ * @param source
+ * source
+ */
+ @SuppressWarnings("unchecked")
+ protected void dropContainment(final EObject target, final List<EObject> source) {
+
+ EReference theRef = getTargetRef(target, source.get(0));
+ if (theRef == null) {
+ return;
+ }
+
+ if (theRef.getEOpposite() != null) {
+ // if it is a bidirectional reference, instead of adding source to
+ // target, set target to the opposite
+ // reference.
+ EReference oppositeRef = theRef.getEOpposite();
+ for (EObject me : source) {
+ Object object = me.eGet(oppositeRef);
+ if (oppositeRef.isMany()) {
+ EList<EObject> eList = (EList<EObject>) object;
+ eList.add(target);
+ } else {
+ me.eSet(oppositeRef, target);
+ }
+ }
+
+ } else {
+ if (theRef.isMany()) {
+
+ Object object = target.eGet(theRef);
+ EList<EObject> eList = (EList<EObject>) object;
+ eList.addAll(source);
+ } else {
+ target.eSet(theRef, source.get(0));
+ }
+
+ }
+
+ }
+
+ /**
+ * This checks if this source can be dropped on this target (taking also the
+ * drop effect into consideration). The most general case is if the target
+ * has the appropriate containment reference for source. Also if all
+ * elements in drop source come from the same level in tree (have the same
+ * container). These cases are handled here. Sub-Classes can override this
+ * method, to implement their own conditions.
+ *
+ * @param eventFeedback
+ * DropTarget drag under effect
+ * @param event
+ * drop target event
+ * @param source
+ * source collection
+ * @param target
+ * target model element
+ * @param dropee
+ * first element of source
+ * @return whether this source can be dropped on the target
+ */
+ public boolean canDrop(int eventFeedback, DropTargetEvent event, List<EObject> source, EObject target,
+ EObject dropee) {
+
+ // moved from ComposedDropAdapter
+ if (source.size() > 1) {
+ event.detail = DND.DROP_NONE;
+ return false;
+ }
+
+ // a container is not allowed to contain the same element twice
+ if (target.eContents().contains(dropee)) {
+ if (!((eventFeedback & DND.FEEDBACK_INSERT_AFTER) == DND.FEEDBACK_INSERT_AFTER || (eventFeedback & DND.FEEDBACK_INSERT_BEFORE) == DND.FEEDBACK_INSERT_BEFORE)) {
+ event.detail = DND.DROP_NONE;
+ return false;
+ }
+
+ }
+
+ // do not drop an element on itself
+ if (target == dropee) {
+ event.detail = DND.DROP_NONE;
+ return false;
+ }
+
+ // do not drop an element on one of its children. this leads to circular
+ // reference
+ // in containment hierarchy and the element and all of its children get
+ // lost
+ // (this creates an island)
+ if (EcoreUtil.isAncestor(dropee, target)) {
+ event.detail = DND.DROP_NONE;
+ return false;
+ }
+
+ if (!haveSameEContainer(source)) {
+ return false;
+ }
+
+ if (((eventFeedback & DND.FEEDBACK_INSERT_AFTER) == DND.FEEDBACK_INSERT_AFTER || (eventFeedback & DND.FEEDBACK_INSERT_BEFORE) == DND.FEEDBACK_INSERT_BEFORE)
+ && target.eContainer() != null) {
+ if (!hasThisContainmentReference(target.eContainer(), dropee.eClass())) {
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ /**
+ * This checks if all elements is drag source collection come from the same
+ * container (level in tree).
+ *
+ * @param source
+ * source
+ * @return true or false
+ */
+ protected boolean haveSameEContainer(List<EObject> source) {
+ EObject first = source.get(0);
+ for (EObject me : source) {
+ if (!first.eContainer().equals(me.eContainer())) {
+ return false;
+ }
+ }
+ return true;
+ }
+
+ /**
+ * This checks if target has appropriate containment reference for source.
+ * Sub-Classes should override this.
+ *
+ * @param target
+ * target
+ * @param refType
+ * refType
+ * @return true or false
+ */
+ protected boolean hasThisContainmentReference(EObject target, EClass refType) {
+
+ boolean result = false;
+
+ for (EReference ref : target.eClass().getEAllContainments()) {
+
+ if (!ref.isContainer()
+ && (ref.getEReferenceType().equals(refType) || ref.getEReferenceType().isSuperTypeOf(refType))) {
+
+ result = true;
+ break;
+ }
+ }
+
+ return result;
+ }
+
+ // TODO: DOD - do we need this?
+ // /**
+ // * This returns the TransactionalEditingDomain.
+ // *
+ // * @return TransactionalEditingDomain
+ // */
+ // protected TransactionalEditingDomain getEditingDomain() {
+ // return domain;
+ // }
+
+ /**
+ * Drop after or before.
+ *
+ * @param targetContainer
+ * target's container
+ * @param target
+ * target
+ * @param source
+ * source
+ * @param after
+ * drop after or drop before
+ */
+ public void dropMove(final EObject targetContainer, final EObject target, final List<EObject> source,
+ final boolean after) {
+
+ // target is the model element after/before which we drop.
+ if (!getTargetRef(targetContainer, target).equals(getTargetRef(targetContainer, source.get(0)))) {
+ return;
+ }
+
+ if (after) {
+ dropAfter(targetContainer, target, source);
+ } else {
+ dropBefore(targetContainer, target, source);
+ }
+
+ }
+
+ /**
+ * Returns the viewer.
+ *
+ * @return viewer
+ */
+ public StructuredViewer getViewer() {
+ return viewer;
+ }
+
+}
\ No newline at end of file
diff --git a/old/org.eclipse.emf.ecp.common/src/org/eclipse/emf/ecp/common/dnd/UCDragAdapter.java b/old/org.eclipse.emf.ecp.common/src/org/eclipse/emf/ecp/common/dnd/UCDragAdapter.java
new file mode 100644
index 0000000..918b49a
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.common/src/org/eclipse/emf/ecp/common/dnd/UCDragAdapter.java
@@ -0,0 +1,58 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2011 Chair for Applied Software Engineering,
+ * Technische Universitaet Muenchen.
+ * 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:
+ ******************************************************************************/
+package org.eclipse.emf.ecp.common.dnd;
+
+import java.util.List;
+
+import org.eclipse.emf.edit.ui.dnd.ViewerDragAdapter;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.swt.dnd.DragSourceEvent;
+
+/**
+ * This class is just a ViewerDragAdpter, with the difference that in dragStart event the selection is extracted from
+ * viewer and set as drag source in DragSourcePlaceHolder.
+ *
+ * @author Hodaie
+ */
+public class UCDragAdapter extends ViewerDragAdapter {
+
+ /**
+ * Constructor.
+ *
+ * @param viewer The viewer
+ */
+ public UCDragAdapter(Viewer viewer) {
+ super(viewer);
+
+ }
+
+ /**
+ * {@inheritDoc} This method extracts the viewer's selection and sets it as drag source in DragSourcePlaceHolder.
+ */
+ @SuppressWarnings("unchecked")
+ @Override
+ public void dragStart(DragSourceEvent event) {
+ super.dragStart(event);
+
+ List<Object> dragSource = null;
+ ISelection sel = viewer.getSelection();
+ if (sel instanceof IStructuredSelection) {
+ IStructuredSelection ssel = (IStructuredSelection) sel;
+ dragSource = ssel.toList();
+ }
+
+ DragSourcePlaceHolder.setDragSource(dragSource);
+
+ }
+
+}
\ No newline at end of file
diff --git a/old/org.eclipse.emf.ecp.common/src/org/eclipse/emf/ecp/common/handler/CreateContainmentHandler.java b/old/org.eclipse.emf.ecp.common/src/org/eclipse/emf/ecp/common/handler/CreateContainmentHandler.java
new file mode 100644
index 0000000..c92c3bc
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.common/src/org/eclipse/emf/ecp/common/handler/CreateContainmentHandler.java
@@ -0,0 +1,104 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2011 Chair for Applied Software Engineering,
+ * Technische Universitaet Muenchen.
+ * 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:
+ ******************************************************************************/
+package org.eclipse.emf.ecp.common.handler;
+
+import java.util.List;
+
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.ecore.EReference;
+import org.eclipse.emf.ecore.EcorePackage;
+import org.eclipse.emf.ecp.common.commands.ECPCommand;
+import org.eclipse.emf.ecp.common.util.UiUtil;
+import org.eclipse.emf.ecp.common.utilities.ActionHelper;
+
+/**
+ * . This is the generic handler for commands to create containments of a model element
+ *
+ * @author Hodaie
+ */
+public class CreateContainmentHandler extends AbstractHandler {
+
+ /**
+ * The Id for the EClass parameter to command. A model element of this EClass type is created in this handler.
+ */
+ public static final String COMMAND_ECLASS_PARAM = "org.eclipse.emf.ecp.navigator.eClassParameter";
+
+ /**
+ * The Id for the EReference parameter to command. A model element of this EReference type is created in this handler.
+ */
+ public static final String COMMAND_EREFERENCE_PARAM = "org.eclipse.emf.ecp.navigator.eReferenceParameter";
+
+ /**
+ * . {@inheritDoc}
+ */
+ public Object execute(ExecutionEvent event) throws ExecutionException {
+
+ // get the command parameter (EClass)
+ Object o = event.getObjectParameterForExecution(COMMAND_ECLASS_PARAM);
+ if (o instanceof EClass) {
+ final EClass newMEType = (EClass) o;
+ final EObject newMEInstance;
+
+ final EObject selectedME = UiUtil.getSelectedModelelement();
+ EPackage ePackage = newMEType.getEPackage();
+ newMEInstance = ePackage.getEFactoryInstance().create(newMEType);
+ EReference ref = (EReference) selectedME.eClass().getEStructuralFeature((String)event.getObjectParameterForExecution(COMMAND_EREFERENCE_PARAM));
+ if(ref==null){
+ ref= getStructuralFeature(newMEInstance, selectedME);
+ }
+ final EReference eReference = ref;
+ if (!eReference.isContainer()) {
+ new ECPCommand(selectedME) {
+ @SuppressWarnings("unchecked")
+ @Override
+ protected void doRun() {
+ Object object = selectedME.eGet(eReference);
+ if ((eReference.isMany())) {
+ EList<EObject> eList = (EList<EObject>) object;
+ eList.add(newMEInstance);
+ } else {
+ selectedME.eSet(eReference, newMEInstance);
+ }
+ ActionHelper.openModelElement(newMEInstance, this.getClass().getName());
+ }
+ }.run(false);
+ }
+ }
+ return null;
+ }
+
+ private EReference getStructuralFeature(final EObject newMEInstance, EObject parent) {
+ // the value of the 'EAll Containments' reference list.
+ List<EReference> eallcontainments = parent.eClass().getEAllContainments();
+ EReference reference = null;
+ for (EReference containmentitem : eallcontainments) {
+
+ EClass eReferenceType = containmentitem.getEReferenceType();
+ if (eReferenceType.equals(newMEInstance)) {
+ reference = containmentitem;
+
+ break;
+ } else if (eReferenceType.isSuperTypeOf(newMEInstance.eClass())
+ || eReferenceType.equals(EcorePackage.eINSTANCE.getEObject())) {
+
+ reference = containmentitem;
+ break;
+ }
+ }
+ return reference;
+ }
+}
\ No newline at end of file
diff --git a/old/org.eclipse.emf.ecp.common/src/org/eclipse/emf/ecp/common/handler/SearchModelElementHandler.java b/old/org.eclipse.emf.ecp.common/src/org/eclipse/emf/ecp/common/handler/SearchModelElementHandler.java
new file mode 100644
index 0000000..751fcb0
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.common/src/org/eclipse/emf/ecp/common/handler/SearchModelElementHandler.java
@@ -0,0 +1,73 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2011 Chair for Applied Software Engineering,
+ * Technische Universitaet Muenchen.
+ * 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:
+ ******************************************************************************/
+package org.eclipse.emf.ecp.common.handler;
+
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.commands.IHandler;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecp.common.Activator;
+import org.eclipse.emf.ecp.common.dialogs.SearchModelElementDialog;
+import org.eclipse.emf.ecp.common.model.ECPWorkspaceManager;
+import org.eclipse.emf.ecp.common.model.NoWorkspaceException;
+import org.eclipse.emf.ecp.common.model.workSpaceModel.ECPProject;
+import org.eclipse.emf.ecp.common.utilities.ActionHelper;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.window.Window;
+import org.eclipse.ui.PlatformUI;
+
+/**
+ * This is the handler to search and select a model element out of a list of model elements.
+ *
+ * @author emueller
+ */
+public class SearchModelElementHandler extends AbstractHandler implements IHandler {
+
+ /**
+ * Default constructor.
+ */
+ public SearchModelElementHandler() {
+ }
+
+ /**
+ *
+ * {@inheritDoc}
+ * @see org.eclipse.core.commands.AbstractHandler#execute(org.eclipse.core.commands.ExecutionEvent)
+ */
+ public Object execute(ExecutionEvent event) throws ExecutionException {
+
+ ECPProject project = null;
+
+ try {
+ project = ECPWorkspaceManager.getInstance().getWorkSpace().getActiveProject();
+ } catch (NoWorkspaceException e) {
+ Activator.getDefault().logException(e.getMessage(), e);
+ }
+
+ if (project == null) {
+ MessageDialog.openInformation(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
+ "Information", "You must first select the Project.");
+ } else {
+ SearchModelElementDialog dialog = new SearchModelElementDialog(project);
+ if (dialog.open() == Window.OK) {
+ Object[] selections = dialog.getResult();
+
+ if (selections != null && selections.length == 1 && selections[0] instanceof EObject) {
+ ActionHelper.openModelElement((EObject) selections[0],
+ "org.eclipse.emf.ecp.navigator.handler.SearchModelElementHandler");
+ }
+ }
+ }
+
+ return null;
+ }
+}
\ No newline at end of file
diff --git a/old/org.eclipse.emf.ecp.common/src/org/eclipse/emf/ecp/common/observer/ModelElementOpenObserver.java b/old/org.eclipse.emf.ecp.common/src/org/eclipse/emf/ecp/common/observer/ModelElementOpenObserver.java
new file mode 100644
index 0000000..00807cd
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.common/src/org/eclipse/emf/ecp/common/observer/ModelElementOpenObserver.java
@@ -0,0 +1,30 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2011 Chair for Applied Software Engineering,
+ * Technische Universitaet Muenchen.
+ * 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:
+ ******************************************************************************/
+package org.eclipse.emf.ecp.common.observer;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.emfstore.common.observer.IObserver;
+
+/**
+ * Listens of an open event of Model Element.
+ *
+ * @author helming
+ */
+public interface ModelElementOpenObserver extends IObserver {
+ /**
+ * Called if a certain model element gets opened.
+ *
+ * @param opened the opened model element
+ * @param sourceView the view the model element is opened from
+ * @param openView The view, the model element is opened with
+ */
+ void onOpen(EObject opened, String sourceView, String openView);
+}
\ No newline at end of file
diff --git a/old/org.eclipse.emf.ecp.common/src/org/eclipse/emf/ecp/common/observer/PresentationSwitchObserver.java b/old/org.eclipse.emf.ecp.common/src/org/eclipse/emf/ecp/common/observer/PresentationSwitchObserver.java
new file mode 100644
index 0000000..8ce2b6c
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.common/src/org/eclipse/emf/ecp/common/observer/PresentationSwitchObserver.java
@@ -0,0 +1,30 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2011 Chair for Applied Software Engineering,
+ * Technische Universitaet Muenchen.
+ * 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:
+ ******************************************************************************/
+package org.eclipse.emf.ecp.common.observer;
+
+import org.eclipse.emf.emfstore.common.observer.IObserver;
+
+/**
+ * Observer for events when the presentation within a view is switched, e.g. to another tab.
+ *
+ * @author helming
+ */
+public interface PresentationSwitchObserver extends IObserver {
+
+ /**
+ * Called if the presentation is switched.
+ *
+ * @param viewID the ID of the focused view
+ * @param presentationID the idea of the activated presentation
+ */
+ void onPresentationSwitchEvent(String viewID, String presentationID);
+
+}
\ No newline at end of file
diff --git a/old/org.eclipse.emf.ecp.common/src/org/eclipse/emf/ecp/common/preferences/ECPPreferenceConstants.java b/old/org.eclipse.emf.ecp.common/src/org/eclipse/emf/ecp/common/preferences/ECPPreferenceConstants.java
new file mode 100644
index 0000000..53e0eb4
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.common/src/org/eclipse/emf/ecp/common/preferences/ECPPreferenceConstants.java
@@ -0,0 +1,34 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2011 Chair for Applied Software Engineering,
+ * Technische Universitaet Muenchen.
+ * 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:
+ ******************************************************************************/
+package org.eclipse.emf.ecp.common.preferences;
+
+/**
+ * Preferences constants for ECP.
+ *
+ * @author Hodaie
+ */
+public final class ECPPreferenceConstants {
+
+ /**
+ * Assignee Recommendation.
+ */
+ public static final String ENABLE_ASSIGNEE_RECOMMENDATION = "assigneeRecommendation.enable";
+
+ /**
+ * private constructor.
+ *
+ * @param value constant value
+ */
+ private ECPPreferenceConstants(String value) {
+
+ }
+
+}
\ No newline at end of file
diff --git a/old/org.eclipse.emf.ecp.common/src/org/eclipse/emf/ecp/common/preferences/ECPPreferencesPage.java b/old/org.eclipse.emf.ecp.common/src/org/eclipse/emf/ecp/common/preferences/ECPPreferencesPage.java
new file mode 100644
index 0000000..7d8280f
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.common/src/org/eclipse/emf/ecp/common/preferences/ECPPreferencesPage.java
@@ -0,0 +1,84 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2011 Chair for Applied Software Engineering,
+ * Technische Universitaet Muenchen.
+ * 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:
+ ******************************************************************************/
+package org.eclipse.emf.ecp.common.preferences;
+
+import org.eclipse.jface.preference.PreferencePage;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchPreferencePage;
+
+/**
+ * ECP preferences root node.
+ *
+ * @author Hodaie
+ */
+public class ECPPreferencesPage extends PreferencePage implements IWorkbenchPreferencePage {
+
+ /**
+ * Default constructor.
+ */
+ public ECPPreferencesPage() {
+ }
+
+ /**
+ * Constructor.
+ *
+ * @param title title
+ */
+ public ECPPreferencesPage(String title) {
+ super(title);
+ }
+
+ /**
+ * Constructor.
+ *
+ * @param title title
+ * @param image image
+ */
+ public ECPPreferencesPage(String title, ImageDescriptor image) {
+ super(title, image);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.preference.PreferencePage#createContents(org.eclipse.swt.widgets.Composite)
+ */
+ @Override
+ protected Control createContents(Composite parent) {
+ parent.setLayout(new GridLayout());
+ Composite content = new Composite(parent, SWT.NONE);
+ content.setLayoutData(new GridData(SWT.BEGINNING, SWT.CENTER, false, false));
+ content.setLayout(new GridLayout());
+
+ Label label = new Label(content, SWT.WRAP);
+ label.setLayoutData(new GridData(SWT.BEGINNING, SWT.CENTER, false, false));
+ label.setText("ECP Preferences");
+
+ return content;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench)
+ */
+ public void init(IWorkbench workbench) {
+
+ }
+
+}
\ No newline at end of file
diff --git a/old/org.eclipse.emf.ecp.common/src/org/eclipse/emf/ecp/common/utilities/ActionHelper.java b/old/org.eclipse.emf.ecp.common/src/org/eclipse/emf/ecp/common/utilities/ActionHelper.java
new file mode 100644
index 0000000..1238d39
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.common/src/org/eclipse/emf/ecp/common/utilities/ActionHelper.java
@@ -0,0 +1,95 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2011 Chair for Applied Software Engineering,
+ * Technische Universitaet Muenchen.
+ * 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:
+ ******************************************************************************/
+package org.eclipse.emf.ecp.common.utilities;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecp.common.Activator;
+import org.eclipse.emf.ecp.common.model.ECPWorkspaceManager;
+import org.eclipse.emf.ecp.common.observer.ModelElementOpenObserver;
+import org.eclipse.emf.ecp.common.util.ModelElementOpener;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.swt.widgets.Display;
+
+/**
+ * @author Hodaie This class contains some utility method for commands and handlers.
+ */
+public final class ActionHelper {
+ // TODO: move constants
+ /**
+ * The ID of the meeditor.
+ */
+ public static final String MEEDITOR_ID = "org.eclipse.emf.ecp.editor";
+ /**
+ * Constant for the open model element command.
+ */
+ public static final String MEEDITOR_OPENMODELELEMENT_COMMAND_ID = "org.eclipse.emf.ecp.editor.openModelElement";
+
+ /**
+ * Constant for the modelelement context.
+ */
+ public static final String MECONTEXT_EVALUATIONCONTEXT_VARIABLE = "meContext";
+
+ /**
+ * Constant for the modelelement to be opened.
+ */
+ public static final String ME_TO_OPEN_EVALUATIONCONTEXT_VARIABLE = "meToOpen";
+ //private static final String FEATURE_TO_MARK_EVALUATIONCONTEXT_VARIABLE = "featureToMark";
+
+ private ActionHelper() {
+
+ }
+
+ /**
+ * This opens the model element.
+ *
+ * @param me ModelElement to open
+ * @param sourceView the view that requested the open model element
+ */
+ public static void openModelElement(final EObject me, final String sourceView) {
+ if (me == null) {
+ MessageDialog.openError(Display.getCurrent().getActiveShell(), "The element was deleted",
+ "The model element you are trying to open was deleted!");
+ return;
+ }
+ IConfigurationElement[] modelelementopener = Platform.getExtensionRegistry().getConfigurationElementsFor(
+ "org.eclipse.emf.ecp.common.modelelementopener");
+ ModelElementOpener bestCandidate = null;
+ int bestValue = -1;
+ String name = "";
+ for (IConfigurationElement element : modelelementopener) {
+ modelelementopener = null;
+ try {
+ ModelElementOpener modelelementOpener = (ModelElementOpener) element.createExecutableExtension("class");
+ int value = modelelementOpener.canOpen(me);
+ if (value > bestValue) {
+ bestCandidate = modelelementOpener;
+ bestValue = value;
+ name = element.getAttribute("name");
+ }
+ } catch (CoreException e) {
+ Activator.getDefault().logException(e.getMessage(), e);
+ }
+ }
+ ECPWorkspaceManager.getObserverBus().notify(ModelElementOpenObserver.class).onOpen(me, sourceView, name);
+ // BEGIN SUPRESS CATCH EXCEPTION
+ try {
+ bestCandidate.openModelElement(me);
+ } catch (RuntimeException e) {
+ Activator.getDefault().logException(e);
+ }
+ // END SUPRESS CATCH EXCEPTION
+
+ }
+
+}
\ No newline at end of file
diff --git a/old/org.eclipse.emf.ecp.common/src/org/eclipse/emf/ecp/common/utilities/CannotMatchUserInProjectException.java b/old/org.eclipse.emf.ecp.common/src/org/eclipse/emf/ecp/common/utilities/CannotMatchUserInProjectException.java
new file mode 100644
index 0000000..938c2d7
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.common/src/org/eclipse/emf/ecp/common/utilities/CannotMatchUserInProjectException.java
@@ -0,0 +1,21 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2011 Chair for Applied Software Engineering,
+ * Technische Universitaet Muenchen.
+ * 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:
+ ******************************************************************************/
+package org.eclipse.emf.ecp.common.utilities;
+
+/**
+ * Represents exceptional condition where current user cannot be found in project.
+ *
+ * @author koegel
+ */
+@SuppressWarnings("serial")
+public class CannotMatchUserInProjectException extends Exception {
+
+}
\ No newline at end of file
diff --git a/old/org.eclipse.emf.ecp.common/src/org/eclipse/emf/ecp/common/utilities/CollectionFilter.java b/old/org.eclipse.emf.ecp.common/src/org/eclipse/emf/ecp/common/utilities/CollectionFilter.java
new file mode 100644
index 0000000..17039f1
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.common/src/org/eclipse/emf/ecp/common/utilities/CollectionFilter.java
@@ -0,0 +1,42 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2011 Chair for Applied Software Engineering,
+ * Technische Universitaet Muenchen.
+ * 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:
+ ******************************************************************************/
+package org.eclipse.emf.ecp.common.utilities;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
+/**
+ * @author schroech
+ */
+public final class CollectionFilter {
+
+ private CollectionFilter() {
+ // TODO Auto-generated constructor stub
+ }
+
+ /**
+ * @param <T> The classType to filter for
+ * @param objects The objects to be filtered
+ * @param classType The classType to filter for
+ * @return A filtered {@link Collection}
+ */
+ @SuppressWarnings("unchecked")
+ public static <T> List<T> filter(@SuppressWarnings("rawtypes") Collection objects, java.lang.Class<T> classType) {
+ List<T> filteredObjects = new ArrayList<T>();
+ for (Object object : objects) {
+ if (classType.isInstance(object)) {
+ filteredObjects.add((T) object);
+ }
+ }
+ return filteredObjects;
+ }
+}
\ No newline at end of file
diff --git a/old/org.eclipse.emf.ecp.common/src/org/eclipse/emf/ecp/common/utilities/ComboView.java b/old/org.eclipse.emf.ecp.common/src/org/eclipse/emf/ecp/common/utilities/ComboView.java
new file mode 100644
index 0000000..c28f01a
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.common/src/org/eclipse/emf/ecp/common/utilities/ComboView.java
@@ -0,0 +1,229 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2011 Chair for Applied Software Engineering,
+ * Technische Universitaet Muenchen.
+ * 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:
+ ******************************************************************************/
+package org.eclipse.emf.ecp.common.utilities;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.List;
+
+import org.eclipse.jface.viewers.ILabelProvider;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Composite;
+
+/**
+ * A combo view is a wrapper around a graphical SWT combo element. It provides type-safe retrieval of the selected
+ * element and allows to easily track selection changes. While a combo only allows String values, this view allows
+ * arbitrary values in the model. The combo view is a wrapper for combo, comparable to JFace wrappers (like TreeView
+ * wrapping Tree). It supports LabelProviders but no ContentProviders. Only the text, not the image, is taken from the
+ * label provider, since the combo object does not support images.
+ *
+ * @author jfinis
+ * @param <T> the type of elements in the combo.
+ */
+public class ComboView<T> {
+
+ /**
+ * Listener to track selection changed events.
+ *
+ * @author helming
+ * @param <T>
+ */
+ public interface IComboChangeListener<T> {
+ /**
+ * called if the selection of the combobox is changed.
+ *
+ * @param newSelection the new selection
+ */
+ void selectionChanged(T newSelection);
+ }
+
+ /**
+ * The SWT Combo element wrapped by this class.
+ */
+ private final Combo combo;
+
+ /**
+ * The index map, that associates indices with the objects behind them.
+ */
+ private HashMap<Integer, T> map = new HashMap<Integer, T>();
+
+ /**
+ * The element that was selected last.
+ */
+ private T lastSelection;
+
+ /**
+ * Selection listener for convenient selection change listening.
+ */
+ private SelectionListener listener;
+
+ /**
+ * The currently used label Provider.
+ */
+ private ILabelProvider labelProvider;
+
+ /**
+ * The list of listeners.
+ */
+ private List<IComboChangeListener<? super T>> changeListeners = new ArrayList<IComboChangeListener<? super T>>();
+
+ /**
+ * Default constructor creating a combo box set from a SWT combo element.
+ *
+ * @param combo the combo element wrapped by this combo box set
+ */
+ public ComboView(Combo combo) {
+ this.combo = combo;
+ listener = new SelectionAdapter() {
+
+ /**
+ * saves the selection and fires an onSelectionChange event.
+ */
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ T newSelection = map.get(ComboView.this.combo.getSelectionIndex());
+ if (newSelection != lastSelection) {
+ lastSelection = newSelection;
+ for (IComboChangeListener<? super T> listener : changeListeners) {
+ listener.selectionChanged(newSelection);
+ }
+ }
+ }
+ };
+ combo.addSelectionListener(listener);
+ }
+
+ /**
+ * Creates a new combo box set and the wrapped combo element.
+ *
+ * @param parent the paren composite
+ * @param style the SWT style
+ */
+ public ComboView(Composite parent, int style) {
+ this(new Combo(parent, style));
+ }
+
+ /**
+ * Sets the input of this combo box. Will have the first element selected by default. and will not fire a selection
+ * changed event.
+ *
+ * @param entries the entries shown in the combobox
+ */
+ public void setInput(Collection<? extends T> entries) {
+ setInput(entries, null, false);
+ }
+
+ /**
+ * Sets the input for this combo box You can set which of the entries is selected by choosing one as default entry.
+ *
+ * @param entries entries in the box
+ * @param defaultEntry the default selected entry
+ * @param fireSelectionChangeEvents if a selection change event should be fired
+ */
+ public void setInput(Collection<? extends T> entries, T defaultEntry, boolean fireSelectionChangeEvents) {
+ String[] labels = new String[entries.size()];
+ int selection = 0;
+ int i = 0;
+ for (T e : entries) {
+ String label;
+ if (labelProvider == null) {
+ label = String.valueOf(e);
+ } else {
+ label = labelProvider.getText(e);
+ }
+ map.put(i, e);
+ labels[i] = label;
+ if (e.equals(defaultEntry)) {
+ selection = i;
+ }
+ i++;
+ }
+
+ // If we do not want to fire selection change events, we make sure that the
+ // selection does not change by setting it to the new value
+ // Since the selection function checks for a changing selection, this will
+ // suppress any change event.
+ if (!fireSelectionChangeEvents) {
+ lastSelection = map.get(selection);
+ }
+ combo.setItems(labels);
+ combo.select(selection);
+ listener.widgetSelected(null); // fire selection events
+
+ }
+
+ /**
+ * Returns the currently selected element.
+ *
+ * @return the current selection
+ */
+ public T getSelection() {
+ // If the combo element is already disposed we return the last selection
+ if (combo.isDisposed()) {
+ return lastSelection;
+ }
+ int index = combo.getSelectionIndex();
+ if (index == -1) {
+ return null;
+ }
+ return map.get(index);
+ }
+
+ /**
+ * Sets the label provider to be used to display elements.
+ *
+ * @param labelProvider label provider to be used.
+ */
+ public void setLabelProvider(ILabelProvider labelProvider) {
+ this.labelProvider = labelProvider;
+ }
+
+ /**
+ * .
+ *
+ * @return the currently used label provider.
+ */
+ public ILabelProvider getLabelProvider() {
+ return labelProvider;
+ }
+
+ /**
+ * Returns the combo element wrapped by this object.
+ *
+ * @return the wrapped combo element
+ */
+ public Combo getControl() {
+ return combo;
+ }
+
+ /**
+ * Adds a listener that is notified whenever the selection changes.
+ *
+ * @param listener the listener.
+ */
+ public void addSelectionChangedListener(IComboChangeListener<? super T> listener) {
+ changeListeners.add(listener);
+ }
+
+ /**
+ * Adds a listener that is notified whenever the selection changes.
+ *
+ * @param listener the listener.
+ */
+ public void removeSelectionChangedListener(IComboChangeListener<? super T> listener) {
+ changeListeners.remove(listener);
+ }
+
+}
\ No newline at end of file
diff --git a/old/org.eclipse.emf.ecp.common/src/org/eclipse/emf/ecp/common/utilities/DefaultLabelProvider.java b/old/org.eclipse.emf.ecp.common/src/org/eclipse/emf/ecp/common/utilities/DefaultLabelProvider.java
new file mode 100644
index 0000000..4a402a3
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.common/src/org/eclipse/emf/ecp/common/utilities/DefaultLabelProvider.java
@@ -0,0 +1,29 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2011 Chair for Applied Software Engineering,
+ * Technische Universitaet Muenchen.
+ * 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:
+ ******************************************************************************/
+package org.eclipse.emf.ecp.common.utilities;
+
+import org.eclipse.emf.edit.provider.ComposedAdapterFactory;
+import org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider;
+
+/**
+ * Default Label Provider for EMF. Creates an adapter factory label provider for all registered EMF packages.
+ *
+ * @author helming
+ */
+public class DefaultLabelProvider extends AdapterFactoryLabelProvider {
+ /**
+ * Default constructor.
+ */
+ public DefaultLabelProvider() {
+ super(new ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry.INSTANCE));
+ }
+
+}
\ No newline at end of file
diff --git a/old/org.eclipse.emf.ecp.common/src/org/eclipse/emf/ecp/common/utilities/ExtProgramFactoryFacade.java b/old/org.eclipse.emf.ecp.common/src/org/eclipse/emf/ecp/common/utilities/ExtProgramFactoryFacade.java
new file mode 100644
index 0000000..0820728
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.common/src/org/eclipse/emf/ecp/common/utilities/ExtProgramFactoryFacade.java
@@ -0,0 +1,52 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2011 Chair for Applied Software Engineering,
+ * Technische Universitaet Muenchen.
+ * 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:
+ ******************************************************************************/
+package org.eclipse.emf.ecp.common.utilities;
+
+/**
+ * Provides the option to open URLs or send emails with an extern program.
+ *
+ * @author stefan.bleibinhaus
+ */
+public abstract class ExtProgramFactoryFacade {
+ private static final ExtProgramFactoryFacade IMPL;
+
+ static {
+ IMPL = (ExtProgramFactoryFacade) ImplementationLoader.newInstance(ExtProgramFactoryFacade.class);
+ }
+
+ /**
+ * @param mailto the mailto-message
+ * @return success as boolean
+ */
+ public static boolean useEmail(String mailto) {
+ return IMPL.useEmailIntern(mailto);
+ }
+
+ /**
+ * @param mailto the mailto-message
+ * @return success as boolean
+ */
+ abstract boolean useEmailIntern(String mailto);
+
+ /**
+ * @param url the url as string
+ * @return success as boolean
+ */
+ abstract boolean launchURLIntern(String url);
+
+ /**
+ * @param url the url as string
+ * @return success as boolean
+ */
+ public static boolean launchURL(String url) {
+ return IMPL.launchURLIntern(url);
+ }
+}
\ No newline at end of file
diff --git a/old/org.eclipse.emf.ecp.common/src/org/eclipse/emf/ecp/common/utilities/ExtProgramFactoryFacadeImpl.java b/old/org.eclipse.emf.ecp.common/src/org/eclipse/emf/ecp/common/utilities/ExtProgramFactoryFacadeImpl.java
new file mode 100644
index 0000000..fa1464a
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.common/src/org/eclipse/emf/ecp/common/utilities/ExtProgramFactoryFacadeImpl.java
@@ -0,0 +1,35 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2011 Chair for Applied Software Engineering,
+ * Technische Universitaet Muenchen.
+ * 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:
+ ******************************************************************************/
+package org.eclipse.emf.ecp.common.utilities;
+
+import org.eclipse.swt.program.Program;
+
+/**
+ * @author stefan.bleibinhaus
+ *
+ */
+public class ExtProgramFactoryFacadeImpl extends ExtProgramFactoryFacade {
+
+ @Override
+ boolean useEmailIntern(String mailto) {
+ return launch(mailto);
+ }
+
+ @Override
+ boolean launchURLIntern(String url) {
+ return launch(url);
+ }
+
+ private boolean launch(String url) {
+ return Program.launch(url);
+ }
+
+}
\ No newline at end of file
diff --git a/old/org.eclipse.emf.ecp.common/src/org/eclipse/emf/ecp/common/utilities/ImplementationLoader.java b/old/org.eclipse.emf.ecp.common/src/org/eclipse/emf/ecp/common/utilities/ImplementationLoader.java
new file mode 100644
index 0000000..a618d8d
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.common/src/org/eclipse/emf/ecp/common/utilities/ImplementationLoader.java
@@ -0,0 +1,51 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2011 Chair for Applied Software Engineering,
+ * Technische Universitaet Muenchen.
+ * 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:
+ ******************************************************************************/
+package org.eclipse.emf.ecp.common.utilities;
+
+import org.eclipse.emf.ecp.common.Activator;
+
+/**
+ * This class is used for loading the implementation of classes in fragments.
+ *
+ * @author stefan.bleibinhaus
+ */
+public final class ImplementationLoader {
+
+ private ImplementationLoader() {
+
+ }
+
+ /**
+ * @param type type of class you want to load
+ * @return the implementation of that class loaded
+ */
+ public static Object newInstance(@SuppressWarnings("rawtypes") final Class type) {
+ String name = type.getName();
+ Object result = null;
+ try {
+ result = type.getClassLoader().loadClass(name + "Impl").newInstance();
+ } catch (ClassNotFoundException e) {
+ String msgException = "Class " + name + "Impl not found.";
+ Activator.getDefault().logException(msgException, e);
+ throw new RuntimeException(msgException, e);
+ } catch (InstantiationException e) {
+ String msgException = "Could not instantiate class " + name + "Impl.";
+ Activator.getDefault().logException(msgException, e);
+ throw new RuntimeException(msgException, e);
+ } catch (IllegalAccessException e) {
+ String msgException = "Could not access class " + name + "Impl.";
+ Activator.getDefault().logException(msgException, e);
+ throw new RuntimeException(msgException, e);
+ }
+ return result;
+ }
+
+}
\ No newline at end of file
diff --git a/old/org.eclipse.emf.ecp.common/src/org/eclipse/emf/ecp/common/utilities/ModelElementClassTooltip.java b/old/org.eclipse.emf.ecp.common/src/org/eclipse/emf/ecp/common/utilities/ModelElementClassTooltip.java
new file mode 100644
index 0000000..d7f534b
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.common/src/org/eclipse/emf/ecp/common/utilities/ModelElementClassTooltip.java
@@ -0,0 +1,65 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2011 Chair for Applied Software Engineering,
+ * Technische Universitaet Muenchen.
+ * 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:
+ ******************************************************************************/
+package org.eclipse.emf.ecp.common.utilities;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.jface.window.DefaultToolTip;
+import org.eclipse.jface.window.ToolTip;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Event;
+
+/**
+ * Defines a tooltip support for the model element icons.
+ *
+ * @author Shterev
+ */
+public class ModelElementClassTooltip extends DefaultToolTip {
+
+ /**
+ * Default constructor.
+ *
+ * @param control the control that should receive the tooltip
+ */
+ public ModelElementClassTooltip(Control control) {
+ super(control, ToolTip.NO_RECREATE, false);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected String getText(Event event) {
+ Object o = getElement(event);
+ return ((EClass) o).getName();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected boolean shouldCreateToolTip(Event event) {
+ final Object element = getElement(event);
+ return (element != null && element instanceof EClass && super.shouldCreateToolTip(event));
+ }
+
+ private Object getElement(Event event) {
+ return event.widget.getData();
+ }
+
+ /**
+ * Enable ToolTip support for the control by creating an instance from this class.
+ *
+ * @param control the control
+ */
+ public static void enableFor(Control control) {
+ new ModelElementClassTooltip(control);
+ }
+}
\ No newline at end of file
diff --git a/old/org.eclipse.emf.ecp.common/src/org/eclipse/emf/ecp/common/utilities/ShortLabelProvider.java b/old/org.eclipse.emf.ecp.common/src/org/eclipse/emf/ecp/common/utilities/ShortLabelProvider.java
new file mode 100644
index 0000000..65aaf11
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.common/src/org/eclipse/emf/ecp/common/utilities/ShortLabelProvider.java
@@ -0,0 +1,51 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2011 Chair for Applied Software Engineering,
+ * Technische Universitaet Muenchen.
+ * 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:
+ ******************************************************************************/
+package org.eclipse.emf.ecp.common.utilities;
+
+import org.eclipse.emf.edit.provider.ComposedAdapterFactory;
+import org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider;
+import org.eclipse.jface.viewers.ILabelProvider;
+
+/**
+ * Label provider to shorten the getText Method.
+ *
+ * @author helming
+ */
+public class ShortLabelProvider extends AdapterFactoryLabelProvider implements ILabelProvider {
+
+ /**
+ * Default constructor.
+ */
+ public ShortLabelProvider() {
+ super(new ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry.INSTANCE));
+
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.edit.provider.IItemLabelProvider#getText(java.lang.Object)
+ * @override
+ */
+ @Override
+ public String getText(Object object) {
+ int limit = 30;
+ String name = super.getText(object);
+ if (name == null) {
+ name = "";
+ }
+ if (name.length() > limit + 5) {
+ name = name.substring(0, limit).concat("[...]");
+ }
+ return name;
+ }
+
+}
\ No newline at end of file
diff --git a/old/org.eclipse.emf.ecp.editor/.checkstyle b/old/org.eclipse.emf.ecp.editor/.checkstyle
new file mode 100644
index 0000000..d4fa17e
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.editor/.checkstyle
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<fileset-config file-format-version="1.2.0" simple-config="true" sync-formatter="false">
+ <fileset name="all" enabled="true" check-config-name="emfcpStyle" local="false">
+ <file-match-pattern match-pattern="." include-pattern="true"/>
+ </fileset>
+</fileset-config>
diff --git a/old/org.eclipse.emf.ecp.editor/.classpath b/old/org.eclipse.emf.ecp.editor/.classpath
new file mode 100644
index 0000000..304e861
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.editor/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <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="output" path="bin"/>
+</classpath>
diff --git a/old/org.eclipse.emf.ecp.editor/.project b/old/org.eclipse.emf.ecp.editor/.project
new file mode 100644
index 0000000..aacdd55
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.editor/.project
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.emf.ecp.editor</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>net.sf.eclipsecs.core.CheckstyleBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>net.sf.eclipsecs.core.CheckstyleNature</nature>
+ </natures>
+</projectDescription>
diff --git a/old/org.eclipse.emf.ecp.editor/.settings/org.eclipse.jdt.core.prefs b/old/org.eclipse.emf.ecp.editor/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 0000000..2aa92f3
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.editor/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,83 @@
+#Wed May 18 17:50:12 CEST 2011
+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.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.doc.comment.support=enabled
+org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
+org.eclipse.jdt.core.compiler.problem.deprecation=warning
+org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
+org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
+org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
+org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.problem.fallthroughCase=warning
+org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled
+org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore
+org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
+org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
+org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
+org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
+org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
+org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore
+org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore
+org.eclipse.jdt.core.compiler.problem.invalidJavadoc=ignore
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTags=disabled
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef=disabled
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef=disabled
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=public
+org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
+org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
+org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=warning
+org.eclipse.jdt.core.compiler.problem.missingJavadocComments=ignore
+org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=disabled
+org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public
+org.eclipse.jdt.core.compiler.problem.missingJavadocTagDescription=return_tag
+org.eclipse.jdt.core.compiler.problem.missingJavadocTags=ignore
+org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled
+org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=public
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=warning
+org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
+org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
+org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
+org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
+org.eclipse.jdt.core.compiler.problem.nullReference=warning
+org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
+org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
+org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore
+org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore
+org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
+org.eclipse.jdt.core.compiler.problem.redundantNullCheck=warning
+org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore
+org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
+org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
+org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
+org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
+org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
+org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
+org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
+org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
+org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning
+org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=warning
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
+org.eclipse.jdt.core.compiler.problem.unusedImport=warning
+org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
+org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
+org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
+org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
+org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
+org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
+org.eclipse.jdt.core.compiler.source=1.5
diff --git a/old/org.eclipse.emf.ecp.editor/.settings/org.eclipse.jdt.ui.prefs b/old/org.eclipse.emf.ecp.editor/.settings/org.eclipse.jdt.ui.prefs
new file mode 100644
index 0000000..30b0004
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.editor/.settings/org.eclipse.jdt.ui.prefs
@@ -0,0 +1,57 @@
+#Thu Mar 31 20:47:46 CEST 2011
+cleanup.add_default_serial_version_id=true
+cleanup.add_generated_serial_version_id=false
+cleanup.add_missing_annotations=true
+cleanup.add_missing_deprecated_annotations=true
+cleanup.add_missing_methods=false
+cleanup.add_missing_nls_tags=false
+cleanup.add_missing_override_annotations=true
+cleanup.add_serial_version_id=false
+cleanup.always_use_blocks=true
+cleanup.always_use_parentheses_in_expressions=false
+cleanup.always_use_this_for_non_static_field_access=false
+cleanup.always_use_this_for_non_static_method_access=false
+cleanup.convert_to_enhanced_for_loop=false
+cleanup.correct_indentation=true
+cleanup.format_source_code=true
+cleanup.format_source_code_changes_only=false
+cleanup.make_local_variable_final=true
+cleanup.make_parameters_final=false
+cleanup.make_private_fields_final=true
+cleanup.make_type_abstract_if_missing_method=false
+cleanup.make_variable_declarations_final=false
+cleanup.never_use_blocks=false
+cleanup.never_use_parentheses_in_expressions=true
+cleanup.organize_imports=true
+cleanup.qualify_static_field_accesses_with_declaring_class=false
+cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true
+cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true
+cleanup.qualify_static_member_accesses_with_declaring_class=true
+cleanup.qualify_static_method_accesses_with_declaring_class=false
+cleanup.remove_private_constructors=true
+cleanup.remove_trailing_whitespaces=true
+cleanup.remove_trailing_whitespaces_all=true
+cleanup.remove_trailing_whitespaces_ignore_empty=false
+cleanup.remove_unnecessary_casts=true
+cleanup.remove_unnecessary_nls_tags=true
+cleanup.remove_unused_imports=true
+cleanup.remove_unused_local_variables=false
+cleanup.remove_unused_private_fields=true
+cleanup.remove_unused_private_members=false
+cleanup.remove_unused_private_methods=true
+cleanup.remove_unused_private_types=true
+cleanup.sort_members=false
+cleanup.sort_members_all=false
+cleanup.use_blocks=true
+cleanup.use_blocks_only_for_return_and_throw=false
+cleanup.use_parentheses_in_expressions=false
+cleanup.use_this_for_non_static_field_access=false
+cleanup.use_this_for_non_static_field_access_only_if_necessary=true
+cleanup.use_this_for_non_static_method_access=false
+cleanup.use_this_for_non_static_method_access_only_if_necessary=true
+cleanup_profile=_unicaseCleanUp
+cleanup_settings_version=2
+eclipse.preferences.version=1
+formatter_settings_version=11
+org.eclipse.jdt.ui.javadoc=false
+org.eclipse.jdt.ui.text.custom_code_templates=<?xml version\="1.0" encoding\="UTF-8" standalone\="no"?><templates><template autoinsert\="true" context\="gettercomment_context" deleted\="false" description\="Comment for getter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.gettercomment" name\="gettercomment">/**\n * @return the ${bare_field_name}\n */</template><template autoinsert\="true" context\="settercomment_context" deleted\="false" description\="Comment for setter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.settercomment" name\="settercomment">/**\n * @param ${param} the ${bare_field_name} to set\n */</template><template autoinsert\="true" context\="constructorcomment_context" deleted\="false" description\="Comment for created constructors" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorcomment" name\="constructorcomment">/**\n * ${tags}\n */</template><template autoinsert\="false" context\="filecomment_context" deleted\="false" description\="Comment for created Java files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.filecomment" name\="filecomment">/**\n * <copyright> Copyright (c) 2008-2009 Jonas Helming, Maximilian Koegel. All rights reserved. This program and the\n * accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this\n * distribution, and is available at http\://www.eclipse.org/legal/epl-v10.html </copyright>\n */</template><template autoinsert\="true" context\="typecomment_context" deleted\="false" description\="Comment for created types" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.typecomment" name\="typecomment">/**\n * @author ${user}\n *\n * ${tags}\n */</template><template autoinsert\="false" context\="fieldcomment_context" deleted\="false" description\="Comment for fields" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.fieldcomment" name\="fieldcomment"/><template autoinsert\="true" context\="methodcomment_context" deleted\="false" description\="Comment for non-overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodcomment" name\="methodcomment">/**\n * ${tags}\n */</template><template autoinsert\="false" context\="overridecomment_context" deleted\="false" description\="Comment for overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.overridecomment" name\="overridecomment">/**\n * {@inheritDoc}\n * ${see_to_overridden}\n */</template><template autoinsert\="true" context\="delegatecomment_context" deleted\="false" description\="Comment for delegate methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.delegatecomment" name\="delegatecomment">/**\n * ${tags}\n * ${see_to_target}\n */</template><template autoinsert\="true" context\="newtype_context" deleted\="false" description\="Newly created files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.newtype" name\="newtype">${filecomment}\n${package_declaration}\n\n${typecomment}\n${type_declaration}</template><template autoinsert\="true" context\="classbody_context" deleted\="false" description\="Code in new class type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.classbody" name\="classbody">\n</template><template autoinsert\="true" context\="interfacebody_context" deleted\="false" description\="Code in new interface type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.interfacebody" name\="interfacebody">\n</template><template autoinsert\="true" context\="enumbody_context" deleted\="false" description\="Code in new enum type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.enumbody" name\="enumbody">\n</template><template autoinsert\="true" context\="annotationbody_context" deleted\="false" description\="Code in new annotation type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.annotationbody" name\="annotationbody">\n</template><template autoinsert\="false" context\="catchblock_context" deleted\="false" description\="Code in new catch blocks" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.catchblock" name\="catchblock">\t\t\t// TODO Auto-generated catch block\n\t\t\t// Do NOT catch all Exceptions ("catch (Exception e)")\n\t\t\t// Log AND handle Exceptions if possible \n //\n // You can just uncomment one of the lines below to log an exception\:\n\t\t\t// logException will show the logged excpetion to the user\n\t\t\t// ModelUtil.logException(${exception_var});\n\t\t\t// ModelUtil.logException("YOUR MESSAGE HERE", ${exception_var});\n\t\t\t// logWarning will only add the message to the error log\n\t\t\t// ModelUtil.logWarning("YOUR MESSAGE HERE", ${exception_var});\n\t\t\t// ModelUtil.logWarning("YOUR MESSAGE HERE");\n\t\t\t//\t\t\t\n\t\t\t// If handling is not possible declare and rethrow Exception</template><template autoinsert\="true" context\="methodbody_context" deleted\="false" description\="Code in created method stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodbody" name\="methodbody">// ${todo} Auto-generated method stub\n${body_statement}</template><template autoinsert\="true" context\="constructorbody_context" deleted\="false" description\="Code in created constructor stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorbody" name\="constructorbody">${body_statement}\n// ${todo} Auto-generated constructor stub</template><template autoinsert\="true" context\="getterbody_context" deleted\="false" description\="Code in created getters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.getterbody" name\="getterbody">return ${field};</template><template autoinsert\="true" context\="setterbody_context" deleted\="false" description\="Code in created setters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.setterbody" name\="setterbody">${field} \= ${param};</template></templates>
diff --git a/old/org.eclipse.emf.ecp.editor/META-INF/MANIFEST.MF b/old/org.eclipse.emf.ecp.editor/META-INF/MANIFEST.MF
new file mode 100644
index 0000000..8f3b622
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.editor/META-INF/MANIFEST.MF
@@ -0,0 +1,17 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: ECP Editor Plug-in
+Bundle-SymbolicName: org.eclipse.emf.ecp.editor;singleton:=true
+Bundle-Version: 0.9.3.qualifier
+Bundle-Activator: org.eclipse.emf.ecp.editor.Activator
+Bundle-Vendor: Eclipse Modeling Project
+Require-Bundle: org.eclipse.emf.ecp.common;visibility:=reexport,
+ org.eclipse.jface.text;bundle-version="[3.5.0,4.0.0)"
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Bundle-ActivationPolicy: lazy
+Export-Package: org.eclipse.emf.ecp.editor,
+ org.eclipse.emf.ecp.editor.commands,
+ org.eclipse.emf.ecp.editor.mecontrols,
+ org.eclipse.emf.ecp.editor.mecontrols.melinkcontrol,
+ org.eclipse.emf.ecp.editor.mecontrols.melinkcontrol.associationclasscontrol
+Bundle-ClassPath: .
diff --git a/old/org.eclipse.emf.ecp.editor/build.properties b/old/org.eclipse.emf.ecp.editor/build.properties
new file mode 100644
index 0000000..c50dd11
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.editor/build.properties
@@ -0,0 +1,10 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ icons/,\
+ .,\
+ plugin.xml,\
+ schema/
+src.includes = schema/,\
+ icons/
+
diff --git a/old/org.eclipse.emf.ecp.editor/icons/accept.png b/old/org.eclipse.emf.ecp.editor/icons/accept.png
new file mode 100644
index 0000000..c96f189
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.editor/icons/accept.png
Binary files differ
diff --git a/old/org.eclipse.emf.ecp.editor/icons/add.png b/old/org.eclipse.emf.ecp.editor/icons/add.png
new file mode 100644
index 0000000..0210873
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.editor/icons/add.png
Binary files differ
diff --git a/old/org.eclipse.emf.ecp.editor/icons/add.xcf b/old/org.eclipse.emf.ecp.editor/icons/add.xcf
new file mode 100644
index 0000000..5538ec0
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.editor/icons/add.xcf
Binary files differ
diff --git a/old/org.eclipse.emf.ecp.editor/icons/arrow_down.png b/old/org.eclipse.emf.ecp.editor/icons/arrow_down.png
new file mode 100644
index 0000000..1493151
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.editor/icons/arrow_down.png
Binary files differ
diff --git a/old/org.eclipse.emf.ecp.editor/icons/arrow_up.png b/old/org.eclipse.emf.ecp.editor/icons/arrow_up.png
new file mode 100644
index 0000000..594a274
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.editor/icons/arrow_up.png
Binary files differ
diff --git a/old/org.eclipse.emf.ecp.editor/icons/bullet.jpg b/old/org.eclipse.emf.ecp.editor/icons/bullet.jpg
new file mode 100644
index 0000000..4112c47
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.editor/icons/bullet.jpg
Binary files differ
diff --git a/old/org.eclipse.emf.ecp.editor/icons/close.png b/old/org.eclipse.emf.ecp.editor/icons/close.png
new file mode 100644
index 0000000..b9991c2
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.editor/icons/close.png
Binary files differ
diff --git a/old/org.eclipse.emf.ecp.editor/icons/collapsed.png b/old/org.eclipse.emf.ecp.editor/icons/collapsed.png
new file mode 100644
index 0000000..8ff65fb
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.editor/icons/collapsed.png
Binary files differ
diff --git a/old/org.eclipse.emf.ecp.editor/icons/commentReply.png b/old/org.eclipse.emf.ecp.editor/icons/commentReply.png
new file mode 100644
index 0000000..9c11450
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.editor/icons/commentReply.png
Binary files differ
diff --git a/old/org.eclipse.emf.ecp.editor/icons/comments.png b/old/org.eclipse.emf.ecp.editor/icons/comments.png
new file mode 100644
index 0000000..39433cf
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.editor/icons/comments.png
Binary files differ
diff --git a/old/org.eclipse.emf.ecp.editor/icons/dark.png b/old/org.eclipse.emf.ecp.editor/icons/dark.png
new file mode 100644
index 0000000..d8c71d6
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.editor/icons/dark.png
Binary files differ
diff --git a/old/org.eclipse.emf.ecp.editor/icons/delete.gif b/old/org.eclipse.emf.ecp.editor/icons/delete.gif
new file mode 100644
index 0000000..c5d817c
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.editor/icons/delete.gif
Binary files differ
diff --git a/old/org.eclipse.emf.ecp.editor/icons/delete.png b/old/org.eclipse.emf.ecp.editor/icons/delete.png
new file mode 100644
index 0000000..08f2493
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.editor/icons/delete.png
Binary files differ
diff --git a/old/org.eclipse.emf.ecp.editor/icons/drive_error.png b/old/org.eclipse.emf.ecp.editor/icons/drive_error.png
new file mode 100644
index 0000000..309f639
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.editor/icons/drive_error.png
Binary files differ
diff --git a/old/org.eclipse.emf.ecp.editor/icons/drive_go.png b/old/org.eclipse.emf.ecp.editor/icons/drive_go.png
new file mode 100644
index 0000000..fc53379
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.editor/icons/drive_go.png
Binary files differ
diff --git a/old/org.eclipse.emf.ecp.editor/icons/expanded.png b/old/org.eclipse.emf.ecp.editor/icons/expanded.png
new file mode 100644
index 0000000..487e0b7
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.editor/icons/expanded.png
Binary files differ
diff --git a/old/org.eclipse.emf.ecp.editor/icons/guest_thumb.png b/old/org.eclipse.emf.ecp.editor/icons/guest_thumb.png
new file mode 100644
index 0000000..64b8961
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.editor/icons/guest_thumb.png
Binary files differ
diff --git a/old/org.eclipse.emf.ecp.editor/icons/link.png b/old/org.eclipse.emf.ecp.editor/icons/link.png
new file mode 100644
index 0000000..25eacb7
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.editor/icons/link.png
Binary files differ
diff --git a/old/org.eclipse.emf.ecp.editor/icons/link_add.png b/old/org.eclipse.emf.ecp.editor/icons/link_add.png
new file mode 100644
index 0000000..56262a0
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.editor/icons/link_add.png
Binary files differ
diff --git a/old/org.eclipse.emf.ecp.editor/icons/link_with_navigator.gif b/old/org.eclipse.emf.ecp.editor/icons/link_with_navigator.gif
new file mode 100644
index 0000000..870934b
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.editor/icons/link_with_navigator.gif
Binary files differ
diff --git a/old/org.eclipse.emf.ecp.editor/icons/mail.png b/old/org.eclipse.emf.ecp.editor/icons/mail.png
new file mode 100644
index 0000000..ab0f6e7
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.editor/icons/mail.png
Binary files differ
diff --git a/old/org.eclipse.emf.ecp.editor/icons/page_add.png b/old/org.eclipse.emf.ecp.editor/icons/page_add.png
new file mode 100644
index 0000000..d5bfa07
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.editor/icons/page_add.png
Binary files differ
diff --git a/old/org.eclipse.emf.ecp.editor/icons/page_go.png b/old/org.eclipse.emf.ecp.editor/icons/page_go.png
new file mode 100644
index 0000000..80fe1ed
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.editor/icons/page_go.png
Binary files differ
diff --git a/old/org.eclipse.emf.ecp.editor/icons/redcross.gif b/old/org.eclipse.emf.ecp.editor/icons/redcross.gif
new file mode 100644
index 0000000..61dd861
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.editor/icons/redcross.gif
Binary files differ
diff --git a/old/org.eclipse.emf.ecp.editor/icons/remove.png b/old/org.eclipse.emf.ecp.editor/icons/remove.png
new file mode 100644
index 0000000..53ac962
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.editor/icons/remove.png
Binary files differ
diff --git a/old/org.eclipse.emf.ecp.editor/icons/text.png b/old/org.eclipse.emf.ecp.editor/icons/text.png
new file mode 100644
index 0000000..dd65786
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.editor/icons/text.png
Binary files differ
diff --git a/old/org.eclipse.emf.ecp.editor/icons/text_bold.png b/old/org.eclipse.emf.ecp.editor/icons/text_bold.png
new file mode 100644
index 0000000..889ae80
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.editor/icons/text_bold.png
Binary files differ
diff --git a/old/org.eclipse.emf.ecp.editor/icons/text_italic.png b/old/org.eclipse.emf.ecp.editor/icons/text_italic.png
new file mode 100644
index 0000000..8482ac8
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.editor/icons/text_italic.png
Binary files differ
diff --git a/old/org.eclipse.emf.ecp.editor/icons/text_link.png b/old/org.eclipse.emf.ecp.editor/icons/text_link.png
new file mode 100644
index 0000000..25eacb7
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.editor/icons/text_link.png
Binary files differ
diff --git a/old/org.eclipse.emf.ecp.editor/icons/text_list_bullets.png b/old/org.eclipse.emf.ecp.editor/icons/text_list_bullets.png
new file mode 100644
index 0000000..4a8672b
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.editor/icons/text_list_bullets.png
Binary files differ
diff --git a/old/org.eclipse.emf.ecp.editor/icons/text_list_numbers.png b/old/org.eclipse.emf.ecp.editor/icons/text_list_numbers.png
new file mode 100644
index 0000000..33b0b8d
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.editor/icons/text_list_numbers.png
Binary files differ
diff --git a/old/org.eclipse.emf.ecp.editor/icons/text_strikethrough.png b/old/org.eclipse.emf.ecp.editor/icons/text_strikethrough.png
new file mode 100644
index 0000000..612058a
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.editor/icons/text_strikethrough.png
Binary files differ
diff --git a/old/org.eclipse.emf.ecp.editor/icons/validation_error.png b/old/org.eclipse.emf.ecp.editor/icons/validation_error.png
new file mode 100644
index 0000000..441ac19
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.editor/icons/validation_error.png
Binary files differ
diff --git a/old/org.eclipse.emf.ecp.editor/icons/world_link.png b/old/org.eclipse.emf.ecp.editor/icons/world_link.png
new file mode 100644
index 0000000..b8edc12
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.editor/icons/world_link.png
Binary files differ
diff --git a/old/org.eclipse.emf.ecp.editor/plugin.xml b/old/org.eclipse.emf.ecp.editor/plugin.xml
new file mode 100644
index 0000000..af72ec3
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.editor/plugin.xml
@@ -0,0 +1,128 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+<plugin>
+ <extension-point id="org.eclipse.emf.ecp.editor.attributecontrols" name="org.eclipse.emf.ecp.editor.attributecontrols" schema="schema/org.eclipse.emf.ecp.editor.attributecontrol.exsd"/>
+ <extension-point id="org.eclipse.emf.ecp.editor.referencecontrols" name="org.eclipse.emf.ecp.editor.referencecontrols" schema="schema/org.eclipse.emf.ecp.editor.referencecontrol.exsd"/>
+ <extension-point id="org.eclipse.emf.ecp.editor.pages" name="org.eclipse.emf.ecp.editor.pages" schema="schema/org.eclipse.emf.ecp.editor.pages.exsd"/>
+ <extension-point id="org.eclipse.emf.ecp.editor.melinkcontrols" name="org.eclipse.emf.ecp.editor.melinkcontrols" schema="schema/org.eclipse.emf.ecp.editor.melinkcontrol.exsd"/>
+ <extension-point id="org.eclipse.emf.ecp.editor.statusmessage" name="Status Message" schema="schema/org.eclipse.emf.ecp.editor.statusmessage.exsd"/>
+ <extension
+ point="org.eclipse.emf.ecp.editor.attributecontrols">
+ <widget
+ class="org.eclipse.emf.ecp.editor.mecontrols.MEBoolControl"
+ name="org.eclipse.emf.ecp.editor.meboolcontrol"
+ showLabel="true"
+ type="java.lang.Boolean">
+ </widget>
+ <widget
+ class="org.eclipse.emf.ecp.editor.mecontrols.MEIntControl"
+ name="org.eclipse.emf.ecp.editor.meintcontrol"
+ showLabel="true"
+ type="java.lang.Integer">
+ </widget>
+ <widget
+ class="org.eclipse.emf.ecp.editor.mecontrols.MESWTDateAndTimeControl"
+ name="org.eclipse.emf.ecp.editor.medatecontrol"
+ showLabel="true"
+ type="java.util.Date">
+ </widget>
+ <widget
+ class="org.eclipse.emf.ecp.editor.mecontrols.MEEnumControl"
+ name="org.eclipse.emf.ecp.editor.meenumcontrol"
+ showLabel="true"
+ type="java.lang.Enum">
+ </widget>
+ <widget
+ class="org.eclipse.emf.ecp.editor.mecontrols.MERichTextControl"
+ name="org.eclipse.emf.ecp.editor.merichtextcontrol"
+ showLabel="true"
+ type="java.lang.String">
+ </widget>
+ <widget
+ class="org.eclipse.emf.ecp.editor.mecontrols.METextControl"
+ name="org.eclipse.emf.ecp.editor.metextcontrol"
+ showLabel="true"
+ type="java.lang.String">
+ </widget>
+ <widget
+ class="org.eclipse.emf.ecp.editor.mecontrols.multiattributecontrol.StringMultiAttributeControl"
+ name="org.eclipse.emf.ecp.editor.multistringcontrol"
+ showLabel="true"
+ type="java.lang.String">
+ </widget>
+ <widget
+ class="org.eclipse.emf.ecp.editor.mecontrols.multiattributecontrol.IntegerMultiAttributeControl"
+ name="org.eclipse.emf.ecp.editor.multiintegercontrol"
+ showLabel="true"
+ type="java.lang.Integer">
+ </widget>
+ <widget
+ class="org.eclipse.emf.ecp.editor.mecontrols.MEDoubleControl"
+ name="org.eclipse.emf.ecp.editor.medoublecontrol"
+ showLabel="true"
+ type="java.lang.Double">
+ </widget>
+ </extension>
+ <extension
+ point="org.eclipse.ui.commands">
+ <command
+ defaultHandler="org.eclipse.emf.ecp.editor.commands.OpenModelElementHandler"
+ id="org.eclipse.emf.ecp.editor.openModelElement"
+ name="OpenModelElement">
+ </command>
+ </extension>
+ <extension
+ point="org.eclipse.ui.editors">
+ <editor
+ class="org.eclipse.emf.ecp.editor.MEEditor"
+ default="false"
+ id="org.eclipse.emf.ecp.editor"
+ name="Model Element Editor">
+ </editor>
+ </extension>
+ <extension
+ point="org.eclipse.emf.ecp.editor.referencecontrols">
+ <widget
+ class="org.eclipse.emf.ecp.editor.mecontrols.melinkcontrol.MESingleLinkControl"
+ name="org.eclipse.emf.ecp.editor.mesinglelinkcontrol"
+ showLabel="true"
+ type="org.eclipse.emf.ecore.EObject">
+ </widget>
+ <widget
+ class="org.eclipse.emf.ecp.editor.mecontrols.melinkcontrol.MEMultiLinkControl"
+ name="org.eclipse.emf.ecp.editor.memultilinkcontrol"
+ showLabel="false"
+ type="org.eclipse.emf.ecore.EObject">
+ </widget>
+ <widget
+ class="org.eclipse.emf.ecp.editor.mecontrols.melinkcontrol.associationclasscontrol.AssociationClassControl"
+ name="org.eclipse.emf.ecp.editor.associationclasscontrol"
+ showLabel="false"
+ type="org.eclipse.emf.ecore.EObject">
+ </widget>
+ <widget
+ class="org.eclipse.emf.ecp.editor.mecontrols.melinkcontrol.associationclasscontrol.AssociationClassControlNoNew"
+ name="org.eclipse.emf.ecp.editor.associationclasscontrolnonew"
+ showLabel="true"
+ type="org.eclipse.emf.ecore.EObject">
+ </widget>
+ </extension>
+ <extension
+ point="org.eclipse.emf.ecp.editor.melinkcontrols">
+ <widget
+ class="org.eclipse.emf.ecp.editor.mecontrols.melinkcontrol.associationclasscontrol.AssociationClassLink"
+ name="org.eclipse.emf.ecp.editor.associationclasslink"
+ type="org.eclipse.emf.ecore.EObject">
+ </widget>
+ <widget
+ class="org.eclipse.emf.ecp.editor.mecontrols.melinkcontrol.associationclasscontrol.AssociationClassLinkNoDelete"
+ name="org.eclipse.emf.ecp.editor.associationclasslinknodelete"
+ type="org.eclipse.emf.ecore.EObject">
+ </widget>
+ <widget
+ class="org.eclipse.emf.ecp.editor.mecontrols.melinkcontrol.associationclasscontrol.AssociationClassLinkNotShow"
+ name="org.eclipse.emf.ecp.editor.associationclasslinknotshow"
+ type="org.eclipse.emf.ecore.EObject">
+ </widget>
+ </extension>
+</plugin>
diff --git a/old/org.eclipse.emf.ecp.editor/pom.xml b/old/org.eclipse.emf.ecp.editor/pom.xml
new file mode 100644
index 0000000..32713f3
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.editor/pom.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.eclipse.emf.emfstore</groupId>
+ <artifactId>emfstore-parent</artifactId>
+ <version>0.9.3-SNAPSHOT</version>
+ <relativePath>../../org.eclipse.emf.emfstore.releng/emfstore-parent/</relativePath>
+ </parent>
+ <groupId>org.eclipse.emf.emfstore</groupId>
+ <artifactId>org.eclipse.emf.ecp.editor</artifactId>
+ <version>0.9.3-SNAPSHOT</version>
+ <packaging>eclipse-plugin</packaging>
+</project>
diff --git a/old/org.eclipse.emf.ecp.editor/schema/org.eclipse.emf.ecp.editor.attributecontrol.exsd b/old/org.eclipse.emf.ecp.editor/schema/org.eclipse.emf.ecp.editor.attributecontrol.exsd
new file mode 100644
index 0000000..93652d0
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.editor/schema/org.eclipse.emf.ecp.editor.attributecontrol.exsd
@@ -0,0 +1,118 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- Schema file written by PDE -->
+<schema targetNamespace="org.eclipse.emf.ecp.editor" xmlns="http://www.w3.org/2001/XMLSchema">
+<annotation>
+ <appinfo>
+ <meta.schema plugin="org.eclipse.emf.ecp.editor" id="org.eclipse.emf.ecp.editor.attributecontrols" name="org.eclipse.emf.ecp.editor.attributecontrols"/>
+ </appinfo>
+ <documentation>
+ Allows to register MEControls replacing standard widgets of the MEEditor for attributes (not references).
+ </documentation>
+ </annotation>
+
+ <element name="extension">
+ <annotation>
+ <appinfo>
+ <meta.element />
+ </appinfo>
+ </annotation>
+ <complexType>
+ <sequence>
+ <element ref="widget" minOccurs="1" maxOccurs="unbounded"/>
+ </sequence>
+ <attribute name="point" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="id" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="name" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appinfo>
+ <meta.attribute translatable="true"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="widget">
+ <complexType>
+ <attribute name="name" type="string" use="required">
+ <annotation>
+ <documentation>
+ Name of the new Control
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="class" type="string" use="required">
+ <annotation>
+ <documentation>
+ The Implementation
+ </documentation>
+ <appinfo>
+ <meta.attribute kind="java" basedOn="org.eclipse.emf.ecp.editor.mecontrols.AbstractMEControl:"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ <attribute name="type" type="string" use="required">
+ <annotation>
+ <documentation>
+ The type of attribut the control renders
+ </documentation>
+ <appinfo>
+ <meta.attribute kind="java" basedOn=":org.eclipse.emf.ecore.EDataType"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ <attribute name="showLabel" type="boolean">
+ <annotation>
+ <documentation>
+ If the Editor display a label naming the attribut.
+ </documentation>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="since"/>
+ </appinfo>
+ <documentation>
+ 0.4.0
+ </documentation>
+ </annotation>
+
+
+ <annotation>
+ <appinfo>
+ <meta.section type="apiinfo"/>
+ </appinfo>
+ <documentation>
+ New Controls should inherit AbstractMEControl
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="implementation"/>
+ </appinfo>
+ <documentation>
+ [Enter information about supplied implementation of this extension point.]
+ </documentation>
+ </annotation>
+
+
+</schema>
diff --git a/old/org.eclipse.emf.ecp.editor/schema/org.eclipse.emf.ecp.editor.melinkcontrol.exsd b/old/org.eclipse.emf.ecp.editor/schema/org.eclipse.emf.ecp.editor.melinkcontrol.exsd
new file mode 100644
index 0000000..6ff7571
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.editor/schema/org.eclipse.emf.ecp.editor.melinkcontrol.exsd
@@ -0,0 +1,119 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- Schema file written by PDE -->
+<schema targetNamespace="org.eclipse.emf.ecp.editor" xmlns="http://www.w3.org/2001/XMLSchema">
+<annotation>
+ <appinfo>
+ <meta.schema plugin="org.eclipse.emf.ecp.editor" id="org.eclipse.emf.ecp.editor.melinkcontrols" name="melinkcontrol"/>
+ </appinfo>
+ <documentation>
+ Allows to replace the Hyperlink widget inside of the MELinkControl.
+ </documentation>
+ </annotation>
+
+ <element name="extension">
+ <annotation>
+ <appinfo>
+ <meta.element />
+ </appinfo>
+ </annotation>
+ <complexType>
+ <sequence minOccurs="1" maxOccurs="unbounded">
+ <element ref="widget"/>
+ </sequence>
+ <attribute name="point" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="id" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="name" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appinfo>
+ <meta.attribute translatable="true"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="widget">
+ <complexType>
+ <attribute name="name" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="class" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appinfo>
+ <meta.attribute kind="java" basedOn="org.eclipse.emf.ecp.editor.mecontrols.melinkcontrol.MELinkControl:"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ <attribute name="type" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appinfo>
+ <meta.attribute kind="java" basedOn=":org.eclipse.emf.ecore.EObject"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="since"/>
+ </appinfo>
+ <documentation>
+ 0.4.0
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="examples"/>
+ </appinfo>
+ <documentation>
+ [Enter extension point usage example here.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="apiinfo"/>
+ </appinfo>
+ <documentation>
+ [Enter API information here.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="implementation"/>
+ </appinfo>
+ <documentation>
+ [Enter information about supplied implementation of this extension point.]
+ </documentation>
+ </annotation>
+
+
+</schema>
diff --git a/old/org.eclipse.emf.ecp.editor/schema/org.eclipse.emf.ecp.editor.pages.exsd b/old/org.eclipse.emf.ecp.editor/schema/org.eclipse.emf.ecp.editor.pages.exsd
new file mode 100644
index 0000000..648c34b
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.editor/schema/org.eclipse.emf.ecp.editor.pages.exsd
@@ -0,0 +1,134 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- Schema file written by PDE -->
+<schema targetNamespace="org.eclipse.emf.ecp.editor" xmlns="http://www.w3.org/2001/XMLSchema">
+<annotation>
+ <appinfo>
+ <meta.schema plugin="org.eclipse.emf.ecp.editor" id="org.eclipse.emf.ecp.editor.pages" name="org.eclipse.emf.ecp.editor.pages"/>
+ </appinfo>
+ <documentation>
+ Allows to add pages to the MEEditor.
+ </documentation>
+ </annotation>
+
+ <element name="extension">
+ <annotation>
+ <appinfo>
+ <meta.element />
+ </appinfo>
+ </annotation>
+ <complexType>
+ <sequence>
+ <element ref="page"/>
+ </sequence>
+ <attribute name="point" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="id" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="name" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appinfo>
+ <meta.attribute translatable="true"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="page">
+ <complexType>
+ <attribute name="name" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="class" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appinfo>
+ <meta.attribute kind="java" basedOn="org.eclipse.emf.ecp.editor.AbstractMEEditorPage:"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ <attribute name="after" type="string">
+ <annotation>
+ <documentation>
+ After which page this page should be displayed. If the referenced page does not exist, the position is undefined.
+ </documentation>
+ <appinfo>
+ <meta.attribute kind="identifier" basedOn="org.eclipse.emf.ecp.editor.pages/page/@name"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ <attribute name="replace" type="string">
+ <annotation>
+ <documentation>
+ Which pages should be replaced by this one. If none of the referenced page exists, this page is simply added as if it wouldn't have the replace attribute set. If some replaced pages exist, they will be omitted and this page will be shown instead.
+
+The page will be placed where one of the replaced pages would have been placed. (Which one is undefined)
+
+To replace pages enter their names (the value of their name attribute) seperated by commas.
+
+Examples:
+examplePage would replace the page with the name examplePage.
+examplePage,examplePage2 would replace the pages named examplePage and examplePage2.
+ </documentation>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="since"/>
+ </appinfo>
+ <documentation>
+ 0.4.1
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="examples"/>
+ </appinfo>
+ <documentation>
+ [Enter extension point usage example here.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="apiinfo"/>
+ </appinfo>
+ <documentation>
+ [Enter API information here.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="implementation"/>
+ </appinfo>
+ <documentation>
+ [Enter information about supplied implementation of this extension point.]
+ </documentation>
+ </annotation>
+
+
+</schema>
diff --git a/old/org.eclipse.emf.ecp.editor/schema/org.eclipse.emf.ecp.editor.referencecontrol.exsd b/old/org.eclipse.emf.ecp.editor/schema/org.eclipse.emf.ecp.editor.referencecontrol.exsd
new file mode 100644
index 0000000..5261cdb
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.editor/schema/org.eclipse.emf.ecp.editor.referencecontrol.exsd
@@ -0,0 +1,126 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- Schema file written by PDE -->
+<schema targetNamespace="org.eclipse.emf.ecp.editor" xmlns="http://www.w3.org/2001/XMLSchema">
+<annotation>
+ <appinfo>
+ <meta.schema plugin="org.eclipse.emf.ecp.editor" id="org.eclipse.emf.ecp.editor.referencecontrols" name="org.eclipse.emf.ecp.editor.referencecontrols"/>
+ </appinfo>
+ <documentation>
+ Allows to add new or replace existing controls in the MEEditor, which render reference attributes, single or multi.
+ </documentation>
+ </annotation>
+
+ <element name="extension">
+ <annotation>
+ <appinfo>
+ <meta.element />
+ </appinfo>
+ </annotation>
+ <complexType>
+ <sequence>
+ <element ref="widget" minOccurs="1" maxOccurs="unbounded"/>
+ </sequence>
+ <attribute name="point" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="id" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="name" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appinfo>
+ <meta.attribute translatable="true"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="widget">
+ <complexType>
+ <attribute name="name" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="class" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appinfo>
+ <meta.attribute kind="java" basedOn="org.eclipse.emf.ecp.editor.mecontrols.AbstractMEControl:"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ <attribute name="type" type="string" use="required">
+ <annotation>
+ <documentation>
+ The type of the opposite element of a reference.
+ </documentation>
+ <appinfo>
+ <meta.attribute kind="java" basedOn=":org.eclipse.emf.ecore.EObject"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ <attribute name="showLabel" type="boolean">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="since"/>
+ </appinfo>
+ <documentation>
+ 0.4.0
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="examples"/>
+ </appinfo>
+ <documentation>
+ [Enter extension point usage example here.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="apiinfo"/>
+ </appinfo>
+ <documentation>
+ [Enter API information here.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="implementation"/>
+ </appinfo>
+ <documentation>
+ [Enter information about supplied implementation of this extension point.]
+ </documentation>
+ </annotation>
+
+
+</schema>
diff --git a/old/org.eclipse.emf.ecp.editor/schema/org.eclipse.emf.ecp.editor.statusmessage.exsd b/old/org.eclipse.emf.ecp.editor/schema/org.eclipse.emf.ecp.editor.statusmessage.exsd
new file mode 100644
index 0000000..0f7888c
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.editor/schema/org.eclipse.emf.ecp.editor.statusmessage.exsd
@@ -0,0 +1,102 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- Schema file written by PDE -->
+<schema targetNamespace="org.eclipse.emf.ecp.editor" xmlns="http://www.w3.org/2001/XMLSchema">
+<annotation>
+ <appinfo>
+ <meta.schema plugin="org.eclipse.emf.ecp.editor" id="org.eclipse.emf.ecp.editor.statusmessage" name="Status Message Provider"/>
+ </appinfo>
+ <documentation>
+ A Status Message Provider returns the status message displayed when w certain element is opened.
+ </documentation>
+ </annotation>
+
+ <element name="extension">
+ <annotation>
+ <appinfo>
+ <meta.element />
+ </appinfo>
+ </annotation>
+ <complexType>
+ <sequence>
+ <element ref="provider"/>
+ </sequence>
+ <attribute name="point" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="id" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="name" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appinfo>
+ <meta.attribute translatable="true"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="provider">
+ <complexType>
+ <attribute name="class" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appinfo>
+ <meta.attribute kind="java" basedOn=":org.eclipse.emf.ecp.editor.StatusMessageProvider"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="since"/>
+ </appinfo>
+ <documentation>
+ 0.4.4
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="examples"/>
+ </appinfo>
+ <documentation>
+ [Enter extension point usage example here.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="apiinfo"/>
+ </appinfo>
+ <documentation>
+ [Enter API information here.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="implementation"/>
+ </appinfo>
+ <documentation>
+ [Enter information about supplied implementation of this extension point.]
+ </documentation>
+ </annotation>
+
+
+</schema>
diff --git a/old/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/AbstractMEEditorPage.java b/old/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/AbstractMEEditorPage.java
new file mode 100644
index 0000000..0569db4
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/AbstractMEEditorPage.java
@@ -0,0 +1,34 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2011 Chair for Applied Software Engineering,
+ * Technische Universitaet Muenchen.
+ * 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:
+ ******************************************************************************/
+package org.eclipse.emf.ecp.editor;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.edit.domain.EditingDomain;
+import org.eclipse.ui.forms.editor.FormPage;
+
+/**
+ * An abstract class for the MEEditorPages.
+ *
+ * @author shterev
+ */
+public abstract class AbstractMEEditorPage {
+
+ /**
+ * Default init.
+ *
+ * @param editor the {@link MEEditor}
+ * @param editingDomain the editingDomain
+ * @param modelElement the modelElement
+ * @return FormPage
+ */
+ public abstract FormPage createPage(MEEditor editor, EditingDomain editingDomain, EObject modelElement);
+
+}
\ No newline at end of file
diff --git a/old/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/Activator.java b/old/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/Activator.java
new file mode 100644
index 0000000..f4acc95
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/Activator.java
@@ -0,0 +1,88 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2011 Chair for Applied Software Engineering,
+ * Technische Universitaet Muenchen.
+ * 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:
+ ******************************************************************************/
+package org.eclipse.emf.ecp.editor;
+
+import org.eclipse.core.runtime.Status;
+import org.eclipse.jface.resource.ImageDescriptor;
+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 {
+
+ /**
+ * The plug-in ID.
+ */
+ public static final String PLUGIN_ID = "org.eclipse.emf.ecp.editor";
+
+ /**
+ * The shared instance.
+ */
+ private static Activator plugin;
+
+ /**
+ * The constructor.
+ */
+ public Activator() {
+ }
+
+ /**
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+ * @generated
+ */
+ @Override
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ plugin = this;
+ }
+
+ /**
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+ * @generated
+ */
+ @Override
+ public void stop(BundleContext context) throws Exception {
+ plugin = null;
+ super.stop(context);
+ }
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static Activator getDefault() {
+ return plugin;
+ }
+
+ /**
+ * Returns an image descriptor for the image file at the given. plug-in relative path
+ *
+ * @param path the path
+ * @return the image descriptor
+ */
+ public static ImageDescriptor getImageDescriptor(String path) {
+ return imageDescriptorFromPlugin(PLUGIN_ID, path);
+ }
+
+ /**
+ * Logs exception.
+ *
+ * @param e
+ */
+ public static void logException(Exception e) {
+ getDefault().getLog().log(
+ new Status(Status.ERROR, Activator.getDefault().getBundle().getSymbolicName(), e.getMessage(), e));
+ }
+
+}
\ No newline at end of file
diff --git a/old/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/AnnotationHiddenDescriptor.java b/old/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/AnnotationHiddenDescriptor.java
new file mode 100644
index 0000000..53ad18c
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/AnnotationHiddenDescriptor.java
@@ -0,0 +1,46 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2011 Chair for Applied Software Engineering,
+ * Technische Universitaet Muenchen.
+ * 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:
+ ******************************************************************************/
+package org.eclipse.emf.ecp.editor;
+
+import org.eclipse.emf.ecore.EAnnotation;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
+
+/**
+ * A {@link IAttributeDescriptor} using the annotation in the genmodel.
+ */
+public class AnnotationHiddenDescriptor implements IAttributeDescriptor<Boolean> {
+
+ private final Boolean defaultValue = new Boolean(false);
+
+ /**
+ * Returns true, if feature associated with given.
+ * {@link IItemPropertyDescriptor} marked with hidden=true annotation
+ *
+ * @see org.eclipse.emf.ecp.editor.IAttributeDescriptor#getValue(org.eclipse.emf.edit.provider.IItemPropertyDescriptor,
+ * org.eclipse.emf.ecore.EObject)
+ * @param propertyDescriptor
+ * the {@link IItemPropertyDescriptor}
+ * @param modelElement
+ * the {@link EObject}
+ * @return isHidden as boolean
+ */
+ public Boolean getValue(IItemPropertyDescriptor propertyDescriptor,
+ EObject modelElement) {
+ EAnnotation priority = ((EStructuralFeature) propertyDescriptor.getFeature(modelElement))
+ .getEAnnotation("org.eclipse.emf.ecp.editor");
+ if (priority == null || priority.getDetails() == null || priority.getDetails().get("hidden") == null) {
+ return defaultValue;
+ }
+ return Boolean.parseBoolean(priority.getDetails().get("hidden"));
+ }
+}
\ No newline at end of file
diff --git a/old/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/AnnotationPositionDescriptor.java b/old/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/AnnotationPositionDescriptor.java
new file mode 100644
index 0000000..a38d245
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/AnnotationPositionDescriptor.java
@@ -0,0 +1,40 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2011 Chair for Applied Software Engineering,
+ * Technische Universitaet Muenchen.
+ * 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:
+ ******************************************************************************/
+package org.eclipse.emf.ecp.editor;
+
+import org.eclipse.emf.ecore.EAnnotation;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
+
+/**
+ * A {@link IAttributeDescriptor} using the annotation in the genmodel.
+ *
+ * @author Shterev
+ */
+public class AnnotationPositionDescriptor implements IAttributeDescriptor<String> {
+
+ private String defaultValue = "left";
+
+ /**
+ * {@inheritDoc}
+ */
+ public String getValue(IItemPropertyDescriptor propertyDescriptor, EObject modelElement) {
+ EAnnotation priority = ((EStructuralFeature) propertyDescriptor.getFeature(modelElement))
+ .getEAnnotation("org.eclipse.emf.ecp.editor");
+ if (priority == null || priority.getDetails() == null || priority.getDetails().get("position") == null) {
+ return defaultValue;
+ }
+ String s = priority.getDetails().get("position");
+ return s;
+ }
+
+}
\ No newline at end of file
diff --git a/old/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/AnnotationPriorityDescriptor.java b/old/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/AnnotationPriorityDescriptor.java
new file mode 100644
index 0000000..98de740
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/AnnotationPriorityDescriptor.java
@@ -0,0 +1,40 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2011 Chair for Applied Software Engineering,
+ * Technische Universitaet Muenchen.
+ * 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:
+ ******************************************************************************/
+package org.eclipse.emf.ecp.editor;
+
+import org.eclipse.emf.ecore.EAnnotation;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
+
+/**
+ * A {@link IAttributeDescriptor} using the annotation in the genmodel.
+ *
+ * @author Shterev
+ */
+public class AnnotationPriorityDescriptor implements IAttributeDescriptor<Double> {
+
+ private double defaultValue = 100.0;
+
+ /**
+ * {@inheritDoc}
+ */
+ public Double getValue(IItemPropertyDescriptor propertyDescriptor, EObject modelElement) {
+ EAnnotation priority = ((EStructuralFeature) propertyDescriptor.getFeature(modelElement))
+ .getEAnnotation("org.eclipse.emf.ecp.editor");
+ if (priority == null || priority.getDetails() == null || priority.getDetails().get("priority") == null) {
+ return defaultValue;
+ }
+ String s = priority.getDetails().get("priority");
+ return Double.parseDouble(s);
+ }
+
+}
\ No newline at end of file
diff --git a/old/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/CategoryDescriptor.java b/old/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/CategoryDescriptor.java
new file mode 100644
index 0000000..a62ebe6
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/CategoryDescriptor.java
@@ -0,0 +1,35 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2011 Chair for Applied Software Engineering,
+ * Technische Universitaet Muenchen.
+ * 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:
+ ******************************************************************************/
+package org.eclipse.emf.ecp.editor;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
+
+/**
+ * A {@link IAttributeDescriptor} using the category property in the genmodel.
+ *
+ * @author shterevg
+ */
+public class CategoryDescriptor implements IAttributeDescriptor<Double> {
+
+ /**
+ * {@inheritDoc}
+ */
+ public Double getValue(IItemPropertyDescriptor propertyDescriptor, EObject modelElement) {
+ String s = propertyDescriptor.getCategory(modelElement);
+ if (s == null) {
+ s = "100.0";
+ }
+ double ret = Double.parseDouble(s);
+ return ret;
+ }
+
+}
\ No newline at end of file
diff --git a/old/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/ControlFactory.java b/old/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/ControlFactory.java
new file mode 100644
index 0000000..710ea9b
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/ControlFactory.java
@@ -0,0 +1,196 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2011 Chair for Applied Software Engineering,
+ * Technische Universitaet Muenchen.
+ * 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:
+ ******************************************************************************/
+package org.eclipse.emf.ecp.editor;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.Set;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.emf.ecore.EAttribute;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EReference;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.ecp.common.model.ECPModelelementContext;
+import org.eclipse.emf.ecp.editor.mecontrols.AbstractMEControl;
+import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
+
+/**
+ * Factory for generating {@link AbstractMEControl}'s according to a {@link IItemPropertyDescriptor}.
+ *
+ * @author shterev
+ */
+public class ControlFactory {
+ private HashMap<Class<?>, ArrayList<AbstractMEControl>> controlRegistry;
+
+ /**
+ * Default constructor.
+ */
+ public ControlFactory() {
+ controlRegistry = new HashMap<Class<?>, ArrayList<AbstractMEControl>>();
+ initializeMEControls();
+ }
+
+ private void initializeMEControls() {
+ IConfigurationElement[] attributecontrols = Platform.getExtensionRegistry().getConfigurationElementsFor(
+ "org.eclipse.emf.ecp.editor.attributecontrols");
+ IConfigurationElement[] referencecontrols = Platform.getExtensionRegistry().getConfigurationElementsFor(
+ "org.eclipse.emf.ecp.editor.referencecontrols");
+ ArrayList<IConfigurationElement> allControls = new ArrayList<IConfigurationElement>();
+ allControls.addAll(Arrays.asList(attributecontrols));
+ allControls.addAll(Arrays.asList(referencecontrols));
+ for (IConfigurationElement e : allControls) {
+ String type = e.getAttribute("type");
+ try {
+ AbstractMEControl control = (AbstractMEControl) e.createExecutableExtension("class");
+ Class<?> resolvedType = control.getClass().getClassLoader().loadClass(type);
+ boolean showLabel = Boolean.parseBoolean(e.getAttribute("showLabel"));
+ control.setShowLabel(showLabel);
+ ArrayList<AbstractMEControl> list = controlRegistry.get(resolvedType);
+ if (list == null) {
+ list = new ArrayList<AbstractMEControl>();
+ }
+ list.add(control);
+ controlRegistry.put(resolvedType, list);
+
+ } catch (ClassNotFoundException e1) {
+ Activator.logException(e1);
+ } catch (CoreException e2) {
+ Activator.logException(e2);
+ }
+ }
+
+ }
+
+ /**
+ * Creates a {@link AbstractMEControl} according to the {@link IItemPropertyDescriptor}.
+ *
+ * @param itemPropertyDescriptor the descriptor
+ * @param modelElement model element
+ * @return the {@link AbstractMEControl}
+ */
+ public AbstractMEControl createControl(IItemPropertyDescriptor itemPropertyDescriptor, EObject modelElement) {
+ return createControl(itemPropertyDescriptor, modelElement, null);
+ }
+
+ /**
+ * Creates a {@link AbstractMEControl} according to the {@link IItemPropertyDescriptor}.
+ *
+ * @param itemPropertyDescriptor the descriptor
+ * @param modelElement model element
+ * @param context model element context
+ * @return the {@link AbstractMEControl}
+ */
+ public AbstractMEControl createControl(IItemPropertyDescriptor itemPropertyDescriptor, EObject modelElement,
+ ECPModelelementContext context) {
+
+ EStructuralFeature feature = (EStructuralFeature) itemPropertyDescriptor.getFeature(modelElement);
+ if (feature instanceof EAttribute) {
+ return createAttribute(itemPropertyDescriptor, feature, modelElement, context);
+ } else if (feature instanceof EReference) {
+ return createReferenceControl(itemPropertyDescriptor, (EReference) feature, modelElement, context);
+ }
+
+ return null;
+ }
+
+ private AbstractMEControl createReferenceControl(IItemPropertyDescriptor itemPropertyDescriptor,
+ EReference feature, EObject modelElement, ECPModelelementContext context) {
+ Class<?> instanceClass = feature.getEType().getInstanceClass();
+ Set<Class<?>> keySet = controlRegistry.keySet();
+ ArrayList<AbstractMEControl> candidates = new ArrayList<AbstractMEControl>();
+ for (Class<?> clazz : keySet) {
+ if (clazz.isAssignableFrom(instanceClass)) {
+ candidates.addAll(controlRegistry.get(clazz));
+ }
+ }
+ AbstractMEControl control = getBestCandidate(candidates, itemPropertyDescriptor, feature, modelElement, context);
+ AbstractMEControl ret = null;
+ if (control == null) {
+ return null;
+ }
+ try {
+ ret = control.getClass().newInstance();
+ ret.setShowLabel(control.getShowLabel());
+ } catch (InstantiationException e) {
+ // Do nothing
+ } catch (IllegalAccessException e) {
+ // Do nothing
+ }
+ return ret;
+ }
+
+ private AbstractMEControl createAttribute(IItemPropertyDescriptor itemPropertyDescriptor,
+ EStructuralFeature feature, EObject modelElement, ECPModelelementContext context) {
+ Class<?> instanceClass = ((EAttribute) feature).getEAttributeType().getInstanceClass();
+ // Test which controls have a fitting type
+ // TODO: could be chached?
+ Set<Class<?>> keySet = controlRegistry.keySet();
+ ArrayList<AbstractMEControl> candidates = new ArrayList<AbstractMEControl>();
+ for (Class<?> clazz : keySet) {
+ if (instanceClass.isPrimitive()) {
+ try {
+ Class<?> primitive = (Class<?>) clazz.getField("TYPE").get(null);
+ if (primitive.equals(instanceClass)) {
+ candidates.addAll(controlRegistry.get(clazz));
+ }
+
+ } catch (IllegalArgumentException e) {
+ // Do nothing
+ } catch (SecurityException e) {
+ // Do nothing
+ } catch (IllegalAccessException e) {
+ // Do nothing
+ } catch (NoSuchFieldException e) {
+ // Do nothing
+ }
+ }
+ if (clazz.isAssignableFrom(instanceClass)) {
+ candidates.addAll(controlRegistry.get(clazz));
+ }
+ }
+ AbstractMEControl control = getBestCandidate(candidates, itemPropertyDescriptor, feature, modelElement, context);
+ AbstractMEControl ret = null;
+ if (control == null) {
+ return null;
+ }
+ try {
+ ret = control.getClass().newInstance();
+ ret.setShowLabel(control.getShowLabel());
+ } catch (InstantiationException e) {
+ // Do nothing
+ } catch (IllegalAccessException e) {
+ // Do nothing
+ }
+ return ret;
+
+ }
+
+ private AbstractMEControl getBestCandidate(ArrayList<AbstractMEControl> candidates,
+ IItemPropertyDescriptor itemPropertyDescriptor, EStructuralFeature feature, EObject modelElement,
+ ECPModelelementContext context) {
+ int bestValue = 0;
+ AbstractMEControl bestCandidate = null;
+ for (AbstractMEControl abstractMEControl : candidates) {
+ abstractMEControl.setContext(context);
+ int newValue = abstractMEControl.canRender(itemPropertyDescriptor, modelElement);
+ if (newValue > bestValue) {
+ bestCandidate = abstractMEControl;
+ bestValue = newValue;
+ }
+ }
+ return bestCandidate;
+ }
+
+}
\ No newline at end of file
diff --git a/old/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/IAttributeDescriptor.java b/old/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/IAttributeDescriptor.java
new file mode 100644
index 0000000..696cf0e
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/IAttributeDescriptor.java
@@ -0,0 +1,30 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2011 Chair for Applied Software Engineering,
+ * Technische Universitaet Muenchen.
+ * 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:
+ ******************************************************************************/
+package org.eclipse.emf.ecp.editor;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
+
+/**
+ * Provides the priorities for a given attribute of a ME.
+ *
+ * @param <A> the type of description (integer/string/double/etc.) for this attribute
+ * @author shterevg
+ */
+public interface IAttributeDescriptor<A> {
+
+ /**
+ * @param propertyDescriptor the property descriptor
+ * @param modelElement the model element
+ * @return Returns the property from a given propertyDescriptor as an A value.
+ */
+ A getValue(IItemPropertyDescriptor propertyDescriptor, EObject modelElement);
+}
\ No newline at end of file
diff --git a/old/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/MEEditor.java b/old/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/MEEditor.java
new file mode 100644
index 0000000..a2c4089
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/MEEditor.java
@@ -0,0 +1,345 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2011 Chair for Applied Software Engineering,
+ * Technische Universitaet Muenchen.
+ * 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:
+ ******************************************************************************/
+package org.eclipse.emf.ecp.editor;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecp.common.model.ECPModelelementContext;
+import org.eclipse.emf.ecp.common.model.ModelElementContextListener;
+import org.eclipse.emf.ecp.common.utilities.ShortLabelProvider;
+import org.eclipse.emf.edit.domain.EditingDomain;
+import org.eclipse.jface.viewers.ILabelProviderListener;
+import org.eclipse.jface.viewers.LabelProviderChangedEvent;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.swt.SWTException;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IEditorSite;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.forms.editor.FormPage;
+import org.eclipse.ui.forms.editor.SharedHeaderFormEditor;
+
+/**
+ * GUI view for editing MEs.
+ *
+ * @author helming
+ * @author naughton
+ */
+public class MEEditor extends SharedHeaderFormEditor {
+
+ /**
+ * The Id for MEEditor. We need this to open a model element.
+ */
+ public static final String ID = "org.eclipse.emf.ecp.editor";
+
+ private EObject modelElement;
+ private EditingDomain editingDomain;
+ private MEEditorPage mePage;
+
+ private ILabelProviderListener labelProviderListener;
+
+ private StatusMessageProvider statusMessageProvider;
+
+ private ModelElementChangeListener modelElementChangeListener;
+
+ private ECPModelelementContext modelElementContext;
+
+ private ModelElementContextListener modelElementContextListener;
+
+ /**
+ * Default constructor.
+ */
+ public MEEditor() {
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void addPages() {
+ String editorID = "Edit";
+ String editorDesc = "Standard View";
+ MEEditorInput editorInput = (MEEditorInput) getEditorInput();
+
+ // add pages from the extension point
+ IConfigurationElement[] configTemp = Platform.getExtensionRegistry().getConfigurationElementsFor(
+ "org.eclipse.emf.ecp.editor.pages");
+ IConfigurationElement[] configIn = null;
+
+ boolean replaceMEEditor = false;
+ int counter = 0;
+
+ for (int i = 0; i < configTemp.length; i++) {
+ if (configTemp[i].getAttribute("replace") != null && configTemp[i].getAttribute("replace").equals(editorID)) {
+ // if a replacement is found, create this page, so it becomes the first one
+ replaceMEEditor = true;
+ AbstractMEEditorPage newPage;
+
+ try {
+ newPage = (AbstractMEEditorPage) configTemp[i].createExecutableExtension("class");
+ FormPage createPage = newPage.createPage(this, editingDomain, modelElement);
+ if (createPage != null) {
+ addPage(createPage);
+ }
+ } catch (CoreException e1) {
+ Activator.logException(e1);
+ }
+
+ // put remaining pages into the original configIn array
+ configIn = new IConfigurationElement[configTemp.length - 1];
+ for (int j = 0, k = 0; j < configTemp.length - 1; j++, k++) {
+ if (counter == j) {
+ j--;
+ } else {
+ configIn[j] = configTemp[k];
+ }
+ }
+
+ break;
+ }
+ counter++;
+ }
+
+ // create original MEEditor standard view if no replacement exists
+ // and put remaining pages into the original configIn array
+ if (!replaceMEEditor) {
+ try {
+ if (editorInput.getProblemFeature() != null) {
+ mePage = new MEEditorPage(this, editorID, editorDesc, modelElementContext, modelElement,
+ editorInput.getProblemFeature());
+ } else {
+ mePage = new MEEditorPage(this, editorID, editorDesc, modelElementContext, modelElement);
+ }
+
+ addPage(mePage);
+ configIn = configTemp;
+ } catch (PartInitException e) {
+ // JH Auto-generated catch block
+ Activator.logException(e);
+ }
+ }
+
+ // Sort the pages by the "after" attribute and omit replaced pages
+ List<IConfigurationElement> config = PageCandidate.getPages(configIn);
+ for (IConfigurationElement e : config) {
+ try {
+ AbstractMEEditorPage newPage = (AbstractMEEditorPage) e.createExecutableExtension("class");
+ FormPage createPage = newPage.createPage(this, editingDomain, modelElement);
+ if (createPage != null) {
+ addPage(createPage);
+ }
+ } catch (CoreException e1) {
+ Activator.logException(e1);
+ }
+ }
+
+ // commentsPage = new METhreadPage(this, "Discussion", "Discussion", editingDomain, modelElement);
+ // descriptionPage = new MEDescriptionPage(this, "Description", "Description", editingDomain, modelElement);
+ // addPage(descriptionPage);
+ // addPage(commentsPage);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void doSave(IProgressMonitor monitor) {
+ // do nothing (Jonas said so)
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void doSaveAs() {
+ }
+
+ /**
+ * Save is not allowed as the editor can only modify model elements.
+ *
+ * @return false
+ */
+ @Override
+ public boolean isSaveAsAllowed() {
+ return false;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void init(IEditorSite site, final IEditorInput input) throws PartInitException {
+ super.init(site, input);
+ if (input instanceof MEEditorInput) {
+ setInput(input);
+ final MEEditorInput meInput = (MEEditorInput) input;
+ modelElement = meInput.getModelElement();
+ setPartName((new ShortLabelProvider()).getText(modelElement));
+ setTitleImage(input.getImageDescriptor().createImage());
+ modelElementContext = meInput.getModelElementContext();
+ initializeEditingDomain();
+
+ modelElementContextListener = new ModelElementContextListener() {
+
+ @Override
+ public void onModelElementDeleted(EObject deleted) {
+ if (modelElement == deleted) {
+ close(false);
+ } else {
+ if (!modelElementContext.contains(modelElement)) {
+ close(false);
+ }
+ }
+
+ }
+
+ @Override
+ public void onContextDeleted() {
+ onModelElementDeleted(modelElement);
+
+ }
+ };
+ modelElementContext.addModelElementContextListener(modelElementContextListener);
+ modelElementChangeListener = new ModelElementChangeListener(modelElement) {
+
+ @Override
+ public void onChange(Notification notification) {
+ Display.getDefault().asyncExec(new Runnable() {
+ public void run() {
+ updateIcon(input);
+ setPartName((new ShortLabelProvider()).getText(modelElement));
+ if (mePage != null) {
+ mePage.updateSectionTitle();
+ mePage.updateLiveValidation();
+ }
+ updateStatusMessage();
+ }
+ });
+
+ }
+ };
+
+ initStatusProvider();
+ updateStatusMessage();
+
+ labelProviderListener = new ILabelProviderListener() {
+ public void labelProviderChanged(LabelProviderChangedEvent event) {
+ updateIcon(meInput);
+ }
+ };
+ meInput.getLabelProvider().addListener(labelProviderListener);
+
+ } else {
+ throw new PartInitException("MEEditor is only appliable for MEEditorInputs");
+ }
+ }
+
+ private void initStatusProvider() {
+ IConfigurationElement[] configurationElements = Platform.getExtensionRegistry().getConfigurationElementsFor(
+ "org.eclipse.emf.ecp.editor.statusmessage");
+ ArrayList<IConfigurationElement> provider = new ArrayList<IConfigurationElement>();
+ provider.addAll(Arrays.asList(configurationElements));
+ int priority = 0;
+ for (IConfigurationElement e : provider) {
+ try {
+ StatusMessageProvider statusMessageProvider = (StatusMessageProvider) e
+ .createExecutableExtension("class");
+ int newpriority = statusMessageProvider.canRender(modelElement);
+ if (newpriority > priority) {
+ priority = newpriority;
+ this.statusMessageProvider = statusMessageProvider;
+ }
+ } catch (CoreException e1) {
+ Activator.logException(e1);
+ }
+ }
+ }
+
+ private void updateStatusMessage() {
+ if (statusMessageProvider != null) {
+ getEditorSite().getActionBars().getStatusLineManager()
+ .setMessage(statusMessageProvider.getMessage(modelElement));
+ }
+ }
+
+ /**
+ * Initializes the editing domain for this model element.
+ */
+ protected void initializeEditingDomain() {
+ this.editingDomain = modelElementContext.getEditingDomain();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public boolean isDirty() {
+ // we do always save immediately so we are never dirty
+ return false;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void setFocus() {
+
+ super.setFocus();
+ if (mePage != null) {
+ mePage.setFocus();
+ }
+ updateStatusMessage();
+ getSite().getSelectionProvider().setSelection(new StructuredSelection(modelElement));
+
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void dispose() {
+ modelElementChangeListener.remove();
+ modelElementContext.removeModelElementContextListener(modelElementContextListener);
+ ((MEEditorInput) getEditorInput()).getLabelProvider().removeListener(labelProviderListener);
+ ((MEEditorInput) getEditorInput()).dispose();
+ super.dispose();
+ }
+
+ private void updateIcon(IEditorInput input) {
+ Image titleImage = input.getImageDescriptor().createImage();
+ setTitleImage(titleImage);
+ // TODO AS: Debug why sometimes the page is null - not disposed Adapter?
+ if (mePage != null) {
+ try {
+ mePage.getManagedForm().getForm().setImage(titleImage);
+ } catch (SWTException e) {
+ // Catch in case Editor is directly closed after change.
+ }
+ }
+ }
+
+ /**
+ * Returns the ECP model element context.
+ * @return the model element context.
+ */
+ public ECPModelelementContext getModelElementContext() {
+ return modelElementContext;
+ }
+}
\ No newline at end of file
diff --git a/old/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/MEEditorInput.java b/old/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/MEEditorInput.java
new file mode 100644
index 0000000..6fa347f
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/MEEditorInput.java
@@ -0,0 +1,222 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2011 Chair for Applied Software Engineering,
+ * Technische Universitaet Muenchen.
+ * 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:
+ ******************************************************************************/
+package org.eclipse.emf.ecp.editor;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.ecp.common.model.ECPModelelementContext;
+import org.eclipse.emf.edit.provider.ComposedAdapterFactory;
+import org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider;
+import org.eclipse.jface.dialogs.IDialogConstants;
+import org.eclipse.jface.dialogs.InputDialog;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.viewers.DecoratingLabelProvider;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.IDecoratorManager;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IPersistableElement;
+import org.eclipse.ui.PlatformUI;
+
+/**
+ * The {@link IEditorInput} for the {@link MEEditor}.
+ *
+ * @author helming
+ * @author shterev
+ * @author naughton
+ */
+public class MEEditorInput implements IEditorInput {
+
+ private EObject modelElement;
+ private EStructuralFeature problemFeature;
+ private DecoratingLabelProvider labelProvider;
+ private ECPModelelementContext modelElementContext;
+ private ComposedAdapterFactory adapterFactory;
+
+ /**
+ * Constructor to add a probleFeature.
+ *
+ * @param me the model element to open
+ * @param context context of the model element
+ * @param problemFeature the problem feature
+ */
+ public MEEditorInput(EObject me, ECPModelelementContext context, EStructuralFeature problemFeature) {
+ this(me, context);
+ this.problemFeature = problemFeature;
+ }
+
+ /**
+ * Default constructor.
+ *
+ * @param me the modelElement
+ * @param context context of the modelelement
+ */
+ public MEEditorInput(EObject me, ECPModelelementContext context) {
+ super();
+ adapterFactory = new ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry.INSTANCE);
+ AdapterFactoryLabelProvider adapterFactoryLabelProvider = new AdapterFactoryLabelProvider(adapterFactory);
+ IDecoratorManager decoratorManager = PlatformUI.getWorkbench().getDecoratorManager();
+ labelProvider = new DecoratingLabelProvider(adapterFactoryLabelProvider, decoratorManager.getLabelDecorator());
+ this.modelElement = me;
+ this.modelElementContext = context;
+ if (labelProvider.getLabelProvider().getText(modelElement) == null) {
+ final Shell activeShell = Display.getCurrent().getActiveShell();
+ boolean doSetName = MessageDialog
+ .openQuestion(
+ activeShell,
+ "Missing title",
+ "The element you are trying to open does not have a proper name and cannot be opened.\nDo you want to set a custom name for it or use a default one?");
+ String newName = "new " + modelElement.eClass().getName();
+ if (doSetName) {
+ final InputDialog inputDialog = new InputDialog(activeShell, "New title",
+ "Please enter the new name for this element", newName, null);
+ inputDialog.setBlockOnOpen(true);
+ if (inputDialog.open() == IDialogConstants.OK_ID && inputDialog.getValue() != "") {
+ newName = inputDialog.getValue();
+ }
+
+ }
+ }
+ }
+
+ /**
+ * Getter for the label provider.
+ *
+ * @return the label provider
+ */
+ public DecoratingLabelProvider getLabelProvider() {
+ return labelProvider;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public boolean exists() {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public ImageDescriptor getImageDescriptor() {
+ ImageDescriptor descriptor = ImageDescriptor.createFromImage(labelProvider.getImage(modelElement));
+ return descriptor;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public String getName() {
+ return labelProvider.getLabelProvider().getText(modelElement);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public IPersistableElement getPersistable() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public String getToolTipText() {
+ return getName();
+ }
+
+ /**
+ * Getter for the modelElement.
+ *
+ * @return the modelElement
+ */
+ public EObject getModelElement() {
+ return modelElement;
+ }
+
+ /**
+ * Setter for the modelElement.
+ *
+ * @param modelElement the modelElement
+ */
+ public void setModelElement(EObject modelElement) {
+ this.modelElement = modelElement;
+ }
+
+ /**
+ * @return the problemFeature
+ */
+ public EStructuralFeature getProblemFeature() {
+ return problemFeature;
+ }
+
+ /**
+ * @param problemFeature the problemFeature to set
+ */
+ public void setProblemFeature(EStructuralFeature problemFeature) {
+ this.problemFeature = problemFeature;
+ }
+
+ /**
+ * Custom equals() for this class.
+ *
+ * @param obj the compared object.
+ * @return the boolean state. {@inheritDoc}
+ */
+ @Override
+ public boolean equals(Object obj) {
+ if (obj instanceof MEEditorInput) {
+ MEEditorInput other = (MEEditorInput) obj;
+ boolean ret = modelElement.equals(other.modelElement);
+ return ret;
+ }
+ return false;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public int hashCode() {
+ return 0;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public Object getAdapter(@SuppressWarnings("rawtypes") Class clazz) {
+
+ if (clazz.equals(EObject.class)) {
+ return getModelElement();
+ }
+ return null;
+ }
+
+ /**
+ * Returns the {@link ECPModelelemenContext}.
+ *
+ * @return {@link ECPModelelementContext}
+ */
+ public ECPModelelementContext getModelElementContext() {
+ return modelElementContext;
+ }
+
+ /**
+ * Disposes this editor input.
+ */
+ public void dispose() {
+ if (adapterFactory != null) {
+ adapterFactory.dispose();
+ }
+ }
+}
\ No newline at end of file
diff --git a/old/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/MEEditorPage.java b/old/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/MEEditorPage.java
new file mode 100644
index 0000000..44b0548
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/MEEditorPage.java
@@ -0,0 +1,423 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2011 Chair for Applied Software Engineering,
+ * Technische Universitaet Muenchen.
+ * 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:
+ ******************************************************************************/
+package org.eclipse.emf.ecp.editor;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.emf.common.util.Diagnostic;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.ecore.util.Diagnostician;
+import org.eclipse.emf.ecp.common.commands.DeleteModelElementCommand;
+import org.eclipse.emf.ecp.common.model.ECPModelelementContext;
+import org.eclipse.emf.ecp.common.utilities.ShortLabelProvider;
+import org.eclipse.emf.ecp.editor.mecontrols.AbstractMEControl;
+import org.eclipse.emf.ecp.editor.mecontrols.FeatureHintTooltipSupport;
+import org.eclipse.emf.ecp.editor.mecontrols.IValidatableControl;
+import org.eclipse.emf.ecp.editor.mecontrols.METextControl;
+import org.eclipse.emf.edit.provider.AdapterFactoryItemDelegator;
+import org.eclipse.emf.edit.provider.ComposedAdapterFactory;
+import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
+import org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider;
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.ContributionManager;
+import org.eclipse.jface.fieldassist.ControlDecoration;
+import org.eclipse.jface.layout.GridDataFactory;
+import org.eclipse.jface.layout.GridLayoutFactory;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.SWTException;
+import org.eclipse.swt.custom.SashForm;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.ui.AbstractSourceProvider;
+import org.eclipse.ui.ISharedImages;
+import org.eclipse.ui.ISourceProvider;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.forms.IManagedForm;
+import org.eclipse.ui.forms.editor.FormPage;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+import org.eclipse.ui.forms.widgets.ScrolledForm;
+import org.eclipse.ui.menus.IMenuService;
+import org.eclipse.ui.services.IEvaluationService;
+
+/**
+ * The editor page for the {@link MEEditor}.
+ *
+ * @author helming
+ * @author shterev
+ * @author naughton
+ */
+public class MEEditorPage extends FormPage {
+
+ private EObject modelElement;
+ private FormToolkit toolkit;
+ private Map<EStructuralFeature, AbstractMEControl> meControls = new HashMap<EStructuralFeature, AbstractMEControl>();
+
+ private Map<AbstractMEControl, Diagnostic> valdiatedControls = new HashMap<AbstractMEControl, Diagnostic>();
+ private static String activeModelelement = "activeModelelement";
+ private ScrolledForm form;
+ private List<IItemPropertyDescriptor> leftColumnAttributes = new ArrayList<IItemPropertyDescriptor>();
+ private List<IItemPropertyDescriptor> rightColumnAttributes = new ArrayList<IItemPropertyDescriptor>();
+ private List<IItemPropertyDescriptor> bottomAttributes = new ArrayList<IItemPropertyDescriptor>();
+ private Composite leftColumnComposite;
+ private Composite rightColumnComposite;
+ private Composite bottomComposite;
+ private EStructuralFeature problemFeature;
+ private final ECPModelelementContext modelElementContext;
+ private final ComposedAdapterFactory adapterFactory;
+
+ /**
+ * Default constructor.
+ *
+ * @param editor
+ * the {@link MEEditor}
+ * @param id
+ * the {@link FormPage#id}
+ * @param title
+ * the title
+ * @param modelElement
+ * the modelElement
+ * @param modelElementContext
+ * the {@link ModelElementContext}
+ */
+ public MEEditorPage(MEEditor editor, String id, String title, ECPModelelementContext modelElementContext,
+ EObject modelElement) {
+ super(editor, id, title);
+ this.modelElementContext = modelElementContext;
+ this.modelElement = modelElement;
+ this.adapterFactory = new ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry.INSTANCE);
+
+ }
+
+ /**
+ * Default constructor.
+ *
+ * @param editor
+ * the {@link MEEditor}
+ * @param id
+ * the {@link FormPage#id}
+ * @param title
+ * the title
+ * @param modelElement
+ * the modelElement
+ * @param problemFeature
+ * the problemFeature
+ * @param modelElementContext
+ * the {@link ModelElementContext}
+ */
+ public MEEditorPage(MEEditor editor, String id, String title, ECPModelelementContext modelElementContext,
+ EObject modelElement, EStructuralFeature problemFeature) {
+ this(editor, id, title, modelElementContext, modelElement);
+ this.problemFeature = problemFeature;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void createFormContent(IManagedForm managedForm) {
+ super.createFormContent(managedForm);
+
+ toolkit = this.getEditor().getToolkit();
+ form = managedForm.getForm();
+ toolkit.decorateFormHeading(form.getForm());
+ Composite body = form.getBody();
+ body.setLayout(new GridLayout());
+ Composite topComposite = toolkit.createComposite(body);
+ topComposite.setLayout(new GridLayout());
+ GridDataFactory.fillDefaults().align(SWT.FILL, SWT.FILL).grab(true, true).applyTo(topComposite);
+
+ sortAndOrderAttributes();
+ if (!rightColumnAttributes.isEmpty()) {
+ SashForm topSash = new SashForm(topComposite, SWT.HORIZONTAL);
+ GridDataFactory.fillDefaults().align(SWT.FILL, SWT.FILL).grab(true, true).applyTo(topSash);
+ toolkit.adapt(topSash, true, true);
+ topSash.setSashWidth(4);
+ leftColumnComposite = toolkit.createComposite(topSash, SWT.NONE);
+ rightColumnComposite = toolkit.createComposite(topSash, SWT.NONE);
+ GridLayoutFactory.fillDefaults().numColumns(1).equalWidth(false).extendedMargins(5, 2, 5, 5)
+ .applyTo(rightColumnComposite);
+ GridDataFactory.fillDefaults().align(SWT.FILL, SWT.FILL).applyTo(rightColumnComposite);
+ int[] topWeights = { 50, 50 };
+ topSash.setWeights(topWeights);
+ } else {
+ leftColumnComposite = toolkit.createComposite(topComposite, SWT.NONE);
+ }
+
+ GridLayoutFactory.fillDefaults().numColumns(1).equalWidth(false).extendedMargins(2, 5, 5, 5)
+ .applyTo(leftColumnComposite);
+ GridDataFactory.fillDefaults().align(SWT.FILL, SWT.FILL).applyTo(leftColumnComposite);
+
+ bottomComposite = toolkit.createComposite(topComposite);
+ GridLayoutFactory.fillDefaults().numColumns(1).equalWidth(false).extendedMargins(0, 0, 0, 0)
+ .applyTo(bottomComposite);
+ GridDataFactory.fillDefaults().align(SWT.FILL, SWT.FILL).grab(true, true).applyTo(bottomComposite);
+ // updateSectionTitle();
+ form.setImage(new AdapterFactoryLabelProvider(adapterFactory).getImage(modelElement));
+ // Sort and order attributes
+ // Create attributes
+ createAttributes(leftColumnComposite, leftColumnAttributes);
+ if (!rightColumnAttributes.isEmpty()) {
+ createAttributes(rightColumnComposite, rightColumnAttributes);
+ }
+ createAttributes(bottomComposite, bottomAttributes);
+ createToolbar();
+ form.pack();
+ updateSectionTitle();
+ updateLiveValidation();
+ }
+
+ /**
+ * Updates the name of the section.
+ */
+ public void updateSectionTitle() {
+ // Layout form
+ ShortLabelProvider shortLabelProvider = new ShortLabelProvider();
+ String name = shortLabelProvider.getText(modelElement);
+
+ name += " [" + modelElement.eClass().getName() + "]";
+ try {
+ form.setText(name);
+ } catch (SWTException e) {
+ // Catch in case editor is closed directly after change
+ }
+ }
+
+ private void createToolbar() {
+ IMenuService menuService = (IMenuService) PlatformUI.getWorkbench().getService(IMenuService.class);
+ ISourceProvider sourceProvider = new AbstractSourceProvider() {
+ public void dispose() {
+ }
+
+ @SuppressWarnings("rawtypes")
+ public Map getCurrentState() {
+ HashMap<Object, Object> map = new HashMap<Object, Object>();
+ map.put(activeModelelement, modelElement);
+ return map;
+ }
+
+ public String[] getProvidedSourceNames() {
+ String[] namens = new String[1];
+ namens[0] = activeModelelement;
+ return namens;
+ }
+
+ };
+
+ IEvaluationService service = (IEvaluationService) PlatformUI.getWorkbench()
+ .getService(IEvaluationService.class);
+ service.addSourceProvider(sourceProvider);
+ form.getToolBarManager().add(new Action("", Activator.getImageDescriptor("icons/delete.gif")) {
+
+ @Override
+ public void run() {
+ new DeleteModelElementCommand(modelElement, modelElementContext).run();
+ }
+ });
+ menuService.populateContributionManager((ContributionManager) form.getToolBarManager(),
+ "toolbar:org.eclipse.emf.ecp.editor.MEEditorPage");
+ form.getToolBarManager().update(true);
+ }
+
+ /**
+ * Filters attributes marked with "hidden=true" annotation.
+ *
+ * @param propertyDescriptors property descriptors to filter
+ */
+ private void filterHiddenAttributes(Collection<IItemPropertyDescriptor> propertyDescriptors) {
+ Iterator<IItemPropertyDescriptor> iterator = propertyDescriptors.iterator();
+
+ AnnotationHiddenDescriptor visibilityDescriptor = new AnnotationHiddenDescriptor();
+
+ while (iterator.hasNext()) {
+ IItemPropertyDescriptor descriptor = iterator.next();
+
+ if (visibilityDescriptor.getValue(descriptor, modelElement)) {
+ iterator.remove();
+ }
+ }
+ }
+
+ private void sortAndOrderAttributes() {
+
+ AdapterFactoryItemDelegator adapterFactoryItemDelegator = new AdapterFactoryItemDelegator(adapterFactory);
+
+ Collection<IItemPropertyDescriptor> propertyDescriptors = adapterFactoryItemDelegator
+ .getPropertyDescriptors(modelElement);
+
+ if (propertyDescriptors != null) {
+ filterHiddenAttributes(propertyDescriptors);
+ AnnotationPositionDescriptor positionDescriptor = new AnnotationPositionDescriptor();
+ for (IItemPropertyDescriptor itemPropertyDescriptor : propertyDescriptors) {
+ String value = positionDescriptor.getValue(itemPropertyDescriptor, modelElement);
+ if (value.equals("left")) {
+ leftColumnAttributes.add(itemPropertyDescriptor);
+ } else if (value.equals("right")) {
+ rightColumnAttributes.add(itemPropertyDescriptor);
+ } else if (value.equals("bottom")) {
+ bottomAttributes.add(itemPropertyDescriptor);
+ } else {
+ leftColumnAttributes.add(itemPropertyDescriptor);
+ }
+ }
+
+ final HashMap<IItemPropertyDescriptor, Double> priorityMap = new HashMap<IItemPropertyDescriptor, Double>();
+ AnnotationPriorityDescriptor priorityDescriptor = new AnnotationPriorityDescriptor();
+ for (IItemPropertyDescriptor itemPropertyDescriptor : propertyDescriptors) {
+ priorityMap.put(itemPropertyDescriptor,
+ priorityDescriptor.getValue(itemPropertyDescriptor, modelElement));
+ }
+
+ Comparator<IItemPropertyDescriptor> comparator = new Comparator<IItemPropertyDescriptor>() {
+ public int compare(IItemPropertyDescriptor o1, IItemPropertyDescriptor o2) {
+ return Double.compare(priorityMap.get(o1), priorityMap.get(o2));
+ }
+ };
+ Collections.sort(leftColumnAttributes, comparator);
+ Collections.sort(rightColumnAttributes, comparator);
+ Collections.sort(bottomAttributes, comparator);
+
+ }
+
+ }
+
+ private void createAttributes(Composite column, List<IItemPropertyDescriptor> attributes) {
+ Composite attributeComposite = toolkit.createComposite(column);
+ GridLayoutFactory.fillDefaults().numColumns(2).applyTo(attributeComposite);
+ GridDataFactory.fillDefaults().grab(true, true).align(SWT.FILL, SWT.BEGINNING).indent(10, 0)
+ .applyTo(attributeComposite);
+
+ ControlFactory controlFactory = new ControlFactory();
+
+ for (IItemPropertyDescriptor itemPropertyDescriptor : attributes) {
+ AbstractMEControl meControl = controlFactory.createControl(itemPropertyDescriptor, modelElement,
+ modelElementContext);
+ if (meControl == null) {
+ continue;
+ }
+ meControls.put((EStructuralFeature) itemPropertyDescriptor.getFeature(modelElement), meControl);
+ Control control;
+ if (meControl.getShowLabel()) {
+ Label label = toolkit.createLabel(attributeComposite,
+ itemPropertyDescriptor.getDisplayName(modelElement));
+ label.setData(modelElement);
+ FeatureHintTooltipSupport.enableFor(label, itemPropertyDescriptor);
+ control = meControl.createControl(attributeComposite, SWT.WRAP, itemPropertyDescriptor, modelElement,
+ modelElementContext, toolkit);
+ GridDataFactory.fillDefaults().align(SWT.LEFT, SWT.CENTER).applyTo(label);
+ GridDataFactory.fillDefaults().grab(true, false).align(SWT.FILL, SWT.BEGINNING).indent(10, 0)
+ .applyTo(control);
+ meControl.applyCustomLayoutData();
+ } else {
+ control = meControl.createControl(attributeComposite, SWT.WRAP, itemPropertyDescriptor, modelElement,
+ modelElementContext, toolkit);
+ control.setData(modelElement);
+ FeatureHintTooltipSupport.enableFor(control, itemPropertyDescriptor);
+ GridDataFactory.fillDefaults().span(2, 1).grab(true, true).align(SWT.FILL, SWT.BEGINNING).indent(10, 0)
+ .applyTo(control);
+ }
+ if (itemPropertyDescriptor.getFeature(modelElement) == problemFeature) {
+ ControlDecoration dec = new ControlDecoration(control, SWT.TOP | SWT.LEFT);
+ dec.setImage(PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJS_ERROR_TSK));
+ dec.setDescriptionText("Problem detected.");
+ }
+
+ }
+
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void dispose() {
+ for (AbstractMEControl control : meControls.values()) {
+ control.dispose();
+ }
+ if (adapterFactory != null) {
+ adapterFactory.dispose();
+ }
+ super.dispose();
+ }
+
+ /**
+ * {@inheritDoc} This method is added to solve the focus bug of navigator.
+ * Every time that a ME is opened in editor, navigator has to lose focus so
+ * that its action contributions are set correctly for next time.
+ */
+ @Override
+ public void setFocus() {
+ super.setFocus();
+ // set keyboard focus on the first Text control
+ for (AbstractMEControl meControl : this.meControls.values()) {
+ if (meControl instanceof METextControl) {
+ ((METextControl) meControl).setFocus();
+ return;
+ }
+ }
+ leftColumnComposite.setFocus();
+ }
+
+ /**
+ * Triggers live validation of the model attributes.
+ * **/
+ public void updateLiveValidation() {
+ Diagnostic diagnostic = Diagnostician.INSTANCE.validate(modelElement);
+ List<AbstractMEControl> affectedControls = new ArrayList<AbstractMEControl>();
+
+ for (Iterator<Diagnostic> i = diagnostic.getChildren().iterator(); i.hasNext();) {
+ Diagnostic childDiagnostic = i.next();
+ Object object = childDiagnostic.getData().get(0);
+ if (object instanceof EObject) {
+ EObject eObject = (EObject) object;
+ if (eObject != modelElement) {
+ continue;
+ }
+ }
+ if (childDiagnostic.getData().size() < 2) {
+ continue;
+ }
+ AbstractMEControl meControl = this.meControls.get(childDiagnostic.getData().get(1));
+ affectedControls.add(meControl);
+ if (meControl instanceof IValidatableControl) {
+ if (this.valdiatedControls.containsKey(meControl)) {
+ if (childDiagnostic.getSeverity() != this.valdiatedControls.get(meControl).getSeverity()) {
+ ((IValidatableControl) meControl).handleValidation(childDiagnostic);
+ this.valdiatedControls.put(meControl, childDiagnostic);
+ }
+ } else {
+ ((IValidatableControl) meControl).handleValidation(childDiagnostic);
+ this.valdiatedControls.put(meControl, childDiagnostic);
+ }
+ }
+ }
+
+ Map<AbstractMEControl, Diagnostic> temp = new HashMap<AbstractMEControl, Diagnostic>();
+ temp.putAll(this.valdiatedControls);
+ for (Map.Entry<AbstractMEControl, Diagnostic> entry : temp.entrySet()) {
+ AbstractMEControl meControl = entry.getKey();
+ if (!affectedControls.contains(meControl)) {
+ this.valdiatedControls.remove(meControl);
+ ((IValidatableControl) meControl).resetValidation();
+ }
+ }
+ }
+
+}
\ No newline at end of file
diff --git a/old/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/MEFormPage.java b/old/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/MEFormPage.java
new file mode 100644
index 0000000..31433f2
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/MEFormPage.java
@@ -0,0 +1,55 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2011 Chair for Applied Software Engineering,
+ * Technische Universitaet Muenchen.
+ * 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:
+ ******************************************************************************/
+package org.eclipse.emf.ecp.editor;
+
+import org.eclipse.ui.forms.editor.FormPage;
+
+/**
+ * @author pfeifferc
+ */
+public class MEFormPage extends FormPage {
+
+ private AbstractMEEditorPage page;
+
+ /**
+ * @param id id
+ * @param title title
+ */
+ public MEFormPage(String id, String title) {
+ super(id, title);
+ }
+
+ /**
+ * @param editor editor
+ * @param id id
+ * @param name name
+ */
+ public MEFormPage(MEEditor editor, String id, String name) {
+ super(editor, id, name);
+ }
+
+ /**
+ * Sets the parent MEPage.
+ *
+ * @param page parent page
+ */
+ public void setParentMEPage(AbstractMEEditorPage page) {
+ this.page = page;
+ }
+
+ /**
+ * @return the parent MEPage
+ */
+ public AbstractMEEditorPage getParentMEPage() {
+ return page;
+ }
+
+}
\ No newline at end of file
diff --git a/old/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/MESuggestedSelectionDialog.java b/old/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/MESuggestedSelectionDialog.java
new file mode 100644
index 0000000..3ebf191
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/MESuggestedSelectionDialog.java
@@ -0,0 +1,194 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2011 Chair for Applied Software Engineering,
+ * Technische Universitaet Muenchen.
+ * 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:
+ ******************************************************************************/
+package org.eclipse.emf.ecp.editor;
+
+import java.util.Collection;
+import java.util.Comparator;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EReference;
+import org.eclipse.emf.ecp.common.dialogs.ModelElementSelectionDialog;
+import org.eclipse.emf.edit.provider.ComposedAdapterFactory;
+import org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Label;
+
+/**
+ * This dialog represents the possibility to select an element from a list where the list is sorted and additional
+ * information can be provided.
+ *
+ * @author Henning Femmer
+ */
+public class MESuggestedSelectionDialog extends ModelElementSelectionDialog {
+
+ // maps modelElement.hashCode() to the similarity factor of the element
+ private Map<EObject, Double> relevanceMap;
+
+ // private RelevanceWrappedLabelProvider labelProvider;
+
+ // private RecommendationManager recMan;
+
+ private Label label;
+ private boolean warning;
+
+ /**
+ * The constructor.
+ *
+ * @param title The title of the dialog
+ * @param message the message displayed
+ * @param blockOnOpen block
+ * @param elements The elements, which can be selected.
+ * @param baseElement The element, to which the selection is made and to which other elements are compared.
+ * @param reference the reference for which this is used
+ */
+ public MESuggestedSelectionDialog(String title, String message, boolean blockOnOpen, EObject baseElement,
+ EReference reference, Collection<EObject> elements) {
+
+ super(reference.isMany());
+
+ setTitle(title);
+ setMessage(message);
+ setBlockOnOpen(blockOnOpen);
+
+ relevanceMap = new HashMap<EObject, Double>(elements.size());
+ setModelElements(elements);
+ // TODO: Reactivate
+ // recMan = RecommendationManager.getInstance();
+ //
+ // if (recMan != null) {
+ // relevanceMap = recMan.getMatchMap(baseElement, reference, elements, new ConstantThresholdSelection(0));
+ // } else {
+ relevanceMap = new HashMap<EObject, Double>();
+ // }
+
+ setLabelProvider(new RelevanceWrappedLabelProvider(relevanceMap));
+ setListLabelProvider(getLabelProvider());
+ setDetailsLabelProvider(new RelevanceDetailsLabelProvider());
+ }
+
+ /**
+ * Does nothing.
+ *
+ * @param parent parent composite
+ * @return null
+ * @see org.eclipse.ui.dialogs.FilteredItemsSelectionDialog#createExtendedContentArea(org.eclipse.swt.widgets.Composite)
+ */
+ @Override
+ protected Control createExtendedContentArea(Composite parent) {
+ if (warning) {
+ label = new Label(parent, SWT.WRAP);
+ label.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, true));
+ label.setForeground(Display.getDefault().getSystemColor(SWT.COLOR_RED));
+ label
+ .setText("This work item does not annotate any model elements. For assignee recommendation to work fine, you should first link this work item with a model element (preferably a functional requirement).");
+ return label;
+ }
+ return null;
+ }
+
+ /**
+ * Compares the names of ModelElements.
+ *
+ * @return a new RelevanceMapComparator
+ * @see org.eclipse.ui.dialogs.FilteredItemsSelectionDialog#getItemsComparator()
+ */
+ @Override
+ protected Comparator<EObject> getItemsComparator() {
+ return new RelevanceMapComparator();
+ }
+
+ /**
+ * This class compares ModelElements with the similarityMap.
+ *
+ * @author henning femmer
+ */
+ class RelevanceMapComparator implements Comparator<EObject> {
+ /**
+ * If both elements got a suggestion their suggestion values are compared, the higher, the better. if just one
+ * got a suggestion, it is preferred. if none, alphabetical comparison is used. {@inheritDoc}
+ *
+ * @see java.util.Comparator#compare(java.lang.Object, java.lang.Object)
+ */
+ public int compare(EObject o1, EObject o2) {
+ Double val1, val2;
+ ComposedAdapterFactory composedAdapterFactory = new ComposedAdapterFactory(
+ ComposedAdapterFactory.Descriptor.Registry.INSTANCE);
+ AdapterFactoryLabelProvider adapterFactoryLabelProvider = new AdapterFactoryLabelProvider(
+ composedAdapterFactory);
+ String name1 = adapterFactoryLabelProvider.getText(o1);
+ String name2 = adapterFactoryLabelProvider.getText(o2);
+
+ val1 = relevanceMap.get(o1);
+ val2 = relevanceMap.get(o2);
+
+ adapterFactoryLabelProvider.dispose();
+ composedAdapterFactory.dispose();
+
+ if (!isRelevant(val1) && !isRelevant(val2)) {
+
+ if (name1 != null && name2 != null) {
+ return name1.compareToIgnoreCase(name2);
+ } else {
+ return 0;
+ }
+ } else if (!isRelevant(val1)) {
+ return 1;
+ } else if (!isRelevant(val2)) {
+ return -1;
+ } else {
+ return val2.compareTo(val1);
+ }
+ }
+
+ }
+
+ private boolean isRelevant(Double val) {
+ return (val != null);
+ }
+
+ /**
+ * This label-provider returns the elements relevance and dateDetails.
+ *
+ * @author henning femmer
+ */
+ class RelevanceDetailsLabelProvider extends LabelProvider {
+ /**
+ * Creates the details.
+ *
+ * @param element the selected element
+ * @return a string with date details and relevance if provided
+ * @see org.eclipse.emf.ecp.editor.MESuggestedSelectionDialog.DateDetailsLabelProvider#getText(java.lang.Object)
+ */
+ @Override
+ public String getText(Object element) {
+ if (element instanceof EObject) {
+ String text = super.getText(element);
+ Double sim = relevanceMap.get(element);
+ if (sim != null) {
+ text = "Relevance: " + sim + ". " + text;
+ }
+ return text;
+ } else if (element == null) {
+ return "No item selected.";
+ } else {
+ return "Multiple elements selected.";
+ }
+ }
+ }
+
+}
\ No newline at end of file
diff --git a/old/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/ModelElementChangeListener.java b/old/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/ModelElementChangeListener.java
new file mode 100644
index 0000000..fcf65c7
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/ModelElementChangeListener.java
@@ -0,0 +1,80 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2011 Chair for Applied Software Engineering,
+ * Technische Universitaet Muenchen.
+ * 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:
+ ******************************************************************************/
+package org.eclipse.emf.ecp.editor;
+
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.notify.impl.AdapterImpl;
+import org.eclipse.emf.ecore.EObject;
+
+/**
+ * Listens to the changes of one modelelement.
+ *
+ * @author helming
+ */
+public abstract class ModelElementChangeListener extends AdapterImpl {
+
+ private final EObject modelelement;
+
+ /**
+ * Default constructor.
+ *
+ * @param modelelement the modelelement to listen on
+ */
+ public ModelElementChangeListener(EObject modelelement) {
+ this.modelelement = modelelement;
+ modelelement.eAdapters().add(this);
+ }
+
+ /**
+ * Handle changes to the model element.
+ *
+ * @param notification the EMF notification, providing details on the change
+ * @return
+ */
+ public abstract void onChange(Notification notification);
+
+ /**
+ * Handle a runtime exception that occured in this listeners methods. NOTE: runtime exceptions of this method will
+ * be logged and silently dropped.
+ *
+ * @param exception the exception
+ */
+ void onRuntimeExceptionInListener(RuntimeException exception) {
+ remove();
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.common.notify.impl.AdapterImpl#notifyChanged(org.eclipse.emf.common.notify.Notification)
+ */
+ @Override
+ public void notifyChanged(Notification notification) {
+ if (notification.isTouch()) {
+ return;
+ }
+ // BEGIN SUPRESS CATCH EXCEPTION
+ try {
+ onChange(notification);
+ } catch (RuntimeException e) {
+ onRuntimeExceptionInListener(e);
+ }
+ // END SUPRESS CATCH EXCEPTION
+ }
+
+ /**
+ * Removes the {@link ModelElementChangeListener}.
+ */
+ public void remove() {
+ modelelement.eAdapters().remove(this);
+ }
+
+}
\ No newline at end of file
diff --git a/old/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/PageCandidate.java b/old/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/PageCandidate.java
new file mode 100644
index 0000000..f8d1499
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/PageCandidate.java
@@ -0,0 +1,184 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2011 Chair for Applied Software Engineering,
+ * Technische Universitaet Muenchen.
+ * 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:
+ ******************************************************************************/
+package org.eclipse.emf.ecp.editor;
+
+import java.util.LinkedHashMap;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+
+import org.eclipse.core.runtime.IConfigurationElement;
+
+/**
+ * Represents a page candidate to be shown in meeditor.
+ *
+ * @author helming
+ */
+public final class PageCandidate {
+
+ // By which pages this page is about to be replaced
+ private List<PageCandidate> replacedBy = new LinkedList<PageCandidate>();
+
+ // Which pages follow after this page
+ private List<PageCandidate> successors = new LinkedList<PageCandidate>();
+
+ // The wrapped configuration element
+ private IConfigurationElement page;
+
+ // If this page is already in the resulting list
+ private boolean enqueued;
+
+ // The mapping from name to page candidate to store all candidates
+ private static Map<String, PageCandidate> candidates = new LinkedHashMap<String, PageCandidate>();
+
+ /**
+ * This method gets an input array of MEEditor pages and performs the tasks "after" and "replace" on them. That
+ * means, pages replaced by others will be omitted and pages with the after attribute set to a valid page name will
+ * be sorted so they appear after that page. If a page that has elements "after" it is replaced, the elements will
+ * instead be after the replacing page.
+ *
+ * @param input A list of MEEditor page candidates (directly from reading the extensions for the pages extension
+ * point)
+ * @return A properly ordered list of all pages to be added to the MEEditor.
+ */
+ public static List<IConfigurationElement> getPages(IConfigurationElement[] input) {
+
+ // Create Page Candidates and store them in the map
+ for (IConfigurationElement i : input) {
+ new PageCandidate(i);
+ }
+
+ // Link them together (build page Tree)
+ linkPages();
+
+ // Determine order
+ List<PageCandidate> orderedPages = determineOrder();
+
+ // The hashmap content is no longer needed
+ candidates.clear();
+
+ // Unwrap ordered Pages and return them.
+ List<IConfigurationElement> result = new LinkedList<IConfigurationElement>();
+ for (PageCandidate p : orderedPages) {
+ result.add(p.page);
+ }
+
+ return result;
+ }
+
+ /**
+ * Constructor of a page candidate.
+ *
+ * @param page the wrapped page
+ */
+ private PageCandidate(IConfigurationElement page) {
+ super();
+ this.page = page;
+ String name = page.getAttribute("name");
+
+ // Entry the page into the candidates map. Log an exception if there are colliding names
+ if (candidates.containsKey(name)) {
+ Activator.logException(new Exception("Two pages to be added to the MEEditor have the same name (" + name
+ + ")! One of them will not be visible."));
+ }
+ candidates.put(name, this);
+ }
+
+ /**
+ * This function links the pages by connecting them via the after and replace attributes. After this, the pages are
+ * linked in a treelike manner which can be used to order them.
+ */
+ private static void linkPages() {
+ // Build the page tree...
+ for (Entry<String, PageCandidate> curEntry : candidates.entrySet()) {
+ PageCandidate cur = curEntry.getValue();
+ // Set replacements if this page has any
+ String r = cur.page.getAttribute("replace");
+ if (r != null) {
+ String[] replacements = r.split(",");
+
+ // Loop over replacements and set them, if they exist
+ for (String s : replacements) {
+ PageCandidate replaced = candidates.get(s.trim());
+ if (replaced != null) {
+ // Replaced page does exist, link them
+ replaced.replacedBy.add(cur);
+ }
+ }
+ }
+
+ // Build the after fields
+ String after = cur.page.getAttribute("after");
+ if (after != null) {
+ PageCandidate before = candidates.get(after);
+ if (before != null) {
+ before.successors.add(cur);
+ }
+ }
+ }
+
+ }
+
+ /**
+ * This function enqueues this page candidate into the List l, unless it is replaced by another page or is already
+ * in the list.
+ *
+ * @param l The list to enqueue this page
+ */
+ private void enqueue(List<PageCandidate> l) {
+
+ // Already enqueued? Skip!
+ if (enqueued) {
+ return;
+ }
+
+ // Was this page replaced?
+ if (replacedBy.size() != 0) {
+
+ // Enqueue all pages that replaced this page
+ for (PageCandidate c : replacedBy) {
+ c.enqueue(l);
+ }
+
+ } else {
+ // This page was not replaced, enqueue it.
+ l.add(this);
+ enqueued = true;
+ }
+
+ // Were some pages tagged "after" this page? Enqueue them!
+ for (PageCandidate c : successors) {
+ c.enqueue(l);
+ }
+ }
+
+ /**
+ * This method determines the ordered resulting page list. Replaced pages will be omitted and all other pages will
+ * be in the desired order
+ *
+ * @return A properly ordered list of all non-replaced page candidates.
+ */
+ private static List<PageCandidate> determineOrder() {
+ List<PageCandidate> result = new LinkedList<PageCandidate>();
+
+ // Loop over all pages and enqueue pages that are not after a specific page
+ // and also do not replace a page. (These pages get enqueued recursively)
+ for (Entry<String, PageCandidate> e : candidates.entrySet()) {
+ PageCandidate p = e.getValue();
+ if (p.successors.size() == 0 && p.replacedBy.size() == 0) {
+ p.enqueue(result);
+ }
+ }
+
+ return result;
+ }
+}
\ No newline at end of file
diff --git a/old/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/RelevanceWrappedLabelProvider.java b/old/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/RelevanceWrappedLabelProvider.java
new file mode 100644
index 0000000..dc3e52e
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/RelevanceWrappedLabelProvider.java
@@ -0,0 +1,70 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2011 Chair for Applied Software Engineering,
+ * Technische Universitaet Muenchen.
+ * 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:
+ ******************************************************************************/
+package org.eclipse.emf.ecp.editor;
+
+import java.text.NumberFormat;
+import java.util.Map;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.edit.provider.ComposedAdapterFactory;
+import org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider;
+
+/**
+ * Wraps the relevance around an element if present.
+ *
+ * @author Henning Femmer
+ */
+public class RelevanceWrappedLabelProvider extends AdapterFactoryLabelProvider {
+
+ private Map<EObject, Double> relevanceValues;
+
+ /**
+ * The constructor.
+ *
+ * @param relevanceVals the relevance map: element->double value
+ */
+ public RelevanceWrappedLabelProvider(Map<EObject, Double> relevanceVals) {
+ super(new ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry.INSTANCE));
+ this.relevanceValues = relevanceVals;
+ }
+
+ /**
+ * Returns the superclasses text, but adds the relevance if present.
+ *
+ * @param o the object
+ * @return the wrapped text
+ * @see org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider#getText(java.lang.Object)
+ */
+ @Override
+ public String getText(Object o) {
+ String text = super.getText(o);
+ if (o instanceof EObject) {
+ Double sim = relevanceValues.get(o);
+ if (sim != null) {
+ return text + " (Relevance: " + formatDouble(sim) + ")";
+ }
+ }
+ return text;
+ }
+
+ /**
+ * Formats the relevance to a readable format.
+ *
+ * @param val the double value
+ * @return a number with maximum 4 fraction digits as string
+ */
+ public static String formatDouble(double val) {
+ NumberFormat n = NumberFormat.getInstance();
+ n.setMaximumFractionDigits(4);
+
+ return n.format(val);
+ }
+}
\ No newline at end of file
diff --git a/old/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/StatusMessageProvider.java b/old/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/StatusMessageProvider.java
new file mode 100644
index 0000000..b94281a
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/StatusMessageProvider.java
@@ -0,0 +1,36 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2011 Chair for Applied Software Engineering,
+ * Technische Universitaet Muenchen.
+ * 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:
+ ******************************************************************************/
+package org.eclipse.emf.ecp.editor;
+
+import org.eclipse.emf.ecore.EObject;
+
+/**
+ * Provides a message for the statusbar of the meeditor.
+ *
+ * @author helming
+ */
+public interface StatusMessageProvider {
+ /**
+ * If a status message provider can return a message for a certain element.
+ *
+ * @param modelelement the modelelement
+ * @return the priority
+ */
+ int canRender(EObject modelelement);
+
+ /**
+ * Return the status message for a certain EObject.
+ *
+ * @param modelelement the modelelement
+ * @return the status message
+ */
+ String getMessage(EObject modelelement);
+}
\ No newline at end of file
diff --git a/old/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/commands/OpenModelElementHandler.java b/old/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/commands/OpenModelElementHandler.java
new file mode 100644
index 0000000..25c8bc3
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/commands/OpenModelElementHandler.java
@@ -0,0 +1,89 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2011 Chair for Applied Software Engineering,
+ * Technische Universitaet Muenchen.
+ * 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:
+ ******************************************************************************/
+package org.eclipse.emf.ecp.editor.commands;
+
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.ecp.common.model.ECPModelelementContext;
+import org.eclipse.emf.ecp.common.model.ECPWorkspaceManager;
+import org.eclipse.emf.ecp.common.model.NoWorkspaceException;
+import org.eclipse.emf.ecp.editor.Activator;
+import org.eclipse.emf.ecp.editor.MEEditorInput;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.handlers.HandlerUtil;
+
+/**
+ * This handler handles openModelEelement command. This handler
+ * is to be executed indirectly using IHandlerService.executeCommand()
+ * method. The Command itself does not have any UI representation.
+ *
+ * @author Hodaie
+ */
+public class OpenModelElementHandler extends AbstractHandler {
+
+ private static final String FEATURE_TO_MARK_EVALUATIONCONTEXT_VARIABLE = "featureToMark";
+
+ /**
+ * {@inheritDoc}
+ *
+ * <br/>
+ * We added this package and command to the editor plug-in,
+ * we needed to open a model element from model.edit plug-in and to avoid
+ * circular references we had to execute this command indirectly using
+ * IHandlerServise.executeCommand.
+ */
+
+ public Object execute(ExecutionEvent event) throws ExecutionException {
+
+ Object o = ((IStructuredSelection) HandlerUtil.getCurrentSelection(event)).getFirstElement();
+
+ EObject me = (EObject) o;
+
+ ECPModelelementContext context = null;
+ try {
+ context = ECPWorkspaceManager.getInstance().getWorkSpace().getProject(me);
+ } catch (NoWorkspaceException e1) {
+
+ }
+
+ EStructuralFeature problemFeature;
+
+ try {
+ problemFeature = (EStructuralFeature) HandlerUtil.getVariableChecked(event,
+ FEATURE_TO_MARK_EVALUATIONCONTEXT_VARIABLE);
+ } catch (ExecutionException executionException) {
+ problemFeature = null;
+ }
+
+ if (o != null) {
+ MEEditorInput input;
+ if (problemFeature == null) {
+ input = new MEEditorInput(me, context);
+ } else {
+ input = new MEEditorInput(me, context, problemFeature);
+ }
+ try {
+ PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage()
+ .openEditor(input, "org.eclipse.emf.ecp.editor", true);
+ } catch (PartInitException e) {
+ Activator.logException(e);
+ }
+ }
+
+ return null;
+ }
+
+}
\ No newline at end of file
diff --git a/old/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/mecontrols/AbstractMEControl.java b/old/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/mecontrols/AbstractMEControl.java
new file mode 100644
index 0000000..f6c153d
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/mecontrols/AbstractMEControl.java
@@ -0,0 +1,207 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2011 Chair for Applied Software Engineering,
+ * Technische Universitaet Muenchen.
+ * 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:
+ ******************************************************************************/
+package org.eclipse.emf.ecp.editor.mecontrols;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecp.common.model.ECPModelelementContext;
+import org.eclipse.emf.edit.domain.EditingDomain;
+import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+
+/**
+ * Abstract class for the ME controls.
+ *
+ * @author helming
+ */
+public abstract class AbstractMEControl {
+
+ /**
+ * The default constant in case the widgets decides it shouldn't render the attribute.
+ */
+ public static final int DO_NOT_RENDER = -1;
+
+ /**
+ * gui toolkit used for rendering.
+ */
+ private FormToolkit toolkit;
+ /**
+ * the modelElement.
+ */
+ private EObject modelElement;
+ /**
+ * the editingDomain.
+ */
+ private EditingDomain editingDomain;
+
+ private boolean showLabel;
+
+ private IItemPropertyDescriptor itemPropertyDescriptor;
+
+ private ECPModelelementContext context;
+
+ /**
+ * @return the toolkit
+ */
+ public FormToolkit getToolkit() {
+ return toolkit;
+ }
+
+ /**
+ * If a control can render a feature of a modelelement.
+ *
+ * @param itemPropertyDescriptor the {@link IItemPropertyDescriptor}
+ * @param modelElement the modelelement
+ * @return the priority
+ */
+ public abstract int canRender(IItemPropertyDescriptor itemPropertyDescriptor, EObject modelElement);
+
+ /**
+ * @param toolkit the toolkit to set
+ */
+ public void setToolkit(FormToolkit toolkit) {
+ this.toolkit = toolkit;
+ }
+
+ /**
+ * @return the modelElement
+ */
+ public EObject getModelElement() {
+ return modelElement;
+ }
+
+ /**
+ * @param modelElement the modelElement to set
+ */
+ public void setModelElement(EObject modelElement) {
+ this.modelElement = modelElement;
+ }
+
+ /**
+ * @return the editingDomain
+ */
+ public EditingDomain getEditingDomain() {
+ return editingDomain;
+ }
+
+ /**
+ * @param editingDomain the editingDomain to set
+ */
+ public void setEditingDomain(EditingDomain editingDomain) {
+ this.editingDomain = editingDomain;
+ }
+
+ /**
+ * Default constructor.
+ */
+ public AbstractMEControl() {
+ super();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void dispose() {
+
+ }
+
+ /**
+ * Method for applying a custom layout data to widgets, as for {@link MERichTextControl}.
+ */
+ public void applyCustomLayoutData() {
+ // by default none. must me implemented by the subclass.
+ }
+
+ /**
+ * Creates the widget for this control.
+ *
+ * @param parent the parent composite
+ * @param itemPropertyDescriptor the {@link IItemPropertyDescriptor}
+ * @param modelElement the model element
+ * @param context the context of the model element
+ * @param toolkit the {@link FormToolkit}
+ * @param style the style
+ * @return the widget
+ */
+ public Control createControl(Composite parent, int style, IItemPropertyDescriptor itemPropertyDescriptor,
+ EObject modelElement, ECPModelelementContext context, FormToolkit toolkit) {
+ this.setContext(context);
+ this.editingDomain = context.getEditingDomain();
+ this.modelElement = modelElement;
+ this.toolkit = toolkit;
+ this.setItemPropertyDescriptor(itemPropertyDescriptor);
+ return createControl(parent, style);
+
+ }
+
+ /**
+ * Shall be overriden to create the control.
+ *
+ * @param parent the paren composite
+ * @param style the SWT style
+ * @return the create Control
+ */
+ protected abstract Control createControl(Composite parent, int style);
+
+ /**
+ * @return if the label for this control should be shown.
+ */
+ public boolean getShowLabel() {
+ return this.showLabel;
+ }
+
+ /**
+ * Sets if the label should be shown.
+ *
+ * @param show if the Label should be shown
+ */
+ public void setShowLabel(boolean show) {
+ this.showLabel = show;
+ }
+
+ /**
+ * Setter for the {@link IItemPropertyDescriptor}.
+ *
+ * @param itemPropertyDescriptor the {@link IItemPropertyDescriptor}
+ */
+ public void setItemPropertyDescriptor(IItemPropertyDescriptor itemPropertyDescriptor) {
+ this.itemPropertyDescriptor = itemPropertyDescriptor;
+ }
+
+ /**
+ * Getter for the {@link IItemPropertyDescriptor}.
+ *
+ * @return the {@link IItemPropertyDescriptor}
+ */
+ public IItemPropertyDescriptor getItemPropertyDescriptor() {
+ return itemPropertyDescriptor;
+ }
+
+ /**
+ * Setter for the {@link ECPModelelementContext}.
+ *
+ * @param context the {@link ECPModelelementContext}
+ */
+ public void setContext(ECPModelelementContext context) {
+ this.context = context;
+ }
+
+ /**
+ * Getter for the {@link ECPModelelementContext}.
+ *
+ * @return the {@link ECPModelelementContext}
+ */
+ public ECPModelelementContext getContext() {
+ return context;
+ }
+
+}
\ No newline at end of file
diff --git a/old/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/mecontrols/FeatureHintTooltipSupport.java b/old/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/mecontrols/FeatureHintTooltipSupport.java
new file mode 100644
index 0000000..a4110ee
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/mecontrols/FeatureHintTooltipSupport.java
@@ -0,0 +1,71 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2011 Chair for Applied Software Engineering,
+ * Technische Universitaet Muenchen.
+ * 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:
+ ******************************************************************************/
+package org.eclipse.emf.ecp.editor.mecontrols;
+
+import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
+import org.eclipse.jface.window.DefaultToolTip;
+import org.eclipse.jface.window.ToolTip;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Event;
+
+/**
+ * Defines a tooltip support displaying brief feature descriptions as tooltip hints.
+ *
+ * @author Shterev
+ */
+public class FeatureHintTooltipSupport extends DefaultToolTip {
+
+ private IItemPropertyDescriptor itemPropertyDescriptor;
+
+ /**
+ * Default constructor.
+ *
+ * @param control the control that should receive the tooltip
+ * @param itemPropertyDescriptor the feature's property descriptor.
+ */
+ public FeatureHintTooltipSupport(Control control, IItemPropertyDescriptor itemPropertyDescriptor) {
+ super(control, ToolTip.NO_RECREATE, false);
+ this.itemPropertyDescriptor = itemPropertyDescriptor;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected String getText(Event event) {
+ Object o = getElement(event);
+ String description = itemPropertyDescriptor.getDescription(o);
+ return (description == null ? "No description available" : description);
+
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected boolean shouldCreateToolTip(Event event) {
+ return (getElement(event) != null && super.shouldCreateToolTip(event));
+ }
+
+ private Object getElement(Event event) {
+ return event.widget.getData();
+ }
+
+ /**
+ * Enable ToolTip support for the control by creating an instance from this class.
+ *
+ * @param control the control
+ * @param itemPropertyDescriptor the feature's property descriptor.
+ */
+ public static void enableFor(Control control, IItemPropertyDescriptor itemPropertyDescriptor) {
+ new FeatureHintTooltipSupport(control, itemPropertyDescriptor);
+ }
+}
\ No newline at end of file
diff --git a/old/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/mecontrols/IValidatableControl.java b/old/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/mecontrols/IValidatableControl.java
new file mode 100644
index 0000000..4b26d43
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/mecontrols/IValidatableControl.java
@@ -0,0 +1,32 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2011 Chair for Applied Software Engineering,
+ * Technische Universitaet Muenchen.
+ * 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:
+ ******************************************************************************/
+package org.eclipse.emf.ecp.editor.mecontrols;
+
+import org.eclipse.emf.common.util.Diagnostic;
+
+/**
+ * Controls which are implementing this interface handle the live validation result by themselves.
+ * @author Haunolder
+ *
+ */
+public interface IValidatableControl {
+
+ /**
+ * Handle live validation.
+ * @param diagnostic of type Diagnostic
+ * **/
+ void handleValidation(Diagnostic diagnostic);
+
+ /**
+ * Reset the MEControl to validation status 'ok'.
+ * **/
+ void resetValidation();
+}
\ No newline at end of file
diff --git a/old/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/mecontrols/MEBoolControl.java b/old/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/mecontrols/MEBoolControl.java
new file mode 100644
index 0000000..57e34f0
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/mecontrols/MEBoolControl.java
@@ -0,0 +1,105 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2011 Chair for Applied Software Engineering,
+ * Technische Universitaet Muenchen.
+ * 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:
+ ******************************************************************************/
+package org.eclipse.emf.ecp.editor.mecontrols;
+
+import org.eclipse.core.databinding.observable.value.IObservableValue;
+import org.eclipse.emf.common.util.Diagnostic;
+import org.eclipse.emf.databinding.EMFDataBindingContext;
+import org.eclipse.emf.databinding.edit.EMFEditObservables;
+import org.eclipse.emf.ecore.EAttribute;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
+import org.eclipse.jface.databinding.swt.SWTObservables;
+import org.eclipse.jface.layout.GridLayoutFactory;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Label;
+
+/**
+ * This is the standard Control to edit boolean values.
+ *
+ * @author helming
+ */
+public class MEBoolControl extends AbstractMEControl implements IValidatableControl{
+
+ private EAttribute attribute;
+
+ private Button check;
+
+ private static final int PRIORITY = 1;
+
+ private Composite composite;
+
+ private Label labelWidgetImage; //Label for diagnostic image
+
+
+ /**
+ * returns a check button without Label. {@inheritDoc}
+ *
+ * @return Control
+ */
+ @Override
+ public Control createControl(Composite parent, int style) {
+ Object feature = getItemPropertyDescriptor().getFeature(getModelElement());
+ this.attribute = (EAttribute) feature;
+ composite = getToolkit().createComposite(parent, style);
+ GridLayoutFactory.fillDefaults().numColumns(2).spacing(2, 0).applyTo(composite);
+
+ labelWidgetImage = getToolkit().createLabel(composite, " ");
+ labelWidgetImage.setBackground(parent.getBackground());
+ labelWidgetImage.setSize(SWT.DEFAULT, 16);
+
+ check = getToolkit().createButton(composite, "", SWT.CHECK);
+ IObservableValue model = EMFEditObservables.observeValue(getEditingDomain(), getModelElement(), attribute);
+ EMFDataBindingContext dbc = new EMFDataBindingContext();
+ dbc.bindValue(SWTObservables.observeSelection(check), model, null, null);
+ return composite;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.ecp.editor.mecontrols.AbstractMEControl#canRender(org.eclipse.emf.edit.provider.IItemPropertyDescriptor,
+ * org.eclipse.emf.ecore.EObject)
+ */
+ @Override
+ public int canRender(IItemPropertyDescriptor itemPropertyDescriptor, EObject modelElement) {
+ Object feature = itemPropertyDescriptor.getFeature(modelElement);
+ if (feature instanceof EAttribute && ((EAttribute) feature).getEType().getInstanceClass().equals(boolean.class)) {
+
+ return PRIORITY;
+ }
+ return AbstractMEControl.DO_NOT_RENDER;
+ }
+
+ /**.
+ * {@inheritDoc}}
+ * */
+ public void handleValidation(Diagnostic diagnostic) {
+ if (diagnostic.getSeverity() == Diagnostic.ERROR || diagnostic.getSeverity() == Diagnostic.WARNING) {
+ Image image = org.eclipse.emf.ecp.editor.Activator.getImageDescriptor("icons/validation_error.png").createImage();
+ this.labelWidgetImage.setImage(image);
+ this.labelWidgetImage.setToolTipText(diagnostic.getMessage());
+ }
+ }
+
+ /**.
+ * {@inheritDoc}}
+ * */
+ public void resetValidation() {
+ this.labelWidgetImage.setImage(null);
+ this.labelWidgetImage.setToolTipText("");
+ }
+
+}
\ No newline at end of file
diff --git a/old/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/mecontrols/MEDoubleControl.java b/old/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/mecontrols/MEDoubleControl.java
new file mode 100644
index 0000000..d902546
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/mecontrols/MEDoubleControl.java
@@ -0,0 +1,60 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2011 Chair for Applied Software Engineering,
+ * Technische Universitaet Muenchen.
+ * 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:
+ ******************************************************************************/
+package org.eclipse.emf.ecp.editor.mecontrols;
+
+
+/**
+ * Standard widget to edit a double attribute.
+ *
+ * @author helming
+ * @author emueller
+ */
+public class MEDoubleControl extends MEPrimitiveAttributeControl<Double> implements IValidatableControl {
+
+ @Override
+ protected int getPriority() {
+ return 1;
+ }
+
+ @Override
+ protected Double convertStringToModel(String s) {
+ return Double.parseDouble(s);
+ }
+
+ @Override
+ protected boolean validateString(String s) {
+ /*
+ * Do not perform any validation here, since a double can be represented with
+ * characters which include 'E', 'f' or 'd'. Furthermore if values become to
+ * be, 'Infinity' is also a valid value.
+ */
+ return true;
+ }
+
+ @Override
+ protected String convertModelToString(Double t) {
+ return Double.toString(t);
+ }
+
+ @Override
+ protected void postValidate(String text) {
+ try {
+ setUnvalidatedString(Double.toString(Double.parseDouble(text)));
+ } catch (NumberFormatException e) {
+ setUnvalidatedString(Double.toString(getDefaultValue()));
+ }
+ }
+
+ @Override
+ protected Double getDefaultValue() {
+ return 0.0;
+ }
+}
\ No newline at end of file
diff --git a/old/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/mecontrols/MEEnumControl.java b/old/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/mecontrols/MEEnumControl.java
new file mode 100644
index 0000000..71a86b5
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/mecontrols/MEEnumControl.java
@@ -0,0 +1,121 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2011 Chair for Applied Software Engineering,
+ * Technische Universitaet Muenchen.
+ * 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:
+ ******************************************************************************/
+package org.eclipse.emf.ecp.editor.mecontrols;
+
+import org.eclipse.core.databinding.observable.value.IObservableValue;
+import org.eclipse.emf.common.util.Diagnostic;
+import org.eclipse.emf.databinding.EMFDataBindingContext;
+import org.eclipse.emf.databinding.edit.EMFEditObservables;
+import org.eclipse.emf.ecore.EAttribute;
+import org.eclipse.emf.ecore.EEnum;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.edit.provider.IItemLabelProvider;
+import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
+import org.eclipse.jface.databinding.viewers.ViewersObservables;
+import org.eclipse.jface.layout.GridDataFactory;
+import org.eclipse.jface.layout.GridLayoutFactory;
+import org.eclipse.jface.viewers.ArrayContentProvider;
+import org.eclipse.jface.viewers.ComboViewer;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Label;
+
+/**
+ * This is the standard Control to enum values.
+ *
+ * @author shterev
+ * @author Nikolay Kasyanov
+ */
+public class MEEnumControl extends AbstractMEControl implements IValidatableControl {
+
+ private EAttribute attribute;
+
+ private ComboViewer combo;
+ private Composite composite;
+
+ private Label labelWidgetImage; //Label for diagnostic image
+ private static final int PRIORITY = 1;
+
+
+ /**
+ * returns a Combo created by ComboViewer. {@inheritDoc}
+ *
+ * @return Control
+ */
+ @Override
+ public Control createControl(Composite parent, int style) {
+ Object feature = getItemPropertyDescriptor().getFeature(getModelElement());
+ this.attribute = (EAttribute) feature;
+ composite = getToolkit().createComposite(parent, style);
+ GridLayoutFactory.fillDefaults().numColumns(2).spacing(2, 0).applyTo(composite);
+ GridDataFactory.fillDefaults().grab(true, false).applyTo(composite);
+ labelWidgetImage = getToolkit().createLabel(composite, " ");
+ labelWidgetImage.setBackground(parent.getBackground());
+ final IItemLabelProvider labelProvider = getItemPropertyDescriptor().getLabelProvider(getModelElement());
+
+ combo = new ComboViewer(composite);
+ combo.setContentProvider(new ArrayContentProvider());
+ combo.setLabelProvider(new LabelProvider() {
+
+ @Override
+ public String getText(Object element) {
+ return labelProvider.getText(element);
+ }
+
+ });
+ combo.setInput(attribute.getEType().getInstanceClass().getEnumConstants());
+
+ EMFDataBindingContext dbc = new EMFDataBindingContext();
+ IObservableValue model = EMFEditObservables.observeValue(getEditingDomain(), getModelElement(), attribute);
+ IObservableValue comboObservable = ViewersObservables.observeSingleSelection(combo);
+ dbc.bindValue(comboObservable, model);
+ return composite;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.ecp.editor.mecontrols.AbstractMEControl#canRender(org.eclipse.emf.edit.provider.IItemPropertyDescriptor,
+ * org.eclipse.emf.ecore.EObject)
+ */
+ @Override
+ public int canRender(IItemPropertyDescriptor itemPropertyDescriptor, EObject modelElement) {
+ Object feature = itemPropertyDescriptor.getFeature(modelElement);
+ if (feature instanceof EAttribute
+ && (EEnum.class).isAssignableFrom(((EAttribute) feature).getEType().getClass())) {
+
+ return PRIORITY;
+ }
+ return AbstractMEControl.DO_NOT_RENDER;
+ }
+
+ /**.
+ * {@inheritDoc}}
+ * */
+ public void handleValidation(Diagnostic diagnostic) {
+ if (diagnostic.getSeverity() == Diagnostic.ERROR || diagnostic.getSeverity() == Diagnostic.WARNING) {
+ Image image = org.eclipse.emf.ecp.editor.Activator.getImageDescriptor("icons/validation_error.png").createImage();
+ this.labelWidgetImage.setImage(image);
+ this.labelWidgetImage.setToolTipText(diagnostic.getMessage());
+ }
+ }
+
+ /**.
+ * {@inheritDoc}}
+ * */
+ public void resetValidation() {
+ this.labelWidgetImage.setImage(null);
+ this.labelWidgetImage.setToolTipText("");
+ }
+
+}
\ No newline at end of file
diff --git a/old/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/mecontrols/MEIntControl.java b/old/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/mecontrols/MEIntControl.java
new file mode 100644
index 0000000..55269e5
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/mecontrols/MEIntControl.java
@@ -0,0 +1,56 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2011 Chair for Applied Software Engineering,
+ * Technische Universitaet Muenchen.
+ * 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:
+ ******************************************************************************/
+package org.eclipse.emf.ecp.editor.mecontrols;
+
+/**
+ * Standard widgets to edit a integer attribute.
+ *
+ * @author helming
+ * @author emueller
+ */
+public class MEIntControl extends MEPrimitiveAttributeControl<Integer> implements IValidatableControl {
+
+ @Override
+ protected int getPriority() {
+ return 1;
+ }
+
+ @Override
+ protected Integer convertStringToModel(String s) {
+ return Integer.parseInt(s);
+ }
+
+ @Override
+ protected boolean validateString(String s) {
+ // TODO: perform validation
+ return true;
+ }
+
+ @Override
+ protected String convertModelToString(Integer t) {
+ return Integer.toString(t);
+ }
+
+ @Override
+ protected void postValidate(String text) {
+ try {
+ setUnvalidatedString(Integer.toString(Integer.parseInt(text)));
+ } catch (NumberFormatException e) {
+ setUnvalidatedString(Integer.toString(getDefaultValue()));
+ }
+ }
+
+ @Override
+ protected Integer getDefaultValue() {
+ return 0;
+ }
+
+}
\ No newline at end of file
diff --git a/old/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/mecontrols/MEPrimitiveAttributeControl.java b/old/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/mecontrols/MEPrimitiveAttributeControl.java
new file mode 100644
index 0000000..672e90b
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/mecontrols/MEPrimitiveAttributeControl.java
@@ -0,0 +1,364 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2011 Chair for Applied Software Engineering,
+ * Technische Universitaet Muenchen.
+ * 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: Max Hohenegger (Bug 377561)
+ ******************************************************************************/
+package org.eclipse.emf.ecp.editor.mecontrols;
+
+import java.lang.reflect.ParameterizedType;
+import java.lang.reflect.Type;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.eclipse.core.databinding.UpdateValueStrategy;
+import org.eclipse.core.databinding.conversion.IConverter;
+import org.eclipse.core.databinding.observable.value.IObservableValue;
+import org.eclipse.core.databinding.validation.IValidator;
+import org.eclipse.core.databinding.validation.ValidationStatus;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.emf.common.util.Diagnostic;
+import org.eclipse.emf.databinding.EMFDataBindingContext;
+import org.eclipse.emf.databinding.edit.EMFEditObservables;
+import org.eclipse.emf.ecore.EAttribute;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
+import org.eclipse.jface.databinding.swt.ISWTObservableValue;
+import org.eclipse.jface.databinding.swt.SWTObservables;
+import org.eclipse.jface.fieldassist.ControlDecoration;
+import org.eclipse.jface.fieldassist.FieldDecoration;
+import org.eclipse.jface.fieldassist.FieldDecorationRegistry;
+import org.eclipse.jface.layout.GridDataFactory;
+import org.eclipse.jface.layout.GridLayoutFactory;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.FocusEvent;
+import org.eclipse.swt.events.FocusListener;
+import org.eclipse.swt.events.VerifyEvent;
+import org.eclipse.swt.events.VerifyListener;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Text;
+
+/**
+ * A control used for primitive types that may be represented by a textual representation.
+ *
+ * @author helming
+ * @author emueller
+ *
+ * @param <T> the actual primitive type
+ */
+public abstract class MEPrimitiveAttributeControl<T> extends AbstractMEControl {
+
+ private static final Map<Class<?>, Class<?>> PRIMITIVES = new HashMap<Class<?>, Class<?>>();
+
+ static {
+ PRIMITIVES.put(Boolean.class, boolean.class);
+ PRIMITIVES.put(Byte.class, byte.class);
+ PRIMITIVES.put(Short.class, short.class);
+ PRIMITIVES.put(Character.class, char.class);
+ PRIMITIVES.put(Integer.class, int.class);
+ PRIMITIVES.put(Long.class, long.class);
+ PRIMITIVES.put(Float.class, float.class);
+ PRIMITIVES.put(Double.class, double.class);
+ }
+
+ private Text text;
+ private boolean doVerify;
+ private EAttribute attribute;
+ private Composite composite;
+ private Label labelWidgetImage; //Label for diagnostic image
+ private ControlDecoration controlDecoration;
+ private EMFDataBindingContext dbc;
+
+ /**
+ * Returns the priority by which the control should be rendered.
+ * The priority determines which control will be used to render
+ * a specific type since multiple controls may be registered to
+ * render the same type.
+ *
+ * @return an integer value representing the priority by which the control gets rendered
+ */
+ protected abstract int getPriority();
+
+ /**
+ * Converts the string value to the actual model value.
+ *
+ * @param s the string value to be converted
+ * @return the model value of type <code>T</code>
+ */
+ protected abstract T convertStringToModel(String s);
+
+ /**
+ * Converts the actual model value to its textual representation.
+ *
+ * @param modelValue
+ * the model value which needs to be converted to its textual representation
+ * @return the string representation of the converted model value
+ */
+ protected abstract String convertModelToString(T modelValue);
+
+ /**
+ * Returns a default value if the SWT Text control should be empty.
+ *
+ * @return a default value
+ */
+ protected abstract T getDefaultValue();
+
+ /**
+ * Called when the SWT Text control loses its focus. This
+ * is useful for cases where {@link #validateString(String)} returns true
+ * but the value entered by the user is invalid. For instance, this might be the case
+ * when the user enters a number that would cause a overflow. In such cases the number
+ * should be set to max value that can represented by the type in question.
+ *
+ * @param text the string value currently entered in the SWT Text control
+ *
+ */
+ protected abstract void postValidate(String text);
+
+
+ /**
+ * Validates the string entered in the text field.
+ * This method is executed whenever the user modifies the text
+ * contained in the SWT Text control.
+ *
+ * @param text
+ * the text to be validated
+ * @return true if <code>text</code> is a valid model value
+ */
+ protected abstract boolean validateString(String text);
+
+ /**
+ *
+ * {@inheritDoc}
+ * @see org.eclipse.emf.ecp.editor.mecontrols.AbstractMEControl#canRender(org.eclipse.emf.edit.provider.IItemPropertyDescriptor, org.eclipse.emf.ecore.EObject)
+ */
+ @Override
+ public int canRender(IItemPropertyDescriptor itemPropertyDescriptor, EObject modelElement) {
+ Object feature = itemPropertyDescriptor.getFeature(modelElement);
+
+ if (feature instanceof EAttribute && (((EAttribute) feature).getEType().getInstanceClass().equals(PRIMITIVES.get(getClassType()))
+ || ((EAttribute) feature).getEType().getInstanceClass().equals((getClassType())))
+ && !((EAttribute) feature).isMany()) {
+
+ return getPriority();
+ }
+
+ return AbstractMEControl.DO_NOT_RENDER;
+ }
+
+ /**
+ * Sets the content of the SWT text control to the given string without
+ * calling {@link #validateString(String)}.
+ * @param string
+ * the content of the SWT Text control
+ */
+ protected void setUnvalidatedString(String string) {
+ boolean oldDoVerify = doVerify;
+ doVerify = false;
+ text.setText(string);
+ doVerify = oldDoVerify;
+ }
+
+ @SuppressWarnings("unchecked")
+ private Class<T> getClassType() {
+ Class<?> clazz = getClass();
+
+ while (!(clazz.getGenericSuperclass() instanceof ParameterizedType)) {
+ clazz = clazz.getSuperclass();
+ }
+
+ Type[] actualTypeArguments = ((ParameterizedType) clazz.getGenericSuperclass())
+ .getActualTypeArguments();
+ return (Class<T>) actualTypeArguments[0];
+ }
+
+ @Override
+ protected Control createControl(Composite parent, int style) {
+ // TODO: activate verification once again
+ doVerify = false;
+ Object feature = getItemPropertyDescriptor().getFeature(getModelElement());
+ this.attribute = (EAttribute) feature;
+
+ composite = getToolkit().createComposite(parent, style);
+ composite.setBackgroundMode(SWT.INHERIT_FORCE);
+ GridLayoutFactory.fillDefaults().numColumns(2).spacing(2, 0).applyTo(composite);
+ GridDataFactory.fillDefaults().grab(true, false).applyTo(composite);
+
+ labelWidgetImage = getToolkit().createLabel(composite, " ");
+ labelWidgetImage.setBackground(parent.getBackground());
+
+ text = getToolkit().createText(composite, new String(), style | SWT.SINGLE | SWT.BORDER);
+ text.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+
+ if (!getItemPropertyDescriptor().canSetProperty(getModelElement())) {
+ text.setEditable(false);
+ }
+
+ controlDecoration = new ControlDecoration(text, SWT.RIGHT | SWT.TOP);
+ controlDecoration.setDescriptionText("Invalid input");
+ controlDecoration.setShowHover(true);
+ FieldDecoration fieldDecoration = FieldDecorationRegistry.getDefault().getFieldDecoration(
+ FieldDecorationRegistry.DEC_ERROR);
+ controlDecoration.setImage(fieldDecoration.getImage());
+
+ IObservableValue model = EMFEditObservables.observeValue(getEditingDomain(), getModelElement(), attribute);
+ dbc = new EMFDataBindingContext();
+ ISWTObservableValue observeText = SWTObservables.observeText(text, SWT.FocusOut);
+ dbc.bindValue(observeText, model, getTargetToModelStrategy(), getModelToTargetStrategy());
+
+ text.addVerifyListener(new VerifyListener() {
+
+ public void verifyText(VerifyEvent e) {
+ if (doVerify) {
+
+ final String oldText = text.getText();
+ String newText = oldText.substring(0, e.start) + e.text + oldText.substring(e.end);
+ if (!validateString(newText)) {
+ e.doit = false;
+ return;
+ }
+ }
+ }
+ });
+
+ text.addFocusListener(new FocusListener() {
+
+ public void focusLost(FocusEvent e) {
+ if (text.getText().equals("")) {
+ setUnvalidatedString(convertModelToString(getDefaultValue()));
+ } else {
+ postValidate(text.getText());
+ }
+
+ dbc.updateModels();
+ dbc.updateTargets();
+ }
+
+ public void focusGained(FocusEvent e) {
+ // do nothing
+ }
+ });
+
+ return composite;
+ }
+
+ /**
+ * Returns the strategy that is used to convert the string to the model value.
+ * @return the target to model update value strategy
+ */
+ protected UpdateValueStrategy getTargetToModelStrategy() {
+ // Define a validator to check that only numbers are entered
+ IValidator validator = new IValidator() {
+ public IStatus validate(Object value) {
+ boolean valid = validateString(text.getText());
+
+ if (valid) {
+ controlDecoration.hide();
+ return ValidationStatus.ok();
+ }
+
+ controlDecoration.show();
+ return ValidationStatus.error("Not a double.");
+ }
+ };
+
+ UpdateValueStrategy strategy = new UpdateValueStrategy(UpdateValueStrategy.POLICY_UPDATE);
+ strategy.setAfterGetValidator(validator);
+ strategy.setConverter(getConverter());
+
+ return strategy;
+ }
+
+ /**
+ * Returns the strategy that is used to convert the model value to the string.
+ * @return the model to string update value strategy
+ */
+ protected UpdateValueStrategy getModelToTargetStrategy() {
+ UpdateValueStrategy updateValueStrategy = new UpdateValueStrategy(UpdateValueStrategy.POLICY_UPDATE);
+ updateValueStrategy.setConverter(new IConverter() {
+
+ public Object getToType() {
+ return String.class;
+ }
+
+ public Object getFromType() {
+ return getClassType();
+ }
+
+ public Object convert(Object fromObject) {
+ @SuppressWarnings("unchecked") T val = (T) fromObject;
+ return convertModelToString(val);
+ }
+ });
+ return updateValueStrategy;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void applyCustomLayoutData() {
+ GridDataFactory.fillDefaults().grab(true, false).hint(250, 16).align(SWT.FILL, SWT.TOP).applyTo(text);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ **/
+ public void handleValidation(Diagnostic diagnostic) {
+ if (diagnostic.getSeverity() == Diagnostic.ERROR || diagnostic.getSeverity() == Diagnostic.WARNING) {
+ Image image = org.eclipse.emf.ecp.editor.Activator.getImageDescriptor("icons/validation_error.png").createImage();
+ this.labelWidgetImage.setImage(image);
+ this.labelWidgetImage.setToolTipText(diagnostic.getMessage());
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ **/
+ public void resetValidation() {
+ this.labelWidgetImage.setImage(null);
+ this.labelWidgetImage.setToolTipText("");
+ }
+
+ /**
+ * This sets the keyboard focus in Text control.
+ **/
+ public void setFocus() {
+ text.setFocus();
+ }
+
+ /**
+ * Returns the converter for a primitive data type.
+ *
+ * @return the converter instance
+ */
+ protected IConverter getConverter() {
+ IConverter converter = new IConverter() {
+
+ public Object getToType() {
+ return getClassType();
+ }
+
+ public Object getFromType() {
+ return String.class;
+ }
+
+ public Object convert(Object fromObject) {
+ T convertedValue = convertStringToModel((String) fromObject);
+ return convertedValue;
+ }
+ };
+
+ return converter;
+ }
+}
\ No newline at end of file
diff --git a/old/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/mecontrols/MERichTextControl.java b/old/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/mecontrols/MERichTextControl.java
new file mode 100644
index 0000000..3f16e90
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/mecontrols/MERichTextControl.java
@@ -0,0 +1,205 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2011 Chair for Applied Software Engineering,
+ * Technische Universitaet Muenchen.
+ * 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:
+ ******************************************************************************/
+package org.eclipse.emf.ecp.editor.mecontrols;
+
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.notify.impl.AdapterImpl;
+import org.eclipse.emf.common.util.Diagnostic;
+import org.eclipse.emf.ecore.EAttribute;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecp.common.commands.ECPCommand;
+import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
+import org.eclipse.jface.layout.GridDataFactory;
+import org.eclipse.jface.layout.GridLayoutFactory;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.FocusAdapter;
+import org.eclipse.swt.events.FocusEvent;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.swt.widgets.ToolBar;
+
+/**
+ * The standard widget for multi line text fields.
+ *
+ * @author helming
+ */
+public class MERichTextControl extends AbstractMEControl implements IValidatableControl{
+ private EAttribute attribute;
+
+ private AdapterImpl eAdapter;
+
+ private static final int PRIORITY = 2;
+
+ private Label labelWidgetImage; //Label for diagnostic image
+
+ private Composite composite;
+
+ private ToolBar toolBar;
+
+ private Text text;
+
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.ecp.editor.mecontrols.AbstractMEControl#createControl(org.eclipse.swt.widgets.Composite,
+ * int)
+ */
+ @Override
+ public Control createControl(Composite parent, int style) {
+ Object feature = getItemPropertyDescriptor().getFeature(getModelElement());
+ this.attribute = (EAttribute) feature;
+ composite = getToolkit().createComposite(parent, style);
+ composite.setBackgroundMode(SWT.INHERIT_FORCE);
+
+ GridLayoutFactory.fillDefaults().numColumns(3).spacing(2, 0).applyTo(composite);
+ GridDataFactory.fillDefaults().grab(true, true).applyTo(composite);
+
+ labelWidgetImage = getToolkit().createLabel(composite, " ");
+ labelWidgetImage.setBackground(composite.getBackground());
+
+ createText();
+ eAdapter = new AdapterImpl() {
+ @Override
+ public void notifyChanged(Notification msg) {
+ if (msg.getFeature() != null && msg.getFeature().equals(MERichTextControl.this.attribute)) {
+ load();
+ }
+ super.notifyChanged(msg);
+ }
+ };
+ getModelElement().eAdapters().add(eAdapter);
+ load();
+ return composite;
+ }
+
+ private void createText() {
+
+ text = new Text(composite, SWT.BORDER | SWT.MULTI | SWT.WRAP | SWT.V_SCROLL);
+
+ text.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_WHITE));
+ text.setSize(10, 100);
+ text.addFocusListener(new FocusAdapter() {
+
+ @Override
+ public void focusLost(FocusEvent e) {
+ save();
+ super.focusLost(e);
+ }
+
+ });
+ GridData spec = new GridData();
+ spec.horizontalAlignment = GridData.FILL;
+ spec.grabExcessHorizontalSpace = true;
+ spec.verticalAlignment = GridData.FILL;
+ spec.grabExcessVerticalSpace = true;
+ spec.heightHint = 200;
+ text.setLayoutData(spec);
+
+ if (!getItemPropertyDescriptor().canSetProperty(getModelElement())) {
+ text.setEnabled(false);
+ }
+ }
+
+ /**
+ * Returns the {@link ToolBar}.
+ *
+ * @return the toolbar
+ */
+ public ToolBar getToolbar() {
+ return toolBar;
+ }
+
+ private void save() {
+ new ECPCommand(getModelElement()) {
+ @Override
+ protected void doRun() {
+ getModelElement().eSet(attribute, text.getText());
+ }
+ }.run(true);
+ }
+
+ private void load() {
+
+ String txt = "";
+ final StringBuffer value = new StringBuffer();
+ new ECPCommand(getModelElement()) {
+ @Override
+ protected void doRun() {
+ if (getModelElement().eGet(attribute) == null) {
+ value.append("");
+ } else {
+ value.append(getModelElement().eGet(attribute));
+ }
+ }
+ }.run(true);
+ txt = value.toString();
+ text.setText(txt);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void dispose() {
+ getModelElement().eAdapters().remove(eAdapter);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void applyCustomLayoutData() {
+ GridDataFactory.fillDefaults().align(SWT.FILL, SWT.TOP).hint(250, 150).grab(true, false).applyTo(composite);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.ecp.editor.mecontrols.AbstractMEControl#canRender(org.eclipse.emf.edit.provider.IItemPropertyDescriptor,
+ * org.eclipse.emf.ecore.EObject)
+ */
+ @Override
+ public int canRender(IItemPropertyDescriptor itemPropertyDescriptor, EObject modelElement) {
+ Object feature = itemPropertyDescriptor.getFeature(modelElement);
+ if (feature instanceof EAttribute && ((EAttribute) feature).getEType().getInstanceClass().equals(String.class)) {
+
+ if (itemPropertyDescriptor.isMultiLine(feature)) {
+ return PRIORITY;
+ }
+ }
+ return AbstractMEControl.DO_NOT_RENDER;
+ }
+
+ /**.
+ * {@inheritDoc}}
+ * */
+ public void handleValidation(Diagnostic diagnostic) {
+ if (diagnostic.getSeverity() == Diagnostic.ERROR || diagnostic.getSeverity() == Diagnostic.WARNING) {
+ Image image = org.eclipse.emf.ecp.editor.Activator.getImageDescriptor("icons/validation_error.png").createImage();
+ this.labelWidgetImage.setImage(image);
+ this.labelWidgetImage.setToolTipText(diagnostic.getMessage());
+ }
+ }
+
+ /**.
+ * {@inheritDoc}}
+ * */
+ public void resetValidation() {
+ this.labelWidgetImage.setImage(null);
+ this.labelWidgetImage.setToolTipText("");
+ }
+}
\ No newline at end of file
diff --git a/old/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/mecontrols/MESWTDateAndTimeControl.java b/old/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/mecontrols/MESWTDateAndTimeControl.java
new file mode 100644
index 0000000..67b3f06
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/mecontrols/MESWTDateAndTimeControl.java
@@ -0,0 +1,129 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2011 Chair for Applied Software Engineering,
+ * Technische Universitaet Muenchen.
+ * 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:
+ ******************************************************************************/
+package org.eclipse.emf.ecp.editor.mecontrols;
+
+import org.eclipse.core.databinding.observable.value.DateAndTimeObservableValue;
+import org.eclipse.core.databinding.observable.value.IObservableValue;
+import org.eclipse.emf.common.util.Diagnostic;
+import org.eclipse.emf.databinding.EMFDataBindingContext;
+import org.eclipse.emf.databinding.edit.EMFEditObservables;
+import org.eclipse.emf.ecore.EAttribute;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecp.common.commands.ECPCommand;
+import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
+import org.eclipse.jface.databinding.swt.SWTObservables;
+import org.eclipse.jface.layout.GridDataFactory;
+import org.eclipse.jface.layout.GridLayoutFactory;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.MouseAdapter;
+import org.eclipse.swt.events.MouseEvent;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.DateTime;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.ui.ISharedImages;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.forms.widgets.ImageHyperlink;
+
+/**
+ * An SWT-based date widget with an additional time field, which
+ * are both controlled by spinners.
+ *
+ * @author Hunnilee
+ *
+ */
+public class MESWTDateAndTimeControl extends AbstractMEControl implements IValidatableControl{
+
+ private static final int PRIORITY = 3;
+
+ private EAttribute attribute;
+ private ImageHyperlink dateDeleteButton;
+ private Composite dateComposite;
+ private DateTime dateWidget;
+ private DateTime timeWidget;
+ private Label labelWidgetImage; //Label for diagnostic image
+
+ @Override
+ public int canRender(IItemPropertyDescriptor itemPropertyDescriptor, EObject modelElement) {
+ return PRIORITY;
+ }
+
+ @Override
+ protected Control createControl(Composite parent, int style) {
+ this.attribute = (EAttribute) getItemPropertyDescriptor().getFeature(getModelElement());
+ dateComposite = getToolkit().createComposite(parent);
+ dateComposite.setBackgroundMode(SWT.INHERIT_FORCE);
+ GridLayoutFactory.fillDefaults().numColumns(4).spacing(2, 0).applyTo(dateComposite);
+ GridDataFactory.fillDefaults().grab(true, false).applyTo(dateComposite);
+
+ createDateAndTimeWidget();
+
+ IObservableValue model = EMFEditObservables.observeValue(getEditingDomain(), getModelElement(), attribute);
+ EMFDataBindingContext dbc = new EMFDataBindingContext();
+ IObservableValue dateObserver = SWTObservables.observeSelection(dateWidget);
+ IObservableValue timeObserver = SWTObservables.observeSelection(timeWidget);
+ dbc.bindValue(new DateAndTimeObservableValue(dateObserver, timeObserver), model, null, null);
+
+ return dateComposite;
+ }
+
+ private void createDateAndTimeWidget() {
+ labelWidgetImage = getToolkit().createLabel(dateComposite, " ");
+ labelWidgetImage.setBackground(dateComposite.getBackground());
+
+ dateWidget = new DateTime(dateComposite, SWT.DATE);
+ dateWidget.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+
+ timeWidget = new DateTime(dateComposite, SWT.TIME | SWT.SHORT);
+ timeWidget.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+
+ dateDeleteButton = new ImageHyperlink(dateComposite, SWT.TOP);
+ dateDeleteButton.setImage(PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_TOOL_DELETE));
+
+
+
+ dateDeleteButton.addMouseListener(new MouseAdapter() {
+ @Override
+ public void mouseUp(MouseEvent e) {
+ new ECPCommand(getModelElement()) {
+
+ @Override
+ protected void doRun() {
+ getModelElement().eSet(attribute, null);
+ }
+ }.run(true);
+ }
+ });
+ }
+
+ /**.
+ * {@inheritDoc}}
+ * */
+ public void handleValidation(Diagnostic diagnostic) {
+ if (diagnostic.getSeverity() == Diagnostic.ERROR || diagnostic.getSeverity() == Diagnostic.WARNING) {
+ Image image = org.eclipse.emf.ecp.editor.Activator.getImageDescriptor("icons/validation_error.png").createImage();
+ this.labelWidgetImage.setImage(image);
+ this.labelWidgetImage.setToolTipText(diagnostic.getMessage());
+ }
+}
+
+ /**.
+ * {@inheritDoc}}
+ * */
+ public void resetValidation() {
+ this.labelWidgetImage.setImage(null);
+ this.labelWidgetImage.setToolTipText("");
+
+ }
+
+}
diff --git a/old/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/mecontrols/METextControl.java b/old/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/mecontrols/METextControl.java
new file mode 100644
index 0000000..04f4c9e
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/mecontrols/METextControl.java
@@ -0,0 +1,51 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2011 Chair for Applied Software Engineering,
+ * Technische Universitaet Muenchen.
+ * 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:
+ ******************************************************************************/
+package org.eclipse.emf.ecp.editor.mecontrols;
+
+/**
+ * Standard widgets to edit a single line text attribute.
+ *
+ * @author helming
+ * @author emueller
+ */
+public class METextControl extends MEPrimitiveAttributeControl<String> implements IValidatableControl {
+
+ @Override
+ protected int getPriority() {
+ return 1;
+ }
+
+ @Override
+ protected String convertStringToModel(String s) {
+ return s;
+ }
+
+ @Override
+ protected boolean validateString(String s) {
+ return true;
+ }
+
+ @Override
+ protected String convertModelToString(String t) {
+ return t;
+ }
+
+ @Override
+ protected void postValidate(String text) {
+ // do nothing
+ }
+
+ @Override
+ protected String getDefaultValue() {
+ return "";
+ }
+
+}
\ No newline at end of file
diff --git a/old/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/mecontrols/melinkcontrol/AddReferenceAction.java b/old/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/mecontrols/melinkcontrol/AddReferenceAction.java
new file mode 100644
index 0000000..7944144
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/mecontrols/melinkcontrol/AddReferenceAction.java
@@ -0,0 +1,196 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2011 Chair for Applied Software Engineering,
+ * Technische Universitaet Muenchen.
+ * 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:
+ ******************************************************************************/
+package org.eclipse.emf.ecp.editor.mecontrols.melinkcontrol;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EReference;
+import org.eclipse.emf.ecore.util.EcoreUtil;
+import org.eclipse.emf.ecp.common.commands.ECPCommand;
+import org.eclipse.emf.ecp.common.model.ECPModelelementContext;
+import org.eclipse.emf.ecp.common.util.OverlayImageDescriptor;
+import org.eclipse.emf.ecp.editor.MESuggestedSelectionDialog;
+import org.eclipse.emf.edit.provider.ComposedAdapterFactory;
+import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
+import org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider;
+import org.eclipse.jface.dialogs.ProgressMonitorDialog;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.window.Window;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.ui.PlatformUI;
+
+/**
+ * An Action for adding reference links to a model element. <br/>
+ * It is mainly used in the {@link MEMultiLinkControl}.
+ *
+ * @author shterev
+ */
+public class AddReferenceAction extends ReferenceAction {
+
+ private static final String DIALOG_MESSAGE = "Enter model element name prefix or pattern (e.g. *Trun?)";
+
+ private final ECPModelelementContext context;
+
+ /**
+ * Command to add a new reference.
+ *
+ * @author helming
+ */
+ private final class AddReferenceCommand extends ECPCommand {
+
+ public AddReferenceCommand(EObject eObject) {
+ super(eObject);
+ }
+
+ @Override
+ protected void doRun() {
+
+ if (!checkMultiplicity(false)) {
+ return;
+ }
+
+ EClass clazz = getReference().getEReferenceType();
+ Collection<EObject> allElements = context.getAllModelElementsbyClass(clazz, true);
+ allElements.remove(getModelElement());
+ Object object = getModelElement().eGet(getReference());
+
+ // don't provide facility to link instances that are already linked
+ EList<EObject> eList = filterAlreadyLinkedElements(allElements, object);
+
+ // don't show contained elements for inverse containment references
+ if (getReference().isContainer()) {
+ allElements.removeAll(getModelElement().eContents());
+ }
+
+ // take care of circular references
+ if (getReference().isContainment()) {
+ Iterator<EObject> iter = allElements.iterator();
+ while (iter.hasNext()) {
+ EObject me = iter.next();
+ if (EcoreUtil.isAncestor(me, getModelElement())) {
+ iter.remove();
+ }
+ }
+ }
+
+ MESuggestedSelectionDialog dlg = new MESuggestedSelectionDialog("Select Elements", DIALOG_MESSAGE, true,
+ getModelElement(), getReference(), allElements);
+
+ if (dlg.open() == Window.OK) {
+ if (getReference().isMany()) {
+ Object[] results = dlg.getResult();
+ ProgressMonitorDialog progressDialog = new ProgressMonitorDialog(PlatformUI.getWorkbench()
+ .getActiveWorkbenchWindow().getShell());
+ progressDialog.open();
+ progressDialog.getProgressMonitor().beginTask("Adding references...", results.length * 10);
+ List<EObject> list = new ArrayList<EObject>();
+ for (Object result : results) {
+ if (result instanceof EObject) {
+ list.add((EObject) result);
+ progressDialog.getProgressMonitor().worked(10);
+ }
+ }
+ eList.addAll(list);
+
+ progressDialog.getProgressMonitor().done();
+ progressDialog.close();
+ } else {
+ Object result = dlg.getFirstResult();
+ if (result instanceof EObject) {
+ getModelElement().eSet(getReference(), result);
+ }
+ }
+
+ }
+ }
+
+ @SuppressWarnings("unchecked")
+ private EList<EObject> filterAlreadyLinkedElements(Collection<EObject> allElements, Object object) {
+
+ EObject eObject;
+ EList<EObject> list = null;
+
+ if (getReference().isMany() && object instanceof EList) {
+ list = (EList<EObject>) object;
+
+ for (EObject ref : list) {
+ allElements.remove(ref);
+ }
+
+ } else if (!getReference().isMany() && object instanceof EObject) {
+ eObject = (EObject) object;
+ allElements.remove(eObject);
+ }
+
+ return list;
+ }
+
+ }
+
+ /**
+ * Default constructor.
+ *
+ * @param modelElement the source model element
+ * @param eReference the target reference
+ * @param descriptor the descriptor used to generate display content
+ * @param context the context of the model element
+ */
+ public AddReferenceAction(EObject modelElement, EReference eReference, IItemPropertyDescriptor descriptor,
+ ECPModelelementContext context) {
+ this.setModelElement(modelElement);
+ this.setReference(eReference);
+ this.context = context;
+
+ Object obj = null;
+ if (!eReference.getEReferenceType().isAbstract()) {
+ obj = eReference.getEReferenceType().getEPackage().getEFactoryInstance()
+ .create(eReference.getEReferenceType());
+ }
+ ComposedAdapterFactory adapterFactory = new ComposedAdapterFactory(
+ ComposedAdapterFactory.Descriptor.Registry.INSTANCE);
+ Image image = new AdapterFactoryLabelProvider(adapterFactory).getImage(obj);
+ adapterFactory.dispose();
+ String overlayString = "icons/link_overlay.png";
+ if (eReference.isContainment()) {
+ overlayString = "icons/containment_overlay.png";
+ }
+ ImageDescriptor addOverlay = org.eclipse.emf.ecp.common.Activator.getImageDescriptor(overlayString);
+ OverlayImageDescriptor imageDescriptor = new OverlayImageDescriptor(image, addOverlay,
+ OverlayImageDescriptor.LOWER_RIGHT);
+ setImageDescriptor(imageDescriptor);
+
+ String attribute = descriptor.getDisplayName(eReference);
+ // make singular attribute labels
+ if (attribute.endsWith("ies")) {
+ attribute = attribute.substring(0, attribute.length() - 3) + "y";
+ } else if (attribute.endsWith("s")) {
+ attribute = attribute.substring(0, attribute.length() - 1);
+ }
+
+ setToolTipText("Link " + attribute);
+
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void run() {
+ new AddReferenceCommand(this.getModelElement()).run(true);
+ }
+
+}
\ No newline at end of file
diff --git a/old/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/mecontrols/melinkcontrol/MEHyperLinkAdapter.java b/old/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/mecontrols/melinkcontrol/MEHyperLinkAdapter.java
new file mode 100644
index 0000000..ed2e843
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/mecontrols/melinkcontrol/MEHyperLinkAdapter.java
@@ -0,0 +1,48 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2011 Chair for Applied Software Engineering,
+ * Technische Universitaet Muenchen.
+ * 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:
+ ******************************************************************************/
+package org.eclipse.emf.ecp.editor.mecontrols.melinkcontrol;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecp.common.utilities.ActionHelper;
+import org.eclipse.ui.forms.events.HyperlinkAdapter;
+import org.eclipse.ui.forms.events.HyperlinkEvent;
+import org.eclipse.ui.forms.events.IHyperlinkListener;
+
+/**
+ * A {@link HyperlinkAdapter} to the model elements.
+ *
+ * @author helming
+ */
+public class MEHyperLinkAdapter extends HyperlinkAdapter implements IHyperlinkListener {
+
+ private EObject target;
+
+ /**
+ * Default constructor.
+ *
+ * @param source the source of the model link
+ * @param target the target of the model link
+ * @param featureName the feature of the model link
+ */
+ public MEHyperLinkAdapter(EObject target, EObject source, String featureName) {
+ super();
+ this.target = target;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void linkActivated(HyperlinkEvent event) {
+ ActionHelper.openModelElement(target, "org.eclipse.emf.ecp.editor");
+ super.linkActivated(event);
+ }
+}
\ No newline at end of file
diff --git a/old/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/mecontrols/melinkcontrol/MEHyperLinkDeleteAdapter.java b/old/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/mecontrols/melinkcontrol/MEHyperLinkDeleteAdapter.java
new file mode 100644
index 0000000..88e7a25
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/mecontrols/melinkcontrol/MEHyperLinkDeleteAdapter.java
@@ -0,0 +1,62 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2011 Chair for Applied Software Engineering,
+ * Technische Universitaet Muenchen.
+ * 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:
+ ******************************************************************************/
+package org.eclipse.emf.ecp.editor.mecontrols.melinkcontrol;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EReference;
+import org.eclipse.emf.ecp.common.commands.DeleteModelElementCommand;
+import org.eclipse.emf.ecp.common.commands.DeleteReferenceCommand;
+import org.eclipse.emf.ecp.common.model.ECPModelelementContext;
+import org.eclipse.swt.events.MouseAdapter;
+import org.eclipse.swt.events.MouseEvent;
+
+/**
+ * A mouse adapter regarding deletion of model elements.
+ *
+ * @author helming
+ * @author shterev
+ */
+public class MEHyperLinkDeleteAdapter extends MouseAdapter {
+
+ private EObject modelElement;
+ private EReference reference;
+ private EObject opposite;
+ private final ECPModelelementContext context;
+
+ /**
+ * Default constructor.
+ *
+ * @param modelElement the model element
+ * @param reference the reference link
+ * @param opposite the model element on the other side of the link
+ * @param context the model element context
+ */
+ public MEHyperLinkDeleteAdapter(EObject modelElement, EReference reference, EObject opposite,
+ ECPModelelementContext context) {
+ this.modelElement = modelElement;
+ this.reference = reference;
+ this.opposite = opposite;
+ this.context = context;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void mouseUp(MouseEvent e) {
+ if ((reference.isContainment() && context.getMetaModelElementContext().isNonDomainElement(opposite.eClass()))
+ || context.getMetaModelElementContext().isAssociationClassElement(opposite)) {
+ new DeleteModelElementCommand(opposite, context).run();
+ } else {
+ new DeleteReferenceCommand(modelElement, reference, opposite, context.getEditingDomain()).run();
+ }
+ }
+}
\ No newline at end of file
diff --git a/old/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/mecontrols/melinkcontrol/MELinkControl.java b/old/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/mecontrols/melinkcontrol/MELinkControl.java
new file mode 100644
index 0000000..8decc89
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/mecontrols/melinkcontrol/MELinkControl.java
@@ -0,0 +1,240 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2011 Chair for Applied Software Engineering,
+ * Technische Universitaet Muenchen.
+ * 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:
+ ******************************************************************************/
+package org.eclipse.emf.ecp.editor.mecontrols.melinkcontrol;
+
+import java.util.ArrayList;
+
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EReference;
+import org.eclipse.emf.ecp.common.model.ECPModelelementContext;
+import org.eclipse.emf.ecp.common.utilities.ModelElementClassTooltip;
+import org.eclipse.emf.ecp.common.utilities.ShortLabelProvider;
+import org.eclipse.emf.edit.provider.ComposedAdapterFactory;
+import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
+import org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider;
+import org.eclipse.jface.viewers.DecoratingLabelProvider;
+import org.eclipse.jface.viewers.ILabelProvider;
+import org.eclipse.jface.viewers.ILabelProviderListener;
+import org.eclipse.jface.viewers.LabelProviderChangedEvent;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.IDecoratorManager;
+import org.eclipse.ui.ISharedImages;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.forms.events.IHyperlinkListener;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+import org.eclipse.ui.forms.widgets.Hyperlink;
+import org.eclipse.ui.forms.widgets.ImageHyperlink;
+
+/**
+ * GUI Control for the ME reference links.
+ *
+ * @author helming
+ * @author shterev
+ */
+public class MELinkControl {
+
+ private EReference eReference;
+ private Hyperlink hyperlink;
+ private ILabelProvider labelProvider;
+ private ILabelProviderListener labelProviderListener;
+ private ImageHyperlink imageHyperlink;
+ private EObject link;
+ private EObject contextModelElement;
+ private org.eclipse.emf.ecp.editor.ModelElementChangeListener modelElementChangeListener;
+ private ECPModelelementContext context;
+ private IItemPropertyDescriptor pDescriptor;
+ private ComposedAdapterFactory adapterFactory;
+
+ private Composite linkComposite;
+ private FormToolkit toolkit;
+
+ /**
+ * Returns the {@link ECPModelelementContext}.
+ *
+ * @return the {@link ECPModelelementContext}
+ */
+ public ECPModelelementContext getContext() {
+ return context;
+ }
+
+ /**
+ * Sets the {@link FormToolkit} to be used.
+ *
+ * @param toolkit the toolkit to be used
+ */
+ protected void setToolkit(FormToolkit toolkit) {
+ this.toolkit = toolkit;
+ }
+
+ /**
+ * Returns the {@link FormToolkit} in use.
+ *
+ * @return the toolkit in use
+ */
+ protected FormToolkit getToolkit() {
+ return toolkit;
+ }
+
+ /**
+ * Sets the {@link ECPModelelementContext}.
+ *
+ * @param context the {@link ECPModelelementContext} to be set
+ */
+ public void setContext(ECPModelelementContext context) {
+ this.context = context;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public Control createControl(final Composite parent, int style, IItemPropertyDescriptor itemPropertyDescriptor,
+ final EObject link, EObject contextModelElement, FormToolkit toolkit, ECPModelelementContext context) {
+ this.context = context;
+ pDescriptor = itemPropertyDescriptor;
+ Object feature = itemPropertyDescriptor.getFeature(link);
+ this.eReference = (EReference) feature;
+ this.link = link;
+ this.contextModelElement = contextModelElement;
+ this.toolkit = toolkit;
+ return createControl(parent, style);
+
+ }
+
+ /**
+ * Creates this link control.
+ *
+ * @param parent
+ * the parent composite
+ * @param style
+ * additional style bits
+ * @return the created link control
+ */
+ protected Control createControl(final Composite parent, int style) {
+ linkComposite = toolkit.createComposite(parent, style);
+ linkComposite.setLayout(new GridLayout(3, false));
+ if (!pDescriptor.canSetProperty(contextModelElement)) {
+ linkComposite.setEnabled(false);
+ }
+ createHyperlink(parent, style);
+ createDeleteAction(style);
+ return linkComposite;
+ }
+
+ /**
+ * Create the delete action.
+ *
+ * @param style the style bits to be applied
+ */
+ protected void createDeleteAction(int style) {
+ ImageHyperlink deleteLink = toolkit.createImageHyperlink(linkComposite, style);
+ Image deleteImage = null;
+ if (eReference.isContainment() && (context.getMetaModelElementContext().isNonDomainElement(link.eClass()))) {
+ deleteImage = org.eclipse.emf.ecp.common.Activator.getImageDescriptor("icons/delete.gif").createImage();
+ } else {
+ deleteImage = PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_TOOL_DELETE);
+ }
+ deleteLink.setImage(deleteImage);
+
+ deleteLink.addMouseListener(new MEHyperLinkDeleteAdapter(contextModelElement, eReference, link, context));
+ }
+
+ private void createHyperlink(final Composite parent, int style) {
+ adapterFactory = new ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry.INSTANCE);
+ AdapterFactoryLabelProvider adapterFactoryLabelProvider = new AdapterFactoryLabelProvider(adapterFactory);
+ IDecoratorManager decoratorManager = PlatformUI.getWorkbench().getDecoratorManager();
+ labelProvider = new DecoratingLabelProvider(adapterFactoryLabelProvider, decoratorManager.getLabelDecorator());
+ labelProviderListener = new ILabelProviderListener() {
+ public void labelProviderChanged(LabelProviderChangedEvent event) {
+ updateIcon();
+ }
+ };
+ labelProvider.addListener(labelProviderListener);
+
+ ArrayList<EObject> list = new ArrayList<EObject>();
+ list.add(link);
+ modelElementChangeListener = new org.eclipse.emf.ecp.editor.ModelElementChangeListener(link) {
+
+ @Override
+ public void onChange(Notification notification) {
+ Display.getDefault().asyncExec(new Runnable() {
+
+ public void run() {
+ if (hyperlink != null && !hyperlink.isDisposed()) {
+ ShortLabelProvider shortLabelProvider = new ShortLabelProvider();
+ String text = shortLabelProvider.getText(link);
+ hyperlink.setText(text);
+ hyperlink.setToolTipText(text);
+ linkComposite.layout(true);
+ parent.getParent().layout(true);
+ }
+ }
+
+ });
+
+ }
+ };
+
+ Image image = labelProvider.getImage(link);
+ imageHyperlink = toolkit.createImageHyperlink(linkComposite, style);
+ imageHyperlink.setImage(image);
+ imageHyperlink.setData(link.eClass());
+ ModelElementClassTooltip.enableFor(imageHyperlink);
+ ShortLabelProvider shortLabelProvider = new ShortLabelProvider();
+ hyperlink = toolkit.createHyperlink(linkComposite, (shortLabelProvider.getText(link)), style);
+ hyperlink.setToolTipText(shortLabelProvider.getText(link));
+ IHyperlinkListener listener = new MEHyperLinkAdapter(link, contextModelElement, eReference.getName());
+ hyperlink.addHyperlinkListener(listener);
+ imageHyperlink.addHyperlinkListener(listener);
+ }
+
+ private void updateIcon() {
+ imageHyperlink.setImage(labelProvider.getImage(link));
+ }
+
+ /**
+ * Disposes the Composite of this {@link MELinkControl}.
+ */
+
+ public void dispose() {
+ if (modelElementChangeListener != null) {
+ modelElementChangeListener.remove();
+ }
+ if (labelProvider != null) {
+ labelProvider.removeListener(labelProviderListener);
+ labelProvider.dispose();
+ }
+ if (linkComposite != null) {
+ linkComposite.dispose();
+ }
+ if (adapterFactory != null) {
+ adapterFactory.dispose();
+ }
+ }
+
+ /**
+ * Whether this control wants to render the link for the given context model element.
+ *
+ * @param itemPropertyDescriptor an item property descriptor
+ * @param link the link for the model element
+ * @param contextModelElement the model element
+ * @return whether this control is able to render the link
+ */
+ public int canRender(IItemPropertyDescriptor itemPropertyDescriptor, EObject link, EObject contextModelElement) {
+ // TODO: introduce/use constant if available
+ return 0;
+ }
+
+}
\ No newline at end of file
diff --git a/old/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/mecontrols/melinkcontrol/MELinkControlFactory.java b/old/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/mecontrols/melinkcontrol/MELinkControlFactory.java
new file mode 100644
index 0000000..28bddd1
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/mecontrols/melinkcontrol/MELinkControlFactory.java
@@ -0,0 +1,134 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2011 Chair for Applied Software Engineering,
+ * Technische Universitaet Muenchen.
+ * 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:
+ ******************************************************************************/
+package org.eclipse.emf.ecp.editor.mecontrols.melinkcontrol;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Set;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecp.common.model.ECPModelelementContext;
+import org.eclipse.emf.ecp.editor.Activator;
+import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
+
+/**
+ * Factory for creating link controls.
+ */
+public class MELinkControlFactory {
+
+ private HashMap<Class<?>, ArrayList<MELinkControl>> controlRegistry;
+
+ /**
+ * Constructor.
+ */
+ public MELinkControlFactory() {
+ controlRegistry = new HashMap<Class<?>, ArrayList<MELinkControl>>();
+ initializeMEControls();
+ }
+
+ private void initializeMEControls() {
+ IConfigurationElement[] linkControls = Platform.getExtensionRegistry().getConfigurationElementsFor(
+ "org.eclipse.emf.ecp.editor.melinkcontrols");
+
+ for (IConfigurationElement e : linkControls) {
+ String type = e.getAttribute("type");
+ try {
+ Class<?> resolvedType = Class.forName(type);
+ MELinkControl control = (MELinkControl) e.createExecutableExtension("class");
+ ArrayList<MELinkControl> list = controlRegistry.get(resolvedType);
+ if (list == null) {
+ list = new ArrayList<MELinkControl>();
+ }
+ list.add(control);
+ controlRegistry.put(resolvedType, list);
+
+ } catch (ClassNotFoundException e1) {
+ Activator.logException(e1);
+ } catch (CoreException e2) {
+ Activator.logException(e2);
+ }
+ }
+
+ }
+
+ /**
+ * Creates a link control.
+ *
+ * @param itemPropertyDescriptor
+ * an item property descriptor
+ * @param link
+ * the object where the link to should lead to
+ * @param contextModelElement
+ * the model element for which to render the link
+ * @return the created link control
+ */
+ public MELinkControl createMELinkControl(IItemPropertyDescriptor itemPropertyDescriptor, final EObject link,
+ EObject contextModelElement) {
+ return createMELinkControl(itemPropertyDescriptor, link, contextModelElement, null);
+ }
+
+ /**
+ * Creates a link control.
+ *
+ * @param itemPropertyDescriptor
+ * an item property descriptor
+ * @param link
+ * the object where the link to should lead to
+ * @param contextModelElement
+ * the model element for which to render the link
+ * @param context
+ * an ECP model context
+ * @return the created link control
+ */
+ public MELinkControl createMELinkControl(IItemPropertyDescriptor itemPropertyDescriptor, final EObject link,
+ EObject contextModelElement, ECPModelelementContext context) {
+ ArrayList<MELinkControl> candidates = new ArrayList<MELinkControl>();
+ Set<Class<?>> keySet = controlRegistry.keySet();
+ for (Class<?> clazz : keySet) {
+ if (clazz.isAssignableFrom(link.getClass())) {
+ candidates.addAll(controlRegistry.get(clazz));
+ }
+ }
+
+ MELinkControl control = getBestCandidate(candidates, itemPropertyDescriptor, link, contextModelElement, context);
+ if (control != null) {
+ try {
+ return control.getClass().newInstance();
+ } catch (InstantiationException e) {
+ // Do nothing
+ } catch (IllegalAccessException e) {
+ // Do nothing
+ }
+ }
+
+ // Default case
+ return new MELinkControl();
+ }
+
+ private MELinkControl getBestCandidate(ArrayList<MELinkControl> candidates,
+ IItemPropertyDescriptor itemPropertyDescriptor, final EObject link, EObject contextModelElement,
+ ECPModelelementContext context) {
+ int bestValue = 0;
+ MELinkControl bestCandidate = null;
+ for (MELinkControl abstractMEControl : candidates) {
+ abstractMEControl.setContext(context);
+ int newValue = abstractMEControl.canRender(itemPropertyDescriptor, link, contextModelElement);
+ if (newValue > bestValue) {
+ bestCandidate = abstractMEControl;
+ bestValue = newValue;
+ }
+ }
+ return bestCandidate;
+ }
+}
\ No newline at end of file
diff --git a/old/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/mecontrols/melinkcontrol/MEMultiLinkControl.java b/old/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/mecontrols/melinkcontrol/MEMultiLinkControl.java
new file mode 100644
index 0000000..5a0ad28
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/mecontrols/melinkcontrol/MEMultiLinkControl.java
@@ -0,0 +1,259 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2011 Chair for Applied Software Engineering,
+ * Technische Universitaet Muenchen.
+ * 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:
+ ******************************************************************************/
+package org.eclipse.emf.ecp.editor.mecontrols.melinkcontrol;
+
+import java.util.ArrayList;
+
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EReference;
+import org.eclipse.emf.ecp.common.commands.ECPCommand;
+import org.eclipse.emf.ecp.editor.mecontrols.AbstractMEControl;
+import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
+import org.eclipse.emf.edit.ui.dnd.LocalTransfer;
+import org.eclipse.jface.action.ToolBarManager;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.ScrolledComposite;
+import org.eclipse.swt.dnd.DND;
+import org.eclipse.swt.dnd.DropTarget;
+import org.eclipse.swt.dnd.Transfer;
+import org.eclipse.swt.events.DisposeEvent;
+import org.eclipse.swt.events.DisposeListener;
+import org.eclipse.swt.graphics.Cursor;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.layout.RowLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.ToolBar;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+import org.eclipse.ui.forms.widgets.Section;
+
+/**
+ * GUI Control for the ME reference multilinks.
+ *
+ * @author helming
+ */
+public class MEMultiLinkControl extends AbstractMEControl {
+
+ /**
+ * Command to rebuild the links.
+ *
+ * @author helming
+ */
+ private final class RebuildLinksCommand extends ECPCommand {
+ private final int sizeLimit;
+
+ public RebuildLinksCommand(EObject modelElement, int sizeLimit) {
+ super(modelElement);
+ this.sizeLimit = sizeLimit;
+ }
+
+ @SuppressWarnings("unchecked")
+ @Override
+ protected void doRun() {
+ Object objectList = getModelElement().eGet(eReference);
+ if (objectList instanceof EList) {
+ EList<EObject> eList = (EList<EObject>) objectList;
+ if (eList.size() <= sizeLimit) {
+ linkArea = getToolkit().createComposite(composite, style);
+ linkArea.setLayout(tableLayout);
+ linkArea.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+ } else {
+
+ scrollPane = new ScrolledComposite(composite, SWT.V_SCROLL | SWT.H_SCROLL);
+ scrollPane.setBackgroundMode(SWT.INHERIT_FORCE);
+ scrollClient = new Composite(scrollPane, style);
+ scrollPane.setContent(scrollClient);
+ getToolkit().getColors().createColor("white", 255, 255, 255);
+ scrollClient.setBackground(getToolkit().getColors().getColor("white"));
+ scrollPane.setExpandVertical(true);
+ scrollPane.setExpandHorizontal(true);
+ RowLayout layout = new RowLayout(SWT.VERTICAL);
+ layout.wrap = true;
+ scrollClient.setLayout(layout);
+ GridData spec = new GridData(400, 150);
+ spec.horizontalAlignment = GridData.FILL;
+ spec.grabExcessHorizontalSpace = true;
+ scrollPane.setLayoutData(spec);
+ scrollPane.setMinSize(150, 150);
+ }
+
+ for (EObject object : eList) {
+
+ MELinkControlFactory controlFactory = new MELinkControlFactory();
+ MELinkControl meControl = controlFactory.createMELinkControl(getItemPropertyDescriptor(), object,
+ getModelElement(), getContext());
+ meControl.createControl((eList.size() <= sizeLimit ? linkArea : scrollClient), style,
+ getItemPropertyDescriptor(), object, getModelElement(), getToolkit(), getContext());
+ linkControls.add(meControl);
+
+ }
+ if (scrollPane != null && !scrollPane.isDisposed()) {
+ scrollPane.setMinSize(scrollClient.computeSize(SWT.DEFAULT, SWT.DEFAULT));
+ scrollClient.layout();
+ scrollPane.layout();
+ } else {
+ linkArea.layout();
+ }
+ if (eList.size() > 0) {
+ section.setExpanded(false);
+ section.setExpanded(true);
+ }
+ }
+ }
+ }
+
+ private EReference eReference;
+
+ private int style;
+
+ private ScrolledComposite scrollPane;
+
+ private Section section;
+
+ private Composite linkArea;
+
+ private Composite composite;
+
+ private ArrayList<MELinkControl> linkControls;
+
+ private GridLayout tableLayout;
+
+ private Composite scrollClient;
+
+ private DropTarget sectionDropTarget;
+
+ private static final int PRIORITY = 1;
+
+ private Object feature;
+
+ private org.eclipse.emf.ecp.editor.ModelElementChangeListener modelElementChangeListener;
+
+ private void createSectionToolbar(Section section, FormToolkit toolkit) {
+ ToolBarManager toolBarManager = new ToolBarManager(SWT.FLAT);
+ ToolBar toolbar = toolBarManager.createControl(section);
+ final Cursor handCursor = new Cursor(Display.getCurrent(), SWT.CURSOR_HAND);
+ toolbar.setCursor(handCursor);
+ // Cursor needs to be explicitly disposed
+ toolbar.addDisposeListener(new DisposeListener() {
+ public void widgetDisposed(DisposeEvent e) {
+ if (!handCursor.isDisposed()) {
+ handCursor.dispose();
+ }
+ }
+ });
+
+ toolBarManager.add(new AddReferenceAction(getModelElement(), eReference, getItemPropertyDescriptor(),
+ getContext()));
+ toolBarManager.add(new NewReferenceAction(getModelElement(), eReference, getItemPropertyDescriptor(),
+ getContext()));
+ toolBarManager.update(true);
+ section.setTextClient(toolbar);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public Control createControl(final Composite parent, int style) {
+ linkControls = new ArrayList<MELinkControl>();
+ feature = getItemPropertyDescriptor().getFeature(getModelElement());
+ this.eReference = (EReference) feature;
+ modelElementChangeListener = new org.eclipse.emf.ecp.editor.ModelElementChangeListener(getModelElement()) {
+
+ @Override
+ public void onChange(Notification notification) {
+ if ((notification.getEventType() != Notification.RESOLVE)
+ && (notification.getFeature().equals(feature))) {
+ rebuildLinkSection();
+ }
+
+ }
+
+ };
+
+ this.style = style;
+ tableLayout = new GridLayout(1, false);
+ section = getToolkit().createSection(parent, Section.TITLE_BAR | Section.TWISTIE | Section.EXPANDED);
+ section.setText(getItemPropertyDescriptor().getDisplayName(getModelElement()));
+ createSectionToolbar(section, getToolkit());
+ composite = getToolkit().createComposite(section, style);
+ composite.setLayout(tableLayout);
+ if (!getItemPropertyDescriptor().canSetProperty(getModelElement())) {
+ composite.setEnabled(false);
+ }
+
+ rebuildLinkSection();
+
+ section.setClient(composite);
+ addDnDSupport();
+ return section;
+ }
+
+ private void addDnDSupport() {
+ sectionDropTarget = new DropTarget(section, DND.DROP_COPY);
+ Transfer[] transfers = new Transfer[] { LocalTransfer.getInstance() };
+ sectionDropTarget.setTransfer(transfers);
+ sectionDropTarget
+ .addDropListener(new MEMultiLinkControlDropAdapter(getModelElement(), eReference, getContext()));
+
+ }
+
+ /**
+ * Method for refreshing (rebuilding) the composite section.
+ */
+ private void rebuildLinkSection() {
+ final int sizeLimit = 5;
+
+ for (MELinkControl link : linkControls) {
+ link.dispose();
+ }
+ if (scrollPane != null) {
+ scrollPane.dispose();
+ }
+ if (linkArea != null) {
+ linkArea.dispose();
+ }
+ linkControls.clear();
+ // JH: TransactionUtil.getEditingDomain(modelElement);
+ new RebuildLinksCommand(getModelElement(), sizeLimit).run(false);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void dispose() {
+ modelElementChangeListener.remove();
+ for (MELinkControl link : linkControls) {
+ link.dispose();
+ }
+ if (sectionDropTarget != null) {
+ sectionDropTarget.dispose();
+ }
+ }
+
+ @Override
+ public int canRender(IItemPropertyDescriptor itemPropertyDescriptor, EObject modelElement) {
+ Object feature = itemPropertyDescriptor.getFeature(modelElement);
+ if (feature instanceof EReference
+ && EObject.class.isAssignableFrom(((EReference) feature).getEType().getInstanceClass())
+ && ((EReference) feature).isMany()) {
+
+ return PRIORITY;
+ }
+ return AbstractMEControl.DO_NOT_RENDER;
+ }
+
+}
\ No newline at end of file
diff --git a/old/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/mecontrols/melinkcontrol/MEMultiLinkControlDropAdapter.java b/old/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/mecontrols/melinkcontrol/MEMultiLinkControlDropAdapter.java
new file mode 100644
index 0000000..4660d85
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/mecontrols/melinkcontrol/MEMultiLinkControlDropAdapter.java
@@ -0,0 +1,263 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2011 Chair for Applied Software Engineering,
+ * Technische Universitaet Muenchen.
+ * 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:
+ ******************************************************************************/
+package org.eclipse.emf.ecp.editor.mecontrols.melinkcontrol;
+
+import java.util.List;
+
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EReference;
+import org.eclipse.emf.ecore.EcorePackage;
+import org.eclipse.emf.ecore.util.EcoreUtil;
+import org.eclipse.emf.ecp.common.commands.ECPCommand;
+import org.eclipse.emf.ecp.common.dnd.DragSourcePlaceHolder;
+import org.eclipse.emf.ecp.common.model.ECPModelelementContext;
+import org.eclipse.swt.dnd.DND;
+import org.eclipse.swt.dnd.DropTargetEvent;
+import org.eclipse.swt.dnd.DropTargetListener;
+
+/**
+ * @author Hodaie
+ */
+public class MEMultiLinkControlDropAdapter implements DropTargetListener {
+
+ private List<EObject> source;
+ private EObject dropee;
+ private EObject target;
+ private EReference reference;
+ private final ECPModelelementContext modelElementContext;
+
+ /**
+ * @param me MEEditor input
+ * @param reference EReference being shown in the section
+ * @param modelElementContext the {@link ECPModelelementContext}
+ */
+ public MEMultiLinkControlDropAdapter(EObject me, EReference reference, ECPModelelementContext modelElementContext) {
+
+ this.reference = reference;
+
+ target = me;
+ this.modelElementContext = modelElementContext;
+
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.swt.dnd.DropTargetListener#dragEnter(org.eclipse.swt.dnd.DropTargetEvent)
+ */
+ public void dragEnter(DropTargetEvent event) {
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.swt.dnd.DropTargetListener#drop(org.eclipse.swt.dnd.DropTargetEvent)
+ */
+ public void drop(DropTargetEvent event) {
+ if (dropee != null) {
+ new ECPCommand(dropee) {
+ @Override
+ protected void doRun() {
+ addME();
+ }
+ };
+ }
+ }
+
+ @SuppressWarnings("unchecked")
+ private void addME() {
+ if (reference == null) {
+ return;
+ }
+
+ if (reference.getEOpposite() != null) {
+ // if it is a bidirectional reference, instead of adding source to target, set target to the opposite
+ // reference.
+ EReference oppositeRef = reference.getEOpposite();
+ for (EObject me : source) {
+ Object object = me.eGet(oppositeRef);
+ if (oppositeRef.isMany()) {
+ EList<EObject> eList = (EList<EObject>) object;
+ eList.add(target);
+ } else {
+ me.eSet(oppositeRef, target);
+ }
+ }
+
+ } else {
+
+ if (reference.isMany()) {
+ Object object = target.eGet(reference);
+ EList<EObject> eList = (EList<EObject>) object;
+ eList.addAll(source);
+
+ } else {
+ target.eSet(reference, source.get(0));
+ }
+
+ }
+
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.swt.dnd.DropTargetListener#dragLeave(org.eclipse.swt.dnd.DropTargetEvent)
+ */
+ public void dragLeave(DropTargetEvent event) {
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.swt.dnd.DropTargetListener#dragOperationChanged(org.eclipse.swt.dnd.DropTargetEvent)
+ */
+ public void dragOperationChanged(DropTargetEvent event) {
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.swt.dnd.DropTargetListener#dragOver(org.eclipse.swt.dnd.DropTargetEvent)
+ */
+ public void dragOver(DropTargetEvent event) {
+ source = null;
+ event.detail = DND.DROP_COPY;
+ if (!extractDnDSourceAndTarget()) {
+ event.detail = DND.DROP_NONE;
+ return;
+ }
+
+ if (source.size() > 1) {
+ event.detail = DND.DROP_NONE;
+ return;
+ }
+
+ if (!canDrop(event)) {
+ event.detail = DND.DROP_NONE;
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.swt.dnd.DropTargetListener#dropAccept(org.eclipse.swt.dnd.DropTargetEvent)
+ */
+ public void dropAccept(DropTargetEvent event) {
+ }
+
+ /**
+ * This checks if this source can be dropped on this target (taking also the drop effect into consideration). The
+ * most general case is if the target has the appropriate containment reference for source. Also if all elements in
+ * drop source come from the same level in tree (have the same container). These cases are handled here. Sub-Classes
+ * can override this method, to implement their own conditions.
+ *
+ * @param event drop target event
+ * @return if this source can be dropped on target
+ */
+ public boolean canDrop(DropTargetEvent event) {
+
+ // do not drop an element on itself
+ if (target == dropee) {
+ return false;
+ }
+
+ // do not drop an element on one of its children. this leads to circular
+ // reference
+ // in containment hierarchy and the element and all of its children get
+ // lost
+ // (this creates an island)
+ if (EcoreUtil.isAncestor(dropee, target)) {
+ return false;
+ }
+
+ // only project admins are allowed to change document structure
+ // TODO: Check if we need this
+ // ProjectSpace projectSpace = WorkspaceManager.getProjectSpace(target);
+ // Usersession userSession = projectSpace.getUsersession();
+ // if (dropee instanceof Section && !UiUtil.isProjectAdmin(userSession, projectSpace)) {
+ // return false;
+ // }
+
+ // for the case of multi selection (not implemented yet) only allow drop, if all dropees come from the same
+ // container
+ if (!haveSameEContainer(source)) {
+ return false;
+ }
+
+ // drop only allowed elements
+ EClass eReferenceType = reference.getEReferenceType();
+ if (!eReferenceType.isSuperTypeOf(dropee.eClass())
+ && !eReferenceType.equals(EcorePackage.eINSTANCE.getEObject())) {
+ return false;
+ }
+
+ return true;
+ }
+
+ /**
+ * This checks if all elements is drag source collection come from the same container (level in tree).
+ *
+ * @param source source
+ * @return true or false
+ */
+ protected boolean haveSameEContainer(List<EObject> source) {
+ EObject first = source.get(0);
+ for (EObject me : source) {
+ if (!first.eContainer().equals(me.eContainer())) {
+ return false;
+ }
+ }
+ return true;
+ }
+
+ /**
+ * This is called continually from dragOver() event handler. This checks drop target and drop source to be not Null,
+ * and sets the target, source, and dropee fields.
+ *
+ * @return
+ */
+ @SuppressWarnings("unchecked")
+ private boolean extractDnDSourceAndTarget() {
+ boolean result = true;
+ if (target == null) {
+ return false;
+ }
+ List<Object> tmpSource = (List<Object>) DragSourcePlaceHolder.getDragSource();
+ if (tmpSource == null) {
+ result = false;
+ }
+
+ for (Object obj : tmpSource) {
+ if (!(obj instanceof EObject)) {
+ result = false;
+ }
+ }
+
+ source = (List<EObject>) DragSourcePlaceHolder.getDragSource();
+ if (source.size() == 0) {
+ return false;
+ }
+
+ // check if source and target are in the same project
+ if (result) {
+ dropee = source.get(0);
+ if (modelElementContext.contains(dropee)) {
+ result = false;
+ }
+ }
+
+ return result;
+ }
+
+}
\ No newline at end of file
diff --git a/old/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/mecontrols/melinkcontrol/MESingleLinkControl.java b/old/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/mecontrols/melinkcontrol/MESingleLinkControl.java
new file mode 100644
index 0000000..16f9d13
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/mecontrols/melinkcontrol/MESingleLinkControl.java
@@ -0,0 +1,191 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2011 Chair for Applied Software Engineering,
+ * Technische Universitaet Muenchen.
+ * 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:
+ ******************************************************************************/
+package org.eclipse.emf.ecp.editor.mecontrols.melinkcontrol;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EReference;
+import org.eclipse.emf.ecp.editor.ModelElementChangeListener;
+import org.eclipse.emf.ecp.editor.mecontrols.AbstractMEControl;
+import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.layout.GridLayoutFactory;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.layout.FillLayout;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Label;
+
+/**
+ * GUI Control for the ME reference single links.
+ *
+ * @author helming
+ */
+public class MESingleLinkControl extends AbstractMEControl {
+
+ private Composite composite;
+
+ private EReference eReference;
+
+ private Composite linkArea;
+
+ private Composite parent;
+
+ private int style;
+
+ private MELinkControl meControl;
+
+ private Label labelWidget;
+
+ private static final int PRIORITY = 1;
+
+ private ModelElementChangeListener modelElementChangeListener;
+
+ /**
+ * Standard Constructor.
+ */
+ public MESingleLinkControl() {
+ super();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public Control createControl(final Composite parent, int style) {
+ Object feature = getItemPropertyDescriptor().getFeature(getModelElement());
+ this.eReference = (EReference) feature;
+ composite = getToolkit().createComposite(parent, style);
+ List<Action> initActions = initActions();
+ int columns = initActions.size() + 1;
+ composite.setLayout(new GridLayout(columns, false));
+ if (!getItemPropertyDescriptor().canSetProperty(getModelElement())) {
+ composite.setEnabled(false);
+ }
+ GridLayoutFactory.fillDefaults().spacing(0, 0).numColumns(columns).equalWidth(false).applyTo(composite);
+ this.parent = parent;
+ this.style = style;
+ linkArea = getToolkit().createComposite(composite);
+ linkArea.setLayout(new FillLayout());
+ updateLink();
+
+ for (Action action : initActions) {
+ createButtonForAction(action);
+ }
+
+ modelElementChangeListener = new ModelElementChangeListener(getModelElement()) {
+
+ @Override
+ public void onChange(Notification notification) {
+ if (notification.getFeature() == eReference) {
+ updateLink();
+ }
+
+ }
+ };
+
+ return composite;
+ }
+
+ /**
+ * Creates the actions for the control.
+ *
+ * @return list of actions
+ */
+ protected List<Action> initActions() {
+ List<Action> result = new ArrayList<Action>();
+ AddReferenceAction addAction = new AddReferenceAction(getModelElement(), eReference,
+ getItemPropertyDescriptor(), getContext());
+ result.add(addAction);
+ ReferenceAction newAction = new NewReferenceAction(getModelElement(), eReference, getItemPropertyDescriptor(),
+ getContext());
+ result.add(newAction);
+ return result;
+ }
+
+ /**
+ * @return the eReference
+ */
+ protected EReference geteReference() {
+ return eReference;
+ }
+
+ /**
+ * Creates a button for an action.
+ *
+ * @param action the action
+ */
+ protected void createButtonForAction(final Action action) {
+ Button selectButton = getToolkit().createButton(composite, "", SWT.PUSH);
+ selectButton.setImage(action.getImageDescriptor().createImage());
+ selectButton.setToolTipText(action.getToolTipText());
+ selectButton.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ action.run();
+ }
+
+ });
+ }
+
+ private void updateLink() {
+ if (meControl != null) {
+ meControl.dispose();
+ }
+ if (labelWidget != null) {
+ labelWidget.dispose();
+ }
+
+ EObject opposite = (EObject) getModelElement().eGet(eReference);
+ if (opposite != null) {
+ MELinkControlFactory meLinkControlFactory = new MELinkControlFactory();
+ meControl = meLinkControlFactory.createMELinkControl(getItemPropertyDescriptor(), opposite,
+ getModelElement(), getContext());
+ meControl.createControl(linkArea, style, getItemPropertyDescriptor(), opposite, getModelElement(),
+ getToolkit(), getContext());
+ } else {
+ labelWidget = getToolkit().createLabel(linkArea, "(Not Set)");
+ labelWidget.setBackground(parent.getBackground());
+ labelWidget.setForeground(parent.getShell().getDisplay().getSystemColor(SWT.COLOR_DARK_GRAY));
+ }
+ linkArea.layout(true);
+ composite.layout(true);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void dispose() {
+ modelElementChangeListener.remove();
+ if (meControl != null) {
+ meControl.dispose();
+ }
+
+ }
+
+ @Override
+ public int canRender(IItemPropertyDescriptor itemPropertyDescriptor, EObject modelElement) {
+ Object feature = itemPropertyDescriptor.getFeature(modelElement);
+ if (feature instanceof EReference && !((EReference) feature).isMany()
+ && EObject.class.isAssignableFrom(((EReference) feature).getEType().getInstanceClass())) {
+ return PRIORITY;
+ }
+ return AbstractMEControl.DO_NOT_RENDER;
+ }
+}
\ No newline at end of file
diff --git a/old/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/mecontrols/melinkcontrol/NewReferenceAction.java b/old/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/mecontrols/melinkcontrol/NewReferenceAction.java
new file mode 100644
index 0000000..ce25c4a
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/mecontrols/melinkcontrol/NewReferenceAction.java
@@ -0,0 +1,201 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2011 Chair for Applied Software Engineering,
+ * Technische Universitaet Muenchen.
+ * 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:
+ ******************************************************************************/
+package org.eclipse.emf.ecp.editor.mecontrols.melinkcontrol;
+
+import java.util.Set;
+
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.ecore.EReference;
+import org.eclipse.emf.ecp.common.MEClassLabelProvider;
+import org.eclipse.emf.ecp.common.commands.ECPCommand;
+import org.eclipse.emf.ecp.common.model.ECPModelelementContext;
+import org.eclipse.emf.ecp.common.util.DialogHandler;
+import org.eclipse.emf.ecp.common.util.OverlayImageDescriptor;
+import org.eclipse.emf.ecp.common.utilities.ActionHelper;
+import org.eclipse.emf.edit.provider.ComposedAdapterFactory;
+import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
+import org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.window.Window;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.dialogs.ElementListSelectionDialog;
+
+/**
+ * An Action for adding reference links to a model element. It is mainly used in the {@link MEMultiLinkControl}
+ *
+ * @author shterev
+ */
+public class NewReferenceAction extends ReferenceAction {
+
+ private static final String DIALOG_MESSAGE = "Select a model element type to be created:";
+
+ /**
+ * Command to create a new reference.
+ *
+ * @author helming
+ */
+ private final class NewReferenceCommand extends ECPCommand {
+
+ public NewReferenceCommand(EObject eObject) {
+ super(eObject);
+ }
+
+ /**
+ *
+ * {@inheritDoc}
+ * @see org.eclipse.emf.ecp.common.commands.ECPCommand#doRun()
+ */
+ @SuppressWarnings("unchecked")
+ @Override
+ protected void doRun() {
+
+ if (!checkMultiplicity(false)) {
+ return;
+ }
+
+ EClass clazz = getReference().getEReferenceType();
+ EClass newClass = null;
+ Set<EClass> subclasses = getAllSubEClasses(clazz);
+
+ if (subclasses.size() == 1) {
+ newClass = subclasses.iterator().next();
+ } else {
+ ElementListSelectionDialog dlg = new ElementListSelectionDialog(PlatformUI.getWorkbench()
+ .getActiveWorkbenchWindow().getShell(), new MEClassLabelProvider());
+ dlg.setMessage(DIALOG_MESSAGE);
+ dlg.setElements(subclasses.toArray());
+
+ dlg.setTitle("Select Element type");
+ dlg.setBlockOnOpen(true);
+ if (dlg.open() != Window.OK) {
+ return;
+ }
+ Object result = dlg.getFirstResult();
+ if (result instanceof EClass) {
+ newClass = (EClass) result;
+ }
+ }
+ final EObject newMEInstance;
+
+ EPackage ePackage = newClass.getEPackage();
+ newMEInstance = ePackage.getEFactoryInstance().create(newClass);
+
+ if (!getReference().isContainer()) {
+ // Returns the value of the Container
+ EObject parent = getModelElement().eContainer();
+ while (parent != null && newMEInstance.eContainer() == null) {
+ EReference reference = modelElementContext.getMetaModelElementContext()
+ .getPossibleContainingReference(newMEInstance, parent);
+ if (reference != null && reference.isMany()) {
+ Object object = parent.eGet(reference);
+ EList<EObject> eList = (EList<EObject>) object;
+ eList.add(newMEInstance);
+ }
+ parent = parent.eContainer();
+ }
+
+ if (newMEInstance.eContainer() == null) {
+ throw new RuntimeException("No matching container for model element found");
+ }
+
+ }
+
+ // add the new object to the reference
+ Object object = getModelElement().eGet(getReference());
+ if (isMultiReference()) {
+ EList<EObject> eList = (EList<EObject>) object;
+ eList.add(newMEInstance);
+ } else {
+ getModelElement().eSet(getReference(), newMEInstance);
+ }
+
+ ActionHelper.openModelElement(newMEInstance, this.getClass().getName());
+ }
+
+ private Set<EClass> getAllSubEClasses(EClass clazz) {
+ Set<EClass> subclasses;
+
+ if (getReference().isContainment()) {
+ subclasses = modelElementContext.getMetaModelElementContext().getAllSubEClasses(clazz, false, true);
+ } else {
+ subclasses = modelElementContext.getMetaModelElementContext().getAllSubEClasses(clazz, false, false);
+ }
+
+ return subclasses;
+ }
+
+ }
+
+ private final ECPModelelementContext modelElementContext;
+
+ /**
+ * Default constructor.
+ *
+ * @param modelElement the source model element
+ * @param eReference the target reference
+ * @param descriptor the descriptor used to generate display content
+ * @param modelElementContext the model element context
+ */
+ public NewReferenceAction(EObject modelElement, EReference eReference, IItemPropertyDescriptor descriptor,
+ ECPModelelementContext modelElementContext) {
+ this.setModelElement(modelElement);
+ this.setReference(eReference);
+ this.modelElementContext = modelElementContext;
+
+ Object obj = null;
+ // Only create a temporary object in order to get the correct icon from the label provider
+ // the actual ME is created later on.
+ if (!eReference.getEReferenceType().isAbstract()) {
+ obj = eReference.getEReferenceType().getEPackage().getEFactoryInstance()
+ .create(eReference.getEReferenceType());
+ }
+ ComposedAdapterFactory adapterFactory = new ComposedAdapterFactory(
+ ComposedAdapterFactory.Descriptor.Registry.INSTANCE);
+ Image image = new AdapterFactoryLabelProvider(adapterFactory).getImage(obj);
+ adapterFactory.dispose();
+
+ ImageDescriptor addOverlay = org.eclipse.emf.ecp.common.Activator.getImageDescriptor("icons/add_overlay.png");
+ OverlayImageDescriptor imageDescriptor = new OverlayImageDescriptor(image, addOverlay,
+ OverlayImageDescriptor.LOWER_RIGHT);
+ setImageDescriptor(imageDescriptor);
+
+ String attribute = descriptor.getDisplayName(eReference);
+
+ // make singular attribute labels
+ if (attribute.endsWith("ies")) {
+ attribute = attribute.substring(0, attribute.length() - 3) + "y";
+ } else if (attribute.endsWith("s")) {
+ attribute = attribute.substring(0, attribute.length() - 1);
+ }
+ setToolTipText("Create and link new " + attribute);
+
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void run() {
+ if (getReference().isContainer()) {
+ DialogHandler.showErrorDialog("Operation not permitted for container references!");
+ return;
+ }
+ new NewReferenceCommand(getModelElement()).run(true);
+ }
+
+ private boolean isMultiReference() {
+ return (getReference().getUpperBound() != 1 && getReference().getUpperBound() != 0);
+ }
+}
\ No newline at end of file
diff --git a/old/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/mecontrols/melinkcontrol/ReferenceAction.java b/old/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/mecontrols/melinkcontrol/ReferenceAction.java
new file mode 100644
index 0000000..0419b25
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/mecontrols/melinkcontrol/ReferenceAction.java
@@ -0,0 +1,97 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2011 Chair for Applied Software Engineering,
+ * Technische Universitaet Muenchen.
+ * 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:
+ ******************************************************************************/
+package org.eclipse.emf.ecp.editor.mecontrols.melinkcontrol;
+
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EReference;
+import org.eclipse.jface.action.Action;
+import org.eclipse.swt.widgets.MessageBox;
+import org.eclipse.ui.PlatformUI;
+
+/**
+ * Abstract class that models a action involving a reference.
+ *
+ */
+public abstract class ReferenceAction extends Action {
+
+ private EReference eReference;
+ private EObject modelElement;
+
+ /**
+ * Checks whether the multiplicity of the reference is valid.
+ *
+ * @param silent
+ * Whether a message box should be shown in case the multiplicity is invalid
+ * @return true, if the multiplicity is valid, false otherwise
+ */
+ protected boolean checkMultiplicity(boolean silent) {
+ if (eReference.getUpperBound() == 1 || eReference.getUpperBound() == -1) {
+ return true;
+ }
+ Object object = getModelElement().eGet(eReference);
+ if (object instanceof EList<?>) {
+ @SuppressWarnings("unchecked")
+ EList<EObject> eList = (EList<EObject>) object;
+ if (eList.size() < eReference.getUpperBound()) {
+ return true;
+ } else {
+ MessageBox box = new MessageBox(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell());
+ box.setMessage("Reference " + eReference.getName() + " has a multiplicity of "
+ + eReference.getUpperBound() + ". Please remove referenced elements before you add new.");
+ box.open();
+ return false;
+ }
+
+ }
+ return false;
+
+ }
+
+ /**
+ * Returns the reference involved in this action.
+ *
+ * @return the reference
+ */
+ public EReference getReference() {
+ return eReference;
+ }
+
+ /**
+ * Sets the reference involved in this action.
+ *
+ * @param eReference
+ * the reference to be set
+ */
+ public void setReference(EReference eReference) {
+ this.eReference = eReference;
+ }
+
+ /**
+ * Returns the model element that is affected by this reference action.
+ *
+ * @return the model element belonging to this action
+ */
+ public EObject getModelElement() {
+ return modelElement;
+ }
+
+ /**
+ * Sets the affected model element.
+ *
+ * @param modelElement
+ * the model element to be set
+ */
+ public void setModelElement(EObject modelElement) {
+ this.modelElement = modelElement;
+ }
+
+}
\ No newline at end of file
diff --git a/old/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/mecontrols/melinkcontrol/associationclasscontrol/AddAssociationClassAction.java b/old/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/mecontrols/melinkcontrol/associationclasscontrol/AddAssociationClassAction.java
new file mode 100644
index 0000000..150ff44
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/mecontrols/melinkcontrol/associationclasscontrol/AddAssociationClassAction.java
@@ -0,0 +1,116 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2011 Chair for Applied Software Engineering,
+ * Technische Universitaet Muenchen.
+ * 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:
+ ******************************************************************************/
+package org.eclipse.emf.ecp.editor.mecontrols.melinkcontrol.associationclasscontrol;
+
+import java.util.Collection;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EReference;
+import org.eclipse.emf.ecp.common.commands.ECPCommand;
+import org.eclipse.emf.ecp.common.model.ECPModelelementContext;
+import org.eclipse.emf.ecp.common.model.workSpaceModel.util.AssociationClassHelper;
+import org.eclipse.emf.ecp.common.util.OverlayImageDescriptor;
+import org.eclipse.emf.ecp.editor.MESuggestedSelectionDialog;
+import org.eclipse.emf.edit.provider.ComposedAdapterFactory;
+import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
+import org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider;
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.window.Window;
+import org.eclipse.swt.graphics.Image;
+
+/**
+ * This class provides the icon and command to link to a existing object over an AssociationClassElement.
+ *
+ * @author Michael Haeger
+ */
+public class AddAssociationClassAction extends Action {
+
+ private static final String DIALOG_MESSAGE = "Enter model element name prefix or pattern (e.g. *Trun?)";
+
+ private EReference eReference;
+ private EObject modelElement;
+ private final ECPModelelementContext context;
+
+ /**
+ * The link command.
+ *
+ * @author Michael Haeger
+ */
+ private final class AddAssociationClassCommand extends ECPCommand {
+
+ public AddAssociationClassCommand(EObject eObject) {
+ super(eObject);
+ }
+
+ @Override
+ protected void doRun() {
+ Collection<EObject> allElements = context.getAllModelElementsbyClass(modelElement.eClass(), false);
+ MESuggestedSelectionDialog dlg = new MESuggestedSelectionDialog("Select Elements", DIALOG_MESSAGE, true,
+ modelElement, eReference, allElements);
+ if (dlg.open() == Window.OK) {
+ if (eReference.isMany()) {
+ for (Object result : dlg.getResult()) {
+ AssociationClassHelper.createAssociation(eReference, modelElement, (EObject) result,
+ context.getMetaModelElementContext());
+ }
+ } else {
+ AssociationClassHelper.createAssociation(eReference, modelElement, (EObject) dlg.getFirstResult(),
+ context.getMetaModelElementContext());
+ }
+ }
+ }
+ }
+
+ /**
+ * Default constructor.
+ *
+ * @param modelElement the object
+ * @param eReference the reference to the AssociationClassElement
+ * @param descriptor the descriptor used to generate display content
+ * @param context model element context
+ */
+ public AddAssociationClassAction(EObject modelElement, EReference eReference, IItemPropertyDescriptor descriptor,
+ ECPModelelementContext context) {
+ this.modelElement = modelElement;
+ this.eReference = eReference;
+ this.context = context;
+ Object obj = null;
+ if (!eReference.getEReferenceType().isAbstract()) {
+ obj = eReference.getEReferenceType().getEPackage().getEFactoryInstance()
+ .create(eReference.getEReferenceType());
+ }
+ ComposedAdapterFactory adapterFactory = new ComposedAdapterFactory(
+ ComposedAdapterFactory.Descriptor.Registry.INSTANCE);
+ Image image = new AdapterFactoryLabelProvider(adapterFactory).getImage(obj);
+ adapterFactory.dispose();
+ ImageDescriptor addOverlay = org.eclipse.emf.ecp.common.Activator.getImageDescriptor("icons/link_overlay.png");
+ OverlayImageDescriptor imageDescriptor = new OverlayImageDescriptor(image, addOverlay,
+ OverlayImageDescriptor.LOWER_RIGHT);
+ setImageDescriptor(imageDescriptor);
+ String attribute = descriptor.getDisplayName(eReference);
+ // make singular attribute labels
+ if (attribute.endsWith("ies")) {
+ attribute = attribute.substring(0, attribute.length() - 3) + "y";
+ } else if (attribute.endsWith("s")) {
+ attribute = attribute.substring(0, attribute.length() - 1);
+ }
+ setToolTipText("Link " + attribute);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void run() {
+ new AddAssociationClassCommand(modelElement).run(true);
+ }
+}
\ No newline at end of file
diff --git a/old/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/mecontrols/melinkcontrol/associationclasscontrol/AssociationClassControl.java b/old/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/mecontrols/melinkcontrol/associationclasscontrol/AssociationClassControl.java
new file mode 100644
index 0000000..ee8a6c1
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/mecontrols/melinkcontrol/associationclasscontrol/AssociationClassControl.java
@@ -0,0 +1,224 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2011 Chair for Applied Software Engineering,
+ * Technische Universitaet Muenchen.
+ * 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:
+ ******************************************************************************/
+package org.eclipse.emf.ecp.editor.mecontrols.melinkcontrol.associationclasscontrol;
+
+import java.util.ArrayList;
+import java.util.LinkedList;
+import java.util.List;
+
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EReference;
+import org.eclipse.emf.ecp.common.commands.ECPCommand;
+import org.eclipse.emf.ecp.editor.mecontrols.AbstractMEControl;
+import org.eclipse.emf.ecp.editor.mecontrols.melinkcontrol.MELinkControl;
+import org.eclipse.emf.ecp.editor.mecontrols.melinkcontrol.MELinkControlFactory;
+import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
+import org.eclipse.jface.action.ToolBarManager;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.ScrolledComposite;
+import org.eclipse.swt.events.DisposeEvent;
+import org.eclipse.swt.events.DisposeListener;
+import org.eclipse.swt.graphics.Cursor;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.layout.RowLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.ToolBar;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+import org.eclipse.ui.forms.widgets.Section;
+
+/**
+ * The GUI control for AssociationClassElements.
+ *
+ * @author Michael Haeger
+ */
+public class AssociationClassControl extends AbstractMEControl {
+
+ /**
+ * Command to rebuild the links.
+ *
+ * @author Michael Haeger
+ */
+ private final class RebuildLinksCommand extends ECPCommand {
+
+ private int sizeLimit;
+
+ public RebuildLinksCommand(EObject eObject) {
+ super(eObject);
+ }
+
+ public RebuildLinksCommand(EObject eObject, int sizeLimit) {
+ this(eObject);
+ this.sizeLimit = sizeLimit;
+ }
+
+ @Override
+ protected void doRun() {
+ Object evaluatedFeature = getModelElement().eGet(eReference);
+ LinkedList<Object> associations = new LinkedList<Object>();
+ if (eReference.isMany()) {
+ associations.addAll((List<?>) evaluatedFeature);
+ } else {
+ associations.add(evaluatedFeature);
+ }
+ if (associations.size() <= sizeLimit) {
+ linkArea = getToolkit().createComposite(composite, style);
+ linkArea.setLayout(tableLayout);
+ linkArea.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+ } else {
+ scrollPane = new ScrolledComposite(composite, SWT.V_SCROLL | SWT.H_SCROLL);
+ scrollPane.setBackgroundMode(SWT.INHERIT_FORCE);
+ scrollClient = new Composite(scrollPane, style);
+ scrollPane.setContent(scrollClient);
+ getToolkit().getColors().createColor("white", 255, 255, 255);
+ scrollClient.setBackground(getToolkit().getColors().getColor("white"));
+ scrollPane.setExpandVertical(true);
+ scrollPane.setExpandHorizontal(true);
+ RowLayout layout = new RowLayout(SWT.VERTICAL);
+ layout.wrap = true;
+ scrollClient.setLayout(layout);
+ GridData spec = new GridData(400, 150);
+ spec.horizontalAlignment = GridData.FILL;
+ spec.grabExcessHorizontalSpace = true;
+ scrollPane.setLayoutData(spec);
+ scrollPane.setMinSize(150, 150);
+ }
+ for (Object association : associations) {
+ MELinkControlFactory controlFactory = new MELinkControlFactory();
+ MELinkControl meControl = controlFactory.createMELinkControl(getItemPropertyDescriptor(),
+ (EObject) association, getModelElement(), getContext());
+ meControl.createControl((associations.size() <= sizeLimit ? linkArea : scrollClient), style,
+ getItemPropertyDescriptor(), (EObject) association, getModelElement(), getToolkit(), getContext());
+ linkControls.add(meControl);
+ }
+ if (scrollPane != null && !scrollPane.isDisposed()) {
+ scrollPane.setMinSize(scrollClient.computeSize(SWT.DEFAULT, SWT.DEFAULT));
+ scrollClient.layout();
+ scrollPane.layout();
+ } else {
+ linkArea.layout();
+ }
+ if (associations.size() > 0) {
+ section.setExpanded(false);
+ section.setExpanded(true);
+ }
+ }
+ }
+
+ private static final int PRIORITY = 2;
+ private EReference eReference;
+ private int style;
+ private ScrolledComposite scrollPane;
+ private Section section;
+ private Composite linkArea;
+ private Composite composite;
+ private Composite scrollClient;
+ private GridLayout tableLayout;
+ private org.eclipse.emf.ecp.editor.ModelElementChangeListener modelElementChangeListener;
+ private ArrayList<MELinkControl> linkControls;
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public int canRender(IItemPropertyDescriptor itemPropertyDescriptor, EObject modelElement) {
+ Object feature = itemPropertyDescriptor.getFeature(modelElement);
+ if (getContext() != null
+ && feature instanceof EReference
+ && getContext().getMetaModelElementContext().isAssociationClassElement(
+ ((EReference) feature).getEReferenceType())) {
+ return PRIORITY;
+ }
+ return AbstractMEControl.DO_NOT_RENDER;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void dispose() {
+ modelElementChangeListener.remove();
+ for (MELinkControl link : linkControls) {
+ link.dispose();
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.ecp.editor.mecontrols.AbstractMEControl#createControl(org.eclipse.swt.widgets.Composite,
+ * int)
+ */
+ @Override
+ protected Control createControl(Composite parent, int style) {
+ linkControls = new ArrayList<MELinkControl>();
+ eReference = (EReference) getItemPropertyDescriptor().getFeature(getModelElement());
+ modelElementChangeListener = new org.eclipse.emf.ecp.editor.ModelElementChangeListener(getModelElement()) {
+ @Override
+ public void onChange(Notification notification) {
+ if ((notification.getEventType() != Notification.RESOLVE)
+ && (notification.getFeature().equals(eReference))) {
+ rebuildLinkSection();
+ }
+ }
+ };
+ this.style = style;
+ tableLayout = new GridLayout(1, false);
+ section = getToolkit().createSection(parent, Section.TITLE_BAR | Section.TWISTIE | Section.EXPANDED);
+ section.setText(getItemPropertyDescriptor().getDisplayName(getModelElement()));
+ createSectionToolbar(section, getToolkit());
+ composite = getToolkit().createComposite(section, style);
+ composite.setLayout(tableLayout);
+ rebuildLinkSection();
+ section.setClient(composite);
+ return section;
+ }
+
+ private void createSectionToolbar(Section section, FormToolkit toolkit) {
+ ToolBarManager toolBarManager = new ToolBarManager(SWT.FLAT);
+ ToolBar toolbar = toolBarManager.createControl(section);
+ final Cursor handCursor = new Cursor(Display.getCurrent(), SWT.CURSOR_HAND);
+ toolbar.setCursor(handCursor);
+ // Cursor needs to be explicitly disposed
+ toolbar.addDisposeListener(new DisposeListener() {
+ public void widgetDisposed(DisposeEvent e) {
+ if (!handCursor.isDisposed()) {
+ handCursor.dispose();
+ }
+ }
+ });
+ toolBarManager.add(new AddAssociationClassAction(getModelElement(), eReference, getItemPropertyDescriptor(),
+ getContext()));
+ toolBarManager.add(new NewAssociationClassAction(getModelElement(), eReference, getItemPropertyDescriptor(),
+ getContext()));
+ toolBarManager.update(true);
+ section.setTextClient(toolbar);
+ }
+
+ private void rebuildLinkSection() {
+ final int sizeLimit = 5;
+
+ for (MELinkControl link : linkControls) {
+ link.dispose();
+ }
+ if (scrollPane != null) {
+ scrollPane.dispose();
+ }
+ if (linkArea != null) {
+ linkArea.dispose();
+ }
+ linkControls.clear();
+ new RebuildLinksCommand(getModelElement(), sizeLimit).run(true);
+ }
+}
\ No newline at end of file
diff --git a/old/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/mecontrols/melinkcontrol/associationclasscontrol/AssociationClassControlNoNew.java b/old/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/mecontrols/melinkcontrol/associationclasscontrol/AssociationClassControlNoNew.java
new file mode 100644
index 0000000..7aa75b6
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/mecontrols/melinkcontrol/associationclasscontrol/AssociationClassControlNoNew.java
@@ -0,0 +1,77 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2011 Chair for Applied Software Engineering,
+ * Technische Universitaet Muenchen.
+ * 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:
+ ******************************************************************************/
+package org.eclipse.emf.ecp.editor.mecontrols.melinkcontrol.associationclasscontrol;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EReference;
+import org.eclipse.emf.ecp.common.model.ECPAssociationClassElement;
+import org.eclipse.emf.ecp.editor.mecontrols.AbstractMEControl;
+import org.eclipse.emf.ecp.editor.mecontrols.melinkcontrol.AddReferenceAction;
+import org.eclipse.emf.ecp.editor.mecontrols.melinkcontrol.MESingleLinkControl;
+import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
+import org.eclipse.jface.action.Action;
+
+/**
+ * This widget removes the new reference action for source and target from every association class. We have to do this
+ * because of the source containment of the association.
+ *
+ * @author Michael Haeger
+ */
+public class AssociationClassControlNoNew extends MESingleLinkControl {
+ private static final int PRIORITY = 2;
+
+ /**
+ * Default constructor.
+ */
+ public AssociationClassControlNoNew() {
+ super();
+ }
+
+ /**
+ * Only create an AddReferenceAction. We can not support NewReferenceActions because of the containment.
+ *
+ * @return Returns the actions.
+ */
+ @Override
+ protected List<Action> initActions() {
+ List<Action> result = new ArrayList<Action>();
+ AddReferenceAction addAction = new AddReferenceAction(getModelElement(), geteReference(),
+ getItemPropertyDescriptor(), getContext());
+ result.add(addAction);
+ return result;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.ecp.editor.mecontrols.melinkcontrol.MESingleLinkControl#canRender(org.eclipse.emf.edit.provider.IItemPropertyDescriptor,
+ * org.eclipse.emf.ecore.EObject)
+ */
+ @Override
+ public int canRender(IItemPropertyDescriptor itemPropertyDescriptor, EObject modelElement) {
+ Object feature = itemPropertyDescriptor.getFeature(modelElement);
+ if (feature instanceof EReference && !((EReference) feature).isMany()) {
+ if (getContext() != null
+ && getContext().getMetaModelElementContext().isAssociationClassElement(modelElement)) {
+ ECPAssociationClassElement association = getContext().getMetaModelElementContext()
+ .getAssociationClassElement(modelElement);
+ // display if given reference is equal to source or target feature
+ if (association.getSourceFeature().equals(feature) || association.getTargetFeature().equals(feature)) {
+ return PRIORITY;
+ }
+ }
+ }
+ return AbstractMEControl.DO_NOT_RENDER;
+ }
+}
\ No newline at end of file
diff --git a/old/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/mecontrols/melinkcontrol/associationclasscontrol/AssociationClassLink.java b/old/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/mecontrols/melinkcontrol/associationclasscontrol/AssociationClassLink.java
new file mode 100644
index 0000000..fe60f67
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/mecontrols/melinkcontrol/associationclasscontrol/AssociationClassLink.java
@@ -0,0 +1,253 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2011 Chair for Applied Software Engineering,
+ * Technische Universitaet Muenchen.
+ * 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:
+ ******************************************************************************/
+package org.eclipse.emf.ecp.editor.mecontrols.melinkcontrol.associationclasscontrol;
+
+import java.util.List;
+
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EReference;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.ecp.common.model.ECPAssociationClassElement;
+import org.eclipse.emf.ecp.common.model.ECPModelelementContext;
+import org.eclipse.emf.ecp.common.model.workSpaceModel.util.AssociationClassHelper;
+import org.eclipse.emf.ecp.common.utilities.ModelElementClassTooltip;
+import org.eclipse.emf.ecp.common.utilities.ShortLabelProvider;
+import org.eclipse.emf.ecp.editor.ControlFactory;
+import org.eclipse.emf.ecp.editor.ModelElementChangeListener;
+import org.eclipse.emf.ecp.editor.mecontrols.AbstractMEControl;
+import org.eclipse.emf.ecp.editor.mecontrols.melinkcontrol.MEHyperLinkAdapter;
+import org.eclipse.emf.ecp.editor.mecontrols.melinkcontrol.MEHyperLinkDeleteAdapter;
+import org.eclipse.emf.ecp.editor.mecontrols.melinkcontrol.MELinkControl;
+import org.eclipse.emf.edit.provider.ComposedAdapterFactory;
+import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
+import org.eclipse.emf.edit.provider.ItemPropertyDescriptor;
+import org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider;
+import org.eclipse.jface.viewers.DecoratingLabelProvider;
+import org.eclipse.jface.viewers.ILabelProvider;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.IDecoratorManager;
+import org.eclipse.ui.ISharedImages;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.forms.events.IHyperlinkListener;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+import org.eclipse.ui.forms.widgets.Hyperlink;
+import org.eclipse.ui.forms.widgets.ImageHyperlink;
+
+/**
+ * This is the association widget. It is displayed instead of the reference to the AssociationClassElement. The other
+ * side of the association is displayed and in addition a widget if the AssociationClassElement has only one feature to
+ * setup else the link to the association.
+ *
+ * @author Michael Haeger
+ */
+public class AssociationClassLink extends MELinkControl {
+ private static final int PRIORITY = 2;
+ private Composite composite;
+ private ILabelProvider labelProvider;
+ private ImageHyperlink imgHyperlink;
+ private Hyperlink hyperlink;
+ private Image deleteImage;
+ private ModelElementChangeListener meChangeListener;
+ private ModelElementChangeListener associationChangeListener;
+ private IHyperlinkListener linkToMEListener;
+ private MEHyperLinkDeleteAdapter delAssociationListener;
+ private EObject association;
+ private EObject modelElement;
+ private EObject relatedModelElement;
+ private List<EStructuralFeature> eAttribute;
+ private ShortLabelProvider shortLabelProvider = new ShortLabelProvider();
+ private EReference eReference;
+ private Composite parent;
+ private ComposedAdapterFactory adapterFactory;
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.ecp.editor.mecontrols.melinkcontrol.MELinkControl#canRender(org.eclipse.emf.edit.provider.IItemPropertyDescriptor,
+ * org.eclipse.emf.ecore.EObject, org.eclipse.emf.ecore.EObject)
+ */
+ @Override
+ public int canRender(IItemPropertyDescriptor itemPropertyDescriptor, EObject link, EObject contextModelElement) {
+ Object ref = itemPropertyDescriptor.getFeature(contextModelElement);
+ if (getContext() != null) {
+ if (getContext().getMetaModelElementContext().isAssociationClassElement(link) && ref instanceof EReference) {
+ ECPAssociationClassElement association = getContext().getMetaModelElementContext()
+ .getAssociationClassElement(link);
+ if (association.getSourceFeature().equals(((EReference) ref).getEOpposite())
+ || association.getTargetFeature().equals(((EReference) ref).getEOpposite())) {
+ return PRIORITY;
+ }
+ }
+ }
+ return AbstractMEControl.DO_NOT_RENDER;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.ecp.editor.mecontrols.melinkcontrol.MELinkControl#createControl(org.eclipse.swt.widgets.Composite,
+ * int, org.eclipse.emf.edit.provider.IItemPropertyDescriptor, org.eclipse.emf.ecore.EObject,
+ * org.eclipse.emf.ecore.EObject, org.eclipse.ui.forms.widgets.FormToolkit,
+ * org.eclipse.emf.ecp.model.ECPModelelementContext)
+ */
+ @Override
+ public Control createControl(final Composite parent, int style, IItemPropertyDescriptor itemPropertyDescriptor,
+ final EObject link, EObject contextModelElement, FormToolkit toolkit, ECPModelelementContext context) {
+ association = link;
+ modelElement = contextModelElement;
+ eReference = (EReference) itemPropertyDescriptor.getFeature(association);
+ eAttribute = AssociationClassHelper.getAssociationFeatures(association, context.getMetaModelElementContext());
+ setToolkit(toolkit);
+ setContext(context);
+ this.parent = parent;
+ // create components
+ createComponents(parent, style);
+ // set all values that depends on other elements
+ setupComponents();
+ return composite;
+ }
+
+ private boolean setupComponents() {
+ boolean changed = false;
+ if (composite != null && !composite.isDisposed()) {
+ EObject newRelatedModelElement = AssociationClassHelper.getRelatedModelElement(modelElement, association,
+ getContext());
+ // check whether it is a new linked goal
+ if (newRelatedModelElement != null && !newRelatedModelElement.equals(relatedModelElement)) {
+ // new goal
+ relatedModelElement = newRelatedModelElement;
+ // remove old listeners
+ if (linkToMEListener != null) {
+ imgHyperlink.removeHyperlinkListener(linkToMEListener);
+ hyperlink.removeHyperlinkListener(linkToMEListener);
+ }
+ // add new listeners
+ linkToMEListener = new MEHyperLinkAdapter(relatedModelElement, modelElement, eReference.getName());
+ imgHyperlink.addHyperlinkListener(linkToMEListener);
+ hyperlink.addHyperlinkListener(linkToMEListener);
+ if (meChangeListener != null) {
+ meChangeListener.remove();
+ }
+ meChangeListener = new AssociationChangeListener(relatedModelElement);
+ } else if (newRelatedModelElement == null && relatedModelElement != null) {
+ // link to goal is removed so remove listener
+ relatedModelElement = newRelatedModelElement;
+ imgHyperlink.removeHyperlinkListener(linkToMEListener);
+ hyperlink.removeHyperlinkListener(linkToMEListener);
+ }
+ if (relatedModelElement != null) {
+ // create components for linked goal
+ imgHyperlink.setData(relatedModelElement.eClass());
+ String text = shortLabelProvider.getText(relatedModelElement);
+ hyperlink.setText(text);
+ hyperlink.setToolTipText(text);
+ } else {
+ imgHyperlink.setData(null);
+ hyperlink.setToolTipText("NULL");
+ hyperlink.setText("NULL");
+ }
+ imgHyperlink.setImage(labelProvider.getImage(relatedModelElement));
+ changed = true;
+ }
+ return changed;
+ }
+
+ private void createComponents(final Composite parent, int style) {
+ composite = getToolkit().createComposite(parent, style);
+ composite.setLayout(new GridLayout(5, false));
+ // handle element deletion
+ delAssociationListener = new MEHyperLinkDeleteAdapter(modelElement, eReference, association, getContext());
+ // listen for changes of the goal reference instance
+ associationChangeListener = new AssociationChangeListener(association);
+ adapterFactory = new ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry.INSTANCE);
+ AdapterFactoryLabelProvider adapterFactoryLabelProvider = new AdapterFactoryLabelProvider(adapterFactory);
+ IDecoratorManager decoratorManager = PlatformUI.getWorkbench().getDecoratorManager();
+ labelProvider = new DecoratingLabelProvider(adapterFactoryLabelProvider, decoratorManager.getLabelDecorator());
+ imgHyperlink = getToolkit().createImageHyperlink(composite, style);
+ ModelElementClassTooltip.enableFor(imgHyperlink);
+ hyperlink = getToolkit().createHyperlink(composite, "", style);
+ if (eAttribute.size() == 1) {
+ ControlFactory controlFactory = new ControlFactory();
+ ItemPropertyDescriptor itemPropertyDescriptor = new ItemPropertyDescriptor(null, "", "", eAttribute.get(0));
+ AbstractMEControl meControl = controlFactory.createControl(itemPropertyDescriptor, association,
+ getContext());
+ meControl.createControl(composite, style, itemPropertyDescriptor, association, getContext(), getToolkit());
+ } else if (eAttribute.size() > 1) {
+ Hyperlink associationLink = getToolkit().createHyperlink(composite, "[edit]", style);
+ associationLink
+ .addHyperlinkListener(new MEHyperLinkAdapter(association, modelElement, eReference.getName()));
+ }
+ if (eReference.isContainment()
+ && (getContext().getMetaModelElementContext().isNonDomainElement(association.eClass()))) {
+ deleteImage = org.eclipse.emf.ecp.common.Activator.getImageDescriptor("icons/delete.gif").createImage();
+ } else {
+ deleteImage = PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_TOOL_DELETE);
+ }
+ ImageHyperlink delHyperlink = getToolkit().createImageHyperlink(composite, style);
+ delHyperlink.setImage(deleteImage);
+ delHyperlink.addMouseListener(delAssociationListener);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.ecp.editor.mecontrols.melinkcontrol.MELinkControl#dispose()
+ */
+ @Override
+ public void dispose() {
+ if (meChangeListener != null) {
+ meChangeListener.remove();
+ }
+ if (associationChangeListener != null) {
+ associationChangeListener.remove();
+ }
+ if (labelProvider != null) {
+ labelProvider.dispose();
+ }
+ if (composite != null) {
+ composite.dispose();
+ }
+ if (adapterFactory != null) {
+ adapterFactory.dispose();
+ }
+ super.dispose();
+ }
+
+ /**
+ * Change listener to rebuild links if content changes.
+ *
+ * @author Michael Haeger
+ */
+ private class AssociationChangeListener extends ModelElementChangeListener {
+ public AssociationChangeListener(EObject modelElement) {
+ super(modelElement);
+ }
+
+ @Override
+ public void onChange(Notification notification) {
+ Display.getDefault().asyncExec(new Runnable() {
+ public void run() {
+ // if something changes do layouts again
+ if (setupComponents()) {
+ composite.pack();
+ composite.layout(true);
+ parent.getParent().layout(true);
+ }
+ }
+ });
+ }
+ }
+}
\ No newline at end of file
diff --git a/old/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/mecontrols/melinkcontrol/associationclasscontrol/AssociationClassLinkNoDelete.java b/old/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/mecontrols/melinkcontrol/associationclasscontrol/AssociationClassLinkNoDelete.java
new file mode 100644
index 0000000..d592e29
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/mecontrols/melinkcontrol/associationclasscontrol/AssociationClassLinkNoDelete.java
@@ -0,0 +1,59 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2011 Chair for Applied Software Engineering,
+ * Technische Universitaet Muenchen.
+ * 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:
+ ******************************************************************************/
+package org.eclipse.emf.ecp.editor.mecontrols.melinkcontrol.associationclasscontrol;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecp.common.model.ECPAssociationClassElement;
+import org.eclipse.emf.ecp.editor.mecontrols.AbstractMEControl;
+import org.eclipse.emf.ecp.editor.mecontrols.melinkcontrol.MELinkControl;
+import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
+
+/**
+ * This class is a simple widget that do not show any delete button on source or target feature in an association. (An
+ * AssociationClassElement could not exist without source or target.)
+ *
+ * @author Michael Haeger
+ */
+public class AssociationClassLinkNoDelete extends MELinkControl {
+ private static final int PRIORITY = 2;
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.ecp.editor.mecontrols.melinkcontrol.MELinkControl#canRender(org.eclipse.emf.edit.provider.IItemPropertyDescriptor,
+ * org.eclipse.emf.ecore.EObject, org.eclipse.emf.ecore.EObject)
+ */
+ @Override
+ public int canRender(IItemPropertyDescriptor itemPropertyDescriptor, EObject link, EObject contextModelElement) {
+ if (getContext() != null) {
+ if (getContext().getMetaModelElementContext().isAssociationClassElement(contextModelElement)) {
+ ECPAssociationClassElement association = getContext().getMetaModelElementContext()
+ .getAssociationClassElement(contextModelElement);
+ // display if given reference is equal to source or target feature
+ if (association.getSourceFeature().equals(itemPropertyDescriptor.getFeature(link))
+ || association.getTargetFeature().equals(itemPropertyDescriptor.getFeature(link))) {
+ return PRIORITY;
+ }
+ }
+ }
+ return AbstractMEControl.DO_NOT_RENDER;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.ecp.editor.mecontrols.melinkcontrol.MELinkControl#createDeleteAction(int)
+ */
+ @Override
+ protected void createDeleteAction(int style) {
+ // display nothing
+ }
+}
\ No newline at end of file
diff --git a/old/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/mecontrols/melinkcontrol/associationclasscontrol/AssociationClassLinkNotShow.java b/old/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/mecontrols/melinkcontrol/associationclasscontrol/AssociationClassLinkNotShow.java
new file mode 100644
index 0000000..85a1465
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/mecontrols/melinkcontrol/associationclasscontrol/AssociationClassLinkNotShow.java
@@ -0,0 +1,66 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2011 Chair for Applied Software Engineering,
+ * Technische Universitaet Muenchen.
+ * 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:
+ ******************************************************************************/
+package org.eclipse.emf.ecp.editor.mecontrols.melinkcontrol.associationclasscontrol;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EReference;
+import org.eclipse.emf.ecp.common.model.ECPAssociationClassElement;
+import org.eclipse.emf.ecp.editor.mecontrols.AbstractMEControl;
+import org.eclipse.emf.ecp.editor.mecontrols.melinkcontrol.MELinkControl;
+import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+
+/**
+ * This class is a simple widget that do not show any reference to a AssociationClassElement if it is not referenced by
+ * source or target. (e.g. MEDiagram elements in MEEditor view)
+ *
+ * @author Michael Haeger
+ */
+public class AssociationClassLinkNotShow extends MELinkControl {
+ private static final int PRIORITY = 2;
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.ecp.editor.mecontrols.melinkcontrol.MELinkControl#canRender(org.eclipse.emf.edit.provider.IItemPropertyDescriptor,
+ * org.eclipse.emf.ecore.EObject, org.eclipse.emf.ecore.EObject)
+ */
+ @Override
+ public int canRender(IItemPropertyDescriptor itemPropertyDescriptor, EObject link, EObject contextModelElement) {
+ if (getContext() != null) {
+ Object ref = itemPropertyDescriptor.getFeature(contextModelElement);
+ if (getContext().getMetaModelElementContext().isAssociationClassElement(link) && ref instanceof EReference) {
+ ECPAssociationClassElement association = getContext().getMetaModelElementContext()
+ .getAssociationClassElement(link);
+ // display if the given reference opposite is not source or target feature: the given object can not be
+ // source or target of the association
+ if (!(association.getSourceFeature().equals(((EReference) ref).getEOpposite()) || association
+ .getTargetFeature().equals(((EReference) ref).getEOpposite()))) {
+ return PRIORITY;
+ }
+ }
+ }
+ return AbstractMEControl.DO_NOT_RENDER;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.ecp.editor.mecontrols.melinkcontrol.MELinkControl#createControl(org.eclipse.swt.widgets.Composite,
+ * int)
+ */
+ @Override
+ protected Control createControl(final Composite parent, int style) {
+ // display nothing
+ return null;
+ }
+}
\ No newline at end of file
diff --git a/old/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/mecontrols/melinkcontrol/associationclasscontrol/NewAssociationClassAction.java b/old/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/mecontrols/melinkcontrol/associationclasscontrol/NewAssociationClassAction.java
new file mode 100644
index 0000000..47fcb8c
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/mecontrols/melinkcontrol/associationclasscontrol/NewAssociationClassAction.java
@@ -0,0 +1,154 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2011 Chair for Applied Software Engineering,
+ * Technische Universitaet Muenchen.
+ * 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:
+ ******************************************************************************/
+package org.eclipse.emf.ecp.editor.mecontrols.melinkcontrol.associationclasscontrol;
+
+import java.util.Set;
+
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.ecore.EReference;
+import org.eclipse.emf.ecp.common.MEClassLabelProvider;
+import org.eclipse.emf.ecp.common.commands.ECPCommand;
+import org.eclipse.emf.ecp.common.model.ECPModelelementContext;
+import org.eclipse.emf.ecp.common.model.workSpaceModel.util.AssociationClassHelper;
+import org.eclipse.emf.ecp.common.util.OverlayImageDescriptor;
+import org.eclipse.emf.ecp.common.utilities.ActionHelper;
+import org.eclipse.emf.edit.provider.ComposedAdapterFactory;
+import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
+import org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider;
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.window.Window;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.dialogs.ElementListSelectionDialog;
+
+/**
+ * This class provides the icon and command to create a new object and link it with a given object over an
+ * AssociationClassElement.
+ *
+ * @author Michael Haeger
+ */
+public class NewAssociationClassAction extends Action {
+
+ private static final String DIALOG_MESSAGE = "Select a model element type to be created:";
+
+ private EReference eReference;
+ private EObject modelElement;
+ private final ECPModelelementContext context;
+
+ /**
+ * The create command.
+ *
+ * @author Michael Haeger
+ */
+ private final class NewAssociationClassCommand extends ECPCommand {
+
+ public NewAssociationClassCommand(EObject eObject) {
+ super(eObject);
+ }
+
+ @SuppressWarnings({ "unchecked" })
+ @Override
+ protected void doRun() {
+ EClass relatedModelElementClass = null;
+ Set<EClass> subclasses = context.getMetaModelElementContext().getAllSubEClasses(modelElement.eClass(),
+ false, true);
+ // select object type to create
+ if (subclasses.size() == 1) {
+ relatedModelElementClass = subclasses.iterator().next();
+ } else {
+ ElementListSelectionDialog dlg = new ElementListSelectionDialog(PlatformUI.getWorkbench()
+ .getActiveWorkbenchWindow().getShell(), new MEClassLabelProvider());
+ dlg.setMessage(DIALOG_MESSAGE);
+ dlg.setElements(subclasses.toArray());
+ dlg.setTitle("Select Element type");
+ dlg.setBlockOnOpen(true);
+ if (dlg.open() != Window.OK) {
+ return;
+ }
+ Object result = dlg.getFirstResult();
+ if (result instanceof EClass) {
+ relatedModelElementClass = (EClass) result;
+ }
+ }
+ // create the other side of the association
+ EPackage ePackage = relatedModelElementClass.getEPackage();
+ final EObject relatedModelElement = ePackage.getEFactoryInstance().create(relatedModelElementClass);
+ if (!eReference.isContainer()) {
+ EObject parent = modelElement.eContainer();
+ while (!(parent == null) && relatedModelElement.eContainer() == null) {
+ EReference reference = context.getMetaModelElementContext().getPossibleContainingReference(
+ relatedModelElement, parent);
+ if (reference != null && reference.isMany()) {
+ Object object = parent.eGet(reference);
+ EList<EObject> eList = (EList<EObject>) object;
+ eList.add(relatedModelElement);
+ }
+ parent = parent.eContainer();
+ }
+ if (relatedModelElement.eContainer() == null) {
+ throw new RuntimeException("No matching container for model element found");
+ }
+ }
+ // create the association
+ AssociationClassHelper.createAssociation(eReference, modelElement, relatedModelElement,
+ context.getMetaModelElementContext());
+ ActionHelper.openModelElement(relatedModelElement, this.getClass().getName());
+ }
+ }
+
+ /**
+ * Default constructor.
+ *
+ * @param modelElement the object
+ * @param eReference the reference to the AssociationClassElement
+ * @param descriptor the descriptor used to generate display content
+ * @param context model element context
+ */
+ public NewAssociationClassAction(EObject modelElement, EReference eReference, IItemPropertyDescriptor descriptor,
+ ECPModelelementContext context) {
+ this.modelElement = modelElement;
+ this.eReference = eReference;
+ this.context = context;
+ Object obj = null;
+ if (!eReference.getEReferenceType().isAbstract()) {
+ obj = eReference.getEReferenceType().getEPackage().getEFactoryInstance()
+ .create(eReference.getEReferenceType());
+ }
+ ComposedAdapterFactory adapterFactory = new ComposedAdapterFactory(
+ ComposedAdapterFactory.Descriptor.Registry.INSTANCE);
+ Image image = new AdapterFactoryLabelProvider(adapterFactory).getImage(obj);
+ adapterFactory.dispose();
+ ImageDescriptor addOverlay = org.eclipse.emf.ecp.common.Activator.getImageDescriptor("icons/add_overlay.png");
+ OverlayImageDescriptor imageDescriptor = new OverlayImageDescriptor(image, addOverlay,
+ OverlayImageDescriptor.LOWER_RIGHT);
+ setImageDescriptor(imageDescriptor);
+ String attribute = descriptor.getDisplayName(eReference);
+ // make singular attribute labels
+ if (attribute.endsWith("ies")) {
+ attribute = attribute.substring(0, attribute.length() - 3) + "y";
+ } else if (attribute.endsWith("s")) {
+ attribute = attribute.substring(0, attribute.length() - 1);
+ }
+ setToolTipText("Create and link new " + attribute);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void run() {
+ new NewAssociationClassCommand(modelElement).run(true);
+ }
+}
\ No newline at end of file
diff --git a/old/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/mecontrols/multiattributecontrol/AttributeControl.java b/old/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/mecontrols/multiattributecontrol/AttributeControl.java
new file mode 100644
index 0000000..a2f9444
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/mecontrols/multiattributecontrol/AttributeControl.java
@@ -0,0 +1,289 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2011 Chair for Applied Software Engineering,
+ * Technische Universitaet Muenchen.
+ * 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:
+ ******************************************************************************/
+package org.eclipse.emf.ecp.editor.mecontrols.multiattributecontrol;
+
+import org.eclipse.emf.ecp.editor.Activator;
+import org.eclipse.jface.layout.GridDataFactory;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.events.MouseEvent;
+import org.eclipse.swt.events.MouseListener;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.ISharedImages;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.forms.widgets.ImageHyperlink;
+
+/**
+ * Represents a general single field for a MultiAttributeItem.
+ *
+ * @author Christian Kroemer (christian.kroemer@z-corp-online.de)
+ */
+abstract class AttributeControl implements ModifyListener, MouseListener {
+ private MultiAttributeControl parentItem;
+ private Composite fieldComposite;
+ private int index = -1; // -1 = value for "not stored yet" / empty control
+
+ private ImageHyperlink button;
+ private ImageHyperlink up;
+ private ImageHyperlink down;
+
+ /**
+ * Disposes the control represented by this object.
+ */
+ public void dispose() {
+ fieldComposite.dispose();
+ }
+
+ /**
+ * Initializes the delete button.
+ */
+ protected void createDeleteButton() {
+ setButton(new ImageHyperlink(getFieldComposite(), SWT.TOP));
+ getButton().setImage(PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_TOOL_DELETE));
+ getButton().addMouseListener(this);
+ getFieldComposite().layout();
+ }
+
+ /**
+ * Initializes the add button.
+ */
+ protected void createAddButton() {
+ setButton(new ImageHyperlink(getFieldComposite(), SWT.TOP));
+ getButton().setImage(PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJ_ADD));
+ getButton().addMouseListener(this);
+ }
+
+ /**
+ * Initializes the up/down buttons.
+ */
+ protected void createUpDownButtons() {
+ Image up = Activator.getImageDescriptor("icons/arrow_up.png").createImage();
+ Image down = Activator.getImageDescriptor("icons/arrow_down.png").createImage();
+
+ // if invisible ones have been created
+ if (getUp() != null) {
+ getUp().dispose();
+ }
+ setUp(new ImageHyperlink(getFieldComposite(), SWT.TOP));
+ getUp().setImage(up);
+ getUp().addMouseListener(this);
+
+ // if invisible ones have been created
+ if (getDown() != null) {
+ getDown().dispose();
+ }
+ setDown(new ImageHyperlink(getFieldComposite(), SWT.TOP));
+ getDown().setImage(down);
+ getDown().addMouseListener(this);
+ getFieldComposite().layout();
+ }
+
+ /**
+ * Initializes invisible up/down buttons (needed for the layout).
+ */
+ protected void createInvisibleUpDownButtons() {
+ setUp(new ImageHyperlink(getFieldComposite(), SWT.TOP));
+ getUp().setImage(PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_TOOL_BACK));
+ getUp().addMouseListener(this);
+ getUp().setVisible(false);
+
+ setDown(new ImageHyperlink(getFieldComposite(), SWT.TOP));
+ getDown().setImage(PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_TOOL_FORWARD));
+ getDown().addMouseListener(this);
+ getDown().setVisible(false);
+ }
+
+ /**
+ * Creates the layout for one single field.
+ */
+ protected void createCompositeLayout() {
+ setFieldComposite(getParentItem().getToolkit().createComposite(getParentItem().getComposite(),
+ getParentItem().getStyle()));
+ GridLayout fieldLayout = new GridLayout(4, false);
+ fieldLayout.verticalSpacing = 0;
+ getFieldComposite().setLayout(fieldLayout);
+ GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).grab(true, true).applyTo(getFieldComposite());
+ }
+
+ /**
+ * Swaps the position of two control elements. It can also be called for moving the first item forward or the last
+ * one backward, as nothing will change then (false will be returned).
+ *
+ * @param index the index of the swap partner
+ * @return true if swap was successful, false otherwise (index didn't exist)
+ */
+ protected abstract boolean swapThisControlWith(int index);
+
+ /**
+ * {@inheritDoc}
+ */
+ public abstract void modifyText(ModifyEvent e);
+
+ /**
+ * {@inheritDoc}
+ */
+ public void mouseDoubleClick(MouseEvent e) {
+ // nothing
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void mouseDown(MouseEvent e) {
+ // nothing
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void mouseUp(MouseEvent e) {
+ if (e.getSource().equals(getButton())) {
+ if (getIndex() == -1) {
+ // add instead of delete
+ addButtonFunctionality();
+ } else {
+ // delete
+ // one will be deleted --> new empty one
+ if (getParentItem().isFull()) {
+ getParentItem().createSingleField();
+ }
+ removeElementAt(getIndex());
+ // accordingly change all other indexes
+ for (int i = getIndex() + 1; i < getParentItem().getControlList().size(); i++) {
+ AttributeControl c = getParentItem().getControlList().get(i);
+ c.setIndex(c.getIndex() - 1);
+ }
+ getParentItem().getControlList().remove(getIndex());
+
+ getFieldComposite().dispose();
+
+ }
+ }
+
+ if (e.getSource().equals(getUp())) {
+ int index = getIndex();
+ swapThisControlWith(index - 1);
+ if (index > 0) {
+ getParentItem().getControlList().get(index - 1).getUp().forceFocus();
+ }
+ }
+
+ if (e.getSource().equals(getDown())) {
+ int index = getIndex();
+ swapThisControlWith(index + 1);
+ if (index < getParentItem().getControlList().size() - 1) {
+ getParentItem().getControlList().get(index + 1).getDown().forceFocus();
+ }
+ }
+
+ getParentItem().refreshWidget();
+ }
+
+ /**
+ * Implements the behavior when the add button is clicked.
+ */
+ protected abstract void addButtonFunctionality();
+
+ /**
+ * Delegates this request to the corresponding Controller.
+ *
+ * @param i the index of the value to be deleted
+ * @return true if the value was removed, false otherwise (index didn't exist)
+ */
+ protected abstract boolean removeElementAt(int i);
+
+ /**
+ * @param parentItem the parentItem to set
+ */
+ public void setParentItem(MultiAttributeControl parentItem) {
+ this.parentItem = parentItem;
+ }
+
+ /**
+ * @return the parentItem
+ */
+ public MultiAttributeControl getParentItem() {
+ return parentItem;
+ }
+
+ /**
+ * @param index the index to set
+ */
+ public void setIndex(int index) {
+ this.index = index;
+ }
+
+ /**
+ * @return the index
+ */
+ public int getIndex() {
+ return index;
+ }
+
+ /**
+ * @param fieldComposite the fieldComposite to set
+ */
+ public void setFieldComposite(Composite fieldComposite) {
+ this.fieldComposite = fieldComposite;
+ }
+
+ /**
+ * @return the fieldComposite
+ */
+ public Composite getFieldComposite() {
+ return fieldComposite;
+ }
+
+ /**
+ * @param button the button to set
+ */
+ public void setButton(ImageHyperlink button) {
+ this.button = button;
+ }
+
+ /**
+ * @return the button
+ */
+ public ImageHyperlink getButton() {
+ return button;
+ }
+
+ /**
+ * @param up the up to set
+ */
+ public void setUp(ImageHyperlink up) {
+ this.up = up;
+ }
+
+ /**
+ * @return the up
+ */
+ public ImageHyperlink getUp() {
+ return up;
+ }
+
+ /**
+ * @param down the down to set
+ */
+ public void setDown(ImageHyperlink down) {
+ this.down = down;
+ }
+
+ /**
+ * @return the down
+ */
+ public ImageHyperlink getDown() {
+ return down;
+ }
+}
\ No newline at end of file
diff --git a/old/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/mecontrols/multiattributecontrol/IntegerAttributeControl.java b/old/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/mecontrols/multiattributecontrol/IntegerAttributeControl.java
new file mode 100644
index 0000000..0b179e3
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/mecontrols/multiattributecontrol/IntegerAttributeControl.java
@@ -0,0 +1,201 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2011 Chair for Applied Software Engineering,
+ * Technische Universitaet Muenchen.
+ * 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:
+ ******************************************************************************/
+package org.eclipse.emf.ecp.editor.mecontrols.multiattributecontrol;
+
+import org.eclipse.jface.layout.GridDataFactory;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.widgets.Spinner;
+
+/**
+ * Represents a single Integer field for a MultiAttributeItem.
+ *
+ * @author Christian Kroemer (christian.kroemer@z-corp-online.de)
+ */
+class IntegerAttributeControl extends AttributeControl {
+
+ // CONSTANTS
+ private static final int SIZE_LIMIT = 10000000;
+
+ // state and references
+ private MultiAttributeController<Integer> dataManipulator;
+ private Spinner widget;
+ private Integer value;
+
+ /**
+ * Constructor for control with content.
+ *
+ * @param parentItem the corresponding IntegerMultiAttributeWidget
+ * @param dataManipulator a MultiAttributeController for this widget
+ * @param value the initial value for this control
+ */
+ IntegerAttributeControl(MultiAttributeControl parentItem, MultiAttributeController<Integer> dataManipulator,
+ int value) {
+ this.setParentItem(parentItem);
+ this.dataManipulator = dataManipulator;
+ this.value = value;
+ this.setIndex(parentItem.getControlList().size());
+ parentItem.getControlList().add(this);
+
+ // initialize
+ createCompositeLayout();
+ setWidget(new Spinner(getFieldComposite(), parentItem.getStyle() | SWT.SINGLE));
+ getWidget().setValues(value, -SIZE_LIMIT, SIZE_LIMIT, 0, 1, 1);
+ getWidget().addModifyListener(this);
+ createDeleteButton();
+ createUpDownButtons();
+ GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).grab(true, true).applyTo(getWidget());
+ }
+
+ /**
+ * Constructor for control with no initial content.
+ *
+ * @param parentItem the corresponding IntegerMultiAttributeWidget
+ * @param dataManipulator a MultiAttributeController for this widget
+ */
+ IntegerAttributeControl(MultiAttributeControl parentItem, MultiAttributeController<Integer> dataManipulator) {
+ this.setParentItem(parentItem);
+ this.dataManipulator = dataManipulator;
+ this.value = IntegerMultiAttributeControl.getEmptyValue();
+
+ // initialize
+ createCompositeLayout();
+ setWidget(new Spinner(getFieldComposite(), parentItem.getStyle() | SWT.SINGLE));
+ getWidget().setValues(value, -SIZE_LIMIT, SIZE_LIMIT, 0, 1, 1);
+ getWidget().addModifyListener(this);
+ getWidget().setForeground(new Color(getWidget().getDisplay(), 100, 100, 100));
+ createAddButton();
+ createInvisibleUpDownButtons();
+ GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).grab(true, true).applyTo(getWidget());
+ }
+
+ /**
+ * Hidden default constructor.
+ */
+ @SuppressWarnings("unused")
+ private IntegerAttributeControl() {
+ // nothing
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected boolean swapThisControlWith(int index) {
+ if (index >= getParentItem().getControlList().size() || index < 0) {
+ return false;
+ }
+ // create non-duplicate Integer
+ int random = 0;
+ while (dataManipulator.contains(random)) {
+ random = ((int) (Math.random() * 10000));
+ }
+ // use it for swap
+ int thisValue = value;
+ int otherValue = ((IntegerAttributeControl) getParentItem().getControlList().get(index)).value;
+ getWidget().setSelection(random);
+ ((IntegerAttributeControl) getParentItem().getControlList().get(index)).getWidget().setSelection(thisValue);
+ getWidget().setSelection(otherValue);
+
+ return true;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void modifyText(ModifyEvent e) { // still duplicated code, but better solution?!
+ if (e.getSource().equals(getWidget())) {
+ // first edit? --> layout changes
+ if (getIndex() == -1) {
+ getWidget().setForeground(new Color(getWidget().getDisplay(), 0, 0, 0));
+ getButton().dispose();
+ createDeleteButton();
+ createUpDownButtons();
+ }
+
+ final int newValue = getWidget().getSelection();
+
+ // jump over duplicates
+ if (!getParentItem().isAllowDuplicates() && dataManipulator.contains(newValue)) {
+ if (newValue > value) {
+ getWidget().setSelection(newValue + 1);
+ } else {
+ getWidget().setSelection(newValue - 1);
+ }
+ return;
+ }
+ // end of duplicate handling
+
+ if (getIndex() != -1) {
+ // was a regular entry before
+ dataManipulator.replaceElementAt(getIndex(), newValue);
+ value = newValue;
+ } else {
+ // was a dummy entry before
+ this.setIndex(getParentItem().getControlList().size());
+ getParentItem().getControlList().add(this);
+ dataManipulator.add(newValue);
+ value = newValue;
+ getButton().setVisible(true);
+ if (!getParentItem().isFull()) {
+ getParentItem().createSingleField();
+ }
+ getFieldComposite().layout();
+ }
+
+ getParentItem().refreshWidget();
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void addButtonFunctionality() {
+ // duplicate handling
+ if (!getParentItem().isAllowDuplicates()) {
+ while (dataManipulator.contains(value)) {
+ value++;
+ }
+ }
+ // end of duplicate handling
+ // automatically added then (ModifyListener!)
+ getWidget().setSelection(value);
+ getWidget().setForeground(new Color(getWidget().getDisplay(), 0, 0, 0));
+ getButton().dispose();
+ createDeleteButton();
+ createUpDownButtons();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected boolean removeElementAt(int i) {
+ return dataManipulator.removeElementAt(i);
+ }
+
+ /**
+ * @param widget the widget to set
+ */
+ public void setWidget(Spinner widget) {
+ this.widget = widget;
+ }
+
+ /**
+ * @return the widget
+ */
+ public Spinner getWidget() {
+ return widget;
+ }
+}
\ No newline at end of file
diff --git a/old/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/mecontrols/multiattributecontrol/IntegerMultiAttributeControl.java b/old/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/mecontrols/multiattributecontrol/IntegerMultiAttributeControl.java
new file mode 100644
index 0000000..14f9222
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/mecontrols/multiattributecontrol/IntegerMultiAttributeControl.java
@@ -0,0 +1,100 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2011 Chair for Applied Software Engineering,
+ * Technische Universitaet Muenchen.
+ * 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:
+ ******************************************************************************/
+package org.eclipse.emf.ecp.editor.mecontrols.multiattributecontrol;
+
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.ecore.util.EDataTypeEList;
+import org.eclipse.swt.events.KeyEvent;
+import org.eclipse.swt.events.KeyListener;
+
+/**
+ * Integer implementation of a MultiAttributeItem.
+ *
+ * @author Christian Kroemer (christian.kroemer@z-corp-online.de)
+ */
+public class IntegerMultiAttributeControl extends MultiAttributeControl {
+
+ // CONSTANTS
+ private static final int EMPTY_VALUE = new Integer(0);
+
+ // essential references
+ private MultiAttributeController<Integer> dataManipulator;
+ private PersonalListener personalListener = new PersonalListener(); // see inner class
+
+ /**
+ * {@inheritDoc}
+ */
+ @SuppressWarnings("unchecked")
+ @Override
+ protected void createDataStructures(EStructuralFeature feature) {
+ EDataTypeEList<Integer> storedValues = (EDataTypeEList<Integer>) getModelElement().eGet(feature);
+ dataManipulator = new MultiAttributeController<Integer>(this, storedValues);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void createSingleField(Object contentObj) {
+ assert (contentObj instanceof Integer);
+ int content = (Integer) contentObj;
+ IntegerAttributeControl f = new IntegerAttributeControl(this, dataManipulator, content);
+ f.getWidget().addKeyListener(personalListener);
+ if (!isEditable()) {
+ f.getWidget().setEnabled(false);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void createSingleField() {
+ IntegerAttributeControl f = new IntegerAttributeControl(this, dataManipulator);
+ f.getWidget().addKeyListener(personalListener);
+ if (!isEditable()) {
+ f.getWidget().setEnabled(false);
+ }
+ setEmptyField(f.getWidget());
+ }
+
+ /**
+ * Implements specific listeners for this type's widget in general, no single-field-specific listener!
+ */
+ private class PersonalListener implements KeyListener {
+
+ public void keyPressed(KeyEvent e) {
+ if (e.keyCode == 13) { // ENTER
+ getEmptyField().forceFocus();
+ }
+ }
+
+ public void keyReleased(KeyEvent e) {
+ // nothing
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public Object[] getAllStoredElements() {
+ return dataManipulator.getAllStoredElements();
+ }
+
+ /**
+ * @return the EMPTY_VALUE
+ */
+ public static int getEmptyValue() {
+ return EMPTY_VALUE;
+ }
+
+}
\ No newline at end of file
diff --git a/old/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/mecontrols/multiattributecontrol/MultiAttributeControl.java b/old/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/mecontrols/multiattributecontrol/MultiAttributeControl.java
new file mode 100644
index 0000000..d70aba5
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/mecontrols/multiattributecontrol/MultiAttributeControl.java
@@ -0,0 +1,286 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2011 Chair for Applied Software Engineering,
+ * Technische Universitaet Muenchen.
+ * 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:
+ ******************************************************************************/
+package org.eclipse.emf.ecp.editor.mecontrols.multiattributecontrol;
+
+import java.util.ArrayList;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.ecore.ETypedElement;
+import org.eclipse.emf.ecp.editor.mecontrols.AbstractMEControl;
+import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.ui.forms.widgets.Form;
+
+/**
+ * Represents a multi-attribute-item for the editor of an EMFCP model element.
+ * <p>
+ * FEATURES:
+ * <p>
+ * * Changes are applied whenever a field is modified, then: immediate storage of any change in the model data and
+ * immediate redrawing of the widget (always n+1 fields for n entries so a new one can be added easily)
+ * <p>
+ * * Limited to $upperBound$ entries if it is != -1.
+ * <p>
+ * * Non-changeable attributes are handled correctly.
+ * <p>
+ * * When a duplicate is entered (and forbidden), this is also handled in the GUI.
+ * <p>
+ * Note that some of the features have to be implemented in a concrete class. See description of abstract methods for
+ * further information.
+ *
+ * @author Christian Kroemer (christian.kroemer@z-corp-online.de)
+ */
+public abstract class MultiAttributeControl extends AbstractMEControl {
+ // CONSTANTS
+ private static final int PRIORITY = 2;
+
+ // state attributes
+ private int style;
+ private int upperBound;
+ private boolean isEditable;
+ private boolean allowDuplicates;
+ private ArrayList<AttributeControl> controlList = new ArrayList<AttributeControl>();
+
+ // essential references
+ private Composite composite;
+ private GridLayout gridLayout;
+ private Control emptyField; // or the bottom one if isFull() && isEditable()
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public int canRender(IItemPropertyDescriptor itemPropertyDescriptor, EObject modelElement) {
+ Object feature = itemPropertyDescriptor.getFeature(modelElement);
+
+ if (feature instanceof ETypedElement) {
+ ETypedElement attr = (ETypedElement) feature;
+ upperBound = attr.getUpperBound();
+ if (upperBound == -1 || upperBound > 1) {
+ return PRIORITY;
+ } else {
+ return DO_NOT_RENDER;
+ }
+ }
+ return DO_NOT_RENDER;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public Control createControl(Composite parent, int style) {
+ final EStructuralFeature feature = (EStructuralFeature) getItemPropertyDescriptor().getFeature(
+ getModelElement());
+ createDataStructures(feature);
+
+ // set state
+ this.setStyle(style);
+ setEditable(getItemPropertyDescriptor().canSetProperty(getModelElement()));
+ setAllowDuplicates(!feature.isUnique());
+
+ // create composite structure
+ setComposite(getToolkit().createComposite(parent, style | SWT.BORDER));
+ configureGridLayout();
+ getComposite().setLayout(gridLayout);
+ if (!getItemPropertyDescriptor().canSetProperty(getModelElement())) {
+ getComposite().setEnabled(false);
+ }
+ // re-set upper bound... needed because canRender() was called in an other instance
+ upperBound = feature.getUpperBound();
+
+ initializeWidget();
+ return getComposite();
+ }
+
+ /**
+ * Creates the lists for stored values and fields needed.
+ *
+ * @param feature reference to the feature of this model element
+ */
+ protected abstract void createDataStructures(EStructuralFeature feature);
+
+ /**
+ * Configures the GridLayout.
+ */
+ private void configureGridLayout() {
+ gridLayout = new GridLayout(1, true);
+ gridLayout.verticalSpacing = 0;
+ }
+
+ /**
+ * Creates, draws and fills all fields needed to display the attribute's data.
+ */
+ protected void initializeWidget() {
+ for (Object i : getAllStoredElements()) {
+ createSingleField(i);
+ }
+ if (!isFull() && isEditable()) {
+ createSingleField();
+ }
+ // make sure it is drawn correctly
+ refreshWidget();
+ }
+
+ /**
+ * Resets the widget.
+ */
+ protected void reInitializeWidget() {
+ // remove empty control (not in controlList!)
+ if (!isFull()) {
+ emptyField.getParent().dispose();
+ }
+ // remove all other controls
+ while (!controlList.isEmpty()) {
+ controlList.get(0).dispose();
+ controlList.remove(0);
+ }
+ initializeWidget();
+ }
+
+ /**
+ * Redraws the widget with correct layout.
+ */
+ protected void refreshWidget() {
+ Composite tmp = getComposite();
+ while (!(tmp instanceof Form)) {
+ // loop until the composite for the whole editor window is reached (doesn't work for less calls)
+ tmp.layout(); // are all layout calls necessary?
+ tmp = tmp.getParent();
+ }
+ }
+
+ /**
+ * Checks if this widget is full.
+ *
+ * @return true if full, false otherwise
+ */
+ protected boolean isFull() {
+ return ((getControlList().size() >= upperBound) && upperBound != -1);
+ }
+
+ /**
+ * Creates one new field within the widget.
+ * <p>
+ * Implement a widget that can display a single attribute of this type and make sure it features suitable Listeners
+ * (immediately store data and always call refreshWidget() after changes; also make sure there is always a new empty
+ * field if the upper bound isn't reached when the former empty field is filled with data; handle duplicates). Deny
+ * editing of field if the attribute is non-changeable.
+ * <p>
+ * Call this method without any parameter for an empty field!
+ *
+ * @param content the data to be displayed in the new field; make sure it is the right type and cast it accordingly
+ * in your implementation
+ */
+ protected abstract void createSingleField(Object content);
+
+ /**
+ * Creates one new empty field within the widget. See description of createSingleField(Object content) for further
+ * information on implementation details.
+ */
+ protected abstract void createSingleField();
+
+ /**
+ * Returns all elements of this attribute as Object array. Needed for some superclass methods.
+ *
+ * @return the array
+ */
+ public abstract Object[] getAllStoredElements();
+
+ /**
+ * @param controlList the controlList to set
+ */
+ public void setControlList(ArrayList<AttributeControl> controlList) {
+ this.controlList = controlList;
+ }
+
+ /**
+ * @return the controlList
+ */
+ public ArrayList<AttributeControl> getControlList() {
+ return controlList;
+ }
+
+ /**
+ * @param style the style to set
+ */
+ public void setStyle(int style) {
+ this.style = style;
+ }
+
+ /**
+ * @return the style
+ */
+ public int getStyle() {
+ return style;
+ }
+
+ /**
+ * @param allowDuplicates the allowDuplicates to set
+ */
+ public void setAllowDuplicates(boolean allowDuplicates) {
+ this.allowDuplicates = allowDuplicates;
+ }
+
+ /**
+ * @return the allowDuplicates
+ */
+ public boolean isAllowDuplicates() {
+ return allowDuplicates;
+ }
+
+ /**
+ * @param composite the composite to set
+ */
+ public void setComposite(Composite composite) {
+ this.composite = composite;
+ }
+
+ /**
+ * @return the composite
+ */
+ public Composite getComposite() {
+ return composite;
+ }
+
+ /**
+ * @param isEditable the isEditable to set
+ */
+ public void setEditable(boolean isEditable) {
+ this.isEditable = isEditable;
+ }
+
+ /**
+ * @return the isEditable
+ */
+ public boolean isEditable() {
+ return isEditable;
+ }
+
+ /**
+ * @param emptyField the emptyField to set
+ */
+ public void setEmptyField(Control emptyField) {
+ this.emptyField = emptyField;
+ }
+
+ /**
+ * @return the emptyField
+ */
+ public Control getEmptyField() {
+ return emptyField;
+ }
+
+}
\ No newline at end of file
diff --git a/old/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/mecontrols/multiattributecontrol/MultiAttributeController.java b/old/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/mecontrols/multiattributecontrol/MultiAttributeController.java
new file mode 100644
index 0000000..e2ba88f
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/mecontrols/multiattributecontrol/MultiAttributeController.java
@@ -0,0 +1,174 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2011 Chair for Applied Software Engineering,
+ * Technische Universitaet Muenchen.
+ * 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:
+ ******************************************************************************/
+package org.eclipse.emf.ecp.editor.mecontrols.multiattributecontrol;
+
+import java.util.ArrayList;
+
+import org.eclipse.core.databinding.observable.ChangeEvent;
+import org.eclipse.core.databinding.observable.IChangeListener;
+import org.eclipse.core.databinding.observable.value.IObservableValue;
+import org.eclipse.emf.databinding.edit.EMFEditObservables;
+import org.eclipse.emf.ecore.EAttribute;
+import org.eclipse.emf.ecore.util.EDataTypeEList;
+import org.eclipse.emf.ecp.common.commands.ECPCommand;
+
+/**
+ * Tool for easily editing EMFCP model elements.
+ * <p>
+ * The necessary anonymous classes (ECPCommand) are provided in order to make manipulation from everywhere else easier.
+ *
+ * @author Christian Kroemer (christian.kroemer@z-corp-online.de)
+ * @param <T> The type of the corresponding model element
+ */
+public class MultiAttributeController<T> implements IChangeListener {
+
+ // essential references
+ private MultiAttributeControl parentItem;
+ private EDataTypeEList<T> data;
+ private ArrayList<T> localData; // for identifying external changes
+ private IObservableValue model;
+
+ /**
+ * Constructor.
+ *
+ * @param parentItem the corresponding MultiAttributeWidget
+ * @param data a reference to the data manipulated by this controller
+ */
+ MultiAttributeController(MultiAttributeControl parentItem, EDataTypeEList<T> data) {
+ this.parentItem = parentItem;
+ this.data = data;
+ localData = new ArrayList<T>();
+ localData.addAll(this.data);
+
+ // create listener for external changes
+ Object feature = parentItem.getItemPropertyDescriptor().getFeature(parentItem.getModelElement());
+ EAttribute attribute = (EAttribute) feature;
+ model = EMFEditObservables.observeValue(parentItem.getEditingDomain(), parentItem.getModelElement(), attribute);
+ model.addChangeListener(this);
+ }
+
+ /**
+ * Hidden default constructor.
+ */
+ @SuppressWarnings("unused")
+ private MultiAttributeController() {
+ // nothing
+ }
+
+ /**
+ * Checks if a value exists in the model attribute.
+ *
+ * @param value the value
+ * @return true if it exists, false otherwise
+ */
+ public boolean contains(T value) {
+ return data.contains(value);
+ }
+
+ /**
+ * Adds a value to the model attribute (nothing happens when duplicates are forbidden and the value is already
+ * stored).
+ *
+ * @param value the value
+ */
+ public void add(final T value) {
+ /*
+ * wrong result for forbidden duplicates when a duplicated entry is added it will be added here, but not in the
+ * model; this should be no problem as every control should check for duplicates before adding
+ */
+ localData.add(value);
+ new ECPCommand(parentItem.getModelElement()) {
+ @Override
+ protected void doRun() {
+ data.add(value);
+ };
+ }.run(false);
+ }
+
+ /**
+ * Removes the element with a certain index from the model attribute.
+ *
+ * @param index the index of the value to be deleted
+ * @return true if the value was removed, false otherwise (index didn't exist)
+ */
+ public boolean removeElementAt(final int index) {
+ if (index >= data.size() || index < 0) {
+ return false;
+ }
+ localData.remove(index);
+ new ECPCommand(parentItem.getModelElement()) {
+ @Override
+ protected void doRun() {
+ data.remove(index);
+ };
+ }.run(false);
+ return true;
+ }
+
+ /**
+ * Replaces the element with a certain index of the model attribute with an other one.
+ *
+ * @param index the index of the old value
+ * @param newValue the new value
+ * @return true if the value was replaced, false otherwise (index didn't exist)
+ */
+ public boolean replaceElementAt(final int index, final T newValue) {
+ if (index >= data.size() || index < 0) {
+ return false;
+ }
+ localData.set(index, newValue);
+ new ECPCommand(parentItem.getModelElement()) {
+ @Override
+ protected void doRun() {
+ data.set(index, newValue);
+ };
+ }.run(false);
+ return true;
+ }
+
+ /**
+ * Returns all elements of this attribute as Object array.
+ *
+ * @return Returns the array.
+ */
+ public Object[] getAllStoredElements() {
+ return data.toArray();
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.core.databinding.observable.IChangeListener#handleChange(org.eclipse.core.databinding.observable.ChangeEvent)
+ */
+ public void handleChange(ChangeEvent event) {
+ if (parentItem.getComposite().isDisposed()) {
+ // listener is no longer needed
+ model.removeChangeListener(this);
+ return;
+ }
+ if (event.getSource() == model && !dataEqualsLocalData()) {
+ // this should only happen for external changes!
+ parentItem.reInitializeWidget();
+ localData.clear();
+ localData.addAll(data);
+ }
+ }
+
+ /**
+ * Checks whether localData and data are out of sync.
+ *
+ * @return true if they are in sync, false otherwise
+ */
+ private boolean dataEqualsLocalData() {
+ return localData.equals(data);
+ }
+
+}
\ No newline at end of file
diff --git a/old/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/mecontrols/multiattributecontrol/StringAttributeControl.java b/old/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/mecontrols/multiattributecontrol/StringAttributeControl.java
new file mode 100644
index 0000000..254c3f3
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/mecontrols/multiattributecontrol/StringAttributeControl.java
@@ -0,0 +1,189 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2011 Chair for Applied Software Engineering,
+ * Technische Universitaet Muenchen.
+ * 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:
+ ******************************************************************************/
+package org.eclipse.emf.ecp.editor.mecontrols.multiattributecontrol;
+
+import org.eclipse.jface.layout.GridDataFactory;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.widgets.Text;
+
+/**
+ * Represents a single String field for a MultiAttributeItem.
+ *
+ * @author Christian Kroemer (christian.kroemer@z-corp-online.de)
+ */
+class StringAttributeControl extends AttributeControl {
+ private MultiAttributeController<String> dataManipulator;
+ private Text widget;
+ private String value;
+
+ /**
+ * Constructor for control with content.
+ *
+ * @param parentItem the corresponding StringMultiAttributeWidget
+ * @param dataManipulator a MultiAttributeController for this widget
+ * @param value the initial value for this control
+ */
+ StringAttributeControl(MultiAttributeControl parentItem, MultiAttributeController<String> dataManipulator,
+ String value) {
+ this.setParentItem(parentItem);
+ this.dataManipulator = dataManipulator;
+ this.value = value;
+ this.setIndex(parentItem.getControlList().size());
+ parentItem.getControlList().add(this);
+
+ // initializeFromInt
+ createCompositeLayout();
+ setWidget(parentItem.getToolkit().createText(getFieldComposite(), value, parentItem.getStyle() | SWT.SINGLE));
+ getWidget().addModifyListener(this);
+ createDeleteButton();
+ createUpDownButtons();
+ GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).grab(true, true).applyTo(getWidget());
+ }
+
+ /**
+ * Constructor for control with no initial content.
+ *
+ * @param parentItem the corresponding StringMultiAttributeWidget
+ * @param dataManipulator a MultiAttributeController for this widget
+ */
+ StringAttributeControl(MultiAttributeControl parentItem, MultiAttributeController<String> dataManipulator) {
+ this.setParentItem(parentItem);
+ this.dataManipulator = dataManipulator;
+ this.value = StringMultiAttributeControl.getEmptyValue();
+
+ // initializeFromInt
+ createCompositeLayout();
+ setWidget(parentItem.getToolkit().createText(getFieldComposite(), value, parentItem.getStyle() | SWT.SINGLE));
+ getWidget().addModifyListener(this);
+ getWidget().setMessage("Add new element...");
+ createAddButton();
+ createInvisibleUpDownButtons();
+ GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).grab(true, true).applyTo(getWidget());
+ }
+
+ /**
+ * Hidden default constructor.
+ */
+ @SuppressWarnings("unused")
+ private StringAttributeControl() {
+ // hide default constructor
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected boolean swapThisControlWith(int index) {
+ if (index >= getParentItem().getControlList().size() || index < 0) {
+ return false;
+ }
+ // create non-duplicate String
+ String random = "";
+ while (dataManipulator.contains(random)) {
+ random = ((Double) Math.random()).toString();
+ }
+ // use it for swap
+ String thisValue = value;
+ String otherValue = ((StringAttributeControl) getParentItem().getControlList().get(index)).value;
+ getWidget().setText(random);
+ ((StringAttributeControl) getParentItem().getControlList().get(index)).getWidget().setText(thisValue);
+ getWidget().setText(otherValue);
+
+ return true;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void modifyText(ModifyEvent e) { // still duplicated code, but better solution?!
+ if (e.getSource().equals(getWidget())) {
+ // first edit? --> new button
+ if (getIndex() == -1) {
+ getButton().dispose();
+ getWidget().setMessage("");
+ createDeleteButton();
+ createUpDownButtons();
+ }
+
+ final String newValue = getWidget().getText();
+
+ // handle duplicates
+ if (!getParentItem().isAllowDuplicates() && dataManipulator.contains(newValue)) {
+ getWidget().setText("_" + newValue);
+ return;
+ }
+ // end of duplicate handling
+
+ if (getIndex() != -1) {
+ // was a regular entry before
+ dataManipulator.replaceElementAt(getIndex(), newValue);
+ value = newValue;
+ } else {
+ // was a dummy entry before
+ this.setIndex(getParentItem().getControlList().size());
+ getParentItem().getControlList().add(this);
+ dataManipulator.add(newValue);
+ value = newValue;
+ getButton().setVisible(true);
+ if (!getParentItem().isFull()) {
+ getParentItem().createSingleField();
+ }
+ getFieldComposite().layout();
+ }
+
+ getParentItem().refreshWidget();
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void addButtonFunctionality() {
+ // duplicate handling
+ if (!getParentItem().isAllowDuplicates()) {
+ while (dataManipulator.contains(value)) {
+ value = "_" + value;
+ }
+ }
+ // end of duplicate handling
+ // automatically added then (ModifyListener!)
+ getWidget().setText(value);
+ getButton().dispose();
+ getWidget().setMessage("");
+ createDeleteButton();
+ createUpDownButtons();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected boolean removeElementAt(int i) {
+ return dataManipulator.removeElementAt(i);
+ }
+
+ /**
+ * @param widget the widget to set
+ */
+ public void setWidget(Text widget) {
+ this.widget = widget;
+ }
+
+ /**
+ * @return the widget
+ */
+ public Text getWidget() {
+ return widget;
+ }
+}
\ No newline at end of file
diff --git a/old/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/mecontrols/multiattributecontrol/StringMultiAttributeControl.java b/old/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/mecontrols/multiattributecontrol/StringMultiAttributeControl.java
new file mode 100644
index 0000000..ae0a1f1
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/mecontrols/multiattributecontrol/StringMultiAttributeControl.java
@@ -0,0 +1,100 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2011 Chair for Applied Software Engineering,
+ * Technische Universitaet Muenchen.
+ * 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:
+ ******************************************************************************/
+package org.eclipse.emf.ecp.editor.mecontrols.multiattributecontrol;
+
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.ecore.util.EDataTypeEList;
+import org.eclipse.swt.events.KeyEvent;
+import org.eclipse.swt.events.KeyListener;
+
+/**
+ * String implementation of a MultiAttributeItem.
+ *
+ * @author Christian Kroemer (christian.kroemer@z-corp-online.de)
+ */
+public class StringMultiAttributeControl extends MultiAttributeControl {
+
+ // CONSTANTS
+ private static final String EMPTY_VALUE = new String("");
+
+ // essential references
+ private MultiAttributeController<String> dataManipulator;
+ private PersonalListener personalListener = new PersonalListener(); // see inner class
+
+ /**
+ * {@inheritDoc}
+ */
+ @SuppressWarnings("unchecked")
+ @Override
+ protected void createDataStructures(EStructuralFeature feature) {
+ EDataTypeEList<String> storedValues = (EDataTypeEList<String>) getModelElement().eGet(feature);
+ dataManipulator = new MultiAttributeController<String>(this, storedValues);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void createSingleField(Object contentObj) {
+ assert (contentObj instanceof String);
+ String content = (String) contentObj;
+ StringAttributeControl f = new StringAttributeControl(this, dataManipulator, content);
+ f.getWidget().addKeyListener(personalListener);
+ if (!isEditable()) {
+ f.getWidget().setEditable(false);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void createSingleField() {
+ StringAttributeControl f = new StringAttributeControl(this, dataManipulator);
+ f.getWidget().addKeyListener(personalListener);
+ if (!isEditable()) {
+ f.getWidget().setEditable(false);
+ }
+ setEmptyField(f.getWidget());
+ }
+
+ /**
+ * Implements specific listeners for this type's widget in general, no single-field-specific listener!
+ */
+ private class PersonalListener implements KeyListener {
+
+ public void keyPressed(KeyEvent e) {
+ if (e.keyCode == 13) { // ENTER
+ getEmptyField().setFocus();
+ }
+ }
+
+ public void keyReleased(KeyEvent e) {
+ // nothing
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public Object[] getAllStoredElements() {
+ return dataManipulator.getAllStoredElements();
+ }
+
+ /**
+ * @return the emptyValue
+ */
+ public static String getEmptyValue() {
+ return EMPTY_VALUE;
+ }
+
+}
\ No newline at end of file
diff --git a/old/org.eclipse.emf.ecp.emfstorebridge/.checkstyle b/old/org.eclipse.emf.ecp.emfstorebridge/.checkstyle
new file mode 100644
index 0000000..d4fa17e
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.emfstorebridge/.checkstyle
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<fileset-config file-format-version="1.2.0" simple-config="true" sync-formatter="false">
+ <fileset name="all" enabled="true" check-config-name="emfcpStyle" local="false">
+ <file-match-pattern match-pattern="." include-pattern="true"/>
+ </fileset>
+</fileset-config>
diff --git a/old/org.eclipse.emf.ecp.emfstorebridge/.classpath b/old/org.eclipse.emf.ecp.emfstorebridge/.classpath
new file mode 100644
index 0000000..64c5e31
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.emfstorebridge/.classpath
@@ -0,0 +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>
diff --git a/old/org.eclipse.emf.ecp.emfstorebridge/.project b/old/org.eclipse.emf.ecp.emfstorebridge/.project
new file mode 100644
index 0000000..2a34e2b
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.emfstorebridge/.project
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.emf.ecp.emfstorebridge</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>net.sf.eclipsecs.core.CheckstyleBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>net.sf.eclipsecs.core.CheckstyleNature</nature>
+ </natures>
+</projectDescription>
diff --git a/old/org.eclipse.emf.ecp.emfstorebridge/.settings/org.eclipse.jdt.core.prefs b/old/org.eclipse.emf.ecp.emfstorebridge/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 0000000..d6c684c
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.emfstorebridge/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,12 @@
+#Wed May 18 17:49:21 CEST 2011
+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.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5
diff --git a/old/org.eclipse.emf.ecp.emfstorebridge/.settings/org.eclipse.jdt.ui.prefs b/old/org.eclipse.emf.ecp.emfstorebridge/.settings/org.eclipse.jdt.ui.prefs
new file mode 100644
index 0000000..46f554c
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.emfstorebridge/.settings/org.eclipse.jdt.ui.prefs
@@ -0,0 +1,57 @@
+#Thu Mar 31 20:47:50 CEST 2011
+cleanup.add_default_serial_version_id=true
+cleanup.add_generated_serial_version_id=false
+cleanup.add_missing_annotations=true
+cleanup.add_missing_deprecated_annotations=true
+cleanup.add_missing_methods=false
+cleanup.add_missing_nls_tags=false
+cleanup.add_missing_override_annotations=true
+cleanup.add_serial_version_id=false
+cleanup.always_use_blocks=true
+cleanup.always_use_parentheses_in_expressions=false
+cleanup.always_use_this_for_non_static_field_access=false
+cleanup.always_use_this_for_non_static_method_access=false
+cleanup.convert_to_enhanced_for_loop=false
+cleanup.correct_indentation=true
+cleanup.format_source_code=true
+cleanup.format_source_code_changes_only=false
+cleanup.make_local_variable_final=true
+cleanup.make_parameters_final=false
+cleanup.make_private_fields_final=true
+cleanup.make_type_abstract_if_missing_method=false
+cleanup.make_variable_declarations_final=false
+cleanup.never_use_blocks=false
+cleanup.never_use_parentheses_in_expressions=true
+cleanup.organize_imports=true
+cleanup.qualify_static_field_accesses_with_declaring_class=false
+cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true
+cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true
+cleanup.qualify_static_member_accesses_with_declaring_class=true
+cleanup.qualify_static_method_accesses_with_declaring_class=false
+cleanup.remove_private_constructors=true
+cleanup.remove_trailing_whitespaces=true
+cleanup.remove_trailing_whitespaces_all=true
+cleanup.remove_trailing_whitespaces_ignore_empty=false
+cleanup.remove_unnecessary_casts=true
+cleanup.remove_unnecessary_nls_tags=true
+cleanup.remove_unused_imports=true
+cleanup.remove_unused_local_variables=false
+cleanup.remove_unused_private_fields=true
+cleanup.remove_unused_private_members=false
+cleanup.remove_unused_private_methods=true
+cleanup.remove_unused_private_types=true
+cleanup.sort_members=false
+cleanup.sort_members_all=false
+cleanup.use_blocks=true
+cleanup.use_blocks_only_for_return_and_throw=false
+cleanup.use_parentheses_in_expressions=false
+cleanup.use_this_for_non_static_field_access=false
+cleanup.use_this_for_non_static_field_access_only_if_necessary=true
+cleanup.use_this_for_non_static_method_access=false
+cleanup.use_this_for_non_static_method_access_only_if_necessary=true
+cleanup_profile=_unicaseCleanUp
+cleanup_settings_version=2
+eclipse.preferences.version=1
+formatter_settings_version=11
+org.eclipse.jdt.ui.javadoc=false
+org.eclipse.jdt.ui.text.custom_code_templates=<?xml version\="1.0" encoding\="UTF-8" standalone\="no"?><templates><template autoinsert\="true" context\="gettercomment_context" deleted\="false" description\="Comment for getter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.gettercomment" name\="gettercomment">/**\n * @return the ${bare_field_name}\n */</template><template autoinsert\="true" context\="settercomment_context" deleted\="false" description\="Comment for setter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.settercomment" name\="settercomment">/**\n * @param ${param} the ${bare_field_name} to set\n */</template><template autoinsert\="true" context\="constructorcomment_context" deleted\="false" description\="Comment for created constructors" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorcomment" name\="constructorcomment">/**\n * ${tags}\n */</template><template autoinsert\="false" context\="filecomment_context" deleted\="false" description\="Comment for created Java files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.filecomment" name\="filecomment">/**\n * <copyright> Copyright (c) 2008-2009 Jonas Helming, Maximilian Koegel. All rights reserved. This program and the\n * accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this\n * distribution, and is available at http\://www.eclipse.org/legal/epl-v10.html </copyright>\n */</template><template autoinsert\="true" context\="typecomment_context" deleted\="false" description\="Comment for created types" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.typecomment" name\="typecomment">/**\n * @author ${user}\n *\n * ${tags}\n */</template><template autoinsert\="false" context\="fieldcomment_context" deleted\="false" description\="Comment for fields" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.fieldcomment" name\="fieldcomment"/><template autoinsert\="true" context\="methodcomment_context" deleted\="false" description\="Comment for non-overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodcomment" name\="methodcomment">/**\n * ${tags}\n */</template><template autoinsert\="false" context\="overridecomment_context" deleted\="false" description\="Comment for overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.overridecomment" name\="overridecomment">/**\n * {@inheritDoc}\n * ${see_to_overridden}\n */</template><template autoinsert\="true" context\="delegatecomment_context" deleted\="false" description\="Comment for delegate methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.delegatecomment" name\="delegatecomment">/**\n * ${tags}\n * ${see_to_target}\n */</template><template autoinsert\="true" context\="newtype_context" deleted\="false" description\="Newly created files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.newtype" name\="newtype">${filecomment}\n${package_declaration}\n\n${typecomment}\n${type_declaration}</template><template autoinsert\="true" context\="classbody_context" deleted\="false" description\="Code in new class type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.classbody" name\="classbody">\n</template><template autoinsert\="true" context\="interfacebody_context" deleted\="false" description\="Code in new interface type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.interfacebody" name\="interfacebody">\n</template><template autoinsert\="true" context\="enumbody_context" deleted\="false" description\="Code in new enum type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.enumbody" name\="enumbody">\n</template><template autoinsert\="true" context\="annotationbody_context" deleted\="false" description\="Code in new annotation type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.annotationbody" name\="annotationbody">\n</template><template autoinsert\="false" context\="catchblock_context" deleted\="false" description\="Code in new catch blocks" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.catchblock" name\="catchblock">\t\t\t// TODO Auto-generated catch block\n\t\t\t// Do NOT catch all Exceptions ("catch (Exception e)")\n\t\t\t// Log AND handle Exceptions if possible \n //\n // You can just uncomment one of the lines below to log an exception\:\n\t\t\t// logException will show the logged excpetion to the user\n\t\t\t// ModelUtil.logException(${exception_var});\n\t\t\t// ModelUtil.logException("YOUR MESSAGE HERE", ${exception_var});\n\t\t\t// logWarning will only add the message to the error log\n\t\t\t// ModelUtil.logWarning("YOUR MESSAGE HERE", ${exception_var});\n\t\t\t// ModelUtil.logWarning("YOUR MESSAGE HERE");\n\t\t\t//\t\t\t\n\t\t\t// If handling is not possible declare and rethrow Exception</template><template autoinsert\="true" context\="methodbody_context" deleted\="false" description\="Code in created method stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodbody" name\="methodbody">// ${todo} Auto-generated method stub\n${body_statement}</template><template autoinsert\="true" context\="constructorbody_context" deleted\="false" description\="Code in created constructor stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorbody" name\="constructorbody">${body_statement}\n// ${todo} Auto-generated constructor stub</template><template autoinsert\="true" context\="getterbody_context" deleted\="false" description\="Code in created getters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.getterbody" name\="getterbody">return ${field};</template><template autoinsert\="true" context\="setterbody_context" deleted\="false" description\="Code in created setters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.setterbody" name\="setterbody">${field} \= ${param};</template></templates>
diff --git a/old/org.eclipse.emf.ecp.emfstorebridge/META-INF/MANIFEST.MF b/old/org.eclipse.emf.ecp.emfstorebridge/META-INF/MANIFEST.MF
new file mode 100644
index 0000000..0ce9d44
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.emfstorebridge/META-INF/MANIFEST.MF
@@ -0,0 +1,12 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: ECP EMFStore Bridge
+Bundle-SymbolicName: org.eclipse.emf.ecp.emfstorebridge;singleton:=true
+Bundle-Version: 0.9.3.qualifier
+Bundle-Activator: org.eclipse.emf.ecp.emfstorebridge.Activator
+Require-Bundle: org.eclipse.emf.emfstore.client.ui,
+ org.eclipse.emf.ecp.common.model
+Bundle-ActivationPolicy: lazy
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Export-Package: org.eclipse.emf.ecp.emfstorebridge
+Bundle-Vendor: Eclipse Modeling Project
diff --git a/old/org.eclipse.emf.ecp.emfstorebridge/build.properties b/old/org.eclipse.emf.ecp.emfstorebridge/build.properties
new file mode 100644
index 0000000..285b8bf
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.emfstorebridge/build.properties
@@ -0,0 +1,6 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ plugin.xml,\
+ icons/
diff --git a/old/org.eclipse.emf.ecp.emfstorebridge/icons/advanced.gif b/old/org.eclipse.emf.ecp.emfstorebridge/icons/advanced.gif
new file mode 100644
index 0000000..f48e26f
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.emfstorebridge/icons/advanced.gif
Binary files differ
diff --git a/old/org.eclipse.emf.ecp.emfstorebridge/icons/arrow_branch.png b/old/org.eclipse.emf.ecp.emfstorebridge/icons/arrow_branch.png
new file mode 100644
index 0000000..7542db1
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.emfstorebridge/icons/arrow_branch.png
Binary files differ
diff --git a/old/org.eclipse.emf.ecp.emfstorebridge/icons/arrow_merge.png b/old/org.eclipse.emf.ecp.emfstorebridge/icons/arrow_merge.png
new file mode 100644
index 0000000..7502dbb
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.emfstorebridge/icons/arrow_merge.png
Binary files differ
diff --git a/old/org.eclipse.emf.ecp.emfstorebridge/icons/arrow_out.png b/old/org.eclipse.emf.ecp.emfstorebridge/icons/arrow_out.png
new file mode 100644
index 0000000..2e9bc42
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.emfstorebridge/icons/arrow_out.png
Binary files differ
diff --git a/old/org.eclipse.emf.ecp.emfstorebridge/icons/arrow_right.png b/old/org.eclipse.emf.ecp.emfstorebridge/icons/arrow_right.png
new file mode 100644
index 0000000..b1a1819
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.emfstorebridge/icons/arrow_right.png
Binary files differ
diff --git a/old/org.eclipse.emf.ecp.emfstorebridge/icons/arrow_undo.png b/old/org.eclipse.emf.ecp.emfstorebridge/icons/arrow_undo.png
new file mode 100644
index 0000000..6972c5e
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.emfstorebridge/icons/arrow_undo.png
Binary files differ
diff --git a/old/org.eclipse.emf.ecp.emfstorebridge/icons/arrow_up.png b/old/org.eclipse.emf.ecp.emfstorebridge/icons/arrow_up.png
new file mode 100644
index 0000000..1ebb193
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.emfstorebridge/icons/arrow_up.png
Binary files differ
diff --git a/old/org.eclipse.emf.ecp.emfstorebridge/icons/compare.png b/old/org.eclipse.emf.ecp.emfstorebridge/icons/compare.png
new file mode 100644
index 0000000..195dc6d
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.emfstorebridge/icons/compare.png
Binary files differ
diff --git a/old/org.eclipse.emf.ecp.emfstorebridge/icons/createrepos.gif b/old/org.eclipse.emf.ecp.emfstorebridge/icons/createrepos.gif
new file mode 100644
index 0000000..26d81c0
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.emfstorebridge/icons/createrepos.gif
Binary files differ
diff --git a/old/org.eclipse.emf.ecp.emfstorebridge/icons/database_go.png b/old/org.eclipse.emf.ecp.emfstorebridge/icons/database_go.png
new file mode 100644
index 0000000..61a8556
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.emfstorebridge/icons/database_go.png
Binary files differ
diff --git a/old/org.eclipse.emf.ecp.emfstorebridge/icons/delete.gif b/old/org.eclipse.emf.ecp.emfstorebridge/icons/delete.gif
new file mode 100644
index 0000000..c5d817c
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.emfstorebridge/icons/delete.gif
Binary files differ
diff --git a/old/org.eclipse.emf.ecp.emfstorebridge/icons/folder_go.png b/old/org.eclipse.emf.ecp.emfstorebridge/icons/folder_go.png
new file mode 100644
index 0000000..34a736f
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.emfstorebridge/icons/folder_go.png
Binary files differ
diff --git a/old/org.eclipse.emf.ecp.emfstorebridge/icons/historyview.png b/old/org.eclipse.emf.ecp.emfstorebridge/icons/historyview.png
new file mode 100644
index 0000000..0f9ed4d
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.emfstorebridge/icons/historyview.png
Binary files differ
diff --git a/old/org.eclipse.emf.ecp.emfstorebridge/icons/revert.png b/old/org.eclipse.emf.ecp.emfstorebridge/icons/revert.png
new file mode 100644
index 0000000..46c75aa
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.emfstorebridge/icons/revert.png
Binary files differ
diff --git a/old/org.eclipse.emf.ecp.emfstorebridge/icons/serverAdd.png b/old/org.eclipse.emf.ecp.emfstorebridge/icons/serverAdd.png
new file mode 100644
index 0000000..3f10a3a
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.emfstorebridge/icons/serverAdd.png
Binary files differ
diff --git a/old/org.eclipse.emf.ecp.emfstorebridge/plugin.xml b/old/org.eclipse.emf.ecp.emfstorebridge/plugin.xml
new file mode 100644
index 0000000..9d560c7
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.emfstorebridge/plugin.xml
@@ -0,0 +1,816 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+<plugin>
+ <extension
+ point="org.eclipse.emf.ecp.model.workspaceprovider">
+ <WorkspaceProvider
+ class="org.eclipse.emf.ecp.emfstorebridge.EMFStoreECPWorkspaceProvider">
+ </WorkspaceProvider>
+ </extension>
+ <extension
+ point="org.eclipse.ui.popupMenus">
+ <objectContribution
+ adaptable="false"
+ id="org.eclipse.emf.ecp.emfstorebridge.xmiAdd"
+ nameFilter="*.library"
+ objectClass="org.eclipse.core.resources.IFile">
+ <action
+ class="org.eclipse.emf.ecp.emfstorebridge.actions.AddXMIAction"
+ id="org.eclipse.emf.ecp.emfstorebridge.addXMI"
+ label="Add to EMF Client Platform">
+ </action>
+ </objectContribution>
+ <objectContribution
+ adaptable="false"
+ id="org.eclipse.emf.ecp.emfstorebridge.xmiImport"
+ nameFilter="*.library"
+ objectClass="org.eclipse.core.resources.IFile">
+ <action
+ class="org.eclipse.emf.ecp.emfstorebridge.actions.ImportXMIAction"
+ id="org.eclipse.emf.ecp.emfstorebridge.actions.xmiImport"
+ label="Import to EMF Client Platform">
+ </action>
+ </objectContribution>
+ </extension>
+
+ <extension
+ point="org.eclipse.ui.decorators">
+ <decorator
+ adaptable="true"
+ class="org.eclipse.emf.emfstore.client.ui.decorators.VersionDecorator"
+ id="org.eclipse.emf.emfstore.client.ui.decorators.VersionDecorator"
+ label="Version Decorator"
+ lightweight="true"
+ state="true">
+ <enablement>
+ <objectClass
+ name="org.eclipse.emf.emfstore.client.model.ProjectSpace">
+ </objectClass>
+ </enablement>
+ <description>
+ Shows version of current project.
+ </description>
+ </decorator>
+ <decorator
+ adaptable="true"
+ class="org.eclipse.emf.emfstore.client.ui.decorators.UsernameDecorator"
+ id="org.eclipse.emf.emfstore.client.ui.decorators.UsernameDecorator"
+ label="Username Decorator"
+ lightweight="true"
+ state="true">
+ <enablement>
+ <objectClass
+ name="org.eclipse.emf.emfstore.client.model.ProjectSpace">
+ </objectClass>
+ </enablement>
+ <description>
+ Shows the username for the current session.
+ </description>
+ </decorator>
+ <decorator
+ adaptable="true"
+ class="org.eclipse.emf.emfstore.client.ui.decorators.ProjectSpaceDirtyDecorator"
+ id="org.eclipse.emf.emfstore.client.ui.decorators.ProjectSpaceDirtyDecorator"
+ label="ProjectSpaceDirty Decorator"
+ lightweight="true"
+ state="true">
+ <enablement>
+ <objectClass
+ name="org.eclipse.emf.emfstore.client.model.ProjectSpace">
+ </objectClass>
+ </enablement>
+ <description>
+ If the porject has local changes.
+ </description>
+ </decorator>
+ <decorator
+ adaptable="true"
+ class="org.eclipse.emf.emfstore.client.ui.decorators.ModelElementDirtyDecorator"
+ id="org.eclipse.emf.emfstore.client.ui.decorators.ModelElementDirtyDecorator"
+ label="ModelElement Dirty Decorator"
+ lightweight="true"
+ state="true">
+ <enablement>
+ <objectClass
+ name="org.eclipse.emf.ecore.EObject">
+ </objectClass>
+ </enablement>
+ <description>
+ If the project has local changes.
+ </description>
+ </decorator>
+ </extension>
+
+ <extension
+ point="org.eclipse.emf.ecp.common.modelelementopener">
+ <ModelElementOpener
+ class="org.eclipse.emf.ecp.emfstorebridge.ProjectSpaceOpener"
+ name="org.eclipse.emf.ecp.emfstorebridge.ProjectSpaceOpener">
+ </ModelElementOpener>
+ </extension>
+ <extension
+ point="org.eclipse.ui.menus">
+ <menuContribution
+ locationURI="popup:org.eclipse.emf.ecp.navigator.viewer?before=additions">
+ <command
+ commandId="org.eclipse.emf.emfstore.client.ui.commitProject"
+ disabledIcon="icons/advanced.gif"
+ icon="icons/arrow_right.png"
+ label="Commit Project"
+ style="push">
+ <visibleWhen
+ checkEnabled="false">
+ <and>
+ <test
+ args="org.eclipse.emf.emfstore.client.ui.commitProject"
+ forcePluginActivation="true"
+ property="org.eclipse.emf.ecp.common.menuContributionsEnablement"
+ value="true">
+ </test>
+ <iterate
+ ifEmpty="false"
+ operator="and">
+ <instanceof
+ value="org.eclipse.emf.emfstore.client.model.ProjectSpace">
+ </instanceof>
+ <test
+ forcePluginActivation="true"
+ property="org.eclipse.emf.emfstore.client.ui.commands.projectIsShared"
+ value="true">
+ </test>
+ </iterate>
+ <count
+ value="1">
+ </count>
+ </and>
+ </visibleWhen>
+ </command>
+ <command
+ commandId="org.eclipse.emf.emfstore.client.ui.createBranch"
+ disabledIcon="icons/advanced.gif"
+ icon="icons/arrow_branch.png"
+ label="Create Branch"
+ style="push">
+ <visibleWhen
+ checkEnabled="false">
+ <and>
+ <test
+ args="org.eclipse.emf.emfstore.client.ui.createBranch"
+ forcePluginActivation="true"
+ property="org.eclipse.emf.ecp.common.menuContributionsEnablement"
+ value="true">
+ </test>
+ <iterate
+ ifEmpty="false"
+ operator="and">
+ <instanceof
+ value="org.eclipse.emf.emfstore.client.model.ProjectSpace">
+ </instanceof>
+ <test
+ forcePluginActivation="true"
+ property="org.eclipse.emf.emfstore.client.ui.commands.projectIsShared"
+ value="true">
+ </test>
+ </iterate>
+ <count
+ value="1">
+ </count>
+ </and>
+ </visibleWhen>
+ </command>
+ <command
+ commandId="org.eclipse.emf.emfstore.client.ui.mergeBranch"
+ disabledIcon="icons/advanced.gif"
+ icon="icons/arrow_merge.png"
+ label="Merge with Branch"
+ style="push">
+ </command>
+ <command
+ commandId="org.eclipse.emf.emfstore.client.ui.updateProject"
+ icon="icons/arrow_up.png"
+ label="Update Project"
+ style="push">
+ <visibleWhen
+ checkEnabled="false">
+ <and>
+ <test
+ args="org.eclipse.emf.emfstore.client.ui.updateProject"
+ forcePluginActivation="true"
+ property="org.eclipse.emf.ecp.common.menuContributionsEnablement"
+ value="true">
+ </test>
+ <iterate
+ ifEmpty="false"
+ operator="and">
+ <instanceof
+ value="org.eclipse.emf.emfstore.client.model.ProjectSpace">
+ </instanceof>
+ <test
+ forcePluginActivation="true"
+ property="org.eclipse.emf.emfstore.client.ui.commands.projectIsShared"
+ value="true">
+ </test>
+ </iterate>
+ <count
+ value="1">
+ </count>
+ </and>
+ </visibleWhen>
+ </command>
+ <command
+ commandId="org.eclipse.emf.emfstore.client.ui.updateProjectVersion"
+ icon="icons/arrow_up.png"
+ label="Update to version..."
+ style="push">
+ <visibleWhen
+ checkEnabled="false">
+ <and>
+ <test
+ args="org.eclipse.emf.emfstore.client.ui.updateProjectVersion"
+ forcePluginActivation="true"
+ property="org.eclipse.emf.ecp.common.menuContributionsEnablement"
+ value="true">
+ </test>
+ <iterate
+ ifEmpty="false"
+ operator="and">
+ <instanceof
+ value="org.eclipse.emf.emfstore.client.model.ProjectSpace">
+ </instanceof>
+ <test
+ forcePluginActivation="true"
+ property="org.eclipse.emf.emfstore.client.ui.commands.projectIsShared"
+ value="true">
+ </test>
+ <test
+ forcePluginActivation="true"
+ property="org.eclipse.emf.emfstore.client.ui.commands.isAdmin"
+ value="true">
+ </test>
+ </iterate>
+ <count
+ value="1">
+ </count>
+ </and>
+ </visibleWhen>
+ </command>
+ <command
+ commandId="org.eclipse.emf.emfstore.client.ui.shareProject"
+ icon="icons/arrow_out.png"
+ label="Share Project"
+ style="push">
+ <visibleWhen
+ checkEnabled="false">
+ <and>
+ <test
+ args="org.eclipse.emf.emfstore.client.ui.shareProject"
+ forcePluginActivation="true"
+ property="org.eclipse.emf.ecp.common.menuContributionsEnablement"
+ value="true">
+ </test>
+ <iterate
+ ifEmpty="false"
+ operator="and">
+ <instanceof
+ value="org.eclipse.emf.emfstore.client.model.ProjectSpace">
+ </instanceof>
+ <test
+ forcePluginActivation="true"
+ property="org.eclipse.emf.emfstore.client.ui.commands.projectIsShared"
+ value="false">
+ </test>
+ </iterate>
+ <count
+ value="1">
+ </count>
+ </and>
+ </visibleWhen>
+ </command>
+ <separator
+ name="org.eclipse.emf.emfstore.client.ui.undoRevertCommands"
+ visible="true">
+ </separator>
+ <command
+ commandId="org.eclipse.emf.emfstore.client.ui.undoLastOperation"
+ icon="icons/arrow_undo.png"
+ label="Undo Last Operation"
+ style="push"
+ tooltip="Undo the last executed operation">
+ <visibleWhen
+ checkEnabled="false">
+ <and>
+ <test
+ args="org.eclipse.emf.emfstore.client.ui.undoLastOperation"
+ forcePluginActivation="true"
+ property="org.eclipse.emf.ecp.common.menuContributionsEnablement"
+ value="true">
+ </test>
+ <iterate
+ ifEmpty="false"
+ operator="and">
+ <instanceof
+ value="org.eclipse.emf.emfstore.client.model.ProjectSpace">
+ </instanceof>
+ </iterate>
+ <count
+ value="1">
+ </count>
+ </and>
+ </visibleWhen>
+ </command>
+ <command
+ commandId="org.eclipse.emf.emfstore.client.ui.revert"
+ icon="icons/revert.png"
+ label="Revert All Operations"
+ style="push"
+ tooltip="Reverts all operations since last commit">
+ <visibleWhen
+ checkEnabled="false">
+ <and>
+ <test
+ args="org.eclipse.emf.emfstore.client.ui.revert"
+ forcePluginActivation="true"
+ property="org.eclipse.emf.ecp.common.menuContributionsEnablement"
+ value="true">
+ </test>
+ <iterate
+ ifEmpty="false"
+ operator="and">
+ <instanceof
+ value="org.eclipse.emf.emfstore.client.model.ProjectSpace">
+ </instanceof>
+ </iterate>
+ <count
+ value="1">
+ </count>
+ </and>
+ </visibleWhen>
+ </command>
+ <separator
+ name="org.eclipse.emf.emfstore.client.ui.additionalCommands"
+ visible="true">
+ </separator>
+ <command
+ commandId="org.eclipse.emf.emfstore.client.ui.commands.showHistory"
+ icon="icons/historyview.png"
+ label="Show History"
+ style="push">
+ <visibleWhen
+ checkEnabled="false">
+ <and>
+ <test
+ args="org.eclipse.emf.emfstore.client.ui.commands.showHistory"
+ forcePluginActivation="true"
+ property="org.eclipse.emf.ecp.common.menuContributionsEnablement"
+ value="true">
+ </test>
+ <iterate
+ ifEmpty="false"
+ operator="and">
+ <instanceof
+ value="org.eclipse.emf.emfstore.client.model.ProjectSpace">
+ </instanceof>
+ <test
+ forcePluginActivation="true"
+ property="org.eclipse.emf.emfstore.client.ui.commands.projectIsShared"
+ value="true">
+ </test>
+ </iterate>
+ <count
+ value="1">
+ </count>
+ </and>
+ </visibleWhen>
+ </command>
+ <separator
+ name="org.eclipse.emf.emfstore.client.ui.otherCommands"
+ visible="true">
+ </separator>
+ <command
+ commandId="org.eclipse.emf.emfstore.client.ui.deleteProject"
+ icon="icons/delete.gif"
+ label="Delete Project"
+ style="push">
+ <visibleWhen
+ checkEnabled="false">
+ <and>
+ <test
+ args="org.eclipse.emf.emfstore.client.ui.deleteProject"
+ forcePluginActivation="true"
+ property="org.eclipse.emf.ecp.common.menuContributionsEnablement"
+ value="true">
+ </test>
+ <iterate
+ ifEmpty="false"
+ operator="and">
+ <instanceof
+ value="org.eclipse.emf.emfstore.client.model.ProjectSpace">
+ </instanceof>
+ </iterate>
+ <count
+ value="1">
+ </count>
+ </and>
+ </visibleWhen>
+ </command>
+ <menu
+ icon="icons/createrepos.gif"
+ id="org.eclipse.emf.emfstore.client.ui.Other"
+ label="Other...">
+ <menu
+ icon="icons/database_go.png"
+ label="Export">
+ <command
+ commandId="org.eclipse.emf.emfstore.client.ui.exportProject"
+ icon="icons/database_go.png"
+ label="Export Project"
+ style="push">
+ <visibleWhen
+ checkEnabled="false">
+ <and>
+ <test
+ args="org.eclipse.emf.emfstore.client.ui.exportProject"
+ forcePluginActivation="true"
+ property="org.eclipse.emf.ecp.common.menuContributionsEnablement"
+ value="true">
+ </test>
+ <iterate
+ ifEmpty="false"
+ operator="and">
+ <instanceof
+ value="org.eclipse.emf.emfstore.client.model.ProjectSpace">
+ </instanceof>
+ </iterate>
+ <count
+ value="1">
+ </count>
+ </and>
+ </visibleWhen>
+ </command>
+ <command
+ commandId="org.eclipse.emf.emfstore.client.ui.exportChanges"
+ icon="icons/database_go.png"
+ label="Export Changes"
+ style="push">
+ <visibleWhen
+ checkEnabled="false">
+ <and>
+ <test
+ args="org.eclipse.emf.emfstore.client.ui.exportChanges"
+ forcePluginActivation="true"
+ property="org.eclipse.emf.ecp.common.menuContributionsEnablement"
+ value="true">
+ </test>
+ <iterate
+ ifEmpty="false"
+ operator="and">
+ <instanceof
+ value="org.eclipse.emf.emfstore.client.model.ProjectSpace">
+ </instanceof>
+ <test
+ forcePluginActivation="true"
+ property="org.eclipse.emf.emfstore.client.ui.commands.projectHasLocalChanges"
+ value="true">
+ </test>
+ </iterate>
+ <count
+ value="1">
+ </count>
+ </and>
+ </visibleWhen>
+ </command>
+ <command
+ commandId="org.eclipse.emf.emfstore.client.ui.exportProjectSpace"
+ icon="icons/database_go.png"
+ label="Export Projectspace"
+ style="push">
+ <visibleWhen
+ checkEnabled="false">
+ <and>
+ <test
+ args="org.eclipse.emf.emfstore.client.ui.exportProjectSpace"
+ forcePluginActivation="true"
+ property="org.eclipse.emf.ecp.common.menuContributionsEnablement"
+ value="true">
+ </test>
+ <iterate
+ ifEmpty="false"
+ operator="and">
+ <instanceof
+ value="org.eclipse.emf.emfstore.client.model.ProjectSpace">
+ </instanceof>
+ </iterate>
+ <count
+ value="1">
+ </count>
+ </and>
+ </visibleWhen>
+ </command>
+ <command
+ commandId="org.eclipse.emf.emfstore.client.ui.exportWorkSpace"
+ icon="icons/database_go.png"
+ label="Export Workspace"
+ style="push">
+ <visibleWhen
+ checkEnabled="false">
+ <and>
+ <test
+ args="org.eclipse.emf.emfstore.client.ui.exportWorkSpace"
+ forcePluginActivation="true"
+ property="org.eclipse.emf.ecp.common.menuContributionsEnablement"
+ value="true">
+ </test>
+ <or>
+ <count
+ value="0">
+ </count>
+ <count
+ value="1">
+ </count>
+ </or>
+ <iterate>
+ <not>
+ <instanceof
+ value="org.eclipse.emf.ecore.EObject">
+ </instanceof>
+ </not>
+ </iterate>
+ </and>
+ </visibleWhen>
+ </command>
+ </menu>
+ <menu
+ icon="icons/folder_go.png"
+ label="Import">
+ <command
+ commandId="org.eclipse.emf.emfstore.client.ui.importChanges"
+ icon="icons/folder_go.png"
+ label="Import Changes"
+ style="push">
+ <visibleWhen
+ checkEnabled="false">
+ <and>
+ <iterate
+ ifEmpty="false"
+ operator="and">
+ <test
+ args="org.eclipse.emf.emfstore.client.ui.importChanges"
+ forcePluginActivation="true"
+ property="org.eclipse.emf.ecp.common.menuContributionsEnablement"
+ value="true">
+ </test>
+ <instanceof
+ value="org.eclipse.emf.emfstore.client.model.ProjectSpace">
+ </instanceof>
+ <test
+ forcePluginActivation="true"
+ property="org.eclipse.emf.emfstore.client.ui.commands.projectHasLocalChanges"
+ value="false">
+ </test>
+ </iterate>
+ <count
+ value="1">
+ </count>
+ </and>
+ </visibleWhen>
+ </command>
+ <command
+ commandId="org.eclipse.emf.emfstore.client.ui.importProject"
+ icon="icons/folder_go.png"
+ label="Import Project"
+ style="push">
+ <visibleWhen
+ checkEnabled="false">
+ <and>
+ <test
+ args="org.eclipse.emf.emfstore.client.ui.importProject"
+ forcePluginActivation="true"
+ property="org.eclipse.emf.ecp.common.menuContributionsEnablement"
+ value="true">
+ </test>
+ <or>
+ <count
+ value="0">
+ </count>
+ <count
+ value="1">
+ </count>
+ </or>
+ </and>
+ </visibleWhen>
+ </command>
+ <command
+ commandId="org.eclipse.emf.emfstore.client.ui.importProjectSpace"
+ icon="icons/folder_go.png"
+ label="Import Projectspace"
+ style="push">
+ <visibleWhen
+ checkEnabled="false">
+ <and>
+ <test
+ args="org.eclipse.emf.emfstore.client.ui.importProjectSpace"
+ forcePluginActivation="true"
+ property="org.eclipse.emf.ecp.common.menuContributionsEnablement"
+ value="true">
+ </test>
+ <or>
+ <count
+ value="0">
+ </count>
+ <count
+ value="1">
+ </count>
+ </or>
+ <iterate>
+ <not>
+ <instanceof
+ value="org.eclipse.emf.ecore.EObject">
+ </instanceof>
+ </not>
+ </iterate>
+ </and>
+ </visibleWhen>
+ </command>
+ <command
+ commandId="org.eclipse.emf.ecp.navigator.importModel"
+ icon="icons/folder_go.png"
+ label="Import Model Element"
+ style="push">
+ <visibleWhen
+ checkEnabled="false">
+ <and>
+ <test
+ args="org.eclipse.emf.ecp.navigator.importModel"
+ forcePluginActivation="true"
+ property="org.eclipse.emf.ecp.common.menuContributionsEnablement"
+ value="true">
+ </test>
+ <iterate
+ ifEmpty="false"
+ operator="and">
+ <instanceof
+ value="org.eclipse.emf.emfstore.client.model.ProjectSpace">
+ </instanceof>
+ </iterate>
+ <count
+ value="1">
+ </count>
+ </and>
+ </visibleWhen>
+ </command>
+ </menu>
+ <command
+ commandId="org.eclipse.emf.emfstore.client.ui.compareProjects"
+ icon="icons/compare.png"
+ label="Compare to ..."
+ style="push">
+ <visibleWhen
+ checkEnabled="false">
+ <and>
+ <test
+ args="org.eclipse.emf.emfstore.client.ui.compareProjects"
+ forcePluginActivation="true"
+ property="org.eclipse.emf.ecp.common.menuContributionsEnablement"
+ value="true">
+ </test>
+ <iterate
+ ifEmpty="false"
+ operator="and">
+ <instanceof
+ value="org.eclipse.emf.emfstore.client.model.ProjectSpace">
+ </instanceof>
+ </iterate>
+ <count
+ value="1">
+ </count>
+ </and>
+ </visibleWhen>
+ </command>
+ <command
+ commandId="org.eclipse.emf.emfstore.client.ui.NewLocalProject"
+ icon="icons/serverAdd.png"
+ label="New Project..."
+ style="push">
+ <visibleWhen
+ checkEnabled="false">
+ <and>
+ <test
+ args="org.eclipse.emf.emfstore.client.ui.NewLocalProject"
+ forcePluginActivation="true"
+ property="org.eclipse.emf.ecp.common.menuContributionsEnablement"
+ value="true">
+ </test>
+ <or>
+ <count
+ value="0">
+ </count>
+ <count
+ value="1">
+ </count>
+ </or>
+ <iterate>
+ <or>
+ <instanceof
+ value="org.eclipse.emf.emfstore.client.model.ProjectSpace">
+ </instanceof>
+ <instanceof
+ value="org.eclipse.emf.emfstore.common.model.Project">
+ </instanceof>
+ </or>
+ </iterate>
+ </and>
+ </visibleWhen>
+ </command>
+ </menu>
+ <menu
+ label="label">
+ </menu>
+ <separator
+ name="org.eclipse.emf.emfstore.client.ui.scmCommands"
+ visible="true">
+ </separator>
+ <command
+ commandId="org.eclipse.emf.emfstore.client.ui.projectProperties"
+ label="Properties"
+ style="push">
+ <visibleWhen
+ checkEnabled="false">
+ <and>
+ <test
+ args="org.eclipse.emf.emfstore.client.ui.projectProperties"
+ forcePluginActivation="true"
+ property="org.eclipse.emf.ecp.common.menuContributionsEnablement"
+ value="true">
+ </test>
+ <iterate
+ ifEmpty="false"
+ operator="and">
+ <instanceof
+ value="org.eclipse.emf.emfstore.client.model.ProjectSpace">
+ </instanceof>
+ <test
+ forcePluginActivation="true"
+ property="org.eclipse.emf.emfstore.client.ui.commands.projectIsShared"
+ value="true">
+ </test>
+ </iterate>
+ <count
+ value="1">
+ </count>
+ </and>
+ </visibleWhen>
+ </command>
+ </menuContribution>
+ <menuContribution
+ locationURI="popup:org.eclipse.emf.ecp.navigator.viewer?after=org.unicase.ui.stem.ShowInStatusView">
+ <command
+ commandId="org.eclipse.emf.emfstore.client.ui.commands.showHistory"
+ icon="icons/historyview.png"
+ label="Show History"
+ style="push">
+ <visibleWhen
+ checkEnabled="false">
+ <and>
+ <test
+ args="org.eclipse.emf.emfstore.client.ui.commands.showHistory"
+ forcePluginActivation="true"
+ property="org.eclipse.emf.ecp.common.menuContributionsEnablement"
+ value="true">
+ </test>
+ <count
+ value="1">
+ </count>
+ <iterate
+ ifEmpty="false"
+ operator="and">
+ <reference
+ definitionId="org.eclipse.emf.ecp.common.commands.modelElement">
+ </reference>
+ </iterate>
+ </and>
+ </visibleWhen>
+ </command>
+ <separator
+ name="org.eclipse.emf.emfstore.client.ui.commands.showHistoryViewSeperator"
+ visible="true">
+ </separator>
+ </menuContribution>
+ <menuContribution
+ locationURI="toolbar:org.eclipse.emf.ecp.editor.MEEditorPage?after=additions">
+ <command
+ commandId="org.eclipse.emf.emfstore.client.ui.commands.showHistory"
+ icon="icons/historyview.png"
+ label="Show History"
+ style="push">
+ </command>
+ </menuContribution>
+ </extension>
+ <extension
+ point="org.eclipse.ui.views">
+ <category
+ id="org.eclipse.emf.ecp"
+ name="ECP">
+ </category>
+ </extension>
+
+</plugin>
diff --git a/old/org.eclipse.emf.ecp.emfstorebridge/pom.xml b/old/org.eclipse.emf.ecp.emfstorebridge/pom.xml
new file mode 100644
index 0000000..3f88ca4
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.emfstorebridge/pom.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.eclipse.emf.emfstore</groupId>
+ <artifactId>emfstore-parent</artifactId>
+ <version>0.9.3-SNAPSHOT</version>
+ <relativePath>../../org.eclipse.emf.emfstore.releng/emfstore-parent/</relativePath>
+ </parent>
+ <groupId>org.eclipse.emf.emfstore</groupId>
+ <artifactId>org.eclipse.emf.ecp.emfstorebridge</artifactId>
+ <version>0.9.3-SNAPSHOT</version>
+ <packaging>eclipse-plugin</packaging>
+</project>
diff --git a/old/org.eclipse.emf.ecp.emfstorebridge/src/org/eclipse/emf/ecp/emfstorebridge/Activator.java b/old/org.eclipse.emf.ecp.emfstorebridge/src/org/eclipse/emf/ecp/emfstorebridge/Activator.java
new file mode 100644
index 0000000..10430b7
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.emfstorebridge/src/org/eclipse/emf/ecp/emfstorebridge/Activator.java
@@ -0,0 +1,71 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2011 Chair for Applied Software Engineering,
+ * Technische Universitaet Muenchen.
+ * 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:
+ ******************************************************************************/
+package org.eclipse.emf.ecp.emfstorebridge;
+
+import org.eclipse.emf.ecp.common.util.AbstractECPPlugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle.
+ */
+public class Activator extends AbstractECPPlugin {
+
+ /**
+ * The plug-in ID.
+ */
+ public static final String PLUGIN_ID = "org.eclipse.emf.ecp.emfstorebridge";
+
+ // The shared instance
+ private static Activator plugin;
+
+ /**
+ * The constructor.
+ */
+ public Activator() {
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+ */
+ @Override
+ // BEGIN SUPRESS CATCH EXCEPTION
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ plugin = this;
+ }
+
+ // END SUPRESS CATCH EXCEPTION
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+ */
+ @Override
+ // BEGIN SUPRESS CATCH EXCEPTION
+ public void stop(BundleContext context) throws Exception {
+ plugin = null;
+ super.stop(context);
+ }
+
+ // END SUPRESS CATCH EXCEPTION
+ /**
+ * Returns the shared instance.
+ *
+ * @return the shared instance
+ */
+ public static Activator getDefault() {
+ return plugin;
+ }
+
+}
\ No newline at end of file
diff --git a/old/org.eclipse.emf.ecp.emfstorebridge/src/org/eclipse/emf/ecp/emfstorebridge/EMFECPWorkspace.java b/old/org.eclipse.emf.ecp.emfstorebridge/src/org/eclipse/emf/ecp/emfstorebridge/EMFECPWorkspace.java
new file mode 100644
index 0000000..8e668a3
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.emfstorebridge/src/org/eclipse/emf/ecp/emfstorebridge/EMFECPWorkspace.java
@@ -0,0 +1,167 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2011 Chair for Applied Software Engineering,
+ * Technische Universitaet Muenchen.
+ * 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:
+ ******************************************************************************/
+package org.eclipse.emf.ecp.emfstorebridge;
+
+import java.util.HashMap;
+
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.notify.impl.AdapterImpl;
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecp.common.model.workSpaceModel.ECPProject;
+import org.eclipse.emf.ecp.common.model.workSpaceModel.ECPWorkspace;
+import org.eclipse.emf.ecp.common.model.workSpaceModel.impl.ECPWorkspaceImpl;
+import org.eclipse.emf.edit.domain.EditingDomain;
+import org.eclipse.emf.emfstore.client.model.Configuration;
+import org.eclipse.emf.emfstore.client.model.ModelPackage;
+import org.eclipse.emf.emfstore.client.model.ProjectSpace;
+import org.eclipse.emf.emfstore.client.model.Workspace;
+import org.eclipse.emf.emfstore.client.model.WorkspaceManager;
+import org.eclipse.emf.emfstore.common.observer.ObserverBus;
+
+/**
+ * Provides an ECPWorspace for the EMFStore.
+ *
+ * @author helming
+ */
+public class EMFECPWorkspace extends ECPWorkspaceImpl implements ECPWorkspace {
+
+ private HashMap<ProjectSpace, EMFStoreECPProject> mapping = new HashMap<ProjectSpace, EMFStoreECPProject>();
+ private AdapterImpl workspaceListenerAdapter;
+ private Object activeProjectSpace;
+
+ /**
+ * default constructor.
+ */
+ public EMFECPWorkspace() {
+ EList<ProjectSpace> projectSpaces = WorkspaceManager.getInstance().getCurrentWorkspace().getProjectSpaces();
+ for (ProjectSpace projectSpace : projectSpaces) {
+ EMFStoreECPProject emfStoreECPProject = new EMFStoreECPProject(projectSpace);
+ getProjects().add(emfStoreECPProject);
+ mapping.put(projectSpace, emfStoreECPProject);
+ }
+ workspaceListenerAdapter = new AdapterImpl() {
+
+ @Override
+ public void notifyChanged(Notification msg) {
+ if ((msg.getFeatureID(Workspace.class)) == ModelPackage.WORKSPACE__PROJECT_SPACES) {
+ if (msg.getEventType() == Notification.ADD
+ && ModelPackage.eINSTANCE.getProjectSpace().isInstance(msg.getNewValue())) {
+ ProjectSpace projectSpace = (ProjectSpace) msg.getNewValue();
+ EMFStoreECPProject emfStoreECPProject = new EMFStoreECPProject(projectSpace);
+ getProjects().add(emfStoreECPProject);
+ mapping.put(projectSpace, emfStoreECPProject);
+ } else if (msg.getEventType() == Notification.REMOVE
+ && ModelPackage.eINSTANCE.getProjectSpace().isInstance(msg.getOldValue())) {
+ ProjectSpace projectSpace = (ProjectSpace) msg.getOldValue();
+ ECPProject project = getProject(projectSpace);
+ project.dispose();
+ project.setWorkspace(null);
+ mapping.remove(projectSpace);
+ }
+ }
+ super.notifyChanged(msg);
+ }
+ };
+ WorkspaceManager.getInstance().getCurrentWorkspace().eAdapters().add(workspaceListenerAdapter);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.ecp.model.workSpaceModel.ECPWorkspace#getEditingDomain()
+ */
+ @Override
+ public EditingDomain getEditingDomain() {
+ return Configuration.getEditingDomain();
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.ecp.model.workSpaceModel.ECPWorkspace#getProject(org.eclipse.emf.ecore.EObject)
+ */
+ @Override
+ public ECPProject getProject(EObject me) {
+ if (me instanceof EObject) {
+ try {
+ ProjectSpace projectSpace = WorkspaceManager.getProjectSpace(me);
+ return mapping.get(projectSpace);
+ } catch (IllegalArgumentException e) {
+ return null;
+ }
+ }
+ if (me instanceof ProjectSpace) {
+ return mapping.get(me);
+ }
+ return null;
+
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.ecp.model.workSpaceModel.ECPWorkspace#getActiveProject()
+ */
+ @Override
+ public ECPProject getActiveProject() {
+ return mapping.get(activeProjectSpace);
+ }
+
+ /**
+ * Preliminary way to pass ObserverBus to ECP.
+ *
+ * @return observerbus
+ */
+ public ObserverBus getObserverBus() {
+ return org.eclipse.emf.emfstore.client.model.WorkspaceManager.getObserverBus();
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.ecp.model.workSpaceModel.ECPWorkspace#setActiveModelelement(org.eclipse.emf.ecore.EObject)
+ */
+ @Override
+ public void setActiveModelelement(EObject modelelement) {
+ if (modelelement == null) {
+ return;
+ }
+
+ final ProjectSpace projectSpace;
+
+ if (modelelement instanceof ProjectSpace) {
+ projectSpace = (ProjectSpace) modelelement;
+ } else if (modelelement instanceof EObject) {
+ try {
+ projectSpace = org.eclipse.emf.emfstore.client.model.WorkspaceManager.getProjectSpace(modelelement);
+ } catch (IllegalArgumentException exception) {
+ return;
+ }
+ } else {
+ projectSpace = null;
+ }
+
+ if (projectSpace == null) {
+ // the active project space should NEVER be null
+ return;
+ }
+
+ if (activeProjectSpace != null) {
+ if (activeProjectSpace.equals(projectSpace)) {
+ return;
+ }
+ }
+
+ activeProjectSpace = projectSpace;
+ }
+
+}
\ No newline at end of file
diff --git a/old/org.eclipse.emf.ecp.emfstorebridge/src/org/eclipse/emf/ecp/emfstorebridge/EMFStoreECPProject.java b/old/org.eclipse.emf.ecp.emfstorebridge/src/org/eclipse/emf/ecp/emfstorebridge/EMFStoreECPProject.java
new file mode 100644
index 0000000..535ca4e
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.emfstorebridge/src/org/eclipse/emf/ecp/emfstorebridge/EMFStoreECPProject.java
@@ -0,0 +1,169 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2011 Chair for Applied Software Engineering,
+ * Technische Universitaet Muenchen.
+ * 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:
+ ******************************************************************************/
+package org.eclipse.emf.ecp.emfstorebridge;
+
+import java.util.ArrayList;
+import java.util.Collection;
+
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecp.common.model.ECPMetaModelElementContext;
+import org.eclipse.emf.ecp.common.model.workSpaceModel.ECPProject;
+import org.eclipse.emf.ecp.common.model.workSpaceModel.impl.ECPProjectImpl;
+import org.eclipse.emf.edit.domain.EditingDomain;
+import org.eclipse.emf.emfstore.client.model.Configuration;
+import org.eclipse.emf.emfstore.client.model.ProjectSpace;
+import org.eclipse.emf.emfstore.client.model.observers.SimpleOperationObserver;
+import org.eclipse.emf.emfstore.common.model.IdEObjectCollection;
+import org.eclipse.emf.emfstore.common.model.util.IdEObjectCollectionChangeObserver;
+import org.eclipse.emf.emfstore.server.model.versioning.operations.AbstractOperation;
+import org.eclipse.swt.widgets.Display;
+
+/**
+ * ECPproject for the EMFStore.
+ *
+ * @author helming
+ */
+public class EMFStoreECPProject extends ECPProjectImpl implements ECPProject, IdEObjectCollectionChangeObserver {
+
+ @Override
+ public EObject getRootContainer() {
+ return projectSpace.getProject();
+ }
+
+ private final ProjectSpace projectSpace;
+ private SimpleOperationObserver simpleOperationListener;
+
+ /**
+ * Default constructor.
+ *
+ * @param projectSpace the project space
+ */
+ public EMFStoreECPProject(ProjectSpace projectSpace) {
+ this.projectSpace = projectSpace;
+ setRootObject(projectSpace);
+ simpleOperationListener = new SimpleOperationObserver() {
+
+ @Override
+ public void operationPerformed(AbstractOperation operation) {
+ Display.getDefault().asyncExec(new Runnable() {
+
+ public void run() {
+ projectChanged();
+ }
+
+ });
+ }
+
+ };
+ projectSpace.getOperationManager().addOperationListener(simpleOperationListener);
+ projectSpace.getProject().addIdEObjectCollectionChangeObserver(this);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.ecp.model.ECPModelelementContext#getAllModelElements()
+ */
+ public Collection<EObject> getAllModelElements() {
+ ArrayList<EObject> ret = new ArrayList<EObject>();
+ ret.addAll(projectSpace.getProject().getAllModelElements());
+ return ret;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.ecp.model.ECPModelelementContext#getEditingDomain()
+ */
+ public EditingDomain getEditingDomain() {
+ return Configuration.getEditingDomain();
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.ecp.model.workSpaceModel.ECPProject#contains(org.eclipse.emf.ecore.EObject)
+ */
+ public boolean contains(EObject eObject) {
+ return projectSpace.getProject().containsInstance(eObject);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.ecp.model.workSpaceModel.ECPProject#getMetaModelElementContext()
+ */
+ public ECPMetaModelElementContext getMetaModelElementContext() {
+ return EMFStoreMetaModelElementContext.getInstance();
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.ecp.model.workSpaceModel.ECPProject#dispose()
+ */
+ public void dispose() {
+ projectSpace.getOperationManager().removeOperationListener(simpleOperationListener);
+ projectSpace.getProject().removeIdEObjectCollectionChangeObserver(this);
+
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.emfstore.common.model.util.ProjectChangeObserver#modelElementAdded(org.eclipse.emf.emfstore.common.model.Project,
+ * org.eclipse.emf.ecore.EObject)
+ */
+ public void modelElementAdded(IdEObjectCollection project, EObject modelElement) {
+ // Do nothing
+
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.emfstore.common.model.util.ProjectChangeObserver#modelElementRemoved(org.eclipse.emf.emfstore.common.model.Project,
+ * org.eclipse.emf.ecore.EObject)
+ */
+ public void modelElementRemoved(IdEObjectCollection project, EObject modelElement) {
+ super.modelelementDeleted(modelElement);
+
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.emfstore.common.model.util.ProjectChangeObserver#notify(org.eclipse.emf.common.notify.Notification,
+ * org.eclipse.emf.emfstore.common.model.Project, org.eclipse.emf.ecore.EObject)
+ */
+ public void notify(Notification notification, IdEObjectCollection project, EObject modelElement) {
+ // Do nothing
+
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.ecp.model.workSpaceModel.ECPProject#addModelElementToRoot(org.eclipse.emf.ecore.EObject)
+ */
+ public void addModelElementToRoot(EObject eObject) {
+ projectSpace.getProject().getModelElements().add(eObject);
+ }
+
+ /**
+ * {@inheritDoc}
+ * @see org.org.eclipse.emf.emfstore.common.model.util.IdEObjectCollectionChangeObserver#collectionDeleted(org.eclipse.emf.emfstore.common.model.IdEObjectCollection)
+ */
+ public void collectionDeleted(IdEObjectCollection project) {
+ super.projectDeleted();
+ }
+}
\ No newline at end of file
diff --git a/old/org.eclipse.emf.ecp.emfstorebridge/src/org/eclipse/emf/ecp/emfstorebridge/EMFStoreECPWorkspaceProvider.java b/old/org.eclipse.emf.ecp.emfstorebridge/src/org/eclipse/emf/ecp/emfstorebridge/EMFStoreECPWorkspaceProvider.java
new file mode 100644
index 0000000..f657793
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.emfstorebridge/src/org/eclipse/emf/ecp/emfstorebridge/EMFStoreECPWorkspaceProvider.java
@@ -0,0 +1,32 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2011 Chair for Applied Software Engineering,
+ * Technische Universitaet Muenchen.
+ * 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:
+ ******************************************************************************/
+package org.eclipse.emf.ecp.emfstorebridge;
+
+import org.eclipse.emf.ecp.common.model.workSpaceModel.ECPWorkspace;
+import org.eclipse.emf.ecp.common.model.workSpaceModel.util.ECPWorkspaceProvider;
+
+/**
+ * Provides an ECPWorkspace based on an EMFStore Workspace.
+ *
+ * @author koegel
+ */
+public class EMFStoreECPWorkspaceProvider implements ECPWorkspaceProvider {
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.ecp.model.workSpaceModel.util.ECPWorkspaceProvider#getECPWorkspace()
+ */
+ public ECPWorkspace getECPWorkspace() {
+ return new org.eclipse.emf.ecp.emfstorebridge.EMFECPWorkspace();
+ }
+
+}
\ No newline at end of file
diff --git a/old/org.eclipse.emf.ecp.emfstorebridge/src/org/eclipse/emf/ecp/emfstorebridge/EMFStoreMetaModelElementContext.java b/old/org.eclipse.emf.ecp.emfstorebridge/src/org/eclipse/emf/ecp/emfstorebridge/EMFStoreMetaModelElementContext.java
new file mode 100644
index 0000000..d9f933f
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.emfstorebridge/src/org/eclipse/emf/ecp/emfstorebridge/EMFStoreMetaModelElementContext.java
@@ -0,0 +1,102 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2011 Chair for Applied Software Engineering,
+ * Technische Universitaet Muenchen.
+ * 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:
+ ******************************************************************************/
+package org.eclipse.emf.ecp.emfstorebridge;
+
+import java.util.Arrays;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecp.common.model.AbstractECPMetaModelElementContext;
+import org.eclipse.emf.ecp.common.model.ECPAssociationClassElement;
+import org.eclipse.emf.ecp.common.model.ECPMetaModelElementContext;
+import org.eclipse.emf.emfstore.common.model.AssociationClassElement;
+import org.eclipse.emf.emfstore.common.model.util.ModelUtil;
+
+/**
+ * {@link AbstractECPMetaModelElementContext} for the EMFStore.
+ *
+ * @author helming
+ */
+public class EMFStoreMetaModelElementContext extends AbstractECPMetaModelElementContext {
+
+ /**
+ * Initializes the singleton instance statically.
+ */
+ private static class SingletonHolder {
+ public static final EMFStoreMetaModelElementContext INSTANCE = new EMFStoreMetaModelElementContext();
+ }
+
+ /**
+ * Singleton.
+ *
+ * @return the instance
+ */
+ public static ECPMetaModelElementContext getInstance() {
+ return SingletonHolder.INSTANCE;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.ecp.model.ECPMetaModelElementContext#isAssociationClassElement(org.eclipse.emf.ecore.EClass)
+ */
+ public boolean isAssociationClassElement(EClass eClazz) {
+ return ModelUtil.isAssociationClassElement(eClazz);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.ecp.model.workSpaceModel.ECPProject#getAssociationClassElement(org.eclipse.emf.ecore.EObject)
+ */
+ public ECPAssociationClassElement getAssociationClassElement(EObject eObject) {
+
+ if (isAssociationClassElement(eObject)) {
+ AssociationClassElement ace = (AssociationClassElement) eObject;
+ return new ECPAssociationClassElement(ace.getSourceFeature(), ace.getTargetFeature(),
+ ace.getAssociationFeatures());
+ }
+
+ return null;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.ecp.model.ECPMetaModelElementContext#isAssociationClassElement(org.eclipse.emf.ecore.EObject)
+ */
+ public boolean isAssociationClassElement(EObject eObject) {
+ return isAssociationClassElement(eObject.eClass());
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.ecp.model.AbstractECPMetaModelElementContext#isNonDomainElement(org.eclipse.emf.ecore.EClass)
+ */
+ @Override
+ public boolean isNonDomainElement(EClass eClass) {
+ EClass nonDomainElementEClass = org.eclipse.emf.emfstore.common.model.ModelPackage.eINSTANCE.getNonDomainElement();
+ Class<?> instanceClass = eClass.getInstanceClass();
+ boolean isNonDomainElement = false;
+
+ if (instanceClass != null) {
+ for (Class<?> iface : Arrays.asList(instanceClass.getInterfaces())) {
+ if (iface.getCanonicalName().equals(nonDomainElementEClass.getInstanceClassName())) {
+ isNonDomainElement = true;
+ break;
+ }
+ }
+ }
+
+ return isNonDomainElement || nonDomainElementEClass.isSuperTypeOf(eClass);
+ }
+}
\ No newline at end of file
diff --git a/old/org.eclipse.emf.ecp.emfstorebridge/src/org/eclipse/emf/ecp/emfstorebridge/ProjectSpaceOpener.java b/old/org.eclipse.emf.ecp.emfstorebridge/src/org/eclipse/emf/ecp/emfstorebridge/ProjectSpaceOpener.java
new file mode 100644
index 0000000..0e25c70
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.emfstorebridge/src/org/eclipse/emf/ecp/emfstorebridge/ProjectSpaceOpener.java
@@ -0,0 +1,43 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2011 Chair for Applied Software Engineering,
+ * Technische Universitaet Muenchen.
+ * 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:
+ ******************************************************************************/
+package org.eclipse.emf.ecp.emfstorebridge;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecp.common.util.ModelElementOpener;
+import org.eclipse.emf.emfstore.client.model.ProjectSpace;
+
+/**
+ * Opener for Project Space.
+ * @author Maximilian Koegel
+ *
+ */
+public class ProjectSpaceOpener implements ModelElementOpener {
+
+ /**
+ * {@inheritDoc}
+ * @see org.eclipse.emf.ecp.common.util.ModelElementOpener#canOpen(org.eclipse.emf.ecore.EObject)
+ */
+ public int canOpen(EObject modelElement) {
+ if (modelElement instanceof ProjectSpace) {
+ return 1;
+ }
+ return DONOTOPEN;
+ }
+
+ /**
+ * {@inheritDoc}
+ * @see org.eclipse.emf.ecp.common.util.ModelElementOpener#openModelElement(org.eclipse.emf.ecore.EObject)
+ */
+ public void openModelElement(EObject modelElement) {
+ // do nothing
+ }
+
+}
\ No newline at end of file
diff --git a/old/org.eclipse.emf.ecp.emfstorebridge/src/org/eclipse/emf/ecp/emfstorebridge/actions/AddXMIAction.java b/old/org.eclipse.emf.ecp.emfstorebridge/src/org/eclipse/emf/ecp/emfstorebridge/actions/AddXMIAction.java
new file mode 100644
index 0000000..ac389dc
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.emfstorebridge/src/org/eclipse/emf/ecp/emfstorebridge/actions/AddXMIAction.java
@@ -0,0 +1,94 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2011 Chair for Applied Software Engineering,
+ * Technische Universitaet Muenchen.
+ * 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:
+ ******************************************************************************/
+package org.eclipse.emf.ecp.emfstorebridge.actions;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecore.resource.ResourceSet;
+import org.eclipse.emf.emfstore.client.model.ModelFactory;
+import org.eclipse.emf.emfstore.client.model.ProjectSpace;
+import org.eclipse.emf.emfstore.client.model.Workspace;
+import org.eclipse.emf.emfstore.client.model.WorkspaceManager;
+import org.eclipse.emf.emfstore.client.model.impl.WorkspaceImpl;
+import org.eclipse.emf.emfstore.client.model.util.EMFStoreCommand;
+import org.eclipse.emf.emfstore.common.model.Project;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.TreeSelection;
+import org.eclipse.ui.IActionDelegate;
+
+/**
+ * Action for adding XMI files to workspace.
+ *
+ * @author koegel
+ */
+public class AddXMIAction implements IActionDelegate {
+
+ private ISelection selection;
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
+ */
+ public void run(IAction action) {
+ if (selection instanceof TreeSelection) {
+ WorkspaceManager.init();
+ final Object firstElement = ((TreeSelection) selection).getFirstElement();
+ new EMFStoreCommand() {
+
+ @Override
+ protected void doRun() {
+ runImport(firstElement);
+ }
+ }.run();
+ }
+
+ }
+
+ private void runImport(Object firstElement) {
+ if (firstElement instanceof IFile) {
+ IFile file = (IFile) firstElement;
+
+ URI fileURI = URI.createFileURI(file.getRawLocationURI().getPath());
+
+ Workspace currentWorkspace = WorkspaceManager.getInstance().getCurrentWorkspace();
+ ResourceSet resourceSet = currentWorkspace.eResource().getResourceSet();
+ Resource resource = resourceSet.getResource(fileURI, true);
+
+ ProjectSpace projectSpace = ModelFactory.eINSTANCE.createProjectSpace();
+ Project project = org.eclipse.emf.emfstore.common.model.ModelFactory.eINSTANCE.createProject();
+ projectSpace.setProject(project);
+ projectSpace.setProjectName(file.getName());
+ projectSpace.setProjectDescription("Imported.");
+ projectSpace.setLocalOperations(ModelFactory.eINSTANCE.createOperationComposite());
+
+ project.getModelElements().addAll(resource.getContents());
+ ((WorkspaceImpl) currentWorkspace).addProjectSpace(projectSpace);
+ projectSpace.init();
+
+ currentWorkspace.save();
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction,
+ * org.eclipse.jface.viewers.ISelection)
+ */
+ public void selectionChanged(IAction action, ISelection selection) {
+ this.selection = selection;
+
+ }
+
+}
\ No newline at end of file
diff --git a/old/org.eclipse.emf.ecp.emfstorebridge/src/org/eclipse/emf/ecp/emfstorebridge/actions/CreateProjectDialog.java b/old/org.eclipse.emf.ecp.emfstorebridge/src/org/eclipse/emf/ecp/emfstorebridge/actions/CreateProjectDialog.java
new file mode 100644
index 0000000..96433fa
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.emfstorebridge/src/org/eclipse/emf/ecp/emfstorebridge/actions/CreateProjectDialog.java
@@ -0,0 +1,130 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2011 Chair for Applied Software Engineering,
+ * Technische Universitaet Muenchen.
+ * 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:
+ ******************************************************************************/
+package org.eclipse.emf.ecp.emfstorebridge.actions;
+
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.emf.ecp.common.util.DialogHandler;
+import org.eclipse.emf.emfstore.client.model.ProjectSpace;
+import org.eclipse.emf.emfstore.client.model.Usersession;
+import org.eclipse.emf.emfstore.client.model.WorkspaceManager;
+import org.eclipse.emf.emfstore.client.model.util.EMFStoreCommand;
+import org.eclipse.emf.emfstore.server.exceptions.AccessControlException;
+import org.eclipse.emf.emfstore.server.exceptions.EmfStoreException;
+import org.eclipse.jface.dialogs.TitleAreaDialog;
+import org.eclipse.jface.layout.GridLayoutFactory;
+import org.eclipse.jface.layout.LayoutConstants;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Text;
+
+/**
+ * Create project dialog.
+ *
+ * @author shterev
+ */
+public class CreateProjectDialog extends TitleAreaDialog {
+
+ private Text txtProjectName;
+ private Text txtProjectDesc;
+ private Usersession session;
+
+ /**
+ * Default constructor.
+ *
+ * @param parent the parent shell
+ * @param session the target usersession
+ */
+ public CreateProjectDialog(Shell parent, Usersession session) {
+ super(parent);
+ this.session = session;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected Control createDialogArea(Composite parent) {
+ Composite contents = new Composite(parent, SWT.NONE);
+ contents.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+
+ setTitle("Create new project");
+ setMessage("Enter the name and the description of the project");
+
+ Label name = new Label(contents, SWT.NULL);
+ name.setText("Name:");
+ txtProjectName = new Text(contents, SWT.SINGLE | SWT.BORDER);
+ txtProjectName.setSize(150, 20);
+
+ Label desc = new Label(contents, SWT.NULL);
+ desc.setText("Description:");
+ txtProjectDesc = new Text(contents, SWT.MULTI | SWT.BORDER);
+ txtProjectDesc.setSize(150, 60);
+
+ Point defaultMargins = LayoutConstants.getMargins();
+ GridLayoutFactory.fillDefaults().numColumns(2).margins(defaultMargins.x, defaultMargins.y)
+ .generateLayout(contents);
+
+ return contents;
+ }
+
+ private ProjectSpace projectSpace;
+
+ /**
+ * @return the projectSpace
+ */
+ public ProjectSpace getProjectSpace() {
+ return projectSpace;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void okPressed() {
+ new EMFStoreCommand() {
+
+ @Override
+ protected void doRun() {
+ try {
+
+ if (session != null) {
+ WorkspaceManager.getInstance().getCurrentWorkspace().createRemoteProject(session, txtProjectName.getText(), txtProjectDesc.getText(),
+ new NullProgressMonitor());
+ } else {
+ projectSpace = WorkspaceManager.getInstance().getCurrentWorkspace()
+ .createLocalProject(txtProjectName.getText(), txtProjectDesc.getText());
+ }
+
+ } catch (AccessControlException e) {
+ DialogHandler.showExceptionDialog(e);
+ } catch (EmfStoreException e) {
+ DialogHandler.showExceptionDialog(e);
+ }
+ }
+
+ }.run();
+ close();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void cancelPressed() {
+ close();
+ }
+
+}
\ No newline at end of file
diff --git a/old/org.eclipse.emf.ecp.emfstorebridge/src/org/eclipse/emf/ecp/emfstorebridge/actions/ImportXMIAction.java b/old/org.eclipse.emf.ecp.emfstorebridge/src/org/eclipse/emf/ecp/emfstorebridge/actions/ImportXMIAction.java
new file mode 100644
index 0000000..bb52011
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.emfstorebridge/src/org/eclipse/emf/ecp/emfstorebridge/actions/ImportXMIAction.java
@@ -0,0 +1,220 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2011 Chair for Applied Software Engineering,
+ * Technische Universitaet Muenchen.
+ * 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:
+ ******************************************************************************/
+package org.eclipse.emf.ecp.emfstorebridge.actions;
+
+import java.util.HashSet;
+import java.util.Set;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.emf.common.util.TreeIterator;
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecore.resource.ResourceSet;
+import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
+import org.eclipse.emf.emfstore.client.model.ProjectSpace;
+import org.eclipse.emf.emfstore.client.model.WorkspaceManager;
+import org.eclipse.emf.emfstore.client.model.util.EMFStoreCommand;
+import org.eclipse.emf.emfstore.common.CommonUtil;
+import org.eclipse.emf.emfstore.common.model.util.ModelUtil;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.dialogs.ProgressMonitorDialog;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.TreeSelection;
+import org.eclipse.ui.IActionDelegate;
+import org.eclipse.ui.PlatformUI;
+
+/**
+ * Action for adding XMI files to workspace.
+ *
+ * @author koegel
+ */
+public class ImportXMIAction implements IActionDelegate {
+
+ private ISelection selection;
+
+ /**
+ * These filter names are used to filter which files are displayed.
+ */
+ public static final String[] FILTER_NAMES = { "ECP Project Files (*.ucm)", "All Files (*.*)" };
+
+ /**
+ * These filter extensions are used to filter which files are displayed.
+ */
+ public static final String[] FILTER_EXTS = { "*.ucm", "*.*" };
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
+ */
+ public void run(IAction action) {
+ if (selection instanceof TreeSelection) {
+ WorkspaceManager.init();
+ final Object firstElement = ((TreeSelection) selection).getFirstElement();
+ new EMFStoreCommand() {
+
+ @Override
+ protected void doRun() {
+ runImport(firstElement);
+ }
+ }.run();
+ }
+
+ }
+
+ private void runImport(Object firstElement) {
+ if (firstElement instanceof IFile) {
+ CreateProjectDialog dialog = new CreateProjectDialog(PlatformUI.getWorkbench().getDisplay()
+ .getActiveShell(), null);
+
+ dialog.open();
+
+ final ProjectSpace projectSpace = dialog.getProjectSpace();
+
+ IFile file = (IFile) firstElement;
+
+ final URI fileURI = URI.createFileURI(file.getRawLocationURI().getPath());
+
+ // create resource set and resource
+ ResourceSet resourceSet = new ResourceSetImpl();
+
+ final Resource resource = resourceSet.getResource(fileURI, true);
+
+ final ProgressMonitorDialog progressDialog = new ProgressMonitorDialog(PlatformUI.getWorkbench()
+ .getActiveWorkbenchWindow().getShell());
+
+ new EMFStoreCommand() {
+ @Override
+ protected void doRun() {
+ importFile(projectSpace, fileURI, resource, progressDialog);
+ }
+
+ }.run();
+
+ return;
+ }
+ }
+
+ private void importFile(final ProjectSpace projectSpace, final URI fileURI, final Resource resource,
+ final ProgressMonitorDialog progressDialog) {
+ try {
+ progressDialog.open();
+ progressDialog.getProgressMonitor().beginTask("Import model...", 100);
+
+ Set<EObject> importElements = validation(resource);
+
+ if (importElements.size() > 0) {
+ int i = 0;
+ for (EObject eObject : importElements) {
+ // run the import command
+ runImport(projectSpace, fileURI, ModelUtil.clone(eObject), i);
+ progressDialog.getProgressMonitor().worked(10);
+ i++;
+ }
+ }
+ // BEGIN SUPRESS CATCH EXCEPTION
+ } catch (RuntimeException e) {
+ ModelUtil.logException(e);
+ // END SUPRESS CATCH EXCEPTION
+ } finally {
+ progressDialog.getProgressMonitor().done();
+ progressDialog.close();
+ }
+ }
+
+ // Validates if the EObjects can be imported
+ private Set<EObject> validation(Resource resource) {
+ Set<EObject> childrenSet = new HashSet<EObject>();
+ Set<EObject> rootNodes = new HashSet<EObject>();
+
+ EList<EObject> rootContent = resource.getContents();
+
+ for (EObject rootNode : rootContent) {
+ TreeIterator<EObject> contents = rootNode.eAllContents();
+ // 1. Run: Put all children in set
+ while (contents.hasNext()) {
+ EObject content = contents.next();
+ if (!(content instanceof EObject)) {
+ // TODO: Report to Console //System.out.println(content +
+ // " is not a ModelElement and can not be imported");
+ continue;
+ }
+ childrenSet.add(content);
+ }
+ }
+
+ // 2. Run: Check if RootNodes are children -> set.contains(RootNode) -- no: RootNode in rootNode-Set -- yes:
+ // Drop RootNode, will be imported as a child
+ for (EObject rootNode : rootContent) {
+
+ if (!(rootNode instanceof EObject)) {
+ // No report to Console, because Run 1 will do this
+ continue;
+ }
+
+ if (!childrenSet.contains(rootNode)) {
+ rootNodes.add(rootNode);
+ }
+ }
+
+ // 3. Check if RootNodes are SelfContained -- yes: import -- no: error
+ Set<EObject> notSelfContained = new HashSet<EObject>();
+ for (EObject rootNode : rootNodes) {
+ if (!CommonUtil.isSelfContained(rootNode)) {
+ // TODO: Report to Console //System.out.println(rootNode + " is not selfcontained");
+ notSelfContained.add(rootNode);
+ }
+ }
+ rootNodes.removeAll(notSelfContained);
+
+ return rootNodes;
+ }
+
+ /**
+ * Runs the import command.
+ *
+ * @param projectSpace - the projectSpace where the element should be imported in.
+ * @param uri - the uri of the resource.
+ * @param element - the modelElement to import.
+ * @param resourceIndex - the index of the element inside the eResource.
+ */
+ private void runImport(final ProjectSpace projectSpace, final org.eclipse.emf.common.util.URI uri,
+ final EObject element, final int resourceIndex) {
+
+ // TODO: PlainEObjectMode
+ // try to find a wrapper for the element which will be added to the project
+ // ModelElement wrapper = ModelElementWrapperDescriptor.getInstance().wrapForImport(projectSpace.getProject(),
+ // element, uri, resourceIndex);
+
+ // if no wrapper could be created, use the element itself to add it to the project
+ // if (wrapper == null) {
+ // wrapper = element;
+ // }
+
+ // add the wrapper or the element itself to the project
+ // copy wrapper to reset model element ids
+ projectSpace.getProject().addModelElement(element);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction,
+ * org.eclipse.jface.viewers.ISelection)
+ */
+ public void selectionChanged(IAction action, ISelection selection) {
+ this.selection = selection;
+
+ }
+
+}
\ No newline at end of file
diff --git a/old/org.eclipse.emf.ecp.navigator/.checkstyle b/old/org.eclipse.emf.ecp.navigator/.checkstyle
new file mode 100644
index 0000000..d4fa17e
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.navigator/.checkstyle
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<fileset-config file-format-version="1.2.0" simple-config="true" sync-formatter="false">
+ <fileset name="all" enabled="true" check-config-name="emfcpStyle" local="false">
+ <file-match-pattern match-pattern="." include-pattern="true"/>
+ </fileset>
+</fileset-config>
diff --git a/old/org.eclipse.emf.ecp.navigator/.classpath b/old/org.eclipse.emf.ecp.navigator/.classpath
new file mode 100644
index 0000000..304e861
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.navigator/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <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="output" path="bin"/>
+</classpath>
diff --git a/old/org.eclipse.emf.ecp.navigator/.project b/old/org.eclipse.emf.ecp.navigator/.project
new file mode 100644
index 0000000..402decf
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.navigator/.project
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.emf.ecp.navigator</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>net.sf.eclipsecs.core.CheckstyleBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>net.sf.eclipsecs.core.CheckstyleNature</nature>
+ </natures>
+</projectDescription>
diff --git a/old/org.eclipse.emf.ecp.navigator/.settings/org.eclipse.jdt.core.prefs b/old/org.eclipse.emf.ecp.navigator/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 0000000..207cf7d
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.navigator/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,83 @@
+#Wed May 18 17:49:16 CEST 2011
+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.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.doc.comment.support=enabled
+org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
+org.eclipse.jdt.core.compiler.problem.deprecation=warning
+org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
+org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
+org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
+org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.problem.fallthroughCase=warning
+org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled
+org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore
+org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
+org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
+org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
+org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
+org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
+org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore
+org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore
+org.eclipse.jdt.core.compiler.problem.invalidJavadoc=ignore
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTags=disabled
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef=disabled
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef=disabled
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=public
+org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
+org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
+org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=warning
+org.eclipse.jdt.core.compiler.problem.missingJavadocComments=ignore
+org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=disabled
+org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public
+org.eclipse.jdt.core.compiler.problem.missingJavadocTagDescription=return_tag
+org.eclipse.jdt.core.compiler.problem.missingJavadocTags=ignore
+org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled
+org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=public
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=warning
+org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
+org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
+org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
+org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
+org.eclipse.jdt.core.compiler.problem.nullReference=warning
+org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
+org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
+org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore
+org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore
+org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
+org.eclipse.jdt.core.compiler.problem.redundantNullCheck=warning
+org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore
+org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
+org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
+org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
+org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
+org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
+org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
+org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
+org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
+org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning
+org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=warning
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
+org.eclipse.jdt.core.compiler.problem.unusedImport=warning
+org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
+org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
+org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
+org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
+org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
+org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
+org.eclipse.jdt.core.compiler.source=1.5
diff --git a/old/org.eclipse.emf.ecp.navigator/.settings/org.eclipse.jdt.ui.prefs b/old/org.eclipse.emf.ecp.navigator/.settings/org.eclipse.jdt.ui.prefs
new file mode 100644
index 0000000..7fdf47d
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.navigator/.settings/org.eclipse.jdt.ui.prefs
@@ -0,0 +1,57 @@
+#Thu Mar 31 20:47:55 CEST 2011
+cleanup.add_default_serial_version_id=true
+cleanup.add_generated_serial_version_id=false
+cleanup.add_missing_annotations=true
+cleanup.add_missing_deprecated_annotations=true
+cleanup.add_missing_methods=false
+cleanup.add_missing_nls_tags=false
+cleanup.add_missing_override_annotations=true
+cleanup.add_serial_version_id=false
+cleanup.always_use_blocks=true
+cleanup.always_use_parentheses_in_expressions=false
+cleanup.always_use_this_for_non_static_field_access=false
+cleanup.always_use_this_for_non_static_method_access=false
+cleanup.convert_to_enhanced_for_loop=false
+cleanup.correct_indentation=true
+cleanup.format_source_code=true
+cleanup.format_source_code_changes_only=false
+cleanup.make_local_variable_final=true
+cleanup.make_parameters_final=false
+cleanup.make_private_fields_final=true
+cleanup.make_type_abstract_if_missing_method=false
+cleanup.make_variable_declarations_final=false
+cleanup.never_use_blocks=false
+cleanup.never_use_parentheses_in_expressions=true
+cleanup.organize_imports=true
+cleanup.qualify_static_field_accesses_with_declaring_class=false
+cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true
+cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true
+cleanup.qualify_static_member_accesses_with_declaring_class=true
+cleanup.qualify_static_method_accesses_with_declaring_class=false
+cleanup.remove_private_constructors=true
+cleanup.remove_trailing_whitespaces=true
+cleanup.remove_trailing_whitespaces_all=true
+cleanup.remove_trailing_whitespaces_ignore_empty=false
+cleanup.remove_unnecessary_casts=true
+cleanup.remove_unnecessary_nls_tags=true
+cleanup.remove_unused_imports=true
+cleanup.remove_unused_local_variables=false
+cleanup.remove_unused_private_fields=true
+cleanup.remove_unused_private_members=false
+cleanup.remove_unused_private_methods=true
+cleanup.remove_unused_private_types=true
+cleanup.sort_members=false
+cleanup.sort_members_all=false
+cleanup.use_blocks=true
+cleanup.use_blocks_only_for_return_and_throw=false
+cleanup.use_parentheses_in_expressions=false
+cleanup.use_this_for_non_static_field_access=false
+cleanup.use_this_for_non_static_field_access_only_if_necessary=true
+cleanup.use_this_for_non_static_method_access=false
+cleanup.use_this_for_non_static_method_access_only_if_necessary=true
+cleanup_profile=_unicaseCleanUp
+cleanup_settings_version=2
+eclipse.preferences.version=1
+formatter_settings_version=11
+org.eclipse.jdt.ui.javadoc=false
+org.eclipse.jdt.ui.text.custom_code_templates=<?xml version\="1.0" encoding\="UTF-8" standalone\="no"?><templates><template autoinsert\="true" context\="gettercomment_context" deleted\="false" description\="Comment for getter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.gettercomment" name\="gettercomment">/**\n * @return the ${bare_field_name}\n */</template><template autoinsert\="true" context\="settercomment_context" deleted\="false" description\="Comment for setter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.settercomment" name\="settercomment">/**\n * @param ${param} the ${bare_field_name} to set\n */</template><template autoinsert\="true" context\="constructorcomment_context" deleted\="false" description\="Comment for created constructors" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorcomment" name\="constructorcomment">/**\n * ${tags}\n */</template><template autoinsert\="false" context\="filecomment_context" deleted\="false" description\="Comment for created Java files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.filecomment" name\="filecomment">/**\n * <copyright> Copyright (c) 2008-2009 Jonas Helming, Maximilian Koegel. All rights reserved. This program and the\n * accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this\n * distribution, and is available at http\://www.eclipse.org/legal/epl-v10.html </copyright>\n */</template><template autoinsert\="true" context\="typecomment_context" deleted\="false" description\="Comment for created types" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.typecomment" name\="typecomment">/**\n * @author ${user}\n *\n * ${tags}\n */</template><template autoinsert\="false" context\="fieldcomment_context" deleted\="false" description\="Comment for fields" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.fieldcomment" name\="fieldcomment"/><template autoinsert\="true" context\="methodcomment_context" deleted\="false" description\="Comment for non-overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodcomment" name\="methodcomment">/**\n * ${tags}\n */</template><template autoinsert\="false" context\="overridecomment_context" deleted\="false" description\="Comment for overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.overridecomment" name\="overridecomment">/**\n * {@inheritDoc}\n * ${see_to_overridden}\n */</template><template autoinsert\="true" context\="delegatecomment_context" deleted\="false" description\="Comment for delegate methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.delegatecomment" name\="delegatecomment">/**\n * ${tags}\n * ${see_to_target}\n */</template><template autoinsert\="true" context\="newtype_context" deleted\="false" description\="Newly created files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.newtype" name\="newtype">${filecomment}\n${package_declaration}\n\n${typecomment}\n${type_declaration}</template><template autoinsert\="true" context\="classbody_context" deleted\="false" description\="Code in new class type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.classbody" name\="classbody">\n</template><template autoinsert\="true" context\="interfacebody_context" deleted\="false" description\="Code in new interface type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.interfacebody" name\="interfacebody">\n</template><template autoinsert\="true" context\="enumbody_context" deleted\="false" description\="Code in new enum type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.enumbody" name\="enumbody">\n</template><template autoinsert\="true" context\="annotationbody_context" deleted\="false" description\="Code in new annotation type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.annotationbody" name\="annotationbody">\n</template><template autoinsert\="false" context\="catchblock_context" deleted\="false" description\="Code in new catch blocks" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.catchblock" name\="catchblock">\t\t\t// TODO Auto-generated catch block\n\t\t\t// Do NOT catch all Exceptions ("catch (Exception e)")\n\t\t\t// Log AND handle Exceptions if possible \n //\n // You can just uncomment one of the lines below to log an exception\:\n\t\t\t// logException will show the logged excpetion to the user\n\t\t\t// ModelUtil.logException(${exception_var});\n\t\t\t// ModelUtil.logException("YOUR MESSAGE HERE", ${exception_var});\n\t\t\t// logWarning will only add the message to the error log\n\t\t\t// ModelUtil.logWarning("YOUR MESSAGE HERE", ${exception_var});\n\t\t\t// ModelUtil.logWarning("YOUR MESSAGE HERE");\n\t\t\t//\t\t\t\n\t\t\t// If handling is not possible declare and rethrow Exception</template><template autoinsert\="true" context\="methodbody_context" deleted\="false" description\="Code in created method stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodbody" name\="methodbody">// ${todo} Auto-generated method stub\n${body_statement}</template><template autoinsert\="true" context\="constructorbody_context" deleted\="false" description\="Code in created constructor stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorbody" name\="constructorbody">${body_statement}\n// ${todo} Auto-generated constructor stub</template><template autoinsert\="true" context\="getterbody_context" deleted\="false" description\="Code in created getters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.getterbody" name\="getterbody">return ${field};</template><template autoinsert\="true" context\="setterbody_context" deleted\="false" description\="Code in created setters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.setterbody" name\="setterbody">${field} \= ${param};</template></templates>
diff --git a/old/org.eclipse.emf.ecp.navigator/META-INF/MANIFEST.MF b/old/org.eclipse.emf.ecp.navigator/META-INF/MANIFEST.MF
new file mode 100644
index 0000000..c00a7c7
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.navigator/META-INF/MANIFEST.MF
@@ -0,0 +1,15 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: ECP Navigator Plug-in
+Bundle-SymbolicName: org.eclipse.emf.ecp.navigator;singleton:=true
+Bundle-Version: 0.9.3.qualifier
+Bundle-Activator: org.eclipse.emf.ecp.navigator.Activator
+Bundle-Vendor: Eclipse Modeling Project
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Bundle-ActivationPolicy: lazy
+Require-Bundle: org.eclipse.emf.ecp.editor;visibility:=reexport
+Export-Package: org.eclipse.emf.ecp.navigator,
+ org.eclipse.emf.ecp.navigator.commands,
+ org.eclipse.emf.ecp.navigator.handler,
+ org.eclipse.emf.ecp.navigator.wizards
+
diff --git a/old/org.eclipse.emf.ecp.navigator/build.properties b/old/org.eclipse.emf.ecp.navigator/build.properties
new file mode 100644
index 0000000..3f76903
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.navigator/build.properties
@@ -0,0 +1,11 @@
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ icons/,\
+ contexts.xml,\
+ plugin.xml,\
+ schema/
+source.. = src/
+src.includes = schema/,\
+ icons/,\
+ contexts.xml
\ No newline at end of file
diff --git a/old/org.eclipse.emf.ecp.navigator/contexts.xml b/old/org.eclipse.emf.ecp.navigator/contexts.xml
new file mode 100644
index 0000000..02e26e4
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.navigator/contexts.xml
@@ -0,0 +1,12 @@
+<contexts>
+ <context id="viewer" title="Sample View">
+ <description>This is the context help for the sample view with a table viewer. It was generated by a PDE template.</description>
+ <topic href="/PLUGINS_ROOT/org.eclipse.platform.doc.isv/guide/ua_help_context.htm" label="Context-sensitive help">
+ <enablement>
+ <with variable="platform">
+ <test property="org.eclipse.core.runtime.isBundleInstalled" args="org.eclipse.platform.doc.isv"/>
+ </with>
+ </enablement>
+ </topic>
+ </context>
+</contexts>
diff --git a/old/org.eclipse.emf.ecp.navigator/icons/CompositeSection.gif b/old/org.eclipse.emf.ecp.navigator/icons/CompositeSection.gif
new file mode 100644
index 0000000..3722fea
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.navigator/icons/CompositeSection.gif
Binary files differ
diff --git a/old/org.eclipse.emf.ecp.navigator/icons/LeafSection.gif b/old/org.eclipse.emf.ecp.navigator/icons/LeafSection.gif
new file mode 100644
index 0000000..f48d8d9
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.navigator/icons/LeafSection.gif
Binary files differ
diff --git a/old/org.eclipse.emf.ecp.navigator/icons/ModelElement.png b/old/org.eclipse.emf.ecp.navigator/icons/ModelElement.png
new file mode 100644
index 0000000..5898c18
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.navigator/icons/ModelElement.png
Binary files differ
diff --git a/old/org.eclipse.emf.ecp.navigator/icons/NewModelElement.png b/old/org.eclipse.emf.ecp.navigator/icons/NewModelElement.png
new file mode 100644
index 0000000..3cbf970
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.navigator/icons/NewModelElement.png
Binary files differ
diff --git a/old/org.eclipse.emf.ecp.navigator/icons/database_go.png b/old/org.eclipse.emf.ecp.navigator/icons/database_go.png
new file mode 100644
index 0000000..61a8556
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.navigator/icons/database_go.png
Binary files differ
diff --git a/old/org.eclipse.emf.ecp.navigator/icons/folder_go.png b/old/org.eclipse.emf.ecp.navigator/icons/folder_go.png
new file mode 100644
index 0000000..34a736f
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.navigator/icons/folder_go.png
Binary files differ
diff --git a/old/org.eclipse.emf.ecp.navigator/icons/link_with_editor.gif b/old/org.eclipse.emf.ecp.navigator/icons/link_with_editor.gif
new file mode 100644
index 0000000..870934b
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.navigator/icons/link_with_editor.gif
Binary files differ
diff --git a/old/org.eclipse.emf.ecp.navigator/icons/magnifier.png b/old/org.eclipse.emf.ecp.navigator/icons/magnifier.png
new file mode 100644
index 0000000..cf3d97f
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.navigator/icons/magnifier.png
Binary files differ
diff --git a/old/org.eclipse.emf.ecp.navigator/icons/sample.gif b/old/org.eclipse.emf.ecp.navigator/icons/sample.gif
new file mode 100644
index 0000000..34fb3c9
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.navigator/icons/sample.gif
Binary files differ
diff --git a/old/org.eclipse.emf.ecp.navigator/icons/unicase.png b/old/org.eclipse.emf.ecp.navigator/icons/unicase.png
new file mode 100644
index 0000000..1e43863
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.navigator/icons/unicase.png
Binary files differ
diff --git a/old/org.eclipse.emf.ecp.navigator/icons/unicase_big.png b/old/org.eclipse.emf.ecp.navigator/icons/unicase_big.png
new file mode 100644
index 0000000..8ef5002
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.navigator/icons/unicase_big.png
Binary files differ
diff --git a/old/org.eclipse.emf.ecp.navigator/plugin.properties b/old/org.eclipse.emf.ecp.navigator/plugin.properties
new file mode 100644
index 0000000..450550f
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.navigator/plugin.properties
@@ -0,0 +1,24 @@
+
+# <copyright>
+# </copyright>
+#
+# $Id$
+
+pluginName = WorkspaceModel Model
+providerName = www.example.org
+_UI_CreateChild_text = {0}
+_UI_CreateChild_text2 = {1} {0}
+_UI_CreateChild_text3 = {1}
+_UI_CreateChild_tooltip = Create New {0} Under {1} Feature
+_UI_CreateChild_description = Create a new child of type {0} for the {1} feature of the selected {2}.
+_UI_CreateSibling_description = Create a new sibling of type {0} for the selected {2}, under the {1} feature of their parent.
+_UI_PropertyDescriptor_description = The {0} of the {1}
+_UI_ECPWorkspace_type = ECP Workspace
+_UI_ECPProject_type = ECP Project
+_UI_Unknown_type = Object
+_UI_Unknown_datatype= Value
+_UI_Unknown_feature = Unspecified
+_UI_ECPWorkspace_projects_feature = Projects
+_UI_ECPWorkspace_activeProject_feature = Active Project
+_UI_ECPProject_workspace_feature = Workspace
+_UI_ECPProject_rootObject_feature = Root Object
diff --git a/old/org.eclipse.emf.ecp.navigator/plugin.xml b/old/org.eclipse.emf.ecp.navigator/plugin.xml
new file mode 100644
index 0000000..c6db5d0
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.navigator/plugin.xml
@@ -0,0 +1,228 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+<plugin>
+
+ <extension-point id="org.eclipse.emf.ecp.navigator.menuconfiguration" name="Menu Configuration" schema="schema/org.eclipse.emf.ecp.navigator.menuconfiguration.exsd"/>
+ <extension-point id="org.eclipse.emf.ecp.navigator.replaceContentProvider" name="Replace Content Provider" schema="schema/org.eclipse.emf.ecp.navigator.replaceContentProvider.exsd"/>
+ <extension-point id="org.eclipse.emf.ecp.navigator.replaceLabelProvider" name="Replace Label Provider" schema="schema/org.eclipse.emf.ecp.navigator.replaceLabelProvider.exsd"/>
+
+ <extension
+ point="org.eclipse.ui.views">
+ <view
+ category="org.eclipse.emf.ecp"
+ class="org.eclipse.emf.ecp.navigator.TreeView"
+ icon="icons/unicase.png"
+ id="org.eclipse.emf.ecp.navigator.viewer"
+ name="Navigator"
+ restorable="true">
+ </view>
+ </extension>
+
+ <extension
+ point="org.eclipse.ui.commands">
+ <category
+ id="org.eclipse.emf.ecp.navigator.project"
+ name="Project and Model Element Commands">
+ </category>
+ </extension>
+ <extension
+ point="org.eclipse.ui.menus">
+ <menuContribution
+ locationURI="popup:org.eclipse.emf.ecp.navigator.viewer?after=additions">
+ <dynamic
+ class="org.eclipse.emf.ecp.navigator.commands.DynamicContainmentCommands"
+ id="org.eclipse.emf.ecp.navigator.dynamicMECreationCommands">
+ <visibleWhen
+ checkEnabled="false">
+ <and>
+ <iterate
+ ifEmpty="false"
+ operator="and">
+ <or>
+
+ <instanceof
+ value="org.eclipse.emf.ecore.EObject">
+ </instanceof>
+ <test
+ args="ContainmentCreationActions"
+ forcePluginActivation="true"
+ property="org.eclipse.emf.ecp.navigator.isActionEnabled"
+ value="true">
+ </test>
+ </or>
+ </iterate>
+ <count
+ value="1">
+ </count>
+ <test
+ args="org.eclipse.emf.ecp.navigator.dynamicMECreationCommands"
+ property="org.eclipse.emf.ecp.common.menuContributionsEnablement"
+ value="true">
+ </test>
+ </and>
+ </visibleWhen>
+ </dynamic>
+ </menuContribution>
+ <menuContribution
+ locationURI="popup:org.eclipse.emf.ecp.navigator.viewer?after=additions">
+ <command
+ commandId="org.eclipse.emf.ecp.navigator.exportModel"
+ icon="icons/database_go.png"
+ label="Export Model Element"
+ style="push">
+ <visibleWhen
+ checkEnabled="false">
+ <and>
+ <iterate>
+ <and>
+ <instanceof
+ value="org.eclipse.emf.ecore.EObject">
+ </instanceof>
+ <test
+ args="org.eclipse.emf.ecp.navigator.exportModel"
+ property="org.eclipse.emf.ecp.common.menuContributionsEnablement"
+ value="true">
+ </test>
+
+ </and>
+ </iterate>
+ <test
+ args="org.eclipse.emf.ecp.navigator.exportModel"
+ property="org.eclipse.emf.ecp.common.menuContributionsEnablement"
+ value="true">
+ </test>
+ </and>
+ </visibleWhen>
+ </command>
+ <command
+ commandId="org.eclipse.emf.ecp.navigator.importModel"
+ icon="icons/folder_go.png"
+ label="Import Model Element"
+ style="push">
+ <visibleWhen
+ checkEnabled="false">
+ <and>
+ <iterate>
+ <and>
+ <instanceof
+ value="org.eclipse.emf.ecore.EObject">
+ </instanceof>
+ <test
+ args="org.eclipse.emf.ecp.navigator.importModel"
+ property="org.eclipse.emf.ecp.common.menuContributionsEnablement"
+ value="true">
+ </test>
+ </and>
+ </iterate>
+ <test
+ args="org.eclipse.emf.ecp.navigator.importModel"
+ property="org.eclipse.emf.ecp.common.menuContributionsEnablement"
+ value="true">
+ </test>
+ </and>
+ </visibleWhen>
+ </command>
+ <separator
+ name="org.eclipse.emf.ecp.navigator.exportImportSeperator"
+ visible="true">
+ </separator>
+ </menuContribution>
+ <menuContribution
+ locationURI="toolbar:org.eclipse.emf.ecp.navigator.viewer?before=additions">
+ <command
+ commandId="org.eclipse.emf.ecp.common.handlers.open_me_ID"
+ icon="icons/magnifier.png"
+ id="SearchElementButon"
+ style="push"
+ tooltip="Search for model element">
+ <visibleWhen
+ checkEnabled="false">
+ <and>
+ <iterate>
+ <and>
+ <instanceof
+ value="org.eclipse.emf.ecore.EObject">
+ </instanceof>
+ <test
+ args="org.eclipse.emf.ecp.navigator.importModel"
+ property="org.eclipse.emf.ecp.common.menuContributionsEnablement"
+ value="true">
+ </test>
+ </and>
+ </iterate>
+ <test
+ args="org.eclipse.emf.ecp.common.handlers.open_me_ID"
+ property="org.eclipse.emf.ecp.common.menuContributionsEnablement"
+ value="true">
+ </test>
+ </and>
+ </visibleWhen>
+ </command>
+ </menuContribution>
+ </extension>
+ <extension
+ point="org.eclipse.ui.commands">
+ <command
+ categoryId="org.eclipse.emf.ecp.navigator"
+ defaultHandler="org.eclipse.emf.ecp.navigator.handler.DeleteModelelementHandler"
+ id="org.eclipse.emf.ecp.common.deleteModelelement"
+ name="Delete Modelelement">
+ </command>
+ <command
+ categoryId="org.eclipse.emf.ecp.navigator"
+ defaultHandler="org.eclipse.emf.ecp.navigator.handler.NewModelElementWizardHandler"
+ id="org.eclipse.emf.ecp.navigator.newModelElementWizard"
+ name="New ModelElement Wizard">
+ <commandParameter
+ id="org.eclipse.emf.ecp.navigator.eClassParameter"
+ name="eClassParameter"
+ optional="true"
+ typeId="org.eclipse.emf.ecp.navigator.eClassType">
+ </commandParameter>
+ </command>
+ <command
+ defaultHandler="org.eclipse.emf.ecp.common.handler.CreateContainmentHandler"
+ description="This generic command is used by dynamic commands to create containment MEs"
+ id="org.eclipse.emf.ecp.navigator.createContaiment"
+ name="New Containment ME">
+ <commandParameter
+ id="org.eclipse.emf.ecp.navigator.eClassParameter"
+ name="eClassParameter"
+ optional="true"
+ typeId="org.eclipse.emf.ecp.navigator.eClassType">
+ </commandParameter>
+ <commandParameter
+ id="org.eclipse.emf.ecp.navigator.eReferenceParameter"
+ name="eReferenceParameter"
+ optional="true"
+ typeId="org.eclipse.emf.ecp.navigator.eReferenceType">
+ </commandParameter>
+
+ </command>
+ <command
+ defaultHandler="org.eclipse.emf.ecp.navigator.handler.ImportModelHandler"
+ id="org.eclipse.emf.ecp.navigator.importModel"
+ name="Import model">
+ </command>
+ <category
+ id="org.eclipse.emf.ecp.navigator"
+ name="Navigator">
+ </category>
+ <commandParameterType
+ converter="org.eclipse.emf.ecp.navigator.commands.EClassTypeConverter"
+ id="org.eclipse.emf.ecp.navigator.eClassType"
+ type="org.eclipse.emf.ecore.EClass">
+ </commandParameterType>
+ <command
+ defaultHandler="org.eclipse.emf.ecp.navigator.handler.ExportModelHandler"
+ id="org.eclipse.emf.ecp.navigator.exportModel"
+ name="Export model">
+ </command>
+ <commandParameterType
+ converter="org.eclipse.emf.ecp.navigator.commands.EReferenceTypeConverter"
+ id="org.eclipse.emf.ecp.navigator.eReferenceType"
+ type="java.lang.String">
+ </commandParameterType>
+
+ </extension>
+</plugin>
diff --git a/old/org.eclipse.emf.ecp.navigator/pom.xml b/old/org.eclipse.emf.ecp.navigator/pom.xml
new file mode 100644
index 0000000..9c0760a
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.navigator/pom.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.eclipse.emf.emfstore</groupId>
+ <artifactId>emfstore-parent</artifactId>
+ <version>0.9.3-SNAPSHOT</version>
+ <relativePath>../../org.eclipse.emf.emfstore.releng/emfstore-parent/</relativePath>
+ </parent>
+ <groupId>org.eclipse.emf.emfstore</groupId>
+ <artifactId>org.eclipse.emf.ecp.navigator</artifactId>
+ <version>0.9.3-SNAPSHOT</version>
+ <packaging>eclipse-plugin</packaging>
+</project>
diff --git a/old/org.eclipse.emf.ecp.navigator/schema/org.eclipse.emf.ecp.navigator.menuconfiguration.exsd b/old/org.eclipse.emf.ecp.navigator/schema/org.eclipse.emf.ecp.navigator.menuconfiguration.exsd
new file mode 100644
index 0000000..eca87b2
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.navigator/schema/org.eclipse.emf.ecp.navigator.menuconfiguration.exsd
@@ -0,0 +1,86 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- Schema file written by PDE -->
+<schema targetNamespace="org.eclipse.emf.ecp.navigator" xmlns="http://www.w3.org/2001/XMLSchema">
+<annotation>
+ <appinfo>
+ <meta.schema plugin="org.eclipse.emf.ecp.navigator" id="org.eclipse.emf.ecp.navigator.menuconfiguration" name="Menu Configuration"/>
+ </appinfo>
+ <documentation>
+ Allows to configure the menu contributions of the navigator. Unwanted contributions can be disabled.
+ </documentation>
+ </annotation>
+
+ <element name="extension">
+ <annotation>
+ <appinfo>
+ <meta.element />
+ </appinfo>
+ </annotation>
+ <complexType>
+ <choice>
+ <element ref="ContainmentCreationActions"/>
+ </choice>
+ <attribute name="point" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="id" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="name" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appinfo>
+ <meta.attribute translatable="true"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="ContainmentCreationActions">
+ <complexType>
+ <attribute name="enabled" type="boolean" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="since"/>
+ </appinfo>
+ <documentation>
+ 0.4.3.internal
+ </documentation>
+ </annotation>
+
+
+
+
+ <annotation>
+ <appinfo>
+ <meta.section type="copyright"/>
+ </appinfo>
+ <documentation>
+ Copyright (c) 2010 Jonas Helming, Maximilian Koegel. 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
+ </documentation>
+ </annotation>
+
+</schema>
diff --git a/old/org.eclipse.emf.ecp.navigator/schema/org.eclipse.emf.ecp.navigator.replaceContentProvider.exsd b/old/org.eclipse.emf.ecp.navigator/schema/org.eclipse.emf.ecp.navigator.replaceContentProvider.exsd
new file mode 100644
index 0000000..8633377
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.navigator/schema/org.eclipse.emf.ecp.navigator.replaceContentProvider.exsd
@@ -0,0 +1,112 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- Schema file written by PDE -->
+<schema targetNamespace="org.eclipse.emf.ecp.navigator" xmlns="http://www.w3.org/2001/XMLSchema">
+<annotation>
+ <appinfo>
+ <meta.schema plugin="org.eclipse.emf.ecp.navigator" id="org.eclipse.emf.ecp.navigator.replaceContentProvider" name="Replace Content Provider"/>
+ </appinfo>
+ <documentation>
+ Replaces a content provider for the navigator
+ </documentation>
+ </annotation>
+
+ <element name="extension">
+ <annotation>
+ <appinfo>
+ <meta.element />
+ </appinfo>
+ </annotation>
+ <complexType>
+ <sequence>
+ <element ref="ContentProvider"/>
+ </sequence>
+ <attribute name="point" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="id" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="name" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appinfo>
+ <meta.attribute translatable="true"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="ContentProvider">
+ <complexType>
+ <attribute name="class" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appinfo>
+ <meta.attribute kind="java" basedOn=":org.eclipse.emf.ecp.navigator.ContentProvider"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ <attribute name="type" type="string" use="required">
+ <annotation>
+ <documentation>
+ The type for which the conten provider is replaced
+ </documentation>
+ <appinfo>
+ <meta.attribute kind="java" basedOn=":org.eclipse.emf.ecore.EObject"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="since"/>
+ </appinfo>
+ <documentation>
+ [Enter the first release in which this extension point appears.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="examples"/>
+ </appinfo>
+ <documentation>
+ [Enter extension point usage example here.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="apiinfo"/>
+ </appinfo>
+ <documentation>
+ [Enter API information here.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="implementation"/>
+ </appinfo>
+ <documentation>
+ [Enter information about supplied implementation of this extension point.]
+ </documentation>
+ </annotation>
+
+
+</schema>
diff --git a/old/org.eclipse.emf.ecp.navigator/schema/org.eclipse.emf.ecp.navigator.replaceLabelProvider.exsd b/old/org.eclipse.emf.ecp.navigator/schema/org.eclipse.emf.ecp.navigator.replaceLabelProvider.exsd
new file mode 100644
index 0000000..bf5b772
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.navigator/schema/org.eclipse.emf.ecp.navigator.replaceLabelProvider.exsd
@@ -0,0 +1,102 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- Schema file written by PDE -->
+<schema targetNamespace="org.eclipse.emf.ecp.navigator" xmlns="http://www.w3.org/2001/XMLSchema">
+<annotation>
+ <appinfo>
+ <meta.schema plugin="org.eclipse.emf.ecp.navigator" id="replaceLabelProvider" name="Replace Label Provider"/>
+ </appinfo>
+ <documentation>
+ Replaces the label provider for the navigator. If two or more replacements for the label providers are provided, the first one will be used.
+ </documentation>
+ </annotation>
+
+ <element name="extension">
+ <annotation>
+ <appinfo>
+ <meta.element />
+ </appinfo>
+ </annotation>
+ <complexType>
+ <sequence>
+ <element ref="LabelProvider"/>
+ </sequence>
+ <attribute name="point" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="id" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="name" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appinfo>
+ <meta.attribute translatable="true"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="LabelProvider">
+ <complexType>
+ <attribute name="class" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appinfo>
+ <meta.attribute kind="java" basedOn=":org.eclipse.jface.viewers.IBaseLabelProvider"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="since"/>
+ </appinfo>
+ <documentation>
+ [Enter the first release in which this extension point appears.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="examples"/>
+ </appinfo>
+ <documentation>
+ [Enter extension point usage example here.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="apiinfo"/>
+ </appinfo>
+ <documentation>
+ [Enter API information here.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="implementation"/>
+ </appinfo>
+ <documentation>
+ [Enter information about supplied implementation of this extension point.]
+ </documentation>
+ </annotation>
+
+
+</schema>
diff --git a/old/org.eclipse.emf.ecp.navigator/src/org/eclipse/emf/ecp/navigator/Activator.java b/old/org.eclipse.emf.ecp.navigator/src/org/eclipse/emf/ecp/navigator/Activator.java
new file mode 100644
index 0000000..11d5d84
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.navigator/src/org/eclipse/emf/ecp/navigator/Activator.java
@@ -0,0 +1,82 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2011 Chair for Applied Software Engineering,
+ * Technische Universitaet Muenchen.
+ * 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:
+ ******************************************************************************/
+package org.eclipse.emf.ecp.navigator;
+
+import org.eclipse.emf.ecp.common.util.AbstractECPPlugin;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle.
+ */
+public class Activator extends AbstractECPPlugin {
+
+ /**
+ * The plug-in ID.
+ */
+ public static final String PLUGIN_ID = "org.eclipse.emf.ecp.navigator";
+
+ // The shared instance
+ private static Activator plugin;
+
+ /**
+ * The constructor.
+ */
+ public Activator() {
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+ */
+ @Override
+ // BEGIN SUPRESS CATCH EXCEPTION
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ plugin = this;
+ }
+
+ // END SUPRESS CATCH EXCEPTION
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+ */
+ @Override
+ // BEGIN SUPRESS CATCH EXCEPTION
+ public void stop(BundleContext context) throws Exception {
+ plugin = null;
+ super.stop(context);
+ }
+
+ // END SUPRESS CATCH EXCEPTION
+
+ /**
+ * Returns the shared instance.
+ *
+ * @return the shared instance
+ */
+ public static Activator getDefault() {
+ return plugin;
+ }
+
+ /**
+ * Returns an image descriptor for the image file at the given. plug-in relative path
+ *
+ * @param path the path
+ * @return the image descriptor
+ */
+ public static ImageDescriptor getImageDescriptor(String path) {
+ return imageDescriptorFromPlugin(PLUGIN_ID, path);
+ }
+}
\ No newline at end of file
diff --git a/old/org.eclipse.emf.ecp.navigator/src/org/eclipse/emf/ecp/navigator/ContentProvider.java b/old/org.eclipse.emf.ecp.navigator/src/org/eclipse/emf/ecp/navigator/ContentProvider.java
new file mode 100644
index 0000000..1a29985
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.navigator/src/org/eclipse/emf/ecp/navigator/ContentProvider.java
@@ -0,0 +1,38 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2011 Chair for Applied Software Engineering,
+ * Technische Universitaet Muenchen.
+ * 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:
+ ******************************************************************************/
+package org.eclipse.emf.ecp.navigator;
+
+import java.util.Collection;
+
+import org.eclipse.emf.ecore.EObject;
+
+/**
+ * Replacement for the project space provider. Influences the root level of the navigator.
+ *
+ * @author helming
+ */
+public interface ContentProvider {
+ /**
+ * if the root object has children.
+ *
+ * @param rootObject the project space
+ * @return i it has children
+ */
+ boolean hasChildren(EObject rootObject);
+
+ /**
+ * Returns the children of a root object.
+ *
+ * @param rootObject The root object
+ * @return the children
+ */
+ Collection<?> getChildren(EObject rootObject);
+}
\ No newline at end of file
diff --git a/old/org.eclipse.emf.ecp.navigator/src/org/eclipse/emf/ecp/navigator/TreeContentProvider.java b/old/org.eclipse.emf.ecp.navigator/src/org/eclipse/emf/ecp/navigator/TreeContentProvider.java
new file mode 100644
index 0000000..e5968d4
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.navigator/src/org/eclipse/emf/ecp/navigator/TreeContentProvider.java
@@ -0,0 +1,159 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2011 Chair for Applied Software Engineering,
+ * Technische Universitaet Muenchen.
+ * 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:
+ ******************************************************************************/
+package org.eclipse.emf.ecp.navigator;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.LinkedList;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecp.common.model.ECPModelelementContext;
+import org.eclipse.emf.ecp.common.model.ECPWorkspaceManager;
+import org.eclipse.emf.ecp.common.model.NoWorkspaceException;
+import org.eclipse.emf.edit.provider.ComposedAdapterFactory;
+import org.eclipse.emf.edit.provider.DelegatingWrapperItemProvider;
+import org.eclipse.emf.edit.ui.provider.AdapterFactoryContentProvider;
+
+/**
+ * Transactional and composed content provider with all registered label providers.
+ *
+ * @author helming
+ */
+public class TreeContentProvider extends AdapterFactoryContentProvider {
+
+ private HashMap<String, ContentProvider> contentProviders = new HashMap<String, ContentProvider>();
+
+ /**
+ * Directly Transfer to project. {@inheritDoc}
+ *
+ * @see org.eclipse.emf.transaction.ui.provider.TransactionalAdapterFactoryContentProvider#getChildren(java.lang.Object)
+ */
+ @Override
+ public Object[] getChildren(Object object) {
+ String className = object.getClass().getCanonicalName();
+ ContentProvider replaceContentProvider = contentProviders.get(className);
+ Object[] preResult;
+ if (replaceContentProvider != null) {
+ preResult = replaceContentProvider.getChildren((EObject) object).toArray();
+ } else {
+ preResult = super.getChildren(object);
+ }
+ ECPModelelementContext context;
+ try {
+ context = ECPWorkspaceManager.getInstance().getWorkSpace().getActiveProject();
+ if (context == null) {
+ return preResult;
+ }
+ } catch (NoWorkspaceException e) {
+ Activator.getDefault().logException(e.getMessage(), e);
+ return preResult;
+ }
+
+ // this removes all AssociationClass's from the result
+ LinkedList<Object> result = new LinkedList<Object>();
+ for (Object item : preResult) {
+ if (!(item instanceof EObject && context.getMetaModelElementContext().isAssociationClassElement(
+ (EObject) item))
+ && !(item instanceof DelegatingWrapperItemProvider && context.getMetaModelElementContext()
+ .isAssociationClassElement((EObject) ((DelegatingWrapperItemProvider) item).getValue()))) {
+ result.add(item);
+ }
+ }
+ return result.toArray();
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.transaction.ui.provider.TransactionalAdapterFactoryContentProvider#hasChildren(java.lang.Object)
+ */
+ @Override
+ public boolean hasChildren(Object object) {
+ ECPModelelementContext context;
+ try {
+ context = ECPWorkspaceManager.getInstance().getWorkSpace().getActiveProject();
+ if (context == null) {
+ return super.hasChildren(object);
+ }
+ } catch (NoWorkspaceException e) {
+ Activator.getDefault().logException(e.getMessage(), e);
+ // if an exception is caught return the not modified result
+ return super.hasChildren(object);
+ }
+ EObject eObject = null;
+ if (object instanceof DelegatingWrapperItemProvider) {
+ eObject = (EObject) ((DelegatingWrapperItemProvider) object).getValue();
+ } else if (object instanceof EObject) {
+ eObject = (EObject) object;
+ }
+ if (eObject == null || eObject.eContents().isEmpty()) {
+ return super.hasChildren(object);
+ }
+ for (EObject child : eObject.eContents()) {
+ if (!context.getMetaModelElementContext().isAssociationClassElement(child)) {
+ return super.hasChildren(object);
+ }
+ }
+ return false;
+ }
+
+ /**
+ * Default constructor.
+ */
+ public TreeContentProvider() {
+ super(new ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry.INSTANCE));
+ IConfigurationElement[] confs = Platform.getExtensionRegistry().getConfigurationElementsFor(
+ "org.eclipse.emf.ecp.navigator.replaceContentProvider");
+ ArrayList<IConfigurationElement> list = new ArrayList<IConfigurationElement>();
+ list.addAll(Arrays.asList(confs));
+ for (IConfigurationElement element : list) {
+ String attribute = element.getAttribute("type");
+ if (contentProviders.get(attribute) != null) {
+ Exception exception = new IllegalStateException("Duplicate RootObjectContent Provider registered");
+ Activator.getDefault().logException(exception.getMessage(), exception);
+ continue;
+ }
+ try {
+ ContentProvider contentProvider = (ContentProvider) element.createExecutableExtension("class");
+ contentProviders.put(attribute, contentProvider);
+
+ } catch (CoreException e) {
+ Activator.getDefault().logException(e.getMessage(), e);
+ }
+
+ }
+
+ }
+
+ // /**
+ // * {@inheritDoc}
+ // *
+ // * @see
+ // org.eclipse.emf.transaction.ui.provider.TransactionalAdapterFactoryContentProvider#getElements(java.lang.Object)
+ // */
+ // @Override
+ // public Object[] getElements(Object object) {
+ // ArrayList<EObject> ret = new ArrayList<EObject>();
+ // if (object instanceof ECPWorkspace) {
+ // ECPWorkspace ecpWorkspace = (ECPWorkspace) object;
+ // EList<ECPProject> projects = ecpWorkspace.getProjects();
+ // for (ECPProject project : projects) {
+ // ret.add(project.getRootObject());
+ // }
+ // }
+ // return ret.toArray();
+ // }
+
+}
\ No newline at end of file
diff --git a/old/org.eclipse.emf.ecp.navigator/src/org/eclipse/emf/ecp/navigator/TreeLabelProvider.java b/old/org.eclipse.emf.ecp.navigator/src/org/eclipse/emf/ecp/navigator/TreeLabelProvider.java
new file mode 100644
index 0000000..63604ba
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.navigator/src/org/eclipse/emf/ecp/navigator/TreeLabelProvider.java
@@ -0,0 +1,86 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2011 Chair for Applied Software Engineering,
+ * Technische Universitaet Muenchen.
+ * 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:
+ ******************************************************************************/
+package org.eclipse.emf.ecp.navigator;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.emf.edit.provider.ComposedAdapterFactory;
+import org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider;
+import org.eclipse.jface.viewers.DecoratingLabelProvider;
+import org.eclipse.jface.viewers.IBaseLabelProvider;
+import org.eclipse.jface.viewers.ILabelProvider;
+import org.eclipse.ui.PlatformUI;
+
+/**
+ * Composed Label provider with all registered label providers.
+ *
+ * @author helming
+ * @author emueller
+ */
+public class TreeLabelProvider {
+
+ private ILabelProvider defaultLabelProvider;
+ private IBaseLabelProvider replacedLabelProvider;
+ private ComposedAdapterFactory adapterFactory;
+
+ /**
+ * Default constructor.
+ */
+ public TreeLabelProvider() {
+ adapterFactory = new ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry.INSTANCE);
+ defaultLabelProvider = new DecoratingLabelProvider(new AdapterFactoryLabelProvider(adapterFactory),
+ PlatformUI.getWorkbench().getDecoratorManager().getLabelDecorator());
+ replaceLabelProvider();
+ }
+
+ private void replaceLabelProvider() {
+
+ IConfigurationElement[] confs = Platform.getExtensionRegistry().getConfigurationElementsFor(
+ "org.eclipse.emf.ecp.navigator.replaceLabelProvider");
+
+ if (confs.length > 1) {
+ Exception exception = new IllegalStateException("Two or more ReplaceLabel Providers registered");
+ Activator.getDefault().logException(exception.getMessage(), exception);
+ } else if (confs.length == 1) {
+ IConfigurationElement element = confs[0];
+
+ try {
+ replacedLabelProvider = (IBaseLabelProvider) element.createExecutableExtension("class");
+ } catch (CoreException e) {
+ Activator.getDefault().logException(e.getMessage(), e);
+ }
+ }
+ }
+
+ /**
+ * Returns the {@link ILabelProvider}. If the default label provider has been replaced, that one
+ * will be returned. If more than one label providers have been registered to replace the default
+ * label provider the first one will be returned.
+ * @return the label provider to be used by the {@link TreeView}
+ */
+ public IBaseLabelProvider getLabelProvider() {
+ if (replacedLabelProvider != null) {
+ return replacedLabelProvider;
+ }
+
+ return defaultLabelProvider;
+ }
+
+ /**
+ * */
+ public void dispose() {
+ if (adapterFactory!=null) {
+ adapterFactory.dispose();
+ }
+
+ }
+}
\ No newline at end of file
diff --git a/old/org.eclipse.emf.ecp.navigator/src/org/eclipse/emf/ecp/navigator/TreeView.java b/old/org.eclipse.emf.ecp.navigator/src/org/eclipse/emf/ecp/navigator/TreeView.java
new file mode 100644
index 0000000..6f06c1d
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.navigator/src/org/eclipse/emf/ecp/navigator/TreeView.java
@@ -0,0 +1,478 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2011 Chair for Applied Software Engineering,
+ * Technische Universitaet Muenchen.
+ * 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:
+ ******************************************************************************/
+package org.eclipse.emf.ecp.navigator;
+
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.notify.impl.AdapterImpl;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecp.common.dnd.ComposedDropAdapter;
+import org.eclipse.emf.ecp.common.dnd.UCDragAdapter;
+import org.eclipse.emf.ecp.common.model.ECPWorkspaceManager;
+import org.eclipse.emf.ecp.common.model.NoWorkspaceException;
+import org.eclipse.emf.ecp.common.model.workSpaceModel.ECPWorkspace;
+import org.eclipse.emf.ecp.common.model.workSpaceModel.WorkSpaceModelPackage;
+import org.eclipse.emf.ecp.navigator.commands.AltKeyDoubleClickAction;
+import org.eclipse.emf.edit.ui.dnd.LocalTransfer;
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.IToolBarManager;
+import org.eclipse.jface.action.MenuManager;
+import org.eclipse.jface.action.Separator;
+import org.eclipse.jface.dialogs.IDialogSettings;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.jface.viewers.TreeNode;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.dnd.DND;
+import org.eclipse.swt.dnd.Transfer;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Menu;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IEditorReference;
+import org.eclipse.ui.IPartListener2;
+import org.eclipse.ui.ISelectionListener;
+import org.eclipse.ui.ISelectionService;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.IWorkbenchPartReference;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.part.ViewPart;
+
+/**
+ * The standard navigator tree view.
+ *
+ * @author helming
+ */
+public class TreeView extends ViewPart implements ISelectionListener { // implements
+ // IShowInSource
+
+ private static TreeViewer viewer;
+ private MenuManager menuMgr;
+
+ private boolean isLinkedWithEditor;
+ private Action linkWithEditor;
+ private PartListener partListener;
+ private ECPWorkspace currentWorkspace;
+ private AdapterImpl workspaceListenerAdapter;
+ private boolean internalSelectionEvent;
+ private TreeLabelProvider labelProvider;
+ private ISelectionService selectionService;
+
+ /**
+ * Constructor.
+ */
+ public TreeView() {
+ try {
+ currentWorkspace = ECPWorkspaceManager.getInstance().getWorkSpace();
+ } catch (NoWorkspaceException e) {
+ Activator.getDefault().logException(e.getMessage(), e);
+ return;
+ }
+
+ workspaceListenerAdapter = new AdapterImpl() {
+
+ @Override
+ public void notifyChanged(Notification msg) {
+ if ((msg.getFeatureID(ECPWorkspace.class)) == WorkSpaceModelPackage.ECP_WORKSPACE__PROJECTS) {
+ if (msg.getEventType() == Notification.ADD
+ && WorkSpaceModelPackage.eINSTANCE.getECPProject().isInstance(msg.getNewValue())) {
+ } else if (msg.getEventType() == Notification.REMOVE
+ && WorkSpaceModelPackage.eINSTANCE.getECPProject().isInstance(msg.getOldValue())) {
+ }
+ }
+ }
+ };
+ currentWorkspace.eAdapters().add(workspaceListenerAdapter);
+
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.ui.part.WorkbenchPart#dispose()
+ */
+ @Override
+ public void dispose() {
+ selectionService.removeSelectionListener(this);
+ getSite().getPage().removePartListener(partListener);
+ currentWorkspace.eAdapters().remove(workspaceListenerAdapter);
+ if (labelProvider != null) {
+ labelProvider.dispose();
+ }
+ super.dispose();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void createPartControl(Composite parent) {
+ viewer = new TreeViewer(parent, SWT.MULTI);
+
+ try {
+ ECPWorkspace workSpace = ECPWorkspaceManager.getInstance().getWorkSpace();
+ labelProvider = new TreeLabelProvider();
+ viewer.setLabelProvider(labelProvider.getLabelProvider());
+ // viewer.setLabelProvider(new TreeLabelProvider());
+ viewer.setContentProvider(new TreeContentProvider());
+ viewer.setUseHashlookup(true);
+ viewer.setInput(workSpace);
+ } catch (NoWorkspaceException e) {
+ // Do not show any content
+ }
+
+ selectionService = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getSelectionService();
+ selectionService.addSelectionListener(this);
+
+ // this is for workaround for update problem in navigator
+ getSite().setSelectionProvider(viewer);
+ partListener = new PartListener();
+
+ menuMgr = new MenuManager();
+ menuMgr.add(new Separator("additions"));
+
+ Control control = viewer.getControl();
+ Menu menu = menuMgr.createContextMenu(control);
+ control.setMenu(menu);
+ getSite().registerContextMenu(menuMgr, viewer);
+ createActions();
+
+ new AltKeyDoubleClickAction(viewer, TreeView.class.getName());
+
+ addDragNDropSupport();
+ addSelectionListener();
+
+ if (viewer.getTree().getItems().length > 0) {
+ setActiveECPProject(viewer.getTree().getItem(0).getData());
+ viewer.getTree().select(viewer.getTree().getItem(0));
+
+ }
+
+ }
+
+ private void createActions() {
+ isLinkedWithEditor = getDialogSettings().getBoolean("LinkWithEditor");
+ if (isLinkedWithEditor) {
+ getSite().getPage().addPartListener(partListener);
+ }
+
+ linkWithEditor = new Action("Link with editor", SWT.TOGGLE) {
+
+ @Override
+ public void run() {
+ if (isLinkedWithEditor) {
+ isLinkedWithEditor = false;
+ getSite().getPage().removePartListener(partListener);
+ } else {
+ isLinkedWithEditor = true;
+ getSite().getPage().addPartListener(partListener);
+ IEditorPart editor = getSite().getPage().getActiveEditor();
+ if (editor != null) {
+ editorActivated(editor);
+ }
+ }
+
+ getDialogSettings().put("LinkWithEditor", this.isChecked());
+ }
+
+ };
+
+ linkWithEditor.setImageDescriptor(Activator.getImageDescriptor("icons/link_with_editor.gif"));
+ linkWithEditor.setToolTipText("Link with editor");
+ linkWithEditor.setChecked(getDialogSettings().getBoolean("LinkWithEditor"));
+
+ IToolBarManager toolBarManager = getViewSite().getActionBars().getToolBarManager();
+ Separator additionsSeperator = new Separator("additions");
+ additionsSeperator.setVisible(true);
+ toolBarManager.add(additionsSeperator);
+ toolBarManager.insertAfter("additions", linkWithEditor);
+
+ }
+
+ private IDialogSettings getDialogSettings() {
+ return Activator.getDefault().getDialogSettings();
+ }
+
+ /**
+ * @param editor editor
+ */
+ public void editorActivated(IEditorPart editor) {
+ Object adapter = editor.getEditorInput().getAdapter(EObject.class);
+ if (adapter != null && adapter instanceof EObject) {
+ EObject me = (EObject) adapter;
+ revealME(me);
+ }
+
+ }
+
+ private void revealME(EObject me) {
+
+ if (me == null) {
+ return;
+ }
+
+ if (TreeView.getTreeViewer().testFindItem(me) == null) {
+ TreeView.getTreeViewer().refresh();
+ }
+
+ TreeView.getTreeViewer().setSelection(new StructuredSelection(me), true);
+
+ }
+
+ private void addSelectionListener() {
+ viewer.addSelectionChangedListener(new ISelectionChangedListener() {
+
+ public void selectionChanged(SelectionChangedEvent event) {
+ if (event.getSelection() instanceof IStructuredSelection) {
+ IStructuredSelection selection = (IStructuredSelection) event.getSelection();
+ Object obj = selection.getFirstElement();
+ setActiveECPProject(obj);
+
+ // activate MEEditor if this obj is already open.
+ if (isLinkedWithEditor && !internalSelectionEvent) {
+ linkWithEditor(obj);
+ }
+
+ }
+ }
+
+ });
+
+ }
+
+ /**
+ * This checks if there is a MEEditor for selected ME open. If so, calls activateEditor to show editor.
+ *
+ * @param selectedME
+ */
+ private void linkWithEditor(Object selectedME) {
+ if (selectedME == null) {
+ return;
+ }
+ if (!(selectedME instanceof EObject)) {
+ return;
+ }
+
+ EObject me = (EObject) selectedME;
+ if (!isEditorOpen(me)) {
+ return;
+ } else {
+ activateEditor(me);
+ }
+ }
+
+ /**
+ * If there is a MEEditor for selected ME open, it shows the editor.
+ *
+ * @param selectedME
+ */
+ private void activateEditor(EObject selectedME) {
+ for (IEditorReference editorRef : getSite().getPage().getEditorReferences()) {
+ Object editorInput = null;
+ try {
+
+ editorInput = editorRef.getEditorInput().getAdapter(EObject.class);
+ } catch (PartInitException e) {
+ e.printStackTrace();
+ }
+ if (selectedME.equals(editorInput)) {
+ getSite().getPage().bringToTop(editorRef.getPart(true));
+ return;
+ }
+ }
+ }
+
+ /**
+ * This checks if selectedME is already open in a MEEditor.
+ *
+ * @param selectedME
+ * @return
+ */
+ private boolean isEditorOpen(EObject selectedME) {
+ for (IEditorReference editorRef : getSite().getPage().getEditorReferences()) {
+ Object editorInput = null;
+ try {
+
+ editorInput = editorRef.getEditorInput().getAdapter(EObject.class);
+ } catch (PartInitException e) {
+ e.printStackTrace();
+ }
+ if (selectedME.equals(editorInput)) {
+ return true;
+ }
+ }
+ return false;
+
+ }
+
+ private void setActiveECPProject(Object obj) {
+ if (obj instanceof EObject) {
+ try {
+ ECPWorkspaceManager.getInstance().getWorkSpace().setActiveModelelement((EObject) obj);
+ } catch (NoWorkspaceException e) {
+ Activator.getDefault().logException(e.getMessage(), e);
+ }
+ }
+
+ }
+
+ private void addDragNDropSupport() {
+ int dndOperations = DND.DROP_COPY | DND.DROP_MOVE | DND.DROP_LINK;
+ Transfer[] transfers = new Transfer[] { LocalTransfer.getInstance() };
+
+ viewer.addDragSupport(dndOperations, transfers, new UCDragAdapter(viewer));
+
+ viewer.addDropSupport(dndOperations, transfers, new ComposedDropAdapter(viewer));
+
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void setFocus() {
+ viewer.getControl().setFocus();
+ menuMgr.update();
+
+ }
+
+ /**
+ * This returns TreeViewer of navigator.
+ *
+ * @return TreeViewer of navigator
+ */
+ public static TreeViewer getTreeViewer() {
+ return viewer;
+ }
+
+ /**
+ * This is a prart listener for navigator. I had to implement it in a separate class, because of check style warning
+ * about anonymous classes greater than 30 lines.
+ *
+ * @author Hodaie
+ */
+ private class PartListener implements IPartListener2 {
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.ui.IPartListener2#partActivated(org.eclipse.ui.IWorkbenchPartReference)
+ */
+ public void partActivated(IWorkbenchPartReference partRef) {
+ if (partRef instanceof IEditorReference) {
+ TreeView.this.editorActivated(((IEditorReference) partRef).getEditor(true));
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.ui.IPartListener2#partBroughtToTop(org.eclipse.ui.IWorkbenchPartReference)
+ */
+ public void partInputChanged(IWorkbenchPartReference partRef) {
+ if (partRef instanceof IEditorReference) {
+ TreeView.this.editorActivated(((IEditorReference) partRef).getEditor(true));
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.ui.IPartListener2#partBroughtToTop(org.eclipse.ui.IWorkbenchPartReference)
+ */
+ public void partBroughtToTop(IWorkbenchPartReference partRef) {
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.ui.IPartListener2#partBroughtToTop(org.eclipse.ui.IWorkbenchPartReference)
+ */
+ public void partClosed(IWorkbenchPartReference partRef) {
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.ui.IPartListener2#partBroughtToTop(org.eclipse.ui.IWorkbenchPartReference)
+ */
+ public void partDeactivated(IWorkbenchPartReference partRef) {
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.ui.IPartListener2#partBroughtToTop(org.eclipse.ui.IWorkbenchPartReference)
+ */
+ public void partHidden(IWorkbenchPartReference partRef) {
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.ui.IPartListener2#partBroughtToTop(org.eclipse.ui.IWorkbenchPartReference)
+ */
+ public void partOpened(IWorkbenchPartReference partRef) {
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.ui.IPartListener2#partBroughtToTop(org.eclipse.ui.IWorkbenchPartReference)
+ */
+ public void partVisible(IWorkbenchPartReference partRef) {
+ }
+
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.ui.ISelectionListener#selectionChanged(org.eclipse.ui.IWorkbenchPart,
+ * org.eclipse.jface.viewers.ISelection)
+ */
+ public void selectionChanged(IWorkbenchPart part, ISelection selection) {
+ if (part == this) {
+ return;
+ }
+ EObject element = extractObjectFromSelection(selection);
+ if (element == null) {
+ return;
+ }
+ revealME(element);
+ }
+
+ private EObject extractObjectFromSelection(ISelection selection) {
+ if (!(selection instanceof IStructuredSelection)) {
+ return null;
+ }
+
+ IStructuredSelection structuredSelection = (IStructuredSelection) selection;
+ if (structuredSelection.size() == 1) {
+ Object node = structuredSelection.getFirstElement();
+ if (node instanceof TreeNode) {
+ Object element = ((TreeNode) node).getValue();
+ if (element instanceof EObject) {
+ return (EObject) element;
+ }
+ } else if (node instanceof EObject) {
+ return (EObject) node;
+ }
+ }
+
+ return null;
+ }
+
+}
\ No newline at end of file
diff --git a/old/org.eclipse.emf.ecp.navigator/src/org/eclipse/emf/ecp/navigator/commands/AltKeyDoubleClickAction.java b/old/org.eclipse.emf.ecp.navigator/src/org/eclipse/emf/ecp/navigator/commands/AltKeyDoubleClickAction.java
new file mode 100644
index 0000000..bcb1b6c
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.navigator/src/org/eclipse/emf/ecp/navigator/commands/AltKeyDoubleClickAction.java
@@ -0,0 +1,172 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2011 Chair for Applied Software Engineering,
+ * Technische Universitaet Muenchen.
+ * 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:
+ ******************************************************************************/
+package org.eclipse.emf.ecp.navigator.commands;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecp.common.util.UiUtil;
+import org.eclipse.emf.ecp.common.utilities.ActionHelper;
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.viewers.ColumnViewer;
+import org.eclipse.jface.viewers.DoubleClickEvent;
+import org.eclipse.jface.viewers.IDoubleClickListener;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.PlatformUI;
+
+/**
+ * listener ActionClass for the DoublclickAction and the ALT Key.
+ *
+ * @author helming .
+ */
+public class AltKeyDoubleClickAction extends Action implements IDoubleClickListener, Listener {
+
+ private ColumnViewer viewer;
+ private boolean isAltKeyPressed;
+ private String classname;
+ private static String meeditorid = "org.eclipse.emf.ecp.editor";
+
+ /**
+ * <pre>
+ * 1- Adds the listener to the collection of listeners who will be notified when
+ * an event of the - given type occurs anywhere in a widget. The event type is (SWT.Alt)
+ * one of the event constants defined in class SWT. When the event does occur, the listener
+ * is notified by sending it the handleEvent() message.
+ * </pre>
+ */
+ public AltKeyDoubleClickAction() {
+
+ PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell().getDisplay().addFilter(SWT.KeyDown, this);
+ }
+
+ /**
+ * <pre>
+ * 1- Adds the listener to the collection of listeners who will be notified when
+ * an event of the - given type occurs anywhere in a widget. The event type is (SWT.Alt)
+ * one of the event constants defined in class SWT. When the event
+ * does occur, the listener is notified by sending it the handleEvent() message.
+ *
+ * </pre>
+ *
+ * @param sourceView the view that requested the open model element.
+ */
+ public AltKeyDoubleClickAction(final String sourceView) {
+ this();
+ this.classname = sourceView;
+
+ }
+
+ /**
+ * <pre>
+ * 1- Adds the listener to the collection of listeners who will be notified when
+ * an event of the - given type occurs anywhere in a widget. The event type is (SWT.Alt)
+ * one of the event constants defined in class SWT. When the event
+ * does occur, the listener is notified by sending it the handleEvent() message.
+ *
+ * 2- Adds a listener for double-clicks in this viewer. Has no effect if an identical
+ * listener is already registered.
+ *
+ * </pre>
+ *
+ * @param viewer ColumnViewer the Viewer of the sourceView.
+ * @param sourceView the view that requested the open model element.
+ */
+ public AltKeyDoubleClickAction(ColumnViewer viewer, final String sourceView) {
+ this(sourceView);
+ this.viewer = viewer;
+ this.viewer.addDoubleClickListener(this);
+ }
+
+ /**
+ * This opens the selected model element.
+ *
+ * @see org.eclipse.jface.action.Action#run()
+ * @see org.eclipse.emf.ecp.navigator.commands.AltKeyDoubleClickAction#openSelectedModelelement()
+ */
+ @Override
+ public void run() {
+ // This method opens a model regardless of a pressed Alt-Key.
+ openSelectedModelelement();
+ }
+
+ /**
+ * This method opens a model regardless of a pressed Alt-Key.
+ */
+ private void openSelectedModelelement() {
+ // the selected Object or null if selection is not an IStructuredSelection
+
+ EObject me = UiUtil.getSelectedModelelement();
+ if (me == null) {
+ return;
+ }
+ if (classname == null || classname.equals("")) {
+ return;
+ }
+ ActionHelper.openModelElement(me, classname);
+ }
+
+ /**
+ * @param event {@link Event}.
+ * @see org.eclipse.swt.widgets.Listener#handleEvent(org.eclipse.swt.widgets.Event)
+ */
+ public void handleEvent(Event event) {
+
+ // check keyCode for Alt.
+ if (event.keyCode == SWT.ALT) {
+ isAltKeyPressed = true;
+ }
+ }
+
+ /**
+ * @param event {@link DoubleClickEvent} .
+ * @see org.eclipse.jface.viewers.IDoubleClickListener#doubleClick (org.eclipse.jface.viewers.DoubleClickEvent).
+ */
+ public void doubleClick(DoubleClickEvent event) {
+ if (isAltKeyPressed) {
+ closeActiveMEEditor();
+ }
+ isAltKeyPressed = false;
+ // open selected modelelment.
+ run();
+
+ }
+
+ /**
+ * this method closes an active MEEditor.
+ */
+ private void closeActiveMEEditor() {
+
+ IWorkbenchWindow workbenchwindow = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
+
+ if (workbenchwindow != null) {
+
+ IWorkbenchPage page = workbenchwindow.getActivePage();
+
+ if (page != null) {
+
+ IEditorPart editor = page.getActiveEditor();
+
+ if (editor != null && editor.getSite().getId().equals(meeditorid)) {
+
+ page.closeEditor(editor, true);
+
+ }
+
+ }
+
+ }
+
+ }
+
+}
\ No newline at end of file
diff --git a/old/org.eclipse.emf.ecp.navigator/src/org/eclipse/emf/ecp/navigator/commands/DynamicContainmentCommands.java b/old/org.eclipse.emf.ecp.navigator/src/org/eclipse/emf/ecp/navigator/commands/DynamicContainmentCommands.java
new file mode 100644
index 0000000..c0db8c0
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.navigator/src/org/eclipse/emf/ecp/navigator/commands/DynamicContainmentCommands.java
@@ -0,0 +1,229 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2011 Chair for Applied Software Engineering,
+ * Technische Universitaet Muenchen.
+ * 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:
+ ******************************************************************************/
+package org.eclipse.emf.ecp.navigator.commands;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EReference;
+import org.eclipse.emf.ecp.common.commands.ECPMenuContributionsEnablementTester;
+import org.eclipse.emf.ecp.common.handler.CreateContainmentHandler;
+import org.eclipse.emf.ecp.common.model.ECPWorkspaceManager;
+import org.eclipse.emf.ecp.common.model.NoWorkspaceException;
+import org.eclipse.emf.ecp.common.model.workSpaceModel.ECPProject;
+import org.eclipse.emf.ecp.common.util.UiUtil;
+import org.eclipse.emf.ecp.navigator.Activator;
+import org.eclipse.emf.ecp.navigator.handler.NewModelElementWizardHandler;
+import org.eclipse.emf.edit.command.CommandParameter;
+import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain;
+import org.eclipse.emf.edit.provider.AdapterFactoryItemDelegator;
+import org.eclipse.emf.edit.provider.ComposedAdapterFactory;
+import org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider;
+import org.eclipse.jface.action.IContributionItem;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.actions.CompoundContributionItem;
+import org.eclipse.ui.menus.CommandContributionItem;
+import org.eclipse.ui.menus.CommandContributionItemParameter;
+
+/**
+ * This class creates a group of commands to create different containments of a
+ * model element through context menu. The created commands have all the same ID
+ * and are handled with the same handler class {@link CreateMEHandler}.
+ *
+ * @author Hodaie
+ */
+public class DynamicContainmentCommands extends CompoundContributionItem {
+
+ private static final String COMMAND_ID = "org.eclipse.emf.ecp.navigator.createContaiment";
+ private EObject selectedME;
+ private ComposedAdapterFactory adapterFactory = new ComposedAdapterFactory(
+ ComposedAdapterFactory.Descriptor.Registry.INSTANCE);
+ private AdapterFactoryLabelProvider labelProvider = new AdapterFactoryLabelProvider(adapterFactory);
+
+ /**
+ * . {@inheritDoc}
+ */
+ @Override
+ protected IContributionItem[] getContributionItems() {
+ // 1. get selected EObject
+ selectedME = UiUtil.getSelectedEObject();
+ if (selectedME == null) {
+ return new IContributionItem[0];
+ }
+ try {
+ if (ECPWorkspaceManager.getInstance().getWorkSpace()
+ .isRootObject(selectedME)) {
+ return createNewWizard(selectedME.eClass());
+ }
+ } catch (NoWorkspaceException e) {
+ Activator.getDefault().logException(e.getMessage(), e);
+ }
+
+ AdapterFactoryItemDelegator delegator = new AdapterFactoryItemDelegator(adapterFactory);
+
+ @SuppressWarnings("unchecked")
+ List<CommandParameter> commandParameters = (List<CommandParameter>) delegator
+ .getNewChildDescriptors(selectedME, AdapterFactoryEditingDomain
+ .getEditingDomainFor(selectedME), null);
+
+ IContributionItem[] commands = createCommands(commandParameters);
+ return commands;
+
+ }
+
+ private IContributionItem[] createNewWizard(EClass eClass) {
+ CommandContributionItemParameter commandParam = new CommandContributionItemParameter(
+ PlatformUI.getWorkbench(), null,
+ "org.eclipse.emf.ecp.navigator.newModelElementWizard",
+ CommandContributionItem.STYLE_PUSH);
+ List<IContributionItem> commands = new ArrayList<IContributionItem>();
+ Map<Object, Object> commandParams = new HashMap<Object, Object>();
+
+ commandParams.put(NewModelElementWizardHandler.COMMAND_ECLASS_PARAM,
+ eClass);
+ commandParam.label = "New Model Element";
+
+ Image image = labelProvider.getImage(eClass);
+ ImageDescriptor imageDescriptor = ImageDescriptor
+ .createFromImage(image);
+ commandParam.icon = imageDescriptor;
+
+ // create command
+ commandParam.parameters = commandParams;
+ CommandContributionItem command = new CommandContributionItem(
+ commandParam);
+ boolean visible=new ECPMenuContributionsEnablementTester().test(null, null, new String[]{"org.eclipse.emf.ecp.navigator.newModelElementWizard"}, true);
+ command.setVisible(visible);
+ commands.add(command);
+
+ return commands.toArray(new IContributionItem[commands.size()]);
+ }
+
+ /**
+ * .
+ *
+ * @param commandParameters
+ * a list of EReference of containments of selected ME
+ * @return an array of IContributionsItem (commands) to create different
+ * types of containments.
+ */
+ private IContributionItem[] createCommands(
+ List<CommandParameter> commandParameters) {
+
+ List<IContributionItem> commands = new ArrayList<IContributionItem>();
+ Map<String, List<CommandParameter>> mapping = new HashMap<String, List<CommandParameter>>();
+ for (CommandParameter commandParameter : commandParameters) {
+ if (commandParameter.getValue() instanceof EObject) {
+ EClass eClass = ((EObject) commandParameter.getValue())
+ .eClass();
+ List<CommandParameter> list = mapping.get(eClass.getName());
+ if (list == null) {
+ list = new ArrayList<CommandParameter>();
+ mapping.put(eClass.getName(), list);
+ }
+ list.add(commandParameter);
+ }
+ }
+ for (String eclass : mapping.keySet()) {
+ List<CommandParameter> list = mapping.get(eclass);
+ boolean showReferenceLable = (list.size() > 1);
+ for (CommandParameter commandParameter : list) {
+ EReference containment = commandParameter.getEReference();
+
+ if (!containment.isMany()) {
+ if (selectedME.eGet(containment) != null) {
+ continue;
+ }
+ }
+
+ ECPProject project = null;
+
+ try {
+ project = ECPWorkspaceManager.getInstance().getWorkSpace().getProject(selectedME);
+ if (project != null && project.getMetaModelElementContext().isNonDomainElement(containment.getEReferenceType())) {
+ continue;
+ }
+ } catch (NoWorkspaceException e) {
+ Activator.getDefault().logException(e.getMessage(), e);
+ }
+
+ CommandContributionItemParameter commandParam = new CommandContributionItemParameter(
+ PlatformUI.getWorkbench(), null, COMMAND_ID,
+ CommandContributionItem.STYLE_PUSH);
+
+ Map<Object, Object> commandParams = new HashMap<Object, Object>();
+
+ Object type = commandParameter.getValue();
+ if (type instanceof EObject) {
+
+ EClass typeClass = ((EObject) type).eClass();
+ if (project != null && project.getMetaModelElementContext().isNonDomainElement(typeClass)) {
+ continue;
+ }
+
+ commandParams.put(
+ CreateContainmentHandler.COMMAND_ECLASS_PARAM, typeClass);
+ commandParams.put(
+ CreateContainmentHandler.COMMAND_EREFERENCE_PARAM,
+ containment.getName());
+ commandParam.label = "New "
+ + ((EObject) type).eClass().getName();
+ if (showReferenceLable) {
+ commandParam.label = commandParam.label + " ("
+ + containment.getName() + ")";
+ }
+ commandParam.icon = getImage(((EObject) type).eClass());
+ } else {
+ commandParams.put(
+ CreateContainmentHandler.COMMAND_ECLASS_PARAM,
+ containment.getEReferenceType());
+ commandParam.label = "New "
+ + containment.getEReferenceType().getName();
+ commandParam.icon = getImage(containment
+ .getEReferenceType());
+
+ }
+
+ // create command
+ commandParam.parameters = commandParams;
+ CommandContributionItem command = new CommandContributionItem(
+ commandParam);
+ commands.add(command);
+ }
+
+ }
+ return commands.toArray(new IContributionItem[commands.size()]);
+ }
+
+ private ImageDescriptor getImage(EClass eClass) {
+ EObject instance = eClass.getEPackage().getEFactoryInstance()
+ .create(eClass);
+ Image image = labelProvider.getImage(instance);
+ ImageDescriptor imageDescriptor = ImageDescriptor
+ .createFromImage(image);
+ return imageDescriptor;
+ }
+
+ @Override
+ public void dispose() {
+ if (adapterFactory!=null) {
+ adapterFactory.dispose();
+ }
+ super.dispose();
+ }
+
+}
\ No newline at end of file
diff --git a/old/org.eclipse.emf.ecp.navigator/src/org/eclipse/emf/ecp/navigator/commands/EClassTypeConverter.java b/old/org.eclipse.emf.ecp.navigator/src/org/eclipse/emf/ecp/navigator/commands/EClassTypeConverter.java
new file mode 100644
index 0000000..0ab996e
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.navigator/src/org/eclipse/emf/ecp/navigator/commands/EClassTypeConverter.java
@@ -0,0 +1,63 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2011 Chair for Applied Software Engineering,
+ * Technische Universitaet Muenchen.
+ * 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:
+ ******************************************************************************/
+package org.eclipse.emf.ecp.navigator.commands;
+
+import org.eclipse.core.commands.AbstractParameterValueConverter;
+import org.eclipse.core.commands.ParameterValueConversionException;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EPackage;
+
+/**
+ * @author Hodaie This is the converter for EClass parameter passed to createME command
+ * (org.eclipse.emf.ecp.navigator.createME).
+ */
+public class EClassTypeConverter extends AbstractParameterValueConverter {
+
+ /**
+ * . {@inheritDoc} This creates the EClass object back from its string representation.
+ */
+ @Override
+ public Object convertToObject(String parameterValue) throws ParameterValueConversionException {
+
+ String[] parts = parameterValue.split(";");
+ String nsURI = parts[0];
+ String name = parts[1];
+
+ EPackage ePackage = EPackage.Registry.INSTANCE.getEPackage(nsURI);
+ EClass eClass = (EClass) ePackage.getEClassifier(name);
+
+ return eClass;
+
+ }
+
+ /**
+ * . ({@inheritDoc}) This creates a string representation of EClass object to put it in command parameters map.
+ */
+ @Override
+ public String convertToString(Object parameterValue) throws ParameterValueConversionException {
+ // We need and string representation of an EClass that can be
+ // turned back to an EClass object.
+ // It was tested with serialization method MRIUtil but
+ // it has the problem that referenced of this EClass instance are not
+ // serialized and we needed them.
+
+ // I found out that all i need to create an EClass instance
+ // is the NsURI of its package and its name.
+ if (parameterValue instanceof EClass) {
+
+ EClass eClass = (EClass) parameterValue;
+ return eClass.getEPackage().getNsURI() + ";" + eClass.getName();
+ } else {
+ return null;
+ }
+ }
+
+}
\ No newline at end of file
diff --git a/old/org.eclipse.emf.ecp.navigator/src/org/eclipse/emf/ecp/navigator/commands/EReferenceTypeConverter.java b/old/org.eclipse.emf.ecp.navigator/src/org/eclipse/emf/ecp/navigator/commands/EReferenceTypeConverter.java
new file mode 100644
index 0000000..bc35fdd
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.navigator/src/org/eclipse/emf/ecp/navigator/commands/EReferenceTypeConverter.java
@@ -0,0 +1,51 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2011 Chair for Applied Software Engineering,
+ * Technische Universitaet Muenchen.
+ * 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:
+ ******************************************************************************/
+package org.eclipse.emf.ecp.navigator.commands;
+
+import org.eclipse.core.commands.AbstractParameterValueConverter;
+import org.eclipse.core.commands.ParameterValueConversionException;
+
+/**
+ * Converts a reference to a string.
+ * @author Jonas Helming
+ *
+ */
+public class EReferenceTypeConverter extends AbstractParameterValueConverter {
+
+
+
+ /**
+ * {@inheritDoc}
+ * @see org.eclipse.core.commands.AbstractParameterValueConverter#convertToObject(java.lang.String)
+ */
+ @Override
+ public Object convertToObject(String parameterValue) throws ParameterValueConversionException {
+ return parameterValue;
+
+ }
+
+
+ /**
+ * {@inheritDoc}
+ * @see org.eclipse.core.commands.AbstractParameterValueConverter#convertToString(java.lang.Object)
+ */
+ @Override
+ public String convertToString(Object parameterValue) throws ParameterValueConversionException {
+ // We need and string representation of an EClass that can be
+ // turned back to an EClass object.
+ // It was tested with serialization method MRIUtil but
+ // it has the problem that referenced of this EClass instance are not
+ // serialized and we needed them.
+
+ return (String) parameterValue;
+ }
+
+}
\ No newline at end of file
diff --git a/old/org.eclipse.emf.ecp.navigator/src/org/eclipse/emf/ecp/navigator/handler/DeleteModelelementHandler.java b/old/org.eclipse.emf.ecp.navigator/src/org/eclipse/emf/ecp/navigator/handler/DeleteModelelementHandler.java
new file mode 100644
index 0000000..f466eed
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.navigator/src/org/eclipse/emf/ecp/navigator/handler/DeleteModelelementHandler.java
@@ -0,0 +1,52 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2011 Chair for Applied Software Engineering,
+ * Technische Universitaet Muenchen.
+ * 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:
+ ******************************************************************************/
+package org.eclipse.emf.ecp.navigator.handler;
+
+import java.util.Set;
+
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecp.common.commands.DeleteModelElementCommand;
+import org.eclipse.emf.ecp.common.model.ECPWorkspaceManager;
+import org.eclipse.emf.ecp.common.model.NoWorkspaceException;
+import org.eclipse.emf.ecp.common.util.UiUtil;
+import org.eclipse.emf.ecp.navigator.Activator;
+
+/**
+ * . This is the Handler to delete a ModelElement
+ *
+ * @author Helming
+ */
+public class DeleteModelelementHandler extends AbstractHandler {
+
+ /**
+ * . {@inheritDoc}
+ */
+ public Object execute(ExecutionEvent event) throws ExecutionException {
+ Set<EObject> eObjects = UiUtil.getSelectedEObjects(event);
+ if (!eObjects.isEmpty()) {
+ deleteModelElement(eObjects);
+ }
+ return null;
+ }
+
+ private void deleteModelElement(final Set<EObject> eObjects) {
+ try {
+ new DeleteModelElementCommand(eObjects, ECPWorkspaceManager.getInstance().getWorkSpace()
+ .getProject(eObjects.iterator().next())).run();
+ } catch (NoWorkspaceException e) {
+ Activator.getDefault().logException(e.getMessage(), e);
+ }
+ }
+
+}
\ No newline at end of file
diff --git a/old/org.eclipse.emf.ecp.navigator/src/org/eclipse/emf/ecp/navigator/handler/ExportModelHandler.java b/old/org.eclipse.emf.ecp.navigator/src/org/eclipse/emf/ecp/navigator/handler/ExportModelHandler.java
new file mode 100644
index 0000000..123969b
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.navigator/src/org/eclipse/emf/ecp/navigator/handler/ExportModelHandler.java
@@ -0,0 +1,213 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2011 Chair for Applied Software Engineering,
+ * Technische Universitaet Muenchen.
+ * 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:
+ ******************************************************************************/
+package org.eclipse.emf.ecp.navigator.handler;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecore.resource.ResourceSet;
+import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
+import org.eclipse.emf.ecore.util.EcoreUtil;
+import org.eclipse.emf.ecp.common.util.DialogHandler;
+import org.eclipse.emf.ecp.common.util.PreferenceHelper;
+import org.eclipse.emf.edit.provider.ComposedAdapterFactory;
+import org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.dialogs.ProgressMonitorDialog;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.FileDialog;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.handlers.HandlerUtil;
+
+/**
+ * Handles the export of ModelElements from a project.
+ */
+public class ExportModelHandler extends AbstractHandler {
+
+ private static final String FILE_EXTENSION = "ecm";
+
+ /**
+ * These filter names are used to filter which files are displayed.
+ */
+ public static final String[] FILTER_NAMES = { "EMFStore Project Files (*." + FILE_EXTENSION + ")", "All Files (*.*)" };
+
+ /**
+ * These filter extensions are used to filter which files are displayed.
+ */
+ public static final String[] FILTER_EXTS = { "*." + FILE_EXTENSION + ", *.*" };
+
+ private static final String EXPORT_MODEL_PATH = "org.eclipse.emf.emfstore.client.ui.exportModelPath";
+
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.core.commands.AbstractHandler#execute(org.eclipse.core.commands.ExecutionEvent)
+ */
+ public Object execute(ExecutionEvent event) throws ExecutionException {
+
+ final List<EObject> exportModelElements = getSelfContainedModelElementTree(event);
+
+ if (exportModelElements.size() > 0) {
+
+ String filePath = getFilePathByFileDialog(getNameForModelElement(exportModelElements.get(0)));
+
+ if (filePath == null) {
+ return null;
+ }
+
+ PreferenceHelper.setPreference(EXPORT_MODEL_PATH, new File(filePath).getParent());
+
+ runCommand(exportModelElements, filePath);
+
+ }
+
+ return null;
+ }
+
+
+ /**
+ * Get the name of a model element.
+ *
+ * @param modelElement the model element
+ * @return the name for the model element
+ */
+ public static String getNameForModelElement(EObject modelElement) {
+ // TODO: moved here from UiUtil since only user
+ ComposedAdapterFactory adapterFactory = new ComposedAdapterFactory(
+ ComposedAdapterFactory.Descriptor.Registry.INSTANCE);
+ AdapterFactoryLabelProvider labelProvider = new AdapterFactoryLabelProvider(adapterFactory);
+
+ String text = labelProvider.getText(modelElement);
+ labelProvider.dispose();
+ adapterFactory.dispose();
+
+ return text;
+ }
+
+ private void runCommand(final List<EObject> exportModelElements, String filePath) {
+ final File file = new File(filePath);
+
+ final URI uri = URI.createFileURI(filePath);
+
+ final ProgressMonitorDialog progressDialog = new ProgressMonitorDialog(PlatformUI.getWorkbench()
+ .getActiveWorkbenchWindow().getShell());
+
+ progressDialog.open();
+ progressDialog.getProgressMonitor().beginTask("Export modelelement...", 100);
+ progressDialog.getProgressMonitor().worked(10);
+
+ try {
+ saveEObjectToResource(exportModelElements, uri);
+ } catch (IOException e) {
+ DialogHandler.showExceptionDialog(e.getMessage(), e);
+ }
+ progressDialog.getProgressMonitor().done();
+ progressDialog.close();
+
+ MessageDialog.openInformation(null, "Export", "Exported modelelement to file " + file.getName());
+ }
+
+ private List<EObject> getSelfContainedModelElementTree(ExecutionEvent event) {
+ List<EObject> result = new ArrayList<EObject>();
+
+ ISelection selection = HandlerUtil.getCurrentSelection(event);
+ IStructuredSelection strucSel = null;
+ EObject copyModelElement = null;
+
+ if (selection != null && selection instanceof IStructuredSelection) {
+ strucSel = (IStructuredSelection) selection;
+ Object firstElement = strucSel.getFirstElement();
+ if (firstElement instanceof EObject) {
+ // TODO: ChainSaw - check whether specific clone functionality of ModelUtil is needed here
+ copyModelElement = EcoreUtil.copy((EObject) firstElement);
+ // copyModelElement = ModelUtil.clone((EObject) firstElement);
+
+ // only export the rootnode makes xml with references, otherwise (see (commented) line two) the children
+ // will be "real" nested as containments of the node (is not necessary)
+ result.add(copyModelElement);
+ // result.addAll(copyModelElement.getAllContainedModelElements());
+
+ } else {
+ // do nothing System.out.println("NOT A MODELELEMENT");
+ }
+ }
+
+ return result;
+ }
+
+ private String getFilePathByFileDialog(String modelElementName) {
+ FileDialog dialog = new FileDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), SWT.SAVE);
+ dialog.setFilterNames(FILTER_NAMES);
+ dialog.setFilterExtensions(FILTER_EXTS);
+ String initialPath = PreferenceHelper.getPreference(EXPORT_MODEL_PATH, System.getProperty("user.home"));
+ dialog.setFilterPath(initialPath);
+ dialog.setOverwrite(true);
+
+ try {
+ // String initialFileName = projectSpace.getProjectName() + "@"
+ // + projectSpace.getBaseVersion().getIdentifier() + ".ucp";
+ String initialFileName = "ModelElement_" + modelElementName + "." + FILE_EXTENSION;
+ dialog.setFileName(initialFileName);
+
+ } catch (NullPointerException e) {
+ // do nothing
+ }
+
+ String filePath = dialog.open();
+
+ return filePath;
+ }
+
+ /**
+ * Save a list of EObjects to the resource with the given URI.
+ *
+ * @param eObjects the EObjects to be saved
+ * @param resourceURI the URI of the resource, which should be used to save the EObjects
+ * @throws IOException if saving to the resource fails
+ */
+ public void saveEObjectToResource(List<? extends EObject> eObjects, URI resourceURI) throws IOException {
+ ResourceSet resourceSet = new ResourceSetImpl();
+ Resource resource = resourceSet.createResource(resourceURI);
+ EList<EObject> contents = resource.getContents();
+
+ for (EObject eObject : eObjects) {
+ contents.add(eObject);
+ }
+
+ contents.addAll(eObjects);
+ resource.save(null);
+ }
+
+ /**
+ * Save an EObject to a resource.
+ *
+ * @param eObject the object
+ * @param resourceURI the resources URI
+ * @throws IOException if saving to the resource fails.
+ */
+ public void saveEObjectToResource(EObject eObject, URI resourceURI) throws IOException {
+ ArrayList<EObject> list = new ArrayList<EObject>();
+ list.add(eObject);
+ saveEObjectToResource(list, resourceURI);
+ }
+}
\ No newline at end of file
diff --git a/old/org.eclipse.emf.ecp.navigator/src/org/eclipse/emf/ecp/navigator/handler/ImportModelHandler.java b/old/org.eclipse.emf.ecp.navigator/src/org/eclipse/emf/ecp/navigator/handler/ImportModelHandler.java
new file mode 100644
index 0000000..02c3d42
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.navigator/src/org/eclipse/emf/ecp/navigator/handler/ImportModelHandler.java
@@ -0,0 +1,217 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2011 Chair for Applied Software Engineering,
+ * Technische Universitaet Muenchen.
+ * 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:
+ ******************************************************************************/
+package org.eclipse.emf.ecp.navigator.handler;
+
+import java.io.File;
+import java.util.HashSet;
+import java.util.Set;
+
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.emf.common.util.TreeIterator;
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecore.resource.ResourceSet;
+import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
+import org.eclipse.emf.ecore.util.EcoreUtil;
+import org.eclipse.emf.ecp.common.commands.ECPCommand;
+import org.eclipse.emf.ecp.common.model.ECPWorkspaceManager;
+import org.eclipse.emf.ecp.common.model.workSpaceModel.ECPProject;
+import org.eclipse.emf.ecp.common.util.PreferenceHelper;
+import org.eclipse.emf.ecp.common.util.UiUtil;
+import org.eclipse.emf.ecp.navigator.Activator;
+import org.eclipse.emf.emfstore.common.CommonUtil;
+import org.eclipse.jface.dialogs.ProgressMonitorDialog;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.FileDialog;
+import org.eclipse.ui.PlatformUI;
+
+/**
+ * Handles the import of ModelElements into a project.
+ */
+public class ImportModelHandler extends AbstractHandler {
+
+ /**
+ * These filter extensions are used to filter which files are displayed.
+ */
+ public static final String[] FILTER_EXTS = { "*.ecm", "*.*" };
+
+ /**
+ * These filter names are used to filter which files are displayed.
+ */
+ public static final String[] FILTER_NAMES = { "EMFStore Project Files (*.ecm)", "All Files (*.*)" };
+
+ private static final String IMPORT_MODEL_PATH = "org.eclipse.emf.emfstore.client.ui.importModelPath";
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.core.commands.AbstractHandler#execute(org.eclipse.core.commands.ExecutionEvent)
+ */
+ public Object execute(ExecutionEvent event) throws ExecutionException {
+ final EObject selectedModelElement = UiUtil.getSelectedModelelement();
+ final ECPProject project = ECPWorkspaceManager.getECPProject(selectedModelElement);
+
+ if (project == null || selectedModelElement == null) {
+ return null;
+ }
+
+ final String fileName = getFileName();
+ if (fileName == null) {
+ return null;
+ }
+
+ final URI fileURI = URI.createFileURI(fileName);
+
+ // create resource set and resource
+ ResourceSet resourceSet = new ResourceSetImpl();
+
+ final Resource resource = resourceSet.getResource(fileURI, true);
+
+ final ProgressMonitorDialog progressDialog = new ProgressMonitorDialog(PlatformUI.getWorkbench()
+ .getActiveWorkbenchWindow().getShell());
+
+ new ECPCommand(project.getRootObject()) {
+ @Override
+ protected void doRun() {
+ importFile(project, fileURI, resource, progressDialog);
+ }
+
+ }.run(false);
+
+ return null;
+ }
+
+ private void importFile(ECPProject project, final URI fileURI, final Resource resource,
+ final ProgressMonitorDialog progressDialog) {
+
+ try {
+ progressDialog.open();
+ progressDialog.getProgressMonitor().beginTask("Import model...", 100);
+
+ Set<EObject> importElements = validation(resource);
+
+ if (importElements.size() > 0) {
+ int i = 0;
+ for (EObject eObject : importElements) {
+ // run the import command
+ runImport(project, fileURI, EcoreUtil.copy(eObject), i);
+ progressDialog.getProgressMonitor().worked(10);
+ i++;
+ }
+ }
+ // BEGIN SUPRESS CATCH EXCEPTION
+ } catch (RuntimeException e) {
+ Activator.getDefault().logException(e.getMessage(), e);
+ // END SUPRESS CATCH EXCEPTION
+ } finally {
+ progressDialog.getProgressMonitor().done();
+ progressDialog.close();
+ }
+ }
+
+ // Validates if the EObjects can be imported
+ private Set<EObject> validation(Resource resource) {
+ Set<EObject> childrenSet = new HashSet<EObject>();
+ Set<EObject> rootNodes = new HashSet<EObject>();
+
+ EList<EObject> rootContent = resource.getContents();
+
+ for (EObject rootNode : rootContent) {
+ TreeIterator<EObject> contents = rootNode.eAllContents();
+ // 1. Run: Put all children in set
+ while (contents.hasNext()) {
+ EObject content = contents.next();
+ if (!(content != null)) {
+ continue;
+ }
+ childrenSet.add(content);
+ }
+ }
+
+ // 2. Run: Check if RootNodes are children -> set.contains(RootNode) -- no: RootNode in rootNode-Set -- yes:
+ // Drop RootNode, will be imported as a child
+ for (EObject rootNode : rootContent) {
+
+ if (!(rootNode != null)) {
+ // No report to Console, because Run 1 will do this
+ continue;
+ }
+
+ if (!childrenSet.contains(rootNode)) {
+ rootNodes.add(rootNode);
+ }
+ }
+
+ // 3. Check if RootNodes are SelfContained -- yes: import -- no: error
+ Set<EObject> notSelfContained = new HashSet<EObject>();
+ for (EObject rootNode : rootNodes) {
+ if (!CommonUtil.isSelfContained(rootNode)) {
+ // TODO: Report to Console //System.out.println(rootNode + " is not selfcontained");
+ notSelfContained.add(rootNode);
+ }
+ }
+ rootNodes.removeAll(notSelfContained);
+
+ return rootNodes;
+ }
+
+ private String getFileName() {
+
+ FileDialog dialog = new FileDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), SWT.OPEN);
+ dialog.setFilterNames(FILTER_NAMES);
+ dialog.setFilterExtensions(FILTER_EXTS);
+ String initialPath = PreferenceHelper.getPreference(IMPORT_MODEL_PATH, System.getProperty("user.home"));
+ dialog.setFilterPath(initialPath);
+
+ String fileName = dialog.open();
+
+ if (fileName == null) {
+ return null;
+ }
+
+ final File file = new File(dialog.getFilterPath(), dialog.getFileName());
+
+ PreferenceHelper.setPreference(IMPORT_MODEL_PATH, file.getParent());
+
+ return file.getAbsolutePath();
+ }
+
+ /**
+ * Runs the import command.
+ *
+ * @param projectSpace - the projectSpace where the element should be imported in.
+ * @param uri - the uri of the resource.
+ * @param element - the modelElement to import.
+ * @param resourceIndex - the index of the element inside the eResource.
+ */
+ private void runImport(final ECPProject project, final org.eclipse.emf.common.util.URI uri, final EObject element,
+ final int resourceIndex) {
+
+ // TODO: ChainSaw: ModelElementWrapperDescriptor ain't in scope here
+ // try to find a wrapper for the element which will be added to the project
+ // EObject wrapper = ModelElementWrapperDescriptor.getInstance().wrapForImport(project, element, uri,
+ // resourceIndex);
+
+ // // if no wrapper could be created, use the element itself to add it to the project
+ // if (wrapper == null) {
+ // wrapper = element;
+ // }
+
+ // add the wrapper or the element itself to the project
+ // copy wrapper to reset model element ids
+
+ project.addModelElementToRoot(element);
+ }
+}
\ No newline at end of file
diff --git a/old/org.eclipse.emf.ecp.navigator/src/org/eclipse/emf/ecp/navigator/handler/NewModelElementWizardHandler.java b/old/org.eclipse.emf.ecp.navigator/src/org/eclipse/emf/ecp/navigator/handler/NewModelElementWizardHandler.java
new file mode 100644
index 0000000..3061687
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.navigator/src/org/eclipse/emf/ecp/navigator/handler/NewModelElementWizardHandler.java
@@ -0,0 +1,57 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2011 Chair for Applied Software Engineering,
+ * Technische Universitaet Muenchen.
+ * 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:
+ ******************************************************************************/
+package org.eclipse.emf.ecp.navigator.handler;
+
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.commands.IHandler;
+import org.eclipse.emf.ecp.navigator.wizards.NewModelElementWizard;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.wizard.WizardDialog;
+import org.eclipse.ui.handlers.HandlerUtil;
+
+/**
+ * @author Hodaie This is the handler for "Add new model element" context menu command. The command is only shown on
+ * LeafSections. The handler initializes and shows the AddNewModelElementWizard
+ */
+public class NewModelElementWizardHandler extends AbstractHandler implements IHandler {
+
+ private static final String WIZARD_TITLE = "Add new model element";
+ /**
+ * String to pass the eclass which containments shall be shown in the new element wizard.
+ */
+ public static final String COMMAND_ECLASS_PARAM = "org.eclipse.emf.ecp.navigator.eClassParameter";
+
+ /**
+ * . ({@inheritDoc})
+ */
+ public Object execute(final ExecutionEvent event) throws ExecutionException {
+
+ NewModelElementWizard wizard = new NewModelElementWizard();
+
+ ISelection selection = HandlerUtil.getCurrentSelection(event);
+ IStructuredSelection ssel;
+ if (selection != null && selection instanceof IStructuredSelection) {
+ ssel = (IStructuredSelection) selection;
+ wizard.init(HandlerUtil.getActiveWorkbenchWindow(event).getWorkbench(), ssel);
+ }
+
+ WizardDialog dialog = new WizardDialog(HandlerUtil.getActiveShell(event), wizard);
+ wizard.setWindowTitle(WIZARD_TITLE);
+ dialog.create();
+ dialog.open();
+
+ return null;
+ }
+
+}
\ No newline at end of file
diff --git a/old/org.eclipse.emf.ecp.navigator/src/org/eclipse/emf/ecp/navigator/wizards/ModelClassFilter.java b/old/org.eclipse.emf.ecp.navigator/src/org/eclipse/emf/ecp/navigator/wizards/ModelClassFilter.java
new file mode 100644
index 0000000..e4d0418
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.navigator/src/org/eclipse/emf/ecp/navigator/wizards/ModelClassFilter.java
@@ -0,0 +1,63 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2011 Chair for Applied Software Engineering,
+ * Technische Universitaet Muenchen.
+ * 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:
+ ******************************************************************************/
+package org.eclipse.emf.ecp.navigator.wizards;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.viewers.ViewerFilter;
+
+/**
+ * Filter for selective input in the NewModelElementWizard.
+ *
+ * @author Shterev
+ */
+public class ModelClassFilter extends ViewerFilter {
+
+ private String searchTerm;
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.ViewerFilter#select(org.eclipse.jface.viewers.Viewer, java.lang.Object,
+ * java.lang.Object)
+ */
+ @Override
+ public boolean select(Viewer viewer, Object parentElement, Object element) {
+ if (searchTerm == null || searchTerm.length() == 0) {
+ return true;
+ }
+ if (element instanceof EClass && parentElement instanceof EPackage) {
+ return ((EClass) element).getName().toLowerCase().contains(searchTerm.toLowerCase())
+ || ((EPackage) parentElement).getName().toLowerCase().contains(searchTerm.toLowerCase());
+ } else if (element instanceof EPackage) {
+ EPackage ePackage = (EPackage) element;
+ Object[] children = ((ModelTreeContentProvider) ((TreeViewer) viewer).getContentProvider())
+ .getChildren(element);
+ boolean show = ePackage.getName().toLowerCase().contains(searchTerm.toLowerCase());
+ for (Object child : children) {
+ show = show || select(viewer, element, child);
+ }
+ return show;
+ }
+ return true;
+ }
+
+ /**
+ * Sets the search term for this name filter.
+ *
+ * @param searchTerm the search term
+ */
+ public void setSearchTerm(String searchTerm) {
+ this.searchTerm = searchTerm;
+ }
+}
\ No newline at end of file
diff --git a/old/org.eclipse.emf.ecp.navigator/src/org/eclipse/emf/ecp/navigator/wizards/ModelTreeContentProvider.java b/old/org.eclipse.emf.ecp.navigator/src/org/eclipse/emf/ecp/navigator/wizards/ModelTreeContentProvider.java
new file mode 100644
index 0000000..b5e5b39
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.navigator/src/org/eclipse/emf/ecp/navigator/wizards/ModelTreeContentProvider.java
@@ -0,0 +1,165 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2011 Chair for Applied Software Engineering,
+ * Technische Universitaet Muenchen.
+ * 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:
+ ******************************************************************************/
+package org.eclipse.emf.ecp.navigator.wizards;
+
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.ecp.common.model.ECPMetaModelElementContext;
+import org.eclipse.emf.ecp.common.model.ECPWorkspaceManager;
+import org.eclipse.emf.ecp.common.model.NoWorkspaceException;
+import org.eclipse.emf.ecp.navigator.Activator;
+import org.eclipse.emf.edit.provider.ComposedAdapterFactory;
+import org.eclipse.emf.edit.ui.provider.AdapterFactoryContentProvider;
+
+/**
+ * @author Hodaie ContentProvider for TreeViewer which is shown on ModelTreePage
+ */
+public class ModelTreeContentProvider extends AdapterFactoryContentProvider {
+
+ private Set<EPackage> packages = new HashSet<EPackage>();
+ private HashSet<EClass> modelElementClasses;
+ private Set<EPackage> rootPackages;
+ private ECPMetaModelElementContext metaContext;
+
+ /**
+ * Constructor.
+ *
+ * @param selected the selected model element.
+ */
+ public ModelTreeContentProvider(EClass selected) {
+ super(new ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry.INSTANCE));
+ Set<EClass> eClasses;
+ try {
+ metaContext = ECPWorkspaceManager.getInstance().getWorkSpace().getActiveProject()
+ .getMetaModelElementContext();
+ eClasses = metaContext.getAllModelElementEClasses(false);
+ } catch (NoWorkspaceException e) {
+ Activator.getDefault().logException(e.getMessage(), e);
+ eClasses = new HashSet<EClass>();
+ } catch (NullPointerException e) {
+ Activator.getDefault().logException(e.getMessage(), e);
+ eClasses = new HashSet<EClass>();
+ }
+ modelElementClasses = new HashSet<EClass>();
+ rootPackages = new HashSet<EPackage>();
+ for (EClass eClass : eClasses) {
+ if (!isNonDomainElement(eClass) && !eClass.isAbstract()) {
+ modelElementClasses.add(eClass);
+ }
+ }
+
+ extractRootPackages(modelElementClasses);
+ }
+
+ private void extractRootPackages(Set<EClass> eClasses) {
+ for (EClass eClass : eClasses) {
+ EPackage ePackage = eClass.getEPackage();
+ packages.add(ePackage);
+ extractAllSuperPackages(ePackage);
+ }
+ }
+
+ private void extractAllSuperPackages(EPackage ePackage) {
+ EPackage eSuperPackage = ePackage.getESuperPackage();
+ if (eSuperPackage == null) {
+ rootPackages.add(ePackage);
+ return;
+ }
+ if (packages.contains(eSuperPackage)) {
+ return;
+ }
+ packages.add(eSuperPackage);
+ extractAllSuperPackages(eSuperPackage);
+ }
+
+ /**
+ * {@inheritDoc} Return an array of sub-packages of Model package.
+ */
+ @Override
+ public Object[] getElements(Object inputElement) {
+ if (rootPackages.size() == 1) {
+ return getChildren(rootPackages.iterator().next());
+ }
+ return rootPackages.toArray();
+
+ // // return ModelUtil.getAllModelPackages().toArray();
+ }
+
+ /**
+ * {@inheritDoc} Shows the children only when argument is an EPackage. Also doesn't show the Children that are.
+ * abstract or not ModelElement.
+ */
+ @Override
+ public Object[] getChildren(Object object) {
+ // show the children only when argument is an EPackage.
+ // Also remove the Children that are abstract or not ModelElement.
+ if (object instanceof EPackage) {
+
+ // remove classes that do not inherit ModelElement
+ // or are abstract.
+ Object[] children = super.getChildren(object);
+ List<Object> ret = new ArrayList<Object>();
+ for (int i = 0; i < children.length; i++) {
+ Object child = children[i];
+ if (child instanceof EPackage && (packages.contains(child))) {
+ ret.add(child);
+ }
+ if (child instanceof EClass && modelElementClasses.contains(child)) {
+ ret.add(child);
+ }
+ }
+ return ret.toArray();
+
+ } else {
+ // for Children that are EClass, show nothing
+ // Otherwise the EAttributes of EClass would be shown in tree
+ return null;
+ }
+
+ }
+
+ /**
+ * Checks if the argument is a NonDomainElement.
+ *
+ * @param object EClass to be checked.
+ * @return
+ */
+ private boolean isNonDomainElement(EClass eClass) {
+ return metaContext.isNonDomainElement(eClass);
+ }
+
+ /**
+ * {@inheritDoc} If argument is an EClass return false. This is to prevent showing of the plus sign beside an.
+ * EClass in TreeViewer
+ */
+ @Override
+ public boolean hasChildren(Object object) {
+ // to remove the plus signs that are shown
+ // beside EClasses in the tree.
+ if (object instanceof EClass) {
+ return false;
+ } else {
+ Object[] children = getChildren(object);
+ if (children != null) {
+ return children.length > 0;
+ } else {
+ return false;
+ }
+ }
+
+ }
+
+}
\ No newline at end of file
diff --git a/old/org.eclipse.emf.ecp.navigator/src/org/eclipse/emf/ecp/navigator/wizards/ModelTreePage.java b/old/org.eclipse.emf.ecp.navigator/src/org/eclipse/emf/ecp/navigator/wizards/ModelTreePage.java
new file mode 100644
index 0000000..d19f855
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.navigator/src/org/eclipse/emf/ecp/navigator/wizards/ModelTreePage.java
@@ -0,0 +1,198 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2011 Chair for Applied Software Engineering,
+ * Technische Universitaet Muenchen.
+ * 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:
+ ******************************************************************************/
+package org.eclipse.emf.ecp.navigator.wizards;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecp.common.MEClassLabelProvider;
+import org.eclipse.emf.ecp.common.model.ECPMetaModelElementContext;
+import org.eclipse.emf.ecp.common.model.ECPWorkspaceManager;
+import org.eclipse.emf.ecp.common.model.NoWorkspaceException;
+import org.eclipse.emf.ecp.navigator.Activator;
+import org.eclipse.jface.layout.GridDataFactory;
+import org.eclipse.jface.layout.GridLayoutFactory;
+import org.eclipse.jface.viewers.DoubleClickEvent;
+import org.eclipse.jface.viewers.IDoubleClickListener;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.jface.viewers.ViewerComparator;
+import org.eclipse.jface.wizard.WizardPage;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.swt.widgets.Tree;
+
+/**
+ * @author Hodaie This is the first page of NewModelElementWizard. On this page the model packages and their class (only
+ * those who inherit ModelElement and are not abstract) are shown in a TreeViewer. If user selects a class in
+ * this tree, the wizard can finish.
+ */
+public class ModelTreePage extends WizardPage implements Listener {
+
+ private TreeViewer treeViewer;
+ private static final String PAGE_TITLE = "Add new model element";
+ private static final String PAGE_DESCRIPTION = "Select model element type";
+ private final EClass selected;
+
+ /**
+ * Constructor.
+ *
+ * @param selected the selected EClass
+ * @param pageName page name
+ */
+ protected ModelTreePage(String pageName, EClass selected) {
+ super(pageName);
+ this.selected = selected;
+ setTitle(PAGE_TITLE);
+ setDescription(PAGE_DESCRIPTION);
+
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void createControl(Composite parent) {
+
+ Composite composite = new Composite(parent, SWT.NULL);
+
+ GridLayoutFactory.fillDefaults().numColumns(2).equalWidth(false).applyTo(composite);
+
+ Label filterLabel = new Label(composite, SWT.LEFT);
+ filterLabel.setText("Search:");
+ final Text filterInput = new Text(composite, SWT.SEARCH);
+ filterInput.setMessage("Model Element class");
+ GridDataFactory.fillDefaults().align(SWT.FILL, SWT.FILL).grab(true, true).applyTo(filterInput);
+ try {
+ ECPMetaModelElementContext metaContext = ECPWorkspaceManager.getInstance().getWorkSpace()
+ .getActiveProject().getMetaModelElementContext();
+ if (metaContext.isGuessed()) {
+ Label label = new Label(composite, SWT.None);
+ label.setText("No registered Package found. EMF Client Platform has tried to guess your model package."
+ + "\n" + "Please register your package explicitly.");
+ GridDataFactory.fillDefaults().align(SWT.FILL, SWT.FILL).grab(true, true).span(2, 1).applyTo(label);
+ }
+ } catch (NoWorkspaceException e) {
+ Activator.getDefault().logException(e.getMessage(), e);
+ } catch (NullPointerException e) {
+ Activator.getDefault().logException(e.getMessage(), e);
+ }
+
+ Tree tree = new Tree(composite, SWT.SINGLE);
+ final ModelClassFilter filter = new ModelClassFilter();
+ filterInput.addModifyListener(new ModifyListener() {
+ public void modifyText(ModifyEvent e) {
+ String text = filterInput.getText();
+ filter.setSearchTerm(text);
+ treeViewer.expandAll();
+ if (text != null && text.length() == 0) {
+ treeViewer.collapseAll();
+ }
+ treeViewer.refresh();
+ }
+ });
+
+ treeViewer = new TreeViewer(tree);
+ GridDataFactory.fillDefaults().align(SWT.FILL, SWT.FILL).grab(true, true).minSize(0, 150).span(2, 1)
+ .applyTo(treeViewer.getControl());
+ treeViewer.setContentProvider(new ModelTreeContentProvider(selected));
+ treeViewer.setLabelProvider(new MEClassLabelProvider());
+ treeViewer.setComparator(new ViewerComparator());
+ treeViewer.addFilter(filter);
+ // give an empty object, otherwise it does not initialize
+ treeViewer.setInput(new Object());
+ treeViewer.getTree().addListener(SWT.Selection, this);
+ treeViewer.addDoubleClickListener(new IDoubleClickListener() {
+
+ public void doubleClick(DoubleClickEvent event) {
+ if (getWizard().canFinish()) {
+ getWizard().performFinish();
+ getWizard().getContainer().getShell().close();
+ }
+
+ }
+
+ });
+
+ setControl(composite);
+
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public boolean canFlipToNextPage() {
+
+ return false;
+
+ }
+
+ /**
+ * Check if tree selection is a ME and wizard can complete. This Method sets the newMEType and treeCompleted fields
+ * in NewModelElementWizard
+ *
+ * @return
+ */
+ private boolean checkSelection() {
+
+ NewModelElementWizard wizard = (NewModelElementWizard) getWizard();
+ boolean canFinish = false;
+ ISelection sel = treeViewer.getSelection();
+ if (sel == null) {
+ canFinish = false;
+ }
+
+ if (!(sel instanceof IStructuredSelection)) {
+ canFinish = false;
+ }
+
+ IStructuredSelection ssel = (IStructuredSelection) sel;
+ if (ssel.isEmpty()) {
+ canFinish = false;
+ }
+ Object o = ssel.getFirstElement();
+ if (o instanceof EClass) {
+ canFinish = true;
+ }
+
+ else {
+ canFinish = false;
+ }
+
+ if (canFinish) {
+ EClass newMEType = (EClass) o;
+ wizard.setNewMEType(newMEType);
+ wizard.setTreePageCompleted(true);
+ return true;
+ } else {
+ wizard.setNewMEType(null);
+ wizard.setTreePageCompleted(false);
+ return false;
+ }
+
+ }
+
+ /**
+ * {@inheritDoc} On selection change in TreeViewer updates wizard buttons accordingly.
+ */
+ public void handleEvent(Event event) {
+
+ checkSelection();
+ getWizard().getContainer().updateButtons();
+
+ }
+
+}
\ No newline at end of file
diff --git a/old/org.eclipse.emf.ecp.navigator/src/org/eclipse/emf/ecp/navigator/wizards/NewModelElementWizard.java b/old/org.eclipse.emf.ecp.navigator/src/org/eclipse/emf/ecp/navigator/wizards/NewModelElementWizard.java
new file mode 100644
index 0000000..e697d20
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.navigator/src/org/eclipse/emf/ecp/navigator/wizards/NewModelElementWizard.java
@@ -0,0 +1,152 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2011 Chair for Applied Software Engineering,
+ * Technische Universitaet Muenchen.
+ * 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:
+ ******************************************************************************/
+package org.eclipse.emf.ecp.navigator.wizards;
+
+import org.eclipse.emf.common.command.Command;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.ecore.EReference;
+import org.eclipse.emf.ecp.common.commands.ECPCommand;
+import org.eclipse.emf.ecp.common.model.ECPWorkspaceManager;
+import org.eclipse.emf.ecp.common.model.NoWorkspaceException;
+import org.eclipse.emf.ecp.common.model.workSpaceModel.ECPProject;
+import org.eclipse.emf.ecp.common.model.workSpaceModel.ECPWorkspace;
+import org.eclipse.emf.ecp.common.utilities.ActionHelper;
+import org.eclipse.emf.ecp.navigator.Activator;
+import org.eclipse.emf.edit.command.AddCommand;
+import org.eclipse.emf.emfstore.common.CommonUtil;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.wizard.Wizard;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchWizard;
+
+/**
+ * @author Hodaie This is implementation of New Model Element wizard. This wizard is show through
+ * "Add new model element..." command in context menu of Navigator (only on right click on LeafSection). The
+ * wizard shows a tree of model packages and their classes. The user can select a Model Element type in this
+ * tree and on finish the model element is created, added to Leaf- or CompositeSection and opend for editing.
+ */
+public class NewModelElementWizard extends Wizard implements IWorkbenchWizard {
+
+ /**
+ * . Through this field, the ModelTreePage tells the wizard which model element type is selected
+ */
+ private EClass newMEType;
+
+ /**
+ * Through this field, the ModelTreePage tells the wizard if it's ready to finish, i.e. if the selection a model
+ * element is and not a package.
+ */
+ private boolean treePageCompleted;
+ private EObject selectedEObject;
+
+ /**
+ * . ({@inheritDoc})
+ */
+ @Override
+ public void addPages() {
+
+ ModelTreePage treePage = new ModelTreePage("ModelTreePage", selectedEObject.eClass());
+ addPage(treePage);
+
+ }
+
+ /**
+ * . ({@inheritDoc}) This method creates a model element instance from selected type, adds it to Leaf- or
+ * CompositeSection, and opens it.
+ */
+ @Override
+ public boolean performFinish() {
+ final EObject newMEInstance;
+ if (selectedEObject != null && newMEType != null) {
+ // 1.create ME
+ EPackage ePackage = newMEType.getEPackage();
+ newMEInstance = ePackage.getEFactoryInstance().create(newMEType);
+ ECPProject tryProject = null;
+ try {
+ tryProject = ECPWorkspaceManager.getInstance().getWorkSpace().getProject(selectedEObject);
+ } catch (NoWorkspaceException e1) {
+ Activator.getDefault().logException(e1.getMessage(), e1);
+ return false;
+ }
+ final ECPProject project = tryProject;
+ if (project != null && selectedEObject.equals(project.getRootObject())) {
+ new ECPCommand(selectedEObject) {
+ @Override
+ protected void doRun() {
+ project.addModelElementToRoot(newMEInstance);
+ }
+ }.run(true);
+
+ } else {
+ final EReference possibleContainingReference = CommonUtil.getPossibleContainingReference(newMEInstance,
+ selectedEObject);
+ if (possibleContainingReference != null && possibleContainingReference.isMany()) {
+ ECPWorkspace workSpace;
+ try {
+ workSpace = ECPWorkspaceManager.getInstance().getWorkSpace();
+ Command create = AddCommand.create(workSpace.getProject(selectedEObject).getEditingDomain(),
+ selectedEObject, possibleContainingReference, newMEInstance);
+ workSpace.getProject(selectedEObject).getEditingDomain().getCommandStack().execute(create);
+ } catch (NoWorkspaceException e) {
+ Activator.getDefault().logException(e.getMessage(), e);
+ }
+ }
+ }
+ // 3.open the newly created ME
+ ActionHelper.openModelElement(newMEInstance, this.getClass().getName());
+ }
+
+ return true;
+ }
+
+ /**
+ * . ({@inheritDoc})
+ */
+ public void init(IWorkbench workbench, IStructuredSelection selection) {
+ // get the in navigator selected ME
+ Object o;
+ if (!selection.isEmpty()) {
+ o = selection.getFirstElement();
+ if (o instanceof EObject) {
+ selectedEObject = (EObject) o;
+ }
+ }
+
+ }
+
+ /**
+ * . ({@inheritDoc})
+ */
+ @Override
+ public boolean canFinish() {
+ return treePageCompleted;
+
+ }
+
+ /**
+ * @see newMEType
+ * @param newMEType The ME type that was in ModelTreePage selected.
+ */
+ public void setNewMEType(EClass newMEType) {
+ this.newMEType = newMEType;
+ }
+
+ /**
+ * @see treePageCompeleted
+ * @param treePageCompleted If ModelTreePage is complete (i.e. its selection is a ME)
+ */
+ public void setTreePageCompleted(boolean treePageCompleted) {
+ this.treePageCompleted = treePageCompleted;
+ }
+
+}
\ No newline at end of file
diff --git a/old/org.eclipse.emf.ecp.navigatoreditorbridge/.checkstyle b/old/org.eclipse.emf.ecp.navigatoreditorbridge/.checkstyle
new file mode 100644
index 0000000..d4fa17e
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.navigatoreditorbridge/.checkstyle
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<fileset-config file-format-version="1.2.0" simple-config="true" sync-formatter="false">
+ <fileset name="all" enabled="true" check-config-name="emfcpStyle" local="false">
+ <file-match-pattern match-pattern="." include-pattern="true"/>
+ </fileset>
+</fileset-config>
diff --git a/old/org.eclipse.emf.ecp.navigatoreditorbridge/.classpath b/old/org.eclipse.emf.ecp.navigatoreditorbridge/.classpath
new file mode 100644
index 0000000..64c5e31
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.navigatoreditorbridge/.classpath
@@ -0,0 +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>
diff --git a/old/org.eclipse.emf.ecp.navigatoreditorbridge/.project b/old/org.eclipse.emf.ecp.navigatoreditorbridge/.project
new file mode 100644
index 0000000..e253e1b
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.navigatoreditorbridge/.project
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.emf.ecp.navigatoreditorbridge</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>net.sf.eclipsecs.core.CheckstyleBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>net.sf.eclipsecs.core.CheckstyleNature</nature>
+ </natures>
+</projectDescription>
diff --git a/old/org.eclipse.emf.ecp.navigatoreditorbridge/.settings/org.eclipse.jdt.core.prefs b/old/org.eclipse.emf.ecp.navigatoreditorbridge/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 0000000..92a611d
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.navigatoreditorbridge/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,276 @@
+#Wed May 18 17:49:10 CEST 2011
+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_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.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_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=true
+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=true
+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=do not insert
+org.eclipse.jdt.core.formatter.comment.line_length=120
+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.compact_else_if=true
+org.eclipse.jdt.core.formatter.continuation_indentation=1
+org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=1
+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_local_variable=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_member=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_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_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_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_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_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_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_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_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_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=true
+org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false
+org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false
+org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false
+org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false
+org.eclipse.jdt.core.formatter.lineSplit=120
+org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false
+org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false
+org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0
+org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1
+org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true
+org.eclipse.jdt.core.formatter.tabulation.char=tab
+org.eclipse.jdt.core.formatter.tabulation.size=4
+org.eclipse.jdt.core.formatter.use_on_off_tags=true
+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_outer_expressions_when_nested=true
diff --git a/old/org.eclipse.emf.ecp.navigatoreditorbridge/.settings/org.eclipse.jdt.ui.prefs b/old/org.eclipse.emf.ecp.navigatoreditorbridge/.settings/org.eclipse.jdt.ui.prefs
new file mode 100644
index 0000000..3420dd8
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.navigatoreditorbridge/.settings/org.eclipse.jdt.ui.prefs
@@ -0,0 +1,4 @@
+#Wed May 18 17:49:10 CEST 2011
+eclipse.preferences.version=1
+formatter_profile=_emfstoreFormatter
+formatter_settings_version=11
diff --git a/old/org.eclipse.emf.ecp.navigatoreditorbridge/META-INF/MANIFEST.MF b/old/org.eclipse.emf.ecp.navigatoreditorbridge/META-INF/MANIFEST.MF
new file mode 100644
index 0000000..92172c8
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.navigatoreditorbridge/META-INF/MANIFEST.MF
@@ -0,0 +1,12 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Navigator Editor-Bridge
+Bundle-SymbolicName: org.eclipse.emf.ecp.navigatoreditorbridge;singleton:=true
+Bundle-Version: 0.9.3.qualifier
+Bundle-Activator: org.eclipse.emf.ecp.navigatoreditorbridge.Activator
+Require-Bundle: org.eclipse.emf.ecp.editor,
+ org.eclipse.emf.ecp.navigator
+Bundle-ActivationPolicy: lazy
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Export-Package: org.eclipse.emf.ecp.navigatoreditorbridge
+Bundle-Vendor: Eclipse Modeling Project
diff --git a/old/org.eclipse.emf.ecp.navigatoreditorbridge/build.properties b/old/org.eclipse.emf.ecp.navigatoreditorbridge/build.properties
new file mode 100644
index 0000000..6f20375
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.navigatoreditorbridge/build.properties
@@ -0,0 +1,5 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ plugin.xml
diff --git a/old/org.eclipse.emf.ecp.navigatoreditorbridge/plugin.xml b/old/org.eclipse.emf.ecp.navigatoreditorbridge/plugin.xml
new file mode 100644
index 0000000..dc0233a
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.navigatoreditorbridge/plugin.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+<plugin>
+ <extension
+ point="org.eclipse.emf.ecp.common.modelelementopener">
+ <ModelElementOpener
+ class="org.eclipse.emf.ecp.navigatoreditorbridge.ModelElementOpener"
+ name="org.eclipse.emf.ecp.editor.MEEditor">
+ </ModelElementOpener>
+ </extension>
+
+</plugin>
diff --git a/old/org.eclipse.emf.ecp.navigatoreditorbridge/pom.xml b/old/org.eclipse.emf.ecp.navigatoreditorbridge/pom.xml
new file mode 100644
index 0000000..3995259
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.navigatoreditorbridge/pom.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.eclipse.emf.emfstore</groupId>
+ <artifactId>emfstore-parent</artifactId>
+ <version>0.9.3-SNAPSHOT</version>
+ <relativePath>../../org.eclipse.emf.emfstore.releng/emfstore-parent/</relativePath>
+ </parent>
+ <groupId>org.eclipse.emf.emfstore</groupId>
+ <artifactId>org.eclipse.emf.ecp.navigatoreditorbridge</artifactId>
+ <version>0.9.3-SNAPSHOT</version>
+ <packaging>eclipse-plugin</packaging>
+</project>
diff --git a/old/org.eclipse.emf.ecp.navigatoreditorbridge/src/org/eclipse/emf/ecp/navigatoreditorbridge/Activator.java b/old/org.eclipse.emf.ecp.navigatoreditorbridge/src/org/eclipse/emf/ecp/navigatoreditorbridge/Activator.java
new file mode 100644
index 0000000..3d8cb9e
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.navigatoreditorbridge/src/org/eclipse/emf/ecp/navigatoreditorbridge/Activator.java
@@ -0,0 +1,62 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2011 Chair for Applied Software Engineering,
+ * Technische Universitaet Muenchen.
+ * 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:
+ ******************************************************************************/
+package org.eclipse.emf.ecp.navigatoreditorbridge;
+
+import org.eclipse.emf.ecp.common.util.AbstractECPPlugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle.
+ */
+public class Activator extends AbstractECPPlugin {
+
+ /**
+ * Plugin ID.
+ */
+ public static final String PLUGIN_ID = "org.eclipse.emf.ecp.navigatoreditorbridge";
+
+ // The shared instance
+ private static Activator plugin;
+
+ /**
+ * The constructor.
+ */
+ public Activator() {
+ }
+
+ // BEGIN SUPRESS CATCH EXCEPTION
+ /**
+ * {@inheritDoc}
+ */
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ plugin = this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void stop(BundleContext context) throws Exception {
+ plugin = null;
+ super.stop(context);
+ }
+
+ // END SUPRESS CATCH EXCEPTION
+ /**
+ * Returns the shared instance.
+ *
+ * @return the shared instance
+ */
+ public static Activator getDefault() {
+ return plugin;
+ }
+
+}
\ No newline at end of file
diff --git a/old/org.eclipse.emf.ecp.navigatoreditorbridge/src/org/eclipse/emf/ecp/navigatoreditorbridge/ModelElementOpener.java b/old/org.eclipse.emf.ecp.navigatoreditorbridge/src/org/eclipse/emf/ecp/navigatoreditorbridge/ModelElementOpener.java
new file mode 100644
index 0000000..791b0e1
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.navigatoreditorbridge/src/org/eclipse/emf/ecp/navigatoreditorbridge/ModelElementOpener.java
@@ -0,0 +1,86 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2011 Chair for Applied Software Engineering,
+ * Technische Universitaet Muenchen.
+ * 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:
+ ******************************************************************************/
+package org.eclipse.emf.ecp.navigatoreditorbridge;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecp.common.model.ECPModelelementContext;
+import org.eclipse.emf.ecp.common.model.ECPWorkspaceManager;
+import org.eclipse.emf.ecp.common.model.NoWorkspaceException;
+import org.eclipse.emf.ecp.editor.MEEditorInput;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.PlatformUI;
+
+/**
+ * Opener for the meeditor.
+ *
+ * @author helming
+ */
+public class ModelElementOpener implements org.eclipse.emf.ecp.common.util.ModelElementOpener {
+
+ /**
+ * Default constructor.
+ */
+ public ModelElementOpener() {
+
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public int canOpen(EObject modelElement) {
+ return 0;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void openModelElement(EObject modelElement) {
+ // IHandlerService handlerService = (IHandlerService)
+ // PlatformUI.getWorkbench().getService(IHandlerService.class);
+
+ // IEvaluationContext context = handlerService.getCurrentState();
+ // context.addVariable(ActionHelper.ME_TO_OPEN_EVALUATIONCONTEXT_VARIABLE, modelElement);
+
+ // try {
+ // context.addVariable(ActionHelper.MECONTEXT_EVALUATIONCONTEXT_VARIABLE, ECPWorkspaceManager.getInstance()
+ // .getWorkSpace().getProject(modelElement));
+ // handlerService.executeCommand(ActionHelper.MEEDITOR_OPENMODELELEMENT_COMMAND_ID, null);
+
+ // } catch (ExecutionException e) {
+ // DialogHandler.showExceptionDialog(e);
+ // } catch (NotDefinedException e) {
+ // DialogHandler.showExceptionDialog(e);
+ // } catch (NotEnabledException e) {
+ // DialogHandler.showExceptionDialog(e);
+ // } catch (NotHandledException e) {
+ // DialogHandler.showExceptionDialog(e);
+ // } catch (NoWorkspaceException e) {
+ // DialogHandler.showExceptionDialog(e);
+ // }
+
+ if (modelElement != null) {
+ ECPModelelementContext context = null;
+ try {
+ context = ECPWorkspaceManager.getInstance().getWorkSpace().getProject(modelElement);
+ } catch (NoWorkspaceException e1) {
+ Activator.getDefault().logException(e1.getMessage(),e1);
+ }
+ MEEditorInput input = new MEEditorInput(modelElement, context);
+
+ try {
+ PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage()
+ .openEditor(input, "org.eclipse.emf.ecp.editor", true);
+ } catch (PartInitException e) {
+ Activator.getDefault().logException(e.getMessage(),e);
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/old/org.eclipse.emf.ecp.validation/.checkstyle b/old/org.eclipse.emf.ecp.validation/.checkstyle
new file mode 100644
index 0000000..d4fa17e
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.validation/.checkstyle
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<fileset-config file-format-version="1.2.0" simple-config="true" sync-formatter="false">
+ <fileset name="all" enabled="true" check-config-name="emfcpStyle" local="false">
+ <file-match-pattern match-pattern="." include-pattern="true"/>
+ </fileset>
+</fileset-config>
diff --git a/old/org.eclipse.emf.ecp.validation/.classpath b/old/org.eclipse.emf.ecp.validation/.classpath
new file mode 100644
index 0000000..2d1a430
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.validation/.classpath
@@ -0,0 +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>
diff --git a/old/org.eclipse.emf.ecp.validation/.project b/old/org.eclipse.emf.ecp.validation/.project
new file mode 100644
index 0000000..7cf2970
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.validation/.project
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.emf.ecp.validation</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>net.sf.eclipsecs.core.CheckstyleBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>net.sf.eclipsecs.core.CheckstyleNature</nature>
+ </natures>
+</projectDescription>
diff --git a/old/org.eclipse.emf.ecp.validation/META-INF/MANIFEST.MF b/old/org.eclipse.emf.ecp.validation/META-INF/MANIFEST.MF
new file mode 100644
index 0000000..daac3a0
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.validation/META-INF/MANIFEST.MF
@@ -0,0 +1,10 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Validation
+Bundle-SymbolicName: org.eclipse.emf.ecp.validation;singleton:=true
+Bundle-Version: 0.9.3.qualifier
+Bundle-Activator: org.eclipse.emf.ecp.validation.Activator
+Require-Bundle: org.eclipse.emf.common;bundle-version="[2.5.0,3.0.0)",
+ org.eclipse.emf.ecp.common
+Bundle-ActivationPolicy: lazy
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
diff --git a/old/org.eclipse.emf.ecp.validation/build.properties b/old/org.eclipse.emf.ecp.validation/build.properties
new file mode 100644
index 0000000..a0ba833
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.validation/build.properties
@@ -0,0 +1,9 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ plugin.xml,\
+ icons/,\
+ schema/
+src.includes = schema/,\
+ icons/
diff --git a/old/org.eclipse.emf.ecp.validation/icons/arrow_right.png b/old/org.eclipse.emf.ecp.validation/icons/arrow_right.png
new file mode 100644
index 0000000..b1a1819
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.validation/icons/arrow_right.png
Binary files differ
diff --git a/old/org.eclipse.emf.ecp.validation/icons/arrow_rotate_clockwise.png b/old/org.eclipse.emf.ecp.validation/icons/arrow_rotate_clockwise.png
new file mode 100644
index 0000000..aa65210
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.validation/icons/arrow_rotate_clockwise.png
Binary files differ
diff --git a/old/org.eclipse.emf.ecp.validation/icons/bell.png b/old/org.eclipse.emf.ecp.validation/icons/bell.png
new file mode 100644
index 0000000..6e0015d
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.validation/icons/bell.png
Binary files differ
diff --git a/old/org.eclipse.emf.ecp.validation/icons/bell_delete.png b/old/org.eclipse.emf.ecp.validation/icons/bell_delete.png
new file mode 100644
index 0000000..23907bb
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.validation/icons/bell_delete.png
Binary files differ
diff --git a/old/org.eclipse.emf.ecp.validation/icons/bell_go.png b/old/org.eclipse.emf.ecp.validation/icons/bell_go.png
new file mode 100644
index 0000000..b89bb34
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.validation/icons/bell_go.png
Binary files differ
diff --git a/old/org.eclipse.emf.ecp.validation/icons/defaultfiltericon.png b/old/org.eclipse.emf.ecp.validation/icons/defaultfiltericon.png
new file mode 100644
index 0000000..908612e
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.validation/icons/defaultfiltericon.png
Binary files differ
diff --git a/old/org.eclipse.emf.ecp.validation/icons/delete.png b/old/org.eclipse.emf.ecp.validation/icons/delete.png
new file mode 100644
index 0000000..08f2493
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.validation/icons/delete.png
Binary files differ
diff --git a/old/org.eclipse.emf.ecp.validation/icons/dirty.png b/old/org.eclipse.emf.ecp.validation/icons/dirty.png
new file mode 100644
index 0000000..14ca5ce
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.validation/icons/dirty.png
Binary files differ
diff --git a/old/org.eclipse.emf.ecp.validation/icons/error.png b/old/org.eclipse.emf.ecp.validation/icons/error.png
new file mode 100644
index 0000000..5311e6c
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.validation/icons/error.png
Binary files differ
diff --git a/old/org.eclipse.emf.ecp.validation/icons/error_decorate.png b/old/org.eclipse.emf.ecp.validation/icons/error_decorate.png
new file mode 100644
index 0000000..28847c4
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.validation/icons/error_decorate.png
Binary files differ
diff --git a/old/org.eclipse.emf.ecp.validation/icons/flag_blue.png b/old/org.eclipse.emf.ecp.validation/icons/flag_blue.png
new file mode 100644
index 0000000..003924f
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.validation/icons/flag_blue.png
Binary files differ
diff --git a/old/org.eclipse.emf.ecp.validation/icons/flag_red.png b/old/org.eclipse.emf.ecp.validation/icons/flag_red.png
new file mode 100644
index 0000000..e8a602d
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.validation/icons/flag_red.png
Binary files differ
diff --git a/old/org.eclipse.emf.ecp.validation/icons/flag_yellow.png b/old/org.eclipse.emf.ecp.validation/icons/flag_yellow.png
new file mode 100644
index 0000000..14c89a5
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.validation/icons/flag_yellow.png
Binary files differ
diff --git a/old/org.eclipse.emf.ecp.validation/icons/info.png b/old/org.eclipse.emf.ecp.validation/icons/info.png
new file mode 100644
index 0000000..8b24632
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.validation/icons/info.png
Binary files differ
diff --git a/old/org.eclipse.emf.ecp.validation/icons/link.png b/old/org.eclipse.emf.ecp.validation/icons/link.png
new file mode 100644
index 0000000..25eacb7
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.validation/icons/link.png
Binary files differ
diff --git a/old/org.eclipse.emf.ecp.validation/icons/openfilterlist.png b/old/org.eclipse.emf.ecp.validation/icons/openfilterlist.png
new file mode 100644
index 0000000..af4fe07
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.validation/icons/openfilterlist.png
Binary files differ
diff --git a/old/org.eclipse.emf.ecp.validation/icons/textfield.png b/old/org.eclipse.emf.ecp.validation/icons/textfield.png
new file mode 100644
index 0000000..d37e730
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.validation/icons/textfield.png
Binary files differ
diff --git a/old/org.eclipse.emf.ecp.validation/icons/validation.png b/old/org.eclipse.emf.ecp.validation/icons/validation.png
new file mode 100644
index 0000000..a0ddc00
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.validation/icons/validation.png
Binary files differ
diff --git a/old/org.eclipse.emf.ecp.validation/icons/warning.png b/old/org.eclipse.emf.ecp.validation/icons/warning.png
new file mode 100644
index 0000000..628cf2d
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.validation/icons/warning.png
Binary files differ
diff --git a/old/org.eclipse.emf.ecp.validation/icons/warning_decorate.png b/old/org.eclipse.emf.ecp.validation/icons/warning_decorate.png
new file mode 100644
index 0000000..14caf6c
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.validation/icons/warning_decorate.png
Binary files differ
diff --git a/old/org.eclipse.emf.ecp.validation/plugin.xml b/old/org.eclipse.emf.ecp.validation/plugin.xml
new file mode 100644
index 0000000..3d4faac
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.validation/plugin.xml
@@ -0,0 +1,103 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+<plugin>
+ <extension-point id="org.eclipse.emf.ecp.validation.filters" name="The validation filter extension point" schema="schema/org.eclipse.emf.ecp.validation.filter.exsd"/>
+ <extension-point id="org.eclipse.emf.ecp.validation.refactoring.strategies" name="Refactorings for the validation constraint violations" schema="schema/org.eclipse.emf.ecp.validation.refactorings.exsd"/>
+
+ <extension
+ point="org.eclipse.ui.views">
+ <view
+ category="org.eclipse.emf.ecp"
+ class="org.eclipse.emf.ecp.validation.ValidationView"
+ icon="icons/validation.png"
+ id="org.eclipse.emf.ecp.validation.validationView"
+ name="Validation View"
+ restorable="true">
+ </view>
+ </extension>
+
+<extension
+ point="org.eclipse.emf.ecp.validation.filters">
+ <filter
+ filter="org.eclipse.emf.ecp.validation.filter.impl.Severity1ValidationFilter"
+ name="Severity1ValidationFilter">
+ </filter>
+ <filter
+ filter="org.eclipse.emf.ecp.validation.filter.impl.Severity2ValidationFilter"
+ name="Severity2ValidationFilter">
+ </filter>
+ <filter
+ filter="org.eclipse.emf.ecp.validation.filter.impl.Severity4ValidationFilter"
+ name="Severity4ValidationFilter">
+ </filter>
+</extension>
+
+ <extension
+ point="org.eclipse.ui.commands">
+ <category
+ id="org.eclipse.emf.emfstore.client.ui.project"
+ name="ECP">
+ </category>
+ <command
+ defaultHandler="org.eclipse.emf.ecp.validation.ValidateHandler"
+ id="org.eclipse.emf.emfstore.client.ui.validate"
+ name="Validate">
+ </command>
+
+ </extension>
+
+ <extension
+ point="org.eclipse.ui.menus">
+ <menuContribution
+ locationURI="popup:org.eclipse.emf.ecp.navigator.viewer?after=additions">
+ <command
+ commandId="org.eclipse.emf.emfstore.client.ui.validate"
+ icon="icons/validation.png"
+ label="Validate"
+ style="push">
+ <visibleWhen
+ checkEnabled="false">
+ <and>
+ <count
+ value="1">
+ </count>
+ <iterate
+ operator="or">
+ <instanceof
+ value="org.eclipse.emf.ecore.EObject">
+ </instanceof>
+ </iterate>
+ <test
+ args="org.eclipse.emf.emfstore.client.ui.validate"
+ property="org.eclipse.emf.ecp.common.menuContributionsEnablement"
+ value="true">
+ </test>
+
+ </and>
+ </visibleWhen>
+ </command>
+ </menuContribution>
+ </extension>
+
+ <extension
+ point="org.eclipse.ui.bindings">
+ <key
+ commandId="org.eclipse.emf.emfstore.client.ui.validate"
+ contextId="org.eclipse.ui.contexts.window"
+ schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
+ sequence="Alt+V">
+ </key>
+ </extension>
+ <!--
+ //Disabled until bug 353491 is fixed
+ <extension
+ point="org.eclipse.ui.propertyPages">
+ <page
+ class="org.eclipse.emf.ecp.validation.pref.ValidationPropertyPage"
+ id="org.eclipse.emf.ecp.validation.pref.ValidationPropertyPage"
+ name="Validation">
+ </page>
+ </extension>-->
+
+
+</plugin>
diff --git a/old/org.eclipse.emf.ecp.validation/pom.xml b/old/org.eclipse.emf.ecp.validation/pom.xml
new file mode 100644
index 0000000..b9b455a
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.validation/pom.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.eclipse.emf.emfstore</groupId>
+ <artifactId>emfstore-parent</artifactId>
+ <version>0.9.3-SNAPSHOT</version>
+ <relativePath>../../org.eclipse.emf.emfstore.releng/emfstore-parent/</relativePath>
+ </parent>
+ <groupId>org.eclipse.emf.emfstore</groupId>
+ <artifactId>org.eclipse.emf.ecp.validation</artifactId>
+ <version>0.9.3-SNAPSHOT</version>
+ <packaging>eclipse-plugin</packaging>
+</project>
diff --git a/old/org.eclipse.emf.ecp.validation/schema/org.eclipse.emf.ecp.validation.filter.exsd b/old/org.eclipse.emf.ecp.validation/schema/org.eclipse.emf.ecp.validation.filter.exsd
new file mode 100644
index 0000000..c721439
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.validation/schema/org.eclipse.emf.ecp.validation.filter.exsd
@@ -0,0 +1,109 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- Schema file written by PDE -->
+<schema targetNamespace="org.eclipse.emf.ecp.validation" xmlns="http://www.w3.org/2001/XMLSchema">
+<annotation>
+ <appinfo>
+ <meta.schema plugin="org.eclipse.emf.ecp.validation" id="org.eclipse.emf.ecp.validation.filters" name="The validation filter extension point"/>
+ </appinfo>
+ <documentation>
+ [Enter description of this extension point.]
+ </documentation>
+ </annotation>
+
+ <element name="extension">
+ <annotation>
+ <appinfo>
+ <meta.element />
+ </appinfo>
+ </annotation>
+ <complexType>
+ <sequence>
+ <element ref="filter" minOccurs="0" maxOccurs="unbounded"/>
+ </sequence>
+ <attribute name="point" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="id" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="name" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appinfo>
+ <meta.attribute translatable="true"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="filter">
+ <complexType>
+ <attribute name="name" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="filter" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appinfo>
+ <meta.attribute kind="java" basedOn="org.eclipse.emf.ecp.validation.filter.ValidationFilter:"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="since"/>
+ </appinfo>
+ <documentation>
+ [Enter the first release in which this extension point appears.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="examples"/>
+ </appinfo>
+ <documentation>
+ [Enter extension point usage example here.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="apiinfo"/>
+ </appinfo>
+ <documentation>
+ [Enter API information here.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="implementation"/>
+ </appinfo>
+ <documentation>
+ [Enter information about supplied implementation of this extension point.]
+ </documentation>
+ </annotation>
+
+
+</schema>
diff --git a/old/org.eclipse.emf.ecp.validation/schema/org.eclipse.emf.ecp.validation.refactorings.exsd b/old/org.eclipse.emf.ecp.validation/schema/org.eclipse.emf.ecp.validation.refactorings.exsd
new file mode 100644
index 0000000..586ddc9
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.validation/schema/org.eclipse.emf.ecp.validation.refactorings.exsd
@@ -0,0 +1,109 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- Schema file written by PDE -->
+<schema targetNamespace="org.eclipse.emf.ecp.validation" xmlns="http://www.w3.org/2001/XMLSchema">
+<annotation>
+ <appinfo>
+ <meta.schema plugin="org.eclipse.emf.ecp.validation" id="org.eclipse.emf.ecp.validation.refactoring.strategies" name="Refactorings for the validation constraint violations"/>
+ </appinfo>
+ <documentation>
+ [Enter description of this extension point.]
+ </documentation>
+ </annotation>
+
+ <element name="extension">
+ <annotation>
+ <appinfo>
+ <meta.element />
+ </appinfo>
+ </annotation>
+ <complexType>
+ <sequence minOccurs="1" maxOccurs="unbounded">
+ <element ref="refactoringStrategy"/>
+ </sequence>
+ <attribute name="point" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="id" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="name" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appinfo>
+ <meta.attribute translatable="true"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="refactoringStrategy">
+ <complexType>
+ <attribute name="applicableFor" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="strategy" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appinfo>
+ <meta.attribute kind="java" basedOn=":org.eclipse.emf.ecp.validation.refactoring.strategy.RefactoringStrategy"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="since"/>
+ </appinfo>
+ <documentation>
+ [Enter the first release in which this extension point appears.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="examples"/>
+ </appinfo>
+ <documentation>
+ [Enter extension point usage example here.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="apiinfo"/>
+ </appinfo>
+ <documentation>
+ [Enter API information here.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="implementation"/>
+ </appinfo>
+ <documentation>
+ [Enter information about supplied implementation of this extension point.]
+ </documentation>
+ </annotation>
+
+
+</schema>
diff --git a/old/org.eclipse.emf.ecp.validation/src/org/eclipse/emf/ecp/validation/Activator.java b/old/org.eclipse.emf.ecp.validation/src/org/eclipse/emf/ecp/validation/Activator.java
new file mode 100644
index 0000000..704b008
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.validation/src/org/eclipse/emf/ecp/validation/Activator.java
@@ -0,0 +1,76 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2011 Chair for Applied Software Engineering,
+ * Technische Universitaet Muenchen.
+ * 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:
+ ******************************************************************************/
+package org.eclipse.emf.ecp.validation;
+
+import org.eclipse.emf.ecp.common.util.AbstractECPPlugin;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle.
+ */
+public class Activator extends AbstractECPPlugin {
+
+ /**
+ * The plug-in ID.
+ */
+ public static final String PLUGIN_ID = "org.eclipse.emf.ecp.validation"; //$NON-NLS-1$
+
+ // The shared instance
+ private static Activator plugin;
+
+ /*
+ * (non-Javadoc)
+ * @see
+ * org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext
+ * )
+ */
+ // BEGIN SUPRESS CATCH EXCEPTION
+ @Override
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ plugin = this;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see
+ * org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext
+ * )
+ */
+ @Override
+ public void stop(BundleContext context) throws Exception {
+ plugin = null;
+ super.stop(context);
+ }
+
+ // END SUPRESS CATCH EXCEPTION
+
+ /**
+ *
+ * @return the shared instance
+ */
+ public static Activator getDefault() {
+ return plugin;
+ }
+
+ /**
+ * Returns an image descriptor for the image file at the given. plug-in
+ * relative path
+ *
+ * @param path
+ * the path
+ * @return the image descriptor
+ */
+ public static ImageDescriptor getImageDescriptor(String path) {
+ return imageDescriptorFromPlugin(PLUGIN_ID, path);
+ }
+}
\ No newline at end of file
diff --git a/old/org.eclipse.emf.ecp.validation/src/org/eclipse/emf/ecp/validation/ValidateHandler.java b/old/org.eclipse.emf.ecp.validation/src/org/eclipse/emf/ecp/validation/ValidateHandler.java
new file mode 100644
index 0000000..bb165d7
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.validation/src/org/eclipse/emf/ecp/validation/ValidateHandler.java
@@ -0,0 +1,113 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2011 Chair for Applied Software Engineering,
+ * Technische Universitaet Muenchen.
+ * 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:
+ ******************************************************************************/
+package org.eclipse.emf.ecp.validation;
+
+import java.util.Iterator;
+
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.emf.common.util.Diagnostic;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.util.Diagnostician;
+import org.eclipse.emf.ecp.common.commands.ECPCommand;
+import org.eclipse.emf.ecp.common.model.ECPWorkspaceManager;
+import org.eclipse.emf.ecp.common.model.NoWorkspaceException;
+import org.eclipse.emf.ecp.common.util.DialogHandler;
+import org.eclipse.emf.ecp.common.util.UiUtil;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.PlatformUI;
+
+/**
+ * Handler to validate the project.
+ *
+ * @author carlan
+ */
+
+/**
+ * @author Haunolder
+ *
+ */
+
+public class ValidateHandler extends AbstractHandler {
+
+ private Diagnostic diagnostic;
+
+ /**
+ * {@inheritDoc}
+ */
+ public Object execute(ExecutionEvent event) throws ExecutionException {
+
+ // the object that is to be validated
+ EObject toValidate = UiUtil.getModelElement(event);
+
+ try {
+ if (ECPWorkspaceManager.getInstance().getWorkSpace().isRootObject(toValidate)) {
+ toValidate = ECPWorkspaceManager.getInstance().getWorkSpace().getActiveProject().getRootContainer();
+ }
+ } catch (NoWorkspaceException e) {
+ return null;
+ }
+
+ // if still null, do nothing, otherwise trigger validation run
+ if (toValidate != null) {
+ final EObject validate = toValidate;
+ new ECPCommand(validate) {
+ @Override
+ protected void doRun() {
+ validateWithoutCommand(validate);
+ }
+ }.run(false);
+ }
+ // validation occurred and the validation view is being instantiated
+ instantiateValidationView();
+
+ return null;
+ }
+
+ /**
+ * Instantiates the ValidationView.
+ */
+ private void instantiateValidationView() {
+ IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
+ ValidationView validationView = null;
+ try {
+ validationView = (ValidationView) page.showView("org.eclipse.emf.ecp.validation.validationView");
+
+ } catch (PartInitException e) {
+ DialogHandler.showExceptionDialog(e);
+ }
+ validationView.updateTable(diagnostic);
+ }
+
+ /**
+ * Perform validation run.
+ *
+ * @param object
+ * : the object to be validated
+ */
+ public void validateWithoutCommand(EObject object) {
+ diagnostic = Diagnostician.INSTANCE.validate(object);
+ if (diagnostic.getSeverity() == Diagnostic.ERROR || diagnostic.getSeverity() == Diagnostic.WARNING) {
+ for (Iterator<Diagnostic> i = diagnostic.getChildren().iterator(); i.hasNext();) {
+ Diagnostic childDiagnostic = i.next();
+ switch (childDiagnostic.getSeverity()) {
+ case Diagnostic.ERROR:
+ case Diagnostic.WARNING:
+ default:
+ break;
+ }
+ }
+ }
+ }
+
+}
\ No newline at end of file
diff --git a/old/org.eclipse.emf.ecp.validation/src/org/eclipse/emf/ecp/validation/ValidationFilterList.java b/old/org.eclipse.emf.ecp.validation/src/org/eclipse/emf/ecp/validation/ValidationFilterList.java
new file mode 100644
index 0000000..63e20ca
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.validation/src/org/eclipse/emf/ecp/validation/ValidationFilterList.java
@@ -0,0 +1,42 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2011 Chair for Applied Software Engineering,
+ * Technische Universitaet Muenchen.
+ * 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:
+ ******************************************************************************/
+package org.eclipse.emf.ecp.validation;
+
+import org.eclipse.jface.viewers.ILabelProvider;
+import org.eclipse.jface.viewers.IStructuredContentProvider;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.dialogs.ListSelectionDialog;
+
+/**
+ * The list of the validation filters.
+ *
+ * @author Carmen Carlan
+ */
+public class ValidationFilterList extends ListSelectionDialog {
+
+ /**
+ * @param parentShell
+ * the
+ * @param input
+ * the
+ * @param contentProvider
+ * the
+ * @param labelProvider
+ * the
+ * @param message
+ * the
+ */
+ public ValidationFilterList(Shell parentShell, Object input, IStructuredContentProvider contentProvider,
+ ILabelProvider labelProvider, String message) {
+ super(parentShell, input, contentProvider, labelProvider, message);
+ }
+
+}
\ No newline at end of file
diff --git a/old/org.eclipse.emf.ecp.validation/src/org/eclipse/emf/ecp/validation/ValidationView.java b/old/org.eclipse.emf.ecp.validation/src/org/eclipse/emf/ecp/validation/ValidationView.java
new file mode 100644
index 0000000..695db95
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.validation/src/org/eclipse/emf/ecp/validation/ValidationView.java
@@ -0,0 +1,537 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2011 Chair for Applied Software Engineering,
+ * Technische Universitaet Muenchen.
+ * 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:
+ ******************************************************************************/
+package org.eclipse.emf.ecp.validation;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.notify.impl.AdapterImpl;
+import org.eclipse.emf.common.util.BasicDiagnostic;
+import org.eclipse.emf.common.util.Diagnostic;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.util.EcoreUtil;
+import org.eclipse.emf.ecp.common.TableViewerColumnSorter;
+import org.eclipse.emf.ecp.common.commands.ECPCommand;
+import org.eclipse.emf.ecp.common.model.ECPWorkspaceManager;
+import org.eclipse.emf.ecp.common.model.NoWorkspaceException;
+import org.eclipse.emf.ecp.common.model.workSpaceModel.ECPProject;
+import org.eclipse.emf.ecp.common.model.workSpaceModel.ECPWorkspace;
+import org.eclipse.emf.ecp.common.model.workSpaceModel.WorkSpaceModelPackage;
+import org.eclipse.emf.ecp.common.utilities.ActionHelper;
+import org.eclipse.emf.ecp.validation.filter.FilterTableViewer;
+import org.eclipse.emf.ecp.validation.filter.ValidationFilter;
+import org.eclipse.emf.ecp.validation.providers.ConstraintLabelProvider;
+import org.eclipse.emf.ecp.validation.providers.SeverityLabelProvider;
+import org.eclipse.emf.ecp.validation.providers.ValidationContentProvider;
+import org.eclipse.emf.ecp.validation.providers.ValidationFilterLabelProvider;
+import org.eclipse.emf.ecp.validation.providers.ValidationLabelProvider;
+import org.eclipse.emf.ecp.validation.refactoring.strategy.RefactoringResult;
+import org.eclipse.emf.ecp.validation.refactoring.strategy.RefactoringStrategy;
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.IToolBarManager;
+import org.eclipse.jface.dialogs.DialogSettings;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.viewers.ColumnLabelProvider;
+import org.eclipse.jface.viewers.DoubleClickEvent;
+import org.eclipse.jface.viewers.IDoubleClickListener;
+import org.eclipse.jface.viewers.IStructuredContentProvider;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.jface.viewers.TableViewer;
+import org.eclipse.jface.viewers.TableViewerColumn;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.TableCursor;
+import org.eclipse.swt.events.KeyEvent;
+import org.eclipse.swt.events.KeyListener;
+import org.eclipse.swt.events.MenuDetectEvent;
+import org.eclipse.swt.events.MenuDetectListener;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Menu;
+import org.eclipse.swt.widgets.MenuItem;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Table;
+import org.eclipse.swt.widgets.TableItem;
+import org.eclipse.ui.IActionBars;
+import org.eclipse.ui.dialogs.ListDialog;
+import org.eclipse.ui.part.ViewPart;
+
+/**
+ * The Validation View.
+ *
+ * @author Carmen Carlan
+ *
+ */
+public class ValidationView extends ViewPart {
+
+ private TableViewer tableViewer;
+
+ private DialogSettings settings;
+
+ private String filename;
+
+ private final String viewId = "org.eclipse.emf.ecp.validation.customValidationView";
+
+ private AdapterImpl workspaceListenerAdapter;
+
+ private Shell shell;
+
+ private Table table;
+
+ private ArrayList<ValidationFilter> validationFilters;
+
+ private TableItem tableItem;
+
+ private ECPWorkspace workspace;
+
+ private ValidationLabelProvider labelProvider;
+
+ /**
+ * Default constructor.
+ */
+ public ValidationView() {
+ IPath path = org.eclipse.emf.ecp.common.Activator.getDefault().getStateLocation();
+ filename = path.append("settings.txt").toOSString();
+ settings = new DialogSettings("Top");
+ try {
+ settings.load(filename);
+ } catch (IOException e) {
+ // Do nothing.
+ }
+
+ try {
+ workspace = ECPWorkspaceManager.getInstance().getWorkSpace();
+ } catch (NoWorkspaceException e) {
+ Activator.getDefault().logException(e.getMessage(), e);
+ return;
+ }
+ workspaceListenerAdapter = new AdapterImpl() {
+
+ @Override
+ public void notifyChanged(Notification msg) {
+ if ((msg.getFeatureID(ECPWorkspace.class)) == WorkSpaceModelPackage.ECP_WORKSPACE__PROJECTS) {
+ if (msg.getOldValue() != null
+ && (msg.getOldValue() instanceof List<?> || msg.getOldValue() instanceof ECPProject)) {
+ tableViewer.setInput(new ArrayList<IStatus>());
+ }
+
+ }
+ super.notifyChanged(msg);
+ }
+ };
+ workspace.eAdapters().add(workspaceListenerAdapter);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void createPartControl(Composite parent) {
+ tableViewer = new FilterTableViewer(parent, SWT.SINGLE | SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL
+ | SWT.FULL_SELECTION);
+ createTable();
+ this.shell = parent.getShell();
+ IActionBars bars = getViewSite().getActionBars();
+ IToolBarManager menuManager = bars.getToolBarManager();
+ OpenFilterDialogAction openFilterDialogAction = new OpenFilterDialogAction();
+ openFilterDialogAction.setImageDescriptor(Activator.getImageDescriptor("icons/openfilterlist.png"));
+ openFilterDialogAction.setToolTipText("Add one or more filters to be applied to the validation view.");
+ menuManager.add(openFilterDialogAction);
+ hookDoubleClickAction();
+ tableViewer.getTable().addMenuDetectListener(new MenuDetectListenerImplementation());
+ }
+
+ /**
+ * Creates the table which will be displayed in the view.
+ */
+ private void createTable() {
+ // CREATE TABLE
+ table = tableViewer.getTable();
+ GridData gridData = new GridData(SWT.FILL, SWT.FILL, true, true);
+ gridData.horizontalSpan = 5;
+ table.setLayoutData(gridData);
+ table.setLinesVisible(true);
+ table.setHeaderVisible(true);
+ TableViewerColumn column;
+
+ // severity column
+ column = new TableViewerColumn(tableViewer, SWT.CENTER, 0);
+ column.getColumn().setText("Severity");
+ column.getColumn().setWidth(50);
+ setLabelProviderAndComparator(column, new SeverityLabelProvider());
+
+ // constraint column
+ column = new TableViewerColumn(tableViewer, SWT.LEFT, 1);
+ column.getColumn().setText("Constraint");
+ column.getColumn().setWidth(200);
+ setLabelProviderAndComparator(column, new ConstraintLabelProvider());
+
+ // affected model element column
+ column = new TableViewerColumn(tableViewer, SWT.LEFT, 2);
+ column.getColumn().setText("Affected ModelElement");
+ column.getColumn().setWidth(200);
+ labelProvider = new ValidationLabelProvider();
+ setLabelProviderAndComparator(column, labelProvider);
+
+ // content provider
+ tableViewer.setContentProvider(new ValidationContentProvider());
+ TableCursor tableCursor = new TableCursor(table, SWT.NONE);
+ tableCursor.setVisible(false);
+ table.addKeyListener(new KeyListener() {
+
+ public void keyReleased(KeyEvent e) {
+ if (e.stateMask == SWT.ALT && e.keyCode == 'r') {
+ tableItem = ((Table) e.getSource()).getSelection()[0];
+ startRefactoring();
+ }
+ }
+
+ public void keyPressed(KeyEvent e) {
+ // nothing to do here
+ }
+ });
+ }
+
+ /**
+ * Sets the LabelProvider and Comparator for a specific column.
+ *
+ * @param column
+ * @param labelProvider
+ */
+ private void setLabelProviderAndComparator(TableViewerColumn column, ColumnLabelProvider labelProvider) {
+ column.setLabelProvider(labelProvider);
+ column.getViewer().setComparator(new TableViewerColumnSorter(tableViewer, column, labelProvider));
+ }
+
+ /**
+ * Attaches a double-click action to the view.
+ */
+ private void hookDoubleClickAction() {
+ tableViewer.addDoubleClickListener(new IDoubleClickListener() {
+
+ public void doubleClick(DoubleClickEvent event) {
+ IStructuredSelection selection = (IStructuredSelection) event.getSelection();
+ IStatus constraintStatus = (IStatus) selection.getFirstElement();
+ BasicDiagnostic inputElement = (BasicDiagnostic) BasicDiagnostic.toDiagnostic(constraintStatus);
+ EObject me = (EObject) inputElement.getData().get(0);
+ if (me instanceof EObject) {
+ ActionHelper.openModelElement(me, viewId);
+ }
+ }
+
+ });
+ }
+
+ /**
+ * Gets the refactoring strategies defined for the plug-in.
+ *
+ * @param status
+ * @return
+ */
+ private ArrayList<RefactoringStrategy> getRefactoringStrategiesFromExtensionPoint(IStatus status) {
+ ArrayList<RefactoringStrategy> refactoringStrategies = new ArrayList<RefactoringStrategy>();
+ IConfigurationElement[] config = Platform.getExtensionRegistry().getConfigurationElementsFor(
+ "org.eclipse.emf.ecp.bulidInValidation.refactoring.strategies");
+ for (IConfigurationElement element : config) {
+ try {
+ if (element.getAttribute("applicableFor").equals(status.getCode())) {
+ final Object object = element.createExecutableExtension("strategy");
+ RefactoringStrategy strategy = (RefactoringStrategy) object;
+ strategy.setConstraintStatus(status);
+ refactoringStrategies.add(strategy);
+ }
+ } catch (CoreException e) {
+ Activator.getDefault().logWarning("Exception loading refactoring strategies from the extension point",
+ e);
+ }
+
+ }
+ return refactoringStrategies;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void setFocus() {
+
+ }
+
+ /**
+ * Updates the validation view table for the new live validation.
+ *
+ * @param diagnostic
+ * validation results.
+ */
+ public void updateTable(Diagnostic diagnostic) {
+ tableViewer.setInput(diagnostic);
+ // this is added to fix the bug regarding context menu not being shown
+ // correctly in navigator, after validation viewer was shown.
+ tableViewer.getTable().setFocus();
+
+ }
+
+ /**
+ * Gets the filters we defined for the plug-in.
+ *
+ * @return
+ */
+ private ArrayList<ValidationFilter> getFiltersFromExtensionPoint() {
+ if (validationFilters == null) {
+ validationFilters = new ArrayList<ValidationFilter>();
+ IConfigurationElement[] config = Platform.getExtensionRegistry().getConfigurationElementsFor(
+ "org.eclipse.emf.ecp.validation.filters");
+ for (IConfigurationElement element : config) {
+ try {
+ Object object = element.createExecutableExtension("filter");
+ if (object instanceof ValidationFilter) {
+ ValidationFilter validationFilter = (ValidationFilter) object;
+ if (validationFilter.init()) {
+ validationFilters.add(validationFilter);
+ }
+ }
+ } catch (CoreException e) {
+ e.printStackTrace();
+ }
+ }
+ }
+ return validationFilters;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void dispose() {
+ workspace.eAdapters().remove(workspaceListenerAdapter);
+ if (labelProvider != null) {
+ labelProvider.dispose();
+ }
+ super.dispose();
+ }
+
+ /**
+ * Starts refactoring.
+ */
+ private void startRefactoring() {
+ IStatus constraintStatus = (IStatus) tableItem.getData();
+ List<?> abstractRefactoringStrategies = getRefactoringStrategiesFromExtensionPoint(constraintStatus);
+ if (abstractRefactoringStrategies.isEmpty()) {
+ return;
+ }
+ RefactoringResult refactoringResult = RefactoringResult.ABORT;
+ if (abstractRefactoringStrategies.size() == 1) {
+ RefactoringStrategy refactoringStrategy = (RefactoringStrategy) abstractRefactoringStrategies.get(0);
+ refactoringStrategy.setShell(shell);
+ refactoringResult = refactoringStrategy.startRefactoring();
+ } else {
+ // otherwise show list dialog
+ ListDialog listDialog = new ListDialog(shell);
+ listDialog.setInput(abstractRefactoringStrategies);
+ listDialog.setLabelProvider(new RefactoringStrategyLabelProvider());
+ listDialog.setContentProvider(new SimpleContentProvider());
+ listDialog.setTitle("Choose a refactoring strategy");
+ listDialog.open();
+ Object[] result = listDialog.getResult();
+ if (result != null && result.length > 0) {
+ RefactoringStrategy refactoringStrategy = (RefactoringStrategy) result[0];
+ refactoringStrategy.setShell(shell);
+ refactoringResult = refactoringStrategy.startRefactoring();
+ }
+ }
+ if (refactoringResult == RefactoringResult.NO_VIOLATION
+ || refactoringResult == RefactoringResult.SUCCESS_CREATE) {
+ tableItem.dispose();
+ }
+ }
+
+ /**
+ * Empty the table from the view.
+ *
+ * @param status
+ */
+ private void removeAllTableItemsForEObject(final IStatus status) {
+ BasicDiagnostic inputElement1 = (BasicDiagnostic) BasicDiagnostic.toDiagnostic(status);
+ EObject deletee = (EObject) inputElement1.getData().get(0);
+ for (TableItem tableItem : tableViewer.getTable().getItems()) {
+ IStatus constraintStatus = (IStatus) tableItem.getData();
+ BasicDiagnostic inputElement2 = (BasicDiagnostic) BasicDiagnostic.toDiagnostic(constraintStatus);
+ EObject modelElement = (EObject) inputElement2.getData().get(0);
+ if (deletee == modelElement) {
+ tableItem.dispose();
+ }
+ }
+ }
+
+ /**
+ * Context menu listener.
+ */
+ private final class MenuDetectListenerImplementation implements MenuDetectListener {
+
+ public void menuDetected(MenuDetectEvent e) {
+ // get the table
+ Table table = (Table) e.getSource();
+ if (table.getSelection() == null || table.getSelection().length == 0) {
+ return;
+ }
+ // get the first table item that was selected (no multiple select)
+ tableItem = table.getSelection()[0];
+ // extract the violation status
+ final IStatus status = (IStatus) tableItem.getData();
+ // create the menu
+ Menu leftClickMenu = new Menu(shell, SWT.POP_UP);
+ // add refactoring menu item if refactoring strategies are available
+ List<RefactoringStrategy> refactoringStrategies = getRefactoringStrategiesFromExtensionPoint(status);
+ if (refactoringStrategies.size() != 0) {
+ final MenuItem refactorMenuItem = new MenuItem(leftClickMenu, SWT.NONE);
+ // add the menu item
+ refactorMenuItem.setData(tableItem);
+ refactorMenuItem.setText("Perform refactoring");
+ refactorMenuItem.setImage(Activator.getImageDescriptor("icons/bell.png").createImage());
+ // refactorMenuItem.setData(data)
+ refactorMenuItem.addSelectionListener(new RefactoringSelectionListener());
+ }
+ // // ignore constraint menu item
+ // MenuItem ignoreMenuItem = new MenuItem(leftClickMenu, SWT.NONE);
+ // ignoreMenuItem.setData(refactoringStrategies);
+ // ignoreMenuItem.setText("Ignore violation");
+ // ignoreMenuItem.setImage(Activator.getImageDescriptor(
+ // "icons/bell_delete.png").createImage());
+ // delete model element menu item
+ MenuItem deleteMenuItem = new MenuItem(leftClickMenu, SWT.NONE);
+ deleteMenuItem.setData(refactoringStrategies);
+ deleteMenuItem.setText("Delete underlying element");
+ deleteMenuItem.setImage(Activator.getImageDescriptor("icons/delete.png").createImage());
+ deleteMenuItem.addSelectionListener(new SelectionAdapter() {
+
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ BasicDiagnostic inputElement = (BasicDiagnostic) BasicDiagnostic.toDiagnostic(status);
+ EObject target = (EObject) inputElement.getData().get(0);
+ if (MessageDialog.openQuestion(shell, "Confirm deletion", "Do you really wish to delete "
+ + target.getClass().getSimpleName() + "?")) {
+ new ECPCommand(target) {
+
+ @Override
+ protected void doRun() {
+ BasicDiagnostic inputElement = (BasicDiagnostic) BasicDiagnostic.toDiagnostic(status);
+ EObject target = (EObject) inputElement.getData().get(0);
+ EcoreUtil.delete(target);
+ }
+ }.run(false);
+ }
+ removeAllTableItemsForEObject(status);
+ }
+ });
+ // set menu to visible
+ leftClickMenu.setVisible(true);
+ }
+
+ /**
+ * Refactoring selection listener.
+ */
+ private final class RefactoringSelectionListener implements SelectionListener {
+ public void widgetSelected(SelectionEvent e) {
+ // only show selection dialog if there is more than one
+ // refactoring
+ startRefactoring();
+ }
+
+ public void widgetDefaultSelected(SelectionEvent e) {
+ // nothing to do here
+ }
+ }
+ }
+
+ /**
+ * The filter dialog action.
+ *
+ */
+ private final class OpenFilterDialogAction extends Action {
+
+ @Override
+ public void run() {
+ ValidationFilterList validationFilterList = new ValidationFilterList(shell, getFiltersFromExtensionPoint(),
+ new SimpleContentProvider(), new ValidationFilterLabelProvider(), "Test");
+ validationFilterList.setTitle("Choose one or more filters");
+ validationFilterList.setInitialSelections(tableViewer.getFilters());
+ validationFilterList.open();
+ if (validationFilterList.getReturnCode() == IStatus.OK) {
+ removeAllFilters();
+ for (Object object : validationFilterList.getResult()) {
+ if (object instanceof ValidationFilter) {
+ ValidationFilter validationFilter = (ValidationFilter) object;
+ applyFilter(validationFilter);
+ }
+ }
+ }
+ }
+
+ private void applyFilter(ValidationFilter validationFilter) {
+ tableViewer.addFilter(validationFilter);
+ }
+
+ private void removeAllFilters() {
+ tableViewer.resetFilters();
+ }
+ }
+
+ /**
+ * Label provider for a refactoring strategy.
+ */
+ private final class RefactoringStrategyLabelProvider extends LabelProvider {
+
+ @Override
+ public Image getImage(Object element) {
+ return Activator.getImageDescriptor("icons/bell.png").createImage();
+ }
+
+ @Override
+ public String getText(Object element) {
+ return ((RefactoringStrategy) ((Object[]) element)[0]).getDescription();
+ }
+ }
+
+ /**
+ * Simple structured content provider for lists.
+ */
+ private final class SimpleContentProvider implements IStructuredContentProvider {
+
+ public Object[] getElements(Object inputElement) {
+ List<?> list = (List<?>) inputElement;
+ if (list.isEmpty()) {
+ return new Object[0];
+ }
+ return list.toArray();
+ }
+
+ public void dispose() {
+
+ }
+
+ public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
+
+ }
+ }
+
+}
\ No newline at end of file
diff --git a/old/org.eclipse.emf.ecp.validation/src/org/eclipse/emf/ecp/validation/filter/FilterTableViewer.java b/old/org.eclipse.emf.ecp.validation/src/org/eclipse/emf/ecp/validation/filter/FilterTableViewer.java
new file mode 100644
index 0000000..16ef937
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.validation/src/org/eclipse/emf/ecp/validation/filter/FilterTableViewer.java
@@ -0,0 +1,70 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2011 Chair for Applied Software Engineering,
+ * Technische Universitaet Muenchen.
+ * 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:
+ ******************************************************************************/
+package org.eclipse.emf.ecp.validation.filter;
+
+import java.util.ArrayList;
+
+import org.eclipse.jface.viewers.TableViewer;
+import org.eclipse.swt.widgets.Composite;
+
+/**
+ * The filter table viewer.
+ *
+ * @author Carmen Carlan
+ */
+public class FilterTableViewer extends TableViewer {
+
+ /**
+ * @param parent the
+ * @param style the
+ */
+ public FilterTableViewer(Composite parent, int style) {
+ super(parent, style);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.StructuredViewer#getFilteredChildren(java.lang.Object)
+ */
+ @Override
+ protected Object[] getFilteredChildren(Object parent) {
+ return filter(getRawChildren(parent));
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.StructuredViewer#filter(java.lang.Object[])
+ */
+ @Override
+ protected Object[] filter(Object[] elements) {
+ if (getFilters() != null) {
+ ArrayList<Object> filtered = new ArrayList<Object>(elements.length);
+ Object root = getRoot();
+ for (int i = 0; i < elements.length; i++) {
+ boolean add = true;
+ for (int j = 0; j < getFilters().length; j++) {
+ add = (getFilters()[j]).select(this, root, elements[i]);
+ if (add) {
+ break;
+ }
+ }
+ if (add) {
+ filtered.add(elements[i]);
+ }
+ }
+ return filtered.toArray();
+ }
+ return elements;
+ }
+
+}
\ No newline at end of file
diff --git a/old/org.eclipse.emf.ecp.validation/src/org/eclipse/emf/ecp/validation/filter/ValidationFilter.java b/old/org.eclipse.emf.ecp.validation/src/org/eclipse/emf/ecp/validation/filter/ValidationFilter.java
new file mode 100644
index 0000000..c5c31c9
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.validation/src/org/eclipse/emf/ecp/validation/filter/ValidationFilter.java
@@ -0,0 +1,60 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2011 Chair for Applied Software Engineering,
+ * Technische Universitaet Muenchen.
+ * 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:
+ ******************************************************************************/
+package org.eclipse.emf.ecp.validation.filter;
+
+import org.eclipse.jface.viewers.ViewerFilter;
+import org.eclipse.swt.graphics.Image;
+
+/**
+ * The validation filter.
+ *
+ * @author Carmen Carlan
+ */
+public abstract class ValidationFilter extends ViewerFilter {
+
+ /**
+ * Initialization method.
+ *
+ * @return true if successful
+ */
+ public abstract boolean init();
+
+ /**
+ * A description of the filter.
+ *
+ * @return the description
+ */
+ public abstract String getDescription();
+
+ /**
+ * A name of the filter.
+ *
+ * @return the name
+ */
+ public abstract String getName();
+
+ /**
+ * An icon for the filter.
+ *
+ * @return the icon image
+ */
+ public abstract Image getImage();
+
+ /**
+ * Use description as toString string.
+ *
+ * @return the description
+ */
+ @Override
+ public String toString() {
+ return getDescription();
+ }
+}
\ No newline at end of file
diff --git a/old/org.eclipse.emf.ecp.validation/src/org/eclipse/emf/ecp/validation/filter/impl/Severity1ValidationFilter.java b/old/org.eclipse.emf.ecp.validation/src/org/eclipse/emf/ecp/validation/filter/impl/Severity1ValidationFilter.java
new file mode 100644
index 0000000..a0246ca
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.validation/src/org/eclipse/emf/ecp/validation/filter/impl/Severity1ValidationFilter.java
@@ -0,0 +1,76 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2011 Chair for Applied Software Engineering,
+ * Technische Universitaet Muenchen.
+ * 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:
+ ******************************************************************************/
+package org.eclipse.emf.ecp.validation.filter.impl;
+
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.emf.ecp.validation.Activator;
+import org.eclipse.emf.ecp.validation.filter.ValidationFilter;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.swt.graphics.Image;
+
+/**
+ * The "INFO" severity filter.
+ *
+ * @author Carmen Carlan
+ *
+ */
+public class Severity1ValidationFilter extends ValidationFilter {
+
+ /**
+ * default constructor.
+ */
+ public Severity1ValidationFilter() {
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public String getDescription() {
+ return "The severity validation filter";
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public Image getImage() {
+ return Activator.getImageDescriptor("icons/flag_blue.png").createImage();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public String getName() {
+ return getClass().getSimpleName();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public boolean select(Viewer viewer, Object parentElement, Object element) {
+ IStatus constraintStatus = (IStatus) element;
+ if (constraintStatus.getSeverity() == 1) {
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public boolean init() {
+ return true;
+ }
+}
\ No newline at end of file
diff --git a/old/org.eclipse.emf.ecp.validation/src/org/eclipse/emf/ecp/validation/filter/impl/Severity2ValidationFilter.java b/old/org.eclipse.emf.ecp.validation/src/org/eclipse/emf/ecp/validation/filter/impl/Severity2ValidationFilter.java
new file mode 100644
index 0000000..423dbc3
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.validation/src/org/eclipse/emf/ecp/validation/filter/impl/Severity2ValidationFilter.java
@@ -0,0 +1,73 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2011 Chair for Applied Software Engineering,
+ * Technische Universitaet Muenchen.
+ * 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:
+ ******************************************************************************/
+package org.eclipse.emf.ecp.validation.filter.impl;
+
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.emf.ecp.validation.Activator;
+import org.eclipse.emf.ecp.validation.filter.ValidationFilter;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.swt.graphics.Image;
+
+/**
+ * Validation warning filter.
+ */
+public class Severity2ValidationFilter extends ValidationFilter {
+
+ /**
+ * default constructor.
+ */
+ public Severity2ValidationFilter() {
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public String getDescription() {
+ return "The severity validation filter";
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public Image getImage() {
+ return Activator.getImageDescriptor("icons/flag_yellow.png").createImage();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public String getName() {
+ return getClass().getSimpleName();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public boolean select(Viewer viewer, Object parentElement, Object element) {
+ IStatus constraintStatus = (IStatus) element;
+ if (constraintStatus.getSeverity() == 2) {
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public boolean init() {
+ return true;
+ }
+}
\ No newline at end of file
diff --git a/old/org.eclipse.emf.ecp.validation/src/org/eclipse/emf/ecp/validation/filter/impl/Severity4ValidationFilter.java b/old/org.eclipse.emf.ecp.validation/src/org/eclipse/emf/ecp/validation/filter/impl/Severity4ValidationFilter.java
new file mode 100644
index 0000000..c5517ea
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.validation/src/org/eclipse/emf/ecp/validation/filter/impl/Severity4ValidationFilter.java
@@ -0,0 +1,73 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2011 Chair for Applied Software Engineering,
+ * Technische Universitaet Muenchen.
+ * 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:
+ ******************************************************************************/
+package org.eclipse.emf.ecp.validation.filter.impl;
+
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.emf.ecp.validation.Activator;
+import org.eclipse.emf.ecp.validation.filter.ValidationFilter;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.swt.graphics.Image;
+
+/**
+ * Validation error filter.
+ */
+public class Severity4ValidationFilter extends ValidationFilter {
+
+ /**
+ * default constructor.
+ */
+ public Severity4ValidationFilter() {
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public String getDescription() {
+ return "The severity validation filter";
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public Image getImage() {
+ return Activator.getImageDescriptor("icons/flag_red.png").createImage();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public String getName() {
+ return getClass().getSimpleName();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public boolean select(Viewer viewer, Object parentElement, Object element) {
+ IStatus constraintStatus = (IStatus) element;
+ if (constraintStatus.getSeverity() == 4) {
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public boolean init() {
+ return true;
+ }
+}
\ No newline at end of file
diff --git a/old/org.eclipse.emf.ecp.validation/src/org/eclipse/emf/ecp/validation/pref/ValidationPropertyKey.java b/old/org.eclipse.emf.ecp.validation/src/org/eclipse/emf/ecp/validation/pref/ValidationPropertyKey.java
new file mode 100644
index 0000000..794ce9a
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.validation/src/org/eclipse/emf/ecp/validation/pref/ValidationPropertyKey.java
@@ -0,0 +1,20 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2011 Chair for Applied Software Engineering,
+ * Technische Universitaet Muenchen.
+ * 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:
+ ******************************************************************************/
+//Disabled until bug 353491 is fixed
+package org.eclipse.emf.ecp.validation.pref;
+//
+//import org.eclipse.emf.emfstore.client.model.preferences.PropertyKey;
+//
+//
+//public enum ValidationPropertyKey implements PropertyKey{
+//
+// ENABLELIVEVALIDATION,
+//}
\ No newline at end of file
diff --git a/old/org.eclipse.emf.ecp.validation/src/org/eclipse/emf/ecp/validation/pref/ValidationPropertyPage.java b/old/org.eclipse.emf.ecp.validation/src/org/eclipse/emf/ecp/validation/pref/ValidationPropertyPage.java
new file mode 100644
index 0000000..7603c19
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.validation/src/org/eclipse/emf/ecp/validation/pref/ValidationPropertyPage.java
@@ -0,0 +1,161 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2011 Chair for Applied Software Engineering,
+ * Technische Universitaet Muenchen.
+ * 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:
+ ******************************************************************************/
+////Disabled until bug 353491 is fixed
+///**
+// * <copyright> Copyright (c) 2008-2009 Jonas Helming, Maximilian Koegel. 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 </copyright>
+// */
+package org.eclipse.emf.ecp.validation.pref;
+//
+//import org.eclipse.emf.emfstore.client.model.ProjectSpace;
+//import org.eclipse.emf.emfstore.client.model.WorkspaceManager;
+//import org.eclipse.emf.emfstore.client.model.preferences.PreferenceManager;
+//import org.eclipse.emf.emfstore.client.model.util.EMFStoreCommand;
+//import org.eclipse.emf.emfstore.client.ui.dialogs.login.LoginDialog;
+//import org.eclipse.emf.emfstore.server.model.accesscontrol.OrgUnitProperty;
+//import org.eclipse.jface.dialogs.MessageDialog;
+//import org.eclipse.jface.layout.GridLayoutFactory;
+//import org.eclipse.swt.SWT;
+//import org.eclipse.swt.layout.GridData;
+//import org.eclipse.swt.layout.GridLayout;
+//import org.eclipse.swt.widgets.Button;
+//import org.eclipse.swt.widgets.Composite;
+//import org.eclipse.swt.widgets.Control;
+//import org.eclipse.swt.widgets.Display;
+//import org.eclipse.swt.widgets.Label;
+//import org.eclipse.swt.widgets.TabFolder;
+//import org.eclipse.swt.widgets.TabItem;
+//import org.eclipse.ui.IWorkbenchPropertyPage;
+//import org.eclipse.ui.dialogs.PropertyPage;
+//
+///**
+// * A property page for the ShortcutActions.
+// *
+// * @author groeber
+// */
+//public class ValidationPropertyPage extends PropertyPage implements
+// IWorkbenchPropertyPage {
+//
+// /**
+// * Recording command to save the properties in the model.
+// *
+// */
+// private final class SavePropertiesCommand extends EMFStoreCommand {
+//
+// @Override
+// protected void doRun() {
+//
+// PreferenceManager.INSTANCE.setProperty(projectSpace, ValidationPropertyKey.ENABLELIVEVALIDATION,
+// cb.getSelection());
+// return;
+// }
+// }
+//
+// public boolean liveValidationEnabled = false;
+// private ProjectSpace projectSpace;
+// // private Project project;
+// private Button cb;
+//
+// @Override
+// protected Control createContents(Composite parent) {
+//
+// GridLayoutFactory.fillDefaults().applyTo(parent);
+// noDefaultAndApplyButton();
+//
+// if (!init()) {
+// Label label = new Label(parent, SWT.WRAP);
+// label.setText("Could not determine the current project!");
+// return label;
+// }
+// loadProperties();
+//
+// TabFolder folder = new TabFolder(parent, SWT.TOP);
+// TabItem generalTab = new TabItem(folder, SWT.NONE);
+//
+// generalTab.setControl(createLiveValidationTab(folder));
+// generalTab.setText("Live Validation");
+//
+// return parent;
+// }
+//
+// private Composite createLiveValidationTab(TabFolder parent) {
+// final Composite composite = new Composite(parent, SWT.NULL);
+// GridLayout gridLayout = new GridLayout(1, false);
+// composite.setLayout(gridLayout);
+//
+// cb = new Button(composite, SWT.CHECK);
+// cb.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false, 1, 1));
+// cb.setSelection(liveValidationEnabled);
+// cb.setText("Enable live Validation");
+//
+// return composite;
+// }
+//
+// private void loadProperties() {
+// try {
+//
+// OrgUnitProperty userProp = PreferenceManager.INSTANCE.getProperty(projectSpace, ValidationPropertyKey.ENABLELIVEVALIDATION);
+//
+//
+// if (userProp != null) {
+// liveValidationEnabled =userProp.getBooleanProperty();
+// }
+// } catch (IllegalStateException e) {
+// if (e.getMessage().contains(
+// "No default value for key ENABLELIVEVALIDATION")) {
+// // Ignore this case: "first run property wasn't set"
+// } else
+// throw e;
+// }
+// }
+//
+// private boolean init() {
+//
+// projectSpace = WorkspaceManager.getInstance().getCurrentWorkspace()
+// .getActiveProjectSpace();
+// return true;
+// }
+//
+// public boolean performOk() {
+// final EMFStoreCommand command = new SavePropertiesCommand();
+// command.run();
+// if (projectSpace.getUsersession().isLoggedIn()) {
+// new EMFStoreCommand() {
+//
+// @Override
+// protected void doRun() {
+// projectSpace.transmitProperties();
+// }
+// }.run();
+// } else {
+// new EMFStoreCommand() {
+//
+// @Override
+// protected void doRun() {
+// boolean yes = MessageDialog
+// .openQuestion(
+// getShell(),
+// "Transmit properties",
+// "You are currently not logged in! Do you wish to log in and thereby transmit your properties?");
+// if (yes) {
+// LoginDialog loginDialog = new LoginDialog(Display
+// .getCurrent().getActiveShell(), projectSpace
+// .getUsersession().getServerInfo());
+// loginDialog.open();
+// }
+// }
+// }.run();
+//
+// }
+// return true;
+// }
+//}
\ No newline at end of file
diff --git a/old/org.eclipse.emf.ecp.validation/src/org/eclipse/emf/ecp/validation/providers/ConstraintLabelProvider.java b/old/org.eclipse.emf.ecp.validation/src/org/eclipse/emf/ecp/validation/providers/ConstraintLabelProvider.java
new file mode 100644
index 0000000..ffb8596
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.validation/src/org/eclipse/emf/ecp/validation/providers/ConstraintLabelProvider.java
@@ -0,0 +1,36 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2011 Chair for Applied Software Engineering,
+ * Technische Universitaet Muenchen.
+ * 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:
+ ******************************************************************************/
+package org.eclipse.emf.ecp.validation.providers;
+
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.jface.viewers.ColumnLabelProvider;
+
+/**
+ * ColumnLabelProvider showing the constraint name.
+ *
+ * @author Carmen Carlan
+ *
+ */
+public class ConstraintLabelProvider extends ColumnLabelProvider {
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public String getText(Object element) {
+ if (element instanceof IStatus) {
+ IStatus constraint = (IStatus) element;
+ return constraint.getMessage();
+ }
+ return super.getText(element);
+ }
+
+}
\ No newline at end of file
diff --git a/old/org.eclipse.emf.ecp.validation/src/org/eclipse/emf/ecp/validation/providers/SeverityLabelProvider.java b/old/org.eclipse.emf.ecp.validation/src/org/eclipse/emf/ecp/validation/providers/SeverityLabelProvider.java
new file mode 100644
index 0000000..93f86de
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.validation/src/org/eclipse/emf/ecp/validation/providers/SeverityLabelProvider.java
@@ -0,0 +1,69 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2011 Chair for Applied Software Engineering,
+ * Technische Universitaet Muenchen.
+ * 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:
+ ******************************************************************************/
+package org.eclipse.emf.ecp.validation.providers;
+
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.emf.ecp.validation.Activator;
+import org.eclipse.jface.viewers.ColumnLabelProvider;
+import org.eclipse.swt.graphics.Image;
+
+/**
+ * Label Provider to show the severity.
+ *
+ * @author Carmen Carlan
+ */
+public class SeverityLabelProvider extends ColumnLabelProvider {
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public Image getImage(Object element) {
+ if (element instanceof IStatus) {
+ IStatus constraint = (IStatus) element;
+ int severity = constraint.getSeverity();
+ switch (severity) {
+ case IStatus.ERROR:
+ return Activator.getImageDescriptor("icons/flag_red.png").createImage();
+ case IStatus.WARNING:
+ return Activator.getImageDescriptor("icons/flag_yellow.png").createImage();
+ default:
+ return Activator.getImageDescriptor("icons/flag_blue.png").createImage();
+ }
+ }
+ return super.getImage(element);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public String getText(Object element) {
+ if (element instanceof IStatus) {
+ IStatus constraint = (IStatus) element;
+ int severity = constraint.getSeverity();
+ switch (severity) {
+ case IStatus.ERROR:
+ return "ERROR";
+ case IStatus.WARNING:
+ return "WARNING";
+ case IStatus.INFO:
+ return "INFO";
+ case IStatus.OK:
+ return "OK";
+ default:
+ break;
+ }
+ }
+ return super.getText(element);
+ }
+
+}
\ No newline at end of file
diff --git a/old/org.eclipse.emf.ecp.validation/src/org/eclipse/emf/ecp/validation/providers/ValidationContentProvider.java b/old/org.eclipse.emf.ecp.validation/src/org/eclipse/emf/ecp/validation/providers/ValidationContentProvider.java
new file mode 100644
index 0000000..6581a34
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.validation/src/org/eclipse/emf/ecp/validation/providers/ValidationContentProvider.java
@@ -0,0 +1,66 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2011 Chair for Applied Software Engineering,
+ * Technische Universitaet Muenchen.
+ * 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: Max Hohenegger (Bug 377894)
+ ******************************************************************************/
+package org.eclipse.emf.ecp.validation.providers;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.emf.common.util.BasicDiagnostic;
+import org.eclipse.emf.edit.provider.ComposedAdapterFactory;
+import org.eclipse.emf.edit.ui.provider.AdapterFactoryContentProvider;
+
+/**
+ * Content Provider for validation view.
+ *
+ * @author Carmen Carlan
+ *
+ */
+public class ValidationContentProvider extends AdapterFactoryContentProvider {
+
+ /**
+ * Default constructor.
+ */
+ public ValidationContentProvider() {
+ super(new ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry.INSTANCE));
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see
+ * org.eclipse.emf.edit.ui.provider.AdapterFactoryContentProvider#getElements
+ * (java.lang.Object)
+ */
+ @Override
+ public Object[] getElements(Object inputElement) {
+ // if a project is deleted while the ValidationView is open the inputElement is an empty List
+ if (!(inputElement instanceof BasicDiagnostic)) {
+ return new Object[0];
+ }
+
+ IStatus status = BasicDiagnostic.toIStatus((BasicDiagnostic) inputElement);
+
+ List<IStatus> constraints = new ArrayList<IStatus>();
+ if (status.isMultiStatus()) {
+ IStatus[] statuses = status.getChildren();
+ for (int i = 0; i < statuses.length; i++) {
+ constraints.add(statuses[i]);
+
+ }
+ } else if (!status.isOK()) {
+
+ constraints.add(status);
+ }
+
+ return constraints.toArray(new Object[constraints.size()]);
+ }
+
+}
\ No newline at end of file
diff --git a/old/org.eclipse.emf.ecp.validation/src/org/eclipse/emf/ecp/validation/providers/ValidationFilterLabelProvider.java b/old/org.eclipse.emf.ecp.validation/src/org/eclipse/emf/ecp/validation/providers/ValidationFilterLabelProvider.java
new file mode 100644
index 0000000..043e599
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.validation/src/org/eclipse/emf/ecp/validation/providers/ValidationFilterLabelProvider.java
@@ -0,0 +1,57 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2011 Chair for Applied Software Engineering,
+ * Technische Universitaet Muenchen.
+ * 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:
+ ******************************************************************************/
+package org.eclipse.emf.ecp.validation.providers;
+
+import org.eclipse.emf.ecp.validation.Activator;
+import org.eclipse.emf.ecp.validation.filter.ValidationFilter;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.swt.graphics.Image;
+
+/**
+ * The label provider for the validation filter.
+ *
+ * @author Carmen Carlan
+ *
+ */
+public class ValidationFilterLabelProvider extends LabelProvider {
+
+ private static final String DESC_NA = "There is no description available for this specific filter.";
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public Image getImage(Object element) {
+ if (element instanceof ValidationFilter) {
+ ValidationFilter validationFilter = (ValidationFilter) element;
+ Image image = validationFilter.getImage();
+ if (image != null) {
+ return image;
+ }
+ }
+ return Activator.getImageDescriptor("icons/defaultfiltericon.png").createImage();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public String getText(Object element) {
+ if (element instanceof ValidationFilter) {
+ ValidationFilter validationFilter = (ValidationFilter) element;
+ String description = validationFilter.getName();
+ if (description != null && !description.equals("")) {
+ return description;
+ }
+ }
+ return DESC_NA;
+ }
+}
\ No newline at end of file
diff --git a/old/org.eclipse.emf.ecp.validation/src/org/eclipse/emf/ecp/validation/providers/ValidationLabelProvider.java b/old/org.eclipse.emf.ecp.validation/src/org/eclipse/emf/ecp/validation/providers/ValidationLabelProvider.java
new file mode 100644
index 0000000..9b496db
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.validation/src/org/eclipse/emf/ecp/validation/providers/ValidationLabelProvider.java
@@ -0,0 +1,80 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2011 Chair for Applied Software Engineering,
+ * Technische Universitaet Muenchen.
+ * 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:
+ ******************************************************************************/
+package org.eclipse.emf.ecp.validation.providers;
+
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.emf.common.util.BasicDiagnostic;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.edit.provider.ComposedAdapterFactory;
+import org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider;
+import org.eclipse.jface.viewers.ColumnLabelProvider;
+import org.eclipse.jface.viewers.ColumnViewer;
+import org.eclipse.jface.viewers.ViewerColumn;
+import org.eclipse.swt.graphics.Image;
+
+/**
+ * Label Provider for the Validation View.
+ *
+ * @author Carmen Carlan
+ *
+ */
+public class ValidationLabelProvider extends ColumnLabelProvider {
+ private AdapterFactoryLabelProvider adapterFactoryLabelProvider;
+ private ComposedAdapterFactory adapterFactory;
+
+ /**
+ * Default constructor.
+ */
+ public ValidationLabelProvider() {
+ super();
+ adapterFactory = new ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry.INSTANCE);
+ adapterFactoryLabelProvider = new AdapterFactoryLabelProvider(adapterFactory);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public Image getImage(Object object) {
+ if (object instanceof IStatus) {
+ BasicDiagnostic inputElement = (BasicDiagnostic) BasicDiagnostic.toDiagnostic((IStatus) object);
+ EObject target = (EObject) inputElement.getData().get(0);
+ if (target instanceof EObject) {
+ return adapterFactoryLabelProvider.getImage(target);
+ }
+ }
+ return super.getImage(object);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public String getText(Object object) {
+ if (object instanceof IStatus) {
+ BasicDiagnostic inputElement = (BasicDiagnostic) BasicDiagnostic.toDiagnostic((IStatus) object);
+ EObject target = (EObject) inputElement.getData().get(0);
+ if (target instanceof EObject) {
+ return adapterFactoryLabelProvider.getText(target);
+ }
+ }
+ return super.getText(object);
+ }
+
+ @Override
+ public void dispose(ColumnViewer viewer, ViewerColumn column) {
+ if (adapterFactory != null) {
+ adapterFactory.dispose();
+ }
+ super.dispose(viewer, column);
+ }
+
+}
\ No newline at end of file
diff --git a/old/org.eclipse.emf.ecp.validation/src/org/eclipse/emf/ecp/validation/refactoring/strategy/RefactoringResult.java b/old/org.eclipse.emf.ecp.validation/src/org/eclipse/emf/ecp/validation/refactoring/strategy/RefactoringResult.java
new file mode 100644
index 0000000..ecd6e89
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.validation/src/org/eclipse/emf/ecp/validation/refactoring/strategy/RefactoringResult.java
@@ -0,0 +1,40 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2011 Chair for Applied Software Engineering,
+ * Technische Universitaet Muenchen.
+ * 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:
+ ******************************************************************************/
+package org.eclipse.emf.ecp.validation.refactoring.strategy;
+
+/**
+ * Possible refactoring outcomes.
+ *
+ * @author pfeifferc
+ */
+public enum RefactoringResult {
+
+ /**
+ * The refactoring was successful, finish the operation.
+ */
+ SUCCESS_CREATE,
+
+ /**
+ * The possible violation was not a violation after all.
+ */
+ NO_VIOLATION,
+
+ /**
+ * The refactoring was successful, but do not create any model elements.
+ */
+ SUCCESS_UNDO,
+
+ /**
+ * The refactoring was cancelled.
+ */
+ ABORT,
+
+}
\ No newline at end of file
diff --git a/old/org.eclipse.emf.ecp.validation/src/org/eclipse/emf/ecp/validation/refactoring/strategy/RefactoringStrategy.java b/old/org.eclipse.emf.ecp.validation/src/org/eclipse/emf/ecp/validation/refactoring/strategy/RefactoringStrategy.java
new file mode 100644
index 0000000..74e7293
--- /dev/null
+++ b/old/org.eclipse.emf.ecp.validation/src/org/eclipse/emf/ecp/validation/refactoring/strategy/RefactoringStrategy.java
@@ -0,0 +1,56 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2011 Chair for Applied Software Engineering,
+ * Technische Universitaet Muenchen.
+ * 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:
+ ******************************************************************************/
+package org.eclipse.emf.ecp.validation.refactoring.strategy;
+
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.swt.widgets.Shell;
+
+/**
+ *
+ * @author Carmen Carlan
+ *
+ */
+public interface RefactoringStrategy {
+ /**
+ * This will start the refactoring.
+ *
+ * @return the result
+ */
+ RefactoringResult startRefactoring();
+
+ /**
+ * @param status
+ * the
+ */
+ void setConstraintStatus(IStatus status);
+
+ /**
+ * @return the description
+ */
+ String getDescription();
+
+ /**
+ * @return the id
+ */
+ String getId();
+
+ /**
+ * @param shell
+ * the
+ */
+ void setShell(Shell shell);
+
+ /**
+ * @return the invalid model element
+ */
+ EObject getInvalidModelElement();
+}
\ No newline at end of file