diff options
| author | Christian W. Damus | 2017-01-10 17:29:34 +0000 |
|---|---|---|
| committer | Christian W. Damus | 2017-01-10 17:29:34 +0000 |
| commit | 5662cf63394f1969362bf2b132061a4f253327ff (patch) | |
| tree | acbecb983b8fe26c43de5b2990d85da7e76805e7 | |
| parent | ee287110dfb72159d635a45e2567b205a96508c7 (diff) | |
| download | org.eclipse.papyrus-rt-5662cf63394f1969362bf2b132061a4f253327ff.tar.gz org.eclipse.papyrus-rt-5662cf63394f1969362bf2b132061a4f253327ff.tar.xz org.eclipse.papyrus-rt-5662cf63394f1969362bf2b132061a4f253327ff.zip | |
Bug 467545: [UML-RT] PapyrusRT shall provide a UML specific implementation to support redefinition
Integration of the UML-RT metamodel implementation into the Papyrus-RT core,
via the UML-RT Language extension which configures the ModelSet for UML-RT.
Also element-types edit-helper advice to constrain the user interactions with
inherited/redefined elements in the editor, especially deletion.
Delete the experimental synchronization implementation for the UML-RT
semantic model, which is not needed with the new metamodel implementation
that handles inheritance internally.
Add UML-RT specializations of commonly used JUnit test fixtures from Papyrus
to ensure proper integration of the UML-RT metamodel implementation in the
test environment. Update some test suites to use these new fixtures.
https://bugs.eclipse.org/bugs/show_bug.cgi?id=467545
Change-Id: I724e0ed3244e966075d31d554cadebedff2d8263
83 files changed, 4061 insertions, 1866 deletions
diff --git a/features/core/org.eclipse.papyrusrt.umlrt.core.feature/feature.xml b/features/core/org.eclipse.papyrusrt.umlrt.core.feature/feature.xml index c3c9b5a94..91afb5324 100644 --- a/features/core/org.eclipse.papyrusrt.umlrt.core.feature/feature.xml +++ b/features/core/org.eclipse.papyrusrt.umlrt.core.feature/feature.xml @@ -40,7 +40,6 @@ <import plugin="org.eclipse.papyrus.uml.diagram.common" version="1.2.0" match="greaterOrEqual"/> <import plugin="org.eclipse.papyrusrt.umlrt.system.profile" version="0.8.0" match="greaterOrEqual"/> <import plugin="org.eclipse.emf.ecore" version="2.11.0" match="greaterOrEqual"/> - <import plugin="org.eclipse.papyrus.infra.sync" version="1.2.0" match="greaterOrEqual"/> <import plugin="org.eclipse.emf.transaction" version="1.9.0" match="greaterOrEqual"/> <import plugin="org.eclipse.papyrus.uml.tools" version="1.2.0" match="greaterOrEqual"/> <import plugin="org.eclipse.papyrusrt.umlrt.core" version="0.8.0" match="greaterOrEqual"/> @@ -60,13 +59,6 @@ unpack="false"/> <plugin - id="org.eclipse.papyrusrt.umlrt.core.sync" - download-size="0" - install-size="0" - version="0.0.0" - unpack="false"/> - - <plugin id="org.eclipse.papyrusrt.umlrt.core.validation" download-size="0" install-size="0" diff --git a/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core.sync/.checkstyle b/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core.sync/.checkstyle deleted file mode 100644 index f479982cb..000000000 --- a/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core.sync/.checkstyle +++ /dev/null @@ -1,7 +0,0 @@ -<?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="Papyrus-RT" local="false"> - <file-match-pattern match-pattern="." include-pattern="true"/> - </fileset> -</fileset-config> diff --git a/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core.sync/.classpath b/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core.sync/.classpath deleted file mode 100644 index 098194ca4..000000000 --- a/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core.sync/.classpath +++ /dev/null @@ -1,7 +0,0 @@ -<?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/JavaSE-1.7"/> - <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> - <classpathentry kind="src" path="src"/> - <classpathentry kind="output" path="bin"/> -</classpath> diff --git a/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core.sync/.project b/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core.sync/.project deleted file mode 100644 index e07668eb7..000000000 --- a/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core.sync/.project +++ /dev/null @@ -1,46 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<projectDescription> - <name>org.eclipse.papyrusrt.umlrt.core.sync</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>org.eclipse.pde.api.tools.apiAnalysisBuilder</name> - <arguments> - </arguments> - </buildCommand> - <buildCommand> - <name>net.sf.eclipsecs.core.CheckstyleBuilder</name> - <arguments> - </arguments> - </buildCommand> - <buildCommand> - <name>org.eclipse.m2e.core.maven2Builder</name> - <arguments> - </arguments> - </buildCommand> - </buildSpec> - <natures> - <nature>org.eclipse.m2e.core.maven2Nature</nature> - <nature>org.eclipse.pde.PluginNature</nature> - <nature>org.eclipse.jdt.core.javanature</nature> - <nature>org.eclipse.pde.api.tools.apiAnalysisNature</nature> - <nature>net.sf.eclipsecs.core.CheckstyleNature</nature> - </natures> -</projectDescription> diff --git a/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core.sync/.settings/org.eclipse.core.resources.prefs b/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core.sync/.settings/org.eclipse.core.resources.prefs deleted file mode 100644 index 99f26c020..000000000 --- a/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core.sync/.settings/org.eclipse.core.resources.prefs +++ /dev/null @@ -1,2 +0,0 @@ -eclipse.preferences.version=1 -encoding/<project>=UTF-8 diff --git a/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core.sync/.settings/org.eclipse.jdt.core.prefs b/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core.sync/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index 28f0d0f67..000000000 --- a/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core.sync/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,297 +0,0 @@ -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 -org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve -org.eclipse.jdt.core.compiler.compliance=1.7 -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.7 -org.eclipse.jdt.core.formatter.align_type_members_on_columns=false -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16 -org.eclipse.jdt.core.formatter.alignment_for_assignment=0 -org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16 -org.eclipse.jdt.core.formatter.alignment_for_compact_if=16 -org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80 -org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0 -org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16 -org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0 -org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16 -org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80 -org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16 -org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16 -org.eclipse.jdt.core.formatter.blank_lines_after_imports=1 -org.eclipse.jdt.core.formatter.blank_lines_after_package=1 -org.eclipse.jdt.core.formatter.blank_lines_before_field=0 -org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0 -org.eclipse.jdt.core.formatter.blank_lines_before_imports=1 -org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1 -org.eclipse.jdt.core.formatter.blank_lines_before_method=1 -org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1 -org.eclipse.jdt.core.formatter.blank_lines_before_package=0 -org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1 -org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1 -org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_lambda_body=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line -org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false -org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false -org.eclipse.jdt.core.formatter.comment.format_block_comments=true -org.eclipse.jdt.core.formatter.comment.format_header=false -org.eclipse.jdt.core.formatter.comment.format_html=true -org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true -org.eclipse.jdt.core.formatter.comment.format_line_comments=true -org.eclipse.jdt.core.formatter.comment.format_source_code=true -org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true -org.eclipse.jdt.core.formatter.comment.indent_root_tags=true -org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert -org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert -org.eclipse.jdt.core.formatter.comment.line_length=260 -org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true -org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true -org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false -org.eclipse.jdt.core.formatter.compact_else_if=true -org.eclipse.jdt.core.formatter.continuation_indentation=2 -org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2 -org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off -org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on -org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false -org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true -org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true -org.eclipse.jdt.core.formatter.indent_empty_lines=false -org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true -org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true -org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true -org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false -org.eclipse.jdt.core.formatter.indentation.size=4 -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_after_type_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert -org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert -org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert -org.eclipse.jdt.core.formatter.insert_space_after_lambda_arrow=insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert -org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert -org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert -org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_lambda_arrow=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert -org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert -org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert -org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.join_lines_in_comments=false -org.eclipse.jdt.core.formatter.join_wrapped_lines=false -org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false -org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false -org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false -org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false -org.eclipse.jdt.core.formatter.lineSplit=260 -org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false -org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false -org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0 -org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=5 -org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true -org.eclipse.jdt.core.formatter.tabulation.char=tab -org.eclipse.jdt.core.formatter.tabulation.size=4 -org.eclipse.jdt.core.formatter.use_on_off_tags=false -org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false -org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true -org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true -org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true -org.eclipse.jdt.core.javaFormatter=org.eclipse.jdt.core.defaultJavaFormatter diff --git a/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core.sync/.settings/org.eclipse.jdt.ui.prefs b/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core.sync/.settings/org.eclipse.jdt.ui.prefs deleted file mode 100644 index b22a3a0ce..000000000 --- a/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core.sync/.settings/org.eclipse.jdt.ui.prefs +++ /dev/null @@ -1,127 +0,0 @@ -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_missing_override_annotations_interface_methods=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_functional_interfaces=false -cleanup.convert_to_enhanced_for_loop=false -cleanup.correct_indentation=false -cleanup.format_source_code=false -cleanup.format_source_code_changes_only=false -cleanup.insert_inferred_type_arguments=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=false -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_redundant_type_arguments=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_anonymous_class_creation=false -cleanup.use_blocks=true -cleanup.use_blocks_only_for_return_and_throw=false -cleanup.use_lambda=true -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.use_type_arguments=false -cleanup_profile=_Papyrus -cleanup_settings_version=2 -eclipse.preferences.version=1 -editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true -formatter_profile=_Papyrus -formatter_settings_version=12 -org.eclipse.jdt.ui.ignorelowercasenames=true -org.eclipse.jdt.ui.importorder=java;javax;org;com; -org.eclipse.jdt.ui.javadoc=true -org.eclipse.jdt.ui.ondemandthreshold=99 -org.eclipse.jdt.ui.staticondemandthreshold=99 -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\="false" context\="constructorcomment_context" deleted\="false" description\="Comment for created constructors" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorcomment" name\="constructorcomment">/**\n * Constructor.\n *\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 (c) ${year} CEA LIST and others.\n * \n * All rights reserved. This program and the accompanying materials\n * are made available under the terms of the Eclipse Public License v1.0\n * which accompanies this distribution, and is available at\n * http\://www.eclipse.org/legal/epl-v10.html\n *\n * Contributors\:\n * CEA LIST - Initial API and implementation\n * \n *****************************************************************************/\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\="true" context\="fieldcomment_context" deleted\="false" description\="Comment for fields" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.fieldcomment" name\="fieldcomment">/**\n * \n */</template><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 * ${see_to_overridden}\n *\n * ${tags}\n */</template><template autoinsert\="false" context\="delegatecomment_context" deleted\="false" description\="Comment for delegate methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.delegatecomment" name\="delegatecomment">/**\n * ${see_to_target}\n *\n * ${tags}\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\="true" context\="catchblock_context" deleted\="false" description\="Code in new catch blocks" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.catchblock" name\="catchblock">// ${todo} Auto-generated catch block\n${exception_var}.printStackTrace();</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> -sp_cleanup.add_default_serial_version_id=true -sp_cleanup.add_generated_serial_version_id=false -sp_cleanup.add_missing_annotations=true -sp_cleanup.add_missing_deprecated_annotations=true -sp_cleanup.add_missing_methods=false -sp_cleanup.add_missing_nls_tags=false -sp_cleanup.add_missing_override_annotations=true -sp_cleanup.add_missing_override_annotations_interface_methods=true -sp_cleanup.add_serial_version_id=false -sp_cleanup.always_use_blocks=true -sp_cleanup.always_use_parentheses_in_expressions=false -sp_cleanup.always_use_this_for_non_static_field_access=false -sp_cleanup.always_use_this_for_non_static_method_access=false -sp_cleanup.convert_functional_interfaces=false -sp_cleanup.convert_to_enhanced_for_loop=false -sp_cleanup.correct_indentation=false -sp_cleanup.format_source_code=true -sp_cleanup.format_source_code_changes_only=false -sp_cleanup.insert_inferred_type_arguments=false -sp_cleanup.make_local_variable_final=true -sp_cleanup.make_parameters_final=false -sp_cleanup.make_private_fields_final=true -sp_cleanup.make_type_abstract_if_missing_method=false -sp_cleanup.make_variable_declarations_final=false -sp_cleanup.never_use_blocks=false -sp_cleanup.never_use_parentheses_in_expressions=true -sp_cleanup.on_save_use_additional_actions=true -sp_cleanup.organize_imports=true -sp_cleanup.qualify_static_field_accesses_with_declaring_class=false -sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true -sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true -sp_cleanup.qualify_static_member_accesses_with_declaring_class=false -sp_cleanup.qualify_static_method_accesses_with_declaring_class=false -sp_cleanup.remove_private_constructors=true -sp_cleanup.remove_redundant_type_arguments=true -sp_cleanup.remove_trailing_whitespaces=false -sp_cleanup.remove_trailing_whitespaces_all=true -sp_cleanup.remove_trailing_whitespaces_ignore_empty=false -sp_cleanup.remove_unnecessary_casts=true -sp_cleanup.remove_unnecessary_nls_tags=false -sp_cleanup.remove_unused_imports=false -sp_cleanup.remove_unused_local_variables=false -sp_cleanup.remove_unused_private_fields=true -sp_cleanup.remove_unused_private_members=false -sp_cleanup.remove_unused_private_methods=true -sp_cleanup.remove_unused_private_types=true -sp_cleanup.sort_members=false -sp_cleanup.sort_members_all=false -sp_cleanup.use_anonymous_class_creation=false -sp_cleanup.use_blocks=false -sp_cleanup.use_blocks_only_for_return_and_throw=false -sp_cleanup.use_lambda=true -sp_cleanup.use_parentheses_in_expressions=false -sp_cleanup.use_this_for_non_static_field_access=false -sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true -sp_cleanup.use_this_for_non_static_method_access=false -sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true -sp_cleanup.use_type_arguments=false diff --git a/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core.sync/META-INF/MANIFEST.MF b/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core.sync/META-INF/MANIFEST.MF deleted file mode 100644 index 785652f48..000000000 --- a/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core.sync/META-INF/MANIFEST.MF +++ /dev/null @@ -1,41 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: Papyrus synchronization system for models (Incubation) -Bundle-SymbolicName: org.eclipse.papyrusrt.umlrt.core.sync;singleton:=true -Bundle-Version: 0.8.0.qualifier -Bundle-Activator: org.eclipse.papyrusrt.umlrt.core.sync.Activator -Bundle-Vendor: Eclipse Modeling Project -Require-Bundle: org.eclipse.core.runtime, - org.eclipse.emf.ecore;bundle-version="2.11.0", - org.eclipse.papyrus.infra.sync;bundle-version="1.2.0", - org.eclipse.uml2.uml;bundle-version="5.1.0", - com.google.guava;bundle-version="11.0.0", - org.eclipse.emf.transaction;bundle-version="1.9.0", - org.eclipse.papyrus.infra.core;bundle-version="1.2.0", - org.eclipse.papyrus.infra.core.log;bundle-version="1.2.0", - org.eclipse.papyrus.uml.tools;bundle-version="1.2.0", - org.eclipse.papyrusrt.umlrt.profile;bundle-version="0.8.0", - org.eclipse.papyrusrt.umlrt.core;bundle-version="0.8.0", - org.eclipse.papyrus.uml.tools.utils;bundle-version="1.2.0" -Bundle-RequiredExecutionEnvironment: JavaSE-1.7 -Bundle-ActivationPolicy: lazy -Export-Package: org.eclipse.papyrusrt.umlrt.core.sync; - uses:="org.eclipse.emf.ecore, - org.eclipse.emf.common.command, - org.osgi.framework, - org.eclipse.papyrus.infra.sync, - org.eclipse.papyrus.infra.sync.service, - com.google.common.base", - org.eclipse.papyrusrt.umlrt.core.sync.capsule; - uses:="org.eclipse.emf.ecore, - org.eclipse.emf.common.command, - org.eclipse.papyrus.infra.sync, - org.eclipse.papyrus.infra.sync.service, - org.eclipse.uml2.uml, - org.eclipse.papyrusrt.core.sync", - org.eclipse.papyrusrt.umlrt.core.sync.statemachine; - uses:="org.eclipse.emf.ecore, - org.eclipse.emf.common.command, - org.eclipse.papyrus.infra.sync, - org.eclipse.uml2.uml, - org.eclipse.papyrusrt.core.sync" diff --git a/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core.sync/about.html b/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core.sync/about.html deleted file mode 100644 index dd3c089a9..000000000 --- a/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core.sync/about.html +++ /dev/null @@ -1,28 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml"> -<head> -<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/> -<title>About</title> -</head> -<body lang="EN-US"> -<h2>About This Content</h2> - -<p>November 14, 2008</p> -<h3>License</h3> - -<p>The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise -indicated below, the Content is provided to you under the terms and conditions of the -Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available -at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>. -For purposes of the EPL, "Program" will mean the Content.</p> - -<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is -being redistributed by another party ("Redistributor") and different terms and conditions may -apply to your use of any object code in the Content. Check the Redistributor's license that was -provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise -indicated below, the terms and conditions of the EPL still apply to any source code in the Content -and such source code may be obtained at <a href="http://www.eclipse.org">http://www.eclipse.org</a>.</p> - -</body> -</html>
\ No newline at end of file diff --git a/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core.sync/build.properties b/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core.sync/build.properties deleted file mode 100644 index 786b1df93..000000000 --- a/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core.sync/build.properties +++ /dev/null @@ -1,6 +0,0 @@ -source.. = src/ -output.. = bin/ -bin.includes = META-INF/,\ - .,\ - plugin.xml,\ - about.html diff --git a/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core.sync/plugin.xml b/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core.sync/plugin.xml deleted file mode 100644 index 5535690d3..000000000 --- a/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core.sync/plugin.xml +++ /dev/null @@ -1,5 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<?eclipse version="3.4"?> -<plugin> - -</plugin> diff --git a/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core.sync/pom.xml b/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core.sync/pom.xml deleted file mode 100644 index 7b48affbc..000000000 --- a/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core.sync/pom.xml +++ /dev/null @@ -1,13 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<project> - <modelVersion>4.0.0</modelVersion> - <parent> - <artifactId>org.eclipse.papyrusrt.core</artifactId> - <groupId>org.eclipse.papyrusrt</groupId> - <version>0.8.0-SNAPSHOT</version> - </parent> - <artifactId>org.eclipse.papyrusrt.umlrt.core.sync</artifactId> - <groupId>org.eclipse.papyrusrt</groupId> - <version>0.8.0-SNAPSHOT</version> - <packaging>eclipse-plugin</packaging> -</project> diff --git a/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core.sync/src/org/eclipse/papyrusrt/umlrt/core/sync/Activator.java b/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core.sync/src/org/eclipse/papyrusrt/umlrt/core/sync/Activator.java deleted file mode 100644 index ec26ad782..000000000 --- a/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core.sync/src/org/eclipse/papyrusrt/umlrt/core/sync/Activator.java +++ /dev/null @@ -1,43 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2015 Christian W. Damus and others. - * - * 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: - * Christian W. Damus - Initial API and implementation - * - *****************************************************************************/ - -package org.eclipse.papyrusrt.umlrt.core.sync; - -import org.osgi.framework.BundleActivator; -import org.osgi.framework.BundleContext; - -public class Activator implements BundleActivator { - - private static BundleContext context; - - static BundleContext getContext() { - return context; - } - - /* - * (non-Javadoc) - * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext) - */ - public void start(BundleContext bundleContext) throws Exception { - Activator.context = bundleContext; - } - - /* - * (non-Javadoc) - * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext) - */ - public void stop(BundleContext bundleContext) throws Exception { - Activator.context = null; - } - -} diff --git a/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core.sync/src/org/eclipse/papyrusrt/umlrt/core/sync/UMLRTSyncTrigger.java b/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core.sync/src/org/eclipse/papyrusrt/umlrt/core/sync/UMLRTSyncTrigger.java deleted file mode 100644 index 518dedfbb..000000000 --- a/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core.sync/src/org/eclipse/papyrusrt/umlrt/core/sync/UMLRTSyncTrigger.java +++ /dev/null @@ -1,61 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2015 Christian W. Damus and others. - * - * 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: - * Christian W. Damus - Initial API and implementation - * - *****************************************************************************/ - -package org.eclipse.papyrusrt.umlrt.core.sync; - -import java.util.Iterator; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.EStructuralFeature; -import org.eclipse.emf.ecore.util.EContentsEList; -import org.eclipse.papyrus.infra.sync.service.AbstractSyncTrigger; -import org.eclipse.papyrus.infra.sync.service.CascadeTriggers; -import org.eclipse.papyrus.infra.sync.service.ISyncAction; -import org.eclipse.papyrus.infra.sync.service.ISyncService; -import org.eclipse.uml2.uml.UMLPackage; - -import com.google.common.base.Function; - -/** - * Sync trigger to initialize synchronization of UML-RT models. - */ -public class UMLRTSyncTrigger extends AbstractSyncTrigger { - private static final EStructuralFeature[] SYNCHRONIZABLE_PACKAGE_CONTENTS = { - UMLPackage.Literals.PACKAGE__NESTED_PACKAGE, - UMLPackage.Literals.PACKAGE__OWNED_TYPE, }; - - public UMLRTSyncTrigger() { - super(); - } - - @Override - public ISyncAction trigger(ISyncService syncService, Object object) { - return new CascadeTriggers(cascadeFunction()); - } - - protected Function<Object, Iterable<? extends EObject>> cascadeFunction() { - return new Function<Object, Iterable<? extends EObject>>() { - @Override - public Iterable<? extends EObject> apply(final Object input) { - return new Iterable<EObject>() { - private final Iterable<EObject> delegate = new EContentsEList<EObject>((EObject) input, SYNCHRONIZABLE_PACKAGE_CONTENTS); - - @Override - public Iterator<EObject> iterator() { - return delegate.iterator(); - } - }; - } - }; - } -} diff --git a/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core.sync/src/org/eclipse/papyrusrt/umlrt/core/sync/UMLSyncBucket.java b/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core.sync/src/org/eclipse/papyrusrt/umlrt/core/sync/UMLSyncBucket.java deleted file mode 100644 index 96862c485..000000000 --- a/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core.sync/src/org/eclipse/papyrusrt/umlrt/core/sync/UMLSyncBucket.java +++ /dev/null @@ -1,37 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2015 Christian W. Damus and others. - * - * 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: - * Christian W. Damus - Initial API and implementation - * - *****************************************************************************/ - -package org.eclipse.papyrusrt.umlrt.core.sync; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.papyrus.infra.sync.EObjectMasterSlaveSyncBucket; -import org.eclipse.papyrus.infra.sync.SyncItem; -import org.eclipse.uml2.uml.Element; - -/** - * A synchronization bucket for UML semantic model synchronization, in which the back-end is the model element, itself - * (not a notation or something else). - */ -public class UMLSyncBucket<M extends Element> extends EObjectMasterSlaveSyncBucket<M, EObject, Notification> { - - public UMLSyncBucket(M model) { - super(model, model); - } - - @Override - protected SyncItem<M, EObject> encapsulate(EObject element) { - return new UMLSyncItem<M>(getModel(), element); - } - -} diff --git a/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core.sync/src/org/eclipse/papyrusrt/umlrt/core/sync/UMLSyncFeature.java b/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core.sync/src/org/eclipse/papyrusrt/umlrt/core/sync/UMLSyncFeature.java deleted file mode 100644 index cd22ca5e3..000000000 --- a/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core.sync/src/org/eclipse/papyrusrt/umlrt/core/sync/UMLSyncFeature.java +++ /dev/null @@ -1,69 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2015 Christian W. Damus and others. - * - * 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: - * Christian W. Damus - Initial API and implementation - * - *****************************************************************************/ - -package org.eclipse.papyrusrt.umlrt.core.sync; - -import org.eclipse.emf.common.command.Command; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.EReference; -import org.eclipse.emf.transaction.RecordingCommand; -import org.eclipse.papyrus.infra.sync.EObjectEReferenceSyncFeature; -import org.eclipse.papyrus.infra.sync.SyncBucket; -import org.eclipse.papyrus.infra.sync.SyncRegistry; -import org.eclipse.papyrus.uml.tools.utils.CustomUMLUtil; -import org.eclipse.papyrusrt.umlrt.core.utils.CapsuleUtils; -import org.eclipse.uml2.uml.Element; - -/** - * Base UML synchronization feature. - */ -public abstract class UMLSyncFeature<M extends Element, N extends Element> extends EObjectEReferenceSyncFeature<M> { - - public UMLSyncFeature(SyncBucket<M, EObject, Notification> bucket, EReference reference, EReference... more) { - super(bucket, reference, more); - } - - protected abstract Class<? extends SyncRegistry<N, EObject, Notification>> getNestedRegistryType(); - - protected SyncRegistry<N, EObject, Notification> getNestedRegistry() { - return getSyncRegistry(getNestedRegistryType()); - } - - @Override - protected Command createDeleteCommand(final EObject object) { - return new RecordingCommand(getEditingDomain()) { - - @Override - protected void doExecute() { - if (object instanceof Element) { - ((Element) object).destroy(); - } else { - CustomUMLUtil.destroy(object); - } - } - }; - } - - @Override - protected boolean match(EObject sourceModel, EObject targetModel) { - boolean result = false; - - // One case of a match is when I already have established synchronization between these elements - SyncRegistry<N, EObject, Notification> nestedRegistry = getNestedRegistry(); - result = nestedRegistry.getModelType().isInstance(sourceModel) && nestedRegistry.synchronizes(targetModel, nestedRegistry.getModelType().cast(sourceModel)); - result = result || CapsuleUtils.redefines(targetModel, sourceModel); - - return result; - } -} diff --git a/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core.sync/src/org/eclipse/papyrusrt/umlrt/core/sync/UMLSyncItem.java b/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core.sync/src/org/eclipse/papyrusrt/umlrt/core/sync/UMLSyncItem.java deleted file mode 100644 index ee0bd026c..000000000 --- a/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core.sync/src/org/eclipse/papyrusrt/umlrt/core/sync/UMLSyncItem.java +++ /dev/null @@ -1,38 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2015 Christian W. Damus and others. - * - * 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: - * Christian W. Damus - Initial API and implementation - * - *****************************************************************************/ - -package org.eclipse.papyrusrt.umlrt.core.sync; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.papyrus.infra.sync.EObjectSyncItem; -import org.eclipse.uml2.uml.Element; - -/** - * A sync-item for UML model-to-model synchronizations. - */ -public class UMLSyncItem<M extends Element> extends EObjectSyncItem<M, EObject> { - - private final M model; - - public UMLSyncItem(M model, EObject backend) { - super(backend); - - this.model = model; - } - - @Override - public M getModel() { - return model; - } - -} diff --git a/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core.sync/src/org/eclipse/papyrusrt/umlrt/core/sync/UMLSyncRegistry.java b/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core.sync/src/org/eclipse/papyrusrt/umlrt/core/sync/UMLSyncRegistry.java deleted file mode 100644 index ea19c3baf..000000000 --- a/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core.sync/src/org/eclipse/papyrusrt/umlrt/core/sync/UMLSyncRegistry.java +++ /dev/null @@ -1,31 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2015 Christian W. Damus and others. - * - * 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: - * Christian W. Damus - Initial API and implementation - * - *****************************************************************************/ - -package org.eclipse.papyrusrt.umlrt.core.sync; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.papyrus.infra.sync.SyncRegistry; - -/** - * Common protocol of the UML-RT synchronization registries. - */ -public abstract class UMLSyncRegistry<M extends EObject> extends SyncRegistry<M, EObject, Notification> { - - public UMLSyncRegistry() { - super(); - } - - @Override - public abstract M getModelOf(EObject backend); // Make it visible to clients -} diff --git a/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core.sync/src/org/eclipse/papyrusrt/umlrt/core/sync/capsule/CapsuleStateMachineSyncFeature.java b/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core.sync/src/org/eclipse/papyrusrt/umlrt/core/sync/capsule/CapsuleStateMachineSyncFeature.java deleted file mode 100644 index 4b1cc4504..000000000 --- a/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core.sync/src/org/eclipse/papyrusrt/umlrt/core/sync/capsule/CapsuleStateMachineSyncFeature.java +++ /dev/null @@ -1,79 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2015 Christian W. Damus and others. - * - * 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: - * Christian W. Damus - Initial API and implementation - * - *****************************************************************************/ - -package org.eclipse.papyrusrt.umlrt.core.sync.capsule; - -import org.eclipse.emf.common.command.Command; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.edit.command.AddCommand; -import org.eclipse.papyrus.infra.sync.SyncBucket; -import org.eclipse.papyrus.infra.sync.SyncItem; -import org.eclipse.papyrus.infra.sync.SyncRegistry; -import org.eclipse.papyrusrt.umlrt.core.sync.UMLSyncFeature; -import org.eclipse.papyrusrt.umlrt.core.sync.statemachine.StateMachineSyncBucket; -import org.eclipse.papyrusrt.umlrt.core.sync.statemachine.StateMachineSyncRegistry; -import org.eclipse.uml2.uml.StateMachine; -import org.eclipse.uml2.uml.UMLPackage; - -/** - * A synchronization feature for matching the regions of a state machine with the state machine that it redefines. - */ -public class CapsuleStateMachineSyncFeature extends UMLSyncFeature<org.eclipse.uml2.uml.Class, StateMachine> { - - public CapsuleStateMachineSyncFeature(CapsuleSyncBucket bucket) { - super(bucket, UMLPackage.Literals.BEHAVIORED_CLASSIFIER__CLASSIFIER_BEHAVIOR); - } - - @Override - protected Class<? extends SyncRegistry<StateMachine, EObject, Notification>> getNestedRegistryType() { - return StateMachineSyncRegistry.class; - } - - @Override - protected Command onTargetAdded(SyncItem<org.eclipse.uml2.uml.Class, EObject> from, EObject source, SyncItem<org.eclipse.uml2.uml.Class, EObject> to, EObject target) { - Command result = null; - - if (target instanceof StateMachine) { - StateMachine stateMachine = (StateMachine) target; - - if (source instanceof StateMachine) { - StateMachine superStateMachine = (StateMachine) source; - - // Ensure the redefinition semantics - if (!stateMachine.getRedefinedBehaviors().contains(superStateMachine)) { - result = AddCommand.create(getEditingDomain(), stateMachine, UMLPackage.Literals.BEHAVIOR__REDEFINED_BEHAVIOR, superStateMachine); - } - - SyncRegistry<StateMachine, EObject, Notification> registry = getNestedRegistry(); - if (registry != null) { - // Synchronize with the super-capsule's state machine - SyncBucket<StateMachine, EObject, Notification> bucket = registry.getBucket(superStateMachine); - if (bucket == null) { - bucket = new StateMachineSyncBucket(superStateMachine); - registry.register(bucket); - } - result = synchronizingWrapper(registry, stateMachine, result); - } - } - } - - return result; - } - - @Override - protected Command onTargetRemoved(SyncItem<org.eclipse.uml2.uml.Class, EObject> to, EObject target) { - // TODO Purge synchronizations no longer needed (if that's even necessary?) - return null; - } -} diff --git a/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core.sync/src/org/eclipse/papyrusrt/umlrt/core/sync/capsule/CapsuleSyncBucket.java b/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core.sync/src/org/eclipse/papyrusrt/umlrt/core/sync/capsule/CapsuleSyncBucket.java deleted file mode 100644 index dadb2df27..000000000 --- a/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core.sync/src/org/eclipse/papyrusrt/umlrt/core/sync/capsule/CapsuleSyncBucket.java +++ /dev/null @@ -1,29 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2015 Christian W. Damus and others. - * - * 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: - * Christian W. Damus - Initial API and implementation - * - *****************************************************************************/ - -package org.eclipse.papyrusrt.umlrt.core.sync.capsule; - -import org.eclipse.papyrusrt.umlrt.core.sync.UMLSyncBucket; - -/** - * Root synchronization bucket for capsules. - */ -public class CapsuleSyncBucket extends UMLSyncBucket<org.eclipse.uml2.uml.Class> { - - public CapsuleSyncBucket(org.eclipse.uml2.uml.Class model) { - super(model); - - add(new CapsuleStateMachineSyncFeature(this)); - } - -} diff --git a/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core.sync/src/org/eclipse/papyrusrt/umlrt/core/sync/capsule/CapsuleSyncRegistry.java b/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core.sync/src/org/eclipse/papyrusrt/umlrt/core/sync/capsule/CapsuleSyncRegistry.java deleted file mode 100644 index 245117e2f..000000000 --- a/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core.sync/src/org/eclipse/papyrusrt/umlrt/core/sync/capsule/CapsuleSyncRegistry.java +++ /dev/null @@ -1,39 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2015 Christian W. Damus and others. - * - * 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: - * Christian W. Damus - Initial API and implementation - * - *****************************************************************************/ - -package org.eclipse.papyrusrt.umlrt.core.sync.capsule; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.papyrusrt.umlrt.core.sync.UMLSyncRegistry; -import org.eclipse.papyrusrt.umlrt.core.utils.CapsuleUtils; - -/** - * Capsule behavior inheritance synchronization registry. - */ -public class CapsuleSyncRegistry extends UMLSyncRegistry<org.eclipse.uml2.uml.Class> { - - public CapsuleSyncRegistry() { - super(); - } - - @Override - public org.eclipse.uml2.uml.Class getModelOf(EObject backend) { - org.eclipse.uml2.uml.Class result = null; - - if (backend instanceof org.eclipse.uml2.uml.Class) { - result = CapsuleUtils.getSuperCapsule((org.eclipse.uml2.uml.Class) backend); - } - - return result; - } -} diff --git a/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core.sync/src/org/eclipse/papyrusrt/umlrt/core/sync/capsule/CapsuleSyncTrigger.java b/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core.sync/src/org/eclipse/papyrusrt/umlrt/core/sync/capsule/CapsuleSyncTrigger.java deleted file mode 100644 index fd13ab5ec..000000000 --- a/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core.sync/src/org/eclipse/papyrusrt/umlrt/core/sync/capsule/CapsuleSyncTrigger.java +++ /dev/null @@ -1,63 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2015 Christian W. Damus and others. - * - * 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: - * Christian W. Damus - Initial API and implementation - * - *****************************************************************************/ - -package org.eclipse.papyrusrt.umlrt.core.sync.capsule; - -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Status; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.papyrus.infra.sync.SyncBucket; -import org.eclipse.papyrus.infra.sync.service.AbstractSyncTrigger; -import org.eclipse.papyrus.infra.sync.service.ISyncAction; -import org.eclipse.papyrus.infra.sync.service.ISyncService; -import org.eclipse.papyrusrt.umlrt.core.utils.CapsuleUtils; - -/** - * Sync trigger to initialize synchronization of capsules. - */ -public class CapsuleSyncTrigger extends AbstractSyncTrigger { - - public CapsuleSyncTrigger() { - super(); - } - - @Override - public ISyncAction trigger(ISyncService syncService, Object object) { - return new ISyncAction() { - - @Override - public IStatus perform(ISyncService syncService, Object object) { - // This cast is safe because it is assured by our enablement expression - org.eclipse.uml2.uml.Class capsule = (org.eclipse.uml2.uml.Class) object; - - CapsuleSyncRegistry registry = syncService.getSyncRegistry(CapsuleSyncRegistry.class); - if (registry != null) { - // Look for a super-capsule to synchronize with - org.eclipse.uml2.uml.Class superCapsule = CapsuleUtils.getSuperCapsule(capsule); - if (superCapsule != null) { - SyncBucket<org.eclipse.uml2.uml.Class, EObject, Notification> bucket = registry.getBucket(superCapsule); - if (bucket == null) { - bucket = new CapsuleSyncBucket(superCapsule); - registry.register(bucket); - } - registry.synchronize(capsule); - } - } - - return Status.OK_STATUS; - } - }; - } - -} diff --git a/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core.sync/src/org/eclipse/papyrusrt/umlrt/core/sync/statemachine/RegionSyncBucket.java b/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core.sync/src/org/eclipse/papyrusrt/umlrt/core/sync/statemachine/RegionSyncBucket.java deleted file mode 100644 index 5e1c4439c..000000000 --- a/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core.sync/src/org/eclipse/papyrusrt/umlrt/core/sync/statemachine/RegionSyncBucket.java +++ /dev/null @@ -1,34 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2015 Christian W. Damus and others. - * - * 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: - * Christian W. Damus - Initial API and implementation - * - *****************************************************************************/ - -package org.eclipse.papyrusrt.umlrt.core.sync.statemachine; - -import org.eclipse.papyrus.infra.sync.EObjectEAttributeSyncFeature; -import org.eclipse.papyrusrt.umlrt.core.sync.UMLSyncBucket; -import org.eclipse.uml2.uml.Region; -import org.eclipse.uml2.uml.UMLPackage; - -/** - * Synchronization bucket for capsule state machine regions. - */ -public class RegionSyncBucket extends UMLSyncBucket<Region> { - - public RegionSyncBucket(Region model) { - super(model); - - add(new RegionVerticesSyncFeature(this)); - add(new RegionTransitionsSyncFeature(this)); - add(EObjectEAttributeSyncFeature.create(this, UMLPackage.Literals.NAMED_ELEMENT__NAME)); - } - -} diff --git a/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core.sync/src/org/eclipse/papyrusrt/umlrt/core/sync/statemachine/RegionSyncRegistry.java b/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core.sync/src/org/eclipse/papyrusrt/umlrt/core/sync/statemachine/RegionSyncRegistry.java deleted file mode 100644 index 789494470..000000000 --- a/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core.sync/src/org/eclipse/papyrusrt/umlrt/core/sync/statemachine/RegionSyncRegistry.java +++ /dev/null @@ -1,34 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2015 Christian W. Damus and others. - * - * 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: - * Christian W. Damus - Initial API and implementation - * - *****************************************************************************/ - -package org.eclipse.papyrusrt.umlrt.core.sync.statemachine; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.papyrusrt.umlrt.core.sync.UMLSyncRegistry; -import org.eclipse.papyrusrt.umlrt.core.utils.CapsuleUtils; -import org.eclipse.uml2.uml.Region; - -/** - * Capsule statemachine region synchronization registry. - */ -public class RegionSyncRegistry extends UMLSyncRegistry<Region> { - - public RegionSyncRegistry() { - super(); - } - - @Override - public Region getModelOf(EObject backend) { - return (backend instanceof Region) ? CapsuleUtils.getSuperRegion((Region) backend) : null; - } -} diff --git a/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core.sync/src/org/eclipse/papyrusrt/umlrt/core/sync/statemachine/RegionTransitionsSyncFeature.java b/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core.sync/src/org/eclipse/papyrusrt/umlrt/core/sync/statemachine/RegionTransitionsSyncFeature.java deleted file mode 100644 index e3aa6c676..000000000 --- a/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core.sync/src/org/eclipse/papyrusrt/umlrt/core/sync/statemachine/RegionTransitionsSyncFeature.java +++ /dev/null @@ -1,94 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2015 Christian W. Damus and others. - * - * 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: - * Christian W. Damus - Initial API and implementation - * - *****************************************************************************/ - -package org.eclipse.papyrusrt.umlrt.core.sync.statemachine; - -import org.eclipse.emf.common.command.Command; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.edit.command.SetCommand; -import org.eclipse.papyrus.infra.sync.SyncBucket; -import org.eclipse.papyrus.infra.sync.SyncItem; -import org.eclipse.papyrus.infra.sync.SyncRegistry; -import org.eclipse.papyrusrt.umlrt.core.sync.UMLSyncFeature; -import org.eclipse.uml2.uml.Region; -import org.eclipse.uml2.uml.StateMachine; -import org.eclipse.uml2.uml.Transition; -import org.eclipse.uml2.uml.UMLPackage; -import org.eclipse.uml2.uml.Vertex; - -import com.google.common.base.Predicate; - -/** - * A synchronization feature for matching the transitions of a region with the region that it redefines. - */ -public class RegionTransitionsSyncFeature extends UMLSyncFeature<Region, Transition> { - - public RegionTransitionsSyncFeature(SyncBucket<Region, EObject, Notification> bucket) { - super(bucket, UMLPackage.Literals.REGION__TRANSITION); - } - - @Override - protected Class<? extends SyncRegistry<Transition, EObject, Notification>> getNestedRegistryType() { - return TransitionSyncRegistry.class; - } - - @Override - protected Command onTargetAdded(SyncItem<Region, EObject> from, EObject source, SyncItem<Region, EObject> to, EObject target) { - Command result = null; - Transition transition = (Transition) target; - Transition superTransition = (Transition) source; - - result = SetCommand.create(getEditingDomain(), transition, UMLPackage.Literals.TRANSITION__REDEFINED_TRANSITION, source); - result = result.chain(SetCommand.create(getEditingDomain(), transition, UMLPackage.Literals.TRANSITION__SOURCE, findRedefiningVertex(transition.getContainer(), superTransition.getSource()))); - result = result.chain(SetCommand.create(getEditingDomain(), transition, UMLPackage.Literals.TRANSITION__TARGET, findRedefiningVertex(transition.getContainer(), superTransition.getTarget()))); - - SyncRegistry<Transition, EObject, Notification> registry = getNestedRegistry(); - if (registry != null) { - // Synchronize with the corresponding transition in the super state machine - SyncBucket<Transition, EObject, Notification> bucket = registry.getBucket(superTransition); - if (bucket == null) { - bucket = new TransitionSyncBucket(superTransition); - registry.register(bucket); - } - result = synchronizingWrapper(registry, transition, result); - } - - return result; - } - - @Override - protected Command onTargetRemoved(SyncItem<Region, EObject> to, EObject target) { - // TODO Purge synchronizations no longer needed (if that's even necessary?) - return null; - } - - protected Vertex findRedefiningVertex(Region context, Vertex superVertex) { - Vertex result = null; - final StateMachine stateMachine = context.getStateMachine(); - - VertexSyncRegistry registry = getSyncRegistry(VertexSyncRegistry.class); - SyncBucket<Vertex, EObject, Notification> bucket = registry.getBucket(superVertex); - if (bucket != null) { - result = (Vertex) bucket.findBackend(new Predicate<EObject>() { - @Override - public boolean apply(EObject input) { - Vertex vertex = (Vertex) input; - return (vertex.getContainer().containingStateMachine() == stateMachine); - } - }); - } - - return result; - } -} diff --git a/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core.sync/src/org/eclipse/papyrusrt/umlrt/core/sync/statemachine/RegionVerticesSyncFeature.java b/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core.sync/src/org/eclipse/papyrusrt/umlrt/core/sync/statemachine/RegionVerticesSyncFeature.java deleted file mode 100644 index 6fc5b7569..000000000 --- a/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core.sync/src/org/eclipse/papyrusrt/umlrt/core/sync/statemachine/RegionVerticesSyncFeature.java +++ /dev/null @@ -1,68 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2015 Christian W. Damus and others. - * - * 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: - * Christian W. Damus - Initial API and implementation - * - *****************************************************************************/ - -package org.eclipse.papyrusrt.umlrt.core.sync.statemachine; - -import org.eclipse.emf.common.command.Command; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.papyrus.infra.sync.SyncBucket; -import org.eclipse.papyrus.infra.sync.SyncItem; -import org.eclipse.papyrus.infra.sync.SyncRegistry; -import org.eclipse.papyrusrt.umlrt.core.sync.UMLSyncFeature; -import org.eclipse.uml2.uml.Region; -import org.eclipse.uml2.uml.UMLPackage; -import org.eclipse.uml2.uml.Vertex; - -/** - * A synchronization feature for matching the vertices of a region with the region that it redefines. - */ -public class RegionVerticesSyncFeature extends UMLSyncFeature<Region, Vertex> { - - public RegionVerticesSyncFeature(SyncBucket<Region, EObject, Notification> bucket) { - super(bucket, UMLPackage.Literals.REGION__SUBVERTEX); - } - - @Override - protected Class<? extends SyncRegistry<Vertex, EObject, Notification>> getNestedRegistryType() { - return VertexSyncRegistry.class; - } - - @Override - protected Command onTargetAdded(SyncItem<Region, EObject> from, EObject source, SyncItem<Region, EObject> to, EObject target) { - Command result = null; - Vertex vertex = (Vertex) target; - Vertex superVertex = (Vertex) source; - - VertexSyncRegistry registry = (VertexSyncRegistry) getNestedRegistry(); - if (!registry.redefines(vertex, superVertex)) { - result = registry.createSetRedefinedVertexCommand(vertex, superVertex); - } - - // Synchronize with the corresponding vertex in the super state machine - SyncBucket<Vertex, EObject, Notification> bucket = registry.getBucket(superVertex); - if (bucket == null) { - bucket = new VertexSyncBucket(superVertex); - registry.register(bucket); - } - result = synchronizingWrapper(registry, vertex, result); - - return result; - } - - @Override - protected Command onTargetRemoved(SyncItem<Region, EObject> to, EObject target) { - // TODO Purge synchronizations no longer needed (if that's even necessary?) - return null; - } -} diff --git a/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core.sync/src/org/eclipse/papyrusrt/umlrt/core/sync/statemachine/StateMachineRegionsSyncFeature.java b/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core.sync/src/org/eclipse/papyrusrt/umlrt/core/sync/statemachine/StateMachineRegionsSyncFeature.java deleted file mode 100644 index 606f69383..000000000 --- a/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core.sync/src/org/eclipse/papyrusrt/umlrt/core/sync/statemachine/StateMachineRegionsSyncFeature.java +++ /dev/null @@ -1,74 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2015 Christian W. Damus and others. - * - * 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: - * Christian W. Damus - Initial API and implementation - * - *****************************************************************************/ - -package org.eclipse.papyrusrt.umlrt.core.sync.statemachine; - -import org.eclipse.emf.common.command.Command; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.EReference; -import org.eclipse.emf.edit.command.SetCommand; -import org.eclipse.papyrus.infra.sync.SyncBucket; -import org.eclipse.papyrus.infra.sync.SyncItem; -import org.eclipse.papyrus.infra.sync.SyncRegistry; -import org.eclipse.papyrusrt.umlrt.core.sync.UMLSyncFeature; -import org.eclipse.uml2.uml.Element; -import org.eclipse.uml2.uml.Region; -import org.eclipse.uml2.uml.UMLPackage; - -/** - * A synchronization feature for matching the regions of a state machine with the state machine that it redefines. - */ -public class StateMachineRegionsSyncFeature<M extends Element> extends UMLSyncFeature<M, Region> { - - public StateMachineRegionsSyncFeature(SyncBucket<M, EObject, Notification> bucket, EReference regionsReference) { - super(bucket, regionsReference); - } - - @Override - protected Class<? extends SyncRegistry<Region, EObject, Notification>> getNestedRegistryType() { - return RegionSyncRegistry.class; - } - - @Override - protected Command onTargetAdded(SyncItem<M, EObject> from, EObject source, SyncItem<M, EObject> to, EObject target) { - Command result = null; - - Region region = (Region) target; - Region superRegion = (Region) source; - - // Ensure the redefinition semantics - if (region.getExtendedRegion() != superRegion) { - result = SetCommand.create(getEditingDomain(), region, UMLPackage.Literals.REGION__EXTENDED_REGION, superRegion); - } - - SyncRegistry<Region, EObject, Notification> registry = getNestedRegistry(); - if (registry != null) { - // Synchronize with the super-statemachine's region - SyncBucket<Region, EObject, Notification> bucket = registry.getBucket(superRegion); - if (bucket == null) { - bucket = new RegionSyncBucket(superRegion); - registry.register(bucket); - } - result = synchronizingWrapper(registry, region, result); - } - - return result; - } - - @Override - protected Command onTargetRemoved(SyncItem<M, EObject> to, EObject target) { - // TODO Purge synchronizations no longer needed (if that's even necessary?) - return null; - } -} diff --git a/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core.sync/src/org/eclipse/papyrusrt/umlrt/core/sync/statemachine/StateMachineSyncBucket.java b/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core.sync/src/org/eclipse/papyrusrt/umlrt/core/sync/statemachine/StateMachineSyncBucket.java deleted file mode 100644 index 93be9a844..000000000 --- a/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core.sync/src/org/eclipse/papyrusrt/umlrt/core/sync/statemachine/StateMachineSyncBucket.java +++ /dev/null @@ -1,33 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2015 Christian W. Damus and others. - * - * 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: - * Christian W. Damus - Initial API and implementation - * - *****************************************************************************/ - -package org.eclipse.papyrusrt.umlrt.core.sync.statemachine; - -import org.eclipse.papyrus.infra.sync.EObjectEAttributeSyncFeature; -import org.eclipse.papyrusrt.umlrt.core.sync.UMLSyncBucket; -import org.eclipse.uml2.uml.StateMachine; -import org.eclipse.uml2.uml.UMLPackage; - -/** - * Root synchronization bucket for capsule state machines. - */ -public class StateMachineSyncBucket extends UMLSyncBucket<StateMachine> { - - public StateMachineSyncBucket(StateMachine model) { - super(model); - - add(new StateMachineRegionsSyncFeature<StateMachine>(this, UMLPackage.Literals.STATE_MACHINE__REGION)); - add(EObjectEAttributeSyncFeature.create(this, UMLPackage.Literals.NAMED_ELEMENT__NAME)); - } - -} diff --git a/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core.sync/src/org/eclipse/papyrusrt/umlrt/core/sync/statemachine/StateMachineSyncRegistry.java b/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core.sync/src/org/eclipse/papyrusrt/umlrt/core/sync/statemachine/StateMachineSyncRegistry.java deleted file mode 100644 index a9855c18f..000000000 --- a/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core.sync/src/org/eclipse/papyrusrt/umlrt/core/sync/statemachine/StateMachineSyncRegistry.java +++ /dev/null @@ -1,40 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2015 Christian W. Damus and others. - * - * 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: - * Christian W. Damus - Initial API and implementation - * - *****************************************************************************/ - -package org.eclipse.papyrusrt.umlrt.core.sync.statemachine; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.papyrusrt.umlrt.core.sync.UMLSyncRegistry; -import org.eclipse.papyrusrt.umlrt.core.utils.CapsuleUtils; -import org.eclipse.uml2.uml.StateMachine; - -/** - * Capsule statemachine inheritance synchronization registry. - */ -public class StateMachineSyncRegistry extends UMLSyncRegistry<StateMachine> { - - public StateMachineSyncRegistry() { - super(); - } - - @Override - public StateMachine getModelOf(EObject backend) { - StateMachine result = null; - - if (backend instanceof StateMachine) { - result = CapsuleUtils.getSuperBehavior((StateMachine) backend); - } - - return result; - } -} diff --git a/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core.sync/src/org/eclipse/papyrusrt/umlrt/core/sync/statemachine/TransitionSyncBucket.java b/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core.sync/src/org/eclipse/papyrusrt/umlrt/core/sync/statemachine/TransitionSyncBucket.java deleted file mode 100644 index 1f6fd227e..000000000 --- a/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core.sync/src/org/eclipse/papyrusrt/umlrt/core/sync/statemachine/TransitionSyncBucket.java +++ /dev/null @@ -1,32 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2015 Christian W. Damus and others. - * - * 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: - * Christian W. Damus - Initial API and implementation - * - *****************************************************************************/ - -package org.eclipse.papyrusrt.umlrt.core.sync.statemachine; - -import org.eclipse.papyrus.infra.sync.EObjectEAttributeSyncFeature; -import org.eclipse.papyrusrt.umlrt.core.sync.UMLSyncBucket; -import org.eclipse.uml2.uml.Transition; -import org.eclipse.uml2.uml.UMLPackage; - -/** - * Synchronization bucket for capsule state machine transitions. - */ -public class TransitionSyncBucket extends UMLSyncBucket<Transition> { - - public TransitionSyncBucket(Transition model) { - super(model); - - add(EObjectEAttributeSyncFeature.create(this, UMLPackage.Literals.NAMED_ELEMENT__NAME)); - } - -} diff --git a/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core.sync/src/org/eclipse/papyrusrt/umlrt/core/sync/statemachine/TransitionSyncRegistry.java b/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core.sync/src/org/eclipse/papyrusrt/umlrt/core/sync/statemachine/TransitionSyncRegistry.java deleted file mode 100644 index 33e20e7ad..000000000 --- a/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core.sync/src/org/eclipse/papyrusrt/umlrt/core/sync/statemachine/TransitionSyncRegistry.java +++ /dev/null @@ -1,34 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2015 Christian W. Damus and others. - * - * 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: - * Christian W. Damus - Initial API and implementation - * - *****************************************************************************/ - -package org.eclipse.papyrusrt.umlrt.core.sync.statemachine; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.papyrusrt.umlrt.core.sync.UMLSyncRegistry; -import org.eclipse.papyrusrt.umlrt.core.utils.CapsuleUtils; -import org.eclipse.uml2.uml.Transition; - -/** - * Capsule statemachine transition synchronization registry. - */ -public class TransitionSyncRegistry extends UMLSyncRegistry<Transition> { - - public TransitionSyncRegistry() { - super(); - } - - @Override - public Transition getModelOf(EObject backend) { - return (backend instanceof Transition) ? CapsuleUtils.getSuperTransition((Transition) backend) : null; - } -} diff --git a/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core.sync/src/org/eclipse/papyrusrt/umlrt/core/sync/statemachine/VertexSyncBucket.java b/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core.sync/src/org/eclipse/papyrusrt/umlrt/core/sync/statemachine/VertexSyncBucket.java deleted file mode 100644 index 99e98a110..000000000 --- a/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core.sync/src/org/eclipse/papyrusrt/umlrt/core/sync/statemachine/VertexSyncBucket.java +++ /dev/null @@ -1,46 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2015 Christian W. Damus and others. - * - * 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: - * Christian W. Damus - Initial API and implementation - * - *****************************************************************************/ - -package org.eclipse.papyrusrt.umlrt.core.sync.statemachine; - -import org.eclipse.papyrus.infra.sync.EObjectEAttributeSyncFeature; -import org.eclipse.papyrusrt.umlrt.core.sync.UMLSyncBucket; -import org.eclipse.uml2.uml.FinalState; -import org.eclipse.uml2.uml.Pseudostate; -import org.eclipse.uml2.uml.State; -import org.eclipse.uml2.uml.UMLPackage; -import org.eclipse.uml2.uml.Vertex; - -/** - * Synchronization bucket for capsule state machine vertices. - */ -public class VertexSyncBucket extends UMLSyncBucket<Vertex> { - - public VertexSyncBucket(Vertex model) { - super(model); - - add(EObjectEAttributeSyncFeature.create(this, UMLPackage.Literals.NAMED_ELEMENT__NAME)); - - // If it's a state, it has additional synchronization to be done for its regions (supporting composite states). - // Note that FinalStates, though they are states, do not have regions - if ((model instanceof State) && !(model instanceof FinalState)) { - add(new StateMachineRegionsSyncFeature<Vertex>(this, UMLPackage.Literals.STATE__REGION)); - } - - // If it's a pseudostate, the synchronize the kind - if (model instanceof Pseudostate) { - add(EObjectEAttributeSyncFeature.create(this, UMLPackage.Literals.PSEUDOSTATE__KIND)); - } - } - -} diff --git a/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core.sync/src/org/eclipse/papyrusrt/umlrt/core/sync/statemachine/VertexSyncRegistry.java b/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core.sync/src/org/eclipse/papyrusrt/umlrt/core/sync/statemachine/VertexSyncRegistry.java deleted file mode 100644 index 96b0f09ab..000000000 --- a/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core.sync/src/org/eclipse/papyrusrt/umlrt/core/sync/statemachine/VertexSyncRegistry.java +++ /dev/null @@ -1,125 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2015 Christian W. Damus and others. - * - * 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: - * Christian W. Damus - Initial API and implementation - * - *****************************************************************************/ - -package org.eclipse.papyrusrt.umlrt.core.sync.statemachine; - -import java.util.Map; - -import org.eclipse.emf.common.command.AbstractCommand; -import org.eclipse.emf.common.command.Command; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.edit.command.SetCommand; -import org.eclipse.papyrusrt.umlrt.core.sync.UMLSyncRegistry; -import org.eclipse.papyrusrt.umlrt.core.utils.CapsuleUtils; -import org.eclipse.uml2.uml.RedefinableElement; -import org.eclipse.uml2.uml.State; -import org.eclipse.uml2.uml.UMLPackage; -import org.eclipse.uml2.uml.Vertex; - -import com.google.common.collect.MapMaker; - -/** - * Capsule statemachine vertex synchronization registry. - */ -public class VertexSyncRegistry extends UMLSyncRegistry<Vertex> { - - private final Map<Vertex, Vertex> redefinitions = new MapMaker().weakKeys().weakValues().makeMap(); - - public VertexSyncRegistry() { - super(); - } - - @Override - public Vertex getModelOf(EObject backend) { - Vertex result = redefinitions.get(backend); - return (result != null) ? result : (backend instanceof Vertex) ? CapsuleUtils.getSuperVertex((Vertex) backend) : null; - } - - /** - * Externally maps a vertex as redefining another, in the case that it is a {@link State}, which is the only kind of - * vertex that is a {@link RedefinableElement}. - * - * @param redefiningVertex - * the redefining vertex. Must not be {@code null} - * @param redefinedVertex - * the redefined vertex. May be {@code null} to clear the redefinition association - */ - void setRedefinedVertex(Vertex redefiningVertex, Vertex redefinedVertex) { - if (redefinedVertex == null) { - redefinitions.remove(redefiningVertex); - } else { - redefinitions.put(redefiningVertex, redefinedVertex); - } - } - - /** - * Queries whether a {@code vertex} redefines an{@code other}. - * - * @param vertex - * a vertex - * @param other - * another vertex - * - * @return whether the {@code vertex} redefines the {@code other} - */ - boolean redefines(Vertex vertex, Vertex other) { - Vertex superVertex = (vertex instanceof State) ? CapsuleUtils.getSuperVertex(vertex) : redefinitions.get(vertex); - return other == superVertex; - } - - Command createSetRedefinedVertexCommand(Vertex redefiningVertex, Vertex redefinedVertex) { - return (redefiningVertex instanceof State) - ? SetCommand.create(getEditingDomain(), redefiningVertex, UMLPackage.Literals.STATE__REDEFINED_STATE, redefinedVertex) - : new RedefinitionCommand(redefiningVertex, redefinedVertex); - } - - // - // Nested types - // - - private final class RedefinitionCommand extends AbstractCommand implements AbstractCommand.NonDirtying { - private final Vertex redefiningVertex; - private final Vertex redefinedVertex; - - private Vertex oldRedefinedVertex; - - RedefinitionCommand(final Vertex redefiningVertex, final Vertex redefinedVertex) { - super(); - - this.redefiningVertex = redefiningVertex; - this.redefinedVertex = redefinedVertex; - } - - @Override - protected boolean prepare() { - oldRedefinedVertex = redefinitions.get(redefiningVertex); - return true; - } - - @Override - public void execute() { - setRedefinedVertex(redefiningVertex, redefinedVertex); - } - - @Override - public void undo() { - setRedefinedVertex(redefiningVertex, oldRedefinedVertex); - } - - @Override - public void redo() { - setRedefinedVertex(redefiningVertex, redefinedVertex); - } - } - -} diff --git a/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core/META-INF/MANIFEST.MF b/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core/META-INF/MANIFEST.MF index 193062cf0..8556f68ba 100644 --- a/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core/META-INF/MANIFEST.MF +++ b/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core/META-INF/MANIFEST.MF @@ -26,10 +26,12 @@ Require-Bundle: org.eclipse.core.runtime;bundle-version="3.11.0", org.eclipse.papyrus.infra.services.edit;bundle-version="1.2.0", org.eclipse.papyrus.uml.diagram.statemachine;bundle-version="1.2.0", org.eclipse.papyrus.uml.diagram.common;bundle-version="1.2.0", - org.eclipse.papyrusrt.umlrt.system.profile;bundle-version="0.8.0" + org.eclipse.papyrusrt.umlrt.system.profile;bundle-version="0.8.0", + org.eclipse.papyrusrt.umlrt.uml;bundle-version="[0.8.0,1.0.0)";visibility:=reexport Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Bundle-ActivationPolicy: lazy Export-Package: org.eclipse.papyrusrt.umlrt.core, + org.eclipse.papyrusrt.umlrt.core.commands, org.eclipse.papyrusrt.umlrt.core.defaultlanguage, org.eclipse.papyrusrt.umlrt.core.internal.commands;x-friends:="org.eclipse.papyrusrt.umlrt.tooling.diagram.common", org.eclipse.papyrusrt.umlrt.core.internal.debug;x-friends:="org.eclipse.papyrusrt.umlrt.cpp", diff --git a/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core/elementtypes/uml-rt.elementtypesconfigurations b/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core/elementtypes/uml-rt.elementtypesconfigurations index ba7067f2b..6dde0b9ec 100644 --- a/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core/elementtypes/uml-rt.elementtypesconfigurations +++ b/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core/elementtypes/uml-rt.elementtypesconfigurations @@ -294,4 +294,10 @@ <adviceBindingsConfigurations xsi:type="elementtypesconfigurations:AdviceBindingConfiguration" xmi:id="_5LsYQNckEeaJs5X9XldAaw" identifier="org.eclipse.papyrusrt.umlrt.core.types.advice.VertexEditHelperAdvice" description="Advice to delete all incoming and outing transitions with a vertex." inheritance="all" editHelperAdviceClassName="org.eclipse.papyrusrt.umlrt.core.types.advice.VertexEditHelperAdvice"> <target xsi:type="elementtypesconfigurations:MetamodelTypeConfiguration" href="../../../plugin/org.eclipse.papyrus.uml.service.types/model/uml.elementtypesconfigurations#_SdNe-lYCEeS0WsAAtVmToA"/> </adviceBindingsConfigurations> + <adviceBindingsConfigurations xsi:type="elementtypesconfigurations:AdviceBindingConfiguration" xmi:id="_ziqaULMhEeaYnN97GmbpKg" identifier="org.eclipse.papyrusrt.umlrt.core.deleteRedefinitionsAdvice" description="Deletes redefinitions inherited via a generalization relationship that is deleted." inheritance="all" editHelperAdviceClassName="org.eclipse.papyrusrt.umlrt.core.internal.types.advice.DeleteRedefinitionsAdvice"> + <target xsi:type="elementtypesconfigurations:MetamodelTypeConfiguration" href="../../../plugin/org.eclipse.papyrus.uml.service.types/model/uml.elementtypesconfigurations#_Scma8FYCEeS0WsAAtVmToA"/> + </adviceBindingsConfigurations> + <adviceBindingsConfigurations xsi:type="elementtypesconfigurations:AdviceBindingConfiguration" xmi:id="_Vzw6gLidEeaZdIQu66ocZQ" identifier="org.eclipse.papyrusrt.umlrt.core.protectRedefinitionsAdvice" description="Blocks deletion of redefinitions except when the element that they redefine is being deleted." inheritance="all" editHelperAdviceClassName="org.eclipse.papyrusrt.umlrt.core.internal.types.advice.DeleteRedefinitionsAdvice"> + <target xsi:type="elementtypesconfigurations:MetamodelTypeConfiguration" href="../../../plugin/org.eclipse.papyrus.uml.service.types/model/uml.elementtypesconfigurations#_Sc6kDFYCEeS0WsAAtVmToA"/> + </adviceBindingsConfigurations> </elementtypesconfigurations:ElementTypeSetConfiguration> diff --git a/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core/plugin.xml b/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core/plugin.xml index f2f294c37..e598e901f 100644 --- a/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core/plugin.xml +++ b/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core/plugin.xml @@ -14,6 +14,15 @@ name="language.1" value="org.eclipse.papyrusrt.umlrt.core.internal.language.UMLRTLanguage"> </parameter> + <!-- Support also the normalized URI of the profile, in case some models use that. --> + <parameter + name="profile.2" + value="platform:/plugin/org.eclipse.papyrusrt.umlrt.profile/umlProfile/uml-rt.profile.uml#_1h74oEeVEeO0lv5O1DTHOQ"> + </parameter> + <parameter + name="language.2" + value="org.eclipse.papyrusrt.umlrt.core.internal.language.UMLRTLanguage"> + </parameter> </class> </provider> </extension> @@ -26,6 +35,13 @@ properties="context" type="org.eclipse.uml2.uml.Behavior"> </propertyTester> + <propertyTester + class="org.eclipse.papyrusrt.umlrt.core.internal.expressions.UMLRTElementPropertyTester" + id="org.eclipse.papyrusrt.umlrt.core.umlrtProperties" + namespace="org.eclipse.papyrusrt.umlrt.core" + properties="isInherited,isRedefinition,isExcluded" + type="org.eclipse.uml2.uml.Element"> + </propertyTester> </extension> <extension point="org.eclipse.papyrus.infra.types.core.elementTypeSetConfiguration"> @@ -51,4 +67,12 @@ startKind="startup"> </service> </extension> + <extension + point="org.eclipse.papyrus.infra.emf.readonly.readOnlyHandler"> + <readOnlyHandler + class="org.eclipse.papyrusrt.umlrt.core.internal.language.UMLExtensionReadOnlyHandler" + priority="1000" + id="org.eclipse.papyrusrt.umlrt.core.umlextensionReadOnlyHandler"> + </readOnlyHandler> + </extension> </plugin> diff --git a/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core/src/org/eclipse/papyrusrt/umlrt/core/commands/ExcludeDependentsRequest.java b/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core/src/org/eclipse/papyrusrt/umlrt/core/commands/ExcludeDependentsRequest.java new file mode 100644 index 000000000..8021899f1 --- /dev/null +++ b/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core/src/org/eclipse/papyrusrt/umlrt/core/commands/ExcludeDependentsRequest.java @@ -0,0 +1,289 @@ +/***************************************************************************** + * Copyright (c) 2017 Christian W. Damus and others. + * + * 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: + * Christian W. Damus - Initial API and implementation + * + *****************************************************************************/ + +package org.eclipse.papyrusrt.umlrt.core.commands; + +import static java.util.Objects.requireNonNull; + +import java.util.Collection; +import java.util.Collections; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Objects; +import java.util.Set; + +import org.eclipse.emf.ecore.EObject; +import org.eclipse.gmf.runtime.common.core.command.CompositeCommand; +import org.eclipse.gmf.runtime.common.core.command.ICommand; +import org.eclipse.gmf.runtime.emf.type.core.EditHelperContext; +import org.eclipse.gmf.runtime.emf.type.core.ElementTypeRegistry; +import org.eclipse.gmf.runtime.emf.type.core.IClientContext; +import org.eclipse.gmf.runtime.emf.type.core.IElementType; +import org.eclipse.gmf.runtime.emf.type.core.requests.AbstractEditCommandRequest; +import org.eclipse.uml2.uml.Element; + +/** + * An edit request for exclusion or re-inheritance of dependent elements that must + * be excluded/re-inherited together with the originally selected element in order + * to maintain model integrity. For example, exclusion of a port of a capsule requires + * exclusion of the inherited/redefined connectors that connect it in the context + * of the inheriting capsule and, conversely, re-inheritance of a connector requires + * re-inheritance of any excluded ports that it connects. + */ +public final class ExcludeDependentsRequest extends AbstractEditCommandRequest { + + private final Set<Element> dependentElementsToExclude = new LinkedHashSet<>(); + private final Set<Element> immutableViewOfDependents = Collections.unmodifiableSet(dependentElementsToExclude); + + private ExcludeRequest initialExcludeRequest; + private Element elementToExclude; + + /** + * Initializes me with the initial exclude request for which we are finding dependents. + * + * @param excludeRequest + * the initial exclude request + * + * @throws NullPointerException + * if the request is {@code null} + */ + public ExcludeDependentsRequest(ExcludeRequest excludeRequest) { + super(requireNonNull(excludeRequest, "excludeRequest").getEditingDomain()); //$NON-NLS-1$ + + this.initialExcludeRequest = excludeRequest; + + setElementToExclude(excludeRequest.getElementToExclude()); + } + + /** + * Queries the element being excluded or reinherited. + * + * @return the element to exclude or reinherit + */ + public final Element getElementToExclude() { + return elementToExclude; + } + + /** + * Sets the element being excluded or reinherited. + * + * @param element + * the element to exclude or reinherit + */ + public final void setElementToExclude(Element element) { + this.elementToExclude = requireNonNull(element, "element"); //$NON-NLS-1$ + + dependentElementsToExclude.add(element); + } + + /** + * Queries whether the {@linkplain #getElementToExclude() element} is to be excluded. + * + * @return {@code true} if the elemet is to be excluded or + * {@code false} if it is to be reinherited + */ + public boolean isExclude() { + return initialExcludeRequest.isExclude(); + } + + @SuppressWarnings("rawtypes") + @Override + public List getElementsToEdit() { + return Collections.singletonList(getElementToExclude()); + } + + @Override + public IClientContext getClientContext() { + IClientContext result = super.getClientContext(); + + if (result == null) { + result = initialExcludeRequest.getClientContext(); + } + + return result; + } + + /** + * My edit-helper context is my {@link #getElementToExclude() element}, itself, because it best + * knows its dependents. + * + * @return my element or an edit-helper context encapsulating it with my client-context + * + * @see #getElementToExclude() + */ + @Override + public Object getEditHelperContext() { + Object result; + IClientContext context = getClientContext(); + + Element excludee = getElementToExclude(); + if (context == null) { + result = excludee; + } else { + result = new EditHelperContext(excludee, context); + } + + return result; + } + + /** + * Obtains an immutable view of the set of dependent elements to exclude/re-inherit. + * + * @return the immutable set of dependent elements + */ + public final Set<Element> getDependentElementsToDestroy() { + return immutableViewOfDependents; + } + + /** + * Obtains a command that excludes/reinherits the specified {@code dependent} of + * the {@linkplain #getElementToExclude() element to be excluded/reinherited}, if it + * is not already being excluded/reinherited by the processing of this + * {@code ExcludeDependentsRequest}. This command can then be composed with + * others by the edit helper processing the request. + * + * @param dependent + * an object dependent on the element being excluded/reinherited, + * which must also be excluded/reinherited + * + * @return a command to exclude/reinherit the {@code dependent}, or + * {@code null} if the element is already being excluded/reinherited + * + * @throws IllegalArgumentException + * on an attempt to exclude/reinherit the + * {@linkplain #getElementToExclude() element to exclude/reinherit} (as a + * dependent of itself) + * @throws NullPointerException + * on attempt to exclude/reinherit a {@code null} + * dependent + * + * @see #getExcludeDependentsCommand(Collection) + */ + public ICommand getExcludeDependentCommand(Element dependent) { + ICommand result = null; + + if (addDependentElementToExclude(dependent)) { + // Record the element that we are excluding, for later restoration + Element elementBeingExcluded = getElementToExclude(); + + try { + ExcludeRequest exclude = new ExcludeRequest(getEditingDomain(), dependent, isExclude()); + exclude.setClientContext(getClientContext()); + + // Propagate my parameters + exclude.addParameters(getParameters()); + + // Propagate the dependents information to detect cycles + exclude.setParameter(ExcludeRequest.EXCLUDE_DEPENDENTS_REQUEST_PARAMETER, this); + setElementToExclude(dependent); + + Object eHelperContext = exclude.getEditHelperContext(); + IElementType context = ElementTypeRegistry.getInstance().getElementType(eHelperContext); + + if (context != null) { + result = context.getEditCommand(exclude); + } + } finally { + // Restore the element that we are excluding + setElementToExclude(elementBeingExcluded); + } + } + + return result; + } + + /** + * Obtains a command that excludes/reinherits the specified {@code dependents} of + * the {@linkplain #getElementToExclude() element to be excluded/reinherited}, if they + * are not already being excluded/reinherited by the processing of this + * request. This command can then be composed with + * others by the edit helper processing the request. + * + * @param dependents + * dependents of the element being excluded/reinherited + * + * @return a command to exclude/reinherit all of the {@code dependents}, + * or {@code null} if they are all already being excluded/reinherited + * + * @see #getExcludeDependentCommand(Element) + */ + public ICommand getExcludeDependentsCommand(Collection<? extends Element> dependents) { + return dependents.stream() + .map(this::getExcludeDependentCommand) + .filter(Objects::nonNull) + .reduce(CompositeCommand::compose) + .orElse(null); + } + + /** + * <p> + * Indicates that the command that fulfils this request will also exclude + * or re-inherit the specified dependent of the + * {@link #getElementToExclude() element to be excluded/re-inherited}. + * </p> + * <p> + * Advice that provides a command to exclude/re-inherit a dependent element + * <em>must</em> indicate that fact by calling this method (only after + * checking whether it isn't already + * {@link #isElementToBeExcluded(Element) being excluded/re-inherited}, anyway). + * </p> + * + * @param dependent + * another object to exclude/re-inherit, which is dependent on the + * element for which we are requesting exclusion/re-inheritance + * + * @return {@code true} if the <code>dependent</code> was not already + * in the set of elements being excluded/re-inherited; {@code false}, otherwise + * + * @throws IllegalArgumentException + * on an attempt to add the + * {@link #getElementToExclude() element to be excluded/re-inherited} as a dependent + * of itself + * @throws NullPointerException + * on attempt to add a {@code null} element + * + * @see #isElementToBeExcluded(Element) + * @see #getElementToExclude() + * @see #getExcludeDependentCommand(Element) + */ + protected boolean addDependentElementToExclude(Element dependent) { + if (requireNonNull(dependent, "dependent") == getElementToExclude()) { + throw new IllegalArgumentException("dependent is the element being excluded"); //$NON-NLS-1$ + } + + return !isElementToBeExcluded(dependent) && dependentElementsToExclude.add(dependent); + } + + /** + * Queries whether the specified element will be excluded/re-inherited as a result of + * the fulfillment of this request.. + * + * @param element + * an element + * + * @return {@code true} if the command that fulfils this request + * would exclude/re-inherit the {@code element}; {@code false} if a new + * command would have to be composed with it to exclude/re-inherit the {@code element} + */ + protected boolean isElementToBeExcluded(Element element) { + boolean result = false; + + EObject excludee = getElementToExclude(); + + for (EObject toCheck = element; !result && (toCheck != null); toCheck = toCheck.eContainer()) { + result = (toCheck == excludee) || dependentElementsToExclude.contains(toCheck); + } + + return result; + } +} diff --git a/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core/src/org/eclipse/papyrusrt/umlrt/core/commands/ExcludeRequest.java b/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core/src/org/eclipse/papyrusrt/umlrt/core/commands/ExcludeRequest.java new file mode 100644 index 000000000..177a9272a --- /dev/null +++ b/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core/src/org/eclipse/papyrusrt/umlrt/core/commands/ExcludeRequest.java @@ -0,0 +1,220 @@ +/***************************************************************************** + * Copyright (c) 2016, 2017 Christian W. Damus and others. + * + * 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: + * Christian W. Damus - Initial API and implementation + * + *****************************************************************************/ + +package org.eclipse.papyrusrt.umlrt.core.commands; + +import static java.util.Objects.requireNonNull; + +import java.util.Collections; +import java.util.List; +import java.util.function.Function; + +import org.eclipse.emf.transaction.TransactionalEditingDomain; +import org.eclipse.emf.transaction.util.TransactionUtil; +import org.eclipse.gmf.runtime.common.core.command.ICommand; +import org.eclipse.gmf.runtime.emf.type.core.EditHelperContext; +import org.eclipse.gmf.runtime.emf.type.core.IClientContext; +import org.eclipse.gmf.runtime.emf.type.core.requests.AbstractEditCommandRequest; +import org.eclipse.uml2.uml.Element; + +/** + * An edit request for exclusion (analogous to destroy except that it merely + * excludes an inherited element) or re-inheritance, which is a quasi-opposite + * of exclusion. + */ +public final class ExcludeRequest extends AbstractEditCommandRequest { + + /** + * Key for the request parameter bearing the request to exclude/re-inherit dependents. + * The value of the parameter is of type {@link ExcludeDependentsParameter}. + */ + public static final String EXCLUDE_DEPENDENTS_REQUEST_PARAMETER = "ExcludeRequest.excludeDependentsRequest"; //$NON-NLS-1$ + + /** + * Key for the request parameter indicating the initial element selected for exclusion/reinheritance. + * The value of the parameter is of type {@link Element}. + */ + public static final String INITIAL_ELEMENT_TO_EXCLUDE_PARAMETER = "ExcludeRequest.initialElementToExclude"; //$NON-NLS-1$ + + private final boolean exclude; + + private Element element; + + /** + * Initializes me with my context editing domain and the {@code element} to be excluded or reinherited. + * + * @param editingDomain + * the context editing domain + * @param element + * the element to be excluded or reinherited + * @param exclude + * {@code true} to exclude the {@code element}, {@code false} to reinherit it + * + * @throws NullPointerException + * if either the {@code element} or its {@link Element#getOwner() owner} is {@code null}, + * because it doesn't make sense to exclude an unowned element because it cannot in that + * case be inherited (besides that only packages can be unowned) + */ + public ExcludeRequest(TransactionalEditingDomain editingDomain, Element element, boolean exclude) { + super(requireNonNull(editingDomain, "editingDomain")); //$NON-NLS-1$ + + this.exclude = exclude; + setElementToExclude(element); + } + + /** + * Initializes me with the {@code element} to be excluded or reinherited. The editing domain context is + * inferred from the {@code element}. + * + * @param element + * the element to be excluded + * @param exclude + * {@code true} to exclude the {@code element}, {@code false} to reinherit it + * + * @throws NullPointerException + * if either the {@code element} or its {@link Element#getOwner() owner} is {@code null}, + * because it doesn't make sense to exclude an unowned element because it cannot in that + * case be inherited (besides that only packages can be unowned) + */ + public ExcludeRequest(Element element, boolean exclude) { + this(TransactionUtil.getEditingDomain(element), element, exclude); + } + + /** + * Queries the element to exclude or reinherit. + * + * @return the element to exclude or reinherit + */ + public final Element getElementToExclude() { + return element; + } + + /** + * Sets the element to exclude or re-inherit. This is intended primarily + * for re-use of a request to exclude/re-inherit multiple elements. + * + * @param element + * the element to exclude or re-inherit + * + * @throws NullPointerException + * if either the {@code element} or its {@link Element#getOwner() owner} is {@code null}, + * because it doesn't make sense to exclude an unowned element because it cannot in that + * case be inherited (besides that only packages can be unowned) + */ + public final void setElementToExclude(Element element) { + this.element = requireNonNull(element, "element"); //$NON-NLS-1$ + + requireNonNull(element.getOwner(), "element.owner"); //$NON-NLS-1$ + } + + /** + * Queries whether the {@linkplain #getElementToExclude() element} is to be excluded. + * + * @return {@code true} if the elemet is to be excluded or + * {@code false} if it is to be reinherited + */ + public boolean isExclude() { + return exclude; + } + + @SuppressWarnings("rawtypes") + @Override + public List getElementsToEdit() { + return Collections.singletonList(getElementToExclude()); + } + + /** + * My edit-helper context is my {@link #getElementToExclude() element}'s owner. + * Roots of the model tree cannot be excluded because obviously they could not + * be inherited, having no owner. + * + * @return my element's owner or an edit-helper context encapsulating it with my client-context + * + * @throws NullPointerException + * if now the {@linkplain #getElementToExclude() element} has no owner + * + * @see #getElementToExclude() + * @see Element#getOwner() + */ + @Override + public Object getEditHelperContext() { + Object result; + IClientContext context = getClientContext(); + + Element owner = requireNonNull(getElementToExclude().getOwner(), "element.owner"); //$NON-NLS-1$ + + if (context == null) { + result = owner; + } else { + result = new EditHelperContext(owner, context); + } + + return result; + } + + /** + * Creates the default edit-command performing this request. + * + * @return the default exclusion/reinheritance edit-command + */ + public ICommand getDefaultCommand() { + return new ExclusionCommand(getEditingDomain(), getElementToExclude(), isExclude()); + } + + /** + * Obtains a supplier of exclusion requests for serial processing of + * multiple elements that optimally reuses request instances. + * + * @param domain + * the editing-domain context to use explicitly in requests + * @param exclude + * {@code true} if elements are to be excluded or + * {@code false} if they are to be re-inherited + * @return the serial exclusion-request function + */ + public static Function<Element, ExcludeRequest> serialRequest(TransactionalEditingDomain domain, boolean exclude) { + return serialRequest(element -> new ExcludeRequest(domain, element, exclude)); + } + + /** + * Obtains a supplier of exclusion requests for serial processing of + * multiple elements that optimally reuses request instances. + * + * @param exclude + * {@code true} if elements are to be excluded or + * {@code false} if they are to be re-inherited + * @return the serial exclusion-request function + */ + public static Function<Element, ExcludeRequest> serialRequest(boolean exclude) { + return serialRequest(element -> new ExcludeRequest(element, exclude)); + } + + private static Function<Element, ExcludeRequest> serialRequest(Function<Element, ExcludeRequest> initializer) { + return new Function<Element, ExcludeRequest>() { + private ExcludeRequest request; + + @Override + public ExcludeRequest apply(Element element) { + if (request == null) { + request = initializer.apply(element); + } else { + // This element must be the new initial, so forget any previous + request.setParameter(INITIAL_ELEMENT_TO_EXCLUDE_PARAMETER, null); + request.setElementToExclude(element); + } + + return request; + } + }; + } +} diff --git a/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core/src/org/eclipse/papyrusrt/umlrt/core/commands/ExclusionCommand.java b/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core/src/org/eclipse/papyrusrt/umlrt/core/commands/ExclusionCommand.java new file mode 100644 index 000000000..30b727cfa --- /dev/null +++ b/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core/src/org/eclipse/papyrusrt/umlrt/core/commands/ExclusionCommand.java @@ -0,0 +1,277 @@ +/***************************************************************************** + * Copyright (c) 2016, 2017 Christian W. Damus and others. + * + * 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: + * Christian W. Damus - Initial API and implementation + * + *****************************************************************************/ + +package org.eclipse.papyrusrt.umlrt.core.commands; + +import java.util.Collection; +import java.util.Collections; +import java.util.List; +import java.util.Objects; +import java.util.function.Predicate; +import java.util.stream.Collectors; + +import org.eclipse.core.commands.ExecutionException; +import org.eclipse.core.runtime.IAdaptable; +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.emf.transaction.TransactionalEditingDomain; +import org.eclipse.emf.transaction.util.TransactionUtil; +import org.eclipse.gmf.runtime.common.core.command.CommandResult; +import org.eclipse.gmf.runtime.common.core.command.ICommand; +import org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand; +import org.eclipse.gmf.runtime.emf.type.core.ElementTypeRegistry; +import org.eclipse.gmf.runtime.emf.type.core.IElementType; +import org.eclipse.papyrus.infra.services.edit.utils.ElementTypeUtils; +import org.eclipse.papyrusrt.umlrt.uml.UMLRTFactory; +import org.eclipse.papyrusrt.umlrt.uml.UMLRTInheritanceKind; +import org.eclipse.papyrusrt.umlrt.uml.UMLRTNamedElement; +import org.eclipse.uml2.uml.Element; +import org.eclipse.uml2.uml.NamedElement; + +import com.google.common.collect.ImmutableList; + +/** + * A command to set the exclusion state of inherited model elements. + * The result of execution contains the {@link #getElement() elements} + * for which the exclusion state was successfully changed. Otherwise, the + * result is empty (but still OK), usually because the elements were already + * in the desired state. + */ +public class ExclusionCommand extends AbstractTransactionalCommand { + + private List<Element> elements; + private boolean exclude; + + /** + * Initializes me with the {@code element} to exclude or reinherit and whether it + * is to be excluded or reinherited. + * + * @param element + * an element to exclude or reinherit + * @param exclude + * {@code true} to exclude the element; {@code false} to reinherit it + */ + public ExclusionCommand(Element element, boolean exclude) { + this(TransactionUtil.getEditingDomain(element), element, exclude); + } + + /** + * Initializes me with the {@code element} to exclude or reinherit and whether it + * is to be excluded or reinherited, in an explicit editing-domain context. + * + * @param domain + * the editing domain context + * @param element + * an element to exclude or reinherit + * @param exclude + * {@code true} to exclude the element; {@code false} to reinherit it + */ + public ExclusionCommand(TransactionalEditingDomain domain, Element element, boolean exclude) { + this(domain, Collections.singletonList(element), exclude); + } + + /** + * Initializes me with the {@code elements} to exclude or reinherit and whether it + * is to be excluded or reinherited, in an explicit editing-domain context. + * + * @param domain + * the editing domain context + * @param elements + * a non-empty collection of elements to exclude or reinherit + * @param exclude + * {@code true} to exclude the elements; {@code false} to reinherit them + * + * @throws IllegalArgumentException + * if the {@code elements} collection is empty + */ + public ExclusionCommand(TransactionalEditingDomain domain, Collection<? extends Element> elements, boolean exclude) { + this(domain, ImmutableList.copyOf(elements), exclude); + } + + private ExclusionCommand(TransactionalEditingDomain domain, List<Element> elements, boolean exclude) { + super(domain, exclude ? "Exclude Element" : "Re-inherit Element", getWorkspaceFiles(elements)); + + if (elements.isEmpty()) { + throw new IllegalArgumentException("no elements"); //$NON-NLS-1$ + } + + this.elements = elements; + this.exclude = exclude; + } + + /** + * Obtains the model elements that I {@linkplain #isExclude() exclude or reinherit}. + * + * @return my elements + * + * @see #isExclude() + */ + public List<? extends Element> getElements() { + return elements; + } + + /** + * Queries whether I exclude my {@link #getElements() elements}. + * + * @return {@code true} if I exclude my elements; {@code false} if I reinherit them + * + * @see #getElements() + */ + public boolean isExclude() { + return exclude; + } + + /** + * I can execute if the basic conditions of my superclass are met and + * my element {@linkplain #isElementInherited() is inherited}. + */ + @Override + public boolean canExecute() { + return super.canExecute() && elements.stream().allMatch(this::isInherited); + } + + /** + * Obtains the UML-RT façade for an element. + * + * @param element + * an element + * @return the {@code element}'s UML-RT façade, or {@code null} if it has none + */ + protected UMLRTNamedElement getUMLRTNamedElement(Element element) { + return (element instanceof NamedElement) + ? UMLRTFactory.create((NamedElement) element) + : null; + } + + /** + * Queries whether an element is inherited, either as is or redefining an + * inherited element. + * + * @param element + * an element + * @return whether the {@code element} is inherited (or a redefinition) + */ + protected boolean isInherited(Element element) { + return UMLRTInheritanceKind.of(element) != UMLRTInheritanceKind.NONE; + } + + @Override + protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException { + CommandResult result; + + if (!canExecute()) { + throw new ExecutionException("Not executable"); //$NON-NLS-1$ + } else { + Predicate<UMLRTNamedElement> action = exclude + ? UMLRTNamedElement::exclude + : UMLRTNamedElement::reinherit; + + result = CommandResult.newOKCommandResult(getElements().stream() + .map(this::getUMLRTNamedElement) + .filter(Objects::nonNull) + .filter(action) // This 'cheat' actually does our command + .map(UMLRTNamedElement::toUML) + .collect(Collectors.toList())); + } + + return result; + } + + /** + * Obtains an exclusion command for the given {@code elements}. + * + * @param domain + * the editing-domain context + * @param elements + * a collection of elemenst to exclude or re-inherit + * @param exclude + * {@code true} to exclude the {@code elements}; {@code false} to re-inherit them + * + * @return the exclusion command + */ + public static ICommand getExclusionCommand(TransactionalEditingDomain domain, Collection<? extends Element> elements, boolean exclude) { + return elements.stream() + .map(ExcludeRequest.serialRequest(domain, exclude)) + .map(ExclusionCommand::getExclusionCommand) + .filter(Objects::nonNull) + .reduce(ICommand::compose) + .orElse(null); + } + + /** + * Obtains an exclusion command for the given {@code element}. + * + * @param domain + * the editing-domain context + * @param element + * an element to exclude or re-inherit + * @param exclude + * {@code true} to exclude the {@code element}; {@code false} to re-inherit it + * + * @return the exclusion command + */ + public static ICommand getExclusionCommand(TransactionalEditingDomain domain, Element element, boolean exclude) { + return getExclusionCommand(new ExcludeRequest(domain, element, exclude)); + } + + private static ICommand getExclusionCommand(ExcludeRequest request) { + ICommand result = null; + + if (request.getClientContext() == null) { + request.setClientContext(ElementTypeUtils.getEditContext()); + } + + IElementType typeToEdit = ElementTypeRegistry.getInstance().getElementType(request.getEditHelperContext()); + if (typeToEdit != null) { + result = typeToEdit.getEditCommand(request); + } + + return result; + } + + /** + * Obtains an exclusion command for the given {@code elements}. The editing-domain + * context is inferred from the {@code elements}. + * + * @param domain + * the editing-domain context + * @param elements + * a collection of elemenst to exclude or re-inherit + * @param exclude + * {@code true} to exclude the {@code elements}; {@code false} to re-inherit them + * + * @return the exclusion command + */ + public static ICommand getExclusionCommand(Collection<? extends Element> elements, boolean exclude) { + return elements.stream() + .map(ExcludeRequest.serialRequest(exclude)) + .map(ExclusionCommand::getExclusionCommand) + .filter(Objects::nonNull) + .reduce(ICommand::compose) + .orElse(null); + } + + /** + * Obtains an exclusion command for the given {@code element}. The editing-domain + * context is inferred from the {@code element}. + * + * @param element + * an element to exclude or re-inherit + * @param exclude + * {@code true} to exclude the {@code element}; {@code false} to re-inherit it + * + * @return the exclusion command + */ + public static ICommand getExclusionCommand(Element element, boolean exclude) { + return getExclusionCommand(new ExcludeRequest(element, exclude)); + } +} diff --git a/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core/src/org/eclipse/papyrusrt/umlrt/core/internal/expressions/UMLRTElementPropertyTester.java b/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core/src/org/eclipse/papyrusrt/umlrt/core/internal/expressions/UMLRTElementPropertyTester.java new file mode 100644 index 000000000..25339bc18 --- /dev/null +++ b/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core/src/org/eclipse/papyrusrt/umlrt/core/internal/expressions/UMLRTElementPropertyTester.java @@ -0,0 +1,80 @@ +/***************************************************************************** + * Copyright (c) 2016, 2017 Christian W. Damus and others. + * + * 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: + * Christian W. Damus - Initial API and implementation + * + *****************************************************************************/ + +package org.eclipse.papyrusrt.umlrt.core.internal.expressions; + +import java.util.Optional; + +import org.eclipse.core.expressions.PropertyTester; +import org.eclipse.papyrus.infra.tools.util.PlatformHelper; +import org.eclipse.papyrusrt.umlrt.uml.UMLRTFactory; +import org.eclipse.papyrusrt.umlrt.uml.UMLRTInheritanceKind; +import org.eclipse.papyrusrt.umlrt.uml.UMLRTNamedElement; +import org.eclipse.uml2.uml.Element; +import org.eclipse.uml2.uml.NamedElement; + +/** + * XML expressions property tester for UML-RT {@link Element}s. + */ +public class UMLRTElementPropertyTester extends PropertyTester { + private static final String IS_INHERITED = "isInherited"; + private static final String IS_REDEFINITION = "isRedefinition"; + private static final String IS_EXCLUDED = "isExcluded"; + + public UMLRTElementPropertyTester() { + super(); + } + + @Override + public boolean test(Object receiver, String property, Object[] args, Object expectedValue) { + Element element = PlatformHelper.getAdapter(receiver, Element.class); + + switch (property) { + case IS_INHERITED: + return isInherited(element) == asBoolean(expectedValue, true); + case IS_REDEFINITION: + return isRedefinition(element) == asBoolean(expectedValue, true); + case IS_EXCLUDED: + return isExcluded(element) == asBoolean(expectedValue, true); + default: + return false; + } + } + + boolean asBoolean(Object value, boolean defaultValue) { + return (value instanceof Boolean) + ? (Boolean) value + : (value == null) + ? defaultValue + : Boolean.valueOf(String.valueOf(value)); + } + + protected Optional<UMLRTNamedElement> toUMLRT(Element element) { + return Optional.ofNullable(element) + .filter(NamedElement.class::isInstance).map(NamedElement.class::cast) + .map(UMLRTFactory::create); + } + + protected boolean isInherited(Element element) { + return UMLRTInheritanceKind.of(element) == UMLRTInheritanceKind.INHERITED; + } + + protected boolean isRedefinition(Element element) { + return UMLRTInheritanceKind.of(element) == UMLRTInheritanceKind.REDEFINED; + } + + protected boolean isExcluded(Element element) { + return UMLRTInheritanceKind.of(element) == UMLRTInheritanceKind.EXCLUDED; + } + +} diff --git a/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core/src/org/eclipse/papyrusrt/umlrt/core/internal/language/UMLExtensionReadOnlyHandler.java b/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core/src/org/eclipse/papyrusrt/umlrt/core/internal/language/UMLExtensionReadOnlyHandler.java new file mode 100644 index 000000000..c3fd30755 --- /dev/null +++ b/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core/src/org/eclipse/papyrusrt/umlrt/core/internal/language/UMLExtensionReadOnlyHandler.java @@ -0,0 +1,57 @@ +/***************************************************************************** + * Copyright (c) 2016 Christian W. Damus and others. + * + * 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: + * Christian W. Damus - Initial API and implementation + * + *****************************************************************************/ + +package org.eclipse.papyrusrt.umlrt.core.internal.language; + +import java.util.Set; + +import org.eclipse.emf.common.util.URI; +import org.eclipse.emf.edit.domain.EditingDomain; +import org.eclipse.papyrus.infra.core.resource.AbstractReadOnlyHandler; +import org.eclipse.papyrus.infra.core.resource.ReadOnlyAxis; + +import com.google.common.base.Optional; + +/** + * Read-only support for the special extension resource that must always be + * treated as writable. + */ +public class UMLExtensionReadOnlyHandler extends AbstractReadOnlyHandler { + private static final URI EXTENSIONS_URI = URI.createURI("umlrt://extensions"); //$NON-NLS-1$ + + public UMLExtensionReadOnlyHandler(EditingDomain editingDomain) { + super(editingDomain); + } + + @Override + public Optional<Boolean> anyReadOnly(Set<ReadOnlyAxis> axes, URI[] uris) { + // I must handle the permission axis in addition to discretion because + // otherwise I could not overrule the EMFReadOnlyHandler + + int knownWritable = 0; + for (int i = 0; i < uris.length; i++) { + if (EXTENSIONS_URI.equals(uris[i])) { + knownWritable++; + } + } + + return (knownWritable == uris.length) ? Optional.of(false) : Optional.absent(); + } + + @Override + public Optional<Boolean> makeWritable(Set<ReadOnlyAxis> axes, URI[] uris) { + // I never report read-only for a resource + return Optional.absent(); + } + +} diff --git a/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core/src/org/eclipse/papyrusrt/umlrt/core/internal/language/UMLRTLanguage.java b/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core/src/org/eclipse/papyrusrt/umlrt/core/internal/language/UMLRTLanguage.java index 8aaf63d8a..acfdc79ec 100644 --- a/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core/src/org/eclipse/papyrusrt/umlrt/core/internal/language/UMLRTLanguage.java +++ b/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core/src/org/eclipse/papyrusrt/umlrt/core/internal/language/UMLRTLanguage.java @@ -1,5 +1,5 @@ /***************************************************************************** - * Copyright (c) 2015 Christian W. Damus and others. + * Copyright (c) 2015, 2016 Christian W. Damus and others. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 @@ -13,10 +13,29 @@ package org.eclipse.papyrusrt.umlrt.core.internal.language; +import java.util.Collection; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.notify.Notifier; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EFactory; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.EPackage; +import org.eclipse.emf.ecore.resource.Resource; +import org.eclipse.emf.ecore.resource.ResourceSet; +import org.eclipse.emf.transaction.Transaction; +import org.eclipse.emf.transaction.TransactionalEditingDomain; +import org.eclipse.emf.transaction.TransactionalEditingDomainEvent; +import org.eclipse.emf.transaction.TransactionalEditingDomainListener; +import org.eclipse.emf.transaction.TransactionalEditingDomainListenerImpl; +import org.eclipse.emf.transaction.util.TransactionUtil; +import org.eclipse.gmf.runtime.emf.core.resources.ResourceHelperImpl; import org.eclipse.papyrus.infra.core.language.Language; import org.eclipse.papyrus.infra.core.language.Version; import org.eclipse.papyrus.infra.core.resource.ModelSet; import org.eclipse.papyrusrt.umlrt.core.Activator; +import org.eclipse.papyrusrt.umlrt.core.utils.UMLRTCommandUtils; +import org.eclipse.papyrusrt.umlrt.uml.util.UMLRTResourcesUtil; /** * Implementation of the UML-RT language extension. @@ -29,19 +48,113 @@ public class UMLRTLanguage extends Language { super(UMLRT_LANGUAGE_ID, new Version(1, 1, 0), "UML Real-Time"); //$NON-NLS-1$ } - /** - * {@inheritDoc} - */ + private TransactionalEditingDomainListener transactionListener; + @Override public void install(ModelSet modelSet) { - Activator.log.debug("UML-RT Language installation is not implemented, yet."); //$NON-NLS-1$ + UMLRTResourcesUtil.installUMLRTFactory(modelSet); + UMLRTResourcesUtil.initLocalStereotypeApplicationHelper(modelSet); + UMLRTResourcesUtil.setUndoRedoRecognizer(modelSet, + msg -> UMLRTCommandUtils.isUndoRedoInProgress((Notifier) msg.getNotifier())); + + // Add a GMF resource-helper to ensure usage of the correct EFactory instances + // in the EMFCoreUtil API used by GMF to create model elements + installResourceHelper(modelSet); + + TransactionalEditingDomain.Lifecycle lifecycle = TransactionUtil.getAdapter(modelSet.getTransactionalEditingDomain(), + TransactionalEditingDomain.Lifecycle.class); + if (lifecycle != null) { + // Initialize undo/redo support for implicit redefinitions + initializeUndoRedo(lifecycle); + } + } + + private void installResourceHelper(ModelSet modelSet) { + modelSet.eAdapters().add(new ResourceHelperImpl() { + + @Override + public void notifyChanged(Notification msg) { + if (msg.getNotifier() instanceof ResourceSet) { + if (msg.getFeatureID(ResourceSet.class) == ResourceSet.RESOURCE_SET__RESOURCES) { + switch (msg.getEventType()) { + case Notification.ADD: + ((Resource) msg.getNewValue()).eAdapters().add(this); + break; + case Notification.ADD_MANY: + ((Collection<?>) msg.getNewValue()).forEach( + r -> ((Resource) r).eAdapters().add(this)); + break; + case Notification.REMOVE: + ((Resource) msg.getOldValue()).eAdapters().remove(this); + break; + case Notification.REMOVE_MANY: + ((Collection<?>) msg.getOldValue()).forEach( + r -> ((Resource) r).eAdapters().remove(this)); + break; + case Notification.SET: + ((Resource) msg.getNewValue()).eAdapters().add(this); + ((Resource) msg.getOldValue()).eAdapters().remove(this); + break; + } + } + } + } + + @Override + public EObject create(EClass eClass) { + EPackage package_ = eClass.getEPackage(); + EFactory factory = modelSet.getPackageRegistry().getEFactory(package_.getNsURI()); + if (factory == null) { + factory = package_.getEFactoryInstance(); + } + return factory.create(eClass); + } + }); + } + + @SuppressWarnings("restriction") + private void initializeUndoRedo(TransactionalEditingDomain.Lifecycle domainLifecycle) { + transactionListener = new TransactionalEditingDomainListenerImpl() { + @Override + public void transactionStarted(TransactionalEditingDomainEvent event) { + if (isUndoRedoTransaction(event)) { + org.eclipse.papyrusrt.umlrt.uml.internal.util.ReificationAdapter reifier = org.eclipse.papyrusrt.umlrt.uml.internal.util.ReificationAdapter.getInstance(event.getSource().getResourceSet()); + if (reifier != null) { + // Disable auto-reification of redefinition elements for this transaction + reifier.disableAutoReification(); + } + } + } + + @Override + public void transactionClosed(TransactionalEditingDomainEvent event) { + if (isUndoRedoTransaction(event)) { + org.eclipse.papyrusrt.umlrt.uml.internal.util.ReificationAdapter reifier = org.eclipse.papyrusrt.umlrt.uml.internal.util.ReificationAdapter.getInstance(event.getSource().getResourceSet()); + if (reifier != null) { + // Re-enable auto-reification of redefinition elements + reifier.enableAutoReification(); + } + } + } + + private boolean isUndoRedoTransaction(TransactionalEditingDomainEvent event) { + Transaction transaction = event.getTransaction(); + return (transaction != null) + && Boolean.TRUE.equals(transaction.getOptions().get( + Transaction.OPTION_IS_UNDO_REDO_TRANSACTION)); + } + }; + domainLifecycle.addTransactionalEditingDomainListener(transactionListener); } - /** - * {@inheritDoc} - */ @Override public void uninstall(ModelSet modelSet) { - Activator.log.debug("UML-RT Language uninstallation is not implemented, yet."); //$NON-NLS-1$ + TransactionalEditingDomain.Lifecycle lifecycle = TransactionUtil.getAdapter(modelSet.getTransactionalEditingDomain(), + TransactionalEditingDomain.Lifecycle.class); + if (lifecycle != null) { + lifecycle.removeTransactionalEditingDomainListener(transactionListener); + } + + UMLRTResourcesUtil.uninstallUMLRTFactory(modelSet); } } diff --git a/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core/src/org/eclipse/papyrusrt/umlrt/core/internal/types/advice/DeleteRedefinitionsAdvice.java b/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core/src/org/eclipse/papyrusrt/umlrt/core/internal/types/advice/DeleteRedefinitionsAdvice.java new file mode 100644 index 000000000..49ca39585 --- /dev/null +++ b/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core/src/org/eclipse/papyrusrt/umlrt/core/internal/types/advice/DeleteRedefinitionsAdvice.java @@ -0,0 +1,269 @@ +/***************************************************************************** + * Copyright (c) 2016, 2017 Christian W. Damus and others. + * + * 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: + * Christian W. Damus - Initial API and implementation + * + *****************************************************************************/ + +package org.eclipse.papyrusrt.umlrt.core.internal.types.advice; + +import static org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest.DESTROY_DEPENDENTS_REQUEST_PARAMETER; + +import java.util.Optional; +import java.util.stream.Stream; + +import org.eclipse.emf.ecore.EObject; +import org.eclipse.gmf.runtime.common.core.command.ICommand; +import org.eclipse.gmf.runtime.common.core.command.UnexecutableCommand; +import org.eclipse.gmf.runtime.emf.type.core.ElementTypeRegistry; +import org.eclipse.gmf.runtime.emf.type.core.IElementType; +import org.eclipse.gmf.runtime.emf.type.core.edithelper.AbstractEditHelperAdvice; +import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyDependentsRequest; +import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest; +import org.eclipse.papyrusrt.umlrt.core.utils.UMLRTCommandUtils; +import org.eclipse.papyrusrt.umlrt.uml.UMLRTCapsule; +import org.eclipse.papyrusrt.umlrt.uml.UMLRTClassifier; +import org.eclipse.papyrusrt.umlrt.uml.UMLRTFactory; +import org.eclipse.papyrusrt.umlrt.uml.UMLRTNamedElement; +import org.eclipse.papyrusrt.umlrt.uml.UMLRTProtocol; +import org.eclipse.papyrusrt.umlrt.uml.util.UMLRTSwitch; +import org.eclipse.uml2.uml.Generalization; +import org.eclipse.uml2.uml.NamedElement; +import org.eclipse.uml2.uml.Namespace; + +/** + * Advice that handles the deletion of redefinitions of elements being deleted, + * according to the semantics of UML-RT redefinition. + */ +public class DeleteRedefinitionsAdvice extends AbstractEditHelperAdvice { + + /** + * Initializes me. + */ + public DeleteRedefinitionsAdvice() { + super(); + } + + @Override + protected ICommand getBeforeDestroyDependentsCommand(DestroyDependentsRequest request) { + ICommand result = null; + + EObject destructee = request.getElementToDestroy(); + if (destructee instanceof Generalization) { + result = getBeforeDestroyDependentsCommand(request, (Generalization) destructee); + } else if (destructee instanceof NamedElement) { + UMLRTNamedElement rt = UMLRTFactory.create((NamedElement) destructee); + + if (rt != null) { + if (rt.isInherited()) { + // We cannot destroy a redefinition unless we are destroying the root definition, + // or the generalization by which it is inherited, or perhaps the namespace that + // contains it + if (!canDestroy(request, rt)) { + // Block the deletion operation + result = UnexecutableCommand.INSTANCE; + } + } else { + // Destroying the root element. Its redefinitions are dependents + result = getBeforeDestroyDependentsCommand(request, rt); + } + } + } + + return result; + } + + boolean canDestroy(DestroyDependentsRequest request, UMLRTNamedElement element) { + boolean result; + + Namespace namespace = element.toUML().getNamespace(); + if ((namespace != null) && isBeingDestroyed(request, namespace)) { + result = true; + } else { + // The easy case is when the element that I redefine is being destroyed + UMLRTNamedElement redefined = element.getRedefinedElement(); + if ((redefined != null) && isBeingDestroyed(request, redefined.toUML())) { + result = true; + } else { + // Assume that the redefinition is not valid until otherwise determined + result = true; + + UMLRTNamedElement root = element.getRootDefinition(); + if ((root != null) + && (element.getRedefinitionContext() instanceof UMLRTClassifier) + && (root.getRedefinitionContext() instanceof UMLRTClassifier)) { + + UMLRTClassifier subtype = (UMLRTClassifier) element.getRedefinitionContext(); + UMLRTClassifier supertype = (UMLRTClassifier) root.getRedefinitionContext(); + + if (supertype.isSuperTypeOf(subtype)) { + // Valid redefinition. Look for a generalization by which the + // definition is inherited being destroyed + result = generalizations(subtype, supertype) + .anyMatch(g -> isBeingDestroyed(request, g)); + } + } + } + } + + return result; + } + + boolean isBeingDestroyed(DestroyDependentsRequest request, EObject object) { + boolean result = false; + + for (EObject test = object; !result && (test != null); test = test.eContainer()) { + result = (request.getElementToDestroy() == test) + || request.getDependentElementsToDestroy().contains(test); + } + + return result; + } + + /** + * Obtains the sequence of generalization relationships from one classifier to another. + * + * @param fromClassifier + * an inheriting classifier + * @param toClassifier + * an inherited classifier + * + * @return the sequence of generalizations, which is undefined if the {@code fromClassifier} + * does not actually inherit the {@code toClassifier} + */ + private Stream<Generalization> generalizations(UMLRTClassifier fromClassifier, UMLRTClassifier toClassifier) { + Stream.Builder<Generalization> result = Stream.builder(); + + UMLRTClassifier supertype; + + for (UMLRTClassifier classifier = fromClassifier; (classifier != null) && (classifier != toClassifier); classifier = supertype) { + supertype = getSupertype(classifier); + if (supertype != null) { + result.add(classifier.toUML().getGeneralization(supertype.toUML())); + } + } + + return result.build(); + } + + private UMLRTClassifier getSupertype(UMLRTClassifier classifier) { + UMLRTClassifier result = null; + + if (classifier instanceof UMLRTCapsule) { + result = ((UMLRTCapsule) classifier).getSuperclass(); + } else if (classifier instanceof UMLRTProtocol) { + result = ((UMLRTProtocol) classifier).getSuperProtocol(); + } + + return result; + } + + protected ICommand getBeforeDestroyDependentsCommand(DestroyDependentsRequest request, Generalization destructee) { + ICommand result; + + Optional<UMLRTClassifier> classifier = Optional.ofNullable(UMLRTFactory.create(destructee.getSpecific())) + .filter(UMLRTClassifier.class::isInstance).map(UMLRTClassifier.class::cast); + + // Seek and destroy all redefinitions in the hierarchy. This should be + // more efficient than letting destroy-dependents traverse the redefinition + // hierarchy recursively + Stream<? extends UMLRTClassifier> hierarchy = classifier.map(UMLRTClassifier::getHierarchy).orElseGet(Stream::empty); + Stream<NamedElement> elementsToDestroy = hierarchy.skip(1) // Don't look for redefinitions in the root type + .flatMap(this::inheritableMembers) + .filter(p -> inheritsFrom(p, classifier.get())) + .map(UMLRTNamedElement::toUML); + + result = elementsToDestroy + .map(request::getDestroyDependentCommand) + .reduce(UMLRTCommandUtils::flatCompose) + .orElse(null); + + return result; + } + + boolean inheritsFrom(UMLRTNamedElement element, UMLRTClassifier classifier) { + return Optional.ofNullable(element.getInheritedElement()) + .map(UMLRTNamedElement::getRedefinitionContext) + .map(UMLRTClassifier.class::cast) + .map(c -> c.isSuperTypeOf(classifier)) + .orElse(false); + } + + Stream<? extends UMLRTNamedElement> inheritableMembers(UMLRTClassifier classifier) { + return new UMLRTSwitch<Stream<? extends UMLRTNamedElement>>() { + @Override + public Stream<? extends UMLRTNamedElement> caseCapsule(UMLRTCapsule object) { + return Stream.concat(object.getPorts(true).stream(), + Stream.concat(object.getCapsuleParts(true).stream(), + object.getConnectors(true).stream())); + } + + @Override + public Stream<? extends UMLRTNamedElement> caseProtocol(UMLRTProtocol object) { + return object.getMessages(true).stream(); + } + + @Override + public Stream<? extends UMLRTNamedElement> defaultCase(Object object) { + return Stream.empty(); + } + }.doSwitch(classifier); + + } + + protected ICommand getBeforeDestroyDependentsCommand(DestroyDependentsRequest request, UMLRTNamedElement destructee) { + ICommand result; + + Optional<UMLRTClassifier> classifier = Optional.ofNullable(destructee.getRedefinitionContext()) + .filter(UMLRTClassifier.class::isInstance).map(UMLRTClassifier.class::cast); + + // Seek and destroy all redefinitions in the hierarchy. This should be + // more efficient than letting destroy-dependents traverse the redefinition + // hierarchy recursively + Stream<? extends UMLRTClassifier> hierarchy = classifier.map(UMLRTClassifier::getHierarchy).orElseGet(Stream::empty); + Stream<NamedElement> elementsToDestroy = hierarchy.skip(1) // Don't look for redefinitions in the root type + .flatMap(this::inheritableMembers) + .filter(p -> p.redefines(destructee)) + .map(UMLRTNamedElement::toUML); + + result = elementsToDestroy + .map(e -> getDestroyDependentCommand(request, e)) + .reduce(UMLRTCommandUtils::flatCompose) + .orElse(null); + + return result; + } + + protected ICommand getDestroyDependentCommand(DestroyDependentsRequest request, EObject object) { + // Work around a bug in GMF: the dependents request does not propagate its client context + // to the new destroy request that it creates + ICommand result = request.getDestroyDependentCommand(object); + + if (result == null) { + // The dependent is now registered as having been processed, so we can be sure + // that we won't try to destroy it with another (redundant) command. Also, + // we checked before getting here that this object wasn't already bing destroyed. + // So, it is safe to create a new command, here + DestroyElementRequest destroy = new DestroyElementRequest( + request.getEditingDomain(), object, request.isConfirmationRequired()); + destroy.setClientContext(request.getClientContext()); + destroy.addParameters(request.getParameters()); + destroy.setParameter(DESTROY_DEPENDENTS_REQUEST_PARAMETER, request); + + Object eHelperContext = destroy.getEditHelperContext(); + IElementType context = ElementTypeRegistry.getInstance().getElementType(eHelperContext); + + if (context != null) { + result = context.getEditCommand(destroy); + } + } + + return result; + } +} diff --git a/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core/src/org/eclipse/papyrusrt/umlrt/core/types/advice/AbstractPortEditHelperAdvice.java b/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core/src/org/eclipse/papyrusrt/umlrt/core/types/advice/AbstractPortEditHelperAdvice.java new file mode 100644 index 000000000..b47a0a619 --- /dev/null +++ b/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core/src/org/eclipse/papyrusrt/umlrt/core/types/advice/AbstractPortEditHelperAdvice.java @@ -0,0 +1,79 @@ +/***************************************************************************** + * Copyright (c) 2017 Christian W. Damus and others. + * + * 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: + * Christian W. Damus - Initial API and implementation + * + *****************************************************************************/ + +package org.eclipse.papyrusrt.umlrt.core.types.advice; + +import java.util.List; +import java.util.function.Predicate; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +import org.eclipse.gmf.runtime.common.core.command.CompositeCommand; +import org.eclipse.gmf.runtime.common.core.command.ICommand; +import org.eclipse.gmf.runtime.emf.type.core.edithelper.AbstractEditHelperAdvice; +import org.eclipse.gmf.runtime.emf.type.core.requests.IEditCommandRequest; +import org.eclipse.papyrusrt.umlrt.core.commands.ExcludeDependentsRequest; +import org.eclipse.papyrusrt.umlrt.uml.UMLRTConnector; +import org.eclipse.papyrusrt.umlrt.uml.UMLRTNamedElement; +import org.eclipse.papyrusrt.umlrt.uml.UMLRTPort; +import org.eclipse.uml2.uml.Connector; +import org.eclipse.uml2.uml.Port; + +/** + * Common advice for the various UML-RT port types. + */ +public abstract class AbstractPortEditHelperAdvice extends AbstractEditHelperAdvice implements IInheritanceEditHelperAdvice { + + public AbstractPortEditHelperAdvice() { + super(); + } + + @Override + public ICommand getBeforeEditCommand(IEditCommandRequest request) { + ICommand result = getInheritanceEditCommand(request); + + if (result == null) { + result = super.getBeforeEditCommand(request); + } + + return result; + } + + @Override + public ICommand getExcludeDependentsCommand(ExcludeDependentsRequest request) { + ICommand result = IInheritanceEditHelperAdvice.super.getExcludeDependentsCommand(request); + + if (request.isExclude() && (request.getElementToExclude() instanceof Port)) { + // Exclude connectors, also + UMLRTPort port = UMLRTPort.getInstance((Port) request.getElementToExclude()); + if (port != null) { + Predicate<UMLRTNamedElement> alreadyExcluded = UMLRTNamedElement::isExcluded; + List<Connector> connectorsToExclude = Stream.concat( + port.getInsideConnectors().stream(), port.getOutsideConnectors().stream()) + .filter(alreadyExcluded.negate()) + .map(UMLRTConnector::toUML) + .collect(Collectors.toList()); + + if (!connectorsToExclude.isEmpty()) { + ICommand excludeConnectors = request.getExcludeDependentsCommand(connectorsToExclude); + if (excludeConnectors != null) { + result = CompositeCommand.compose(result, excludeConnectors); + } + } + } + } + + return result; + } + +} diff --git a/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core/src/org/eclipse/papyrusrt/umlrt/core/types/advice/CapsuleEditHelperAdvice.java b/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core/src/org/eclipse/papyrusrt/umlrt/core/types/advice/CapsuleEditHelperAdvice.java index 2f3c70d80..a37bfdd98 100644 --- a/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core/src/org/eclipse/papyrusrt/umlrt/core/types/advice/CapsuleEditHelperAdvice.java +++ b/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core/src/org/eclipse/papyrusrt/umlrt/core/types/advice/CapsuleEditHelperAdvice.java @@ -1,5 +1,5 @@ /***************************************************************************** - * Copyright (c) 2015, 2016 CEA LIST, Christian W. Damus, and others. + * Copyright (c) 2015, 2017 CEA LIST, Christian W. Damus, and others. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 @@ -8,7 +8,7 @@ * * Contributors: * Onder Gurcan <onder.gurcan@cea.fr> - Initial API and implementation - * Christian W. Damus - bug 493869 + * Christian W. Damus - bugs 493869, 467545 * *****************************************************************************/ @@ -51,12 +51,12 @@ import org.eclipse.uml2.uml.UMLPackage; /** - * The helperadvice class used for UMLRealTime::Protocol. + * The helperadvice class used for UMLRealTime::Capsule. * * @author Onder Gurcan <onder.gurcan@cea.fr> * */ -public class CapsuleEditHelperAdvice extends AbstractEditHelperAdvice { +public class CapsuleEditHelperAdvice extends AbstractEditHelperAdvice implements IInheritanceEditHelperAdvice { @Override public boolean approveRequest(IEditCommandRequest request) { @@ -147,6 +147,17 @@ public class CapsuleEditHelperAdvice extends AbstractEditHelperAdvice { return true; } + @Override + public ICommand getBeforeEditCommand(IEditCommandRequest request) { + ICommand result = getInheritanceEditCommand(request); + + if (result == null) { + result = super.getBeforeEditCommand(request); + } + + return result; + } + /** * @see org.eclipse.gmf.runtime.emf.type.core.edithelper.AbstractEditHelperAdvice#getBeforeConfigureCommand(org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest) * diff --git a/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core/src/org/eclipse/papyrusrt/umlrt/core/types/advice/CapsulePartEditHelperAdvice.java b/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core/src/org/eclipse/papyrusrt/umlrt/core/types/advice/CapsulePartEditHelperAdvice.java index 4b97e6b71..d0f988729 100644 --- a/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core/src/org/eclipse/papyrusrt/umlrt/core/types/advice/CapsulePartEditHelperAdvice.java +++ b/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core/src/org/eclipse/papyrusrt/umlrt/core/types/advice/CapsulePartEditHelperAdvice.java @@ -1,5 +1,5 @@ /***************************************************************************** - * Copyright (c) 2014, 2016 CEA LIST, Christian W. Damus, and others. + * Copyright (c) 2014, 2017 CEA LIST, Christian W. Damus, and others. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 @@ -8,10 +8,14 @@ * * Contributors: * CEA LIST - Initial API and implementation - * Christian W. Damus - bug 474481 + * Christian W. Damus - bugs 474481, 467545 *****************************************************************************/ package org.eclipse.papyrusrt.umlrt.core.types.advice; +import java.util.List; +import java.util.function.Predicate; +import java.util.stream.Collectors; + import org.eclipse.core.commands.ExecutionException; import org.eclipse.core.runtime.IAdaptable; import org.eclipse.core.runtime.IProgressMonitor; @@ -22,22 +26,65 @@ import org.eclipse.gmf.runtime.emf.type.core.commands.ConfigureElementCommand; import org.eclipse.gmf.runtime.emf.type.core.edithelper.AbstractEditHelperAdvice; import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest; import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest; +import org.eclipse.gmf.runtime.emf.type.core.requests.IEditCommandRequest; import org.eclipse.papyrus.infra.services.edit.utils.RequestParameterConstants; +import org.eclipse.papyrusrt.umlrt.core.commands.ExcludeDependentsRequest; import org.eclipse.papyrusrt.umlrt.core.utils.NewElementUtil; import org.eclipse.papyrusrt.umlrt.profile.UMLRealTime.CapsulePart; +import org.eclipse.papyrusrt.umlrt.uml.UMLRTCapsulePart; +import org.eclipse.papyrusrt.umlrt.uml.UMLRTConnector; +import org.eclipse.papyrusrt.umlrt.uml.UMLRTNamedElement; import org.eclipse.uml2.uml.AggregationKind; +import org.eclipse.uml2.uml.Connector; import org.eclipse.uml2.uml.Property; import org.eclipse.uml2.uml.VisibilityKind; /** * Edit Helper Advice for {@link CapsulePart} */ -public class CapsulePartEditHelperAdvice extends AbstractEditHelperAdvice { +public class CapsulePartEditHelperAdvice extends AbstractEditHelperAdvice implements IInheritanceEditHelperAdvice { public CapsulePartEditHelperAdvice() { super(); } + @Override + public ICommand getBeforeEditCommand(IEditCommandRequest request) { + ICommand result = getInheritanceEditCommand(request); + + if (result == null) { + result = super.getBeforeEditCommand(request); + } + + return result; + } + + @Override + public ICommand getExcludeDependentsCommand(ExcludeDependentsRequest request) { + ICommand result = IInheritanceEditHelperAdvice.super.getExcludeDependentsCommand(request); + + if (request.isExclude() && (request.getElementToExclude() instanceof Property)) { + // Exclude connectors, also + UMLRTCapsulePart part = UMLRTCapsulePart.getInstance((Property) request.getElementToExclude()); + if (part != null) { + Predicate<UMLRTNamedElement> alreadyExcluded = UMLRTNamedElement::isExcluded; + List<Connector> connectorsToExclude = part.getConnectorsOfPorts().stream() + .filter(alreadyExcluded.negate()) + .map(UMLRTConnector::toUML) + .collect(Collectors.toList()); + + if (!connectorsToExclude.isEmpty()) { + ICommand excludeConnectors = request.getExcludeDependentsCommand(connectorsToExclude); + if (excludeConnectors != null) { + result = CompositeCommand.compose(result, excludeConnectors); + } + } + } + } + + return result; + } + /** * {@inheritDoc} * diff --git a/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core/src/org/eclipse/papyrusrt/umlrt/core/types/advice/ClassifierEditHelperAdvice.java b/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core/src/org/eclipse/papyrusrt/umlrt/core/types/advice/ClassifierEditHelperAdvice.java index 535002a40..c4e8d307f 100644 --- a/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core/src/org/eclipse/papyrusrt/umlrt/core/types/advice/ClassifierEditHelperAdvice.java +++ b/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core/src/org/eclipse/papyrusrt/umlrt/core/types/advice/ClassifierEditHelperAdvice.java @@ -20,10 +20,16 @@ import java.util.Set; import org.eclipse.emf.ecore.EObject; import org.eclipse.emf.ecore.EReference; import org.eclipse.gmf.runtime.emf.type.core.edithelper.AbstractEditHelperAdvice; +import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest; import org.eclipse.gmf.runtime.emf.type.core.requests.IEditCommandRequest; import org.eclipse.gmf.runtime.emf.type.core.requests.SetRequest; +import org.eclipse.papyrus.uml.service.types.element.UMLElementTypes; +import org.eclipse.papyrusrt.umlrt.core.types.ElementTypeUtils; import org.eclipse.papyrusrt.umlrt.core.utils.ProtocolUtils; import org.eclipse.papyrusrt.umlrt.core.utils.UMLRTProfileUtils; +import org.eclipse.papyrusrt.umlrt.uml.UMLRTClassifier; +import org.eclipse.papyrusrt.umlrt.uml.UMLRTFactory; +import org.eclipse.papyrusrt.umlrt.uml.UMLRTNamedElement; import org.eclipse.uml2.uml.Classifier; import org.eclipse.uml2.uml.UMLPackage; @@ -49,7 +55,9 @@ public class ClassifierEditHelperAdvice extends AbstractEditHelperAdvice { public boolean approveRequest(IEditCommandRequest request) { boolean result; - if (request instanceof SetRequest) { + if (request instanceof CreateElementRequest) { + result = approveCreateRequest((CreateElementRequest) request); + } else if (request instanceof SetRequest) { result = approveSetRequest((SetRequest) request); } else { result = super.approveRequest(request); @@ -80,4 +88,21 @@ public class ClassifierEditHelperAdvice extends AbstractEditHelperAdvice { return result; } + protected boolean approveCreateRequest(CreateElementRequest request) { + boolean result = true; + + if (ElementTypeUtils.isTypeCompatible(request.getElementType(), UMLElementTypes.GENERALIZATION)) { + // Enforce single generalization + if (request.getContainer() instanceof Classifier) { + UMLRTNamedElement element = UMLRTFactory.create((Classifier) request.getContainer()); + if (element instanceof UMLRTClassifier) { + UMLRTClassifier classifier = (UMLRTClassifier) element; + result = classifier.toUML().getGeneralizations().isEmpty(); + } + } + } + + return result; + } + } diff --git a/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core/src/org/eclipse/papyrusrt/umlrt/core/types/advice/ExternalBehaviorPortEditHelperAdvice.java b/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core/src/org/eclipse/papyrusrt/umlrt/core/types/advice/ExternalBehaviorPortEditHelperAdvice.java index 713277a6e..329f934fa 100644 --- a/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core/src/org/eclipse/papyrusrt/umlrt/core/types/advice/ExternalBehaviorPortEditHelperAdvice.java +++ b/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core/src/org/eclipse/papyrusrt/umlrt/core/types/advice/ExternalBehaviorPortEditHelperAdvice.java @@ -1,5 +1,5 @@ /***************************************************************************** - * Copyright (c) 2015 CEA LIST. + * Copyright (c) 2015, 2017 CEA LIST, Christian W. Damus, and others. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 @@ -8,6 +8,7 @@ * * Contributors: * Celine JANSSENS (ALL4TEC) celine.janssens@all4tec.net - Initial API and implementation + * Christian W. Damus - bug 467545 *****************************************************************************/ package org.eclipse.papyrusrt.umlrt.core.types.advice; @@ -17,7 +18,6 @@ import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.gmf.runtime.common.core.command.CommandResult; import org.eclipse.gmf.runtime.common.core.command.ICommand; import org.eclipse.gmf.runtime.emf.type.core.commands.ConfigureElementCommand; -import org.eclipse.gmf.runtime.emf.type.core.edithelper.AbstractEditHelperAdvice; import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest; import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest; import org.eclipse.papyrus.uml.tools.utils.NamedElementUtil; @@ -28,12 +28,12 @@ import org.eclipse.uml2.uml.util.UMLUtil; /** - * The helperadvice class used for UMLRealTime::Protocol. + * Edit-helper advice for external behavior ports. * * @author Onder Gurcan <onder.gurcan@cea.fr> * */ -public class ExternalBehaviorPortEditHelperAdvice extends AbstractEditHelperAdvice { +public class ExternalBehaviorPortEditHelperAdvice extends AbstractPortEditHelperAdvice { @Override protected ICommand getBeforeCreateRelationshipCommand(CreateRelationshipRequest request) { diff --git a/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core/src/org/eclipse/papyrusrt/umlrt/core/types/advice/IInheritanceEditHelperAdvice.java b/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core/src/org/eclipse/papyrusrt/umlrt/core/types/advice/IInheritanceEditHelperAdvice.java new file mode 100644 index 000000000..bc26ee632 --- /dev/null +++ b/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core/src/org/eclipse/papyrusrt/umlrt/core/types/advice/IInheritanceEditHelperAdvice.java @@ -0,0 +1,131 @@ +/***************************************************************************** + * Copyright (c) 2017 Christian W. Damus and others. + * + * 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: + * Christian W. Damus - Initial API and implementation + * + *****************************************************************************/ + +package org.eclipse.papyrusrt.umlrt.core.types.advice; + +import static org.eclipse.papyrusrt.umlrt.core.commands.ExcludeRequest.EXCLUDE_DEPENDENTS_REQUEST_PARAMETER; +import static org.eclipse.papyrusrt.umlrt.core.commands.ExcludeRequest.INITIAL_ELEMENT_TO_EXCLUDE_PARAMETER; + +import org.eclipse.emf.ecore.EObject; +import org.eclipse.gmf.runtime.common.core.command.ICommand; +import org.eclipse.gmf.runtime.emf.type.core.ElementTypeRegistry; +import org.eclipse.gmf.runtime.emf.type.core.IElementType; +import org.eclipse.gmf.runtime.emf.type.core.requests.IEditCommandRequest; +import org.eclipse.papyrusrt.umlrt.core.commands.ExcludeDependentsRequest; +import org.eclipse.papyrusrt.umlrt.core.commands.ExcludeRequest; +import org.eclipse.uml2.uml.Element; + +/** + * A protocol for the edit-helper advice of elements that have UML-RT inheritance semantics, + * which supports edit requests peculiar to them. + */ +public interface IInheritanceEditHelperAdvice { + /** + * Handles requests peculiar to UML-RT inheritable elements. + * + * @param request + * a request that may or may not be inheritance-related + * + * @return the command, or {@code null} if the {@code request} is not inheritance-related + * or there simply is no command required to satisfy it + */ + default ICommand getInheritanceEditCommand(IEditCommandRequest request) { + ICommand result = null; + + if (request instanceof ExcludeRequest) { + result = getExcludeCommand((ExcludeRequest) request); + } else if (request instanceof ExcludeDependentsRequest) { + result = getExcludeDependentsCommand((ExcludeDependentsRequest) request); + } + + return result; + } + + /** + * Obtains a command that excludes the {@code request}ed element and its dependents. + * + * @param request + * an exclude request + * @return the command to exclude the element ad its dependents + */ + default ICommand getExcludeCommand(ExcludeRequest request) { + ICommand result = getBasicExcludeCommand(request); + + EObject initial = (Element) request.getParameter(INITIAL_ELEMENT_TO_EXCLUDE_PARAMETER); + + if (initial == null) { + // Set the parameter to keep track of the initial element to exclude + request.setParameter(INITIAL_ELEMENT_TO_EXCLUDE_PARAMETER, request.getElementToExclude()); + } + + // Get elements dependent on the element we are excluding that + // must also be excluded + ExcludeDependentsRequest dependents = (ExcludeDependentsRequest) request.getParameter(EXCLUDE_DEPENDENTS_REQUEST_PARAMETER); + if (dependents == null) { + // Create the exclude-dependents request that will be propagated to + // exclude requests for all elements excluded in this operation + dependents = new ExcludeDependentsRequest(request); + + // Propagate the parameters, including the initial element to exclude + dependents.addParameters(request.getParameters()); + dependents.setClientContext(request.getClientContext()); + request.setParameter(EXCLUDE_DEPENDENTS_REQUEST_PARAMETER, dependents); + } else { + dependents.setElementToExclude(request.getElementToExclude()); + } + + IElementType typeToEdit = ElementTypeRegistry.getInstance().getElementType( + dependents.getEditHelperContext()); + + if (typeToEdit != null) { + // Get the dependents-exclusion command + ICommand command = typeToEdit.getEditCommand(dependents); + + if (command != null) { + // Exclude dependents before the element they depend on + result = command.compose(result); + } + } + + return result; + } + + /** + * Obtains a command that excludes the {@code request}ed element only, + * not also its dependents. + * + * @param request + * an exclude request + * @return the command to exclude the element only + */ + default ICommand getBasicExcludeCommand(ExcludeRequest request) { + Element toExclude = request.getElementToExclude(); + + if (request.getParameter(INITIAL_ELEMENT_TO_EXCLUDE_PARAMETER) == null) { + request.setParameter(INITIAL_ELEMENT_TO_EXCLUDE_PARAMETER, toExclude); + } + + return request.getDefaultCommand(); + } + + /** + * Obtains a command that excludes the dependents of the {@code request}ed element. + * + * @param request + * an exclude request + * @return the command to exclude the dependents + */ + default ICommand getExcludeDependentsCommand(ExcludeDependentsRequest request) { + return null; + } +} diff --git a/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core/src/org/eclipse/papyrusrt/umlrt/core/types/advice/InternalBehaviorPortEditHelperAdvice.java b/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core/src/org/eclipse/papyrusrt/umlrt/core/types/advice/InternalBehaviorPortEditHelperAdvice.java index 8b1f6f4ed..97778bd05 100644 --- a/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core/src/org/eclipse/papyrusrt/umlrt/core/types/advice/InternalBehaviorPortEditHelperAdvice.java +++ b/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core/src/org/eclipse/papyrusrt/umlrt/core/types/advice/InternalBehaviorPortEditHelperAdvice.java @@ -1,5 +1,5 @@ /***************************************************************************** - * Copyright (c) 2015 CEA LIST. + * Copyright (c) 2015, 2017 CEA LIST, Christian W. Damus, and others. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 @@ -8,6 +8,7 @@ * * Contributors: * CEA LIST- Initial API and implementation + * Christian W. Damus - bug 467545 *****************************************************************************/ package org.eclipse.papyrusrt.umlrt.core.types.advice; @@ -17,7 +18,6 @@ import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.gmf.runtime.common.core.command.CommandResult; import org.eclipse.gmf.runtime.common.core.command.ICommand; import org.eclipse.gmf.runtime.emf.type.core.commands.ConfigureElementCommand; -import org.eclipse.gmf.runtime.emf.type.core.edithelper.AbstractEditHelperAdvice; import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest; import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest; import org.eclipse.papyrusrt.umlrt.profile.UMLRealTime.RTPort; @@ -26,12 +26,12 @@ import org.eclipse.uml2.uml.VisibilityKind; import org.eclipse.uml2.uml.util.UMLUtil; /** - * The helperadvice class used for UMLRealTime::Protocol. + * Edit-helper advice for internal behavior ports. * * @author Onder Gurcan <onder.gurcan@cea.fr> * */ -public class InternalBehaviorPortEditHelperAdvice extends AbstractEditHelperAdvice { +public class InternalBehaviorPortEditHelperAdvice extends AbstractPortEditHelperAdvice { /** * Gets the before create relationship command. diff --git a/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core/src/org/eclipse/papyrusrt/umlrt/core/types/advice/MessageSetEditHelperAdvice.java b/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core/src/org/eclipse/papyrusrt/umlrt/core/types/advice/MessageSetEditHelperAdvice.java index 0cce50ddd..d73462d16 100644 --- a/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core/src/org/eclipse/papyrusrt/umlrt/core/types/advice/MessageSetEditHelperAdvice.java +++ b/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core/src/org/eclipse/papyrusrt/umlrt/core/types/advice/MessageSetEditHelperAdvice.java @@ -1,14 +1,15 @@ /***************************************************************************** - * Copyright (c) 2015 CEA LIST. - * + * Copyright (c) 2015, 2017 CEA LIST, Christian W. Damus, and others. * * 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: Onder Gurcan <onder.gurcan@cea.fr> - * Celine Janssens (ALL4TEC) celine.janssens@all4tec.net - Bug 476126 + * Contributors: + * Onder Gurcan <onder.gurcan@cea.fr> - Initial API and implementation + * Celine Janssens (ALL4TEC) celine.janssens@all4tec.net - Bug 476126 + * Christian W. Damus - bug 467545 * *****************************************************************************/ @@ -56,7 +57,7 @@ import org.eclipse.uml2.uml.UMLPackage; /** * The helper advice class used for UMLRealTime::MessageSets. */ -public class MessageSetEditHelperAdvice extends AbstractEditHelperAdvice { +public class MessageSetEditHelperAdvice extends AbstractEditHelperAdvice implements IInheritanceEditHelperAdvice { /** * Label of the CALL Event creation command @@ -69,6 +70,17 @@ public class MessageSetEditHelperAdvice extends AbstractEditHelperAdvice { private static final String OWNED_OPERATION = IRealTimeConstants.CALL_EVENT_OPERATION_PARAMETER_NAME; @Override + public ICommand getBeforeEditCommand(IEditCommandRequest request) { + ICommand result = getInheritanceEditCommand(request); + + if (result == null) { + result = super.getBeforeEditCommand(request); + } + + return result; + } + + @Override protected ICommand getBeforeDestroyElementCommand(DestroyElementRequest request) { ICommand command = null; if (request.getElementToDestroy() instanceof Operation) { diff --git a/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core/src/org/eclipse/papyrusrt/umlrt/core/types/advice/OperationEditHelperAdvice.java b/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core/src/org/eclipse/papyrusrt/umlrt/core/types/advice/OperationEditHelperAdvice.java index 5c63f6a4c..be777d67f 100644 --- a/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core/src/org/eclipse/papyrusrt/umlrt/core/types/advice/OperationEditHelperAdvice.java +++ b/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core/src/org/eclipse/papyrusrt/umlrt/core/types/advice/OperationEditHelperAdvice.java @@ -1,5 +1,5 @@ /***************************************************************************** - * Copyright (c) 2015 CEA LIST. + * Copyright (c) 2015, 2017 CEA LIST, Christian W. Damus, and others. * * * All rights reserved. This program and the accompanying materials @@ -8,6 +8,7 @@ * http://www.eclipse.org/legal/epl-v10.html * * Contributors: Onder Gurcan <onder.gurcan@cea.fr> + Christian W. Damus - bug 467545 * *****************************************************************************/ @@ -21,6 +22,7 @@ import org.eclipse.gmf.runtime.common.core.command.ICommand; import org.eclipse.gmf.runtime.emf.type.core.commands.ConfigureElementCommand; import org.eclipse.gmf.runtime.emf.type.core.edithelper.AbstractEditHelperAdvice; import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest; +import org.eclipse.gmf.runtime.emf.type.core.requests.IEditCommandRequest; import org.eclipse.papyrusrt.umlrt.core.utils.CapsuleUtils; import org.eclipse.uml2.uml.CallConcurrencyKind; import org.eclipse.uml2.uml.Classifier; @@ -33,7 +35,18 @@ import org.eclipse.uml2.uml.Operation; * @author Onder Gurcan <onder.gurcan@cea.fr> * */ -public class OperationEditHelperAdvice extends AbstractEditHelperAdvice { +public class OperationEditHelperAdvice extends AbstractEditHelperAdvice implements IInheritanceEditHelperAdvice { + + @Override + public ICommand getBeforeEditCommand(IEditCommandRequest request) { + ICommand result = getInheritanceEditCommand(request); + + if (result == null) { + result = super.getBeforeEditCommand(request); + } + + return result; + } /** * @see org.eclipse.gmf.runtime.emf.type.core.edithelper.AbstractEditHelperAdvice#getBeforeConfigureCommand(org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest) @@ -62,6 +75,7 @@ public class OperationEditHelperAdvice extends AbstractEditHelperAdvice { /** * The owner of the operation should be a capsule. + * * @param operation * @return */ diff --git a/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core/src/org/eclipse/papyrusrt/umlrt/core/types/advice/ProtocolEditHelperAdvice.java b/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core/src/org/eclipse/papyrusrt/umlrt/core/types/advice/ProtocolEditHelperAdvice.java index 10dda5aff..97a29a250 100644 --- a/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core/src/org/eclipse/papyrusrt/umlrt/core/types/advice/ProtocolEditHelperAdvice.java +++ b/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core/src/org/eclipse/papyrusrt/umlrt/core/types/advice/ProtocolEditHelperAdvice.java @@ -1,5 +1,5 @@ /***************************************************************************** - * Copyright (c) 2015 CEA LIST. + * Copyright (c) 2015, 2017 CEA LIST, Christian W. Damus, and others. * * * All rights reserved. This program and the accompanying materials @@ -9,6 +9,7 @@ * * Contributors: Onder Gurcan <onder.gurcan@cea.fr> * Celine Janssens (ALL4TEC) celine.janssens@all4tec.net - Extract the ConfigureElementCommand Class + Christian W. Damus - bug 467545 * *****************************************************************************/ @@ -55,7 +56,7 @@ import org.eclipse.uml2.uml.UMLPackage; * @author Onder Gurcan <onder.gurcan@cea.fr> * */ -public class ProtocolEditHelperAdvice extends AbstractEditHelperAdvice { +public class ProtocolEditHelperAdvice extends AbstractEditHelperAdvice implements IInheritanceEditHelperAdvice { /** @@ -77,7 +78,7 @@ public class ProtocolEditHelperAdvice extends AbstractEditHelperAdvice { } // check type is compatible with UMLRT::OperationAsMessages. If yes, allow creation - List<IElementType> types = new ArrayList<IElementType>(Arrays.asList(type.getAllSuperTypes())); + List<IElementType> types = new ArrayList<>(Arrays.asList(type.getAllSuperTypes())); types.add(type); if (types.contains(umlRTMessageType)) { return true; @@ -94,6 +95,17 @@ public class ProtocolEditHelperAdvice extends AbstractEditHelperAdvice { return super.approveRequest(request); } + @Override + public ICommand getBeforeEditCommand(IEditCommandRequest request) { + ICommand result = getInheritanceEditCommand(request); + + if (result == null) { + result = super.getBeforeEditCommand(request); + } + + return result; + } + /** * {@inheritDoc} */ @@ -115,7 +127,7 @@ public class ProtocolEditHelperAdvice extends AbstractEditHelperAdvice { } // check type is compatible with UMLRT::OperationAsMessages. If yes, allow creation - List<IElementType> types = new ArrayList<IElementType>(Arrays.asList(type.getAllSuperTypes())); + List<IElementType> types = new ArrayList<>(Arrays.asList(type.getAllSuperTypes())); types.add(type); if (types.contains(umlRTMessageType)) { // return the right message set here rather than the protocol container diff --git a/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core/src/org/eclipse/papyrusrt/umlrt/core/types/advice/RTConnectorEditHelperAdvice.java b/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core/src/org/eclipse/papyrusrt/umlrt/core/types/advice/RTConnectorEditHelperAdvice.java index ac2d8b6b6..ec0d5e7de 100644 --- a/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core/src/org/eclipse/papyrusrt/umlrt/core/types/advice/RTConnectorEditHelperAdvice.java +++ b/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core/src/org/eclipse/papyrusrt/umlrt/core/types/advice/RTConnectorEditHelperAdvice.java @@ -1,5 +1,5 @@ /***************************************************************************** - * Copyright (c) 2014 CEA LIST. + * Copyright (c) 2014, 2017 CEA LIST, Christian W. Damus, and others. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 @@ -8,10 +8,17 @@ * * Contributors: * CEA LIST - Initial API and implementation + * Christian W. Damus - bug 467545 *****************************************************************************/ package org.eclipse.papyrusrt.umlrt.core.types.advice; +import java.util.List; +import java.util.Objects; +import java.util.stream.Collectors; +import java.util.stream.Stream; + import org.eclipse.emf.ecore.EObject; +import org.eclipse.gmf.runtime.common.core.command.CompositeCommand; import org.eclipse.gmf.runtime.common.core.command.ICommand; import org.eclipse.gmf.runtime.emf.type.core.edithelper.AbstractEditHelperAdvice; import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest; @@ -21,8 +28,13 @@ import org.eclipse.gmf.runtime.emf.type.core.requests.IEditCommandRequest; import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest; import org.eclipse.gmf.runtime.notation.View; import org.eclipse.papyrus.uml.service.types.utils.RequestParameterConstants; +import org.eclipse.papyrusrt.umlrt.core.commands.ExcludeDependentsRequest; import org.eclipse.papyrusrt.umlrt.core.types.ElementTypeUtils; import org.eclipse.papyrusrt.umlrt.core.types.IUMLRTElementTypes; +import org.eclipse.papyrusrt.umlrt.uml.UMLRTConnector; +import org.eclipse.papyrusrt.umlrt.uml.UMLRTNamedElement; +import org.eclipse.papyrusrt.umlrt.uml.UMLRTReplicatedElement; +import org.eclipse.uml2.uml.ConnectableElement; import org.eclipse.uml2.uml.Connector; /** @@ -30,7 +42,7 @@ import org.eclipse.uml2.uml.Connector; * * @author ysroh bug#474244 */ -public class RTConnectorEditHelperAdvice extends AbstractEditHelperAdvice { +public class RTConnectorEditHelperAdvice extends AbstractEditHelperAdvice implements IInheritanceEditHelperAdvice { @Override protected ICommand getBeforeCreateRelationshipCommand(CreateRelationshipRequest request) { @@ -137,4 +149,42 @@ public class RTConnectorEditHelperAdvice extends AbstractEditHelperAdvice { protected ICommand getBeforeReorientRelationshipCommand(ReorientRelationshipRequest request) { return super.getBeforeReorientRelationshipCommand(request); } + + @Override + public ICommand getBeforeEditCommand(IEditCommandRequest request) { + ICommand result = getInheritanceEditCommand(request); + + if (result == null) { + result = super.getBeforeEditCommand(request); + } + + return result; + } + + @Override + public ICommand getExcludeDependentsCommand(ExcludeDependentsRequest request) { + ICommand result = IInheritanceEditHelperAdvice.super.getExcludeDependentsCommand(request); + + if (!request.isExclude() && (request.getElementToExclude() instanceof Connector)) { + // Re-inherit connected elements, also + UMLRTConnector connector = UMLRTConnector.getInstance((Connector) request.getElementToExclude()); + if (connector != null) { + List<? extends ConnectableElement> connectablesToReinherit = Stream.of(connector.getSource(), connector.getSourcePartWithPort(), + connector.getTarget(), connector.getTargetPartWithPort()) + .filter(Objects::nonNull) + .filter(UMLRTNamedElement::isExcluded) + .map(UMLRTReplicatedElement::toUML) + .collect(Collectors.toList()); + + if (!connectablesToReinherit.isEmpty()) { + ICommand excludeConnectors = request.getExcludeDependentsCommand(connectablesToReinherit); + if (excludeConnectors != null) { + result = CompositeCommand.compose(result, excludeConnectors); + } + } + } + } + + return result; + } } diff --git a/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core/src/org/eclipse/papyrusrt/umlrt/core/types/advice/RelayPortEditHelperAdvice.java b/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core/src/org/eclipse/papyrusrt/umlrt/core/types/advice/RelayPortEditHelperAdvice.java index 3c8036384..61ddc71fd 100644 --- a/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core/src/org/eclipse/papyrusrt/umlrt/core/types/advice/RelayPortEditHelperAdvice.java +++ b/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core/src/org/eclipse/papyrusrt/umlrt/core/types/advice/RelayPortEditHelperAdvice.java @@ -1,5 +1,5 @@ /***************************************************************************** - * Copyright (c) 2015 CEA LIST. + * Copyright (c) 2015, 2017 CEA LIST, Christian W. Damus, and others. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 @@ -8,6 +8,7 @@ * * Contributors: * Celine JANSSENS (ALL4TEC) celine.janssens@all4tec.net - Initial API and implementation + * Christian W. Damus - bug 467545 *****************************************************************************/ package org.eclipse.papyrusrt.umlrt.core.types.advice; @@ -17,7 +18,6 @@ import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.gmf.runtime.common.core.command.CommandResult; import org.eclipse.gmf.runtime.common.core.command.ICommand; import org.eclipse.gmf.runtime.emf.type.core.commands.ConfigureElementCommand; -import org.eclipse.gmf.runtime.emf.type.core.edithelper.AbstractEditHelperAdvice; import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest; import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest; import org.eclipse.papyrusrt.umlrt.profile.UMLRealTime.RTPort; @@ -27,12 +27,12 @@ import org.eclipse.uml2.uml.util.UMLUtil; /** - * The helperadvice class used for UMLRealTime::Protocol. + * Edit-helper advice for relay ports. * * @author Onder Gurcan <onder.gurcan@cea.fr> * */ -public class RelayPortEditHelperAdvice extends AbstractEditHelperAdvice { +public class RelayPortEditHelperAdvice extends AbstractPortEditHelperAdvice { @Override protected ICommand getBeforeCreateRelationshipCommand(CreateRelationshipRequest request) { diff --git a/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core/src/org/eclipse/papyrusrt/umlrt/core/types/advice/ServiceAccessPointEditHelperAdvice.java b/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core/src/org/eclipse/papyrusrt/umlrt/core/types/advice/ServiceAccessPointEditHelperAdvice.java index 4526860e8..776be2b9a 100644 --- a/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core/src/org/eclipse/papyrusrt/umlrt/core/types/advice/ServiceAccessPointEditHelperAdvice.java +++ b/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core/src/org/eclipse/papyrusrt/umlrt/core/types/advice/ServiceAccessPointEditHelperAdvice.java @@ -1,5 +1,5 @@ /***************************************************************************** - * Copyright (c) 2015 CEA LIST. + * Copyright (c) 2015, 2017 CEA LIST, Christian W. Damus, and others. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 @@ -8,6 +8,7 @@ * * Contributors: * Celine JANSSENS (ALL4TEC) celine.janssens@all4tec.net - Initial API and implementation + * Christian W. Damus - bug 467545 *****************************************************************************/ package org.eclipse.papyrusrt.umlrt.core.types.advice; @@ -20,7 +21,6 @@ import org.eclipse.gmf.runtime.common.core.command.ICommand; import org.eclipse.gmf.runtime.emf.type.core.ElementTypeRegistry; import org.eclipse.gmf.runtime.emf.type.core.IElementType; import org.eclipse.gmf.runtime.emf.type.core.commands.ConfigureElementCommand; -import org.eclipse.gmf.runtime.emf.type.core.edithelper.AbstractEditHelperAdvice; import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest; import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest; import org.eclipse.gmf.runtime.emf.type.core.requests.IEditCommandRequest; @@ -33,12 +33,12 @@ import org.eclipse.uml2.uml.util.UMLUtil; /** - * The helperadvice class used for UMLRealTime::Protocol. + * Edit-helper advice for SAPs. * * @author Onder Gurcan <onder.gurcan@cea.fr> * */ -public class ServiceAccessPointEditHelperAdvice extends AbstractEditHelperAdvice { +public class ServiceAccessPointEditHelperAdvice extends AbstractPortEditHelperAdvice { diff --git a/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core/src/org/eclipse/papyrusrt/umlrt/core/types/advice/ServiceProvisionPointEditHelperAdvice.java b/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core/src/org/eclipse/papyrusrt/umlrt/core/types/advice/ServiceProvisionPointEditHelperAdvice.java index 461e25ff1..bdf6a55b2 100644 --- a/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core/src/org/eclipse/papyrusrt/umlrt/core/types/advice/ServiceProvisionPointEditHelperAdvice.java +++ b/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core/src/org/eclipse/papyrusrt/umlrt/core/types/advice/ServiceProvisionPointEditHelperAdvice.java @@ -1,5 +1,5 @@ /***************************************************************************** - * Copyright (c) 2015 CEA LIST. + * Copyright (c) 2015, 2017 CEA LIST, Christian W. Damus, and others. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 @@ -8,6 +8,7 @@ * * Contributors: * Celine JANSSENS (ALL4TEC) celine.janssens@all4tec.net - Initial API and implementation + * Christian W. Damus - bug 467545 *****************************************************************************/ package org.eclipse.papyrusrt.umlrt.core.types.advice; @@ -20,7 +21,6 @@ import org.eclipse.gmf.runtime.common.core.command.ICommand; import org.eclipse.gmf.runtime.emf.type.core.ElementTypeRegistry; import org.eclipse.gmf.runtime.emf.type.core.IElementType; import org.eclipse.gmf.runtime.emf.type.core.commands.ConfigureElementCommand; -import org.eclipse.gmf.runtime.emf.type.core.edithelper.AbstractEditHelperAdvice; import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest; import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest; import org.eclipse.gmf.runtime.emf.type.core.requests.IEditCommandRequest; @@ -32,12 +32,12 @@ import org.eclipse.uml2.uml.VisibilityKind; import org.eclipse.uml2.uml.util.UMLUtil; /** - * The helperadvice class used for UMLRealTime::Protocol. + * Edit-helper advice for SPPs. * * @author Onder Gurcan <onder.gurcan@cea.fr> * */ -public class ServiceProvisionPointEditHelperAdvice extends AbstractEditHelperAdvice { +public class ServiceProvisionPointEditHelperAdvice extends AbstractPortEditHelperAdvice { /** * @see org.eclipse.gmf.runtime.emf.type.core.edithelper.AbstractEditHelperAdvice#approveRequest(org.eclipse.gmf.runtime.emf.type.core.requests.IEditCommandRequest) diff --git a/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core/src/org/eclipse/papyrusrt/umlrt/core/utils/CapsulePartKindEnum.java b/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core/src/org/eclipse/papyrusrt/umlrt/core/utils/CapsulePartKindEnum.java index 810205995..9b37a767c 100644 --- a/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core/src/org/eclipse/papyrusrt/umlrt/core/utils/CapsulePartKindEnum.java +++ b/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core/src/org/eclipse/papyrusrt/umlrt/core/utils/CapsulePartKindEnum.java @@ -1,27 +1,40 @@ package org.eclipse.papyrusrt.umlrt.core.utils; +import java.util.Arrays; +import java.util.EnumMap; +import java.util.Map; + +import org.eclipse.papyrusrt.umlrt.uml.UMLRTCapsulePartKind; + public enum CapsulePartKindEnum { /** * Fixed kind of capsule Part */ - FIXED(0, "Fixed"), + FIXED(0, "Fixed", UMLRTCapsulePartKind.FIXED), /** * Optional kind of capsule Part */ - OPTIONAL(1, "Optional"), + OPTIONAL(1, "Optional", UMLRTCapsulePartKind.OPTIONAL), /** * Plugin kind of capsule Part */ - PLUGIN(2, "Plugin"); + PLUGIN(2, "Plugin", UMLRTCapsulePartKind.PLUG_IN); + private static final Map<UMLRTCapsulePartKind, CapsulePartKindEnum> FACADE_MAP = new EnumMap<>(UMLRTCapsulePartKind.class); private final String label; private final int index; + private final UMLRTCapsulePartKind facadeKind; + + static { + FACADE_MAP.put(UMLRTCapsulePartKind.NULL, null); + Arrays.asList(values()).forEach(k -> FACADE_MAP.put(k.toFacade(), k)); + } public String getLabel() { @@ -33,10 +46,22 @@ public enum CapsulePartKindEnum { return index; } - private CapsulePartKindEnum(int index, String label) { + private CapsulePartKindEnum(int index, String label, UMLRTCapsulePartKind facadeKind) { this.label = label; this.index = index; + this.facadeKind = facadeKind; + } + + public static CapsulePartKindEnum fromFacade(UMLRTCapsulePartKind facadeKind) { + return FACADE_MAP.get(facadeKind); + } + + public UMLRTCapsulePartKind toFacade() { + return facadeKind; + } + public static UMLRTCapsulePartKind toFacade(CapsulePartKindEnum kind) { + return (kind == null) ? UMLRTCapsulePartKind.NULL : kind.toFacade(); } @Override diff --git a/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core/src/org/eclipse/papyrusrt/umlrt/core/utils/CapsulePartUtils.java b/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core/src/org/eclipse/papyrusrt/umlrt/core/utils/CapsulePartUtils.java index c8a1355d6..329891ca3 100644 --- a/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core/src/org/eclipse/papyrusrt/umlrt/core/utils/CapsulePartUtils.java +++ b/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core/src/org/eclipse/papyrusrt/umlrt/core/utils/CapsulePartUtils.java @@ -1,5 +1,5 @@ /***************************************************************************** - * Copyright (c) 2014 CEA LIST. + * Copyright (c) 2014, 2017 CEA LIST, Christian W. Damus, and others. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 @@ -9,12 +9,15 @@ * Contributors: * CEA LIST - Initial API and implementation * Celine JANSSENS (ALL4TEC) celine.janssens@all4tec.net - Add #getStereotypeApplication() + * Christian W. Damus - bug 467545 *****************************************************************************/ package org.eclipse.papyrusrt.umlrt.core.utils; import org.eclipse.papyrusrt.umlrt.core.types.ElementTypeUtils; import org.eclipse.papyrusrt.umlrt.core.types.IUMLRTElementTypes; import org.eclipse.papyrusrt.umlrt.profile.UMLRealTime.CapsulePart; +import org.eclipse.papyrusrt.umlrt.uml.UMLRTCapsulePart; +import org.eclipse.papyrusrt.umlrt.uml.UMLRTCapsulePartKind; import org.eclipse.uml2.uml.Property; import org.eclipse.uml2.uml.util.UMLUtil; @@ -46,4 +49,38 @@ public class CapsulePartUtils { } + /** + * Query if capsule-part kind is editable. + * + * @param capsulePart + * a capsule part + * @param newKind + * kind a kind to which to change the {@code capsulePart} + * @return whether it is valid to change the {@code capsulePart} to be the new kind + */ + public static boolean isKindEditable(Property capsulePart, CapsulePartKindEnum newKind) { + boolean result = true; + + UMLRTCapsulePart partFacade = (capsulePart == null) ? null : UMLRTCapsulePart.getInstance(capsulePart); + if (partFacade != null) { + UMLRTCapsulePartKind currentKind = partFacade.getKind(); + UMLRTCapsulePartKind targetKind = CapsulePartKindEnum.toFacade(newKind); + + if (targetKind == UMLRTCapsulePartKind.NULL) { + result = false; + } + // Can always transition to the current kind + else if (targetKind != currentKind) { + // A redefinition cannot change plug-in-ness + if (partFacade.isInherited()) { + // isNotification is irrelevant to the port kind + result = (currentKind != UMLRTCapsulePartKind.PLUG_IN) + && (targetKind != UMLRTCapsulePartKind.PLUG_IN); + } + } + } + + return result; + } + } diff --git a/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core/src/org/eclipse/papyrusrt/umlrt/core/utils/ProtocolContainerUtils.java b/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core/src/org/eclipse/papyrusrt/umlrt/core/utils/ProtocolContainerUtils.java index 228ba1b1f..09be26a8c 100644 --- a/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core/src/org/eclipse/papyrusrt/umlrt/core/utils/ProtocolContainerUtils.java +++ b/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core/src/org/eclipse/papyrusrt/umlrt/core/utils/ProtocolContainerUtils.java @@ -1,5 +1,5 @@ /***************************************************************************** - * Copyright (c) 2015, 2016 CEA LIST, Christian W. Damus, and others. + * Copyright (c) 2015, 2017 CEA LIST, Christian W. Damus, and others. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 @@ -8,7 +8,7 @@ * * Contributors: * CEA LIST - Initial API and implementation - * Christian W. Damus - bug 494367 + * Christian W. Damus - bugs 494367, 467545 * *****************************************************************************/ @@ -32,6 +32,7 @@ import org.eclipse.papyrus.infra.services.edit.service.IElementEditService; import org.eclipse.papyrusrt.umlrt.core.types.IUMLRTElementTypes; import org.eclipse.papyrusrt.umlrt.profile.UMLRealTime.RTMessageKind; import org.eclipse.papyrusrt.umlrt.profile.UMLRealTime.RTMessageSet; +import org.eclipse.papyrusrt.umlrt.uml.UMLRTProtocol; import org.eclipse.uml2.uml.Collaboration; import org.eclipse.uml2.uml.Dependency; import org.eclipse.uml2.uml.Element; @@ -52,7 +53,11 @@ public class ProtocolContainerUtils { * @param direction * @param showInherited * @return + * + * @deprecated Use the {@link UMLRTProtocol} façade API, instead, to get not just inherited protocol messages + * but distinct "shadows" of inherited messages in the context of the inheriting protocol */ + @Deprecated public static List<Operation> getRTMessages(Package protocolContainer, RTMessageKind direction, boolean showInherited) { Interface messageSet = getMessageSet(protocolContainer, direction); if (messageSet != null) { @@ -69,7 +74,11 @@ public class ProtocolContainerUtils { * @param protocolContainer * @param direction * @return + * + * @deprecated Use the {@link UMLRTProtocol} façade API, instead, to get not just inherited protocol messages + * but distinct "shadows" of inherited messages in the context of the inheriting protocol */ + @Deprecated public static List<Operation> getAllRTMessages(Package protocolContainer, RTMessageKind direction) { return getRTMessages(protocolContainer, direction, true); } @@ -78,7 +87,11 @@ public class ProtocolContainerUtils { * Returns all the In Operations attached to the protocol in this protocol container * * @return all the In Operations attached to the protocol in this protocol container or an empty list if there was no protocol/interfacein. + * + * @deprecated Use the {@link UMLRTProtocol} façade API, instead, to get not just inherited protocol messages + * but distinct "shadows" of inherited messages in the context of the inheriting protocol */ + @Deprecated public static List<Operation> getAllInRTMessages(Package protocolContainer) { return getAllRTMessages(protocolContainer, RTMessageKind.IN); } @@ -87,7 +100,11 @@ public class ProtocolContainerUtils { * Returns all the Out Operations attached to the protocol in this protocol container * * @return all the Out Operations attached to the protocol in this protocol container or <code>null</code> if there was no protocol/interfacein. + * + * @deprecated Use the {@link UMLRTProtocol} façade API, instead, to get not just inherited protocol messages + * but distinct "shadows" of inherited messages in the context of the inheriting protocol */ + @Deprecated public static Collection<Operation> getAllOutRTMessages(Package protocolContainer) { return getAllRTMessages(protocolContainer, RTMessageKind.OUT); } @@ -96,19 +113,25 @@ public class ProtocolContainerUtils { * Returns all the InOut Operations attached to the protocol in this protocol container * * @return all the InOut Operations attached to the protocol in this protocol container or <code>null</code> if there was no protocol/interfacein. + * + * @deprecated Use the {@link UMLRTProtocol} façade API, instead, to get not just inherited protocol messages + * but distinct "shadows" of inherited messages in the context of the inheriting protocol */ + @Deprecated public static Collection<Operation> getAllInOutRTMessages(Package protocolContainer) { return getAllRTMessages(protocolContainer, RTMessageKind.IN_OUT); } - - /** * @param protocolContainer * @param direction * @param showInherited * @return + * + * @deprecated Use the {@link UMLRTProtocol} façade API, instead, to get not just inherited protocol messages + * but distinct "shadows" of inherited messages in the context of the inheriting protocol */ + @Deprecated public static List<Operation> getRTMessages(Package protocolContainer, RTMessageKind direction) { return getRTMessages(protocolContainer, direction, false); } @@ -117,7 +140,11 @@ public class ProtocolContainerUtils { * Returns all the In Operations attached to the protocol in this protocol container * * @return all the In Operations attached to the protocol in this protocol container or an empty list if there was no protocol/interfacein. + * + * @deprecated Use the {@link UMLRTProtocol} façade API, instead, to get not just inherited protocol messages + * but distinct "shadows" of inherited messages in the context of the inheriting protocol */ + @Deprecated public static List<Operation> getInRTMessages(Package protocolContainer) { return getRTMessages(protocolContainer, RTMessageKind.IN); } @@ -126,7 +153,11 @@ public class ProtocolContainerUtils { * Returns all the Out Operations attached to the protocol in this protocol container * * @return all the Out Operations attached to the protocol in this protocol container or <code>null</code> if there was no protocol/interfacein. + * + * @deprecated Use the {@link UMLRTProtocol} façade API, instead, to get not just inherited protocol messages + * but distinct "shadows" of inherited messages in the context of the inheriting protocol */ + @Deprecated public static Collection<Operation> geOutRTMessages(Package protocolContainer) { return getRTMessages(protocolContainer, RTMessageKind.OUT); } @@ -135,7 +166,11 @@ public class ProtocolContainerUtils { * Returns all the InOut Operations attached to the protocol in this protocol container * * @return all the InOut Operations attached to the protocol in this protocol container or <code>null</code> if there was no protocol/interfacein. + * + * @deprecated Use the {@link UMLRTProtocol} façade API, instead, to get not just inherited protocol messages + * but distinct "shadows" of inherited messages in the context of the inheriting protocol */ + @Deprecated public static Collection<Operation> getInOutRTMessages(Package protocolContainer) { return getRTMessages(protocolContainer, RTMessageKind.IN_OUT); } diff --git a/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core/src/org/eclipse/papyrusrt/umlrt/core/utils/ProtocolUtils.java b/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core/src/org/eclipse/papyrusrt/umlrt/core/utils/ProtocolUtils.java index fda2f9977..c8bc61593 100644 --- a/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core/src/org/eclipse/papyrusrt/umlrt/core/utils/ProtocolUtils.java +++ b/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core/src/org/eclipse/papyrusrt/umlrt/core/utils/ProtocolUtils.java @@ -1,5 +1,5 @@ /***************************************************************************** - * Copyright (c) 2015 CEA LIST and others. + * Copyright (c) 2015, 2016 CEA LIST, Christian W. Damus, and others. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 @@ -8,6 +8,7 @@ * * Contributors: * CEA LIST - Initial API and implementation + * Christian W. Damus - bug 467545 * *****************************************************************************/ @@ -15,6 +16,8 @@ package org.eclipse.papyrusrt.umlrt.core.utils; import java.util.Collections; import java.util.List; +import java.util.stream.Collectors; +import java.util.stream.Stream; import org.eclipse.emf.common.util.BasicEList; import org.eclipse.emf.common.util.EList; @@ -29,6 +32,8 @@ import org.eclipse.papyrusrt.umlrt.core.defaultlanguage.IDefaultLanguageService; import org.eclipse.papyrusrt.umlrt.core.types.ElementTypeUtils; import org.eclipse.papyrusrt.umlrt.core.types.IUMLRTElementTypes; import org.eclipse.papyrusrt.umlrt.profile.UMLRealTime.RTMessageKind; +import org.eclipse.papyrusrt.umlrt.uml.UMLRTProtocol; +import org.eclipse.papyrusrt.umlrt.uml.UMLRTProtocolMessage; import org.eclipse.uml2.uml.Collaboration; import org.eclipse.uml2.uml.Element; import org.eclipse.uml2.uml.Interface; @@ -77,13 +82,20 @@ public class ProtocolUtils { * @return */ public static List<Operation> getRTMessages(Collaboration protocol, RTMessageKind direction, boolean showInherited) { - Package protocolContainer = getProtocolContainer(protocol); - if (protocolContainer == null) { - Activator.log.error("Impossible to get the root protocol container", null); - return Collections.emptyList(); + List<Operation> result; + + UMLRTProtocol facade = UMLRTProtocol.getInstance(protocol); + if (facade == null) { + result = Collections.emptyList(); + } else { + Stream<UMLRTProtocolMessage> messages = facade.getMessages(direction, true).stream(); + if (!showInherited) { + messages = messages.filter(m -> !m.isVirtualRedefinition()); + } + result = messages.map(UMLRTProtocolMessage::toUML).collect(Collectors.toList()); } - return ProtocolContainerUtils.getRTMessages(protocolContainer, direction, showInherited); + return result; } /** diff --git a/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core/src/org/eclipse/papyrusrt/umlrt/core/utils/RTPortKindEnum.java b/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core/src/org/eclipse/papyrusrt/umlrt/core/utils/RTPortKindEnum.java index 5ef707527..e7577b688 100644 --- a/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core/src/org/eclipse/papyrusrt/umlrt/core/utils/RTPortKindEnum.java +++ b/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core/src/org/eclipse/papyrusrt/umlrt/core/utils/RTPortKindEnum.java @@ -8,7 +8,7 @@ * * Contributors: * CEA LIST - Initial API and implementation - * Christian W. Damus - bugs 490859, 492368, 496649 + * Christian W. Damus - bugs 490859, 492368, 496649, 467545 * *****************************************************************************/ package org.eclipse.papyrusrt.umlrt.core.utils; @@ -19,43 +19,54 @@ import static org.eclipse.papyrusrt.umlrt.core.types.IUMLRTElementTypes.RELAY_PO import static org.eclipse.papyrusrt.umlrt.core.types.IUMLRTElementTypes.SERVICE_ACCESS_POINT_ID; import static org.eclipse.papyrusrt.umlrt.core.types.IUMLRTElementTypes.SERVICE_PROVISION_POINT_ID; +import java.util.Arrays; +import java.util.EnumMap; +import java.util.Map; + import org.eclipse.gmf.runtime.emf.type.core.ElementTypeRegistry; import org.eclipse.gmf.runtime.emf.type.core.IElementType; import org.eclipse.gmf.runtime.emf.type.core.IHintedType; import org.eclipse.papyrusrt.umlrt.core.types.ElementTypeUtils; import org.eclipse.papyrusrt.umlrt.core.types.IUMLRTElementTypes; import org.eclipse.papyrusrt.umlrt.core.types.UMLRTElementTypesEnumerator; +import org.eclipse.papyrusrt.umlrt.uml.UMLRTPortKind; public enum RTPortKindEnum implements Comparable<RTPortKindEnum> { - /** * */ - EXTERNAL(0, "External Behavior"), + EXTERNAL(0, "External Behavior", UMLRTPortKind.EXTERNAL_BEHAVIOR), /** * */ - INTERNAL(1, "Internal Behavior"), + INTERNAL(1, "Internal Behavior", UMLRTPortKind.INTERNAL_BEHAVIOR), /** * */ - RELAY(2, "Relay"), + RELAY(2, "Relay", UMLRTPortKind.RELAY), /** * */ - SAP(3, "SAP"), + SAP(3, "SAP", UMLRTPortKind.SAP), /** * */ - SPP(4, "SPP"); + SPP(4, "SPP", UMLRTPortKind.SPP); + private static final Map<UMLRTPortKind, RTPortKindEnum> FACADE_MAP = new EnumMap<>(UMLRTPortKind.class); private final String label; private final int index; + private final UMLRTPortKind facadeKind; + + static { + FACADE_MAP.put(UMLRTPortKind.NULL, null); + Arrays.asList(values()).forEach(k -> FACADE_MAP.put(k.toFacade(), k)); + } public String getLabel() { @@ -69,10 +80,10 @@ public enum RTPortKindEnum implements Comparable<RTPortKindEnum> { - private RTPortKindEnum(int index, String label) { + private RTPortKindEnum(int index, String label, UMLRTPortKind facadeKind) { this.label = label; this.index = index; - + this.facadeKind = facadeKind; } @Override @@ -110,6 +121,18 @@ public enum RTPortKindEnum implements Comparable<RTPortKindEnum> { return result; } + public static RTPortKindEnum fromFacade(UMLRTPortKind facadeKind) { + return FACADE_MAP.get(facadeKind); + } + + public UMLRTPortKind toFacade() { + return facadeKind; + } + + public static UMLRTPortKind toFacade(RTPortKindEnum kind) { + return (kind == null) ? UMLRTPortKind.NULL : kind.toFacade(); + } + /** * Converts me to my corresponding {@linkplain IElementType element-type}. * diff --git a/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core/src/org/eclipse/papyrusrt/umlrt/core/utils/RTPortUtils.java b/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core/src/org/eclipse/papyrusrt/umlrt/core/utils/RTPortUtils.java index d66780e3e..ecaf511da 100644 --- a/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core/src/org/eclipse/papyrusrt/umlrt/core/utils/RTPortUtils.java +++ b/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core/src/org/eclipse/papyrusrt/umlrt/core/utils/RTPortUtils.java @@ -1,5 +1,5 @@ /***************************************************************************** - * Copyright (c) 2015 CEA LIST. + * Copyright (c) 2015, 2017 CEA LIST, Christian W. Damus, and others. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 @@ -10,6 +10,7 @@ * Mickael ADAM (ALL4TEC) mickael.adam@all4tec.net - add RTPORT_KIND_REQUEST_PARAMETER * Celine Janssens (ALL4TEC) celine.janssens@all4tec.net - Bug 472884 * Young-Soo Roh ysroh@zeligsoft.com - Bug 502199 + * Christian W. Damus - bug 467545 * *****************************************************************************/ package org.eclipse.papyrusrt.umlrt.core.utils; @@ -27,9 +28,8 @@ import org.eclipse.papyrus.infra.emf.gmf.command.GMFtoEMFCommandWrapper; import org.eclipse.papyrusrt.umlrt.profile.UMLRealTime.PortRegistrationType; import org.eclipse.papyrusrt.umlrt.profile.UMLRealTime.RTPort; import org.eclipse.papyrusrt.umlrt.profile.UMLRealTime.UMLRealTimePackage; -import org.eclipse.uml2.uml.Connector; -import org.eclipse.uml2.uml.ConnectorEnd; -import org.eclipse.uml2.uml.Element; +import org.eclipse.papyrusrt.umlrt.uml.UMLRTPort; +import org.eclipse.papyrusrt.umlrt.uml.UMLRTPortKind; import org.eclipse.uml2.uml.Operation; import org.eclipse.uml2.uml.Port; import org.eclipse.uml2.uml.UMLPackage; @@ -78,7 +78,7 @@ public final class RTPortUtils { * @return <code>true</code> if a connector is connected to the specified Port */ public static boolean isConnected(Port port) { - return port != null && !port.getEnds().isEmpty(); + return isConnectedInside(port) || isConnectedOutside(port); } /** @@ -89,23 +89,9 @@ public final class RTPortUtils { * @return true if connected inside */ public static boolean isConnectedInside(Port port) { - // it should be at least connected - if (!isConnected(port)) { - return false; - } + UMLRTPort rt = UMLRTPort.getInstance(port); - // check the connected elements - for (ConnectorEnd connectorEnd : port.getEnds()) { - // should be a connector - Element connectorEndContainer = connectorEnd.getOwner(); - if (connectorEndContainer instanceof Connector) { - Element connectorContainer = ((Connector) connectorEndContainer).getOwner(); - if (connectorContainer != null && connectorContainer.equals(port.getClass_())) { - return true; - } - } - } - return false; + return (rt != null) && rt.isConnectedInside(); } /** @@ -116,23 +102,9 @@ public final class RTPortUtils { * @return true if connected outside */ public static boolean isConnectedOutside(Port port) { - // it should be at least connected - if (!isConnected(port)) { - return false; - } + UMLRTPort rt = UMLRTPort.getInstance(port); - // check the connected elements - for (ConnectorEnd connectorEnd : port.getEnds()) { - // should be a connector - Element connectorEndContainer = connectorEnd.getOwner(); - if (connectorEndContainer instanceof Connector) { - Element connectorContainer = ((Connector) connectorEndContainer).getOwner(); - if (connectorContainer != null && !connectorContainer.equals(port.getClass_())) { - return true; - } - } - } - return false; + return (rt != null) && rt.isConnectedOutside(); } /** @@ -290,66 +262,70 @@ public final class RTPortUtils { * @param port * port * @param newKind - * kind - * @return true if editable + * kind a kind to which to change the {@code port} + * @return whether it is valid to change the {@code port} to be the new kind */ public static boolean isKindEditable(Port port, RTPortKindEnum newKind) { boolean result = true; - if ((null != port) && (null != getKind(port))) { - switch (getKind(port)) { - case EXTERNAL: - if (isConnectedOutside(port)) { - // can only go from EXTERNAL to RELAY when connected outside - if (!(RTPortKindEnum.RELAY == newKind || RTPortKindEnum.EXTERNAL == newKind)) { - result = false; - } - } else if (isConnected(port)) { - // no connection on SAP and SPP - if (RTPortKindEnum.SAP == newKind || RTPortKindEnum.SPP == newKind) { - result = false; - } + UMLRTPort portFacade = (port == null) ? null : UMLRTPort.getInstance(port); + if (portFacade != null) { + UMLRTPortKind currentKind = portFacade.getKind(); + UMLRTPortKind targetKind = RTPortKindEnum.toFacade(newKind); + + // Can always transition to the current kind + if (targetKind != currentKind) { + // A redefinition can only change isNotification and isBehavior, so + // that restricts our possibilities + if (portFacade.isInherited()) { + // isNotification is irrelevant to the port kind + result = (targetKind.isExternal() == currentKind.isExternal()) + && (targetKind.isWired() == currentKind.isWired()) + && (targetKind.isPublish() == currentKind.isPublish()); } - break; - case INTERNAL: - if (isConnectedInside(port)) { - // can only go from INTERNAL to RELAY when connected inside - if (!(RTPortKindEnum.RELAY == newKind || RTPortKindEnum.INTERNAL == newKind)) { - result = false; - } - } - if (isConnected(port)) { - // no connection on SAP and SPP - if (RTPortKindEnum.SAP == newKind || RTPortKindEnum.SPP == newKind) { - result = false; + + switch (currentKind) { + case EXTERNAL_BEHAVIOR: + if (portFacade.isConnectedOutside()) { + // can only go from EXTERNAL to RELAY when connected outside, + // but a redefinition cannot change isService + result = result && (targetKind == UMLRTPortKind.RELAY); + } else if (portFacade.isConnectedInside()) { + // no connection on SAP and SPP + result = result && targetKind.isWired(); } - } - break; - case RELAY: - if (isConnectedInside(port)) { - // can only go from RELAY to INTERNAL when connected inside - if (!(RTPortKindEnum.RELAY == newKind || RTPortKindEnum.INTERNAL == newKind)) { - result = false; + break; + case INTERNAL_BEHAVIOR: + if (portFacade.isConnectedInside()) { + // can only go from INTERNAL to RELAY when connected inside + result = result && (targetKind == UMLRTPortKind.RELAY); + } else if (portFacade.isConnectedOutside()) { + // no connection on SAP and SPP. But, connecting an internal behaviour + // port outside shouldn't be possible to start with + result = result && targetKind.isWired(); } - } - if (isConnectedOutside(port)) { - // can only go from RELAY to EXTERNAL when connected outside - if (!(RTPortKindEnum.RELAY == newKind || RTPortKindEnum.EXTERNAL == newKind)) { - result = false; + break; + case RELAY: + if (portFacade.isConnectedInside()) { + // can only go from RELAY to INTERNAL when connected inside + result = result && (targetKind == UMLRTPortKind.INTERNAL_BEHAVIOR); } - } - if (isConnected(port)) { - if (RTPortKindEnum.SAP == newKind || RTPortKindEnum.SPP == newKind) { - // no connection on SAP and SPP - result = false; + if (portFacade.isConnectedOutside()) { + // can only go from RELAY to EXTERNAL when connected outside, + // but it may also be connected inside, in which case + // it can only be relay + result = result && (targetKind == UMLRTPortKind.EXTERNAL_BEHAVIOR); } + break; + case SAP: + break; + case SPP: + break; + case NULL: + break; + default: + assert false : "Unhandled port kind"; //$NON-NLS-1$ + break; } - break; - case SAP: - break; - case SPP: - break; - default: - break; } } return result; diff --git a/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core/src/org/eclipse/papyrusrt/umlrt/core/utils/UMLRTCommandUtils.java b/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core/src/org/eclipse/papyrusrt/umlrt/core/utils/UMLRTCommandUtils.java new file mode 100644 index 000000000..ccee54e3a --- /dev/null +++ b/plugins/umlrt/core/org.eclipse.papyrusrt.umlrt.core/src/org/eclipse/papyrusrt/umlrt/core/utils/UMLRTCommandUtils.java @@ -0,0 +1,98 @@ +/***************************************************************************** + * Copyright (c) 2016, 2017 Christian W. Damus and others. + * + * 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: + * Christian W. Damus - Initial API and implementation + * + *****************************************************************************/ + +package org.eclipse.papyrusrt.umlrt.core.utils; + +import static java.util.Spliterators.spliteratorUnknownSize; + +import java.util.Iterator; +import java.util.Spliterator; +import java.util.stream.StreamSupport; + +import org.eclipse.emf.common.notify.Notifier; +import org.eclipse.emf.transaction.Transaction; +import org.eclipse.emf.transaction.TransactionalEditingDomain; +import org.eclipse.emf.transaction.impl.InternalTransactionalEditingDomain; +import org.eclipse.emf.transaction.util.TransactionUtil; +import org.eclipse.gmf.runtime.common.core.command.ICommand; +import org.eclipse.gmf.runtime.common.core.command.ICompositeCommand; +import org.eclipse.gmf.runtime.common.core.command.UnexecutableCommand; + +/** + * Various static utilities for working with commands. + */ +public class UMLRTCommandUtils { + + // Not instantiable by clients + private UMLRTCommandUtils() { + super(); + } + + /** + * An alternative to the {@link ICommand#compose(org.eclipse.core.commands.operations.IUndoableOperation)} + * API that compose commands into a single, flat composite, instead of adding nested composites + * to the result. + * + * @param c1 + * a possible composite command + * @param c2 + * another possibly composite command + * + * @return a command that composes {@code c1} with {@code c2} or its components, + * according to whethr {@code c2} is composite + */ + public static ICommand flatCompose(ICommand c1, ICommand c2) { + ICommand result; + + if (c2 instanceof UnexecutableCommand) { + // That's enough + result = c2; + } else if (c1 instanceof UnexecutableCommand) { + // Or that + result = c1; + } else if (c2 instanceof ICompositeCommand) { + ICompositeCommand cc2 = (ICompositeCommand) c2; + @SuppressWarnings("unchecked") + Iterator<ICommand> commands = cc2.iterator(); + result = StreamSupport.stream( + spliteratorUnknownSize(commands, Spliterator.NONNULL | Spliterator.ORDERED), + false).reduce(c1, UMLRTCommandUtils::flatCompose); + } else if (c1 != null) { + result = (c2 == null) ? c1 : c1.compose(c2); + } else { + result = c2; // Whether it's null or not + } + + return result; + } + + /** + * Queries whether changes reported by a {@code notifier} are happening in the + * context of an undo or a redo of a command execution. + * + * @param notifier + * some EMF run-time object + * @return whether it is being changed by undo or redo + */ + public static boolean isUndoRedoInProgress(Notifier notifier) { + boolean result = false; + + TransactionalEditingDomain domain = TransactionUtil.getEditingDomain(notifier); + if (domain instanceof InternalTransactionalEditingDomain) { + Transaction active = ((InternalTransactionalEditingDomain) domain).getActiveTransaction(); + result = (active != null) && Boolean.TRUE.equals(active.getOptions().get(Transaction.OPTION_IS_UNDO_REDO_TRANSACTION)); + } + + return result; + } +} diff --git a/plugins/umlrt/core/pom.xml b/plugins/umlrt/core/pom.xml index c0c9b744f..133b804ee 100644 --- a/plugins/umlrt/core/pom.xml +++ b/plugins/umlrt/core/pom.xml @@ -13,7 +13,6 @@ <packaging>pom</packaging> <modules> <module>org.eclipse.papyrusrt.umlrt.core</module> - <module>org.eclipse.papyrusrt.umlrt.core.sync</module> <module>org.eclipse.papyrusrt.umlrt.core.validation</module> <module>org.eclipse.papyrusrt.umlrt.system.profile</module> <module>org.eclipse.papyrusrt.umlrt.system.profile.validation</module> diff --git a/tests/junit/framework/org.eclipse.papyrusrt.junit/META-INF/MANIFEST.MF b/tests/junit/framework/org.eclipse.papyrusrt.junit/META-INF/MANIFEST.MF index 44eb0db6a..2e239eea1 100644 --- a/tests/junit/framework/org.eclipse.papyrusrt.junit/META-INF/MANIFEST.MF +++ b/tests/junit/framework/org.eclipse.papyrusrt.junit/META-INF/MANIFEST.MF @@ -12,7 +12,10 @@ Require-Bundle: org.junit;bundle-version="[4.12.0,5.0.0)";visibility:=reexport, org.eclipse.papyrus.infra.types.core;bundle-version="[2.0.0,3.0.0)", org.eclipse.papyrus.infra.services.edit;bundle-version="[2.0.0,3.0.0)", org.eclipse.papyrus.infra.emf;bundle-version="[2.0.0,3.0.0)", - org.eclipse.papyrus.infra.emf.gmf;bundle-version="[1.2.0, 2.0.0)" + org.eclipse.papyrus.infra.emf.gmf;bundle-version="[1.2.0,2.0.0)", + org.eclipse.papyrusrt.umlrt.uml;bundle-version="[0.8.0,1.0.0)", + org.eclipse.papyrusrt.umlrt.core;bundle-version="[0.8.0,1.0.0)", + org.eclipse.papyrus.infra.gmfdiag.common;bundle-version="[2.0.2,3.0.0)" Export-Package: org.eclipse.papyrusrt.junit.matchers, org.eclipse.papyrusrt.junit.rules, org.eclipse.papyrusrt.junit.utils diff --git a/tests/junit/framework/org.eclipse.papyrusrt.junit/src/org/eclipse/papyrusrt/junit/matchers/FunctionalMatchers.java b/tests/junit/framework/org.eclipse.papyrusrt.junit/src/org/eclipse/papyrusrt/junit/matchers/FunctionalMatchers.java new file mode 100644 index 000000000..237a3739c --- /dev/null +++ b/tests/junit/framework/org.eclipse.papyrusrt.junit/src/org/eclipse/papyrusrt/junit/matchers/FunctionalMatchers.java @@ -0,0 +1,90 @@ +/***************************************************************************** + * Copyright (c) 2017 Christian W. Damus and others. + * + * 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: + * Christian W. Damus - Initial API and implementation + * + *****************************************************************************/ + +package org.eclipse.papyrusrt.junit.matchers; + +import java.util.Objects; +import java.util.function.Function; + +import org.hamcrest.BaseMatcher; +import org.hamcrest.Description; +import org.hamcrest.Matcher; + +/** + * Generic Hamcrest matchers that compose standard matchers on details extracted by functions. + */ +public class FunctionalMatchers { + + public static <T, U> Matcher<T> compose(Function<? super T, ? extends U> detailFunction, Matcher<? super U> detailMatcher) { + return new DetailMatcher<>(detailFunction, detailMatcher); + } + + // + // Nested types + // + + private static final class DetailMatcher<T, U> extends BaseMatcher<T> { + private final Function<? super T, ? extends U> detailFunction; + private final Matcher<? super U> detailMatcher; + + DetailMatcher(Function<? super T, ? extends U> detailFunction, Matcher<? super U> detailMatcher) { + super(); + + this.detailFunction = detailFunction; + this.detailMatcher = detailMatcher; + } + + @Override + public int hashCode() { + return Objects.hash(detailFunction, detailMatcher); + } + + @Override + public boolean equals(Object obj) { + boolean result; + + if (obj == this) { + result = true; + } else if (!(obj instanceof DetailMatcher<?, ?>)) { + result = false; + } else { + DetailMatcher<?, ?> other = (DetailMatcher<?, ?>) obj; + result = Objects.equals(other.detailFunction, this.detailFunction) + && Objects.equals(other.detailMatcher, this.detailMatcher); + } + + return result; + } + + @Override + public void describeTo(Description description) { + description.appendText("detail of object ").appendDescriptionOf(detailMatcher); + } + + @Override + public boolean matches(Object item) { + boolean result = false; + + if (item != null) { + @SuppressWarnings("unchecked") + T master = (T) item; + U detail = detailFunction.apply(master); + + result = detailMatcher.matches(detail); + } + + return result; + } + } + +} diff --git a/tests/junit/framework/org.eclipse.papyrusrt.junit/src/org/eclipse/papyrusrt/junit/rules/PapyrusRTEditorFixture.java b/tests/junit/framework/org.eclipse.papyrusrt.junit/src/org/eclipse/papyrusrt/junit/rules/PapyrusRTEditorFixture.java new file mode 100644 index 000000000..f0ad7d0d0 --- /dev/null +++ b/tests/junit/framework/org.eclipse.papyrusrt.junit/src/org/eclipse/papyrusrt/junit/rules/PapyrusRTEditorFixture.java @@ -0,0 +1,273 @@ +/***************************************************************************** + * Copyright (c) 2016, 2017 Christian W. Damus and others. + * + * 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: + * Christian W. Damus - Initial API and implementation + * + *****************************************************************************/ + +package org.eclipse.papyrusrt.junit.rules; + +import static org.junit.Assert.fail; + +import java.lang.annotation.Annotation; +import java.lang.annotation.ElementType; +import java.lang.annotation.Inherited; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; +import java.util.ArrayList; +import java.util.List; + +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.resource.Resource; +import org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditorWithFlyOutPalette; +import org.eclipse.gmf.runtime.notation.Diagram; +import org.eclipse.papyrus.infra.core.language.ILanguage; +import org.eclipse.papyrus.infra.core.resource.ModelSet; +import org.eclipse.papyrus.infra.core.sasheditor.editor.IComponentPage; +import org.eclipse.papyrus.infra.core.sasheditor.editor.IEditorPage; +import org.eclipse.papyrus.infra.core.sasheditor.editor.IPageVisitor; +import org.eclipse.papyrus.infra.core.sasheditor.editor.ISashWindowsContainer; +import org.eclipse.papyrus.infra.gmfdiag.common.model.NotationModel; +import org.eclipse.papyrus.infra.tools.util.PlatformHelper; +import org.eclipse.papyrus.infra.ui.editor.IMultiDiagramEditor; +import org.eclipse.papyrus.junit.utils.JUnitUtils; +import org.eclipse.papyrus.junit.utils.rules.AbstractModelFixture; +import org.eclipse.papyrus.junit.utils.rules.JavaResource; +import org.eclipse.papyrus.junit.utils.rules.PapyrusEditorFixture; +import org.eclipse.papyrus.junit.utils.rules.PluginResource; +import org.junit.runner.Description; +import org.junit.runners.Parameterized; + +import com.google.common.base.Strings; + +/** + * A specialized {@link PapyrusEditorFixture} that ensures that the resource set + * is configured for the UML-RT language when initializing test resources. + */ +public class PapyrusRTEditorFixture extends PapyrusEditorFixture { + + private DiagramNameStrategy nameStrategy; + + private String modelPath; + + public PapyrusRTEditorFixture() { + super(); + } + + /** + * Initializes me with a test resource path to inject not via an annotation. + * This is useful especially for {@link Parameterized parameterized} test suites. + * + * @param modelPath + * the model path to load instead of any that might be supplied by an annotaiton + * + * @see Parameterized + * @see PluginResource + * @see JavaResource + */ + public PapyrusRTEditorFixture(String modelPath) { + super(); + + this.modelPath = modelPath; + } + + @Override + protected void starting(Description description) { + DiagramNaming naming = JUnitUtils.getAnnotation(description, DiagramNaming.class); + if (naming != null) { + try { + nameStrategy = naming.value().newInstance(); + } catch (Exception e) { + e.printStackTrace(); + fail("Could not instantiate diagram name strategy: " + e.getMessage()); + } + } + + if (modelPath != null) { + // Inject a fake annotation for this path. + if (description.isSuite()) { + List<Annotation> annotations = new ArrayList<>(description.getAnnotations()); + annotations.add(0, fakePluginResource(modelPath)); + description = Description.createSuiteDescription(description.getDisplayName(), + annotations.toArray(new Annotation[annotations.size()])); + } else if (description.isTest()) { + List<Annotation> annotations = new ArrayList<>(description.getAnnotations()); + annotations.add(0, fakePluginResource(modelPath)); + description = Description.createTestDescription(description.getTestClass(), description.getDisplayName(), + annotations.toArray(new Annotation[annotations.size()])); + } + } + + super.starting(description); + } + + private static PluginResource fakePluginResource(String path) { + return new PluginResource() { + + @Override + public Class<? extends Annotation> annotationType() { + return PluginResource.class; + } + + @Override + public String[] value() { + return new String[] { path }; + } + + @Override + public String bundle() { + return ""; + } + }; + } + + @Override + protected Resource initModelResource(String targetPath, AbstractModelFixture.ResourceKind resourceKind, String resourcePath) { + Resource result; + + if (getEditor() == null) { + // Bootstrap mode. We use a temporary resource set to copy resources + // to the workspace, so language doesn't matter + result = super.initModelResource(targetPath, resourceKind, resourcePath); + } else { + ModelSet modelSet = getModelSet(); + + @SuppressWarnings("restriction") + ILanguage umlrt = new org.eclipse.papyrusrt.umlrt.core.internal.language.UMLRTLanguage(); + umlrt.install(modelSet); + + try { + result = super.initModelResource(targetPath, resourceKind, resourcePath); + } finally { + // The ModelSet will try to install it again, later, so don't do it now + umlrt.uninstall(modelSet); + } + } + + return result; + } + + @Override + public PapyrusEditorFixture activateDiagram(IMultiDiagramEditor editor, final String name) { + if (nameStrategy == null) { + return super.activateDiagram(editor, name); + } + + // We can help the Papyrus framework to find diagram editors by their implied names + + activate(editor); + + ISashWindowsContainer sashContainer = PlatformHelper.getAdapter(editor, ISashWindowsContainer.class); + + sashContainer.visit(new IPageVisitor() { + + @Override + public void accept(IEditorPage page) { + if (page.getIEditorPart() instanceof DiagramEditorWithFlyOutPalette) { + Diagram diagram = ((DiagramEditorWithFlyOutPalette) page.getIEditorPart()).getDiagram(); + sneakDiagramName(diagram, name); + } + } + + @Override + public void accept(IComponentPage page) { + // Pass + } + }); + + return super.activateDiagram(editor, name); + } + + private boolean sneakDiagramName(Diagram diagram, String name) { + boolean result = false; + + if (Strings.isNullOrEmpty(diagram.getName())) { + if (nameStrategy.canName(diagram) && name.equals(nameStrategy.getName(diagram))) { + // Sneakily set the name so that the super implementation can find it + diagram.eSetDeliver(false); + try { + diagram.setName(nameStrategy.getName(diagram)); + } finally { + diagram.eSetDeliver(true); + } + + result = true; + } + } + + return result; + } + + @Override + public PapyrusEditorFixture openDiagram(IMultiDiagramEditor editor, final String name) { + if (nameStrategy == null) { + return super.openDiagram(editor, name); + } + + // We can help the Papyrus framework to open diagram editors by their implied names + + activate(editor); + + ModelSet modelSet = getModelSet(); + NotationModel notation = (NotationModel) modelSet.getModel(NotationModel.MODEL_ID); + for (EObject next : notation.getResource().getContents()) { + if (next instanceof Diagram) { + Diagram diagram = (Diagram) next; + if (sneakDiagramName(diagram, name)) { + break; + } + } + } + + return super.openDiagram(editor, name); + } + + // + // Nested types + // + + /** + * A strategy for resolving implicit diagram names. + */ + public interface DiagramNameStrategy { + /** + * Queries whether the strategy handles a given {@code diagram}. + * + * @param diagram + * a diagram + * + * @return whether I can provide its implicit name + */ + boolean canName(Diagram diagram); + + /** + * Queries the implicit name of the given {@code diagram}, which + * can be assumed to have a {@code null} or blank name. + * + * @param diagram + * a diagram that is implicitly named + * + * @return its implicit name + */ + String getName(Diagram diagram); + } + + /** + * Annotation on test suites or methods to indicate the diagram name strategy + * to use to help the fixture find diagram editors that use the implicit diagram + * name (where the diagram name is unset in the notation). + */ + @Retention(RetentionPolicy.RUNTIME) + @Target({ ElementType.METHOD, ElementType.TYPE }) + @Inherited + public @interface DiagramNaming { + Class<? extends DiagramNameStrategy> value(); + } +} diff --git a/tests/junit/framework/org.eclipse.papyrusrt.junit/src/org/eclipse/papyrusrt/junit/rules/UMLRTModelSetFixture.java b/tests/junit/framework/org.eclipse.papyrusrt.junit/src/org/eclipse/papyrusrt/junit/rules/UMLRTModelSetFixture.java new file mode 100644 index 000000000..ea850c449 --- /dev/null +++ b/tests/junit/framework/org.eclipse.papyrusrt.junit/src/org/eclipse/papyrusrt/junit/rules/UMLRTModelSetFixture.java @@ -0,0 +1,92 @@ +/***************************************************************************** + * Copyright (c) 2016 Christian W. Damus and others. + * + * 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: + * Christian W. Damus - Initial API and implementation + * + *****************************************************************************/ + +package org.eclipse.papyrusrt.junit.rules; + +import java.util.concurrent.atomic.AtomicReference; +import java.util.function.Supplier; + +import org.eclipse.core.commands.ExecutionException; +import org.eclipse.core.runtime.IAdaptable; +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.emf.ecore.resource.Resource; +import org.eclipse.gmf.runtime.common.core.command.CommandResult; +import org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand; +import org.eclipse.papyrus.infra.core.language.ILanguage; +import org.eclipse.papyrus.infra.core.resource.ModelSet; +import org.eclipse.papyrus.junit.utils.rules.AbstractModelFixture; +import org.eclipse.papyrus.junit.utils.rules.ModelSetFixture; + +/** + * A specialized {@link ModelSetFixture} that ensures that the resource set + * is configured for the UML-RT language. + */ +public class UMLRTModelSetFixture extends ModelSetFixture { + + public UMLRTModelSetFixture() { + super(); + } + + @Override + protected Resource initModelResource(String targetPath, AbstractModelFixture.ResourceKind resourceKind, String resourcePath) { + Resource result; + + if (getResourceSet() == null) { + // Bootstrap mode. We use a temporary resource set to copy resources + // to the workspace, so language doesn't matter + result = super.initModelResource(targetPath, resourceKind, resourcePath); + } else { + ModelSet modelSet = getResourceSet(); + + @SuppressWarnings("restriction") + ILanguage umlrt = new org.eclipse.papyrusrt.umlrt.core.internal.language.UMLRTLanguage(); + umlrt.install(modelSet); + + try { + result = super.initModelResource(targetPath, resourceKind, resourcePath); + } finally { + // The ModelSet will try to install it again, later, so don't do it now + umlrt.uninstall(modelSet); + } + } + + return result; + } + + public <T> T execute(Supplier<T> supplier) { + AtomicReference<T> result = new AtomicReference<>(null); + + execute(new AbstractTransactionalCommand(getEditingDomain(), "Test Setup", null) { + + @Override + protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException { + result.set(supplier.get()); + return CommandResult.newOKCommandResult(result.get()); + } + }); + + return result.get(); + } + + public void execute(Runnable action) { + execute(new AbstractTransactionalCommand(getEditingDomain(), "Test Setup", null) { + + @Override + protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException { + action.run(); + return CommandResult.newOKCommandResult(); + } + }); + } + +} diff --git a/tests/junit/framework/org.eclipse.papyrusrt.junit/src/org/eclipse/papyrusrt/junit/utils/CreationUtils.java b/tests/junit/framework/org.eclipse.papyrusrt.junit/src/org/eclipse/papyrusrt/junit/utils/CreationUtils.java index 997dbcc11..472bc4ec0 100644 --- a/tests/junit/framework/org.eclipse.papyrusrt.junit/src/org/eclipse/papyrusrt/junit/utils/CreationUtils.java +++ b/tests/junit/framework/org.eclipse.papyrusrt.junit/src/org/eclipse/papyrusrt/junit/utils/CreationUtils.java @@ -1,5 +1,5 @@ /***************************************************************************** - * Copyright (c) 2016 CEA LIST and others. + * Copyright (c) 2016 CEA LIST, Christian W. Damus, and others. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 @@ -8,6 +8,7 @@ * * Contributors: * CEA LIST - Initial API and implementation + * Christian W. Damus - bug 467545 * *****************************************************************************/ @@ -32,7 +33,9 @@ import org.eclipse.emf.transaction.impl.InternalTransactionalEditingDomain; import org.eclipse.gmf.runtime.common.core.command.ICommand; import org.eclipse.gmf.runtime.emf.type.core.IHintedType; import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest; +import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest; import org.eclipse.gmf.runtime.emf.type.core.requests.GetEditContextRequest; +import org.eclipse.gmf.runtime.emf.type.core.requests.IEditCommandRequest; import org.eclipse.papyrus.infra.emf.gmf.command.GMFtoEMFCommandWrapper; import org.eclipse.papyrus.infra.services.edit.service.ElementEditServiceUtils; import org.eclipse.papyrus.infra.services.edit.service.IElementEditService; @@ -52,7 +55,11 @@ public final class CreationUtils { } public static Command getCreateChildCommand(EObject owner, IHintedType hintedType, boolean canCreate, TransactionalEditingDomain transactionalEditingDomain) { - GetEditContextRequest editContextRequest = new GetEditContextRequest(transactionalEditingDomain, new CreateElementRequest(transactionalEditingDomain, owner, hintedType), owner); + return getCreationCommand(owner, hintedType, canCreate, transactionalEditingDomain, CreateElementRequest::new); + } + + static Command getCreationCommand(EObject owner, IHintedType hintedType, boolean canCreate, TransactionalEditingDomain domain, ICreationRequestFunction requestFunction) { + GetEditContextRequest editContextRequest = new GetEditContextRequest(domain, requestFunction.apply(domain, owner, hintedType), owner); editContextRequest.setParameter(IRequestCacheEntries.Cache_Maps, new HashMap<>()); editContextRequest.setEditContext(owner); @@ -70,12 +77,12 @@ public final class CreationUtils { IStatus status = null; try { // this command could run in an unprotected transaction, it is not supposed to modify the model - InternalTransactionalEditingDomain domain = (InternalTransactionalEditingDomain) transactionalEditingDomain; + InternalTransactionalEditingDomain internalDomain = (InternalTransactionalEditingDomain) domain; Map<String, Object> options = new HashMap<>(); options.put(Transaction.OPTION_NO_NOTIFICATIONS, true); options.put(Transaction.OPTION_NO_VALIDATION, true); options.put(Transaction.OPTION_NO_TRIGGERS, true); - Transaction transaction = domain.startTransaction(false, options); + Transaction transaction = internalDomain.startTransaction(false, options); try { status = getEditContextCommand.execute(null, null); } finally { @@ -101,10 +108,10 @@ public final class CreationUtils { return UnexecutableCommand.INSTANCE; } - ICommand createGMFCommand = provider.getEditCommand(new CreateElementRequest(transactionalEditingDomain, target, hintedType)); + ICommand createGMFCommand = provider.getEditCommand(requestFunction.apply(domain, target, hintedType)); if (!canCreate) { // command should not be executable: either it should be null or it should be not executable - if (createGMFCommand != null && createGMFCommand.canExecute()) { + if ((createGMFCommand != null) && createGMFCommand.canExecute()) { fail("Creation command is executable but it was expected as not executable"); } } else { @@ -117,4 +124,28 @@ public final class CreationUtils { } return null; } + + /** + * For the case where the {@code owner} is also the source end of the relationship. + * + * @see #getCreateRelationshipCommand(EObject, IHintedType, EObject, EObject, boolean, TransactionalEditingDomain) + */ + public static Command getCreateRelationshipCommand(EObject owner, IHintedType hintedType, EObject target, boolean canCreate, TransactionalEditingDomain transactionalEditingDomain) { + return getCreateRelationshipCommand(owner, hintedType, owner, target, canCreate, transactionalEditingDomain); + } + + public static Command getCreateRelationshipCommand(EObject owner, IHintedType hintedType, EObject source, EObject target, boolean canCreate, TransactionalEditingDomain transactionalEditingDomain) { + return getCreationCommand(owner, hintedType, canCreate, transactionalEditingDomain, + (d, o, t) -> new CreateRelationshipRequest(d, o, source, target, t)); + } + + // + // Nested types + // + + @FunctionalInterface + private static interface ICreationRequestFunction { + + IEditCommandRequest apply(TransactionalEditingDomain domain, EObject owner, IHintedType hintedType); + } } diff --git a/tests/junit/umlrt/core/org.eclipse.papyrusrt.umlrt.core.tests/org.eclipse.papyrusrt.umlrt.core.tests.launch b/tests/junit/umlrt/core/org.eclipse.papyrusrt.umlrt.core.tests/org.eclipse.papyrusrt.umlrt.core.tests.launch index 123585eae..3cad41238 100644 --- a/tests/junit/umlrt/core/org.eclipse.papyrusrt.umlrt.core.tests/org.eclipse.papyrusrt.umlrt.core.tests.launch +++ b/tests/junit/umlrt/core/org.eclipse.papyrusrt.umlrt.core.tests/org.eclipse.papyrusrt.umlrt.core.tests.launch @@ -9,6 +9,9 @@ <booleanAttribute key="clearConfig" value="true"/> <booleanAttribute key="clearws" value="true"/> <booleanAttribute key="clearwslog" value="false"/> +<listAttribute key="com.mountainminds.eclemma.core.SCOPE_IDS"> +<listEntry value="=org.eclipse.papyrusrt.umlrt.core/src"/> +</listAttribute> <stringAttribute key="configLocation" value="${workspace_loc}/.metadata/.plugins/org.eclipse.pde.core/pde-junit"/> <booleanAttribute key="default" value="true"/> <booleanAttribute key="includeOptional" value="true"/> diff --git a/tests/junit/umlrt/core/org.eclipse.papyrusrt.umlrt.core.tests/resource/exclusions.di b/tests/junit/umlrt/core/org.eclipse.papyrusrt.umlrt.core.tests/resource/exclusions.di new file mode 100644 index 000000000..bf9abab34 --- /dev/null +++ b/tests/junit/umlrt/core/org.eclipse.papyrusrt.umlrt.core.tests/resource/exclusions.di @@ -0,0 +1,2 @@ +<?xml version="1.0" encoding="UTF-8"?> +<xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"/> diff --git a/tests/junit/umlrt/core/org.eclipse.papyrusrt.umlrt.core.tests/resource/exclusions.notation b/tests/junit/umlrt/core/org.eclipse.papyrusrt.umlrt.core.tests/resource/exclusions.notation new file mode 100644 index 000000000..656211537 --- /dev/null +++ b/tests/junit/umlrt/core/org.eclipse.papyrusrt.umlrt.core.tests/resource/exclusions.notation @@ -0,0 +1,275 @@ +<?xml version="1.0" encoding="UTF-8"?> +<xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:configuration="http://www.eclipse.org/papyrus/infra/viewpoints/configuration" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" xmlns:notation="http://www.eclipse.org/gmf/runtime/1.0.2/notation" xmlns:style="http://www.eclipse.org/papyrus/infra/viewpoints/policy/style" xmlns:uml="http://www.eclipse.org/uml2/5.0.0/UML"> + <notation:Diagram xmi:id="_YixLUNNgEeaCL_jN4Rh9Ew" type="CompositeStructure" measurementUnit="Pixel"> + <children xmi:type="notation:Shape" xmi:id="_YixyYNNgEeaCL_jN4Rh9Ew" type="Class_Shape"> + <children xmi:type="notation:DecorationNode" xmi:id="_YixyYtNgEeaCL_jN4Rh9Ew" type="Class_NameLabel"/> + <children xmi:type="notation:DecorationNode" xmi:id="_YixyY9NgEeaCL_jN4Rh9Ew" type="Class_FloatingNameLabel"> + <layoutConstraint xmi:type="notation:Location" xmi:id="_YixyZNNgEeaCL_jN4Rh9Ew" y="5"/> + </children> + <children xmi:type="notation:BasicCompartment" xmi:id="_YixyZdNgEeaCL_jN4Rh9Ew" type="Class_StructureCompartment"> + <children xmi:type="notation:Shape" xmi:id="_c8EG0NNgEeaCL_jN4Rh9Ew" type="Property_Shape"> + <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_fxWR4NNgEeaCL_jN4Rh9Ew" source="PapyrusCSSForceValue"> + <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_fxWR4dNgEeaCL_jN4Rh9Ew" key="mutable" value="true"/> + </eAnnotations> + <children xmi:type="notation:DecorationNode" xmi:id="_c8Et4NNgEeaCL_jN4Rh9Ew" type="Property_NameLabel"/> + <children xmi:type="notation:DecorationNode" xmi:id="_c8Et4dNgEeaCL_jN4Rh9Ew" type="Property_FloatingNameLabel"> + <layoutConstraint xmi:type="notation:Location" xmi:id="_c8Et4tNgEeaCL_jN4Rh9Ew" y="5"/> + </children> + <children xmi:type="notation:BasicCompartment" xmi:id="_c8Et49NgEeaCL_jN4Rh9Ew" type="Property_StructureCompartment"> + <styles xmi:type="notation:TitleStyle" xmi:id="_c8Et5NNgEeaCL_jN4Rh9Ew"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_c8Et5dNgEeaCL_jN4Rh9Ew"/> + </children> + <children xmi:type="notation:DecorationNode" xmi:id="_c8MCoNNgEeaCL_jN4Rh9Ew" type="StereotypeLabel"> + <styles xmi:type="notation:StringValueStyle" xmi:id="_c8MCodNgEeaCL_jN4Rh9Ew" name="stereotype" stringValue="UMLRealTime::CapsulePart"/> + <element xmi:type="uml:Stereotype" href="pathmap://UML_RT_PROFILE/uml-rt.profile.uml#_EQwT4EhOEeO0lv5O1DTHOQ"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_c8MCotNgEeaCL_jN4Rh9Ew"/> + </children> + <children xmi:type="notation:BasicCompartment" xmi:id="_c8MCo9NgEeaCL_jN4Rh9Ew" type="StereotypeBrace"> + <styles xmi:type="notation:TitleStyle" xmi:id="_c8MCpNNgEeaCL_jN4Rh9Ew"/> + <styles xmi:type="notation:StringValueStyle" xmi:id="_c8MCpdNgEeaCL_jN4Rh9Ew" name="stereotype" stringValue="UMLRealTime::CapsulePart"/> + <element xmi:type="uml:Stereotype" href="pathmap://UML_RT_PROFILE/uml-rt.profile.uml#_EQwT4EhOEeO0lv5O1DTHOQ"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_c8MCptNgEeaCL_jN4Rh9Ew"/> + </children> + <children xmi:type="notation:BasicCompartment" xmi:id="_c8MpsNNgEeaCL_jN4Rh9Ew" type="compartment_shape_display"> + <styles xmi:type="notation:TitleStyle" xmi:id="_c8MpsdNgEeaCL_jN4Rh9Ew"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_c8MpstNgEeaCL_jN4Rh9Ew"/> + </children> + <children xmi:type="notation:BasicCompartment" xmi:id="_c8NQx9NgEeaCL_jN4Rh9Ew" type="StereotypeCompartment"> + <styles xmi:type="notation:TitleStyle" xmi:id="_c8NQyNNgEeaCL_jN4Rh9Ew"/> + <styles xmi:type="notation:StringValueStyle" xmi:id="_c8NQydNgEeaCL_jN4Rh9Ew" name="stereotype" stringValue="UMLRealTime::CapsulePart"/> + <element xmi:type="uml:Stereotype" href="pathmap://UML_RT_PROFILE/uml-rt.profile.uml#_EQwT4EhOEeO0lv5O1DTHOQ"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_c8NQytNgEeaCL_jN4Rh9Ew"/> + </children> + <children xmi:type="notation:Shape" xmi:id="_fukDoNNgEeaCL_jN4Rh9Ew" type="Port_Shape"> + <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_fxWR4tNgEeaCL_jN4Rh9Ew" source="PapyrusCSSForceValue"> + <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_fxWR49NgEeaCL_jN4Rh9Ew" key="mutable" value="true"/> + </eAnnotations> + <children xmi:type="notation:DecorationNode" xmi:id="_fukDotNgEeaCL_jN4Rh9Ew" type="Port_NameLabel"> + <layoutConstraint xmi:type="notation:Location" xmi:id="_fukDo9NgEeaCL_jN4Rh9Ew" x="-50" y="14"/> + </children> + <children xmi:type="notation:DecorationNode" xmi:id="_fukDpNNgEeaCL_jN4Rh9Ew" type="Port_StereotypeLabel"> + <layoutConstraint xmi:type="notation:Location" xmi:id="_fukDpdNgEeaCL_jN4Rh9Ew" x="25" y="-10"/> + </children> + <element xmi:type="uml:Port" href="exclusions.uml#_fuekENNgEeaCL_jN4Rh9Ew"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_fukDodNgEeaCL_jN4Rh9Ew" x="-5" y="20" width="11" height="11"/> + </children> + <element xmi:type="uml:Property" href="exclusions.uml#_cYJhcNNgEeaCL_jN4Rh9Ew"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_c8EG0dNgEeaCL_jN4Rh9Ew" x="165" y="77"/> + </children> + <children xmi:type="notation:Shape" xmi:id="_c8Mps9NgEeaCL_jN4Rh9Ew" type="StereotypeComment"> + <styles xmi:type="notation:TitleStyle" xmi:id="_c8MptNNgEeaCL_jN4Rh9Ew"/> + <styles xmi:type="notation:EObjectValueStyle" xmi:id="_c8MpttNgEeaCL_jN4Rh9Ew" name="BASE_ELEMENT"> + <eObjectValue xmi:type="uml:Property" href="exclusions.uml#_cYJhcNNgEeaCL_jN4Rh9Ew"/> + </styles> + <element xsi:nil="true"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_c8MptdNgEeaCL_jN4Rh9Ew" x="200"/> + </children> + <children xmi:type="notation:Shape" xmi:id="_fupjOtNgEeaCL_jN4Rh9Ew" type="StereotypeComment"> + <styles xmi:type="notation:TitleStyle" xmi:id="_fupjO9NgEeaCL_jN4Rh9Ew"/> + <styles xmi:type="notation:EObjectValueStyle" xmi:id="_fupjPdNgEeaCL_jN4Rh9Ew" name="BASE_ELEMENT"> + <eObjectValue xmi:type="uml:Port" href="exclusions.uml#_fuekENNgEeaCL_jN4Rh9Ew"/> + </styles> + <element xsi:nil="true"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_fupjPNNgEeaCL_jN4Rh9Ew" x="194" y="-6"/> + </children> + <styles xmi:type="notation:TitleStyle" xmi:id="_YixyZtNgEeaCL_jN4Rh9Ew"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_YixyZ9NgEeaCL_jN4Rh9Ew"/> + </children> + <children xmi:type="notation:DecorationNode" xmi:id="_ZSRVoNNgEeaCL_jN4Rh9Ew" type="StereotypeLabel"> + <styles xmi:type="notation:StringValueStyle" xmi:id="_ZSRVodNgEeaCL_jN4Rh9Ew" name="stereotype" stringValue="UMLRealTime::Capsule"/> + <element xmi:type="uml:Stereotype" href="pathmap://UML_RT_PROFILE/uml-rt.profile.uml#_hcMIwEhNEeO0lv5O1DTHOQ"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_ZSRVotNgEeaCL_jN4Rh9Ew"/> + </children> + <children xmi:type="notation:BasicCompartment" xmi:id="_ZSSjwNNgEeaCL_jN4Rh9Ew" type="StereotypeBrace"> + <styles xmi:type="notation:TitleStyle" xmi:id="_ZSSjwdNgEeaCL_jN4Rh9Ew"/> + <styles xmi:type="notation:StringValueStyle" xmi:id="_ZSSjwtNgEeaCL_jN4Rh9Ew" name="stereotype" stringValue="UMLRealTime::Capsule"/> + <element xmi:type="uml:Stereotype" href="pathmap://UML_RT_PROFILE/uml-rt.profile.uml#_hcMIwEhNEeO0lv5O1DTHOQ"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_ZSSjw9NgEeaCL_jN4Rh9Ew"/> + </children> + <children xmi:type="notation:BasicCompartment" xmi:id="_ZSTK0NNgEeaCL_jN4Rh9Ew" type="compartment_shape_display"> + <styles xmi:type="notation:TitleStyle" xmi:id="_ZSTK0dNgEeaCL_jN4Rh9Ew"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_ZSTK0tNgEeaCL_jN4Rh9Ew"/> + </children> + <children xmi:type="notation:BasicCompartment" xmi:id="_ZSVAANNgEeaCL_jN4Rh9Ew" type="StereotypeCompartment"> + <styles xmi:type="notation:TitleStyle" xmi:id="_ZSVAAdNgEeaCL_jN4Rh9Ew"/> + <styles xmi:type="notation:StringValueStyle" xmi:id="_ZSVAAtNgEeaCL_jN4Rh9Ew" name="stereotype" stringValue="UMLRealTime::Capsule"/> + <element xmi:type="uml:Stereotype" href="pathmap://UML_RT_PROFILE/uml-rt.profile.uml#_hcMIwEhNEeO0lv5O1DTHOQ"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_ZSVAA9NgEeaCL_jN4Rh9Ew"/> + </children> + <children xmi:type="notation:Shape" xmi:id="_ay1wgNNgEeaCL_jN4Rh9Ew" type="Port_Shape"> + <children xmi:type="notation:DecorationNode" xmi:id="_ay1wgtNgEeaCL_jN4Rh9Ew" type="Port_NameLabel"> + <layoutConstraint xmi:type="notation:Location" xmi:id="_ay1wg9NgEeaCL_jN4Rh9Ew" x="23" y="-8"/> + </children> + <children xmi:type="notation:DecorationNode" xmi:id="_ay1whNNgEeaCL_jN4Rh9Ew" type="Port_StereotypeLabel"> + <layoutConstraint xmi:type="notation:Location" xmi:id="_ay1whdNgEeaCL_jN4Rh9Ew" x="25" y="-10"/> + </children> + <element xmi:type="uml:Port" href="exclusions.uml#_aOzPUNNgEeaCL_jN4Rh9Ew"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_ay1wgdNgEeaCL_jN4Rh9Ew" x="-8" y="93" width="16" height="16"/> + </children> + <element xmi:type="uml:Class" href="exclusions.uml#_Yg5jENNgEeaCL_jN4Rh9Ew"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_YixyYdNgEeaCL_jN4Rh9Ew" x="40" y="40" width="500" height="250"/> + </children> + <children xmi:type="notation:Shape" xmi:id="_ZSTx4NNgEeaCL_jN4Rh9Ew" type="StereotypeComment"> + <styles xmi:type="notation:TitleStyle" xmi:id="_ZSTx4dNgEeaCL_jN4Rh9Ew"/> + <styles xmi:type="notation:EObjectValueStyle" xmi:id="_ZSTx49NgEeaCL_jN4Rh9Ew" name="BASE_ELEMENT"> + <eObjectValue xmi:type="uml:Class" href="exclusions.uml#_Yg5jENNgEeaCL_jN4Rh9Ew"/> + </styles> + <element xsi:nil="true"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_ZSTx4tNgEeaCL_jN4Rh9Ew" x="240" y="40"/> + </children> + <children xmi:type="notation:Shape" xmi:id="_ay7QENNgEeaCL_jN4Rh9Ew" type="StereotypeComment"> + <styles xmi:type="notation:TitleStyle" xmi:id="_ay7QEdNgEeaCL_jN4Rh9Ew"/> + <styles xmi:type="notation:EObjectValueStyle" xmi:id="_ay7QE9NgEeaCL_jN4Rh9Ew" name="BASE_ELEMENT"> + <eObjectValue xmi:type="uml:Port" href="exclusions.uml#_aOzPUNNgEeaCL_jN4Rh9Ew"/> + </styles> + <element xsi:nil="true"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_ay7QEtNgEeaCL_jN4Rh9Ew" x="192" y="93"/> + </children> + <children xmi:type="notation:Shape" xmi:id="_ikw0sNNgEeaCL_jN4Rh9Ew" type="StereotypeComment"> + <styles xmi:type="notation:TitleStyle" xmi:id="_ikw0sdNgEeaCL_jN4Rh9Ew"/> + <styles xmi:type="notation:EObjectValueStyle" xmi:id="_ikw0s9NgEeaCL_jN4Rh9Ew" name="BASE_ELEMENT"> + <eObjectValue xmi:type="uml:Connector" href="exclusions.uml#_ikSTkNNgEeaCL_jN4Rh9Ew"/> + </styles> + <element xsi:nil="true"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_ikw0stNgEeaCL_jN4Rh9Ew" x="192" y="-7"/> + </children> + <styles xmi:type="notation:StringValueStyle" xmi:id="_YixLUdNgEeaCL_jN4Rh9Ew" name="diagram_compatibility_version" stringValue="1.2.0"/> + <styles xmi:type="notation:DiagramStyle" xmi:id="_YixLUtNgEeaCL_jN4Rh9Ew"/> + <styles xmi:type="style:PapyrusViewStyle" xmi:id="_YixLU9NgEeaCL_jN4Rh9Ew"> + <owner xmi:type="uml:Class" href="exclusions.uml#_Yg5jENNgEeaCL_jN4Rh9Ew"/> + <configuration xmi:type="configuration:PapyrusDiagram" href="platform:/plugin/org.eclipse.papyrusrt.umlrt.tooling.diagram.common/configuration/UMLRT.configuration#_Z79eQHcZEeSnWeKqQOfW2A"/> + </styles> + <element xmi:type="uml:Class" href="exclusions.uml#_Yg5jENNgEeaCL_jN4Rh9Ew"/> + <edges xmi:type="notation:Connector" xmi:id="_ZSTx5NNgEeaCL_jN4Rh9Ew" type="StereotypeCommentLink" source="_YixyYNNgEeaCL_jN4Rh9Ew" target="_ZSTx4NNgEeaCL_jN4Rh9Ew"> + <styles xmi:type="notation:FontStyle" xmi:id="_ZSTx5dNgEeaCL_jN4Rh9Ew"/> + <styles xmi:type="notation:EObjectValueStyle" xmi:id="_ZSUY8NNgEeaCL_jN4Rh9Ew" name="BASE_ELEMENT"> + <eObjectValue xmi:type="uml:Class" href="exclusions.uml#_Yg5jENNgEeaCL_jN4Rh9Ew"/> + </styles> + <element xsi:nil="true"/> + <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_ZSTx5tNgEeaCL_jN4Rh9Ew" points="[0, 0, 0, 0]$[0, 0, 0, 0]"/> + <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_ZSTx59NgEeaCL_jN4Rh9Ew"/> + <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_ZSTx6NNgEeaCL_jN4Rh9Ew"/> + </edges> + <edges xmi:type="notation:Connector" xmi:id="_ay7QFNNgEeaCL_jN4Rh9Ew" type="StereotypeCommentLink" source="_ay1wgNNgEeaCL_jN4Rh9Ew" target="_ay7QENNgEeaCL_jN4Rh9Ew"> + <styles xmi:type="notation:FontStyle" xmi:id="_ay7QFdNgEeaCL_jN4Rh9Ew"/> + <styles xmi:type="notation:EObjectValueStyle" xmi:id="_ay7QGdNgEeaCL_jN4Rh9Ew" name="BASE_ELEMENT"> + <eObjectValue xmi:type="uml:Port" href="exclusions.uml#_aOzPUNNgEeaCL_jN4Rh9Ew"/> + </styles> + <element xsi:nil="true"/> + <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_ay7QFtNgEeaCL_jN4Rh9Ew" points="[0, 0, 0, 0]$[0, 0, 0, 0]"/> + <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_ay7QF9NgEeaCL_jN4Rh9Ew"/> + <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_ay7QGNNgEeaCL_jN4Rh9Ew"/> + </edges> + <edges xmi:type="notation:Connector" xmi:id="_c8Mpt9NgEeaCL_jN4Rh9Ew" type="StereotypeCommentLink" source="_c8EG0NNgEeaCL_jN4Rh9Ew" target="_c8Mps9NgEeaCL_jN4Rh9Ew"> + <styles xmi:type="notation:FontStyle" xmi:id="_c8MpuNNgEeaCL_jN4Rh9Ew"/> + <styles xmi:type="notation:EObjectValueStyle" xmi:id="_c8NQwtNgEeaCL_jN4Rh9Ew" name="BASE_ELEMENT"> + <eObjectValue xmi:type="uml:Property" href="exclusions.uml#_cYJhcNNgEeaCL_jN4Rh9Ew"/> + </styles> + <element xsi:nil="true"/> + <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_c8MpudNgEeaCL_jN4Rh9Ew" points="[0, 0, 0, 0]$[0, 0, 0, 0]"/> + <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_c8NQwNNgEeaCL_jN4Rh9Ew"/> + <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_c8NQwdNgEeaCL_jN4Rh9Ew"/> + </edges> + <edges xmi:type="notation:Connector" xmi:id="_fupjPtNgEeaCL_jN4Rh9Ew" type="StereotypeCommentLink" source="_fukDoNNgEeaCL_jN4Rh9Ew" target="_fupjOtNgEeaCL_jN4Rh9Ew"> + <styles xmi:type="notation:FontStyle" xmi:id="_fupjP9NgEeaCL_jN4Rh9Ew"/> + <styles xmi:type="notation:EObjectValueStyle" xmi:id="_fuqKQtNgEeaCL_jN4Rh9Ew" name="BASE_ELEMENT"> + <eObjectValue xmi:type="uml:Port" href="exclusions.uml#_fuekENNgEeaCL_jN4Rh9Ew"/> + </styles> + <element xsi:nil="true"/> + <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_fupjQNNgEeaCL_jN4Rh9Ew" points="[0, 0, 0, 0]$[0, 0, 0, 0]"/> + <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_fuqKQNNgEeaCL_jN4Rh9Ew"/> + <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_fuqKQdNgEeaCL_jN4Rh9Ew"/> + </edges> + <edges xmi:type="notation:Connector" xmi:id="_ikgWANNgEeaCL_jN4Rh9Ew" type="Connector_Edge" source="_ay1wgNNgEeaCL_jN4Rh9Ew" target="_fukDoNNgEeaCL_jN4Rh9Ew"> + <children xmi:type="notation:DecorationNode" xmi:id="_ikg9ENNgEeaCL_jN4Rh9Ew" type="Connector_StereotypeLabel"> + <layoutConstraint xmi:type="notation:Location" xmi:id="_ikg9EdNgEeaCL_jN4Rh9Ew" y="60"/> + </children> + <children xmi:type="notation:DecorationNode" xmi:id="_ikg9EtNgEeaCL_jN4Rh9Ew" type="Connector_NameLabel"> + <layoutConstraint xmi:type="notation:Location" xmi:id="_ikg9E9NgEeaCL_jN4Rh9Ew" y="-20"/> + </children> + <styles xmi:type="notation:FontStyle" xmi:id="_ikgWAdNgEeaCL_jN4Rh9Ew"/> + <element xmi:type="uml:Connector" href="exclusions.uml#_ikSTkNNgEeaCL_jN4Rh9Ew"/> + <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_ikgWAtNgEeaCL_jN4Rh9Ew" points="[48, 142, -643984, -643984]$[266, 198, -643984, -643984]"/> + </edges> + <edges xmi:type="notation:Connector" xmi:id="_ikw0tNNgEeaCL_jN4Rh9Ew" type="StereotypeCommentLink" source="_ikgWANNgEeaCL_jN4Rh9Ew" target="_ikw0sNNgEeaCL_jN4Rh9Ew"> + <styles xmi:type="notation:FontStyle" xmi:id="_ikw0tdNgEeaCL_jN4Rh9Ew"/> + <styles xmi:type="notation:EObjectValueStyle" xmi:id="_ikxbwNNgEeaCL_jN4Rh9Ew" name="BASE_ELEMENT"> + <eObjectValue xmi:type="uml:Connector" href="exclusions.uml#_ikSTkNNgEeaCL_jN4Rh9Ew"/> + </styles> + <element xsi:nil="true"/> + <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_ikw0ttNgEeaCL_jN4Rh9Ew" points="[0, 0, 0, 0]$[0, 0, 0, 0]"/> + <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_ikw0t9NgEeaCL_jN4Rh9Ew"/> + <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_ikw0uNNgEeaCL_jN4Rh9Ew"/> + </edges> + </notation:Diagram> + <notation:Diagram xmi:id="_ct6WENNgEeaCL_jN4Rh9Ew" type="CompositeStructure" measurementUnit="Pixel"> + <children xmi:type="notation:Shape" xmi:id="_ct6WFNNgEeaCL_jN4Rh9Ew" type="Class_Shape"> + <children xmi:type="notation:DecorationNode" xmi:id="_ct6WFtNgEeaCL_jN4Rh9Ew" type="Class_NameLabel"/> + <children xmi:type="notation:DecorationNode" xmi:id="_ct6WF9NgEeaCL_jN4Rh9Ew" type="Class_FloatingNameLabel"> + <layoutConstraint xmi:type="notation:Location" xmi:id="_ct6WGNNgEeaCL_jN4Rh9Ew" y="5"/> + </children> + <children xmi:type="notation:BasicCompartment" xmi:id="_ct6WGdNgEeaCL_jN4Rh9Ew" type="Class_StructureCompartment"> + <styles xmi:type="notation:TitleStyle" xmi:id="_ct6WGtNgEeaCL_jN4Rh9Ew"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_ct6WG9NgEeaCL_jN4Rh9Ew"/> + </children> + <children xmi:type="notation:Shape" xmi:id="_fuhAUNNgEeaCL_jN4Rh9Ew" type="Port_Shape"> + <children xmi:type="notation:DecorationNode" xmi:id="_fuhAUtNgEeaCL_jN4Rh9Ew" type="Port_NameLabel"> + <layoutConstraint xmi:type="notation:Location" xmi:id="_fuhAU9NgEeaCL_jN4Rh9Ew" x="25" y="3"/> + </children> + <children xmi:type="notation:DecorationNode" xmi:id="_fuhAVNNgEeaCL_jN4Rh9Ew" type="Port_StereotypeLabel"> + <layoutConstraint xmi:type="notation:Location" xmi:id="_fuhAVdNgEeaCL_jN4Rh9Ew" x="25" y="-10"/> + </children> + <element xmi:type="uml:Port" href="exclusions.uml#_fuekENNgEeaCL_jN4Rh9Ew"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_fuhAUdNgEeaCL_jN4Rh9Ew" y="125" width="16" height="16"/> + </children> + <element xmi:type="uml:Class" href="exclusions.uml#_ctuI0NNgEeaCL_jN4Rh9Ew"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_ct6WFdNgEeaCL_jN4Rh9Ew" x="40" y="40" width="500" height="250"/> + </children> + <styles xmi:type="notation:StringValueStyle" xmi:id="_ct6WEdNgEeaCL_jN4Rh9Ew" name="diagram_compatibility_version" stringValue="1.2.0"/> + <styles xmi:type="notation:DiagramStyle" xmi:id="_ct6WEtNgEeaCL_jN4Rh9Ew"/> + <styles xmi:type="style:PapyrusViewStyle" xmi:id="_ct6WE9NgEeaCL_jN4Rh9Ew"> + <owner xmi:type="uml:Class" href="exclusions.uml#_ctuI0NNgEeaCL_jN4Rh9Ew"/> + <configuration xmi:type="configuration:PapyrusDiagram" href="platform:/plugin/org.eclipse.papyrusrt.umlrt.tooling.diagram.common/configuration/UMLRT.configuration#_Z79eQHcZEeSnWeKqQOfW2A"/> + </styles> + <element xmi:type="uml:Class" href="exclusions.uml#_ctuI0NNgEeaCL_jN4Rh9Ew"/> + </notation:Diagram> + <notation:Diagram xmi:id="_3vB9kNNhEea0HKbsdbhZXw" type="CompositeStructure" measurementUnit="Pixel"> + <children xmi:type="notation:Shape" xmi:id="_3vFA4NNhEea0HKbsdbhZXw" type="Class_Shape"> + <children xmi:type="notation:DecorationNode" xmi:id="_3vG2ENNhEea0HKbsdbhZXw" type="Class_NameLabel"/> + <children xmi:type="notation:DecorationNode" xmi:id="_3vHdINNhEea0HKbsdbhZXw" type="Class_FloatingNameLabel"> + <layoutConstraint xmi:type="notation:Location" xmi:id="_3vHdIdNhEea0HKbsdbhZXw" y="5"/> + </children> + <children xmi:type="notation:BasicCompartment" xmi:id="_3vHdItNhEea0HKbsdbhZXw" type="Class_StructureCompartment"> + <styles xmi:type="notation:TitleStyle" xmi:id="_3vHdI9NhEea0HKbsdbhZXw"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_3vHdJNNhEea0HKbsdbhZXw"/> + </children> + <element xmi:type="uml:Class" href="exclusions.uml#_3rRe8NNhEea0HKbsdbhZXw"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_3vFA4dNhEea0HKbsdbhZXw" x="40" y="40" width="500" height="250"/> + </children> + <children xmi:type="notation:Shape" xmi:id="_4QcokNNhEea0HKbsdbhZXw" type="StereotypeComment"> + <styles xmi:type="notation:TitleStyle" xmi:id="_4QcokdNhEea0HKbsdbhZXw"/> + <styles xmi:type="notation:EObjectValueStyle" xmi:id="_4QdPoNNhEea0HKbsdbhZXw" name="BASE_ELEMENT"> + <eObjectValue xmi:type="uml:Class" href="exclusions.uml#_3rRe8NNhEea0HKbsdbhZXw"/> + </styles> + <element xsi:nil="true"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_4QcoktNhEea0HKbsdbhZXw" x="240" y="40"/> + </children> + <styles xmi:type="notation:StringValueStyle" xmi:id="_3vCkoNNhEea0HKbsdbhZXw" name="diagram_compatibility_version" stringValue="1.2.0"/> + <styles xmi:type="notation:DiagramStyle" xmi:id="_3vCkodNhEea0HKbsdbhZXw"/> + <styles xmi:type="style:PapyrusViewStyle" xmi:id="_3vCkotNhEea0HKbsdbhZXw"> + <owner xmi:type="uml:Class" href="exclusions.uml#_3rRe8NNhEea0HKbsdbhZXw"/> + <configuration xmi:type="configuration:PapyrusDiagram" href="platform:/plugin/org.eclipse.papyrusrt.umlrt.tooling.diagram.common/configuration/UMLRT.configuration#_Z79eQHcZEeSnWeKqQOfW2A"/> + </styles> + <element xmi:type="uml:Class" href="exclusions.uml#_3rRe8NNhEea0HKbsdbhZXw"/> + <edges xmi:type="notation:Connector" xmi:id="_4QdPodNhEea0HKbsdbhZXw" type="StereotypeCommentLink" source="_3vFA4NNhEea0HKbsdbhZXw" target="_4QcokNNhEea0HKbsdbhZXw"> + <styles xmi:type="notation:FontStyle" xmi:id="_4QdPotNhEea0HKbsdbhZXw"/> + <styles xmi:type="notation:EObjectValueStyle" xmi:id="_4Qd2stNhEea0HKbsdbhZXw" name="BASE_ELEMENT"> + <eObjectValue xmi:type="uml:Class" href="exclusions.uml#_3rRe8NNhEea0HKbsdbhZXw"/> + </styles> + <element xsi:nil="true"/> + <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_4QdPo9NhEea0HKbsdbhZXw" points="[0, 0, 0, 0]$[0, 0, 0, 0]"/> + <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_4Qd2sNNhEea0HKbsdbhZXw"/> + <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_4Qd2sdNhEea0HKbsdbhZXw"/> + </edges> + </notation:Diagram> +</xmi:XMI> diff --git a/tests/junit/umlrt/core/org.eclipse.papyrusrt.umlrt.core.tests/resource/exclusions.uml b/tests/junit/umlrt/core/org.eclipse.papyrusrt.umlrt.core.tests/resource/exclusions.uml new file mode 100644 index 000000000..b104a1419 --- /dev/null +++ b/tests/junit/umlrt/core/org.eclipse.papyrusrt.umlrt.core.tests/resource/exclusions.uml @@ -0,0 +1,90 @@ +<?xml version="1.0" encoding="UTF-8"?> +<xmi:XMI xmi:version="20131001" xmlns:xmi="http://www.omg.org/spec/XMI/20131001" xmlns:UMLRealTime="http://www.eclipse.org/papyrus/umlrt" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" xmlns:uml="http://www.eclipse.org/uml2/5.0.0/UML"> + <uml:Model xmi:id="_85OccNNfEeaCL_jN4Rh9Ew" name="exclusions"> + <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_wEUxINNgEeaCL_jN4Rh9Ew" source="http://www.eclipse.org/papyrus-rt/language/1.0.0"> + <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_wEVYMNNgEeaCL_jN4Rh9Ew" key="language" value="umlrt-cpp"/> + </eAnnotations> + <packagedElement xmi:type="uml:Class" xmi:id="_Yg5jENNgEeaCL_jN4Rh9Ew" name="Capsule1" isActive="true"> + <ownedAttribute xmi:type="uml:Port" xmi:id="_aOzPUNNgEeaCL_jN4Rh9Ew" name="protocol1" visibility="public" type="_amy4kNNgEeaCL_jN4Rh9Ew" isOrdered="true" aggregation="composite" isBehavior="false" isService="true"/> + <ownedAttribute xmi:type="uml:Property" xmi:id="_cYJhcNNgEeaCL_jN4Rh9Ew" name="capsule2" visibility="protected" type="_ctuI0NNgEeaCL_jN4Rh9Ew" isOrdered="true" aggregation="composite"/> + <ownedConnector xmi:type="uml:Connector" xmi:id="_ikSTkNNgEeaCL_jN4Rh9Ew" name="RTConnector1"> + <end xmi:type="uml:ConnectorEnd" xmi:id="_ikXzINNgEeaCL_jN4Rh9Ew" role="_aOzPUNNgEeaCL_jN4Rh9Ew"/> + <end xmi:type="uml:ConnectorEnd" xmi:id="_ikXzIdNgEeaCL_jN4Rh9Ew" partWithPort="_cYJhcNNgEeaCL_jN4Rh9Ew" role="_fuekENNgEeaCL_jN4Rh9Ew"/> + </ownedConnector> + </packagedElement> + <packagedElement xmi:type="uml:Package" xmi:id="_am0GsNNgEeaCL_jN4Rh9Ew" name="Protocol1"> + <packagedElement xmi:type="uml:Collaboration" xmi:id="_amy4kNNgEeaCL_jN4Rh9Ew" name="Protocol1"> + <interfaceRealization xmi:type="uml:InterfaceRealization" xmi:id="_am3xENNgEeaCL_jN4Rh9Ew" client="_amy4kNNgEeaCL_jN4Rh9Ew" supplier="_am174NNgEeaCL_jN4Rh9Ew" contract="_am174NNgEeaCL_jN4Rh9Ew"/> + <interfaceRealization xmi:type="uml:InterfaceRealization" xmi:id="_am8CgNNgEeaCL_jN4Rh9Ew" client="_amy4kNNgEeaCL_jN4Rh9Ew" supplier="_am6NUdNgEeaCL_jN4Rh9Ew" contract="_am6NUdNgEeaCL_jN4Rh9Ew"/> + </packagedElement> + <packagedElement xmi:type="uml:Interface" xmi:id="_am174NNgEeaCL_jN4Rh9Ew" name="Protocol1"> + <ownedOperation xmi:type="uml:Operation" xmi:id="_xT47kNNgEeaCL_jN4Rh9Ew" name="greet"> + <ownedParameter xmi:type="uml:Parameter" xmi:id="_xw_HQNNgEeaCL_jN4Rh9Ew" name="data"> + <type xmi:type="uml:PrimitiveType" href="pathmap://PapyrusC_Cpp_LIBRARIES/AnsiCLibrary.uml#_5lVhgBydEduyofBvg4RL2w"/> + <lowerValue xmi:type="uml:LiteralInteger" xmi:id="_3iqyANNgEeaCL_jN4Rh9Ew" value="0"/> + <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_3iyt0NNgEeaCL_jN4Rh9Ew" value="32"/> + </ownedParameter> + </ownedOperation> + </packagedElement> + <packagedElement xmi:type="uml:Interface" xmi:id="_am4YINNgEeaCL_jN4Rh9Ew" name="Protocol1~"/> + <packagedElement xmi:type="uml:Usage" xmi:id="_am5mQNNgEeaCL_jN4Rh9Ew" client="_amy4kNNgEeaCL_jN4Rh9Ew" supplier="_am4YINNgEeaCL_jN4Rh9Ew"/> + <packagedElement xmi:type="uml:AnyReceiveEvent" xmi:id="_am6NUNNgEeaCL_jN4Rh9Ew" name="*"/> + <packagedElement xmi:type="uml:Interface" xmi:id="_am6NUdNgEeaCL_jN4Rh9Ew" name="Protocol1IO"/> + <packagedElement xmi:type="uml:Usage" xmi:id="_am8pkNNgEeaCL_jN4Rh9Ew" client="_amy4kNNgEeaCL_jN4Rh9Ew" supplier="_am6NUdNgEeaCL_jN4Rh9Ew"/> + </packagedElement> + <packagedElement xmi:type="uml:Class" xmi:id="_ctuI0NNgEeaCL_jN4Rh9Ew" name="Capsule2" isActive="true"> + <ownedAttribute xmi:type="uml:Port" xmi:id="_fuekENNgEeaCL_jN4Rh9Ew" name="protocol1" visibility="public" type="_amy4kNNgEeaCL_jN4Rh9Ew" isOrdered="true" aggregation="composite" isBehavior="true" isService="true"/> + </packagedElement> + <packagedElement xmi:type="uml:Class" xmi:id="_3rRe8NNhEea0HKbsdbhZXw" name="Capsule3" isActive="true"> + <generalization xmi:type="uml:Generalization" xmi:id="__E8bMNNhEea0HKbsdbhZXw" general="_Yg5jENNgEeaCL_jN4Rh9Ew"/> + </packagedElement> + <packagedElement xmi:type="uml:Package" xmi:id="_6A4EYNNhEea0HKbsdbhZXw" name="Protocol2"> + <packagedElement xmi:type="uml:Collaboration" xmi:id="_6AuTYNNhEea0HKbsdbhZXw" name="Protocol2"> + <generalization xmi:type="uml:Generalization" xmi:id="_8iEOwNNhEea0HKbsdbhZXw" general="_amy4kNNgEeaCL_jN4Rh9Ew"/> + <interfaceRealization xmi:type="uml:InterfaceRealization" xmi:id="_6BBOUNNhEea0HKbsdbhZXw" client="_6AuTYNNhEea0HKbsdbhZXw" supplier="_6A884NNhEea0HKbsdbhZXw" contract="_6A884NNhEea0HKbsdbhZXw"/> + <interfaceRealization xmi:type="uml:InterfaceRealization" xmi:id="_6BK_UNNhEea0HKbsdbhZXw" client="_6AuTYNNhEea0HKbsdbhZXw" supplier="_6BH8ANNhEea0HKbsdbhZXw" contract="_6BH8ANNhEea0HKbsdbhZXw"/> + </packagedElement> + <packagedElement xmi:type="uml:Interface" xmi:id="_6A884NNhEea0HKbsdbhZXw" name="Protocol2"> + <generalization xmi:type="uml:Generalization" xmi:id="_8iKVYNNhEea0HKbsdbhZXw" general="_am174NNgEeaCL_jN4Rh9Ew"/> + </packagedElement> + <packagedElement xmi:type="uml:Interface" xmi:id="_6BDDgNNhEea0HKbsdbhZXw" name="Protocol2~"> + <generalization xmi:type="uml:Generalization" xmi:id="_8iTfUNNhEea0HKbsdbhZXw" general="_am4YINNgEeaCL_jN4Rh9Ew"/> + </packagedElement> + <packagedElement xmi:type="uml:Usage" xmi:id="_6BGt4NNhEea0HKbsdbhZXw" client="_6AuTYNNhEea0HKbsdbhZXw" supplier="_6BDDgNNhEea0HKbsdbhZXw"/> + <packagedElement xmi:type="uml:AnyReceiveEvent" xmi:id="_6BHU8NNhEea0HKbsdbhZXw" name="*"/> + <packagedElement xmi:type="uml:Interface" xmi:id="_6BH8ANNhEea0HKbsdbhZXw" name="Protocol2IO"> + <generalization xmi:type="uml:Generalization" xmi:id="_8iUGYNNhEea0HKbsdbhZXw" general="_am6NUdNgEeaCL_jN4Rh9Ew"/> + </packagedElement> + <packagedElement xmi:type="uml:Usage" xmi:id="_6BMNcNNhEea0HKbsdbhZXw" client="_6AuTYNNhEea0HKbsdbhZXw" supplier="_6BH8ANNhEea0HKbsdbhZXw"/> + </packagedElement> + <profileApplication xmi:type="uml:ProfileApplication" xmi:id="_85neANNfEeaCL_jN4Rh9Ew"> + <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_85pTMNNfEeaCL_jN4Rh9Ew" source="http://www.eclipse.org/uml2/2.0.0/UML"> + <references xmi:type="ecore:EPackage" href="http://www.eclipse.org/papyrus/umlrt#/"/> + </eAnnotations> + <appliedProfile xmi:type="uml:Profile" href="pathmap://UML_RT_PROFILE/uml-rt.profile.uml#_1h74oEeVEeO0lv5O1DTHOQ"/> + </profileApplication> + <profileApplication xmi:type="uml:ProfileApplication" xmi:id="_wFJQgNNgEeaCL_jN4Rh9Ew"> + <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_wFJQgdNgEeaCL_jN4Rh9Ew" source="http://www.eclipse.org/uml2/2.0.0/UML"> + <references xmi:type="ecore:EPackage" href="http://www.eclipse.org/papyrus/umlrt/cppproperties#/"/> + </eAnnotations> + <appliedProfile xmi:type="uml:Profile" href="pathmap://UMLRT_CPP/RTCppProperties.profile.uml#_vl5LALs8EeSTjNEQkASznQ"/> + </profileApplication> + </uml:Model> + <UMLRealTime:Capsule xmi:id="_YiyZcNNgEeaCL_jN4Rh9Ew" base_Class="_Yg5jENNgEeaCL_jN4Rh9Ew"/> + <UMLRealTime:RTPort xmi:id="_aO1EgNNgEeaCL_jN4Rh9Ew" isPublish="false" isWired="true" base_Port="_aOzPUNNgEeaCL_jN4Rh9Ew"/> + <UMLRealTime:ProtocolContainer xmi:id="_am1U0NNgEeaCL_jN4Rh9Ew" base_Package="_am0GsNNgEeaCL_jN4Rh9Ew"/> + <UMLRealTime:RTMessageSet xmi:id="_am2i8NNgEeaCL_jN4Rh9Ew" base_Interface="_am174NNgEeaCL_jN4Rh9Ew"/> + <UMLRealTime:RTMessageSet xmi:id="_am4_MNNgEeaCL_jN4Rh9Ew" base_Interface="_am4YINNgEeaCL_jN4Rh9Ew" rtMsgKind="out"/> + <UMLRealTime:RTMessageSet xmi:id="_am60YNNgEeaCL_jN4Rh9Ew" base_Interface="_am6NUdNgEeaCL_jN4Rh9Ew" rtMsgKind="inOut"/> + <UMLRealTime:Protocol xmi:id="_am9QoNNgEeaCL_jN4Rh9Ew" base_Collaboration="_amy4kNNgEeaCL_jN4Rh9Ew"/> + <UMLRealTime:CapsulePart xmi:id="_cYPBANNgEeaCL_jN4Rh9Ew" base_Property="_cYJhcNNgEeaCL_jN4Rh9Ew"/> + <UMLRealTime:Capsule xmi:id="_ct69INNgEeaCL_jN4Rh9Ew" base_Class="_ctuI0NNgEeaCL_jN4Rh9Ew"/> + <UMLRealTime:RTPort xmi:id="_fufyMNNgEeaCL_jN4Rh9Ew" isPublish="false" isWired="true" base_Port="_fuekENNgEeaCL_jN4Rh9Ew"/> + <UMLRealTime:RTConnector xmi:id="_ikYaMNNgEeaCL_jN4Rh9Ew" base_Connector="_ikSTkNNgEeaCL_jN4Rh9Ew"/> + <UMLRealTime:Capsule xmi:id="_3vJ5YNNhEea0HKbsdbhZXw" base_Class="_3rRe8NNhEea0HKbsdbhZXw"/> + <UMLRealTime:ProtocolContainer xmi:id="_6A6goNNhEea0HKbsdbhZXw" base_Package="_6A4EYNNhEea0HKbsdbhZXw"/> + <UMLRealTime:RTMessageSet xmi:id="_6BAAMNNhEea0HKbsdbhZXw" base_Interface="_6A884NNhEea0HKbsdbhZXw"/> + <UMLRealTime:RTMessageSet xmi:id="_6BFfwNNhEea0HKbsdbhZXw" base_Interface="_6BDDgNNhEea0HKbsdbhZXw" rtMsgKind="out"/> + <UMLRealTime:RTMessageSet xmi:id="_6BKYQNNhEea0HKbsdbhZXw" base_Interface="_6BH8ANNhEea0HKbsdbhZXw" rtMsgKind="inOut"/> + <UMLRealTime:Protocol xmi:id="_6BM0gNNhEea0HKbsdbhZXw" base_Collaboration="_6AuTYNNhEea0HKbsdbhZXw"/> +</xmi:XMI> diff --git a/tests/junit/umlrt/core/org.eclipse.papyrusrt.umlrt.core.tests/resource/inheritance/connectors.di b/tests/junit/umlrt/core/org.eclipse.papyrusrt.umlrt.core.tests/resource/inheritance/connectors.di new file mode 100644 index 000000000..bf9abab34 --- /dev/null +++ b/tests/junit/umlrt/core/org.eclipse.papyrusrt.umlrt.core.tests/resource/inheritance/connectors.di @@ -0,0 +1,2 @@ +<?xml version="1.0" encoding="UTF-8"?> +<xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"/> diff --git a/tests/junit/umlrt/core/org.eclipse.papyrusrt.umlrt.core.tests/resource/inheritance/connectors.notation b/tests/junit/umlrt/core/org.eclipse.papyrusrt.umlrt.core.tests/resource/inheritance/connectors.notation new file mode 100644 index 000000000..708c3577a --- /dev/null +++ b/tests/junit/umlrt/core/org.eclipse.papyrusrt.umlrt.core.tests/resource/inheritance/connectors.notation @@ -0,0 +1,315 @@ +<?xml version="1.0" encoding="UTF-8"?> +<xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:configuration="http://www.eclipse.org/papyrus/infra/viewpoints/configuration" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" xmlns:notation="http://www.eclipse.org/gmf/runtime/1.0.2/notation" xmlns:style="http://www.eclipse.org/papyrus/infra/viewpoints/policy/style" xmlns:uml="http://www.eclipse.org/uml2/5.0.0/UML"> + <notation:Diagram xmi:id="_cZ1jkKaqEeaVuqljGw-fqQ" type="CompositeStructure" measurementUnit="Pixel"> + <children xmi:type="notation:Shape" xmi:id="_caQaUKaqEeaVuqljGw-fqQ" type="Class_Shape"> + <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_VG04ELp2EeaV0fVWRP8bJg" source="PapyrusCSSForceValue"> + <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_VG04Ebp2EeaV0fVWRP8bJg" key="mutable" value="true"/> + </eAnnotations> + <children xmi:type="notation:DecorationNode" xmi:id="_caTdoKaqEeaVuqljGw-fqQ" type="Class_NameLabel"/> + <children xmi:type="notation:DecorationNode" xmi:id="_caTdoaaqEeaVuqljGw-fqQ" type="Class_FloatingNameLabel"> + <layoutConstraint xmi:type="notation:Location" xmi:id="_caTdoqaqEeaVuqljGw-fqQ" y="5"/> + </children> + <children xmi:type="notation:BasicCompartment" xmi:id="_caUEsKaqEeaVuqljGw-fqQ" type="Class_StructureCompartment"> + <children xmi:type="notation:Shape" xmi:id="_cjYwQLp2EeaV0fVWRP8bJg" type="Property_Shape"> + <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_d7dWcLp2EeaV0fVWRP8bJg" source="PapyrusCSSForceValue"> + <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_d7dWcbp2EeaV0fVWRP8bJg" key="mutable" value="true"/> + </eAnnotations> + <children xmi:type="notation:DecorationNode" xmi:id="_cjZXULp2EeaV0fVWRP8bJg" type="Property_NameLabel"/> + <children xmi:type="notation:DecorationNode" xmi:id="_cjZXUbp2EeaV0fVWRP8bJg" type="Property_FloatingNameLabel"> + <layoutConstraint xmi:type="notation:Location" xmi:id="_cjZXUrp2EeaV0fVWRP8bJg" y="5"/> + </children> + <children xmi:type="notation:BasicCompartment" xmi:id="_cjZXU7p2EeaV0fVWRP8bJg" type="Property_StructureCompartment"> + <styles xmi:type="notation:TitleStyle" xmi:id="_cjZXVLp2EeaV0fVWRP8bJg"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_cjZXVbp2EeaV0fVWRP8bJg"/> + </children> + <children xmi:type="notation:DecorationNode" xmi:id="_cjh6MLp2EeaV0fVWRP8bJg" type="StereotypeLabel"> + <styles xmi:type="notation:StringValueStyle" xmi:id="_cjh6Mbp2EeaV0fVWRP8bJg" name="stereotype" stringValue="UMLRealTime::CapsulePart"/> + <element xmi:type="uml:Stereotype" href="pathmap://UML_RT_PROFILE/uml-rt.profile.uml#_EQwT4EhOEeO0lv5O1DTHOQ"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_cjh6Mrp2EeaV0fVWRP8bJg"/> + </children> + <children xmi:type="notation:BasicCompartment" xmi:id="_cjihQLp2EeaV0fVWRP8bJg" type="StereotypeBrace"> + <styles xmi:type="notation:TitleStyle" xmi:id="_cjihQbp2EeaV0fVWRP8bJg"/> + <styles xmi:type="notation:StringValueStyle" xmi:id="_cjihQrp2EeaV0fVWRP8bJg" name="stereotype" stringValue="UMLRealTime::CapsulePart"/> + <element xmi:type="uml:Stereotype" href="pathmap://UML_RT_PROFILE/uml-rt.profile.uml#_EQwT4EhOEeO0lv5O1DTHOQ"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_cjihQ7p2EeaV0fVWRP8bJg"/> + </children> + <children xmi:type="notation:BasicCompartment" xmi:id="_cjihRLp2EeaV0fVWRP8bJg" type="compartment_shape_display"> + <styles xmi:type="notation:TitleStyle" xmi:id="_cjihRbp2EeaV0fVWRP8bJg"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_cjihRrp2EeaV0fVWRP8bJg"/> + </children> + <children xmi:type="notation:BasicCompartment" xmi:id="_cjjvYLp2EeaV0fVWRP8bJg" type="StereotypeCompartment"> + <styles xmi:type="notation:TitleStyle" xmi:id="_cjjvYbp2EeaV0fVWRP8bJg"/> + <styles xmi:type="notation:StringValueStyle" xmi:id="_cjjvYrp2EeaV0fVWRP8bJg" name="stereotype" stringValue="UMLRealTime::CapsulePart"/> + <element xmi:type="uml:Stereotype" href="pathmap://UML_RT_PROFILE/uml-rt.profile.uml#_EQwT4EhOEeO0lv5O1DTHOQ"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_cjjvY7p2EeaV0fVWRP8bJg"/> + </children> + <children xmi:type="notation:Shape" xmi:id="_d5mVQLp2EeaV0fVWRP8bJg" type="Port_Shape"> + <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_d7d9gLp2EeaV0fVWRP8bJg" source="PapyrusCSSForceValue"> + <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_d7d9gbp2EeaV0fVWRP8bJg" key="mutable" value="true"/> + </eAnnotations> + <children xmi:type="notation:DecorationNode" xmi:id="_d5mVQrp2EeaV0fVWRP8bJg" type="Port_NameLabel"> + <layoutConstraint xmi:type="notation:Location" xmi:id="_d5mVQ7p2EeaV0fVWRP8bJg" x="25" y="3"/> + </children> + <children xmi:type="notation:DecorationNode" xmi:id="_d5mVRLp2EeaV0fVWRP8bJg" type="Port_StereotypeLabel"> + <layoutConstraint xmi:type="notation:Location" xmi:id="_d5mVRbp2EeaV0fVWRP8bJg" x="25" y="-10"/> + </children> + <element xmi:type="uml:Port" href="connectors.uml#_dVF6ALp2EeaV0fVWRP8bJg"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_d5mVQbp2EeaV0fVWRP8bJg" x="-5" y="16" width="11" height="11"/> + </children> + <element xmi:type="uml:Property" href="connectors.uml#_cisMsLp2EeaV0fVWRP8bJg"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_cjYwQbp2EeaV0fVWRP8bJg" x="125" y="46"/> + </children> + <children xmi:type="notation:Shape" xmi:id="_cjjIULp2EeaV0fVWRP8bJg" type="StereotypeComment"> + <styles xmi:type="notation:TitleStyle" xmi:id="_cjjIUbp2EeaV0fVWRP8bJg"/> + <styles xmi:type="notation:EObjectValueStyle" xmi:id="_cjjIU7p2EeaV0fVWRP8bJg" name="BASE_ELEMENT"> + <eObjectValue xmi:type="uml:Property" href="connectors.uml#_cisMsLp2EeaV0fVWRP8bJg"/> + </styles> + <element xsi:nil="true"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_cjjIUrp2EeaV0fVWRP8bJg" x="325" y="46"/> + </children> + <children xmi:type="notation:Shape" xmi:id="_d5p_oLp2EeaV0fVWRP8bJg" type="StereotypeComment"> + <styles xmi:type="notation:TitleStyle" xmi:id="_d5p_obp2EeaV0fVWRP8bJg"/> + <styles xmi:type="notation:EObjectValueStyle" xmi:id="_d5p_o7p2EeaV0fVWRP8bJg" name="BASE_ELEMENT"> + <eObjectValue xmi:type="uml:Port" href="connectors.uml#_dVF6ALp2EeaV0fVWRP8bJg"/> + </styles> + <element xsi:nil="true"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_d5p_orp2EeaV0fVWRP8bJg" x="194" y="-6"/> + </children> + <styles xmi:type="notation:TitleStyle" xmi:id="_caUEsaaqEeaVuqljGw-fqQ"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_caUEsqaqEeaVuqljGw-fqQ"/> + </children> + <children xmi:type="notation:DecorationNode" xmi:id="_VB7xALp2EeaV0fVWRP8bJg" type="StereotypeLabel"> + <styles xmi:type="notation:StringValueStyle" xmi:id="_VB7xAbp2EeaV0fVWRP8bJg" name="stereotype" stringValue="UMLRealTime::Capsule"/> + <element xmi:type="uml:Stereotype" href="pathmap://UML_RT_PROFILE/uml-rt.profile.uml#_hcMIwEhNEeO0lv5O1DTHOQ"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_VB7xArp2EeaV0fVWRP8bJg"/> + </children> + <children xmi:type="notation:BasicCompartment" xmi:id="_VB8YELp2EeaV0fVWRP8bJg" type="StereotypeBrace"> + <styles xmi:type="notation:TitleStyle" xmi:id="_VB8YEbp2EeaV0fVWRP8bJg"/> + <styles xmi:type="notation:StringValueStyle" xmi:id="_VB8YErp2EeaV0fVWRP8bJg" name="stereotype" stringValue="UMLRealTime::Capsule"/> + <element xmi:type="uml:Stereotype" href="pathmap://UML_RT_PROFILE/uml-rt.profile.uml#_hcMIwEhNEeO0lv5O1DTHOQ"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_VB8YE7p2EeaV0fVWRP8bJg"/> + </children> + <children xmi:type="notation:BasicCompartment" xmi:id="_VB8_ILp2EeaV0fVWRP8bJg" type="compartment_shape_display"> + <styles xmi:type="notation:TitleStyle" xmi:id="_VB8_Ibp2EeaV0fVWRP8bJg"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_VB8_Irp2EeaV0fVWRP8bJg"/> + </children> + <children xmi:type="notation:BasicCompartment" xmi:id="_VB9mOrp2EeaV0fVWRP8bJg" type="StereotypeCompartment"> + <styles xmi:type="notation:TitleStyle" xmi:id="_VB9mO7p2EeaV0fVWRP8bJg"/> + <styles xmi:type="notation:StringValueStyle" xmi:id="_VB-NQLp2EeaV0fVWRP8bJg" name="stereotype" stringValue="UMLRealTime::Capsule"/> + <element xmi:type="uml:Stereotype" href="pathmap://UML_RT_PROFILE/uml-rt.profile.uml#_hcMIwEhNEeO0lv5O1DTHOQ"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_VB-NQbp2EeaV0fVWRP8bJg"/> + </children> + <children xmi:type="notation:Shape" xmi:id="_VB-0ULp2EeaV0fVWRP8bJg" type="Port_Shape"> + <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_VG04Erp2EeaV0fVWRP8bJg" source="PapyrusCSSForceValue"> + <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_VG04E7p2EeaV0fVWRP8bJg" key="mutable" value="true"/> + </eAnnotations> + <children xmi:type="notation:DecorationNode" xmi:id="_VB-0Urp2EeaV0fVWRP8bJg" type="Port_NameLabel"> + <layoutConstraint xmi:type="notation:Location" xmi:id="_VB-0U7p2EeaV0fVWRP8bJg" x="25" y="3"/> + </children> + <children xmi:type="notation:DecorationNode" xmi:id="_VB-0VLp2EeaV0fVWRP8bJg" type="Port_StereotypeLabel"> + <layoutConstraint xmi:type="notation:Location" xmi:id="_VB-0Vbp2EeaV0fVWRP8bJg" x="25" y="-10"/> + </children> + <element xmi:type="uml:Port" href="connectors.uml#_uFmasKaqEeaVuqljGw-fqQ"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_VB-0Ubp2EeaV0fVWRP8bJg" x="-8" y="117" width="16" height="16"/> + </children> + <children xmi:type="notation:Shape" xmi:id="_VB_bYLp2EeaV0fVWRP8bJg" type="Port_Shape"> + <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_VG04FLp2EeaV0fVWRP8bJg" source="PapyrusCSSForceValue"> + <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_VG04Fbp2EeaV0fVWRP8bJg" key="mutable" value="true"/> + </eAnnotations> + <children xmi:type="notation:DecorationNode" xmi:id="_VB_bYrp2EeaV0fVWRP8bJg" type="Port_NameLabel"> + <layoutConstraint xmi:type="notation:Location" xmi:id="_VB_bY7p2EeaV0fVWRP8bJg" x="25" y="3"/> + </children> + <children xmi:type="notation:DecorationNode" xmi:id="_VB_bZLp2EeaV0fVWRP8bJg" type="Port_StereotypeLabel"> + <layoutConstraint xmi:type="notation:Location" xmi:id="_VB_bZbp2EeaV0fVWRP8bJg" x="25" y="-10"/> + </children> + <element xmi:type="uml:Port" href="connectors.uml#_0JPYIKaqEeaVuqljGw-fqQ"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_VB_bYbp2EeaV0fVWRP8bJg" x="-8" y="140" width="16" height="16"/> + </children> + <element xmi:type="uml:Class" href="connectors.uml#_cUZp8KaqEeaVuqljGw-fqQ"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_caQaUaaqEeaVuqljGw-fqQ" x="40" y="40" width="500" height="250"/> + </children> + <children xmi:type="notation:Shape" xmi:id="_VB8_I7p2EeaV0fVWRP8bJg" type="StereotypeComment"> + <styles xmi:type="notation:TitleStyle" xmi:id="_VB8_JLp2EeaV0fVWRP8bJg"/> + <styles xmi:type="notation:EObjectValueStyle" xmi:id="_VB8_Jrp2EeaV0fVWRP8bJg" name="BASE_ELEMENT"> + <eObjectValue xmi:type="uml:Class" href="connectors.uml#_cUZp8KaqEeaVuqljGw-fqQ"/> + </styles> + <element xsi:nil="true"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_VB8_Jbp2EeaV0fVWRP8bJg" x="240" y="40"/> + </children> + <children xmi:type="notation:Shape" xmi:id="_VCCesrp2EeaV0fVWRP8bJg" type="StereotypeComment"> + <styles xmi:type="notation:TitleStyle" xmi:id="_VCCes7p2EeaV0fVWRP8bJg"/> + <styles xmi:type="notation:EObjectValueStyle" xmi:id="_VCCetbp2EeaV0fVWRP8bJg" name="BASE_ELEMENT"> + <eObjectValue xmi:type="uml:Port" href="connectors.uml#_uFmasKaqEeaVuqljGw-fqQ"/> + </styles> + <element xsi:nil="true"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_VCCetLp2EeaV0fVWRP8bJg" x="192" y="-8"/> + </children> + <children xmi:type="notation:Shape" xmi:id="_VCGJIbp2EeaV0fVWRP8bJg" type="StereotypeComment"> + <styles xmi:type="notation:TitleStyle" xmi:id="_VCGJIrp2EeaV0fVWRP8bJg"/> + <styles xmi:type="notation:EObjectValueStyle" xmi:id="_VCGJJLp2EeaV0fVWRP8bJg" name="BASE_ELEMENT"> + <eObjectValue xmi:type="uml:Port" href="connectors.uml#_0JPYIKaqEeaVuqljGw-fqQ"/> + </styles> + <element xsi:nil="true"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_VCGJI7p2EeaV0fVWRP8bJg" x="192" y="-8"/> + </children> + <children xmi:type="notation:Shape" xmi:id="_euCC4Lp2EeaV0fVWRP8bJg" type="StereotypeComment"> + <styles xmi:type="notation:TitleStyle" xmi:id="_euCC4bp2EeaV0fVWRP8bJg"/> + <styles xmi:type="notation:EObjectValueStyle" xmi:id="_euCC47p2EeaV0fVWRP8bJg" name="BASE_ELEMENT"> + <eObjectValue xmi:type="uml:Connector" href="connectors.uml#_etrdkLp2EeaV0fVWRP8bJg"/> + </styles> + <element xsi:nil="true"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_euCC4rp2EeaV0fVWRP8bJg" x="192" y="17"/> + </children> + <styles xmi:type="notation:StringValueStyle" xmi:id="_cZ1jkaaqEeaVuqljGw-fqQ" name="diagram_compatibility_version" stringValue="1.2.0"/> + <styles xmi:type="notation:DiagramStyle" xmi:id="_cZ1jkqaqEeaVuqljGw-fqQ"/> + <styles xmi:type="style:PapyrusViewStyle" xmi:id="_cZ1jk6aqEeaVuqljGw-fqQ"> + <owner xmi:type="uml:Class" href="connectors.uml#_cUZp8KaqEeaVuqljGw-fqQ"/> + <configuration xmi:type="configuration:PapyrusDiagram" href="platform:/plugin/org.eclipse.papyrusrt.umlrt.tooling.diagram.common/configuration/UMLRT.configuration#_Z79eQHcZEeSnWeKqQOfW2A"/> + </styles> + <element xmi:type="uml:Class" href="connectors.uml#_cUZp8KaqEeaVuqljGw-fqQ"/> + <edges xmi:type="notation:Connector" xmi:id="_VB9mMLp2EeaV0fVWRP8bJg" type="StereotypeCommentLink" source="_caQaUKaqEeaVuqljGw-fqQ" target="_VB8_I7p2EeaV0fVWRP8bJg"> + <styles xmi:type="notation:FontStyle" xmi:id="_VB9mMbp2EeaV0fVWRP8bJg"/> + <styles xmi:type="notation:EObjectValueStyle" xmi:id="_VB9mNbp2EeaV0fVWRP8bJg" name="BASE_ELEMENT"> + <eObjectValue xmi:type="uml:Class" href="connectors.uml#_cUZp8KaqEeaVuqljGw-fqQ"/> + </styles> + <element xsi:nil="true"/> + <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_VB9mMrp2EeaV0fVWRP8bJg" points="[0, 0, 0, 0]$[0, 0, 0, 0]"/> + <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_VB9mM7p2EeaV0fVWRP8bJg"/> + <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_VB9mNLp2EeaV0fVWRP8bJg"/> + </edges> + <edges xmi:type="notation:Connector" xmi:id="_VCCetrp2EeaV0fVWRP8bJg" type="StereotypeCommentLink" source="_VB-0ULp2EeaV0fVWRP8bJg" target="_VCCesrp2EeaV0fVWRP8bJg"> + <styles xmi:type="notation:FontStyle" xmi:id="_VCCet7p2EeaV0fVWRP8bJg"/> + <styles xmi:type="notation:EObjectValueStyle" xmi:id="_VCCeu7p2EeaV0fVWRP8bJg" name="BASE_ELEMENT"> + <eObjectValue xmi:type="uml:Port" href="connectors.uml#_uFmasKaqEeaVuqljGw-fqQ"/> + </styles> + <element xsi:nil="true"/> + <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_VCCeuLp2EeaV0fVWRP8bJg" points="[0, 0, 0, 0]$[0, 0, 0, 0]"/> + <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_VCCeubp2EeaV0fVWRP8bJg"/> + <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_VCCeurp2EeaV0fVWRP8bJg"/> + </edges> + <edges xmi:type="notation:Connector" xmi:id="_VCGwILp2EeaV0fVWRP8bJg" type="StereotypeCommentLink" source="_VB_bYLp2EeaV0fVWRP8bJg" target="_VCGJIbp2EeaV0fVWRP8bJg"> + <styles xmi:type="notation:FontStyle" xmi:id="_VCGwIbp2EeaV0fVWRP8bJg"/> + <styles xmi:type="notation:EObjectValueStyle" xmi:id="_VCGwJbp2EeaV0fVWRP8bJg" name="BASE_ELEMENT"> + <eObjectValue xmi:type="uml:Port" href="connectors.uml#_0JPYIKaqEeaVuqljGw-fqQ"/> + </styles> + <element xsi:nil="true"/> + <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_VCGwIrp2EeaV0fVWRP8bJg" points="[0, 0, 0, 0]$[0, 0, 0, 0]"/> + <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_VCGwI7p2EeaV0fVWRP8bJg"/> + <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_VCGwJLp2EeaV0fVWRP8bJg"/> + </edges> + <edges xmi:type="notation:Connector" xmi:id="_cjjIVLp2EeaV0fVWRP8bJg" type="StereotypeCommentLink" source="_cjYwQLp2EeaV0fVWRP8bJg" target="_cjjIULp2EeaV0fVWRP8bJg"> + <styles xmi:type="notation:FontStyle" xmi:id="_cjjIVbp2EeaV0fVWRP8bJg"/> + <styles xmi:type="notation:EObjectValueStyle" xmi:id="_cjjIWbp2EeaV0fVWRP8bJg" name="BASE_ELEMENT"> + <eObjectValue xmi:type="uml:Property" href="connectors.uml#_cisMsLp2EeaV0fVWRP8bJg"/> + </styles> + <element xsi:nil="true"/> + <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_cjjIVrp2EeaV0fVWRP8bJg" points="[0, 0, 0, 0]$[0, 0, 0, 0]"/> + <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_cjjIV7p2EeaV0fVWRP8bJg"/> + <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_cjjIWLp2EeaV0fVWRP8bJg"/> + </edges> + <edges xmi:type="notation:Connector" xmi:id="_d5p_pLp2EeaV0fVWRP8bJg" type="StereotypeCommentLink" source="_d5mVQLp2EeaV0fVWRP8bJg" target="_d5p_oLp2EeaV0fVWRP8bJg"> + <styles xmi:type="notation:FontStyle" xmi:id="_d5p_pbp2EeaV0fVWRP8bJg"/> + <styles xmi:type="notation:EObjectValueStyle" xmi:id="_d5p_qbp2EeaV0fVWRP8bJg" name="BASE_ELEMENT"> + <eObjectValue xmi:type="uml:Port" href="connectors.uml#_dVF6ALp2EeaV0fVWRP8bJg"/> + </styles> + <element xsi:nil="true"/> + <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_d5p_prp2EeaV0fVWRP8bJg" points="[0, 0, 0, 0]$[0, 0, 0, 0]"/> + <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_d5p_p7p2EeaV0fVWRP8bJg"/> + <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_d5p_qLp2EeaV0fVWRP8bJg"/> + </edges> + <edges xmi:type="notation:Connector" xmi:id="_et0AcLp2EeaV0fVWRP8bJg" type="Connector_Edge" source="_VB-0ULp2EeaV0fVWRP8bJg" target="_d5mVQLp2EeaV0fVWRP8bJg"> + <children xmi:type="notation:DecorationNode" xmi:id="_et0ngLp2EeaV0fVWRP8bJg" type="Connector_StereotypeLabel"> + <layoutConstraint xmi:type="notation:Location" xmi:id="_et0ngbp2EeaV0fVWRP8bJg" y="60"/> + </children> + <children xmi:type="notation:DecorationNode" xmi:id="_et0ngrp2EeaV0fVWRP8bJg" type="Connector_NameLabel"> + <layoutConstraint xmi:type="notation:Location" xmi:id="_et0ng7p2EeaV0fVWRP8bJg" y="-20"/> + </children> + <styles xmi:type="notation:FontStyle" xmi:id="_et0Acbp2EeaV0fVWRP8bJg"/> + <element xmi:type="uml:Connector" href="connectors.uml#_etrdkLp2EeaV0fVWRP8bJg"/> + <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_et0Acrp2EeaV0fVWRP8bJg" points="[48, 163, -643984, -643984]$[171, 128, -643984, -643984]"/> + </edges> + <edges xmi:type="notation:Connector" xmi:id="_euCC5Lp2EeaV0fVWRP8bJg" type="StereotypeCommentLink" source="_et0AcLp2EeaV0fVWRP8bJg" target="_euCC4Lp2EeaV0fVWRP8bJg"> + <styles xmi:type="notation:FontStyle" xmi:id="_euCC5bp2EeaV0fVWRP8bJg"/> + <styles xmi:type="notation:EObjectValueStyle" xmi:id="_euCC6bp2EeaV0fVWRP8bJg" name="BASE_ELEMENT"> + <eObjectValue xmi:type="uml:Connector" href="connectors.uml#_etrdkLp2EeaV0fVWRP8bJg"/> + </styles> + <element xsi:nil="true"/> + <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_euCC5rp2EeaV0fVWRP8bJg" points="[0, 0, 0, 0]$[0, 0, 0, 0]"/> + <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_euCC57p2EeaV0fVWRP8bJg"/> + <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_euCC6Lp2EeaV0fVWRP8bJg"/> + </edges> + </notation:Diagram> + <notation:Diagram xmi:id="_eOk3oKaqEeaVuqljGw-fqQ" type="CompositeStructure" measurementUnit="Pixel"> + <children xmi:type="notation:Shape" xmi:id="_eOlesKaqEeaVuqljGw-fqQ" type="Class_Shape"> + <children xmi:type="notation:DecorationNode" xmi:id="_eOlesqaqEeaVuqljGw-fqQ" type="Class_NameLabel"/> + <children xmi:type="notation:DecorationNode" xmi:id="_eOles6aqEeaVuqljGw-fqQ" type="Class_FloatingNameLabel"> + <layoutConstraint xmi:type="notation:Location" xmi:id="_eOletKaqEeaVuqljGw-fqQ" y="5"/> + </children> + <children xmi:type="notation:BasicCompartment" xmi:id="_eOletaaqEeaVuqljGw-fqQ" type="Class_StructureCompartment"> + <styles xmi:type="notation:TitleStyle" xmi:id="_eOletqaqEeaVuqljGw-fqQ"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_eOlet6aqEeaVuqljGw-fqQ"/> + </children> + <element xmi:type="uml:Class" href="connectors.uml#_eOTK0KaqEeaVuqljGw-fqQ"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_eOlesaaqEeaVuqljGw-fqQ" x="40" y="40" width="500" height="250"/> + </children> + <styles xmi:type="notation:StringValueStyle" xmi:id="_eOk3oaaqEeaVuqljGw-fqQ" name="diagram_compatibility_version" stringValue="1.2.0"/> + <styles xmi:type="notation:DiagramStyle" xmi:id="_eOk3oqaqEeaVuqljGw-fqQ"/> + <styles xmi:type="style:PapyrusViewStyle" xmi:id="_eOk3o6aqEeaVuqljGw-fqQ"> + <owner xmi:type="uml:Class" href="connectors.uml#_eOTK0KaqEeaVuqljGw-fqQ"/> + <configuration xmi:type="configuration:PapyrusDiagram" href="platform:/plugin/org.eclipse.papyrusrt.umlrt.tooling.diagram.common/configuration/UMLRT.configuration#_Z79eQHcZEeSnWeKqQOfW2A"/> + </styles> + <element xmi:type="uml:Class" href="connectors.uml#_eOTK0KaqEeaVuqljGw-fqQ"/> + </notation:Diagram> + <notation:Diagram xmi:id="_go16oKaqEeaVuqljGw-fqQ" type="CompositeStructure" measurementUnit="Pixel"> + <children xmi:type="notation:Shape" xmi:id="_go2hsKaqEeaVuqljGw-fqQ" type="Class_Shape"> + <children xmi:type="notation:DecorationNode" xmi:id="_go2hsqaqEeaVuqljGw-fqQ" type="Class_NameLabel"/> + <children xmi:type="notation:DecorationNode" xmi:id="_go2hs6aqEeaVuqljGw-fqQ" type="Class_FloatingNameLabel"> + <layoutConstraint xmi:type="notation:Location" xmi:id="_go2htKaqEeaVuqljGw-fqQ" y="5"/> + </children> + <children xmi:type="notation:BasicCompartment" xmi:id="_go2htaaqEeaVuqljGw-fqQ" type="Class_StructureCompartment"> + <styles xmi:type="notation:TitleStyle" xmi:id="_go2htqaqEeaVuqljGw-fqQ"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_go2ht6aqEeaVuqljGw-fqQ"/> + </children> + <element xmi:type="uml:Class" href="connectors.uml#_golb8KaqEeaVuqljGw-fqQ"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_go2hsaaqEeaVuqljGw-fqQ" x="40" y="40" width="500" height="250"/> + </children> + <styles xmi:type="notation:StringValueStyle" xmi:id="_go16oaaqEeaVuqljGw-fqQ" name="diagram_compatibility_version" stringValue="1.2.0"/> + <styles xmi:type="notation:DiagramStyle" xmi:id="_go16oqaqEeaVuqljGw-fqQ"/> + <styles xmi:type="style:PapyrusViewStyle" xmi:id="_go16o6aqEeaVuqljGw-fqQ"> + <owner xmi:type="uml:Class" href="connectors.uml#_golb8KaqEeaVuqljGw-fqQ"/> + <configuration xmi:type="configuration:PapyrusDiagram" href="platform:/plugin/org.eclipse.papyrusrt.umlrt.tooling.diagram.common/configuration/UMLRT.configuration#_Z79eQHcZEeSnWeKqQOfW2A"/> + </styles> + <element xmi:type="uml:Class" href="connectors.uml#_golb8KaqEeaVuqljGw-fqQ"/> + </notation:Diagram> + <notation:Diagram xmi:id="_bbqTMLp2EeaV0fVWRP8bJg" type="CompositeStructure" measurementUnit="Pixel"> + <children xmi:type="notation:Shape" xmi:id="_bbq6QLp2EeaV0fVWRP8bJg" type="Class_Shape"> + <children xmi:type="notation:DecorationNode" xmi:id="_bbq6Qrp2EeaV0fVWRP8bJg" type="Class_NameLabel"/> + <children xmi:type="notation:DecorationNode" xmi:id="_bbq6Q7p2EeaV0fVWRP8bJg" type="Class_FloatingNameLabel"> + <layoutConstraint xmi:type="notation:Location" xmi:id="_bbq6RLp2EeaV0fVWRP8bJg" y="5"/> + </children> + <children xmi:type="notation:BasicCompartment" xmi:id="_bbq6Rbp2EeaV0fVWRP8bJg" type="Class_StructureCompartment"> + <styles xmi:type="notation:TitleStyle" xmi:id="_bbq6Rrp2EeaV0fVWRP8bJg"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_bbq6R7p2EeaV0fVWRP8bJg"/> + </children> + <children xmi:type="notation:Shape" xmi:id="_d5j5ALp2EeaV0fVWRP8bJg" type="Port_Shape"> + <children xmi:type="notation:DecorationNode" xmi:id="_d5j5Arp2EeaV0fVWRP8bJg" type="Port_NameLabel"> + <layoutConstraint xmi:type="notation:Location" xmi:id="_d5j5A7p2EeaV0fVWRP8bJg" x="25" y="3"/> + </children> + <children xmi:type="notation:DecorationNode" xmi:id="_d5j5BLp2EeaV0fVWRP8bJg" type="Port_StereotypeLabel"> + <layoutConstraint xmi:type="notation:Location" xmi:id="_d5j5Bbp2EeaV0fVWRP8bJg" x="25" y="-10"/> + </children> + <element xmi:type="uml:Port" href="connectors.uml#_dVF6ALp2EeaV0fVWRP8bJg"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_d5j5Abp2EeaV0fVWRP8bJg" y="105" width="16" height="16"/> + </children> + <element xmi:type="uml:Class" href="connectors.uml#_bZqvILp2EeaV0fVWRP8bJg"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_bbq6Qbp2EeaV0fVWRP8bJg" x="40" y="40" width="500" height="250"/> + </children> + <styles xmi:type="notation:StringValueStyle" xmi:id="_bbqTMbp2EeaV0fVWRP8bJg" name="diagram_compatibility_version" stringValue="1.2.0"/> + <styles xmi:type="notation:DiagramStyle" xmi:id="_bbqTMrp2EeaV0fVWRP8bJg"/> + <styles xmi:type="style:PapyrusViewStyle" xmi:id="_bbqTM7p2EeaV0fVWRP8bJg"> + <owner xmi:type="uml:Class" href="connectors.uml#_bZqvILp2EeaV0fVWRP8bJg"/> + <configuration xmi:type="configuration:PapyrusDiagram" href="platform:/plugin/org.eclipse.papyrusrt.umlrt.tooling.diagram.common/configuration/UMLRT.configuration#_Z79eQHcZEeSnWeKqQOfW2A"/> + </styles> + <element xmi:type="uml:Class" href="connectors.uml#_bZqvILp2EeaV0fVWRP8bJg"/> + </notation:Diagram> +</xmi:XMI> diff --git a/tests/junit/umlrt/core/org.eclipse.papyrusrt.umlrt.core.tests/resource/inheritance/connectors.uml b/tests/junit/umlrt/core/org.eclipse.papyrusrt.umlrt.core.tests/resource/inheritance/connectors.uml new file mode 100644 index 000000000..e45b51563 --- /dev/null +++ b/tests/junit/umlrt/core/org.eclipse.papyrusrt.umlrt.core.tests/resource/inheritance/connectors.uml @@ -0,0 +1,134 @@ +<?xml version="1.0" encoding="UTF-8"?> +<xmi:XMI xmi:version="20131001" xmlns:xmi="http://www.omg.org/spec/XMI/20131001" xmlns:UMLRealTime="http://www.eclipse.org/papyrus/umlrt" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" xmlns:uml="http://www.eclipse.org/uml2/5.0.0/UML"> + <uml:Model xmi:id="_upCUYKapEeaVuqljGw-fqQ" name="connectors"> + <packageImport xmi:id="_4tIaoK5sEeab8Ykik38t7Q"> + <importedPackage xmi:type="uml:Model" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#_0"/> + </packageImport> + <packagedElement xmi:type="uml:Class" xmi:id="_cUZp8KaqEeaVuqljGw-fqQ" name="RootCapsule" isActive="true"> + <ownedAttribute xmi:type="uml:Port" xmi:id="_uFmasKaqEeaVuqljGw-fqQ" name="protocol1" visibility="public" type="_ufaB0KaqEeaVuqljGw-fqQ" isOrdered="true" aggregation="composite"/> + <ownedAttribute xmi:type="uml:Port" xmi:id="_0JPYIKaqEeaVuqljGw-fqQ" name="protocol2" visibility="public" type="_0h-oQKaqEeaVuqljGw-fqQ" isOrdered="true" aggregation="composite" isBehavior="true"> + <lowerValue xmi:type="uml:LiteralInteger" xmi:id="_Lp1UoKarEeaVuqljGw-fqQ" value="4"/> + <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_MY-5oKarEeaVuqljGw-fqQ" value="4"/> + </ownedAttribute> + <ownedAttribute xmi:id="_cisMsLp2EeaV0fVWRP8bJg" name="nestedCapsule" visibility="protected" type="_bZqvILp2EeaV0fVWRP8bJg" isOrdered="true" aggregation="composite"/> + <ownedConnector xmi:id="_etrdkLp2EeaV0fVWRP8bJg" name="connector1"> + <end xmi:id="_etsrsLp2EeaV0fVWRP8bJg" role="_uFmasKaqEeaVuqljGw-fqQ"/> + <end xmi:id="_etsrsbp2EeaV0fVWRP8bJg" partWithPort="_cisMsLp2EeaV0fVWRP8bJg" role="_dVF6ALp2EeaV0fVWRP8bJg"/> + </ownedConnector> + </packagedElement> + <packagedElement xmi:type="uml:Class" xmi:id="_eOTK0KaqEeaVuqljGw-fqQ" name="Subcapsule" isActive="true"> + <generalization xmi:id="_2gbR8KaqEeaVuqljGw-fqQ" general="_cUZp8KaqEeaVuqljGw-fqQ"/> + </packagedElement> + <packagedElement xmi:type="uml:Class" xmi:id="_golb8KaqEeaVuqljGw-fqQ" name="Subsubcapsule" isActive="true"> + <generalization xmi:id="_4D3aoKaqEeaVuqljGw-fqQ" general="_eOTK0KaqEeaVuqljGw-fqQ"/> + </packagedElement> + <packagedElement xmi:type="uml:Package" xmi:id="_ufb3AKaqEeaVuqljGw-fqQ" name="Protocol1"> + <packagedElement xmi:type="uml:Collaboration" xmi:id="_ufaB0KaqEeaVuqljGw-fqQ" name="Protocol1"> + <interfaceRealization xmi:id="_ufgIcKaqEeaVuqljGw-fqQ" client="_ufaB0KaqEeaVuqljGw-fqQ" supplier="_ufeTQKaqEeaVuqljGw-fqQ" contract="_ufeTQKaqEeaVuqljGw-fqQ"/> + <interfaceRealization xmi:id="_ufmPEKaqEeaVuqljGw-fqQ" client="_ufaB0KaqEeaVuqljGw-fqQ" supplier="_ufkZ4KaqEeaVuqljGw-fqQ" contract="_ufkZ4KaqEeaVuqljGw-fqQ"/> + </packagedElement> + <packagedElement xmi:type="uml:Interface" xmi:id="_ufeTQKaqEeaVuqljGw-fqQ" name="Protocol1"> + <ownedOperation xmi:id="_l58soK5lEeab8Ykik38t7Q" name="greet"> + <ownedParameter xmi:id="_0QqTgK5lEeab8Ykik38t7Q" name="data"> + <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#String"/> + </ownedParameter> + </ownedOperation> + </packagedElement> + <packagedElement xmi:type="uml:Interface" xmi:id="_ufhWkKaqEeaVuqljGw-fqQ" name="Protocol1~"/> + <packagedElement xmi:type="uml:Usage" xmi:id="_ufjLwKaqEeaVuqljGw-fqQ" client="_ufaB0KaqEeaVuqljGw-fqQ" supplier="_ufhWkKaqEeaVuqljGw-fqQ"/> + <packagedElement xmi:type="uml:AnyReceiveEvent" xmi:id="_ufjy0KaqEeaVuqljGw-fqQ" name="*"/> + <packagedElement xmi:type="uml:Interface" xmi:id="_ufkZ4KaqEeaVuqljGw-fqQ" name="Protocol1IO"/> + <packagedElement xmi:type="uml:Usage" xmi:id="_ufm2IKaqEeaVuqljGw-fqQ" client="_ufaB0KaqEeaVuqljGw-fqQ" supplier="_ufkZ4KaqEeaVuqljGw-fqQ"/> + <packagedElement xmi:type="uml:CallEvent" xmi:id="_l6EocK5lEeab8Ykik38t7Q" operation="_l58soK5lEeab8Ykik38t7Q"/> + </packagedElement> + <packagedElement xmi:type="uml:Package" xmi:id="_0iAdcKaqEeaVuqljGw-fqQ" name="Protocol2"> + <packagedElement xmi:type="uml:Collaboration" xmi:id="_0h-oQKaqEeaVuqljGw-fqQ" name="Protocol2"> + <interfaceRealization xmi:id="_0iEH0KaqEeaVuqljGw-fqQ" client="_0h-oQKaqEeaVuqljGw-fqQ" supplier="_0iCSoKaqEeaVuqljGw-fqQ" contract="_0iCSoKaqEeaVuqljGw-fqQ"/> + <interfaceRealization xmi:id="_0i0VwKaqEeaVuqljGw-fqQ" client="_0h-oQKaqEeaVuqljGw-fqQ" supplier="_0iHyMKaqEeaVuqljGw-fqQ" contract="_0iHyMKaqEeaVuqljGw-fqQ"/> + </packagedElement> + <packagedElement xmi:type="uml:Interface" xmi:id="_0iCSoKaqEeaVuqljGw-fqQ" name="Protocol2"/> + <packagedElement xmi:type="uml:Interface" xmi:id="_0iEu4KaqEeaVuqljGw-fqQ" name="Protocol2~"/> + <packagedElement xmi:type="uml:Usage" xmi:id="_0iGkEKaqEeaVuqljGw-fqQ" client="_0h-oQKaqEeaVuqljGw-fqQ" supplier="_0iEu4KaqEeaVuqljGw-fqQ"/> + <packagedElement xmi:type="uml:AnyReceiveEvent" xmi:id="_0iHLIKaqEeaVuqljGw-fqQ" name="*"/> + <packagedElement xmi:type="uml:Interface" xmi:id="_0iHyMKaqEeaVuqljGw-fqQ" name="Protocol2IO"/> + <packagedElement xmi:type="uml:Usage" xmi:id="_0i080KaqEeaVuqljGw-fqQ" client="_0h-oQKaqEeaVuqljGw-fqQ" supplier="_0iHyMKaqEeaVuqljGw-fqQ"/> + </packagedElement> + <packagedElement xmi:type="uml:Package" xmi:id="_YbdjIK31Eeab8Ykik38t7Q" name="nested"/> + <packagedElement xmi:type="uml:Class" xmi:id="_bZqvILp2EeaV0fVWRP8bJg" name="NestedCapsule" isActive="true"> + <ownedAttribute xmi:type="uml:Port" xmi:id="_dVF6ALp2EeaV0fVWRP8bJg" name="protocol1" visibility="public" type="_ufaB0KaqEeaVuqljGw-fqQ" isOrdered="true" aggregation="composite" isBehavior="true"/> + </packagedElement> + <packagedElement xmi:type="uml:Package" xmi:id="_lUf5INOnEeaFeYmSU0wjMA" name="Subprotocol"> + <packagedElement xmi:type="uml:Collaboration" xmi:id="_lUf5IdOnEeaFeYmSU0wjMA" name="Subprotocol"> + <generalization xmi:id="_G-7zcNOoEeaFeYmSU0wjMA" general="_ufaB0KaqEeaVuqljGw-fqQ"/> + <interfaceRealization xmi:id="_lUf5ItOnEeaFeYmSU0wjMA" client="_lUf5IdOnEeaFeYmSU0wjMA" supplier="_lUf5JNOnEeaFeYmSU0wjMA" contract="_lUf5JNOnEeaFeYmSU0wjMA"/> + <interfaceRealization xmi:id="_lUf5I9OnEeaFeYmSU0wjMA" client="_lUf5IdOnEeaFeYmSU0wjMA" supplier="_lUf5KNOnEeaFeYmSU0wjMA" contract="_lUf5KNOnEeaFeYmSU0wjMA"/> + </packagedElement> + <packagedElement xmi:type="uml:Interface" xmi:id="_lUf5JNOnEeaFeYmSU0wjMA" name="Subprotocol"> + <generalization xmi:id="_KJGCUNOoEeaFeYmSU0wjMA" general="_ufeTQKaqEeaVuqljGw-fqQ"/> + </packagedElement> + <packagedElement xmi:type="uml:Interface" xmi:id="_lUf5JdOnEeaFeYmSU0wjMA" name="Subprotocol~"> + <generalization xmi:id="_RL2TYNOoEeaFeYmSU0wjMA" general="_ufhWkKaqEeaVuqljGw-fqQ"/> + </packagedElement> + <packagedElement xmi:type="uml:Usage" xmi:id="_lUf5JtOnEeaFeYmSU0wjMA" client="_lUf5IdOnEeaFeYmSU0wjMA" supplier="_lUf5JdOnEeaFeYmSU0wjMA"/> + <packagedElement xmi:type="uml:AnyReceiveEvent" xmi:id="_lUf5J9OnEeaFeYmSU0wjMA" name="*"/> + <packagedElement xmi:type="uml:Interface" xmi:id="_lUf5KNOnEeaFeYmSU0wjMA" name="SubprotocolIO"> + <generalization xmi:id="_TEKf4NOoEeaFeYmSU0wjMA" general="_ufkZ4KaqEeaVuqljGw-fqQ"/> + </packagedElement> + <packagedElement xmi:type="uml:Usage" xmi:id="_lUf5KdOnEeaFeYmSU0wjMA" client="_lUf5IdOnEeaFeYmSU0wjMA" supplier="_lUf5KNOnEeaFeYmSU0wjMA"/> + </packagedElement> + <packagedElement xmi:type="uml:Package" xmi:id="_u-RPwNOnEeaFeYmSU0wjMA" name="Subsubprotocol"> + <packagedElement xmi:type="uml:Collaboration" xmi:id="_u-RPwdOnEeaFeYmSU0wjMA" name="Subsubprotocol"> + <generalization xmi:id="_5pFMoNOnEeaFeYmSU0wjMA" general="_lUf5IdOnEeaFeYmSU0wjMA"/> + <interfaceRealization xmi:id="_u-RPwtOnEeaFeYmSU0wjMA" client="_u-RPwdOnEeaFeYmSU0wjMA" supplier="_u-RPxNOnEeaFeYmSU0wjMA" contract="_u-RPxNOnEeaFeYmSU0wjMA"/> + <interfaceRealization xmi:id="_u-RPw9OnEeaFeYmSU0wjMA" client="_u-RPwdOnEeaFeYmSU0wjMA" supplier="_u-RPyNOnEeaFeYmSU0wjMA" contract="_u-RPyNOnEeaFeYmSU0wjMA"/> + </packagedElement> + <packagedElement xmi:type="uml:Interface" xmi:id="_u-RPxNOnEeaFeYmSU0wjMA" name="Subsubprotocol"> + <generalization xmi:id="_9TS0kNOnEeaFeYmSU0wjMA" general="_lUf5JNOnEeaFeYmSU0wjMA"/> + </packagedElement> + <packagedElement xmi:type="uml:Interface" xmi:id="_u-RPxdOnEeaFeYmSU0wjMA" name="Subsubprotocol~"> + <generalization xmi:id="__nY-INOnEeaFeYmSU0wjMA" general="_lUf5JdOnEeaFeYmSU0wjMA"/> + </packagedElement> + <packagedElement xmi:type="uml:Usage" xmi:id="_u-RPxtOnEeaFeYmSU0wjMA" client="_u-RPwdOnEeaFeYmSU0wjMA" supplier="_u-RPxdOnEeaFeYmSU0wjMA"/> + <packagedElement xmi:type="uml:AnyReceiveEvent" xmi:id="_u-RPx9OnEeaFeYmSU0wjMA" name="*"/> + <packagedElement xmi:type="uml:Interface" xmi:id="_u-RPyNOnEeaFeYmSU0wjMA" name="SubsubprotocolIO"> + <generalization xmi:id="_ElZwQNOoEeaFeYmSU0wjMA" general="_lUf5KNOnEeaFeYmSU0wjMA"/> + </packagedElement> + <packagedElement xmi:type="uml:Usage" xmi:id="_u-RPydOnEeaFeYmSU0wjMA" client="_u-RPwdOnEeaFeYmSU0wjMA" supplier="_u-RPyNOnEeaFeYmSU0wjMA"/> + </packagedElement> + <profileApplication xmi:id="_usQngKapEeaVuqljGw-fqQ"> + <eAnnotations xmi:id="_usWHEKapEeaVuqljGw-fqQ" source="http://www.eclipse.org/uml2/2.0.0/UML"> + <references xmi:type="ecore:EPackage" href="http://www.eclipse.org/papyrus/umlrt#/"/> + </eAnnotations> + <appliedProfile href="pathmap://UML_RT_PROFILE/uml-rt.profile.uml#_1h74oEeVEeO0lv5O1DTHOQ"/> + </profileApplication> + </uml:Model> + <UMLRealTime:Capsule xmi:id="_caZkQKaqEeaVuqljGw-fqQ" base_Class="_cUZp8KaqEeaVuqljGw-fqQ"/> + <UMLRealTime:Capsule xmi:id="_eOms0KaqEeaVuqljGw-fqQ" base_Class="_eOTK0KaqEeaVuqljGw-fqQ"/> + <UMLRealTime:Capsule xmi:id="_go3IwKaqEeaVuqljGw-fqQ" base_Class="_golb8KaqEeaVuqljGw-fqQ"/> + <UMLRealTime:RTPort xmi:id="_uFo28KaqEeaVuqljGw-fqQ" base_Port="_uFmasKaqEeaVuqljGw-fqQ"/> + <UMLRealTime:ProtocolContainer xmi:id="_ufdFIKaqEeaVuqljGw-fqQ" base_Package="_ufb3AKaqEeaVuqljGw-fqQ"/> + <UMLRealTime:RTMessageSet xmi:id="_uffhYKaqEeaVuqljGw-fqQ" base_Interface="_ufeTQKaqEeaVuqljGw-fqQ"/> + <UMLRealTime:RTMessageSet xmi:id="_ufh9oKaqEeaVuqljGw-fqQ" base_Interface="_ufhWkKaqEeaVuqljGw-fqQ" rtMsgKind="out"/> + <UMLRealTime:RTMessageSet xmi:id="_ufloAKaqEeaVuqljGw-fqQ" base_Interface="_ufkZ4KaqEeaVuqljGw-fqQ" rtMsgKind="inOut"/> + <UMLRealTime:Protocol xmi:id="_ufndMKaqEeaVuqljGw-fqQ" base_Collaboration="_ufaB0KaqEeaVuqljGw-fqQ"/> + <UMLRealTime:RTPort xmi:id="_0JRNUKaqEeaVuqljGw-fqQ" base_Port="_0JPYIKaqEeaVuqljGw-fqQ"/> + <UMLRealTime:ProtocolContainer xmi:id="_0iBrkKaqEeaVuqljGw-fqQ" base_Package="_0iAdcKaqEeaVuqljGw-fqQ"/> + <UMLRealTime:RTMessageSet xmi:id="_0iDgwKaqEeaVuqljGw-fqQ" base_Interface="_0iCSoKaqEeaVuqljGw-fqQ"/> + <UMLRealTime:RTMessageSet xmi:id="_0iF9AKaqEeaVuqljGw-fqQ" base_Interface="_0iEu4KaqEeaVuqljGw-fqQ" rtMsgKind="out"/> + <UMLRealTime:RTMessageSet xmi:id="_0iIZQKaqEeaVuqljGw-fqQ" base_Interface="_0iHyMKaqEeaVuqljGw-fqQ" rtMsgKind="inOut"/> + <UMLRealTime:Protocol xmi:id="_0i080aaqEeaVuqljGw-fqQ" base_Collaboration="_0h-oQKaqEeaVuqljGw-fqQ"/> + <UMLRealTime:Capsule xmi:id="_bbrhULp2EeaV0fVWRP8bJg" base_Class="_bZqvILp2EeaV0fVWRP8bJg"/> + <UMLRealTime:CapsulePart xmi:id="_cita0Lp2EeaV0fVWRP8bJg" base_Property="_cisMsLp2EeaV0fVWRP8bJg"/> + <UMLRealTime:RTPort xmi:id="_dVHIILp2EeaV0fVWRP8bJg" base_Port="_dVF6ALp2EeaV0fVWRP8bJg"/> + <UMLRealTime:RTConnector xmi:id="_etsrsrp2EeaV0fVWRP8bJg" base_Connector="_etrdkLp2EeaV0fVWRP8bJg"/> + <UMLRealTime:ProtocolContainer xmi:id="_lUsGYNOnEeaFeYmSU0wjMA" base_Package="_lUf5INOnEeaFeYmSU0wjMA"/> + <UMLRealTime:Protocol xmi:id="_lUtUgNOnEeaFeYmSU0wjMA" base_Collaboration="_lUf5IdOnEeaFeYmSU0wjMA"/> + <UMLRealTime:RTMessageSet xmi:id="_lUtUgdOnEeaFeYmSU0wjMA" base_Interface="_lUf5JNOnEeaFeYmSU0wjMA"/> + <UMLRealTime:RTMessageSet xmi:id="_lUtUgtOnEeaFeYmSU0wjMA" base_Interface="_lUf5JdOnEeaFeYmSU0wjMA" rtMsgKind="out"/> + <UMLRealTime:RTMessageSet xmi:id="_lUt7kNOnEeaFeYmSU0wjMA" base_Interface="_lUf5KNOnEeaFeYmSU0wjMA" rtMsgKind="inOut"/> + <UMLRealTime:ProtocolContainer xmi:id="_u-RPytOnEeaFeYmSU0wjMA" base_Package="_u-RPwNOnEeaFeYmSU0wjMA"/> + <UMLRealTime:Protocol xmi:id="_u-R20NOnEeaFeYmSU0wjMA" base_Collaboration="_u-RPwdOnEeaFeYmSU0wjMA"/> + <UMLRealTime:RTMessageSet xmi:id="_u-R20dOnEeaFeYmSU0wjMA" base_Interface="_u-RPxNOnEeaFeYmSU0wjMA"/> + <UMLRealTime:RTMessageSet xmi:id="_u-R20tOnEeaFeYmSU0wjMA" base_Interface="_u-RPxdOnEeaFeYmSU0wjMA" rtMsgKind="out"/> + <UMLRealTime:RTMessageSet xmi:id="_u-R209OnEeaFeYmSU0wjMA" base_Interface="_u-RPyNOnEeaFeYmSU0wjMA" rtMsgKind="inOut"/> +</xmi:XMI> diff --git a/tests/junit/umlrt/core/org.eclipse.papyrusrt.umlrt.core.tests/src/org/eclipse/papyrusrt/umlrt/core/tests/creation/CreateConnectorTests.java b/tests/junit/umlrt/core/org.eclipse.papyrusrt.umlrt.core.tests/src/org/eclipse/papyrusrt/umlrt/core/tests/creation/CreateConnectorTests.java index 199d27902..14423cdc3 100644 --- a/tests/junit/umlrt/core/org.eclipse.papyrusrt.umlrt.core.tests/src/org/eclipse/papyrusrt/umlrt/core/tests/creation/CreateConnectorTests.java +++ b/tests/junit/umlrt/core/org.eclipse.papyrusrt.umlrt.core.tests/src/org/eclipse/papyrusrt/umlrt/core/tests/creation/CreateConnectorTests.java @@ -8,7 +8,7 @@ * * Contributors: * CEA LIST - Initial API and implementation - * Christian W. Damus - bug 492565 + * Christian W. Damus - bugs 492565, 467545 *****************************************************************************/ package org.eclipse.papyrusrt.umlrt.core.tests.creation; @@ -44,6 +44,7 @@ import org.eclipse.papyrus.uml.diagram.composite.edit.parts.ClassCompositeEditPa import org.eclipse.papyrus.uml.diagram.composite.edit.parts.PortEditPart; import org.eclipse.papyrus.uml.diagram.composite.edit.parts.PropertyPartEditPartCN; import org.eclipse.papyrus.uml.service.types.utils.RequestParameterConstants; +import org.eclipse.papyrusrt.junit.rules.PapyrusRTEditorFixture; import org.eclipse.papyrusrt.junit.rules.UIThreadRule; import org.eclipse.papyrusrt.umlrt.core.types.UMLRTElementTypesEnumerator; import org.eclipse.uml2.uml.Class; @@ -71,7 +72,7 @@ public class CreateConnectorTests extends AbstractPapyrusTest { public static final HouseKeeper.Static houseKeeper = new HouseKeeper.Static(); @ClassRule - public static final PapyrusEditorFixture editorFixture = new PapyrusEditorFixture(); + public static final PapyrusEditorFixture editorFixture = new PapyrusRTEditorFixture(); @CleanUp private static IMultiDiagramEditor openPapyrusEditor; diff --git a/tests/junit/umlrt/core/org.eclipse.papyrusrt.umlrt.core.tests/src/org/eclipse/papyrusrt/umlrt/core/tests/creation/CreateGeneralizationTest.java b/tests/junit/umlrt/core/org.eclipse.papyrusrt.umlrt.core.tests/src/org/eclipse/papyrusrt/umlrt/core/tests/creation/CreateGeneralizationTest.java new file mode 100644 index 000000000..ea17c63a8 --- /dev/null +++ b/tests/junit/umlrt/core/org.eclipse.papyrusrt.umlrt.core.tests/src/org/eclipse/papyrusrt/umlrt/core/tests/creation/CreateGeneralizationTest.java @@ -0,0 +1,97 @@ +/***************************************************************************** + * Copyright (c) 2016 Christian W. Damus and others. + * + * 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: + * Christian W. Damus - Initial API and implementation + * + *****************************************************************************/ + +package org.eclipse.papyrusrt.umlrt.core.tests.creation; + +import static org.hamcrest.CoreMatchers.is; +import static org.hamcrest.MatcherAssert.assertThat; + +import org.eclipse.emf.common.command.Command; +import org.eclipse.papyrus.junit.utils.rules.PluginResource; +import org.eclipse.papyrus.uml.service.types.element.UMLElementTypes; +import org.eclipse.papyrusrt.junit.rules.UMLRTModelSetFixture; +import org.eclipse.papyrusrt.junit.utils.CreationUtils; +import org.eclipse.papyrusrt.umlrt.uml.UMLRTCapsule; +import org.eclipse.papyrusrt.umlrt.uml.UMLRTPackage; +import org.eclipse.papyrusrt.umlrt.uml.UMLRTProtocol; +import org.junit.Rule; +import org.junit.Test; + +/** + * Test cases for UML-RT classifier generalization scenarios. + */ +@PluginResource("resource/TestModel.di") +public class CreateGeneralizationTest { + + @Rule + public final UMLRTModelSetFixture fixture = new UMLRTModelSetFixture(); + + public CreateGeneralizationTest() { + super(); + } + + @Test + public void createCapsuleGeneralization() { + UMLRTPackage model = UMLRTPackage.getInstance(fixture.getModel()); + UMLRTCapsule capsule0 = model.getCapsule("Capsule0"); + UMLRTCapsule newCapsule = fixture.execute(() -> model.createCapsule("NewCapsule")); + + Command create = CreationUtils.getCreateRelationshipCommand(newCapsule.toUML(), + UMLElementTypes.GENERALIZATION, capsule0.toUML(), + true, fixture.getEditingDomain()); + fixture.execute(create); + + assertThat(newCapsule.getSuperclass(), is(capsule0)); + } + + @Test + public void createSecondCapsuleGeneralization() { + UMLRTPackage model = UMLRTPackage.getInstance(fixture.getModel()); + UMLRTCapsule capsule0 = model.getCapsule("Capsule0"); + UMLRTCapsule newCapsule = fixture.execute(() -> model.createCapsule("NewCapsule")); + + fixture.execute(() -> newCapsule.setSuperclass(capsule0)); + + CreationUtils.getCreateRelationshipCommand(newCapsule.toUML(), + UMLElementTypes.GENERALIZATION, capsule0.toUML(), + false, fixture.getEditingDomain()); + } + + @Test + public void createProtocolGeneralization() { + UMLRTPackage model = UMLRTPackage.getInstance(fixture.getModel()); + UMLRTProtocol protocol0 = model.getProtocol("Protocol0"); + UMLRTProtocol newProtocol = fixture.execute(() -> model.createProtocol("NewProtocol")); + + Command create = CreationUtils.getCreateRelationshipCommand(newProtocol.toUML(), + UMLElementTypes.GENERALIZATION, protocol0.toUML(), + true, fixture.getEditingDomain()); + fixture.execute(create); + + assertThat(newProtocol.getSuperProtocol(), is(protocol0)); + } + + @Test + public void createSecondProtocolGeneralization() { + UMLRTPackage model = UMLRTPackage.getInstance(fixture.getModel()); + UMLRTProtocol protocol0 = model.getProtocol("Protocol0"); + UMLRTProtocol newProtocol = fixture.execute(() -> model.createProtocol("NewProtocol")); + + fixture.execute(() -> newProtocol.setSuperProtocol(protocol0)); + + CreationUtils.getCreateRelationshipCommand(newProtocol.toUML(), + UMLElementTypes.GENERALIZATION, protocol0.toUML(), + false, fixture.getEditingDomain()); + } + +} diff --git a/tests/junit/umlrt/core/org.eclipse.papyrusrt.umlrt.core.tests/src/org/eclipse/papyrusrt/umlrt/core/tests/edition/ExclusionCommandTest.java b/tests/junit/umlrt/core/org.eclipse.papyrusrt.umlrt.core.tests/src/org/eclipse/papyrusrt/umlrt/core/tests/edition/ExclusionCommandTest.java new file mode 100644 index 000000000..a2b722bc3 --- /dev/null +++ b/tests/junit/umlrt/core/org.eclipse.papyrusrt.umlrt.core.tests/src/org/eclipse/papyrusrt/umlrt/core/tests/edition/ExclusionCommandTest.java @@ -0,0 +1,286 @@ +/***************************************************************************** + * Copyright (c) 2017 Christian W. Damus and others. + * + * 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: + * Christian W. Damus - Initial API and implementation + * + *****************************************************************************/ + +package org.eclipse.papyrusrt.umlrt.core.tests.edition; + +import static org.eclipse.papyrusrt.junit.matchers.CommandMatchers.isExecutable; +import static org.hamcrest.CoreMatchers.everyItem; +import static org.hamcrest.MatcherAssert.assertThat; +import static org.junit.Assume.assumeThat; + +import java.util.Arrays; +import java.util.List; +import java.util.stream.Collectors; + +import org.eclipse.gmf.runtime.common.core.command.ICommand; +import org.eclipse.papyrus.junit.utils.rules.PluginResource; +import org.eclipse.papyrusrt.junit.rules.UMLRTModelSetFixture; +import org.eclipse.papyrusrt.umlrt.core.commands.ExclusionCommand; +import org.eclipse.papyrusrt.umlrt.uml.UMLRTCapsule; +import org.eclipse.papyrusrt.umlrt.uml.UMLRTCapsulePart; +import org.eclipse.papyrusrt.umlrt.uml.UMLRTConnector; +import org.eclipse.papyrusrt.umlrt.uml.UMLRTNamedElement; +import org.eclipse.papyrusrt.umlrt.uml.UMLRTPackage; +import org.eclipse.papyrusrt.umlrt.uml.UMLRTPort; +import org.eclipse.papyrusrt.umlrt.uml.UMLRTProtocol; +import org.eclipse.papyrusrt.umlrt.uml.UMLRTProtocolMessage; +import org.eclipse.uml2.uml.NamedElement; +import org.hamcrest.BaseMatcher; +import org.hamcrest.Description; +import org.hamcrest.Matcher; +import org.junit.Rule; +import org.junit.Test; + +import com.google.common.collect.Lists; + +/** + * Test cases for the {@link ExclusionCommand}, including edit-helper advice for + * exclusion/reinheritance dependencies. + */ +@PluginResource("resource/exclusions.di") +public class ExclusionCommandTest { + + @Rule + public final UMLRTModelSetFixture modelSet = new UMLRTModelSetFixture(); + + public ExclusionCommandTest() { + super(); + } + + @Test + public void excludeConnector() { + UMLRTConnector connector = getCapsule().getConnector("RTConnector1"); + UMLRTPort source = connector.getSource(); + UMLRTCapsulePart target = connector.getTargetPartWithPort(); + + exclude(connector); + + assertThat(connector, isExcluded()); + assertThat(source, notExcluded()); + assertThat(target, notExcluded()); + } + + @Test + public void excludePort() { + UMLRTConnector connector = getCapsule().getConnector("RTConnector1"); + UMLRTPort source = connector.getSource(); + UMLRTCapsulePart target = connector.getTargetPartWithPort(); + + exclude(source); + + assertThat(source, isExcluded()); + assertThat(connector, isExcluded()); + assertThat(target, notExcluded()); + } + + @Test + public void excludeCapsulePart() { + UMLRTConnector connector = getCapsule().getConnector("RTConnector1"); + UMLRTPort source = connector.getSource(); + UMLRTCapsulePart target = connector.getTargetPartWithPort(); + + exclude(target); + + assertThat(target, isExcluded()); + assertThat(connector, isExcluded()); + assertThat(source, notExcluded()); + } + + @Test + public void excludeProtocolMessage() { + UMLRTProtocolMessage message = getProtocol().getMessage("greet"); + + exclude(message); + + assertThat(message, isExcluded()); + } + + @Test + public void reinheritConnector() { + UMLRTConnector connector = getCapsule().getConnector("RTConnector1"); + UMLRTPort source = connector.getSource(); + UMLRTCapsulePart target = connector.getTargetPartWithPort(); + + exclude(connector); + + assumeThat(connector, isExcluded()); + + reinherit(connector); + + assertThat(connector, notExcluded()); + assertThat(source, notExcluded()); + assertThat(target, notExcluded()); + } + + @Test + public void reinheritConnectorWithDependents() { + UMLRTConnector connector = getCapsule().getConnector("RTConnector1"); + UMLRTPort source = connector.getSource(); + UMLRTCapsulePart target = connector.getTargetPartWithPort(); + + exclude(connector); + + assumeThat(connector, isExcluded()); + + exclude(source, target); + + assumeThat(Arrays.asList(source, target), everyItem(isExcluded())); + + reinheritConnector(); + + assertThat(connector, notExcluded()); + assertThat(source, notExcluded()); // This is required + assertThat(target, notExcluded()); // This is required + } + + @Test + public void reinheritPort() { + UMLRTConnector connector = getCapsule().getConnector("RTConnector1"); + UMLRTPort source = connector.getSource(); + UMLRTCapsulePart target = connector.getTargetPartWithPort(); + + exclude(source); + + assumeThat(source, isExcluded()); + + reinherit(source); + + assertThat(source, notExcluded()); + assertThat(connector, isExcluded()); // This is not required + assertThat(target, notExcluded()); + } + + @Test + public void reinheritCapsulePart() { + UMLRTConnector connector = getCapsule().getConnector("RTConnector1"); + UMLRTPort source = connector.getSource(); + UMLRTCapsulePart target = connector.getTargetPartWithPort(); + + exclude(target); + + assumeThat(target, isExcluded()); + + reinherit(target); + + assertThat(target, notExcluded()); + assertThat(connector, isExcluded()); // This is not required + assertThat(source, notExcluded()); + } + + @Test + public void reinheritProtocolMessage() { + UMLRTProtocolMessage message = getProtocol().getMessage("greet"); + + exclude(message); + + assumeThat(message, isExcluded()); + + reinherit(message); + + assertThat(message, notExcluded()); + } + + // + // Test framework + // + + UMLRTPackage getRoot() { + return UMLRTPackage.getInstance(modelSet.getModel()); + } + + /** Get the subtype (inheriting) capsule. */ + UMLRTCapsule getCapsule() { + return getCapsule("Capsule3"); + } + + UMLRTCapsule getCapsule(String name) { + return getRoot().getCapsule(name); + } + + /** Get the subtype (inheriting) protocol. */ + UMLRTProtocol getProtocol() { + return getProtocol("Protocol2"); + } + + UMLRTProtocol getProtocol(String name) { + return getRoot().getProtocol(name); + } + + void exclude(UMLRTNamedElement element) { + ICommand exclude = ExclusionCommand.getExclusionCommand(element.toUML(), true); + assertThat(exclude, isExecutable()); + modelSet.execute(exclude); + } + + void exclude(UMLRTNamedElement element, UMLRTNamedElement element2, UMLRTNamedElement... rest) { + List<NamedElement> elements = Lists.asList(element, element2, rest).stream() + .map(UMLRTNamedElement::toUML) + .collect(Collectors.toList()); + ICommand exclude = ExclusionCommand.getExclusionCommand(elements, true); + assertThat(exclude, isExecutable()); + modelSet.execute(exclude); + } + + void reinherit(UMLRTNamedElement element) { + ICommand reinherit = ExclusionCommand.getExclusionCommand(element.toUML(), false); + assertThat(reinherit, isExecutable()); + modelSet.execute(reinherit); + } + + void reinherit(UMLRTNamedElement element, UMLRTNamedElement element2, UMLRTNamedElement... rest) { + List<NamedElement> elements = Lists.asList(element, element2, rest).stream() + .map(UMLRTNamedElement::toUML) + .collect(Collectors.toList()); + ICommand reinherit = ExclusionCommand.getExclusionCommand(elements, false); + assertThat(reinherit, isExecutable()); + modelSet.execute(reinherit); + } + + Matcher<UMLRTNamedElement> isExcluded() { + return isExcluded(true); + } + + Matcher<UMLRTNamedElement> notExcluded() { + return isExcluded(false); + } + + Matcher<UMLRTNamedElement> isExcluded(boolean expected) { + return new BaseMatcher<UMLRTNamedElement>() { + @Override + public void describeTo(Description description) { + description.appendText(expected ? "is excluded" : "not excluded"); + } + + @Override + public void describeMismatch(Object item, Description description) { + if (item == null) { + super.describeMismatch(item, description); + } else { + description.appendText(expected ? "was not excluded" : "was excluded"); + } + } + + @Override + public boolean matches(Object item) { + boolean result = false; + + if (item instanceof UMLRTNamedElement) { + UMLRTNamedElement element = (UMLRTNamedElement) item; + result = element.isExcluded() == expected; + } + + return result; + } + }; + } +} diff --git a/tests/junit/umlrt/core/org.eclipse.papyrusrt.umlrt.core.tests/src/org/eclipse/papyrusrt/umlrt/core/tests/edition/MoveElementAroundResourcesTests.java b/tests/junit/umlrt/core/org.eclipse.papyrusrt.umlrt.core.tests/src/org/eclipse/papyrusrt/umlrt/core/tests/edition/MoveElementAroundResourcesTests.java index 90b047bf4..1ccee8c72 100644 --- a/tests/junit/umlrt/core/org.eclipse.papyrusrt.umlrt.core.tests/src/org/eclipse/papyrusrt/umlrt/core/tests/edition/MoveElementAroundResourcesTests.java +++ b/tests/junit/umlrt/core/org.eclipse.papyrusrt.umlrt.core.tests/src/org/eclipse/papyrusrt/umlrt/core/tests/edition/MoveElementAroundResourcesTests.java @@ -43,6 +43,7 @@ import org.eclipse.papyrus.infra.services.edit.service.IElementEditService; import org.eclipse.papyrus.junit.utils.rules.ModelSetFixture; import org.eclipse.papyrus.junit.utils.rules.PluginResource; import org.eclipse.papyrusrt.junit.rules.FixtureElementRule; +import org.eclipse.papyrusrt.junit.rules.UMLRTModelSetFixture; import org.eclipse.papyrusrt.umlrt.core.utils.ProtocolUtils; import org.eclipse.papyrusrt.umlrt.profile.UMLRealTime.RTMessageKind; import org.eclipse.uml2.uml.Class; @@ -66,7 +67,7 @@ import com.google.common.collect.Lists; public class MoveElementAroundResourcesTests { @Rule - public final ModelSetFixture model = new ModelSetFixture(); + public final ModelSetFixture model = new UMLRTModelSetFixture(); @Rule public final FixtureElementRule elements = new FixtureElementRule(); diff --git a/tests/junit/umlrt/core/org.eclipse.papyrusrt.umlrt.core.tests/src/org/eclipse/papyrusrt/umlrt/core/tests/types/advice/DeleteRedefinitionsAdviceTest.java b/tests/junit/umlrt/core/org.eclipse.papyrusrt.umlrt.core.tests/src/org/eclipse/papyrusrt/umlrt/core/tests/types/advice/DeleteRedefinitionsAdviceTest.java new file mode 100644 index 000000000..09f64a802 --- /dev/null +++ b/tests/junit/umlrt/core/org.eclipse.papyrusrt.umlrt.core.tests/src/org/eclipse/papyrusrt/umlrt/core/tests/types/advice/DeleteRedefinitionsAdviceTest.java @@ -0,0 +1,264 @@ +/***************************************************************************** + * Copyright (c) 2017 Christian W. Damus and others. + * + * 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: + * Christian W. Damus - Initial API and implementation + * + *****************************************************************************/ + +package org.eclipse.papyrusrt.umlrt.core.tests.types.advice; + +import static org.eclipse.papyrusrt.junit.matchers.CommandMatchers.isExecutable; +import static org.hamcrest.CoreMatchers.not; +import static org.hamcrest.CoreMatchers.nullValue; +import static org.hamcrest.MatcherAssert.assertThat; +import static org.junit.Assert.fail; + +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +import org.eclipse.gmf.runtime.common.core.command.ICommand; +import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest; +import org.eclipse.papyrus.infra.core.services.ServiceException; +import org.eclipse.papyrus.infra.services.edit.service.ElementEditServiceUtils; +import org.eclipse.papyrus.infra.services.edit.utils.RequestCacheEntries; +import org.eclipse.papyrus.junit.utils.rules.PluginResource; +import org.eclipse.papyrusrt.junit.rules.ElementTypesRule; +import org.eclipse.papyrusrt.junit.rules.UMLRTModelSetFixture; +import org.eclipse.papyrusrt.umlrt.uml.UMLRTCapsule; +import org.eclipse.papyrusrt.umlrt.uml.UMLRTClassifier; +import org.eclipse.papyrusrt.umlrt.uml.UMLRTInheritanceKind; +import org.eclipse.papyrusrt.umlrt.uml.UMLRTNamedElement; +import org.eclipse.papyrusrt.umlrt.uml.UMLRTPackage; +import org.eclipse.papyrusrt.umlrt.uml.UMLRTProtocol; +import org.eclipse.papyrusrt.umlrt.uml.util.UMLRTSwitch; +import org.eclipse.uml2.uml.Element; +import org.eclipse.uml2.uml.Generalization; +import org.junit.ClassRule; +import org.junit.Rule; +import org.junit.Test; +import org.junit.rules.TestRule; +import org.junit.runner.RunWith; +import org.junit.runners.Parameterized; +import org.junit.runners.Parameterized.Parameters; + +/** + * Test suite for the advice that handles deletion (destruction) of redefinitions. + */ +@PluginResource("resource/inheritance/connectors.di") +@RunWith(Parameterized.class) +public class DeleteRedefinitionsAdviceTest { + + @ClassRule + public static final TestRule elementTypes = new ElementTypesRule(); + + @Rule + public final UMLRTModelSetFixture model = new UMLRTModelSetFixture(); + + private final TestElementKind elementKind; + private final UMLRTInheritanceKind inheritanceKind; + + public DeleteRedefinitionsAdviceTest(TestElementKind elementKind, UMLRTInheritanceKind inheritanceKind) { + super(); + + this.elementKind = elementKind; + this.inheritanceKind = inheritanceKind; + } + + @Test + public void destroyGeneralization() { + UMLRTClassifier classifier = classifier(); + UMLRTClassifier intermediate = getSupertype(classifier); + + Generalization generalization = intermediate.toUML().getGeneralizations().get(0); + + UMLRTNamedElement member = element(); + + destroy(generalization); + + assertDestroyed(member); + } + + @Test + public void destroyRootDefinition() { + UMLRTNamedElement member = element(); + + destroy(member.getRootDefinition()); + + assertDestroyed(member); + } + + @Test + public void destroySpecificNamespace() { + UMLRTNamedElement member = element(); + + destroy(member.getRedefinitionContext()); + + assertDestroyed(member); + } + + @Test + public void tryToDestroyRedefinition() { + UMLRTNamedElement member = element(); + + assertThat("Can destroy non-root definition", getDestroyCommand(member), not(isExecutable())); + } + + // + // Test framework + // + + @Parameters(name = "{0}, {1}") + public static Iterable<Object[]> parameters() { + List<UMLRTInheritanceKind> inheritances = Arrays.asList( + UMLRTInheritanceKind.INHERITED, UMLRTInheritanceKind.REDEFINED, UMLRTInheritanceKind.EXCLUDED); + + // Cross product of inheritable element kind and inheritance kind + return Stream.of(TestElementKind.values()) + .flatMap(v -> inheritances.stream().map(i -> new Object[] { v, i })) + .collect(Collectors.toList()); + } + + <T extends UMLRTClassifier> T getSupertype(UMLRTClassifier classifier) { + return new UMLRTSwitch<T>() { + @SuppressWarnings("unchecked") + @Override + public T caseCapsule(UMLRTCapsule object) { + return (T) object.getSuperclass(); + } + + @SuppressWarnings("unchecked") + @Override + public T caseProtocol(UMLRTProtocol object) { + return (T) object.getSuperProtocol(); + } + }.doSwitch(classifier); + } + + UMLRTClassifier classifier() { + return elementKind.getTestClassifier(UMLRTPackage.getInstance(model.getModel())); + } + + UMLRTNamedElement element() { + return elementKind.getTestElement(model, classifier(), inheritanceKind); + } + + void destroy(UMLRTNamedElement element) { + destroy(element.toUML()); + } + + void destroy(Element element) { + ICommand destroy = getDestroyCommand(element); + assertThat(destroy, isExecutable()); + model.execute(destroy); + } + + ICommand getDestroyCommand(UMLRTNamedElement element) { + return getDestroyCommand(element.toUML()); + } + + ICommand getDestroyCommand(Element element) { + DestroyElementRequest request = new DestroyElementRequest(element, false); + + // Prime the cache maps as the Delete action in the UI does + Map<String, Object> cacheMaps = new HashMap<>(); + try { + RequestCacheEntries.initializeEObjCache(element, cacheMaps); + } catch (ServiceException e) { + e.printStackTrace(); + fail("Failed to initialize destroy command: " + e.getMessage()); + } + request.setParameter(RequestCacheEntries.Cache_Maps, cacheMaps); + + return ElementEditServiceUtils.getCommandProvider(element).getEditCommand(request); + } + + void assertDestroyed(UMLRTNamedElement element) { + assertDestroyed(element.toUML()); + } + + void assertDestroyed(Element element) { + assertThat("Not destroyed", element.eContainer(), nullValue()); + assertThat("Not detached", element.eResource(), nullValue()); + } + + enum TestElementKind { + PORT, CAPSULE_PART, CONNECTOR, PROTOCOL_MESSAGE; + + /** Get a subtype of more than first order. */ + UMLRTClassifier getTestClassifier(UMLRTPackage model) { + switch (this) { + case PORT: + case CAPSULE_PART: + case CONNECTOR: + return model.getCapsule("Subsubcapsule"); + case PROTOCOL_MESSAGE: + return model.getProtocol("Subsubprotocol"); + default: + throw new AssertionError("Invalid test element kind: " + this.name()); + } + } + + /** Get an element to verify its destruction. */ + UMLRTNamedElement getTestElement(UMLRTModelSetFixture fixture, UMLRTClassifier classifier, UMLRTInheritanceKind inheritance) { + UMLRTNamedElement result; + + switch (this) { + case PORT: + result = ((UMLRTCapsule) classifier).getPort("protocol1"); + break; + case CAPSULE_PART: + result = ((UMLRTCapsule) classifier).getCapsulePart("nestedCapsule"); + break; + case CONNECTOR: + result = ((UMLRTCapsule) classifier).getConnector("connector1"); + break; + case PROTOCOL_MESSAGE: + result = ((UMLRTProtocol) classifier).getMessage("greet"); + break; + default: + throw new AssertionError("Invalid test element kind: " + this.name()); + } + + switch (inheritance) { + case REDEFINED: + // Just change the name to redefine it + fixture.execute(() -> result.setName("$redefined$")); + break; + case EXCLUDED: + fixture.execute(() -> result.exclude()); + break; + default: + // Nothing to do for the inherited (or local) element + break; + } + + return result; + } + + @Override + public String toString() { + switch (this) { + case PORT: + return "port"; + case CAPSULE_PART: + return "capsule-part"; + case CONNECTOR: + return "connector"; + case PROTOCOL_MESSAGE: + return "protocol-message"; + default: + throw new AssertionError("Invalid test element kind: " + this.name()); + } + } + } +} diff --git a/tests/junit/umlrt/core/org.eclipse.papyrusrt.umlrt.core.tests/src/org/eclipse/papyrusrt/umlrt/core/tests/utils/AbstractRTPortTest.java b/tests/junit/umlrt/core/org.eclipse.papyrusrt.umlrt.core.tests/src/org/eclipse/papyrusrt/umlrt/core/tests/utils/AbstractRTPortTest.java index c668da33d..6f330a36b 100644 --- a/tests/junit/umlrt/core/org.eclipse.papyrusrt.umlrt.core.tests/src/org/eclipse/papyrusrt/umlrt/core/tests/utils/AbstractRTPortTest.java +++ b/tests/junit/umlrt/core/org.eclipse.papyrusrt.umlrt.core.tests/src/org/eclipse/papyrusrt/umlrt/core/tests/utils/AbstractRTPortTest.java @@ -1,5 +1,5 @@ /***************************************************************************** - * Copyright (c) 2014 CEA LIST. + * Copyright (c) 2014, 2016 CEA LIST, Christian W. Damus, and others. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 @@ -8,6 +8,7 @@ * * Contributors: * CEA LIST - Initial API and implementation + * Christian W. Damus - bug 467545 *****************************************************************************/ package org.eclipse.papyrusrt.umlrt.core.tests.utils; @@ -21,6 +22,7 @@ import org.eclipse.papyrus.infra.types.core.registries.ElementTypeSetConfigurati import org.eclipse.papyrus.junit.framework.classification.tests.AbstractPapyrusTest; import org.eclipse.papyrus.junit.utils.rules.ModelSetFixture; import org.eclipse.papyrus.junit.utils.rules.PluginResource; +import org.eclipse.papyrusrt.junit.rules.UMLRTModelSetFixture; import org.eclipse.papyrusrt.umlrt.core.Activator; import org.eclipse.papyrusrt.umlrt.core.utils.RTPortKindEnum; import org.eclipse.papyrusrt.umlrt.core.utils.RTPortUtils; @@ -66,10 +68,11 @@ public abstract class AbstractRTPortTest extends AbstractPapyrusTest { protected static Connector connectedCapsule_relayConnector; @ClassRule - public final static ModelSetFixture modelSetFixture = new ModelSetFixture(); + public final static ModelSetFixture modelSetFixture = new UMLRTModelSetFixture(); @BeforeClass public static void initModelElements() { + // capsules capsule = (Class) modelSetFixture.getModel().getMember("Capsule"); Assert.assertNotNull(capsule); |
