diff options
author | Benoit Maggi | 2017-05-15 13:42:51 +0000 |
---|---|---|
committer | Benoit Maggi | 2017-06-01 05:11:06 +0000 |
commit | fdf5650b204a1e3a625a08735d91bf1d8df0e098 (patch) | |
tree | fbbca998ceafa9642d475aa14fb342fcad29cd28 /plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric | |
parent | 735a84b375cb02b7c58c9a6540d4d070d1728822 (diff) | |
download | org.eclipse.papyrus-fdf5650b204a1e3a625a08735d91bf1d8df0e098.tar.gz org.eclipse.papyrus-fdf5650b204a1e3a625a08735d91bf1d8df0e098.tar.xz org.eclipse.papyrus-fdf5650b204a1e3a625a08735d91bf1d8df0e098.zip |
Bug 516687 - [SysML 1.1] Move SysML 1.1 to an independent repository
- remove sysml 1.1 plugins and feature from master branch
- note: some weak reference are still in the code a simple sysml grep
will show all remaining typos
Change-Id: I00173658659cfb5f3cec47391c6a3b1216bafcff
Signed-off-by: Benoit Maggi <benoit.maggi@cea.fr>
Diffstat (limited to 'plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric')
92 files changed, 0 insertions, 8515 deletions
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/.classpath b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/.classpath deleted file mode 100644 index f0c55498599..00000000000 --- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/.classpath +++ /dev/null @@ -1,8 +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.8"/> - <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> - <classpathentry kind="src" path="src"/> - <classpathentry kind="src" path="src-gen"/> - <classpathentry kind="output" path="bin"/> -</classpath> diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/.project b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/.project deleted file mode 100644 index a0701c1e4fb..00000000000 --- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/.project +++ /dev/null @@ -1,52 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<projectDescription> - <name>org.eclipse.papyrus.sysml.diagram.parametric</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.oomph.version.VersionBuilder</name> - <arguments> - <dictionary> - <key>check.maven.pom</key> - <value>true</value> - </dictionary> - <dictionary> - <key>ignore.lower.bound.dependency.ranges</key> - <value>true</value> - </dictionary> - <dictionary> - <key>release.path</key> - <value>/org.eclipse.papyrus.releng.main.release/release.xml</value> - </dictionary> - </arguments> - </buildCommand> - <buildCommand> - <name>org.eclipse.pde.api.tools.apiAnalysisBuilder</name> - <arguments> - </arguments> - </buildCommand> - </buildSpec> - <natures> - <nature>org.eclipse.pde.PluginNature</nature> - <nature>org.eclipse.jdt.core.javanature</nature> - <nature>org.eclipse.oomph.version.VersionNature</nature> - <nature>org.eclipse.pde.api.tools.apiAnalysisNature</nature> - </natures> -</projectDescription> diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/.settings/org.eclipse.jdt.core.prefs b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index f08be2b06c4..00000000000 --- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,291 +0,0 @@ -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 -org.eclipse.jdt.core.compiler.compliance=1.7 -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 diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/.settings/org.eclipse.jdt.ui.prefs b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/.settings/org.eclipse.jdt.ui.prefs deleted file mode 100644 index 954281dbc31..00000000000 --- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/.settings/org.eclipse.jdt.ui.prefs +++ /dev/null @@ -1,68 +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 -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> diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/.settings/org.eclipse.pde.api.tools.prefs b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/.settings/org.eclipse.pde.api.tools.prefs deleted file mode 100644 index 23fb95e120f..00000000000 --- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/.settings/org.eclipse.pde.api.tools.prefs +++ /dev/null @@ -1,98 +0,0 @@ -ANNOTATION_ELEMENT_TYPE_ADDED_METHOD_WITHOUT_DEFAULT_VALUE=Error -ANNOTATION_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error -ANNOTATION_ELEMENT_TYPE_REMOVED_FIELD=Error -ANNOTATION_ELEMENT_TYPE_REMOVED_METHOD=Error -ANNOTATION_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error -API_COMPONENT_ELEMENT_TYPE_REMOVED_API_TYPE=Error -API_COMPONENT_ELEMENT_TYPE_REMOVED_REEXPORTED_API_TYPE=Error -API_COMPONENT_ELEMENT_TYPE_REMOVED_REEXPORTED_TYPE=Error -API_COMPONENT_ELEMENT_TYPE_REMOVED_TYPE=Error -API_USE_SCAN_FIELD_SEVERITY=Error -API_USE_SCAN_METHOD_SEVERITY=Error -API_USE_SCAN_TYPE_SEVERITY=Error -CLASS_ELEMENT_TYPE_ADDED_METHOD=Error -CLASS_ELEMENT_TYPE_ADDED_RESTRICTIONS=Error -CLASS_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error -CLASS_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Error -CLASS_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error -CLASS_ELEMENT_TYPE_CHANGED_NON_ABSTRACT_TO_ABSTRACT=Error -CLASS_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Error -CLASS_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error -CLASS_ELEMENT_TYPE_REMOVED_CONSTRUCTOR=Error -CLASS_ELEMENT_TYPE_REMOVED_FIELD=Error -CLASS_ELEMENT_TYPE_REMOVED_METHOD=Error -CLASS_ELEMENT_TYPE_REMOVED_SUPERCLASS=Error -CLASS_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error -CLASS_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error -CONSTRUCTOR_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error -CONSTRUCTOR_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error -CONSTRUCTOR_ELEMENT_TYPE_CHANGED_VARARGS_TO_ARRAY=Error -CONSTRUCTOR_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error -ENUM_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Error -ENUM_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error -ENUM_ELEMENT_TYPE_REMOVED_ENUM_CONSTANT=Error -ENUM_ELEMENT_TYPE_REMOVED_FIELD=Error -ENUM_ELEMENT_TYPE_REMOVED_METHOD=Error -ENUM_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error -FIELD_ELEMENT_TYPE_ADDED_VALUE=Error -FIELD_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error -FIELD_ELEMENT_TYPE_CHANGED_FINAL_TO_NON_FINAL_STATIC_CONSTANT=Error -FIELD_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Error -FIELD_ELEMENT_TYPE_CHANGED_NON_STATIC_TO_STATIC=Error -FIELD_ELEMENT_TYPE_CHANGED_STATIC_TO_NON_STATIC=Error -FIELD_ELEMENT_TYPE_CHANGED_TYPE=Error -FIELD_ELEMENT_TYPE_CHANGED_VALUE=Error -FIELD_ELEMENT_TYPE_REMOVED_TYPE_ARGUMENT=Error -FIELD_ELEMENT_TYPE_REMOVED_VALUE=Error -ILLEGAL_EXTEND=Warning -ILLEGAL_IMPLEMENT=Warning -ILLEGAL_INSTANTIATE=Warning -ILLEGAL_OVERRIDE=Warning -ILLEGAL_REFERENCE=Warning -INTERFACE_ELEMENT_TYPE_ADDED_FIELD=Ignore -INTERFACE_ELEMENT_TYPE_ADDED_METHOD=Error -INTERFACE_ELEMENT_TYPE_ADDED_RESTRICTIONS=Error -INTERFACE_ELEMENT_TYPE_ADDED_SUPER_INTERFACE_WITH_METHODS=Error -INTERFACE_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error -INTERFACE_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Error -INTERFACE_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error -INTERFACE_ELEMENT_TYPE_REMOVED_FIELD=Error -INTERFACE_ELEMENT_TYPE_REMOVED_METHOD=Error -INTERFACE_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error -INTERFACE_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error -INVALID_ANNOTATION=Ignore -INVALID_JAVADOC_TAG=Ignore -INVALID_REFERENCE_IN_SYSTEM_LIBRARIES=Ignore -LEAK_EXTEND=Warning -LEAK_FIELD_DECL=Warning -LEAK_IMPLEMENT=Warning -LEAK_METHOD_PARAM=Warning -LEAK_METHOD_RETURN_TYPE=Warning -METHOD_ELEMENT_TYPE_ADDED_RESTRICTIONS=Error -METHOD_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error -METHOD_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error -METHOD_ELEMENT_TYPE_CHANGED_NON_ABSTRACT_TO_ABSTRACT=Error -METHOD_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Error -METHOD_ELEMENT_TYPE_CHANGED_NON_STATIC_TO_STATIC=Error -METHOD_ELEMENT_TYPE_CHANGED_STATIC_TO_NON_STATIC=Error -METHOD_ELEMENT_TYPE_CHANGED_VARARGS_TO_ARRAY=Error -METHOD_ELEMENT_TYPE_REMOVED_ANNOTATION_DEFAULT_VALUE=Error -METHOD_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error -MISSING_EE_DESCRIPTIONS=Error -TYPE_PARAMETER_ELEMENT_TYPE_ADDED_CLASS_BOUND=Error -TYPE_PARAMETER_ELEMENT_TYPE_ADDED_INTERFACE_BOUND=Error -TYPE_PARAMETER_ELEMENT_TYPE_CHANGED_CLASS_BOUND=Error -TYPE_PARAMETER_ELEMENT_TYPE_CHANGED_INTERFACE_BOUND=Error -TYPE_PARAMETER_ELEMENT_TYPE_REMOVED_CLASS_BOUND=Error -TYPE_PARAMETER_ELEMENT_TYPE_REMOVED_INTERFACE_BOUND=Error -UNUSED_PROBLEM_FILTERS=Warning -automatically_removed_unused_problem_filters=Enabled -eclipse.preferences.version=1 -incompatible_api_component_version=Error -incompatible_api_component_version_include_major_without_breaking_change=Disabled -incompatible_api_component_version_include_minor_without_api_change=Disabled -invalid_since_tag_version=Error -malformed_since_tag=Error -missing_since_tag=Warning -report_api_breakage_when_major_version_incremented=Disabled -report_resolution_errors_api_component=Warning diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/META-INF/MANIFEST.MF b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/META-INF/MANIFEST.MF deleted file mode 100644 index 26bfc574664..00000000000 --- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/META-INF/MANIFEST.MF +++ /dev/null @@ -1,29 +0,0 @@ -Manifest-Version: 1.0 -Export-Package: org.eclipse.papyrus.sysml.diagram.parametric, - org.eclipse.papyrus.sysml.diagram.parametric.commands, - org.eclipse.papyrus.sysml.diagram.parametric.edit.part, - org.eclipse.papyrus.sysml.diagram.parametric.edit.policy, - org.eclipse.papyrus.sysml.diagram.parametric.factory, - org.eclipse.papyrus.sysml.diagram.parametric.figures, - org.eclipse.papyrus.sysml.diagram.parametric.parser, - org.eclipse.papyrus.sysml.diagram.parametric.part, - org.eclipse.papyrus.sysml.diagram.parametric.policies, - org.eclipse.papyrus.sysml.diagram.parametric.preferences, - org.eclipse.papyrus.sysml.diagram.parametric.provider, - org.eclipse.papyrus.sysml.diagram.parametric.utils -Bundle-ActivationPolicy: lazy -Bundle-Name: %pluginName -Bundle-Localization: plugin -Bundle-RequiredExecutionEnvironment: J2SE-1.5 -Require-Bundle: org.eclipse.gmf.runtime.diagram.ui.providers;bundle-version="[1.7.0,2.0.0)", - org.eclipse.papyrus.sysml.service.types;bundle-version="[2.0.0,3.0.0)", - org.eclipse.papyrus.infra.gmfdiag.navigation;bundle-version="[2.0.0,3.0.0)", - org.eclipse.papyrus.sysml.diagram.internalblock;bundle-version="[3.0.0,4.0.0)", - org.eclipse.papyrus.uml.diagram.clazz;bundle-version="[3.0.0,4.0.0)", - org.eclipse.papyrus.infra.properties.ui;bundle-version="[2.0.0,3.0.0)", - org.eclipse.papyrus.infra.internationalization.utils;bundle-version="[1.0.0,2.0.0)" -Bundle-Vendor: %providerName -Bundle-Version: 2.0.0.qualifier -Bundle-ManifestVersion: 2 -Bundle-Activator: org.eclipse.papyrus.sysml.diagram.parametric.Activator -Bundle-SymbolicName: org.eclipse.papyrus.sysml.diagram.parametric;singleton:=true diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/about.html b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/about.html deleted file mode 100644 index d35d5aed64c..00000000000 --- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/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>June 5, 2007</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> diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/build.properties b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/build.properties deleted file mode 100644 index 70eddf30d23..00000000000 --- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/build.properties +++ /dev/null @@ -1,12 +0,0 @@ -source.. = src/,\ - src-gen/ -output.. = bin/ -bin.includes = META-INF/,\ - .,\ - plugin.properties,\ - plugin.xml,\ - palettes/,\ - icons/,\ - about.html,\ - model/ -src.includes = model/ diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/icons/obj16/Diagram_Parametric.png b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/icons/obj16/Diagram_Parametric.png Binary files differdeleted file mode 100644 index 2b3e965c7e1..00000000000 --- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/icons/obj16/Diagram_Parametric.png +++ /dev/null diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/icons/wizban/NewResourceWizard.gif b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/icons/wizban/NewResourceWizard.gif Binary files differdeleted file mode 100644 index 93641ae9d67..00000000000 --- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/icons/wizban/NewResourceWizard.gif +++ /dev/null diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/model/SysML.Parametric.idgen b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/model/SysML.Parametric.idgen deleted file mode 100644 index 4db68156930..00000000000 --- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/model/SysML.Parametric.idgen +++ /dev/null @@ -1,124 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<idgen:Diagram xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:gmfgen="http://www.eclipse.org/gmf/2009/GenModel" xmlns:idgen="http://www.eclipse.org/papyrus/0.7.0/idgen" name="Parametric" type="Parametric" icon="icons/obj16/Diagram_Parametric.gif" label="SysML Parametric Diagram" language="sysml" javaPackagePrefix="org.eclipse.papyrus.sysml.diagram.parametric" javaClassPrefix="ParametricDiagram" createCommandLabel="Create a new Parametric Diagram"> - <diagramEditPart name="Diagram edit part"> - <behaviors javaClassQualifiedName="org.eclipse.papyrus.uml.diagram.common.editpolicies.DuplicatePasteEditPolicy" key="DuplicatePasteEditPolicy.PASTE_ROLE"/> - <behaviors javaClassQualifiedName="org.eclipse.papyrus.sysml.diagram.internalblock.edit.policy.CustomDragDropEditPolicy" key="EditPolicyRoles.DRAG_DROP_ROLE"/> - <behaviors javaClassQualifiedName="org.eclipse.papyrus.gmf.diagram.common.edit.policy.DefaultXYLayoutEditPolicy" key="EditPolicy.LAYOUT_ROLE"/> - <behaviors name="" javaClassQualifiedName="org.eclipse.papyrus.gmf.diagram.common.edit.policy.DefaultCreationEditPolicy" key="EditPolicyRoles.CREATION_ROLE"/> - <behaviors javaClassQualifiedName="org.eclipse.papyrus.gmf.diagram.common.edit.policy.DefaultContainerNodeEditPolicy" key="EditPolicy.GRAPHICAL_NODE_ROLE"/> - </diagramEditPart> - <inheritedDiagrams name="CompositeDiagram" viewProviderClassQualifiedName="" editPartProviderClassQualifiedName="" dndEditPolicyClassQualifiedName="org.eclipse.papyrus.uml.diagram.composite.custom.edit.policies.CustomDiagramDragDropEditPolicy"> - <genInheritedEditor href="../../org.eclipse.papyrus.uml.diagram.composite/model/compositediagram.gmfgen#CompositeStructure"/> - <genNodes> - <genNode xsi:type="gmfgen:GenTopLevelNode" href="../../org.eclipse.papyrus.uml.diagram.composite/model/compositediagram.gmfgen#/0/@diagram/@topLevelNodes.48"/> - <semanticType href="../../org.eclipse.papyrus.sysml.diagram.common/model/UML.ReusableParts.idgen#org.eclipse.papyrus.uml.Constraint"/> - </genNodes> - <genNodes generatePreferencePage="false" generateTool="false"> - <genNode xsi:type="gmfgen:GenChildNode" href="../../org.eclipse.papyrus.uml.diagram.composite/model/compositediagram.gmfgen#/0/@diagram/@childNodes.27"/> - <semanticType href="../../org.eclipse.papyrus.sysml.diagram.common/model/UML.ReusableParts.idgen#org.eclipse.papyrus.uml.Comment"/> - </genNodes> - <genNodes> - <genNode xsi:type="gmfgen:GenTopLevelNode" href="../../org.eclipse.papyrus.uml.diagram.composite/model/compositediagram.gmfgen#/0/@diagram/@topLevelNodes.43"/> - <semanticType href="../../org.eclipse.papyrus.sysml.diagram.common/model/UML.ReusableParts.idgen#org.eclipse.papyrus.uml.Comment"/> - </genNodes> - <genNodes generatePreferencePage="false" generateTool="false"> - <genNode xsi:type="gmfgen:GenChildNode" href="../../org.eclipse.papyrus.uml.diagram.composite/model/compositediagram.gmfgen#/0/@diagram/@childNodes.32"/> - <semanticType href="../../org.eclipse.papyrus.sysml.diagram.common/model/UML.ReusableParts.idgen#org.eclipse.papyrus.uml.Constraint"/> - </genNodes> - <genLinks> - <genLink href="../../org.eclipse.papyrus.uml.diagram.composite/model/compositediagram.gmfgen#/0/@diagram/@links.1"/> - </genLinks> - <genLinks> - <genLink href="../../org.eclipse.papyrus.uml.diagram.composite/model/compositediagram.gmfgen#/0/@diagram/@links.2"/> - </genLinks> - </inheritedDiagrams> - <customJavaClasses name="" customEditPolicyProvider="org.eclipse.papyrus.sysml.diagram.internalblock.CustomEditPolicyProvider" customPreferenceInitializer="org.eclipse.papyrus.sysml.diagram.parametric.preferences.CustomPreferenceInitializer"/> - <usedCustomNodes href="../../org.eclipse.papyrus.sysml.diagram.common/model/SysML.ReusableParts.idgen#shape_sysml_block_as_composite"/> - <usedCustomNodes href="../../org.eclipse.papyrus.sysml.diagram.common/model/SysML.ReusableParts.idgen#shape_sysml_blockproperty_as_composite"/> - <usedCustomNodes href="../../org.eclipse.papyrus.sysml.diagram.common/model/SysML.ReusableParts.idgen#shape_sysml_flowport_as_affixed"/> - <usedCustomNodes href="../../org.eclipse.papyrus.sysml.diagram.common/model/UML.ReusableParts.idgen#shape_uml_port_as_affixed"/> - <usedCustomEdges href="../../org.eclipse.papyrus.sysml.diagram.common/model/UML.ReusableParts.idgen#link_uml_connector"/> - <usedCustomEdges href="../../org.eclipse.papyrus.sysml.diagram.common/model/UML.ReusableParts.idgen#link_uml_dependency"/> - <usedCustomDecorations href="../../org.eclipse.papyrus.sysml.diagram.common/model/SysML.ReusableParts.idgen#label_sysml_block_name"/> - <usedCustomDecorations href="../../org.eclipse.papyrus.sysml.diagram.common/model/SysML.ReusableParts.idgen#affixedlabel_sysml_flowport_label"/> - <usedCustomDecorations href="../../org.eclipse.papyrus.sysml.diagram.common/model/UML.ReusableParts.idgen#affixedlabel_uml_appliedstereotype"/> - <usedCustomDecorations href="../../org.eclipse.papyrus.sysml.diagram.common/model/UML.ReusableParts.idgen#affixedlabel_uml_port_label"/> - <usedCustomDecorations href="../../org.eclipse.papyrus.sysml.diagram.common/model/SysML.ReusableParts.idgen#compartment_sysml_structure"/> - <usedCustomDecorations href="../../org.eclipse.papyrus.sysml.diagram.common/model/SysML.ReusableParts.idgen#compartment_sysml_blockproperty_structure"/> - <usedCustomDecorations href="../../org.eclipse.papyrus.sysml.diagram.common/model/UML.ReusableParts.idgen#label_uml_property_label"/> - <usedCustomDecorations href="../../org.eclipse.papyrus.sysml.diagram.common/model/UML.ReusableParts.idgen#linklabel_uml_appliedstereotype"/> - <usedCustomDecorations href="../../org.eclipse.papyrus.sysml.diagram.common/model/UML.ReusableParts.idgen#linklabel_uml_connector_label"/> - <usedCustomDecorations href="../../org.eclipse.papyrus.sysml.diagram.common/model/UML.ReusableParts.idgen#linklabel_uml_connector_source_multiplicity"/> - <usedCustomDecorations href="../../org.eclipse.papyrus.sysml.diagram.common/model/UML.ReusableParts.idgen#linklabel_uml_connector_target_multiplicity"/> - <usedCustomDecorations href="../../org.eclipse.papyrus.sysml.diagram.common/model/UML.ReusableParts.idgen#linklabel_uml_namedelement_name"/> - <diagramConfig> - <contains xsi:type="idgen:GraphicalTypeDiagramRef"> - <contains> - <ref href="../../org.eclipse.papyrus.sysml.diagram.common/model/SysML.ReusableParts.idgen#shape_sysml_block_as_composite"/> - <contains> - <ref href="../../org.eclipse.papyrus.sysml.diagram.common/model/SysML.ReusableParts.idgen#shape_sysml_flowport_as_affixed"/> - </contains> - <contains> - <ref href="../../org.eclipse.papyrus.sysml.diagram.common/model/UML.ReusableParts.idgen#shape_uml_port_as_affixed"/> - </contains> - <contains> - <ref href="../../org.eclipse.papyrus.sysml.diagram.common/model/SysML.ReusableParts.idgen#compartment_sysml_structure"/> - </contains> - <contains> - <ref href="../../org.eclipse.papyrus.sysml.diagram.common/model/SysML.ReusableParts.idgen#shape_sysml_blockproperty_as_composite"/> - <contains> - <ref href="../../org.eclipse.papyrus.sysml.diagram.common/model/SysML.ReusableParts.idgen#shape_sysml_flowport_as_affixed"/> - </contains> - <contains> - <ref href="../../org.eclipse.papyrus.sysml.diagram.common/model/UML.ReusableParts.idgen#shape_uml_port_as_affixed"/> - </contains> - <contains> - <ref href="../../org.eclipse.papyrus.sysml.diagram.common/model/SysML.ReusableParts.idgen#compartment_sysml_blockproperty_structure"/> - <contains> - <ref href="../../org.eclipse.papyrus.sysml.diagram.common/model/SysML.ReusableParts.idgen#shape_sysml_blockproperty_as_composite"/> - </contains> - </contains> - </contains> - <contains> - <ref href="../../org.eclipse.papyrus.sysml.diagram.common/model/SysML.ReusableParts.idgen#shape_sysml_constraintblockproperty_as_composite"/> - <contains> - <ref href="../../org.eclipse.papyrus.sysml.diagram.common/model/UML.ReusableParts.idgen#shape_uml_property_as_label"/> - </contains> - <contains> - <ref href="../../org.eclipse.papyrus.sysml.diagram.common/model/SysML.ReusableParts.idgen#compartment_sysml_blockproperty_structure"/> - <contains> - <ref href="../../org.eclipse.papyrus.sysml.diagram.common/model/SysML.ReusableParts.idgen#shape_sysml_constraintblockproperty_as_composite"/> - </contains> - <contains> - <ref href="../../org.eclipse.papyrus.sysml.diagram.common/model/UML.ReusableParts.idgen#label_uml_property_label"/> - </contains> - </contains> - </contains> - </contains> - <contains> - <ref href="../../org.eclipse.papyrus.sysml.diagram.common/model/UML.ReusableParts.idgen#link_uml_dependency"/> - </contains> - <contains> - <ref href="../../org.eclipse.papyrus.sysml.diagram.common/model/UML.ReusableParts.idgen#link_uml_connector"/> - </contains> - </contains> - <contains> - <ref href="../../org.eclipse.papyrus.sysml.diagram.common/model/SysML.ReusableParts.idgen#compartment_sysml_structure"/> - <contains> - <ref href="../../org.eclipse.papyrus.sysml.diagram.common/model/SysML.ReusableParts.idgen#shape_sysml_blockproperty_as_composite"/> - </contains> - <contains> - <ref href="../../org.eclipse.papyrus.sysml.diagram.common/model/SysML.ReusableParts.idgen#shape_sysml_constraintblockproperty_as_composite"/> - </contains> - </contains> - <contains> - <ref href="../../org.eclipse.papyrus.sysml.diagram.common/model/SysML.ReusableParts.idgen#compartment_sysml_blockproperty_structure"/> - <contains> - <ref href="../../org.eclipse.papyrus.sysml.diagram.common/model/SysML.ReusableParts.idgen#shape_sysml_blockproperty_as_composite"/> - </contains> - <contains> - <ref href="../../org.eclipse.papyrus.sysml.diagram.common/model/SysML.ReusableParts.idgen#shape_sysml_constraintblockproperty_as_composite"/> - </contains> - </contains> - </diagramConfig> -</idgen:Diagram> diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/palettes/PapyrusSYSMLParametricDiagram.paletteconfiguration b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/palettes/PapyrusSYSMLParametricDiagram.paletteconfiguration deleted file mode 100644 index e23ba26ed7c..00000000000 --- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/palettes/PapyrusSYSMLParametricDiagram.paletteconfiguration +++ /dev/null @@ -1,78 +0,0 @@ -<?xml version="1.0" encoding="ASCII"?>
-<paletteconfiguration:PaletteConfiguration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:elementtypesconfigurations="http://www.eclipse.org/papyrus/infra/elementtypesconfigurations/1.2" xmlns:paletteconfiguration="http://www.eclipse.org/papyrus/diagram/paletteconfiguration/0.8" id="org.eclipse.papyrus.sysml.diagram.parametric.paletteconfiguration" label="org.eclipse.papyrus.sysml.diagram.parametric Palette" description="This is the palette of PapyrusSysMLParametricDiagram">
- <drawerConfigurations id="parametric.drawer.nodes" label="Nodes">
- <icon pluginID="org.eclipse.gmf.runtime.diagram.ui" iconPath="/icons/group.gif"/>
- <ownedConfigurations xsi:type="paletteconfiguration:ToolConfiguration" id="parametric.tool.constraintblockpropertycomposite" label="ConstraintProperty" description="Create a new ConstraintProperty">
- <icon pluginID="org.eclipse.papyrus.sysml" iconPath="/icons/blocks/Block.gif"/>
- <elementDescriptors>
- <elementType xsi:type="elementtypesconfigurations:SpecializationTypeConfiguration" href="platform:/plugin/org.eclipse.papyrus.sysml.service.types/model/sysml.elementtypesconfigurations#org.eclipse.papyrus.sysml.ConstraintProperty"/>
- </elementDescriptors>
- </ownedConfigurations>
- <ownedConfigurations xsi:type="paletteconfiguration:ToolConfiguration" id="parametric.tool.parameter" label="ConstraintParameter" description="Create a new ConstraintParameter">
- <icon pluginID="org.eclipse.uml2.uml.edit" iconPath="/icons/full/obj16/Port.gif"/>
- <elementDescriptors>
- <elementType xsi:type="elementtypesconfigurations:MetamodelTypeConfiguration" href="platform:/plugin/org.eclipse.papyrus.uml.service.types/model/uml.elementtypesconfigurations#org.eclipse.papyrus.uml.Property"/>
- </elementDescriptors>
- </ownedConfigurations>
- <ownedConfigurations xsi:type="paletteconfiguration:ToolConfiguration" id="parametric.tool.blockpropertycomposite" label="Part" description="Create a new Part">
- <icon pluginID="org.eclipse.uml2.uml.edit" iconPath="/icons/full/obj16/Property.gif"/>
- <elementDescriptors>
- <elementType xsi:type="elementtypesconfigurations:SpecializationTypeConfiguration" href="platform:/plugin/org.eclipse.papyrus.sysml.service.types/model/sysml.elementtypesconfigurations#org.eclipse.papyrus.sysml.PartProperty"/>
- </elementDescriptors>
- </ownedConfigurations>
- <ownedConfigurations xsi:type="paletteconfiguration:ToolConfiguration" id="parametric.tool.reference" label="Reference" description="Create a new Reference">
- <icon pluginID="org.eclipse.uml2.uml.edit" iconPath="/icons/full/obj16/Property.gif"/>
- <elementDescriptors>
- <elementType xsi:type="elementtypesconfigurations:SpecializationTypeConfiguration" href="platform:/plugin/org.eclipse.papyrus.sysml.service.types/model/sysml.elementtypesconfigurations#org.eclipse.papyrus.sysml.ReferenceProperty"/>
- </elementDescriptors>
- </ownedConfigurations>
- <ownedConfigurations xsi:type="paletteconfiguration:ToolConfiguration" id="parametric.tool.value" label="Value" description="Create a new Value">
- <icon pluginID="org.eclipse.uml2.uml.edit" iconPath="/icons/full/obj16/Property.gif"/>
- <elementDescriptors>
- <elementType xsi:type="elementtypesconfigurations:SpecializationTypeConfiguration" href="platform:/plugin/org.eclipse.papyrus.sysml.service.types/model/sysml.elementtypesconfigurations#org.eclipse.papyrus.sysml.ValueProperty"/>
- </elementDescriptors>
- </ownedConfigurations>
- </drawerConfigurations>
- <drawerConfigurations id="parametric.drawer.edges" label="Edges">
- <icon pluginID="org.eclipse.gmf.runtime.diagram.ui" iconPath="/icons/group.gif"/>
- <ownedConfigurations xsi:type="paletteconfiguration:ToolConfiguration" id="parametric.tool.connector" label="BindingConnector" description="Create a new BindingConnector" kind="ConnectionTool">
- <icon pluginID="org.eclipse.uml2.uml.edit" iconPath="/icons/full/obj16/Connector.gif"/>
- <elementDescriptors>
- <elementType xsi:type="elementtypesconfigurations:MetamodelTypeConfiguration" href="platform:/plugin/org.eclipse.papyrus.uml.service.types/model/uml.elementtypesconfigurations#org.eclipse.papyrus.uml.Connector"/>
- </elementDescriptors>
- </ownedConfigurations>
- </drawerConfigurations>
- <drawerConfigurations id="parametric.drawer.others" label="Others">
- <icon pluginID="org.eclipse.gmf.runtime.diagram.ui" iconPath="/icons/group.gif"/>
- <ownedConfigurations xsi:type="paletteconfiguration:ToolConfiguration" id="parametric.tool.dependency" label="Dependency" description="Create a new Dependency" kind="ConnectionTool">
- <icon pluginID="org.eclipse.uml2.uml.edit" iconPath="/icons/full/obj16/Dependency.gif"/>
- <elementDescriptors>
- <elementType xsi:type="elementtypesconfigurations:MetamodelTypeConfiguration" href="platform:/plugin/org.eclipse.papyrus.uml.service.types/model/uml.elementtypesconfigurations#org.eclipse.papyrus.uml.Dependency"/>
- </elementDescriptors>
- </ownedConfigurations>
- <ownedConfigurations xsi:type="paletteconfiguration:ToolConfiguration" id="parametric.tool.comment" label="Comment" description="Create a new Comment">
- <icon pluginID="org.eclipse.uml2.uml.edit" iconPath="/icons/full/obj16//Comment.gif"/>
- <elementDescriptors>
- <elementType xsi:type="elementtypesconfigurations:MetamodelTypeConfiguration" href="platform:/plugin/org.eclipse.papyrus.uml.service.types/model/uml.elementtypesconfigurations#org.eclipse.papyrus.uml.Comment"/>
- </elementDescriptors>
- </ownedConfigurations>
- <ownedConfigurations xsi:type="paletteconfiguration:ToolConfiguration" id="parametric.tool.constraint" label="Constraint" description="Create a new Constraint">
- <icon pluginID="org.eclipse.uml2.uml.edit" iconPath="/icons/full/obj16/Constraint.gif"/>
- <elementDescriptors>
- <elementType xsi:type="elementtypesconfigurations:MetamodelTypeConfiguration" href="platform:/plugin/org.eclipse.papyrus.uml.service.types/model/uml.elementtypesconfigurations#org.eclipse.papyrus.uml.Constraint"/>
- </elementDescriptors>
- </ownedConfigurations>
- <ownedConfigurations xsi:type="paletteconfiguration:ToolConfiguration" id="parametric.tool.commentannotatedelement" label="CommentAnnotatedElement" description="Create a new CommentAnnotatedElement" kind="ConnectionTool">
- <icon pluginID="org.eclipse.papyrus.sysml.diagram.blockdefinition" iconPath="/icons/obj16/Link.gif"/>
- <elementDescriptors>
- <elementType xsi:type="elementtypesconfigurations:SpecializationTypeConfiguration" href="platform:/plugin/org.eclipse.papyrus.uml.service.types/model/umldi.elementtypesconfigurations#org.eclipse.papyrus.umldi.Comment_AnnotatedElementEdge"/>
- </elementDescriptors>
- </ownedConfigurations>
- <ownedConfigurations xsi:type="paletteconfiguration:ToolConfiguration" id="parametric.tool.context_link" label="ContextLink" description="Create a new ContextLink" kind="ConnectionTool">
- <icon pluginID="org.eclipse.papyrus.sysml.diagram.blockdefinition" iconPath="/icons/obj16/Link.gif"/>
- <elementDescriptors>
- <elementType xsi:type="elementtypesconfigurations:SpecializationTypeConfiguration" href="platform:/plugin/org.eclipse.papyrus.uml.service.types/model/umldi.elementtypesconfigurations#org.eclipse.papyrus.umldi.Constraint_ContextEdge"/>
- </elementDescriptors>
- </ownedConfigurations>
- </drawerConfigurations>
-</paletteconfiguration:PaletteConfiguration>
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/palettes/parametric.palette.xml b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/palettes/parametric.palette.xml deleted file mode 100644 index f385c0ec607..00000000000 --- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/palettes/parametric.palette.xml +++ /dev/null @@ -1,44 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<paletteDefinition> - <content> - <drawer id="parametric.drawer.nodes" name="Nodes" iconpath="platform:/plugin/org.eclipse.gmf.runtime.diagram.ui/icons/group.gif"> - <aspectTool description="Create a new ConstraintProperty" id="parametric.tool.constraintblockpropertycomposite" - name="ConstraintProperty" refToolId="parametric.tool.constraintblockpropertycomposite"> - </aspectTool> - <aspectTool description="Create a new ConstraintParameter" id="parametric.tool.parameter" - name="ConstraintParameter" refToolId="parametric.tool.parameter"> - </aspectTool> - <aspectTool description="Create a new Part" id="parametric.tool.blockpropertycomposite" - name="Part" refToolId="parametric.tool.blockpropertycomposite"> - </aspectTool> - <aspectTool description="Create a new Reference" id="parametric.tool.reference" - name="Reference" refToolId="parametric.tool.reference"> - </aspectTool> - <aspectTool description="Create a new Value" id="parametric.tool.value" - name="Value" refToolId="parametric.tool.value"> - </aspectTool> - </drawer> - <drawer id="parametric.drawer.edges" name="Edges" iconpath="platform:/plugin/org.eclipse.gmf.runtime.diagram.ui/icons/group.gif"> - <aspectTool description="Create a new BindingConnector" id="parametric.tool.connector" - name="BindingConnector" refToolId="parametric.tool.connector"> - </aspectTool> - </drawer> - <drawer id="parametric.drawer.others" name="Others" iconpath="platform:/plugin/org.eclipse.gmf.runtime.diagram.ui/icons/group.gif"> - <aspectTool description="Create a new Dependency" id="parametric.tool.dependency" - name="Dependency" refToolId="parametric.tool.dependency"> - </aspectTool> - <aspectTool description="Create a new Comment" id="parametric.tool.comment" - name="Comment" refToolId="parametric.tool.comment"> - </aspectTool> - <aspectTool description="Create a new Constraint" id="parametric.tool.constraint" - name="Constraint" refToolId="parametric.tool.constraint"> - </aspectTool> - <aspectTool description="Create a new CommentAnnotatedElement" id="parametric.tool.commentannotatedelement" - name="CommentAnnotatedElement" refToolId="parametric.tool.comment_constraint_link"> - </aspectTool> - <aspectTool description="Create a new ContextLink" id="parametric.tool.context_link" - name="ContextLink" refToolId="parametric.tool.context_link"> - </aspectTool> - </drawer> - </content> -</paletteDefinition> diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/plugin.properties b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/plugin.properties deleted file mode 100644 index 6f678bf8b44..00000000000 --- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/plugin.properties +++ /dev/null @@ -1,14 +0,0 @@ -################################################################################# -# Copyright (c) 2010 CEA LIST. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/epl-v10.html -# -# Contributors: -# Yann Tanguy (CEA LIST) yann.tanguy@cea.fr - initial API and implementation -################################################################################## -pluginName=SysML Parametric Diagram -providerName=Eclipse Modeling Project -context.description=Papyrus SysML Parametric Diagram Editing -context.name=In Papyrus SysML Parametric Diagram Editor diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/plugin.xml b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/plugin.xml deleted file mode 100644 index 44487bcb7a8..00000000000 --- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/plugin.xml +++ /dev/null @@ -1,561 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<?eclipse version="3.4"?> -<plugin> - -<extension point="org.eclipse.ui.contexts" id="ui-context"> - <?gmfgen generated="true"?> - <context - description="%context.description" - id="org.eclipse.papyrus.sysml.diagram.parametric.ui.diagramContext" - name="%context.name" - parentId="org.eclipse.gmf.runtime.diagram.ui.diagramContext"> - </context> -</extension> - -<!-- Diagram declaration --> -<extension point="org.eclipse.papyrus.infra.ui.papyrusDiagram"> - <creationCommand - creationCommandClass="org.eclipse.papyrus.sysml.diagram.parametric.ParametricDiagramCreateCommand" - icon="icons/obj16/Diagram_Parametric.png" - id="org.eclipse.papyrus.sysml.diagram.parametric.CreateCommand" - language="sysml" - label="Parametric Diagram"/> - <editorDiagram - actionBarContributorId="org.eclipse.papyrus.uml.diagram.common.part.UMLDiagramActionBarContributor" - factoryClass="org.eclipse.papyrus.sysml.diagram.parametric.ParametricDiagramEditorFactory" - icon="icons/obj16/Diagram_Parametric.png" /> -</extension> - -<!-- Diagram creation command and handler --> -<extension point="org.eclipse.ui.commands"> - <command id="org.eclipse.papyrus.sysml.diagram.parametric.CreateCommand" - name="Create a new Parametric Diagram" - description="Create a new Parametric Diagram" - categoryId="org.eclipse.papyrus.editor.category"/> - <command - categoryId="org.eclipse.papyrus.editor.category" - description="Switch ConstraintProperty Representation" - defaultHandler="org.eclipse.papyrus.sysml.diagram.parametric.commands.switchrepresentation.SwitchConstraintPropertyRepresentationCommandHandler" - id="org.eclipse.papyrus.sysml.diagram.parametric.custom.switchConstraintProperty" - name="Switch ConstraintProperty Representation"/> - <command - categoryId="org.eclipse.papyrus.editor.category" - description="Show/Hide ConstraintExpression" - defaultHandler="org.eclipse.papyrus.sysml.diagram.parametric.commands.switchrepresentation.ShowHideConstraintExpressionCommandHandler" - id="org.eclipse.papyrus.sysml.diagram.parametric.custom.showHideConstraintExpression" - name="Show/Hide Constraint expression"/> -</extension> - - -<!-- Diagram creation command registration in menu and toolbar --> -<extension point="org.eclipse.ui.menus"> - - - <menuContribution locationURI="popup:org.eclipse.papyrus.uml.diagram.ui.popupmenu.format"> - <menu - label="Representation" - tooltip="Representation"> - <command - commandId="org.eclipse.papyrus.sysml.diagram.parametric.custom.switchConstraintProperty" - label="Switch ConstraintProperty representation" - style="push" - tooltip="Switch ConstraintProperty representation"> - <visibleWhen> - <and> - <iterate> - <instanceof - value="org.eclipse.papyrus.sysml.diagram.parametric.edit.part.CustomConstraintBlockPropertyCompositeEditPart"> - </instanceof> - </iterate> - <with - variable="selection"> - <not> - <count - value="0"> - </count> - </not> - </with> - </and> - </visibleWhen> - </command> - </menu> - <separator - name="org.eclipse.papyrus.uml.diagram.menu.popup.separatorRepresentation" - visible="true"> - </separator> - </menuContribution> - - <menuContribution locationURI="popup:org.eclipse.papyrus.uml.diagram.ui.popupmenu.filters"> - <command - commandId="org.eclipse.papyrus.sysml.diagram.parametric.custom.showHideConstraintExpression" - icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Constraint.gif" - label="Show/Hide Constraint expression" - style="push" - tooltip="Show/Hide Constraint expression"> - <visibleWhen> - <and> - <iterate> - <instanceof - value="org.eclipse.papyrus.sysml.diagram.parametric.edit.part.CustomConstraintBlockPropertyCompositeEditPart"> - </instanceof> - </iterate> - <with - variable="selection"> - <not> - <count - value="0"> - </count> - </not> - </with> - </and> - </visibleWhen> - </command> - </menuContribution> -</extension> - - -<extension - id="update-cmd-binding" - point="org.eclipse.ui.bindings"> - <key - commandId="org.eclipse.papyrus.sysml.diagram.parametric.custom.switchConstraintProperty" - contextId="org.eclipse.gmf.runtime.diagram.ui.diagramContext" - schemeId="org.eclipse.ui.defaultAcceleratorConfiguration" - sequence="CTRL+R"> - </key> -</extension> - -<!-- Handler for Show/Hide content on Part or Ref. --> -<extension point="org.eclipse.ui.handlers"> - <handler class="org.eclipse.papyrus.sysml.diagram.parametric.handler.ShowHideRelatedContentsHandler" commandId="org.eclipse.papyrus.uml.diagram.menu.commands.ShowHideContentsCommand"> - <activeWhen> - <and> - <with variable="activeEditor"> - <test property="org.eclipse.papyrus.uml.diagram.common.diagram.tester.diagramType" value="Parametric" forcePluginActivation="true"></test> - </with> - <with variable="showHideRelatedContents"> - <equals value="enabled"></equals> - </with> - <with variable="selection"> - <iterate ifEmpty="false" operator="and"> - <instanceof value="org.eclipse.papyrus.sysml.diagram.common.edit.part.ConstraintBlockPropertyCompositeEditPart"></instanceof> - </iterate> - </with> - </and> - - </activeWhen> - </handler> - <handler class="org.eclipse.papyrus.sysml.diagram.parametric.handler.ShowHideRelatedContentsHandler" commandId="org.eclipse.papyrus.uml.diagram.menu.commands.ShowHideContentsCommand"> - <activeWhen> - <and> - <with variable="activeEditor"> - <test property="org.eclipse.papyrus.uml.diagram.common.diagram.tester.diagramType" value="Parametric" forcePluginActivation="true"></test> - </with> - <with variable="showHideRelatedContents"> - <equals value="enabled"></equals> - </with> - <with variable="selection"> - <iterate ifEmpty="false" operator="and"> - <instanceof value="org.eclipse.papyrus.sysml.diagram.parametric.edit.part.CustomBlockCompositeEditPartTN"></instanceof> - </iterate> - </with> - </and> - - </activeWhen> - </handler> - <handler class="org.eclipse.papyrus.sysml.diagram.parametric.handler.ShowHideRelatedContentsHandler" commandId="org.eclipse.papyrus.uml.diagram.menu.commands.ShowHideContentsCommand"> - <activeWhen> - <and> - <with variable="activeEditor"> - <test property="org.eclipse.papyrus.uml.diagram.common.diagram.tester.diagramType" value="Parametric" forcePluginActivation="true"></test> - </with> - <with variable="showHideRelatedContents"> - <equals value="enabled"></equals> - </with> - <with variable="selection"> - <iterate ifEmpty="false" operator="and"> - <instanceof value="org.eclipse.papyrus.sysml.diagram.common.edit.part.BlockPropertyCompositeEditPart"></instanceof> - </iterate> - </with> - </and> - - </activeWhen> - </handler> -</extension> - -<!-- Diagram view providers declaration --> -<extension point="org.eclipse.gmf.runtime.diagram.core.viewProviders"> - <!-- Diagram view provider --> - <viewProvider class="org.eclipse.papyrus.sysml.diagram.parametric.provider.ParametricDiagramViewProvider"> - <Priority name="Low"/> - <context viewClass="org.eclipse.gmf.runtime.notation.Diagram" semanticHints="Parametric"/> - </viewProvider> - - <!-- Custom graphical types view provider --> - <viewProvider class="org.eclipse.papyrus.sysml.diagram.parametric.provider.CustomViewProvider"> - <Priority name="Medium"/> - <context viewClass="org.eclipse.gmf.runtime.notation.Node" semanticHints="UML::Property, UML::Port, SysML::ReferenceProperty, SysML::FlowPort, SysML::FlowPort_Out, SysML::Block, SysML::FlowPort_In, SysML::FlowPort_InOut, SysML::PartProperty, SysML::ConstraintProperty"/> - <context viewClass="org.eclipse.gmf.runtime.notation.Node" semanticHints="shape_sysml_flowport_as_affixed, shape_uml_port_as_affixed, shape_sysml_block_as_composite, shape_sysml_blockproperty_as_composite, shape_sysml_constraintblockproperty_as_composite"/> - <context viewClass="org.eclipse.gmf.runtime.notation.Edge" semanticHints="UML::Connector, UML::Dependency"/> - <context viewClass="org.eclipse.gmf.runtime.notation.Edge" semanticHints="link_uml_dependency, link_uml_connector"/> - - <!-- Additional descriptors provided in case the semantic hint is is not provided --> - - <!-- "uml.Class" --> - <object id="uml.Class" class="org.eclipse.gmf.runtime.emf.core.util.IProxyEObject(org.eclipse.gmf.runtime.emf.core)"> - <method name="getProxyClassID()" value="uml.Class"/> - </object> - <context viewClass="org.eclipse.gmf.runtime.notation.Node" semanticHints="uml.Class"/> - - <!-- "uml.Port" --> - <object id="uml.Port" class="org.eclipse.gmf.runtime.emf.core.util.IProxyEObject(org.eclipse.gmf.runtime.emf.core)"> - <method name="getProxyClassID()" value="uml.Port"/> - </object> - <context viewClass="org.eclipse.gmf.runtime.notation.Node" semanticHints="uml.Port"/> - - <!-- "uml.Property" --> - <object id="uml.Property" class="org.eclipse.gmf.runtime.emf.core.util.IProxyEObject(org.eclipse.gmf.runtime.emf.core)"> - <method name="getProxyClassID()" value="uml.Property"/> - </object> - <context viewClass="org.eclipse.gmf.runtime.notation.Node" semanticHints="uml.Property"/> - - <!-- "uml.Connector" --> - <object id="uml.Connector" class="org.eclipse.gmf.runtime.emf.core.util.IProxyEObject(org.eclipse.gmf.runtime.emf.core)"> - <method name="getProxyClassID()" value="uml.Connector"/> - </object> - <context viewClass="org.eclipse.gmf.runtime.notation.Edge" semanticHints="uml.Connector"/> - - <!-- "uml.Dependency" --> - <object id="uml.Dependency" class="org.eclipse.gmf.runtime.emf.core.util.IProxyEObject(org.eclipse.gmf.runtime.emf.core)"> - <method name="getProxyClassID()" value="uml.Dependency"/> - </object> - <context viewClass="org.eclipse.gmf.runtime.notation.Edge" semanticHints="uml.Dependency"/> - <object id="elementtype.node" - class="org.eclipse.papyrus.gmf.diagram.common.commands.ISemanticHintAdapter(org.eclipse.papyrus.sysml.diagram.common)"> - - <method - name="getSemanticHint()" - value="UML::Property, SysML::ActorPartProperty, SysML::ValueProperty, SysML::ReferenceProperty, SysML::FlowPort_In, UML::Port, SysML::FlowPort_Out, SysML::PartProperty, SysML::FlowPort_InOut, SysML::FlowPort, SysML::Block, SysML::FlowPort_NA"> - </method> - </object> - <context - elements="elementtype.node" - viewClass="org.eclipse.gmf.runtime.notation.Node"> - </context> - <object id="elementtype.edge" - class="org.eclipse.papyrus.gmf.diagram.common.commands.ISemanticHintAdapter(org.eclipse.papyrus.sysml.diagram.common)"> - <method - name="getSemanticHint()" - value="UML::Dependency, UML::Connector"> - </method> - </object> - <context - elements="elementtype.edge" - viewClass="org.eclipse.gmf.runtime.notation.Edge"> - </context> - - </viewProvider> - - <!-- ViewProvider for inherited elements (from CompositeDiagram ViewProvider) --> - <viewProvider class="org.eclipse.papyrus.sysml.diagram.parametric.provider.InheritedCompositeDiagramViewProvider"> - <Priority name="Low"></Priority> - - <!-- Load the ViewProvider on following SemanticHint related to IElementType(s) used in the palette (also used for legacy elements) --> - <context viewClass="org.eclipse.gmf.runtime.notation.Node" semanticHints="UML::Comment, UML::Constraint"></context> - - <context viewClass="org.eclipse.gmf.runtime.notation.Node" semanticHints="Comment_Shape, Comment_Shape_CN, Constraint_Shape, Constraint_Shape_CN"></context> - - <context viewClass="org.eclipse.gmf.runtime.notation.Edge" semanticHints="Comment_AnnotatedElementEdge, Constraint_ConstrainedElementEdge"></context> - - <!-- Additional descriptors provided in case the semantic hint is is not provided --> - - <!-- "uml.Comment" --> - <object id="uml.Comment" class="org.eclipse.gmf.runtime.emf.core.util.IProxyEObject(org.eclipse.gmf.runtime.emf.core)"> - <method name="getProxyClassID()" value="uml.Comment"></method> - </object> - - <!-- "uml.Constraint" --> - <object id="uml.Constraint" class="org.eclipse.gmf.runtime.emf.core.util.IProxyEObject(org.eclipse.gmf.runtime.emf.core)"> - <method name="getProxyClassID()" value="uml.Constraint"></method> - </object> - - <!-- Additional activation contexts for nodes semantic objects --> - <context viewClass="org.eclipse.gmf.runtime.notation.Node" elements="uml.Comment, uml.Constraint"></context> - - </viewProvider> -</extension> - -<!-- Diagram edit part providers declaration --> -<extension point="org.eclipse.gmf.runtime.diagram.ui.editpartProviders"> - <!-- Diagram edit part provider --> - <editpartProvider class="org.eclipse.papyrus.sysml.diagram.parametric.provider.ParametricDiagramEditPartProvider"> - <Priority name="Low"/> - <object - id="org.eclipse.papyrus.sysml.diagram.parametric.Diagram" - class="org.eclipse.gmf.runtime.notation.Diagram"> - <method name="getType()" value="Parametric"/> - </object> - <context views="org.eclipse.papyrus.sysml.diagram.parametric.Diagram"/> - </editpartProvider> - - <!-- Custom graphical types edit part provider --> - <editpartProvider class="org.eclipse.papyrus.sysml.diagram.parametric.provider.CustomEditPartProvider"> - <Priority name="Medium"/> - - <object - class="org.eclipse.gmf.runtime.notation.Node(org.eclipse.gmf.runtime.notation)" - id="org.eclipse.papyrus.sysml.diagram.parametric.CustomNodeGraphicalTypes"> - <method name="getType()" value="shape_sysml_flowport_as_affixed, shape_uml_port_as_affixed, shape_sysml_block_as_composite, shape_sysml_blockproperty_as_composite, shape_sysml_constraintblockproperty_as_composite"/> - </object> - - <object - class="org.eclipse.gmf.runtime.notation.Node(org.eclipse.gmf.runtime.notation)" - id="org.eclipse.papyrus.sysml.diagram.parametric.CustomGraphicalTypes_Decorations"> - <method name="getType()" value="linklabel_uml_connector_source_multiplicity, compartment_sysml_blockproperty_structure, linklabel_uml_connector_target_multiplicity, affixedlabel_sysml_flowport_label, compartment_sysml_structure, affixedlabel_uml_port_label, label_sysml_block_name, linklabel_uml_appliedstereotype, linklabel_uml_namedelement_name, linklabel_uml_connector_label, label_uml_property_label, shape_uml_constraint_as_label, affixedlabel_uml_appliedstereotype"/> - </object> - - <context views="org.eclipse.papyrus.sysml.diagram.parametric.CustomNodeGraphicalTypes"/> - <context views="org.eclipse.papyrus.sysml.diagram.parametric.CustomGraphicalTypes_Decorations"/> - - <object - class="org.eclipse.gmf.runtime.notation.Edge(org.eclipse.gmf.runtime.notation)" - id="org.eclipse.papyrus.sysml.diagram.parametric.CustomEdgeGraphicalTypes"> - <method name="getType()" value="link_uml_dependency, link_uml_connector"/> - </object> - - <context views="org.eclipse.papyrus.sysml.diagram.parametric.CustomEdgeGraphicalTypes"/> - - </editpartProvider> - - <!-- EditPartProvider for inherited elements (from CompositeDiagram) --> - <editpartProvider class="org.eclipse.papyrus.sysml.diagram.parametric.provider.InheritedCompositeDiagramEditPartProvider"> - <Priority name="Low"></Priority> - - <object id="COMMENT" class="org.eclipse.gmf.runtime.notation.Node"> - <method name="getType()" value="Comment_Shape, Comment_BodyLabel"></method> - </object> - <object id="COMMENT_CN" class="org.eclipse.gmf.runtime.notation.Node"> - <method name="getType()" value="Comment_Shape_CN, Comment_BodyLabel_CN"></method> - </object> - <object id="CONSTRAINT" class="org.eclipse.gmf.runtime.notation.Node"> - <method name="getType()" value="Constraint_Shape, Constraint_NameLabel, Constraint_BodyLabel"></method> - </object> - <object id="CONSTRAINT_CN" class="org.eclipse.gmf.runtime.notation.Node"> - <method name="getType()" value="Constraint_Shape_CN, Constraint_NameLabel_CN, Constraint_BodyLabel_CN"></method> - </object> - - <object id="COMMENT_ANNOTATED_ELEMENT" class="org.eclipse.gmf.runtime.notation.Edge"> - <method name="getType()" value="Comment_AnnotatedElementEdge"></method> - </object> - <object id="CONSTRAINT_CONSTRAINED_ELEMENT" class="org.eclipse.gmf.runtime.notation.Edge"> - <method name="getType()" value="Constraint_ConstrainedElementEdge"></method> - </object> - - <context views="COMMENT, COMMENT_CN, CONSTRAINT, CONSTRAINT_CN"></context> - <context views="COMMENT_ANNOTATED_ELEMENT, CONSTRAINT_CONSTRAINED_ELEMENT"></context> - - </editpartProvider> - -</extension> - -<!-- Diagram edit policy provider --> -<extension - point="org.eclipse.gmf.runtime.diagram.ui.editpolicyProviders"> - <editpolicyProvider - class="org.eclipse.papyrus.sysml.diagram.parametric.provider.CustomEditPolicyProvider"> - <Priority name="Low"/> - </editpolicyProvider> -</extension> - -<!-- Preference pages declaration --> -<extension point="org.eclipse.ui.preferencePages" id="prefpages"> - - <!-- Diagram Preference pages declaration --> - <page - id="org.eclipse.papyrus.sysml.diagram.parametric.preferences" - name="Parametric Diagram" - category="org.eclipse.papyrus.infra.gmfdiag.preferences.diagrams" - class="org.eclipse.papyrus.sysml.diagram.parametric.preferences.ParametricDiagramGeneralPreferencePage"> - </page> - - <!-- Element Preference pages declaration --> - - - - - - - - - - - - - - - - - -</extension> - -<!-- // Start of user code custom extensions - --> -<!-- Parser provider declaration --> -<extension point="org.eclipse.gmf.runtime.common.ui.services.parserProviders"> - <ParserProvider class="org.eclipse.papyrus.sysml.diagram.parametric.provider.ParserProvider"> - <Priority name="Low"></Priority> - </ParserProvider> -</extension> - - <!-- Diagram specific advices --> -<extension point="org.eclipse.gmf.runtime.emf.type.core.elementTypes"> - <metamodel nsURI="http://www.eclipse.org/uml2/5.0.0/UML"> - <!-- specific advices (pop up on creation) --> - <adviceBinding id="org.eclipse.papyrus.sysml.service.types.helper.ConstraintParameterEditHelperAdvice" - class="org.eclipse.papyrus.sysml.service.types.helper.ConstraintParameterEditHelperAdvice" - inheritance="none" - typeId="org.eclipse.papyrus.uml.Property"/> - </metamodel> -</extension> - -<!-- UML ElementType bindings to Papyrus shared IClientContext --> -<extension point="org.eclipse.gmf.runtime.emf.type.core.elementTypeBindings"> - <!-- Bindings declaration to shared IClientContext --> - <binding context="org.eclipse.papyrus.infra.services.edit.TypeContext"> - <elementType ref="org.eclipse.papyrus.sysml.service.types.helper.ConstraintParameterEditHelperAdvice"/> - </binding> -</extension> - -<extension point="org.eclipse.gmf.runtime.emf.type.core.elementTypes"> - <metamodel nsURI="http://www.eclipse.org/uml2/5.0.0/UML"> - <specializationType - id="org.eclipse.papyrus.sysml.diagram.parametric.Constraint_ContextEdge" - name="Constraint Context Edge" - kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"> - <specializes id="org.eclipse.gmf.runtime.emf.type.core.null"/> - <param name="semanticHint" value="Constraint_ContextEdge"/> - </specializationType> - </metamodel> - <metamodel nsURI="http://www.eclipse.org/uml2/5.0.0/UML"> - <specializationType - id="org.eclipse.papyrus.sysml.diagram.parametric.Constraint_KeywordLabel" - name="Constraint Keyword Label" - kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"> - <specializes id="org.eclipse.gmf.runtime.emf.type.core.null"/> - <param name="semanticHint" value="Constraint_KeywordLabel"/> - </specializationType> - </metamodel> -</extension> -<!-- // End of user code - --> -<extension point="org.eclipse.papyrus.infra.gmfdiag.common.notationTypesMapping"> - <diagramMappings diagramID="Parametric"> - <mapping type="Parametric" humanReadableType="ParametricDiagram"/> - <!-- Compartments --> - <mapping - humanReadableType="structure" - type="compartment_sysml_structure"> - </mapping> - - <mapping - humanReadableType="structure" - type="compartment_sysml_blockproperty_structure"> - </mapping> - - <!-- Link labels --> - - <mapping - humanReadableType="Label" - type="affixedlabel_sysml_flowport_label"> - </mapping> - - <mapping - humanReadableType="Name" - type="affixedlabel_uml_appliedstereotype"> - </mapping> - - <mapping - humanReadableType="Label" - type="affixedlabel_uml_port_label"> - </mapping> - - <mapping - humanReadableType="Stereotype" - type="linklabel_uml_appliedstereotype"> - </mapping> - - <mapping - humanReadableType="Name" - type="linklabel_uml_connector_label"> - </mapping> - - <mapping - humanReadableType="SourceMultiplicity" - type="linklabel_uml_connector_source_multiplicity"> - </mapping> - - <mapping - humanReadableType="TargetMultiplicity" - type="linklabel_uml_connector_target_multiplicity"> - </mapping> - - <mapping - humanReadableType="Name" - type="linklabel_uml_namedelement_name"> - </mapping> - - </diagramMappings> -</extension> - - <extension - point="org.eclipse.papyrus.infra.gmfdiag.common.visualTypeProviders"> - <visualTypeProvider - class="org.eclipse.papyrus.sysml.diagram.parametric.provider.ParametricVisualTypeProvider" - diagramType="Parametric"> - </visualTypeProvider> - </extension> - -<extension - point="org.eclipse.papyrus.infra.gmfdiag.common.diagramReconciler"> - <diagramReconciler - diagramType="Parametric" - reconcilerClass="org.eclipse.papyrus.uml.diagram.composite.custom.migration.CompositeReconciler_1_1_0" - source="1.0.0" - target="1.3.0"> - </diagramReconciler> - <diagramReconciler - diagramType="Parametric" - reconcilerClass="org.eclipse.papyrus.uml.diagram.composite.custom.migration.CompositeReconcilerForCompartment_1_2_0" - source="1.1.0" - target="1.3.0"> - </diagramReconciler> - <diagramReconciler - diagramType="Parametric" - reconcilerClass="org.eclipse.papyrus.uml.diagram.composite.custom.migration.CompositeReconciler_1_2_0" - source="1.1.0" - target="1.3.0"> - </diagramReconciler> - <diagramReconciler - diagramType="Parametric" - reconcilerClass="org.eclipse.papyrus.sysml.diagram.parametric.migration.ParametricReconciler_1_2_0" - source="1.1.0" - target="1.3.0"> - </diagramReconciler> -</extension> -<extension point="org.eclipse.papyrus.infra.gmfdiag.common.paletteDefinition"> - <paletteDefinition - ID="org.eclipse.papyrus.sysml.diagram.parametric.paletteconfiguration" - class="org.eclipse.papyrus.infra.gmfdiag.common.service.palette.ExtendedPluginPaletteProvider" - name="Papyrus SysML parametric editor Plugin Palette" - path="palettes/PapyrusSYSMLParametricDiagram.paletteconfiguration" - provider="Eclipse Modeling Project"> - <Priority - name="Lowest"> - </Priority> - <!-- Specify diagram this palette tools relate to --> - <editor - id="org.eclipse.papyrus.sysml.diagram.parametric"> - </editor> - </paletteDefinition> -</extension> -</plugin> diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/pom.xml b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/pom.xml deleted file mode 100644 index c7e4b5e5b34..00000000000 --- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/pom.xml +++ /dev/null @@ -1,13 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - <modelVersion>4.0.0</modelVersion> - <parent> - <groupId>org.eclipse.papyrus</groupId> - <artifactId>org.eclipse.papyrus.sysml-diagram</artifactId> - <version>0.0.1-SNAPSHOT</version> - </parent> - <artifactId>org.eclipse.papyrus.sysml.diagram.parametric</artifactId> - <version>2.0.0-SNAPSHOT</version> - <packaging>eclipse-plugin</packaging> -</project>
\ No newline at end of file diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/ParametricDiagramCreateCommand.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/ParametricDiagramCreateCommand.java deleted file mode 100644 index 2c1a0445a80..00000000000 --- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/ParametricDiagramCreateCommand.java +++ /dev/null @@ -1,184 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * R�gis CHEVREL: chevrel.regis <at> gmail.com - * CEA LIST - Initial API and implementation - * Laurent Wouters (CEA LIST) laurent.wouters@cea.fr - Viewpoints application - * - *****************************************************************************/ -package org.eclipse.papyrus.sysml.diagram.parametric; - -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.core.runtime.NullProgressMonitor; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.resource.Resource; -import org.eclipse.gmf.runtime.common.core.command.ICommand; -import org.eclipse.gmf.runtime.diagram.core.preferences.PreferencesHint; -import org.eclipse.gmf.runtime.diagram.core.services.ViewService; -import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil; -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.notation.Bounds; -import org.eclipse.gmf.runtime.notation.Diagram; -import org.eclipse.gmf.runtime.notation.Node; -import org.eclipse.gmf.runtime.notation.View; -import org.eclipse.papyrus.infra.gmfdiag.common.AbstractPapyrusGmfCreateDiagramCommandHandler; -import org.eclipse.papyrus.infra.gmfdiag.common.helper.DiagramPrototype; -import org.eclipse.papyrus.infra.services.edit.service.ElementEditServiceUtils; -import org.eclipse.papyrus.infra.services.edit.service.IElementEditService; -import org.eclipse.papyrus.infra.services.edit.utils.GMFCommandUtils; -import org.eclipse.papyrus.sysml.blocks.Block; -import org.eclipse.papyrus.sysml.diagram.common.utils.SysMLGraphicalTypes; -import org.eclipse.papyrus.sysml.diagram.parametric.provider.ElementTypes; -import org.eclipse.papyrus.sysml.service.types.element.SysMLElementTypes; -import org.eclipse.papyrus.uml.diagram.common.commands.SemanticAdapter; -import org.eclipse.papyrus.uml.diagram.composite.part.UMLDiagramEditorPlugin; -import org.eclipse.uml2.uml.Element; -import org.eclipse.uml2.uml.Package; -import org.eclipse.uml2.uml.util.UMLUtil; - -/** - * Represents a creation command for a SysML parametric diagram - * - * @author Laurent Wouters - */ -public class ParametricDiagramCreateCommand extends AbstractPapyrusGmfCreateDiagramCommandHandler { - - /** - * {@inheritDoc} - */ - @Override - protected String getDefaultDiagramName() { - return "New Parametric Diagram"; //$NON-NLS-1$ - } - - /** - * {@inheritDoc} - */ - @Override - protected String getDiagramNotationID() { - return ElementTypes.DIAGRAM_ID; - } - - /** - * {@inheritDoc} - */ - @Override - protected PreferencesHint getPreferenceHint() { - return Activator.DIAGRAM_PREFERENCES_HINT; - } - - /** - * {@inheritDoc} - */ - @Override - protected Diagram doCreateDiagram(Resource diagramResource, EObject owner, EObject element, DiagramPrototype prototype, String name) { - // Start of user code Custom diagram creation - Diagram diagram = null; - - if (element instanceof org.eclipse.uml2.uml.Class) { - org.eclipse.uml2.uml.Class cOwner = (org.eclipse.uml2.uml.Class) element; - Block block = UMLUtil.getStereotypeApplication(cOwner, Block.class); - - if (block != null) { - canvasDomainElement = element; - Package owningPackage = ((Element) element).getNearestPackage(); - diagram = super.doCreateDiagram(diagramResource, owner, owningPackage, prototype, name); - } - - } else if (element instanceof Package) { - - try { - canvasDomainElement = null; - IEditCommandRequest request = new CreateElementRequest(element, SysMLElementTypes.BLOCK); - IElementEditService commandService = ElementEditServiceUtils.getCommandProvider(element); - if (commandService == null) { - return null; - } - - ICommand createElementCommand = commandService.getEditCommand(request); - if ((createElementCommand != null) && (createElementCommand.canExecute())) { - createElementCommand.execute(new NullProgressMonitor(), null); - EObject block = GMFCommandUtils.getCommandEObjectResult(createElementCommand); - canvasDomainElement = block; - diagram = super.doCreateDiagram(diagramResource, owner, element, prototype, name); - } - - } catch (ExecutionException e) { - e.printStackTrace(); - } - - } - - return diagram; - // End of user code - } - - // Start of user code Custom creation command - /** Domain Element referenced by canvas if it differs from {@link Package} */ - protected EObject canvasDomainElement = null; - - /** Default margin for the display of Domain Element referenced by canvas */ - protected static int DEFAULT_MARGIN = 20; - - /** Default height for the display of Domain Element referenced by canvas */ - protected static int DEFAULT_HEIGHT = 600; - - /** Default width for the display of Domain Element referenced by canvas */ - protected static int DEFAULT_WIDTH = 1000; - - /** - * Initialize the diagram. The diagram is attached to the element selected on creation. - * Possible element types are: Block. - */ - @Override - protected void initializeDiagram(EObject diagram) { - if (diagram instanceof Diagram) { - Diagram currentDiagram = (Diagram) diagram; - if (canvasDomainElement != null) { - currentDiagram.setElement(canvasDomainElement); - initializeDiagramContent(currentDiagram); - } - } - } - - /** - * Initialize the diagram with the canvas domain element shown. - * - * @param diagram - * the diagram to initialize - */ - protected void initializeDiagramContent(Diagram diagram) { - - // Create a view for the canvasDomainElement in the new diagram - View view = - ViewService.getInstance().createNode(new SemanticAdapter(canvasDomainElement, null), diagram, SysMLGraphicalTypes.SHAPE_SYSML_BLOCK_AS_COMPOSITE_ID, ViewUtil.APPEND, true, UMLDiagramEditorPlugin.DIAGRAM_PREFERENCES_HINT); - view.setElement(diagram.getElement()); - - // Update the view position and size (should adapt to canvas current size) - Bounds viewBounds = (Bounds) ((Node) view).getLayoutConstraint(); - viewBounds.setX(DEFAULT_MARGIN); - viewBounds.setY(DEFAULT_MARGIN); - viewBounds.setHeight(DEFAULT_HEIGHT); - viewBounds.setWidth(DEFAULT_WIDTH); - } - - /** - * {@inheritDoc} - * - * @generated NOT - */ - @Override - public boolean isParentReassignable() { - // Bug 374626: [Model Explorer] Moving an IBD from a block to another block shall be forbidden - return false; - } - - // End of user code -} diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/ParametricDiagramEditorFactory.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/ParametricDiagramEditorFactory.java deleted file mode 100644 index fc8f9f6a4db..00000000000 --- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/ParametricDiagramEditorFactory.java +++ /dev/null @@ -1,25 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Régis CHEVREL: chevrel.regis <at> gmail.com - * CEA LIST - Initial API and implementation - * - *****************************************************************************/ -package org.eclipse.papyrus.sysml.diagram.parametric; - -import org.eclipse.papyrus.infra.gmfdiag.common.GmfEditorFactory; -import org.eclipse.papyrus.sysml.diagram.parametric.provider.ElementTypes; - -public class ParametricDiagramEditorFactory extends GmfEditorFactory { - - public ParametricDiagramEditorFactory() { - super(ParametricDiagramForMultiEditor.class, ElementTypes.DIAGRAM_ID); - } - -} diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/ParametricDiagramForMultiEditor.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/ParametricDiagramForMultiEditor.java deleted file mode 100644 index 725e124586f..00000000000 --- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/ParametricDiagramForMultiEditor.java +++ /dev/null @@ -1,133 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013, 2014 CEA LIST 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: - * R�gis CHEVREL: chevrel.regis <at> gmail.com - * CEA LIST - Initial API and implementation - * Christian W. Damus (CEA) - bug 392301 - * Nicolas FAUVERGUE (ALL4TEC) nicolas.fauvergue@all4tec.net - Bug 496905 - * - *****************************************************************************/ -package org.eclipse.papyrus.sysml.diagram.parametric; - -import org.eclipse.core.runtime.CoreException; -import org.eclipse.emf.common.ui.URIEditorInput; -import org.eclipse.emf.ecore.util.EcoreUtil; -import org.eclipse.gmf.runtime.notation.Diagram; -import org.eclipse.jface.dialogs.ErrorDialog; -import org.eclipse.jface.resource.ImageDescriptor; -import org.eclipse.papyrus.infra.core.editor.BackboneException; -import org.eclipse.papyrus.infra.core.services.ServiceException; -import org.eclipse.papyrus.infra.core.services.ServicesRegistry; -import org.eclipse.papyrus.infra.internationalization.utils.utils.LabelInternationalization; -import org.eclipse.papyrus.sysml.diagram.parametric.part.ParametricDiagramEditor; -import org.eclipse.swt.graphics.Image; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.ui.IEditorInput; -import org.eclipse.ui.IEditorSite; -import org.eclipse.ui.PartInitException; - -/** - * An editor to be used in multitabs editor. This editor extends the original UML Diagram. - * - */ -public class ParametricDiagramForMultiEditor extends ParametricDiagramEditor { - - /** - * The location of diagram icon in the plug-in - */ - private static final String DIAG_IMG_PATH = "icons/obj16/Diagram_Parametric.png"; - - /** - * The image descriptor of the diagram icon - */ - private static final ImageDescriptor DIAG_IMG_DESC = Activator.getBundledImageDescriptor(ParametricDiagramForMultiEditor.DIAG_IMG_PATH); - - /** The editor splitter. */ - private Composite splitter; - - private Image titleImage; - - /** - * Constructor for SashSystem v2. Context and required objects are retrieved from the - * ServiceRegistry. - * - * @throws BackboneException - * @throws ServiceException - * - */ - public ParametricDiagramForMultiEditor(ServicesRegistry servicesRegistry, Diagram diagram) throws BackboneException, ServiceException { - super(servicesRegistry, diagram); - } - - /** - * {@inheritDoc} - */ - @Override - public void init(IEditorSite site, IEditorInput input) throws PartInitException { - super.init(site, input); - setPartName(LabelInternationalization.getInstance().getDiagramLabel(getDiagram())); - titleImage = DIAG_IMG_DESC.createImage(); - setTitleImage(titleImage); - } - - @Override - public void dispose() { - if (titleImage != null) { - titleImage.dispose(); - titleImage = null; - } - - super.dispose(); - } - - /** - * {@inheritDoc} - */ - @Override - public void setInput(IEditorInput input) { - try { - // Provide an URI with fragment in order to reuse the same Resource - // and set the diagram to the fragment. - URIEditorInput uriInput = new URIEditorInput(EcoreUtil.getURI(getDiagram())); - doSetInput(uriInput, true); - } catch (CoreException x) { - String title = "Problem opening"; - String msg = "Cannot open input element:"; - Shell shell = getSite().getShell(); - ErrorDialog.openError(shell, title, msg, x.getStatus()); - } - } - - /** - * {@inheritDoc} - */ - @Override - protected void createGraphicalViewer(Composite parent) { - splitter = parent; - super.createGraphicalViewer(parent); - } - - /** - * {@inheritDoc} - */ - @Override - public void setFocus() { - splitter.setFocus(); - super.setFocus(); - } - - /** - * {@inheritDoc} - */ - @Override - public String getEditingDomainID() { - return "org.eclipse.papyrus.sysml.diagram.parametric.EditingDomain"; - } -} diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/edit/part/ParametricDiagramEditPart.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/edit/part/ParametricDiagramEditPart.java deleted file mode 100644 index 4f433e7f871..00000000000 --- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/edit/part/ParametricDiagramEditPart.java +++ /dev/null @@ -1,52 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * R�gis CHEVREL: chevrel.regis <at> gmail.com - * CEA LIST - Initial API and implementation - * - *****************************************************************************/ -package org.eclipse.papyrus.sysml.diagram.parametric.edit.part; - - - -import org.eclipse.gef.EditPolicy; -import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles; -import org.eclipse.gmf.runtime.notation.View; -import org.eclipse.papyrus.gmf.diagram.common.edit.policy.DefaultContainerNodeEditPolicy; -import org.eclipse.papyrus.gmf.diagram.common.edit.policy.DefaultXYLayoutEditPolicy; -import org.eclipse.papyrus.infra.gmfdiag.common.editpart.PapyrusDiagramEditPart; -import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.DefaultCreationEditPolicy; -import org.eclipse.papyrus.sysml.diagram.internalblock.edit.policy.CustomDragDropEditPolicy; -import org.eclipse.papyrus.sysml.diagram.parametric.edit.policy.DiagramSemanticEditPolicy; -import org.eclipse.papyrus.sysml.diagram.parametric.policies.CustomParametricSemanticPolicy; -import org.eclipse.papyrus.uml.diagram.common.editpolicies.PasteEditPolicy; - - -/** - * - * @Generated NOT //change the super class - */ -public class ParametricDiagramEditPart extends PapyrusDiagramEditPart { - - public ParametricDiagramEditPart(View view) { - super(view); - } - - @Override - protected void createDefaultEditPolicies() { - super.createDefaultEditPolicies(); - installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new DiagramSemanticEditPolicy()); - installEditPolicy(PasteEditPolicy.PASTE_ROLE, new PasteEditPolicy()); - installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new CustomDragDropEditPolicy()); - installEditPolicy(EditPolicy.LAYOUT_ROLE, new DefaultXYLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.CREATION_ROLE, new DefaultCreationEditPolicy()); - installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultContainerNodeEditPolicy()); - installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new CustomParametricSemanticPolicy()); - } -} diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/edit/policy/DiagramSemanticEditPolicy.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/edit/policy/DiagramSemanticEditPolicy.java deleted file mode 100644 index 960b88a1f6b..00000000000 --- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/edit/policy/DiagramSemanticEditPolicy.java +++ /dev/null @@ -1,56 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Régis CHEVREL: chevrel.regis <at> gmail.com - * CEA LIST - Initial API and implementation - * - *****************************************************************************/ -package org.eclipse.papyrus.sysml.diagram.parametric.edit.policy; - -import org.eclipse.gef.commands.Command; -import org.eclipse.gef.commands.UnexecutableCommand; -import org.eclipse.gef.requests.ReconnectRequest; -// Start of user code custom imports -// End of user code -import org.eclipse.papyrus.sysml.diagram.parametric.policies.CustomDefaultSemanticEditPolicy; - -public class DiagramSemanticEditPolicy extends CustomDefaultSemanticEditPolicy { - - /** - * {@inheritDoc} - */ - @Override - protected Command getReorientRelationshipSourceCommand(ReconnectRequest request) { - return UnexecutableCommand.INSTANCE; - } - - /** - * {@inheritDoc} - */ - @Override - protected Command getReorientRelationshipTargetCommand(ReconnectRequest request) { - return UnexecutableCommand.INSTANCE; - } - - /** - * {@inheritDoc} - */ - @Override - protected Command getReorientRefRelationshipSourceCommand(ReconnectRequest request) { - return UnexecutableCommand.INSTANCE; - } - - /** - * {@inheritDoc} - */ - @Override - protected Command getReorientRefRelationshipTargetCommand(ReconnectRequest request) { - return UnexecutableCommand.INSTANCE; - } -} diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/edit/policy/ParametricDiagramDragDropEditPolicy.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/edit/policy/ParametricDiagramDragDropEditPolicy.java deleted file mode 100644 index 65653c3e4a1..00000000000 --- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/edit/policy/ParametricDiagramDragDropEditPolicy.java +++ /dev/null @@ -1,51 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * R�gis CHEVREL: chevrel.regis <at> gmail.com - * CEA LIST - Initial API and implementation - * - *****************************************************************************/ -package org.eclipse.papyrus.sysml.diagram.parametric.edit.policy; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.gmf.runtime.notation.View; -import org.eclipse.papyrus.gmf.diagram.common.provider.IGraphicalTypeRegistry; -import org.eclipse.papyrus.sysml.diagram.parametric.provider.GraphicalTypeRegistry; -import org.eclipse.papyrus.uml.diagram.composite.custom.edit.policies.CustomDiagramDragDropEditPolicy; - -/** Customization of the DND edit policy for the Parametric Diagram */ -public class ParametricDiagramDragDropEditPolicy extends CustomDiagramDragDropEditPolicy { - - /** Local graphical type registry */ - protected IGraphicalTypeRegistry registry = new GraphicalTypeRegistry(); - - /** - * {@inheritDoc} - */ - @Override - public String getNodeVisualID(View containerView, EObject domainElement) { - String domainType = registry.getNodeGraphicalType(domainElement, containerView.getType()); - if (org.eclipse.papyrus.infra.gmfdiag.common.providers.IGraphicalTypeRegistry.UNDEFINED_TYPE.equals(domainType)) { - return null; // undefined - } - return domainType; - } - - /** - * {@inheritDoc} - */ - @Override - public String getLinkWithClassVisualID(EObject domainElement) { - String domainType = registry.getEdgeGraphicalType(domainElement); - if (org.eclipse.papyrus.infra.gmfdiag.common.providers.IGraphicalTypeRegistry.UNDEFINED_TYPE.equals(domainType)) { - return null; // undefined - } - return domainType; - } -} diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/factory/DiagramPaletteFactory.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/factory/DiagramPaletteFactory.java deleted file mode 100644 index a5028a8a321..00000000000 --- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/factory/DiagramPaletteFactory.java +++ /dev/null @@ -1,77 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Régis CHEVREL: chevrel.regis <at> gmail.com - * CEA LIST - Initial API and implementation - * - *****************************************************************************/ -package org.eclipse.papyrus.sysml.diagram.parametric.factory; - -import java.util.Arrays; -import java.util.HashMap; - -import org.eclipse.gef.Tool; -import org.eclipse.gmf.runtime.diagram.ui.services.palette.PaletteFactory; -import org.eclipse.gmf.runtime.emf.type.core.IElementType; -import org.eclipse.papyrus.infra.gmfdiag.common.service.palette.AspectUnspecifiedTypeConnectionTool; -import org.eclipse.papyrus.infra.gmfdiag.common.service.palette.AspectUnspecifiedTypeCreationTool; -import org.eclipse.papyrus.sysml.diagram.parametric.provider.ElementTypes; -import org.eclipse.papyrus.sysml.service.types.element.SysMLElementTypes; -import org.eclipse.papyrus.uml.service.types.element.UMLElementTypes; - -@SuppressWarnings("serial") -public class DiagramPaletteFactory extends PaletteFactory.Adapter { - - private static HashMap<String, IElementType[]> nodesToolIdTypesMap = new HashMap<String, IElementType[]>() { - - { - put("parametric.tool.blockcomposite", new IElementType[] { SysMLElementTypes.BLOCK }); - put("parametric.tool.blockpropertycomposite", new IElementType[] { SysMLElementTypes.PART_PROPERTY }); - put("parametric.tool.reference", new IElementType[] { SysMLElementTypes.REFERENCE_PROPERTY }); - put("parametric.tool.value", new IElementType[] { SysMLElementTypes.VALUE_PROPERTY }); - put("parametric.tool.constraintblockpropertycomposite", new IElementType[] { SysMLElementTypes.CONSTRAINT_PROPERTY }); - put("parametric.tool.flowport", new IElementType[] { SysMLElementTypes.FLOW_PORT }); - put("parametric.tool.port", new IElementType[] { UMLElementTypes.PORT }); - put("parametric.tool.parameter", new IElementType[] { UMLElementTypes.PROPERTY }); - // Start of user code Custom nodes - put("parametric.tool.constraint", new IElementType[] { UMLElementTypes.CONSTRAINT }); - put("parametric.tool.comment", new IElementType[] { UMLElementTypes.COMMENT }); - // End of user code - } - }; - - private static HashMap<String, IElementType[]> edgesToolIdTypesMap = new HashMap<String, IElementType[]>() { - - { - put("parametric.tool.connector", new IElementType[] { UMLElementTypes.CONNECTOR }); - put("parametric.tool.dependency", new IElementType[] { UMLElementTypes.DEPENDENCY }); - // Start of user code Custom edges - put("parametric.tool.comment_constraint_link", new IElementType[] { ElementTypes.COMMENT_ANNOTATED_ELEMENT }); - put("parametric.tool.context_link", new IElementType[] { ElementTypes.CONTEXT_LINK }); - // End of user code - } - }; - - @Override - public Tool createTool(String toolId) { - - IElementType[] types; - - types = nodesToolIdTypesMap.get(toolId); - if (types != null) { - return new AspectUnspecifiedTypeCreationTool(Arrays.asList(types)); - } - - types = edgesToolIdTypesMap.get(toolId); - if (types != null) { - return new AspectUnspecifiedTypeConnectionTool(Arrays.asList(types)); - } - return null; - } -} diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/factory/ParametricDiagramViewFactory.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/factory/ParametricDiagramViewFactory.java deleted file mode 100644 index 1599ffce349..00000000000 --- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/factory/ParametricDiagramViewFactory.java +++ /dev/null @@ -1,31 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Régis CHEVREL: chevrel.regis <at> gmail.com - * CEA LIST - Initial API and implementation - * - *****************************************************************************/ -package org.eclipse.papyrus.sysml.diagram.parametric.factory; - -import org.eclipse.gmf.runtime.diagram.ui.view.factories.DiagramViewFactory; -import org.eclipse.gmf.runtime.notation.MeasurementUnit; - -public class ParametricDiagramViewFactory extends DiagramViewFactory { - - // Start of user code Custom view Factory field - // End of user code - - /** - * {@inheritDoc} - */ - @Override - protected MeasurementUnit getMeasurementUnit() { - return MeasurementUnit.PIXEL_LITERAL; - } -} diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/part/ParametricDiagramEditor.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/part/ParametricDiagramEditor.java deleted file mode 100644 index ef56c9aa4ad..00000000000 --- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/part/ParametricDiagramEditor.java +++ /dev/null @@ -1,64 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Régis CHEVREL: chevrel.regis <at> gmail.com - * CEA LIST - Initial API and implementation - * - *****************************************************************************/ -package org.eclipse.papyrus.sysml.diagram.parametric.part; - -import org.eclipse.gmf.runtime.diagram.core.preferences.PreferencesHint; -import org.eclipse.gmf.runtime.notation.Diagram; -import org.eclipse.papyrus.infra.core.services.ServiceException; -import org.eclipse.papyrus.infra.core.services.ServicesRegistry; -import org.eclipse.papyrus.sysml.diagram.parametric.Activator; - -/** - * @generated - */ -public class ParametricDiagramEditor extends org.eclipse.papyrus.uml.diagram.composite.part.UMLDiagramEditor { - - /** context used when trying to find services */ - public static final String ID = "org.eclipse.papyrus.sysml.diagram.parametric.part.ParametricDiagramEditorID"; //$NON-NLS-1$ - - /** - * {@inheritDoc} - */ - @Override - public String getContextID() { - return CONTEXT_ID; - } - - /** - * @throws org.eclipse.papyrus.infra.core.services.ServiceException - * @generated - */ - public ParametricDiagramEditor(ServicesRegistry servicesRegistry, Diagram diagram) throws ServiceException, org.eclipse.papyrus.infra.core.services.ServiceException { - super(servicesRegistry, diagram); - } - - // Start of user code Custom Editor Methods - // End of user code - - /** - * @generated - */ - @Override - public String getContributorId() { - return Activator.PLUGIN_ID; - } - - /** - * @generated - */ - @Override - protected PreferencesHint getPreferencesHint() { - return Activator.DIAGRAM_PREFERENCES_HINT; - } -} diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/preferences/BlockCompositePreferencePage.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/preferences/BlockCompositePreferencePage.java deleted file mode 100644 index 0a84ca4d3b7..00000000000 --- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/preferences/BlockCompositePreferencePage.java +++ /dev/null @@ -1,96 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * R�gis CHEVREL: chevrel.regis <at> gmail.com - * CEA LIST - Initial API and implementation - * - *****************************************************************************/ -package org.eclipse.papyrus.sysml.diagram.parametric.preferences; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; - -import org.eclipse.jface.preference.IPreferenceStore; -import org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper; -import org.eclipse.papyrus.sysml.diagram.common.utils.SysMLGraphicalTypes; -import org.eclipse.papyrus.sysml.diagram.parametric.provider.ElementTypes; - -public class BlockCompositePreferencePage extends ParametricDiagramNodePreferencePage { - - /** Constant key to access preferences */ - public static String prefKey = ElementTypes.DIAGRAM_ID + "_" + SysMLGraphicalTypes.SHAPE_SYSML_BLOCK_AS_COMPOSITE_ID; //$NON-NLS-1$ - - /** The compartments default visibility for preferences */ - public static final Map<String, Boolean> compartmentDefaultVisibilityMap; - - /** The compartment titles default visibility for preferences */ - public static final Map<String, Boolean> compartmentTitleDefaultVisibilityMap; - - /** Static attribute initialization */ - static { - compartmentDefaultVisibilityMap = new LinkedHashMap<String, Boolean>(); - compartmentDefaultVisibilityMap.put("structure", Boolean.TRUE); //$NON-NLS-1$ - - compartmentTitleDefaultVisibilityMap = new LinkedHashMap<String, Boolean>(); - compartmentTitleDefaultVisibilityMap.put("structure", Boolean.TRUE); //$NON-NLS-1$ - - - // Start of user code custom static initializations - // End of user code - - Collections.unmodifiableMap(compartmentDefaultVisibilityMap); - Collections.unmodifiableMap(compartmentTitleDefaultVisibilityMap); - } - - /** Constructor */ - public BlockCompositePreferencePage() { - super(); - setPreferenceKey(ElementTypes.DIAGRAM_ID + "_" + SysMLGraphicalTypes.SHAPE_SYSML_BLOCK_AS_COMPOSITE_ID); //$NON-NLS-1$ - } - - /** Default preferences initializer */ - public static void initDefaults(IPreferenceStore store) { - // Start of user code custom default initializations - // End of user code - - // Initialize default visibility for compartments in preference page. - for (String compartmentName : compartmentDefaultVisibilityMap.keySet()) { - String showCompartmentKey = PreferencesConstantsHelper.getCompartmentElementConstant(prefKey, compartmentName, PreferencesConstantsHelper.COMPARTMENT_VISIBILITY); - store.setDefault(showCompartmentKey, compartmentDefaultVisibilityMap.get(compartmentName)); - } - - // Initialize default title visibility for compartments in preference page. - for (String compartmentName : compartmentTitleDefaultVisibilityMap.keySet()) { - String showCompartmentTitleKey = PreferencesConstantsHelper.getCompartmentElementConstant(prefKey, compartmentName, PreferencesConstantsHelper.COMPARTMENT_NAME_VISIBILITY); - store.setDefault(showCompartmentTitleKey, compartmentTitleDefaultVisibilityMap.get(compartmentName)); - } - } - - /** - * {@inheritDoc} - */ - @Override - protected void initializeCompartmentNamesList() { - for (String name : compartmentDefaultVisibilityMap.keySet()) { - this.compartmentNamesList.add(name); - } - } - - /** - * {@inheritDoc} - */ - @Override - protected void initializeCompartmentTitlesList() { - for (String name : compartmentTitleDefaultVisibilityMap.keySet()) { - this.compartmentTitlesList.add(name); - } - } - -} diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/preferences/CommentAnnotatedElementPreferencePage.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/preferences/CommentAnnotatedElementPreferencePage.java deleted file mode 100644 index baf66ca53e7..00000000000 --- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/preferences/CommentAnnotatedElementPreferencePage.java +++ /dev/null @@ -1,43 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Régis CHEVREL: chevrel.regis <at> gmail.com - * CEA LIST - Initial API and implementation - * - *****************************************************************************/ -package org.eclipse.papyrus.sysml.diagram.parametric.preferences; - -import org.eclipse.jface.preference.IPreferenceStore; -import org.eclipse.papyrus.sysml.diagram.parametric.provider.ElementTypes; - -public class CommentAnnotatedElementPreferencePage extends ParametricDiagramLinkPreferencePage { - - /** Constant key to access preferences */ - protected static String prefKey = ElementTypes.DIAGRAM_ID + "_CommentAnnotatedElement"; //$NON-NLS-1$ - - - /** Default constructor */ - public CommentAnnotatedElementPreferencePage() { - super(); - setPreferenceKey(ElementTypes.DIAGRAM_ID + "_CommentAnnotatedElement"); //$NON-NLS-1$ - } - - /** - * Initialize defaults using a specified {@link IPreferenceStore} - * - * @param store - * the preference store. - */ - public static void initDefaults(IPreferenceStore store) { - // Start of user code custom default initializations - // End of user code - - } - -} diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/preferences/CommentPreferencePage.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/preferences/CommentPreferencePage.java deleted file mode 100644 index 9b4a5ecd860..00000000000 --- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/preferences/CommentPreferencePage.java +++ /dev/null @@ -1,44 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Régis CHEVREL: chevrel.regis <at> gmail.com - * CEA LIST - Initial API and implementation - * - *****************************************************************************/ -package org.eclipse.papyrus.sysml.diagram.parametric.preferences; - -import org.eclipse.jface.preference.IPreferenceStore; -import org.eclipse.papyrus.sysml.diagram.parametric.provider.ElementTypes; - -public class CommentPreferencePage extends ParametricDiagramNodePreferencePage { - - /** Constant key to access preferences */ - protected static String prefKey = ElementTypes.DIAGRAM_ID + "_Comment"; //$NON-NLS-1$ - - - /** Default constructor */ - public CommentPreferencePage() { - super(); - setPreferenceKey(ElementTypes.DIAGRAM_ID + "_Comment"); //$NON-NLS-1$ - } - - /** - * Initialize defaults using a specified {@link IPreferenceStore} - * - * @param store - * the preference store. - */ - public static void initDefaults(IPreferenceStore store) { - // Start of user code custom default initializations - // End of user code - - } - - -} diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/preferences/ConnectorPreferencePage.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/preferences/ConnectorPreferencePage.java deleted file mode 100644 index 96d5e6434de..00000000000 --- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/preferences/ConnectorPreferencePage.java +++ /dev/null @@ -1,36 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * R�gis CHEVREL: chevrel.regis <at> gmail.com - * CEA LIST - Initial API and implementation - * - *****************************************************************************/ -package org.eclipse.papyrus.sysml.diagram.parametric.preferences; - -import org.eclipse.jface.preference.IPreferenceStore; -import org.eclipse.papyrus.sysml.diagram.parametric.provider.ElementTypes; -import org.eclipse.papyrus.uml.diagram.common.utils.UMLGraphicalTypes; - -public class ConnectorPreferencePage extends ParametricDiagramLinkPreferencePage { - - /** Constant key to access preferences */ - public static String prefKey = ElementTypes.DIAGRAM_ID + "_" + UMLGraphicalTypes.LINK_UML_CONNECTOR_ID; //$NON-NLS-1$ - - /** Constructor */ - public ConnectorPreferencePage() { - super(); - setPreferenceKey(ElementTypes.DIAGRAM_ID + "_" + UMLGraphicalTypes.LINK_UML_CONNECTOR_ID); //$NON-NLS-1$ - } - - /** Default preferences initializer */ - public static void initDefaults(IPreferenceStore store) { - // Start of user code custom default initializations - // End of user code - } -} diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/preferences/ConstraintConstrainedElementPreferencePage.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/preferences/ConstraintConstrainedElementPreferencePage.java deleted file mode 100644 index e44b40abc91..00000000000 --- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/preferences/ConstraintConstrainedElementPreferencePage.java +++ /dev/null @@ -1,43 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Régis CHEVREL: chevrel.regis <at> gmail.com - * CEA LIST - Initial API and implementation - * - *****************************************************************************/ -package org.eclipse.papyrus.sysml.diagram.parametric.preferences; - -import org.eclipse.jface.preference.IPreferenceStore; -import org.eclipse.papyrus.sysml.diagram.parametric.provider.ElementTypes; - -public class ConstraintConstrainedElementPreferencePage extends ParametricDiagramLinkPreferencePage { - - /** Constant key to access preferences */ - protected static String prefKey = ElementTypes.DIAGRAM_ID + "_ConstraintConstrainedElement"; //$NON-NLS-1$ - - - /** Default constructor */ - public ConstraintConstrainedElementPreferencePage() { - super(); - setPreferenceKey(ElementTypes.DIAGRAM_ID + "_ConstraintConstrainedElement"); //$NON-NLS-1$ - } - - /** - * Initialize defaults using a specified {@link IPreferenceStore} - * - * @param store - * the preference store. - */ - public static void initDefaults(IPreferenceStore store) { - // Start of user code custom default initializations - // End of user code - - } - -} diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/preferences/ConstraintPreferencePage.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/preferences/ConstraintPreferencePage.java deleted file mode 100644 index b36251c17cf..00000000000 --- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/preferences/ConstraintPreferencePage.java +++ /dev/null @@ -1,44 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Régis CHEVREL: chevrel.regis <at> gmail.com - * CEA LIST - Initial API and implementation - * - *****************************************************************************/ -package org.eclipse.papyrus.sysml.diagram.parametric.preferences; - -import org.eclipse.jface.preference.IPreferenceStore; -import org.eclipse.papyrus.sysml.diagram.parametric.provider.ElementTypes; - -public class ConstraintPreferencePage extends ParametricDiagramNodePreferencePage { - - /** Constant key to access preferences */ - protected static String prefKey = ElementTypes.DIAGRAM_ID + "_Constraint"; //$NON-NLS-1$ - - - /** Default constructor */ - public ConstraintPreferencePage() { - super(); - setPreferenceKey(ElementTypes.DIAGRAM_ID + "_Constraint"); //$NON-NLS-1$ - } - - /** - * Initialize defaults using a specified {@link IPreferenceStore} - * - * @param store - * the preference store. - */ - public static void initDefaults(IPreferenceStore store) { - // Start of user code custom default initializations - // End of user code - - } - - -} diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/preferences/DependencyPreferencePage.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/preferences/DependencyPreferencePage.java deleted file mode 100644 index c561639997d..00000000000 --- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/preferences/DependencyPreferencePage.java +++ /dev/null @@ -1,36 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * R�gis CHEVREL: chevrel.regis <at> gmail.com - * CEA LIST - Initial API and implementation - * - *****************************************************************************/ -package org.eclipse.papyrus.sysml.diagram.parametric.preferences; - -import org.eclipse.jface.preference.IPreferenceStore; -import org.eclipse.papyrus.sysml.diagram.parametric.provider.ElementTypes; -import org.eclipse.papyrus.uml.diagram.common.utils.UMLGraphicalTypes; - -public class DependencyPreferencePage extends ParametricDiagramLinkPreferencePage { - - /** Constant key to access preferences */ - public static String prefKey = ElementTypes.DIAGRAM_ID + "_" + UMLGraphicalTypes.LINK_UML_DEPENDENCY_ID; //$NON-NLS-1$ - - /** Constructor */ - public DependencyPreferencePage() { - super(); - setPreferenceKey(ElementTypes.DIAGRAM_ID + "_" + UMLGraphicalTypes.LINK_UML_DEPENDENCY_ID); //$NON-NLS-1$ - } - - /** Default preferences initializer */ - public static void initDefaults(IPreferenceStore store) { - // Start of user code custom default initializations - // End of user code - } -} diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/preferences/ParametricDiagramGeneralPreferencePage.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/preferences/ParametricDiagramGeneralPreferencePage.java deleted file mode 100644 index 7a1d14342ad..00000000000 --- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/preferences/ParametricDiagramGeneralPreferencePage.java +++ /dev/null @@ -1,26 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Régis CHEVREL: chevrel.regis <at> gmail.com - * CEA LIST - Initial API and implementation - * - *****************************************************************************/ -package org.eclipse.papyrus.sysml.diagram.parametric.preferences; - -import org.eclipse.papyrus.infra.gmfdiag.preferences.pages.DiagramPreferencePage; -import org.eclipse.papyrus.sysml.diagram.internalblock.provider.ElementTypes; -import org.eclipse.papyrus.sysml.diagram.parametric.Activator; - -public class ParametricDiagramGeneralPreferencePage extends DiagramPreferencePage { - - public ParametricDiagramGeneralPreferencePage() { - setPreferenceStore(Activator.getInstance().getPreferenceStore()); - setPreferenceKey(ElementTypes.DIAGRAM_ID); - } -} diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/preferences/ParametricDiagramLinkPreferencePage.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/preferences/ParametricDiagramLinkPreferencePage.java deleted file mode 100644 index 996a70da0fe..00000000000 --- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/preferences/ParametricDiagramLinkPreferencePage.java +++ /dev/null @@ -1,73 +0,0 @@ -/*****************************************************************************
- * Copyright (c) 2013 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * R�gis CHEVREL: chevrel.regis <at> gmail.com
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.parametric.preferences;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-import java.util.TreeMap;
-
-import org.eclipse.papyrus.infra.gmfdiag.preferences.pages.AbstractPapyrusLinkPreferencePage;
-import org.eclipse.papyrus.infra.gmfdiag.preferences.ui.OrderedLabelGroup;
-import org.eclipse.papyrus.sysml.diagram.parametric.Activator;
-import org.eclipse.swt.widgets.Composite;
-
-public class ParametricDiagramLinkPreferencePage extends AbstractPapyrusLinkPreferencePage {
-
- /** The list of label names for this link */
- protected List<String> labelsList;
-
- /** Constructor */
- public ParametricDiagramLinkPreferencePage() {
- labelsList = new ArrayList<String>();
- initializeLabelsList();
- Collections.unmodifiableList(labelsList);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected void createPageContents(Composite parent) {
- super.createPageContents(parent);
-
- // Add label visibility group
- if (!labelsList.isEmpty()) {
- OrderedLabelGroup compartmentGroup = new OrderedLabelGroup(parent, getPreferenceKey(), this, labelsList);
- addPreferenceGroup(compartmentGroup);
- }
-
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected String getBundleId() {
- return Activator.PLUGIN_ID;
- }
-
- /** Initialize the list containing names of labels. */
- protected void initializeLabelsList() {
- // Implemented by subclasses.
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected final TreeMap<String, String> getLabelRole() {
- return new TreeMap<String, String>();
- }
-}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/preferences/ParametricDiagramNodePreferencePage.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/preferences/ParametricDiagramNodePreferencePage.java deleted file mode 100644 index a28b62b6357..00000000000 --- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/preferences/ParametricDiagramNodePreferencePage.java +++ /dev/null @@ -1,119 +0,0 @@ -/*****************************************************************************
- * Copyright (c) 2013 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * R�gis CHEVREL: chevrel.regis <at> gmail.com
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.parametric.preferences;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-import java.util.TreeMap;
-
-import org.eclipse.papyrus.infra.gmfdiag.preferences.pages.AbstractPapyrusNodePreferencePage;
-import org.eclipse.papyrus.infra.gmfdiag.preferences.ui.OrderedCompartmentGroup;
-import org.eclipse.papyrus.infra.gmfdiag.preferences.ui.OrderedLabelGroup;
-import org.eclipse.papyrus.sysml.diagram.parametric.Activator;
-import org.eclipse.swt.widgets.Composite;
-
-public class ParametricDiagramNodePreferencePage extends AbstractPapyrusNodePreferencePage {
-
- /** The list owning the names of compartments */
- protected List<String> compartmentNamesList;
-
- /** The list owning the names of compartment that have a title */
- protected List<String> compartmentTitlesList;
-
- /** The list of label names for this node */
- protected List<String> labelsList;
-
- /** Constructor */
- public ParametricDiagramNodePreferencePage() {
- this.labelsList = new ArrayList<String>();
- this.compartmentNamesList = new ArrayList<String>();
- this.compartmentTitlesList = new ArrayList<String>();
-
- initializeLabelsList();
- initializeCompartmentNamesList();
- initializeCompartmentTitlesList();
-
- Collections.unmodifiableList(labelsList);
- Collections.unmodifiableList(compartmentNamesList);
- Collections.unmodifiableList(compartmentTitlesList);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected void createPageContents(Composite parent) {
- super.createPageContents(parent);
-
- // Add compartments visibility group
- if (!compartmentNamesList.isEmpty()) {
- OrderedCompartmentGroup compartmentGroup = new OrderedCompartmentGroup(parent, getPreferenceKey(), this, compartmentNamesList, compartmentTitlesList, getPreferenceStore());
- addPreferenceGroup(compartmentGroup);
- }
-
- // Add label visibility group
- if (!labelsList.isEmpty()) {
- OrderedLabelGroup compartmentGroup = new OrderedLabelGroup(parent, getPreferenceKey(), this, labelsList);
- addPreferenceGroup(compartmentGroup);
- }
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected String getBundleId() {
- return Activator.PLUGIN_ID;
- }
-
- /** Initialize the list containing names of labels. */
- protected void initializeLabelsList() {
- // Implemented by subclasses.
- }
-
- /** Initialize the list containing the names of compartments. */
- protected void initializeCompartmentNamesList() {
- // Implemented by subclasses.
- }
-
- /** Initialize the list containing the names of compartment that have titles. */
- protected void initializeCompartmentTitlesList() {
- // Implemented by subclasses.
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected final TreeMap<String, String> getLabelRole() {
- return new TreeMap<String, String>();
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected final TreeMap<String, Boolean> getCompartmentTitleVisibilityPreferences() {
- return new TreeMap<String, Boolean>();
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected final void initializeCompartmentsList() {
- compartmentsList = Collections.emptyList();
- }
-}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/preferences/ParametricDiagramPreferenceInitializer.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/preferences/ParametricDiagramPreferenceInitializer.java deleted file mode 100644 index 560e1b430ab..00000000000 --- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/preferences/ParametricDiagramPreferenceInitializer.java +++ /dev/null @@ -1,39 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Régis CHEVREL: chevrel.regis <at> gmail.com - * CEA LIST - Initial API and implementation - * - *****************************************************************************/ -package org.eclipse.papyrus.sysml.diagram.parametric.preferences; - -import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer; -import org.eclipse.jface.preference.IPreferenceStore; -import org.eclipse.papyrus.sysml.diagram.parametric.Activator; - -public class ParametricDiagramPreferenceInitializer extends AbstractPreferenceInitializer { - - protected IPreferenceStore getPreferenceStore() { - return Activator.getInstance().getPreferenceStore(); - } - - @Override - public void initializeDefaultPreferences() { - IPreferenceStore store = getPreferenceStore(); - - org.eclipse.papyrus.sysml.diagram.parametric.preferences.ConstraintPreferencePage.initDefaults(store); - org.eclipse.papyrus.sysml.diagram.parametric.preferences.CommentPreferencePage.initDefaults(store); - org.eclipse.papyrus.sysml.diagram.parametric.preferences.CommentAnnotatedElementPreferencePage.initDefaults(store); - BlockCompositePreferencePage.initDefaults(store); - BlockPropertyCompositePreferencePage.initDefaults(store); - ConnectorPreferencePage.initDefaults(store); - DependencyPreferencePage.initDefaults(store); - - } -} diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/provider/CustomEditPartProvider.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/provider/CustomEditPartProvider.java deleted file mode 100644 index f63c6714da0..00000000000 --- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/provider/CustomEditPartProvider.java +++ /dev/null @@ -1,133 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Régis CHEVREL: chevrel.regis <at> gmail.com - * CEA LIST - Initial API and implementation - * - *****************************************************************************/ -package org.eclipse.papyrus.sysml.diagram.parametric.provider; - -import java.util.HashMap; -import java.util.Map; - -import org.eclipse.gmf.runtime.common.core.service.IOperation; -import org.eclipse.gmf.runtime.diagram.ui.services.editpart.CreateGraphicEditPartOperation; -import org.eclipse.gmf.runtime.diagram.ui.services.editpart.IEditPartOperation; -import org.eclipse.gmf.runtime.notation.Edge; -import org.eclipse.gmf.runtime.notation.Node; -import org.eclipse.gmf.runtime.notation.View; -import org.eclipse.papyrus.gmf.diagram.common.provider.CustomAbstractEditPartProvider; -import org.eclipse.papyrus.sysml.diagram.common.edit.part.BlockPropertyStructureCompartmentEditPart; -import org.eclipse.papyrus.sysml.diagram.common.edit.part.FlowPortAffixedLabelNameEditPart; -import org.eclipse.papyrus.sysml.diagram.common.edit.part.FlowPortAffixedNodeEditPart; -import org.eclipse.papyrus.sysml.diagram.common.edit.part.StructureCompartmentEditPart; -import org.eclipse.papyrus.sysml.diagram.common.utils.SysMLGraphicalTypes; -import org.eclipse.papyrus.sysml.diagram.parametric.edit.part.CustomBlockCompositeEditPartTN; -import org.eclipse.papyrus.sysml.diagram.parametric.edit.part.CustomBlockLabelNameEditPart; -import org.eclipse.papyrus.sysml.diagram.parametric.edit.part.CustomBlockPropertyCompositeEditPart; -import org.eclipse.papyrus.sysml.diagram.parametric.edit.part.CustomConstraintBlockPropertyCompositeEditPart; -import org.eclipse.papyrus.sysml.diagram.parametric.edit.part.CustomConstraintParameterAffixedNodeEditPart; -import org.eclipse.papyrus.uml.diagram.common.edit.part.AppliedStereotypeAffixedLabelEditPart; -import org.eclipse.papyrus.uml.diagram.common.edit.part.AppliedStereotypeLinkLabelEditPart; -import org.eclipse.papyrus.uml.diagram.common.edit.part.ConnectorEditPart; -import org.eclipse.papyrus.uml.diagram.common.edit.part.ConnectorLinkLabelEditPart; -import org.eclipse.papyrus.uml.diagram.common.edit.part.ConnectorLinkLabelSourceMultiplicityEditPart; -import org.eclipse.papyrus.uml.diagram.common.edit.part.ConnectorLinkLabelTargetMultiplicityEditPart; -import org.eclipse.papyrus.uml.diagram.common.edit.part.ConstraintNodeLabelEditPart; -import org.eclipse.papyrus.uml.diagram.common.edit.part.DependencyEditPart; -import org.eclipse.papyrus.uml.diagram.common.edit.part.NamedElementLinkLabelNameEditPart; -import org.eclipse.papyrus.uml.diagram.common.edit.part.PortAffixedLabelNameEditPart; -import org.eclipse.papyrus.uml.diagram.common.edit.part.PortAffixedNodeEditPart; -import org.eclipse.papyrus.uml.diagram.common.edit.part.PropertyNodeLabelEditPart; -import org.eclipse.papyrus.uml.diagram.common.utils.UMLGraphicalTypes; - -public class CustomEditPartProvider extends CustomAbstractEditPartProvider { - - /** Map containing node view types supported by this provider */ - protected Map<String, Class<?>> nodeMap = new HashMap<String, Class<?>>(); - - /** Map containing edge view types supported by this provider */ - protected Map<String, Class<?>> edgeMap = new HashMap<String, Class<?>>(); - - /** Default constructor */ - public CustomEditPartProvider() { - super(); - - diagramType = ElementTypes.DIAGRAM_ID; - - // Nodes - nodeMap.put(SysMLGraphicalTypes.SHAPE_SYSML_CONSTRAINTBLOCKPROPERTY_AS_COMPOSITE_ID, CustomConstraintBlockPropertyCompositeEditPart.class); - nodeMap.put(SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, CustomBlockPropertyCompositeEditPart.class); - nodeMap.put(SysMLGraphicalTypes.SHAPE_SYSML_BLOCK_AS_COMPOSITE_ID, CustomBlockCompositeEditPartTN.class); - nodeMap.put(SysMLGraphicalTypes.SHAPE_SYSML_FLOWPORT_AS_AFFIXED_ID, FlowPortAffixedNodeEditPart.class); - nodeMap.put(UMLGraphicalTypes.SHAPE_UML_PORT_AS_AFFIXED_ID, PortAffixedNodeEditPart.class); - nodeMap.put(UMLGraphicalTypes.SHAPE_UML_PROPERTY_AS_AFFIXED_ID, CustomConstraintParameterAffixedNodeEditPart.class); - - // Decorations - nodeMap.put(SysMLGraphicalTypes.AFFIXEDLABEL_SYSML_FLOWPORT_LABEL_ID, FlowPortAffixedLabelNameEditPart.class); - nodeMap.put(SysMLGraphicalTypes.COMPARTMENT_SYSML_BLOCKPROPERTY_STRUCTURE_ID, BlockPropertyStructureCompartmentEditPart.class); - nodeMap.put(SysMLGraphicalTypes.COMPARTMENT_SYSML_STRUCTURE_ID, StructureCompartmentEditPart.class); - nodeMap.put(SysMLGraphicalTypes.LABEL_SYSML_BLOCK_NAME_ID, CustomBlockLabelNameEditPart.class); // TODO : change for multi FlowText - nodeMap.put(UMLGraphicalTypes.AFFIXEDLABEL_UML_APPLIEDSTEREOTYPE_ID, AppliedStereotypeAffixedLabelEditPart.class); - nodeMap.put(UMLGraphicalTypes.AFFIXEDLABEL_UML_PORT_LABEL_ID, PortAffixedLabelNameEditPart.class); - nodeMap.put(UMLGraphicalTypes.LABEL_UML_PROPERTY_LABEL_ID, PropertyNodeLabelEditPart.class); - nodeMap.put(UMLGraphicalTypes.SHAPE_UML_CONSTRAINT_AS_LABEL_ID, ConstraintNodeLabelEditPart.class); - nodeMap.put(UMLGraphicalTypes.LINKLABEL_UML_APPLIEDSTEREOTYPE_ID, AppliedStereotypeLinkLabelEditPart.class); - nodeMap.put(UMLGraphicalTypes.LINKLABEL_UML_CONNECTOR_LABEL_ID, ConnectorLinkLabelEditPart.class); - nodeMap.put(UMLGraphicalTypes.LINKLABEL_UML_CONNECTOR_SOURCE_MULTIPLICITY_ID, ConnectorLinkLabelSourceMultiplicityEditPart.class); - nodeMap.put(UMLGraphicalTypes.LINKLABEL_UML_CONNECTOR_TARGET_MULTIPLICITY_ID, ConnectorLinkLabelTargetMultiplicityEditPart.class); - nodeMap.put(UMLGraphicalTypes.LINKLABEL_UML_NAMEDELEMENT_NAME_ID, NamedElementLinkLabelNameEditPart.class); - - - // Edges - edgeMap.put(UMLGraphicalTypes.LINK_UML_CONNECTOR_ID, ConnectorEditPart.class); - edgeMap.put(UMLGraphicalTypes.LINK_UML_DEPENDENCY_ID, DependencyEditPart.class); - } - - /** - * {@inheritDoc} - */ - @Override - public boolean provides(IOperation operation) { - if (operation instanceof CreateGraphicEditPartOperation) { - View newView = ((IEditPartOperation) operation).getView(); - if (newView == null) { - return false; - } - - String graphicalType = newView.getType(); - - if ((newView instanceof Node) && (!nodeMap.containsKey(graphicalType))) { - return false; - } - - if ((newView instanceof Edge) && (!edgeMap.containsKey(graphicalType))) { - return false; - } - } - - return super.provides(operation); - } - - /** - * {@inheritDoc} - */ - @Override - protected Class<?> getNodeEditPartClass(View view) { - return nodeMap.get(view.getType()); - } - - /** - * {@inheritDoc} - */ - @Override - protected Class<?> getEdgeEditPartClass(View view) { - return edgeMap.get(view.getType()); - } -} diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/provider/CustomGraphicalTypeRegistry.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/provider/CustomGraphicalTypeRegistry.java deleted file mode 100644 index 0d20a3bdf92..00000000000 --- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/provider/CustomGraphicalTypeRegistry.java +++ /dev/null @@ -1,255 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Régis CHEVREL: chevrel.regis <at> gmail.com - * CEA LIST - Initial API and implementation - * - *****************************************************************************/ -package org.eclipse.papyrus.sysml.diagram.parametric.provider; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.gmf.runtime.emf.type.core.ISpecializationType; -import org.eclipse.papyrus.sysml.constraints.ConstraintBlock; -import org.eclipse.papyrus.sysml.diagram.common.utils.SysMLGraphicalTypes; -import org.eclipse.papyrus.sysml.diagram.internalblock.provider.ElementTypes; -import org.eclipse.papyrus.sysml.service.types.element.SysMLElementTypes; -import org.eclipse.papyrus.uml.diagram.common.utils.UMLGraphicalTypes; -import org.eclipse.papyrus.uml.service.types.element.UMLElementTypes; -import org.eclipse.uml2.uml.Element; -import org.eclipse.uml2.uml.util.UMLUtil; - -public class CustomGraphicalTypeRegistry extends GraphicalTypeRegistry { - - /** Default constructor */ - public CustomGraphicalTypeRegistry() { - - super(); - - // Nodes - knownNodes.add(SysMLGraphicalTypes.SHAPE_SYSML_CONSTRAINTBLOCKPROPERTY_AS_COMPOSITE_ID); - knownNodes.add(SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID); - knownNodes.add(SysMLGraphicalTypes.SHAPE_SYSML_BLOCK_AS_COMPOSITE_ID); - knownNodes.add(SysMLGraphicalTypes.SHAPE_SYSML_FLOWPORT_AS_AFFIXED_ID); - knownNodes.add(UMLGraphicalTypes.SHAPE_UML_PORT_AS_AFFIXED_ID); - knownNodes.add(UMLGraphicalTypes.SHAPE_UML_PROPERTY_AS_AFFIXED_ID); - // Decorations - knownNodes.add(SysMLGraphicalTypes.AFFIXEDLABEL_SYSML_FLOWPORT_LABEL_ID); - knownNodes.add(SysMLGraphicalTypes.COMPARTMENT_SYSML_BLOCKPROPERTY_STRUCTURE_ID); - knownNodes.add(SysMLGraphicalTypes.COMPARTMENT_SYSML_STRUCTURE_ID); - knownNodes.add(SysMLGraphicalTypes.LABEL_SYSML_BLOCK_NAME_ID); - knownNodes.add(UMLGraphicalTypes.AFFIXEDLABEL_UML_APPLIEDSTEREOTYPE_ID); - knownNodes.add(UMLGraphicalTypes.AFFIXEDLABEL_UML_PORT_LABEL_ID); - knownNodes.add(UMLGraphicalTypes.LABEL_UML_PROPERTY_LABEL_ID); - knownNodes.add(UMLGraphicalTypes.SHAPE_UML_CONSTRAINT_AS_LABEL_ID); - knownNodes.add(UMLGraphicalTypes.LINKLABEL_UML_APPLIEDSTEREOTYPE_ID); - knownNodes.add(UMLGraphicalTypes.LINKLABEL_UML_CONNECTOR_LABEL_ID); - knownNodes.add(UMLGraphicalTypes.LINKLABEL_UML_CONNECTOR_SOURCE_MULTIPLICITY_ID); - knownNodes.add(UMLGraphicalTypes.LINKLABEL_UML_CONNECTOR_TARGET_MULTIPLICITY_ID); - knownNodes.add(UMLGraphicalTypes.LINKLABEL_UML_NAMEDELEMENT_NAME_ID); - - // Edges - knownEdges.add(UMLGraphicalTypes.LINK_UML_CONNECTOR_ID); - knownEdges.add(UMLGraphicalTypes.LINK_UML_DEPENDENCY_ID); - } - - /** - * {@inheritDoc} - */ - @Override - public String getNodeGraphicalType(EObject domainElement, String containerType) { - // Start of user code getNodeGraphicalType(EObject domainElement, String containerType) - // End of user code - - if (((ISpecializationType) SysMLElementTypes.BLOCK).getMatcher().matches(domainElement)) { - if (ElementTypes.DIAGRAM_ID.equals(containerType)) { - return SysMLGraphicalTypes.SHAPE_SYSML_BLOCK_AS_COMPOSITE_ID; - } - return UNDEFINED_TYPE; - } - if (((ISpecializationType) SysMLElementTypes.CONSTRAINT_PROPERTY).getMatcher().matches(domainElement)) { - if (SysMLGraphicalTypes.SHAPE_SYSML_BLOCK_AS_COMPOSITE_ID.equals(domainElement)) { - return SysMLGraphicalTypes.SHAPE_SYSML_CONSTRAINTBLOCKPROPERTY_AS_COMPOSITE_ID; - } - if (SysMLGraphicalTypes.COMPARTMENT_SYSML_BLOCKPROPERTY_STRUCTURE_ID.equals(containerType)) { - return SysMLGraphicalTypes.SHAPE_SYSML_CONSTRAINTBLOCKPROPERTY_AS_COMPOSITE_ID; - } - if (SysMLGraphicalTypes.COMPARTMENT_SYSML_STRUCTURE_ID.equals(containerType)) { - return SysMLGraphicalTypes.SHAPE_SYSML_CONSTRAINTBLOCKPROPERTY_AS_COMPOSITE_ID; - } - return UNDEFINED_TYPE; - } - - // These element are only authorized on Block, not in Constraint Block. In ConstraintBlock it must become a ConstraintParameter - if (UMLUtil.getStereotypeApplication((Element) domainElement.eContainer(), ConstraintBlock.class) == null) { - if (((ISpecializationType) SysMLElementTypes.PART_PROPERTY).getMatcher().matches(domainElement)) { - if (SysMLGraphicalTypes.SHAPE_SYSML_BLOCK_AS_COMPOSITE_ID.equals(containerType)) { - return SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID; - } - if (SysMLGraphicalTypes.COMPARTMENT_SYSML_BLOCKPROPERTY_STRUCTURE_ID.equals(containerType)) { - return SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID; - } - if (SysMLGraphicalTypes.COMPARTMENT_SYSML_STRUCTURE_ID.equals(containerType)) { - return SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID; - } - return UNDEFINED_TYPE; - } - if (((ISpecializationType) SysMLElementTypes.REFERENCE_PROPERTY).getMatcher().matches(domainElement)) { - if (SysMLGraphicalTypes.SHAPE_SYSML_BLOCK_AS_COMPOSITE_ID.equals(containerType)) { - return SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID; - } - if (SysMLGraphicalTypes.COMPARTMENT_SYSML_BLOCKPROPERTY_STRUCTURE_ID.equals(containerType)) { - return SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID; - } - if (SysMLGraphicalTypes.COMPARTMENT_SYSML_STRUCTURE_ID.equals(containerType)) { - return SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID; - } - return UNDEFINED_TYPE; - } - if (((ISpecializationType) SysMLElementTypes.VALUE_PROPERTY).getMatcher().matches(domainElement)) { - if (SysMLGraphicalTypes.SHAPE_SYSML_BLOCK_AS_COMPOSITE_ID.equals(containerType)) { - return SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID; - } - if (SysMLGraphicalTypes.COMPARTMENT_SYSML_BLOCKPROPERTY_STRUCTURE_ID.equals(containerType)) { - return SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID; - } - if (SysMLGraphicalTypes.COMPARTMENT_SYSML_STRUCTURE_ID.equals(containerType)) { - return SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID; - } - return UNDEFINED_TYPE; - } - } - // Order is important for Part/Reference/ConstraintProperty which are also Property - if (UMLElementTypes.PROPERTY.getEClass().isInstance(domainElement)) { - if (SysMLGraphicalTypes.SHAPE_SYSML_CONSTRAINTBLOCKPROPERTY_AS_COMPOSITE_ID.equals(containerType)) { - return UMLGraphicalTypes.SHAPE_UML_PROPERTY_AS_AFFIXED_ID; - } - if (SysMLGraphicalTypes.SHAPE_SYSML_BLOCK_AS_COMPOSITE_ID.equals(containerType)) { - return UMLGraphicalTypes.SHAPE_UML_PROPERTY_AS_AFFIXED_ID; - } - return UNDEFINED_TYPE; - - } - if (((ISpecializationType) SysMLElementTypes.BLOCK).getMatcher().matches(domainElement)) { - if (ElementTypes.DIAGRAM_ID.equals(containerType)) { - return SysMLGraphicalTypes.SHAPE_SYSML_BLOCK_AS_COMPOSITE_ID; - } - return UNDEFINED_TYPE; - } - return super.getNodeGraphicalType(domainElement, containerType); - } - - /** - * {@inheritDoc} - */ - @Override - public String getNodeGraphicalType(String proposedType, String containerType) { - // Start of user code getNodeGraphicalType(String proposedType, String containerType) - // End of user code - - if (SysMLElementTypes.BLOCK.getSemanticHint().equals(proposedType)) { - if (ElementTypes.DIAGRAM_ID.equals(containerType)) { - return SysMLGraphicalTypes.SHAPE_SYSML_BLOCK_AS_COMPOSITE_ID; - } - return UNDEFINED_TYPE; - } - - if (UMLElementTypes.PROPERTY.getSemanticHint().equals(proposedType)) { - if (SysMLGraphicalTypes.SHAPE_SYSML_CONSTRAINTBLOCKPROPERTY_AS_COMPOSITE_ID.equals(containerType)) { - return UMLGraphicalTypes.SHAPE_UML_PROPERTY_AS_AFFIXED_ID; - } - if (SysMLGraphicalTypes.SHAPE_SYSML_BLOCK_AS_COMPOSITE_ID.equals(containerType)) { - return UMLGraphicalTypes.SHAPE_UML_PROPERTY_AS_AFFIXED_ID; - } - return UNDEFINED_TYPE; - } - - if (SysMLElementTypes.CONSTRAINT_PROPERTY.getSemanticHint().equals(proposedType)) { - if (SysMLGraphicalTypes.COMPARTMENT_SYSML_BLOCKPROPERTY_STRUCTURE_ID.equals(containerType)) { - - return SysMLGraphicalTypes.SHAPE_SYSML_CONSTRAINTBLOCKPROPERTY_AS_COMPOSITE_ID; - } - if (SysMLGraphicalTypes.COMPARTMENT_SYSML_STRUCTURE_ID.equals(containerType)) { - return SysMLGraphicalTypes.SHAPE_SYSML_CONSTRAINTBLOCKPROPERTY_AS_COMPOSITE_ID; - } - return UNDEFINED_TYPE; - } - - if (SysMLElementTypes.PART_PROPERTY.getSemanticHint().equals(proposedType)) { - if (SysMLGraphicalTypes.SHAPE_SYSML_BLOCK_AS_COMPOSITE_ID.equals(containerType)) { - return SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID; - } - if (SysMLGraphicalTypes.COMPARTMENT_SYSML_BLOCKPROPERTY_STRUCTURE_ID.equals(containerType)) { - return SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID; - } - if (SysMLGraphicalTypes.COMPARTMENT_SYSML_STRUCTURE_ID.equals(containerType)) { - return SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID; - } - return UNDEFINED_TYPE; - } - if (SysMLElementTypes.REFERENCE_PROPERTY.getSemanticHint().equals(proposedType)) { - if (SysMLGraphicalTypes.SHAPE_SYSML_BLOCK_AS_COMPOSITE_ID.equals(containerType)) { - return SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID; - } - if (SysMLGraphicalTypes.COMPARTMENT_SYSML_BLOCKPROPERTY_STRUCTURE_ID.equals(containerType)) { - return SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID; - } - if (SysMLGraphicalTypes.COMPARTMENT_SYSML_STRUCTURE_ID.equals(containerType)) { - return SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID; - } - return UNDEFINED_TYPE; - } - if (SysMLElementTypes.VALUE_PROPERTY.getSemanticHint().equals(proposedType)) { - if (SysMLGraphicalTypes.SHAPE_SYSML_BLOCK_AS_COMPOSITE_ID.equals(containerType)) { - return SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID; - } - if (SysMLGraphicalTypes.COMPARTMENT_SYSML_BLOCKPROPERTY_STRUCTURE_ID.equals(containerType)) { - return SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID; - } - if (SysMLGraphicalTypes.COMPARTMENT_SYSML_STRUCTURE_ID.equals(containerType)) { - return SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID; - } - return UNDEFINED_TYPE; - } - return super.getNodeGraphicalType(proposedType, containerType); - } - - /** - * {@inheritDoc} - */ - @Override - public String getEdgeGraphicalType(EObject domainElement) { - // Start of user code getEdgeGraphicalType(EObject domainElement) - // End of user code - - if (UMLElementTypes.CONNECTOR.getEClass().isInstance(domainElement)) { - return UMLGraphicalTypes.LINK_UML_CONNECTOR_ID; - } - if (UMLElementTypes.DEPENDENCY.getEClass().isInstance(domainElement)) { - return UMLGraphicalTypes.LINK_UML_DEPENDENCY_ID; - } - return super.getEdgeGraphicalType(domainElement); - } - - /** - * {@inheritDoc} - */ - @Override - public String getEdgeGraphicalType(String proposedType) { - // Start of user code getEdgeGraphicalType(String proposedType) - // End of user code - - if (UMLElementTypes.CONNECTOR.getSemanticHint().equals(proposedType)) { - return UMLGraphicalTypes.LINK_UML_CONNECTOR_ID; - } - if (UMLElementTypes.DEPENDENCY.getSemanticHint().equals(proposedType)) { - return UMLGraphicalTypes.LINK_UML_DEPENDENCY_ID; - } - return super.getEdgeGraphicalType(proposedType); - } -} diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/provider/CustomGraphicalTypes.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/provider/CustomGraphicalTypes.java deleted file mode 100644 index 51ddb08410c..00000000000 --- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/provider/CustomGraphicalTypes.java +++ /dev/null @@ -1,26 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Régis CHEVREL: chevrel.regis <at> gmail.com - * CEA LIST - Initial API and implementation - * - *****************************************************************************/ -package org.eclipse.papyrus.sysml.diagram.parametric.provider; - -public class CustomGraphicalTypes { - - /** ********************************************************* */ - /** Diagram custom graphical types id *********************** */ - /** ********************************************************* */ - - - - - -} diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/provider/CustomViewProvider.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/provider/CustomViewProvider.java deleted file mode 100644 index 318d7a10c2b..00000000000 --- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/provider/CustomViewProvider.java +++ /dev/null @@ -1,100 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Régis CHEVREL: chevrel.regis <at> gmail.com - * CEA LIST - Initial API and implementation - * - *****************************************************************************/ -package org.eclipse.papyrus.sysml.diagram.parametric.provider; - -import java.util.HashMap; -import java.util.Map; - -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.gmf.runtime.notation.View; -import org.eclipse.papyrus.gmf.diagram.common.factory.AffixedLabelViewFactory; -import org.eclipse.papyrus.gmf.diagram.common.factory.CompartmentShapeViewFactory; -import org.eclipse.papyrus.gmf.diagram.common.factory.ConnectorLabelViewFactory; -import org.eclipse.papyrus.gmf.diagram.common.factory.InnerLabelViewFactory; -import org.eclipse.papyrus.gmf.diagram.common.provider.CustomAbstractViewProvider; -import org.eclipse.papyrus.sysml.diagram.common.factory.BlockCompositeClassifierViewFactory; -import org.eclipse.papyrus.sysml.diagram.common.factory.BlockPropertyCompositeClassifierViewFactory; -import org.eclipse.papyrus.sysml.diagram.common.factory.ConstraintBlockPropertyCompositeClassifierViewFactory; -import org.eclipse.papyrus.sysml.diagram.common.factory.FlowPortAffixedNodeViewFactory; -import org.eclipse.papyrus.sysml.diagram.common.utils.SysMLGraphicalTypes; -import org.eclipse.papyrus.uml.diagram.common.factory.ConnectorLinkViewFactory; -import org.eclipse.papyrus.uml.diagram.common.factory.ConstraintPropertyAffixedNodeViewFactory; -import org.eclipse.papyrus.uml.diagram.common.factory.DependencyLinkViewFactory; -import org.eclipse.papyrus.uml.diagram.common.factory.PortAffixedNodeViewFactory; -import org.eclipse.papyrus.uml.diagram.common.utils.UMLGraphicalTypes; - -public class CustomViewProvider extends CustomAbstractViewProvider { - - /** Map containing node view types supported by this provider */ - protected Map<String, Class<?>> nodeMap = new HashMap<String, Class<?>>(); - - /** Map containing edge view types supported by this provider */ - protected Map<String, Class<?>> edgeMap = new HashMap<String, Class<?>>(); - - /** Default constructor */ - public CustomViewProvider() { - super(); - this.registry = new CustomGraphicalTypeRegistry(); - - diagramType = ElementTypes.DIAGRAM_ID; - - // Custom classifier nodes - nodeMap.put(SysMLGraphicalTypes.SHAPE_SYSML_BLOCK_AS_COMPOSITE_ID, BlockCompositeClassifierViewFactory.class); - nodeMap.put(SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, BlockPropertyCompositeClassifierViewFactory.class); - nodeMap.put(SysMLGraphicalTypes.SHAPE_SYSML_CONSTRAINTBLOCKPROPERTY_AS_COMPOSITE_ID, ConstraintBlockPropertyCompositeClassifierViewFactory.class); - nodeMap.put(UMLGraphicalTypes.SHAPE_UML_PROPERTY_AS_AFFIXED_ID, ConstraintPropertyAffixedNodeViewFactory.class); - // Custom affixed nodes - nodeMap.put(SysMLGraphicalTypes.SHAPE_SYSML_FLOWPORT_AS_AFFIXED_ID, FlowPortAffixedNodeViewFactory.class); - nodeMap.put(UMLGraphicalTypes.SHAPE_UML_PORT_AS_AFFIXED_ID, PortAffixedNodeViewFactory.class); - // Custom child node labels - // Custom inner labels - nodeMap.put(SysMLGraphicalTypes.LABEL_SYSML_BLOCK_NAME_ID, InnerLabelViewFactory.class); - nodeMap.put(UMLGraphicalTypes.LABEL_UML_PROPERTY_LABEL_ID, InnerLabelViewFactory.class); - nodeMap.put(UMLGraphicalTypes.SHAPE_UML_CONSTRAINT_AS_LABEL_ID, InnerLabelViewFactory.class); - // Custom compartments - nodeMap.put(SysMLGraphicalTypes.COMPARTMENT_SYSML_STRUCTURE_ID, CompartmentShapeViewFactory.class); - nodeMap.put(SysMLGraphicalTypes.COMPARTMENT_SYSML_BLOCKPROPERTY_STRUCTURE_ID, CompartmentShapeViewFactory.class); - // Custom affixed labels - nodeMap.put(SysMLGraphicalTypes.AFFIXEDLABEL_SYSML_FLOWPORT_LABEL_ID, AffixedLabelViewFactory.class); - nodeMap.put(UMLGraphicalTypes.AFFIXEDLABEL_UML_APPLIEDSTEREOTYPE_ID, AffixedLabelViewFactory.class); - nodeMap.put(UMLGraphicalTypes.AFFIXEDLABEL_UML_PORT_LABEL_ID, AffixedLabelViewFactory.class); - - // Custom edges - edgeMap.put(UMLGraphicalTypes.LINK_UML_CONNECTOR_ID, ConnectorLinkViewFactory.class); - edgeMap.put(UMLGraphicalTypes.LINK_UML_DEPENDENCY_ID, DependencyLinkViewFactory.class); - - // Custom edge labels - nodeMap.put(UMLGraphicalTypes.LINKLABEL_UML_APPLIEDSTEREOTYPE_ID, ConnectorLabelViewFactory.class); - nodeMap.put(UMLGraphicalTypes.LINKLABEL_UML_CONNECTOR_LABEL_ID, ConnectorLabelViewFactory.class); - nodeMap.put(UMLGraphicalTypes.LINKLABEL_UML_CONNECTOR_SOURCE_MULTIPLICITY_ID, ConnectorLabelViewFactory.class); - nodeMap.put(UMLGraphicalTypes.LINKLABEL_UML_CONNECTOR_TARGET_MULTIPLICITY_ID, ConnectorLabelViewFactory.class); - nodeMap.put(UMLGraphicalTypes.LINKLABEL_UML_NAMEDELEMENT_NAME_ID, ConnectorLabelViewFactory.class); - } - - /** - * {@inheritDoc} - */ - @Override - protected Class<?> getNodeViewClass(IAdaptable semanticAdapter, View containerView, String graphicalType) { - return nodeMap.get(graphicalType); - } - - /** - * {@inheritDoc} - */ - @Override - protected Class<?> getEdgeViewClass(IAdaptable semanticAdapter, View containerView, String graphicalType) { - return edgeMap.get(graphicalType); - } -} diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/provider/ElementTypes.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/provider/ElementTypes.java deleted file mode 100644 index 827030013c4..00000000000 --- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/provider/ElementTypes.java +++ /dev/null @@ -1,75 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * R�gis CHEVREL: chevrel.regis <at> gmail.com - * CEA LIST - Initial API and implementation - * - *****************************************************************************/ -package org.eclipse.papyrus.sysml.diagram.parametric.provider; - -import org.eclipse.gmf.runtime.emf.type.core.AbstractElementTypeEnumerator; -import org.eclipse.gmf.runtime.emf.type.core.IHintedType; -import org.eclipse.papyrus.uml.diagram.clazz.edit.parts.CommentBodyEditPart; -import org.eclipse.papyrus.uml.diagram.clazz.edit.parts.CommentBodyEditPartCN; -import org.eclipse.papyrus.uml.diagram.clazz.edit.parts.ConstraintNameEditPart; -import org.eclipse.papyrus.uml.diagram.clazz.edit.parts.ConstraintNameEditPartCN; -import org.eclipse.papyrus.uml.diagram.composite.edit.parts.ConstraintSpecificationEditPart; -import org.eclipse.papyrus.uml.diagram.composite.edit.parts.ConstraintSpecificationEditPartCN; -import org.eclipse.papyrus.uml.diagram.composite.providers.UMLElementTypes; - -public class ElementTypes extends AbstractElementTypeEnumerator { - - /** ********************************************************* */ - /** SysML Parametric Diagram specific elements **************** */ - /** ********************************************************* */ - - /** SysML Parametric Diagram :: Diagram */ - public static final String DIAGRAM_ID = "Parametric"; - - - - - /** ********************************************************* */ - /** SysML Parametric Diagram - CompositeDiagram related elements */ - /** ********************************************************* */ - - /** CompositeDiagram :: CONSTRAINT */ - public static final IHintedType CONSTRAINT = (IHintedType) UMLElementTypes.Constraint_Shape; - - public static final String CONSTRAINT_LABEL_NAME_HINT = ConstraintNameEditPart.VISUAL_ID; - - public static final String CONSTRAINT_LABEL_SPECIFICATION_HINT = ConstraintSpecificationEditPart.VISUAL_ID; - - /** CompositeDiagram :: COMMENT_CN */ - public static final IHintedType COMMENT_CN = (IHintedType) UMLElementTypes.Comment_Shape_CN; - - public static final String COMMENT_CN_LABEL_BODY_HINT = CommentBodyEditPartCN.VISUAL_ID; - - /** CompositeDiagram :: COMMENT */ - public static final IHintedType COMMENT = (IHintedType) UMLElementTypes.Comment_Shape; - - public static final String COMMENT_LABEL_BODY_HINT = CommentBodyEditPart.VISUAL_ID; - - /** CompositeDiagram :: CONSTRAINT_CN */ - public static final IHintedType CONSTRAINT_CN = (IHintedType) UMLElementTypes.Constraint_Shape_CN; - - public static final String CONSTRAINT_CN_LABEL_NAME_HINT = ConstraintNameEditPartCN.VISUAL_ID; - - public static final String CONSTRAINT_CN_LABEL_SPECIFICATION_HINT = ConstraintSpecificationEditPartCN.VISUAL_ID; - - /** CompositeDiagram :: COMMENT_ANNOTATED_ELEMENT */ - public static final IHintedType COMMENT_ANNOTATED_ELEMENT = (IHintedType) UMLElementTypes.Comment_AnnotatedElementEdge; - - /** CompositeDiagram :: CONTEXT_LINK */ - public static final IHintedType CONTEXT_LINK = (IHintedType) getElementType("org.eclipse.papyrus.sysml.diagram.parametric.Constraint_ContextEdge"); //$NON-NLS-1$ - - /** CompositeDiagram :: CONContextLinkAppliedStereotype */ - public static final IHintedType CONTEXT_LINK_APPLIED_STEREOTYPE = (IHintedType) getElementType("org.eclipse.papyrus.sysml.diagram.parametric.Constraint_KeywordLabel"); //$NON-NLS-1$ - -} diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/provider/GraphicalTypeRegistry.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/provider/GraphicalTypeRegistry.java deleted file mode 100644 index 186fd31af2c..00000000000 --- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/provider/GraphicalTypeRegistry.java +++ /dev/null @@ -1,201 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Régis CHEVREL: chevrel.regis <at> gmail.com - * CEA LIST - Initial API and implementation - * - *****************************************************************************/ -package org.eclipse.papyrus.sysml.diagram.parametric.provider; - -import java.util.HashSet; -import java.util.Set; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.gmf.runtime.emf.type.core.IElementType; -import org.eclipse.gmf.runtime.emf.type.core.IHintedType; -import org.eclipse.papyrus.gmf.diagram.common.provider.IGraphicalTypeRegistry; -import org.eclipse.papyrus.sysml.diagram.common.utils.SysMLGraphicalTypes; -import org.eclipse.papyrus.uml.service.types.element.UMLElementTypes; - -/** - * <pre> - * This class provides graphical type id (used as View type) for - * domain element according to their actual or expected graphical - * container type. - * </pre> - */ -public class GraphicalTypeRegistry implements IGraphicalTypeRegistry { - - /** A Set containing all known node graphical types */ - protected Set<String> knownNodes = new HashSet<String>(); - - /** A Set containing all known edge graphical types */ - protected Set<String> knownEdges = new HashSet<String>(); - - /** Default constructor */ - public GraphicalTypeRegistry() { - - // Fill known edges set - knownEdges.add(ElementTypes.COMMENT_ANNOTATED_ELEMENT.getSemanticHint()); - knownEdges.add(ElementTypes.CONTEXT_LINK.getSemanticHint()); - knownEdges.add(ElementTypes.CONTEXT_LINK_APPLIED_STEREOTYPE.getSemanticHint()); - - // Fill known nodes set (primary nodes) - knownNodes.add(UMLElementTypes.CONSTRAINT.getSemanticHint()); - knownNodes.add(UMLElementTypes.COMMENT.getSemanticHint()); - - knownNodes.add(ElementTypes.CONSTRAINT.getSemanticHint()); - knownNodes.add(ElementTypes.COMMENT_CN.getSemanticHint()); - knownNodes.add(ElementTypes.COMMENT.getSemanticHint()); - knownNodes.add(ElementTypes.CONSTRAINT_CN.getSemanticHint()); - - // Fill known nodes set (child label nodes) - } - - /** - * {@inheritDoc} - */ - public String getEdgeGraphicalType(EObject domainElement) { - - String graphicalType = UNDEFINED_TYPE; - if (domainElement == null) { - return UNDEFINED_TYPE; - } - return graphicalType; - } - - /** - * {@inheritDoc} - */ - public String getEdgeGraphicalType(IElementType elementType) { - if (elementType instanceof IHintedType) { - String semanticHint = ((IHintedType) elementType).getSemanticHint(); - return getEdgeGraphicalType(semanticHint); - } - - return UNDEFINED_TYPE; - } - - /** - * {@inheritDoc} - */ - public String getEdgeGraphicalType(String proposedType) { - if (isKnownEdgeType(proposedType)) { - return proposedType; - } - - return UNDEFINED_TYPE; - } - - /** - * {@inheritDoc} - */ - public String getNodeGraphicalType(EObject domainElement, String containerType) { - - String graphicalType = UNDEFINED_TYPE; - if ((containerType == null) || (domainElement == null)) { - return UNDEFINED_TYPE; - } - - if (domainElement instanceof org.eclipse.uml2.uml.Constraint) { - if (ElementTypes.DIAGRAM_ID.equals(containerType)) { // Constraint TopNode - graphicalType = ElementTypes.CONSTRAINT.getSemanticHint(); - } - if (SysMLGraphicalTypes.COMPARTMENT_SYSML_STRUCTURE_ID.equals(containerType)) { - graphicalType = ElementTypes.CONSTRAINT_CN.getSemanticHint(); - } - - } - - if (domainElement instanceof org.eclipse.uml2.uml.Comment) { - if (ElementTypes.DIAGRAM_ID.equals(containerType)) { // Comment TopNode - graphicalType = ElementTypes.COMMENT.getSemanticHint(); - } - if (SysMLGraphicalTypes.COMPARTMENT_SYSML_STRUCTURE_ID.equals(containerType)) { - graphicalType = ElementTypes.COMMENT_CN.getSemanticHint(); - } - if (SysMLGraphicalTypes.COMPARTMENT_SYSML_BLOCKPROPERTY_STRUCTURE_ID.equals(containerType)) { - graphicalType = ElementTypes.COMMENT_CN.getSemanticHint(); - } - - } - - return graphicalType; - } - - /** - * {@inheritDoc} - */ - public String getNodeGraphicalType(IElementType elementType, String containerType) { - if (elementType instanceof IHintedType) { - String semanticHint = ((IHintedType) elementType).getSemanticHint(); - return getNodeGraphicalType(semanticHint, containerType); - } - - return UNDEFINED_TYPE; - } - - /** - * {@inheritDoc} - */ - public String getNodeGraphicalType(String proposedType, String containerType) { - if ((UMLElementTypes.COMMENT.getSemanticHint().equals(proposedType))) { - - if (ElementTypes.DIAGRAM_ID.equals(containerType)) { // Constraint TopNode - return ElementTypes.COMMENT.getSemanticHint(); - } - - if (SysMLGraphicalTypes.COMPARTMENT_SYSML_STRUCTURE_ID.equals(containerType)) { - return ElementTypes.COMMENT_CN.getSemanticHint(); - } - - if (SysMLGraphicalTypes.COMPARTMENT_SYSML_BLOCKPROPERTY_STRUCTURE_ID.equals(containerType)) { - return ElementTypes.COMMENT_CN.getSemanticHint(); - } - - return UNDEFINED_TYPE; - } - - if (UMLElementTypes.CONSTRAINT.getSemanticHint().equals(proposedType)) { - - if (ElementTypes.DIAGRAM_ID.equals(containerType)) { // Constraint TopNode - return ElementTypes.CONSTRAINT.getSemanticHint(); - } - if (SysMLGraphicalTypes.COMPARTMENT_SYSML_STRUCTURE_ID.equals(containerType)) { - return ElementTypes.CONSTRAINT_CN.getSemanticHint(); - } - - if (SysMLGraphicalTypes.COMPARTMENT_SYSML_BLOCKPROPERTY_STRUCTURE_ID.equals(containerType)) { - return ElementTypes.CONSTRAINT_CN.getSemanticHint(); - } - - - return UNDEFINED_TYPE; - } - if (isKnownNodeType(proposedType)) { - return proposedType; - } - - return UNDEFINED_TYPE; - } - - /** - * {@inheritDoc} - */ - public boolean isKnownEdgeType(String type) { - return knownEdges.contains(type); - } - - /** - * {@inheritDoc} - */ - public boolean isKnownNodeType(String type) { - return knownNodes.contains(type); - } -} diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/provider/IGraphicalTypeRegistry.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/provider/IGraphicalTypeRegistry.java deleted file mode 100644 index a3f92e3f1e4..00000000000 --- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/provider/IGraphicalTypeRegistry.java +++ /dev/null @@ -1,110 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Régis CHEVREL: chevrel.regis <at> gmail.com - * CEA LIST - Initial API and implementation - * - *****************************************************************************/ -package org.eclipse.papyrus.sysml.diagram.parametric.provider; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.gmf.runtime.emf.type.core.IElementType; - -/** - * This interface provides an API for accessing the local graphical type registry. - * This registry provides a graphical type for existing model elements. - */ -public interface IGraphicalTypeRegistry { - - /** Constant for undefined graphical type */ - public static final String UNDEFINED_TYPE = "undefined_type"; - - /** - * Get a valid edge graphical type for the domain element. - * - * @param domainElement - * the domain element. - * @return the domain element graphical type. - */ - public String getEdgeGraphicalType(EObject domainElement); - - /** - * Get a valid edge graphical type for the element type. - * - * @param elementType - * the element type. - * @param containerType - * the type of the graphical owner of the domain element. - * @return the domain element graphical type. - */ - public String getEdgeGraphicalType(IElementType elementType); - - /** - * Get a valid edge graphical type for the proposed type. - * - * @param proposedType - * the proposed type. - * @param containerType - * the type of the graphical owner of the domain element. - * @return the domain element graphical type. - */ - public String getEdgeGraphicalType(String proposedType); - - /** - * Get a valid node graphical type for the domain element. - * - * @param domainElement - * the domain element. - * @param containerType - * the type of the graphical owner of the domain element. - * @return the domain element graphical type. - */ - public String getNodeGraphicalType(EObject domainElement, String containerType); - - /** - * Get a valid node graphical type for the element type. - * - * @param elementType - * the element type. - * @param containerType - * the type of the graphical owner of the domain element. - * @return the domain element graphical type. - */ - public String getNodeGraphicalType(IElementType elementType, String containerType); - - /** - * Get a valid node graphical type for the proposed type. - * - * @param proposedType - * the proposed type. - * @param containerType - * the type of the graphical owner of the domain element. - * @return the domain element graphical type. - */ - public String getNodeGraphicalType(String proposedType, String containerType); - - /** - * Test if the type is a known edge graphical type in this diagram - * - * @param type - * the type to test - * @return true if the type is known - */ - public boolean isKnownEdgeType(String type); - - /** - * Test if the type is a known node graphical type in this diagram - * - * @param type - * the type to test - * @return true if the type is known - */ - public boolean isKnownNodeType(String type); - -} diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/provider/InheritedCompositeDiagramEditPartProvider.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/provider/InheritedCompositeDiagramEditPartProvider.java deleted file mode 100644 index 05a7d55e7eb..00000000000 --- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/provider/InheritedCompositeDiagramEditPartProvider.java +++ /dev/null @@ -1,84 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * R�gis CHEVREL: chevrel.regis <at> gmail.com - * CEA LIST - Initial API and implementation - * - *****************************************************************************/ -package org.eclipse.papyrus.sysml.diagram.parametric.provider; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.gmf.runtime.common.core.service.IOperation; -import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart; -import org.eclipse.gmf.runtime.diagram.ui.services.editpart.CreateGraphicEditPartOperation; -import org.eclipse.gmf.runtime.diagram.ui.services.editpart.IEditPartOperation; -import org.eclipse.gmf.runtime.notation.View; -import org.eclipse.papyrus.uml.diagram.clazz.edit.parts.ContextLinkAppliedStereotypeEditPart; -import org.eclipse.papyrus.uml.diagram.clazz.edit.parts.ContextLinkEditPart; -import org.eclipse.papyrus.uml.diagram.composite.part.UMLVisualIDRegistry; -import org.eclipse.papyrus.uml.diagram.composite.providers.UMLEditPartProvider; - -public class InheritedCompositeDiagramEditPartProvider extends UMLEditPartProvider { - - @Override - protected IGraphicalEditPart createEditPart(View view) { - String visualID = UMLVisualIDRegistry.getVisualID(view); - if (ContextLinkEditPart.VISUAL_ID.equals(visualID)) { - return new ContextLinkEditPart(view); - } - if (ContextLinkAppliedStereotypeEditPart.VISUAL_ID.equals(visualID)) { - return new ContextLinkAppliedStereotypeEditPart(view); - } - return super.createEditPart(view); - } - - @Override - public synchronized boolean provides(IOperation operation) { - if (operation instanceof CreateGraphicEditPartOperation) { - View view = ((IEditPartOperation) operation).getView(); - - // Ensure current diagram is a Parametric Diagram - if (!ElementTypes.DIAGRAM_ID.equals(view.getDiagram().getType())) { - return false; - } - - // Test supported inherited types - EObject eobject = view.getElement(); - - /** Nodes (and ChildLabelNodes) *********** */ - if (eobject instanceof org.eclipse.uml2.uml.Constraint) { - return true; - } - if (eobject instanceof org.eclipse.uml2.uml.Comment) { - return true; - } - - // Additional test needed here to decide whether to support Feature type links. - // As feature type link are not related to a MetaClass from the domain model - // they are not already handled by previous tests. - // Also concerns NotationType. - String hint = view.getType(); - - /** Edges (Feature) : COMMENT_ANNOTATED_ELEMENT *********** */ - if (ElementTypes.COMMENT_ANNOTATED_ELEMENT.getSemanticHint().equals(hint)) { - return true; - } - /** Edges (Feature) : CONSTRAINT_CONSTRAINED_ELEMENT *********** */ - if (ElementTypes.CONTEXT_LINK.getSemanticHint().equals(hint)) { - return true; - } - if (ElementTypes.CONTEXT_LINK_APPLIED_STEREOTYPE.getSemanticHint().equals(hint)) { - return true; - } - - } - return false; - } - -} diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/provider/InheritedCompositeDiagramViewProvider.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/provider/InheritedCompositeDiagramViewProvider.java deleted file mode 100644 index 3098ae11653..00000000000 --- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/provider/InheritedCompositeDiagramViewProvider.java +++ /dev/null @@ -1,217 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * R�gis CHEVREL: chevrel.regis <at> gmail.com - * CEA LIST - Initial API and implementation - * - *****************************************************************************/ -package org.eclipse.papyrus.sysml.diagram.parametric.provider; - - -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.emf.ecore.EAnnotation; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.EcoreFactory; -import org.eclipse.gmf.runtime.diagram.core.preferences.PreferencesHint; -import org.eclipse.gmf.runtime.diagram.core.services.view.CreateEdgeViewOperation; -import org.eclipse.gmf.runtime.diagram.core.services.view.CreateNodeViewOperation; -import org.eclipse.gmf.runtime.diagram.core.services.view.CreateViewForKindOperation; -import org.eclipse.gmf.runtime.emf.type.core.IElementType; -import org.eclipse.gmf.runtime.notation.Edge; -import org.eclipse.gmf.runtime.notation.Node; -import org.eclipse.gmf.runtime.notation.View; -import org.eclipse.papyrus.gmf.diagram.common.provider.IGraphicalTypeRegistry; -import org.eclipse.papyrus.sysml.diagram.common.utils.SysMLGraphicalTypes; -import org.eclipse.papyrus.sysml.diagram.parametric.Activator; -import org.eclipse.papyrus.uml.diagram.common.commands.SemanticAdapter; -import org.eclipse.papyrus.uml.diagram.composite.providers.UMLViewProvider; -import org.eclipse.papyrus.uml.service.types.element.UMLElementTypes; - -public class InheritedCompositeDiagramViewProvider extends UMLViewProvider { - - /** Local graphical type registry */ - protected IGraphicalTypeRegistry registry = new GraphicalTypeRegistry(); - - @Override - public Edge createEdge(IAdaptable semanticAdapter, View containerView, String semanticHint, int index, boolean persisted, PreferencesHint preferencesHint) { - Edge createdEdge = null; - - IElementType elementType = (IElementType) semanticAdapter.getAdapter(IElementType.class); - if (elementType != null) { - if (elementType == ElementTypes.CONTEXT_LINK) { - org.eclipse.papyrus.uml.diagram.clazz.providers.UMLViewProvider classDiagramUMLProvider = new org.eclipse.papyrus.uml.diagram.clazz.providers.UMLViewProvider(); - createdEdge = classDiagramUMLProvider.createConstraint_ContextEdge(containerView, index, persisted, preferencesHint); - } - else { - createdEdge = super.createEdge(semanticAdapter, containerView, semanticHint, index, persisted, preferencesHint); - } - } - - if (createdEdge == null) { - Activator.log.error(new Exception("Could not create Edge.")); - } - - return createdEdge; - } - - @Override - protected boolean provides(CreateViewForKindOperation op) { - // Never use this method (often incorrectly implemented due to GMF Tooling choices). - String diagramType = op.getContainerView().getDiagram().getType(); - if (!ElementTypes.DIAGRAM_ID.equals(diagramType)) { - return false; - } - - throw new UnsupportedOperationException("Should never be called by the " + diagramType + " diagram."); - } - - @Override - protected boolean provides(CreateEdgeViewOperation op) { - - // Must have a container - if (op.getContainerView() == null) { - return false; - } - - // This provider is registered for InternalBlock Diagram only - String diagramType = op.getContainerView().getDiagram().getType(); - if (!ElementTypes.DIAGRAM_ID.equals(diagramType)) { - return false; - } - - IElementType elementType = getSemanticElementType(op.getSemanticAdapter()); - if (elementType == ElementTypes.COMMENT_ANNOTATED_ELEMENT) { - return true; - } - if (elementType == ElementTypes.CONTEXT_LINK) { - return true; - } - - // ///////////////////////////////////////////////////////////////////// - // Test possibility to provide a view based on the semantic nature and its expected container. - // ///////////////////////////////////////////////////////////////////// - - // IElementType may be null (especially when drop from ModelExplorer). - // In such a case, test the semantic EObject instead. - if (elementType == null) { - EObject domainElement = (EObject) op.getSemanticAdapter().getAdapter(EObject.class); - String domainElementGraphicalType = op.getSemanticHint(); - if (domainElementGraphicalType == null) { - domainElementGraphicalType = registry.getEdgeGraphicalType(domainElement); - } - - if ((!org.eclipse.papyrus.infra.gmfdiag.common.providers.IGraphicalTypeRegistry.UNDEFINED_TYPE.equals(domainElementGraphicalType)) && (registry.isKnownEdgeType(domainElementGraphicalType))) { - return true; - } - } - - return false; - } - - @Override - protected boolean provides(CreateNodeViewOperation op) { - // Must have a container - if (op.getContainerView() == null) { - return false; - } - // Get the type of the container - String containerGraphicalType = op.getContainerView().getType(); - - // This provider is registered for InternalBlock Diagram only - String diagramType = op.getContainerView().getDiagram().getType(); - if (!ElementTypes.DIAGRAM_ID.equals(diagramType)) { - return false; - } - - // ///////////////////////////////////////////////////////////////////// - // Test possibility to provide a view based on the ElementType and its expected container. - // ///////////////////////////////////////////////////////////////////// - - IElementType elementType = (IElementType) op.getSemanticAdapter().getAdapter(IElementType.class); - if (elementType == UMLElementTypes.CONSTRAINT) { - if (ElementTypes.DIAGRAM_ID.equals(containerGraphicalType)) { - return true; - } - if (SysMLGraphicalTypes.COMPARTMENT_SYSML_STRUCTURE_ID.equals(containerGraphicalType)) { - return true; - } - } - if (elementType == UMLElementTypes.COMMENT) { - if (ElementTypes.DIAGRAM_ID.equals(containerGraphicalType)) { - return true; - } - if (SysMLGraphicalTypes.COMPARTMENT_SYSML_STRUCTURE_ID.equals(containerGraphicalType)) { - return true; - } - if (SysMLGraphicalTypes.COMPARTMENT_SYSML_BLOCKPROPERTY_STRUCTURE_ID.equals(containerGraphicalType)) { - return true; - } - } - - // ///////////////////////////////////////////////////////////////////// - // Test possibility to provide a view based on the semantic nature and its expected container. - // ///////////////////////////////////////////////////////////////////// - - // IElementType may be null (especially when drop from ModelExplorer). - // In such a case, test the semantic EObject instead. - if (elementType == null) { - EObject domainElement = (EObject) op.getSemanticAdapter().getAdapter(EObject.class); - String domainElementGraphicalType = op.getSemanticHint(); - if (domainElementGraphicalType == null) { - domainElementGraphicalType = registry.getNodeGraphicalType(domainElement, containerGraphicalType); - } else { - domainElementGraphicalType = registry.getNodeGraphicalType(domainElementGraphicalType, containerGraphicalType); - } - - if ((!org.eclipse.papyrus.infra.gmfdiag.common.providers.IGraphicalTypeRegistry.UNDEFINED_TYPE.equals(domainElementGraphicalType)) && (registry.isKnownNodeType(domainElementGraphicalType))) { - return true; - } - } - return false; - } - - @Override - public Node createNode(IAdaptable semanticAdapter, View containerView, String semanticHint, int index, boolean persisted, PreferencesHint preferencesHint) { - - // Use the GraphicalTypeRegistry to find the expected type for a domain element - // Get the type of the container - String containerGraphicalType = containerView.getType(); - - // Get the type of the domain element - EObject domainElement = (EObject) semanticAdapter.getAdapter(EObject.class); - - if (semanticHint != null) { - // Look for a possible graphicalType replacement - String graphicalType = registry.getNodeGraphicalType(semanticHint, containerGraphicalType); - return super.createNode(new SemanticAdapter(domainElement, null), containerView, graphicalType, index, persisted, preferencesHint); - } - - String domainElementGraphicalType = registry.getNodeGraphicalType(domainElement, containerGraphicalType); - - // Create the expected node - if (!org.eclipse.papyrus.infra.gmfdiag.common.providers.IGraphicalTypeRegistry.UNDEFINED_TYPE.equals(domainElementGraphicalType)) { - return super.createNode(semanticAdapter, containerView, domainElementGraphicalType, index, persisted, preferencesHint); - } - - Activator.log.error(new Exception("Could not create Node.")); - return null; - } - - - @Override - protected void stampShortcut(View containerView, Node target) { - if (!ElementTypes.DIAGRAM_ID.equals(containerView.getDiagram().getType())) { - EAnnotation shortcutAnnotation = EcoreFactory.eINSTANCE.createEAnnotation(); - shortcutAnnotation.setSource("Shortcut"); //$NON-NLS-1$ - shortcutAnnotation.getDetails().put("modelID", ElementTypes.DIAGRAM_ID); //$NON-NLS-1$ - target.getEAnnotations().add(shortcutAnnotation); - } - } - -} diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/provider/ParametricDiagramEditPartProvider.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/provider/ParametricDiagramEditPartProvider.java deleted file mode 100644 index 3666d0c192f..00000000000 --- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/provider/ParametricDiagramEditPartProvider.java +++ /dev/null @@ -1,50 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Régis CHEVREL: chevrel.regis <at> gmail.com - * CEA LIST - Initial API and implementation - * - *****************************************************************************/ -package org.eclipse.papyrus.sysml.diagram.parametric.provider; - -import org.eclipse.gmf.runtime.common.core.service.IOperation; -import org.eclipse.gmf.runtime.diagram.ui.services.editpart.AbstractEditPartProvider; -import org.eclipse.gmf.runtime.diagram.ui.services.editpart.CreateGraphicEditPartOperation; -import org.eclipse.gmf.runtime.diagram.ui.services.editpart.IEditPartOperation; -import org.eclipse.gmf.runtime.notation.View; -import org.eclipse.papyrus.sysml.diagram.parametric.Activator; -import org.eclipse.papyrus.sysml.diagram.parametric.edit.part.ParametricDiagramEditPart; - -public class ParametricDiagramEditPartProvider extends AbstractEditPartProvider { - - @Override - public boolean provides(IOperation operation) { - if (operation instanceof CreateGraphicEditPartOperation) { - View view = ((IEditPartOperation) operation).getView(); - - // Ensure current diagram is Parametric Diagram - if (ElementTypes.DIAGRAM_ID.equals(view.getType())) { - return true; - } - } - - return false; - } - - @Override - protected Class<?> getDiagramEditPartClass(View view) { - if (ElementTypes.DIAGRAM_ID.equals(view.getType())) { - return ParametricDiagramEditPart.class; - } - - Activator.log.error(new Exception("Could not create EditPart.")); - return null; - } - -} diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/provider/ParametricDiagramEditPolicyProvider.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/provider/ParametricDiagramEditPolicyProvider.java deleted file mode 100644 index a483e666967..00000000000 --- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/provider/ParametricDiagramEditPolicyProvider.java +++ /dev/null @@ -1,63 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Régis CHEVREL: chevrel.regis <at> gmail.com - * CEA LIST - Initial API and implementation - * - *****************************************************************************/ -package org.eclipse.papyrus.sysml.diagram.parametric.provider; - -import org.eclipse.gef.EditPart; -import org.eclipse.gmf.runtime.common.core.service.AbstractProvider; -import org.eclipse.gmf.runtime.common.core.service.IOperation; -import org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart; -import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles; -import org.eclipse.gmf.runtime.diagram.ui.services.editpolicy.CreateEditPoliciesOperation; -import org.eclipse.gmf.runtime.diagram.ui.services.editpolicy.IEditPolicyProvider; -import org.eclipse.papyrus.sysml.diagram.internalblock.edit.policy.CustomDragDropEditPolicy; -import org.eclipse.papyrus.uml.diagram.common.edit.part.PortAffixedNodeEditPart; - -public class ParametricDiagramEditPolicyProvider extends AbstractProvider implements IEditPolicyProvider { - - public boolean provides(IOperation operation) { - - CreateEditPoliciesOperation epOperation = (CreateEditPoliciesOperation) operation; - if (!(epOperation.getEditPart() instanceof GraphicalEditPart)) { - return false; - } - GraphicalEditPart gep = (GraphicalEditPart) epOperation.getEditPart(); - String diagramType = gep.getNotationView().getDiagram().getType(); - if (!ElementTypes.DIAGRAM_ID.equals(diagramType)) { - return false; - } - - if (gep instanceof org.eclipse.papyrus.uml.diagram.composite.edit.parts.ConstraintEditPart) { - return true; - } - if (gep instanceof PortAffixedNodeEditPart) { - return true; - } - if (gep instanceof org.eclipse.papyrus.uml.diagram.composite.edit.parts.UseCaseEditPartCN) { - return true; - } - if (gep instanceof org.eclipse.papyrus.uml.diagram.composite.edit.parts.CommentEditPart) { - return true; - } - if (gep instanceof org.eclipse.papyrus.uml.diagram.composite.edit.parts.InteractionConstraintEditPartCN) { - return true; - } - - return false; - } - - public void createEditPolicies(EditPart editPart) { - editPart.installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new CustomDragDropEditPolicy()); - } - -} diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/provider/ParametricDiagramViewProvider.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/provider/ParametricDiagramViewProvider.java deleted file mode 100644 index bb6d60896be..00000000000 --- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/provider/ParametricDiagramViewProvider.java +++ /dev/null @@ -1,43 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Régis CHEVREL: chevrel.regis <at> gmail.com - * CEA LIST - Initial API and implementation - * - *****************************************************************************/ -package org.eclipse.papyrus.sysml.diagram.parametric.provider; - -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.gmf.runtime.diagram.core.providers.AbstractViewProvider; -import org.eclipse.gmf.runtime.diagram.core.services.view.CreateDiagramViewOperation; -import org.eclipse.papyrus.sysml.diagram.parametric.Activator; -import org.eclipse.papyrus.sysml.diagram.parametric.factory.ParametricDiagramViewFactory; - -public class ParametricDiagramViewProvider extends AbstractViewProvider { - - @Override - protected boolean provides(CreateDiagramViewOperation operation) { - - if (ElementTypes.DIAGRAM_ID.equals(operation.getSemanticHint())) { - return true; - } - - return false; - } - - @Override - protected Class<?> getDiagramViewClass(IAdaptable semanticAdapter, String diagramKind) { - if (ElementTypes.DIAGRAM_ID.equals(diagramKind)) { - return ParametricDiagramViewFactory.class; - } - - Activator.log.error(new Exception("Could not create View.")); - return null; - } -} diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/utils/ParametricDiagramGraphicalTypes.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/utils/ParametricDiagramGraphicalTypes.java deleted file mode 100644 index a49f14b0078..00000000000 --- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/utils/ParametricDiagramGraphicalTypes.java +++ /dev/null @@ -1,22 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Régis CHEVREL: chevrel.regis <at> gmail.com - * CEA LIST - Initial API and implementation - * - *****************************************************************************/ -package org.eclipse.papyrus.sysml.diagram.parametric.utils; - -public class ParametricDiagramGraphicalTypes { - - /** ********************************************************* */ - /** Diagram custom graphical types id *********************** */ - /** ********************************************************* */ - -} diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/Activator.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/Activator.java deleted file mode 100644 index 761cc1f12bc..00000000000 --- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/Activator.java +++ /dev/null @@ -1,107 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Régis CHEVREL: chevrel.regis <at> gmail.com - * CEA LIST - Initial API and implementation - * - *****************************************************************************/ -package org.eclipse.papyrus.sysml.diagram.parametric; - -import org.eclipse.gmf.runtime.diagram.core.preferences.PreferencesHint; -import org.eclipse.jface.preference.IPreferenceStore; -import org.eclipse.jface.resource.ImageDescriptor; -import org.eclipse.papyrus.infra.core.log.LogHelper; -import org.eclipse.papyrus.sysml.diagram.parametric.preferences.CustomPreferenceInitializer; -import org.eclipse.ui.plugin.AbstractUIPlugin; -import org.osgi.framework.BundleContext; - -/** The activator class controls the plug-in life cycle */ -public class Activator extends AbstractUIPlugin { - - /** The plug-in ID */ - public static final String PLUGIN_ID = "org.eclipse.papyrus.sysml.diagram.parametric"; - - /** The plug-in shared instance */ - private static Activator plugin; - - /** The logging helper */ - public static LogHelper log; - - /** The plug-in Preference store */ - public static final PreferencesHint DIAGRAM_PREFERENCES_HINT = new PreferencesHint(PLUGIN_ID); - - /** Default constructor */ - public Activator() { - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) - */ - @Override - public void start(BundleContext context) throws Exception { - super.start(context); - plugin = this; - - // register the login helper - log = new LogHelper(plugin); - - // register the preference store - PreferencesHint.registerPreferenceStore(DIAGRAM_PREFERENCES_HINT, getPreferenceStore()); - - // Preferences initialization - CustomPreferenceInitializer diagramPreferenceInitializer = new CustomPreferenceInitializer(); - diagramPreferenceInitializer.initializeDefaultPreferences(); - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext) - */ - @Override - public void stop(BundleContext context) throws Exception { - plugin = null; - super.stop(context); - } - - /** - * Returns the shared instance - * - * @return the shared instance - */ - public static Activator getInstance() { - return plugin; - } - - /** - * Returns an image descriptor for the image file at the given plug-in relative path. - * - * @generated - * @param path - * the path - * @return the image descriptor - */ - public static ImageDescriptor getBundledImageDescriptor(String path) { - return AbstractUIPlugin.imageDescriptorFromPlugin(PLUGIN_ID, path); - } - - /** - * - * @see org.eclipse.ui.plugin.AbstractUIPlugin#getPreferenceStore() - * - * @return Shared Preference Store. - */ - @Override - public IPreferenceStore getPreferenceStore() { - IPreferenceStore store = org.eclipse.papyrus.infra.gmfdiag.preferences.Activator.getDefault().getPreferenceStore(); - return store; - } -} diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/ParametricDiagramCondition.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/ParametricDiagramCondition.java deleted file mode 100644 index 7d051b7ea9c..00000000000 --- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/ParametricDiagramCondition.java +++ /dev/null @@ -1,32 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * chevrel.regis@gmail.com - * CEA LIST - Initial API and implementation - * Laurent Wouters (CEA LIST) laurent.wouters@cea.fr - Viewpoints application - * - *****************************************************************************/ -package org.eclipse.papyrus.sysml.diagram.parametric; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.papyrus.infra.ui.extension.commands.PerspectiveContextDependence; - -/** - * ParametricDiagramCondition to set conditions for the diagram creation - */ -public class ParametricDiagramCondition extends PerspectiveContextDependence { - - /** - * {@inheritDoc} - */ - @Override - public boolean create(EObject selectedElement) { - return false; - } -} diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/commands/CustomBindingConnectorCreateCommand.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/commands/CustomBindingConnectorCreateCommand.java deleted file mode 100644 index 80089b8bf55..00000000000 --- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/commands/CustomBindingConnectorCreateCommand.java +++ /dev/null @@ -1,155 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Régis CHEVREL: chevrel.regis <at> gmail.com - * CEA LIST - Initial API and implementation - * - *****************************************************************************/ -package org.eclipse.papyrus.sysml.diagram.parametric.commands; - -import java.util.List; - -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.emf.ecore.EObject; -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.EditElementCommand; -import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest; -import org.eclipse.papyrus.infra.services.edit.service.ElementEditServiceUtils; -import org.eclipse.papyrus.infra.services.edit.service.IElementEditService; -import org.eclipse.papyrus.sysml.blocks.Block; -import org.eclipse.papyrus.sysml.blocks.BlocksPackage; -import org.eclipse.papyrus.sysml.diagram.common.utils.ConstraintBlockHelper; -import org.eclipse.papyrus.uml.service.types.utils.ConnectorUtils; -import org.eclipse.papyrus.uml.service.types.utils.RequestParameterUtils; -import org.eclipse.uml2.uml.Connector; -import org.eclipse.uml2.uml.Element; -import org.eclipse.uml2.uml.Property; -import org.eclipse.uml2.uml.StructuredClassifier; -import org.eclipse.uml2.uml.Type; -import org.eclipse.uml2.uml.util.UMLUtil; -import org.eclipse.uml2.uml.util.UMLUtil.StereotypeApplicationHelper; - -/** - * - */ -public class CustomBindingConnectorCreateCommand extends EditElementCommand { - - private final EObject source; - private final EObject target; - - public CustomBindingConnectorCreateCommand(final CreateRelationshipRequest request) { - super(request.getLabel(), null, request); - this.source = request.getSource(); - this.target = request.getTarget(); - } - - /** - * A BindingConnector could be created in Parametric only if at least one end is a ConstraintParameter. - * Also check Block.isEncapsulated (could not cross a Block which is encapsulted) - * - * @return - */ - @Override - public boolean canExecute() { - if (this.source == null) { - return false; - } - if (this.target == null) { - return true; - } - if (this.source == this.target) { - return false; - } - if (this.source != null && this.target != null) { - - boolean hasEncapsulationViolation = !checkEncapsulationCrossing(); - - return hasEncapsulationViolation ? false : - // one of the end must be a ConstraintParameter - ConstraintBlockHelper.isConstraintParameter((Element) source, RequestParameterUtils.getSourceView(getRequest())) - || ConstraintBlockHelper.isConstraintParameter((Element) target, RequestParameterUtils.getTargetView(getRequest())); - } - return false; - } - - /** - * Check that BindingConnector do not cross a "Block.isEncapsulated" Part/Reference/ConstraintProperty - * - * @return true no encapsulation problem, false else - */ - private boolean checkEncapsulationCrossing() { - org.eclipse.papyrus.sysml.service.types.utils.ConnectorUtils util = new org.eclipse.papyrus.sysml.service.types.utils.ConnectorUtils(); - - // source end - get the nestedPath - List<Property> nestedPropertyPath = util.getNestedPropertyPath(RequestParameterUtils.getSourceView(getRequest()), RequestParameterUtils.getTargetView(getRequest())); - // check for each level of path if crossing an isEncapsultaed Block - for (Property property : nestedPropertyPath) { - Type type = property.getType(); - Block stereotypeApplication = UMLUtil.getStereotypeApplication(type, Block.class); - if (stereotypeApplication != null) { - if (stereotypeApplication.isEncapsulated()) { - return false; - } - } - } - - // target end - get the nestedPath - nestedPropertyPath = util.getNestedPropertyPath(RequestParameterUtils.getTargetView(getRequest()), RequestParameterUtils.getSourceView(getRequest())); - // check for each level of path if crossing an isEncapsultaed Block - for (Property property : nestedPropertyPath) { - Type type = property.getType(); - Block stereotypeApplication = UMLUtil.getStereotypeApplication(type, Block.class); - if (stereotypeApplication != null) { - if (stereotypeApplication.isEncapsulated()) { - return false; - } - } - } - return true; - } - - /** - * Create the connector, affect its owner, calculate nestedPath - * - * @param monitor - * @param info - * @return CommandResult contains the created Connector - */ - @Override - protected CommandResult doExecuteWithResult(final IProgressMonitor monitor, final IAdaptable info) throws ExecutionException { - - if (!canExecute()) { - throw new ExecutionException("Invalid arguments in create link command"); //$NON-NLS-1$ - } - - // Create the Connector and its ConnectorEnd. Correct container are set and paths are set in case of <<NestedConnectorEnd>>. - StructuredClassifier deducedContainer = new ConnectorUtils().deduceContainer(RequestParameterUtils.getSourceView(getRequest()), RequestParameterUtils.getTargetView(getRequest())); - ((CreateRelationshipRequest) getRequest()).setContainer(deducedContainer); - IElementEditService commandProvider = ElementEditServiceUtils.getCommandProvider(deducedContainer); - ICommand editCommand = commandProvider.getEditCommand(getRequest()); - - if (editCommand.canExecute()) { - editCommand.execute(monitor, info); - Object newObject = editCommand.getCommandResult().getReturnValue(); - - if (newObject instanceof Connector) { - Connector connector = (Connector) newObject; - // Apply the <<BindingConnector>> stereotype - StereotypeApplicationHelper.INSTANCE.applyStereotype(connector, BlocksPackage.eINSTANCE.getBindingConnector()); - } - - return CommandResult.newOKCommandResult(newObject); - } - return CommandResult.newErrorCommandResult("Invalid arguments in create link command"); - } - -} diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/commands/CustomBindingConnectorReorientCommand.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/commands/CustomBindingConnectorReorientCommand.java deleted file mode 100644 index 86c945d3427..00000000000 --- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/commands/CustomBindingConnectorReorientCommand.java +++ /dev/null @@ -1,265 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Régis CHEVREL: chevrel.regis <at> gmail.com - * CEA LIST - Initial API and implementation - * - *****************************************************************************/ -package org.eclipse.papyrus.sysml.diagram.parametric.commands; - -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; -import java.util.Set; - -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.util.EcoreUtil; -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.requests.DestroyElementRequest; -import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRequest; -import org.eclipse.gmf.runtime.notation.View; -import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.DefaultSemanticEditPolicy; -import org.eclipse.papyrus.infra.services.edit.service.ElementEditServiceUtils; -import org.eclipse.papyrus.infra.services.edit.service.IElementEditService; -import org.eclipse.papyrus.sysml.blocks.Block; -import org.eclipse.papyrus.sysml.blocks.BlocksPackage; -import org.eclipse.papyrus.sysml.blocks.NestedConnectorEnd; -import org.eclipse.papyrus.sysml.diagram.common.utils.ConstraintBlockHelper; -import org.eclipse.papyrus.sysml.service.types.utils.ConnectorUtils; -import org.eclipse.papyrus.uml.diagram.common.util.CrossReferencerUtil; -import org.eclipse.papyrus.uml.service.types.command.ConnectorReorientCommand; -import org.eclipse.uml2.uml.Connector; -import org.eclipse.uml2.uml.ConnectorEnd; -import org.eclipse.uml2.uml.Element; -import org.eclipse.uml2.uml.Property; -import org.eclipse.uml2.uml.StructuredClassifier; -import org.eclipse.uml2.uml.Type; -import org.eclipse.uml2.uml.util.UMLUtil; -import org.eclipse.uml2.uml.util.UMLUtil.StereotypeApplicationHelper; - -public class CustomBindingConnectorReorientCommand extends ConnectorReorientCommand { - - private final EObject source; - - private final EObject target; - - public CustomBindingConnectorReorientCommand(ReorientReferenceRelationshipRequestWithGraphical request) { - super(request); - source = reorientDirection == ReorientRequest.REORIENT_SOURCE ? request.getNewRelationshipEnd() : request.getReferenceOwner(); - target = reorientDirection == ReorientRequest.REORIENT_SOURCE ? request.getReferenceOwner() : request.getNewRelationshipEnd(); - } - - - /** - * A BindingConnector could be reoriented in Parametric only if at least one end is a ConstraintParameter. - * Also check Block.isEncapsulated (could not cross a Block which is encapsulted) - * - * @return - */ - @Override - public boolean canExecute() { - - if (this.source == this.target) { - return false; - } - - Object connectorView = getRequest().getParameter(DefaultSemanticEditPolicy.GRAPHICAL_RECONNECTED_EDGE); - if (connectorView instanceof org.eclipse.gmf.runtime.notation.Connector) { - View sourceView = getSourceView(); - View targetView = getTargetView(); - - if (this.source != null && this.target != null) { - boolean hasEncapsulationViolation = !checkEncapsulationCrossing(); - - return hasEncapsulationViolation ? false : - // one of the end must be a ConstraintParameter - ConstraintBlockHelper.isConstraintParameter((Element) source, sourceView) - || ConstraintBlockHelper.isConstraintParameter((Element) target, targetView); - } - } - return false; - } - - /** - * Check that BindingConnector do not cross a "Block.isEncapsulated" Part/Reference/ConstraintProperty - * - * @return true no encapsulation problem, false else - */ - private boolean checkEncapsulationCrossing() { - org.eclipse.papyrus.sysml.service.types.utils.ConnectorUtils util = new org.eclipse.papyrus.sysml.service.types.utils.ConnectorUtils(); - // source end - get the nestedPath - List<Property> nestedPropertyPath = util.getNestedPropertyPath(getSourceView(), getTargetView()); - // check for each level of path if crossing an isEncapsultaed Block - for (Property property : nestedPropertyPath) { - Type type = property.getType(); - Block stereotypeApplication = UMLUtil.getStereotypeApplication(type, Block.class); - if (stereotypeApplication != null) { - if (stereotypeApplication.isEncapsulated()) { - return false; - } - } - } - - // target end - get the nestedPath - nestedPropertyPath = util.getNestedPropertyPath(getTargetView(), getSourceView()); - // check for each level of path if crossing an isEncapsultaed Block - for (Property property : nestedPropertyPath) { - Type type = property.getType(); - Block stereotypeApplication = UMLUtil.getStereotypeApplication(type, Block.class); - if (stereotypeApplication != null) { - if (stereotypeApplication.isEncapsulated()) { - return false; - } - } - } - return true; - } - - @Override - /** - * Get the link to re-orient. - * - * @return the edited {@link Connector} - */ - protected Connector getLink() { - return (Connector) (getConnectorView()).getElement(); - } - - @Override - protected void replaceOwner(Connector connector, StructuredClassifier newOwner) { - - View sourceView = getSourceView(); - View targetView = getTargetView(); - - StructuredClassifier deducedContainer = new ConnectorUtils().deduceContainer(sourceView, targetView); - if (connector.getOwner() != deducedContainer) { - super.replaceOwner(connector, deducedContainer); - } - } - - private org.eclipse.gmf.runtime.notation.Connector getConnectorView() { - return (org.eclipse.gmf.runtime.notation.Connector) getRequest().getParameter(DefaultSemanticEditPolicy.GRAPHICAL_RECONNECTED_EDGE); - } - - private View getSourceView() { - return reorientDirection == ReorientRequest.REORIENT_SOURCE ? - (View) ((ReorientReferenceRelationshipRequestWithGraphical) getRequest()).getSourceEditPart().getModel() : - getConnectorView().getSource(); - } - - private View getTargetView() { - return reorientDirection == ReorientRequest.REORIENT_TARGET ? - (View) ((ReorientReferenceRelationshipRequestWithGraphical) getRequest()).getTargetEditPart().getModel() : - getConnectorView().getTarget(); - - } - - @Override - protected Property findNewOppositePartWithPort() { - // no Port allowed in Parametric - return null; - } - - @Override - protected Property findNewPartWithPort() { - // no Port allowed in Parametric - return null; - } - - /** - * Reorient connector - recalculate nestedPath - remove connector deprecated representations (all diagrams) - */ - @Override - protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException { - CommandResult result = super.doExecuteWithResult(monitor, info); - - // apply or update NestedConnectorEnd stereotype and its PropertyPath if needed - Connector connector = getLink(); - if (connector.getEnds().size() == 2) { - updateNestedPropertyPath(connector.getEnds().get(0), getSourceView(), getTargetView()); - updateNestedPropertyPath(connector.getEnds().get(1), getTargetView(), getSourceView()); - } - - Set<View> memberViewsToDestroy = getMemberViewsToDestroy(connector); - // Suppress Connector representation which are not coherant with the new ConnectorEnd - for (View view : memberViewsToDestroy) { - // exclude reoriented connector representation - if (view != getConnectorView()) { - // Check Connector View ends matches with semantic ConnectorEnds - View sourceNode = ((org.eclipse.gmf.runtime.notation.Connector) view).getSource(); - View targetNode = ((org.eclipse.gmf.runtime.notation.Connector) view).getTarget(); - - EObject sourceElement = sourceNode.getElement(); - EObject targetElement = targetNode.getElement(); - - EList<ConnectorEnd> ends = connector.getEnds(); - boolean isSameEnds = true; - for (ConnectorEnd connectorEnd : ends) { - if (connectorEnd.getRole() != sourceElement && connectorEnd.getRole() != targetElement) { - isSameEnds = false; - break; - } - } - - // if no matching between graphical and semantic, we destroy the representation - if (!isSameEnds) { - final DestroyElementRequest destroyRequest = new DestroyElementRequest(getRequest().getEditingDomain(), view, false); - final IElementEditService commandProvider = ElementEditServiceUtils.getCommandProvider(view); - ICommand editCommand = commandProvider.getEditCommand(destroyRequest); - editCommand.execute(monitor, info); - } - } - } - - return result; - } - - - protected Set<View> getMemberViewsToDestroy(final Connector connector) { - Set<View> viewsToDestroy = new HashSet<View>(); - - // Find Views in Composite Structure Diagram that are referencing current member - Iterator<View> viewIt = CrossReferencerUtil.getCrossReferencingViews(connector, null).iterator(); - while (viewIt.hasNext()) { - View view = viewIt.next(); - viewsToDestroy.add(view); - } - - return viewsToDestroy; - } - - private void updateNestedPropertyPath(ConnectorEnd connectorEnd, View sourceView, View targetView) { - ConnectorUtils utils = new ConnectorUtils(); - List<Property> nestedPropertyPath = utils.getNestedPropertyPath(sourceView, targetView); - if (!nestedPropertyPath.isEmpty()) { - // Search for existing stereotype application - NestedConnectorEnd nestedConnectorEnd = UMLUtil.getStereotypeApplication(connectorEnd, NestedConnectorEnd.class); - if (nestedConnectorEnd == null) { - // apply stereotype if no application found - nestedConnectorEnd = (NestedConnectorEnd) StereotypeApplicationHelper.INSTANCE.applyStereotype(connectorEnd, BlocksPackage.eINSTANCE.getNestedConnectorEnd()); - } - // set new path - nestedConnectorEnd.getPropertyPath().clear(); - nestedConnectorEnd.getPropertyPath().addAll(nestedPropertyPath); - } - else { - // remove all NestedConnectorEnd Stereotype applications - for (EObject stereotypeApplication : connectorEnd.getStereotypeApplications()) { - if (NestedConnectorEnd.class.isInstance(stereotypeApplication)) { - EcoreUtil.delete(stereotypeApplication, true); - } - } - } - } -} diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/commands/CustomParametricContextLinkCreateCommand.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/commands/CustomParametricContextLinkCreateCommand.java deleted file mode 100644 index 4ec0ac24a7c..00000000000 --- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/commands/CustomParametricContextLinkCreateCommand.java +++ /dev/null @@ -1,140 +0,0 @@ -/*****************************************************************************
- * Copyright (c) 2013 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Régis CHEVREL: chevrel.regis <at> gmail.com
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.parametric.commands;
-
-import java.util.Collection;
-import java.util.List;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature.Setting;
-import org.eclipse.gmf.runtime.common.core.command.CommandResult;
-import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
-import org.eclipse.gmf.runtime.notation.NotationPackage;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.uml.service.types.command.ConstraintConstrainedElementsCreateCommand;
-import org.eclipse.papyrus.uml.service.types.utils.NamedElementHelper;
-import org.eclipse.uml2.common.util.CacheAdapter;
-import org.eclipse.uml2.uml.Constraint;
-import org.eclipse.uml2.uml.Namespace;
-import org.eclipse.uml2.uml.Property;
-
-public class CustomParametricContextLinkCreateCommand extends
- ConstraintConstrainedElementsCreateCommand {
-
- public CustomParametricContextLinkCreateCommand(
- CreateRelationshipRequest request) {
- super(request);
- }
-
- /**
- * Can execute if :
- * - source is Constraint
- * - target is a Namespace or a Namespace typed property
- * - there is no context link already outgoing from the source Constraint
- */
- @Override
- public boolean canExecute() {
- if (source == null && target == null) {
- return false;
- }
- if (source != null && !(source instanceof Constraint)) {
- return false;
- }
- if (target != null && !(target instanceof Namespace)) {
- if (target instanceof Property) {
- if (!(((Property) target).getType() instanceof Namespace)) {
- // not a Part / Reference / ConstraintProperty => could not create context link
- return false;
- }
- }
- else {
- // not a Property, not a Namespace => could not create context link
- return false;
- }
- }
- if (getSource() == null) {
- return true; // link creation is in progress; source is not defined yet
- }
- View viewSource = findView(source);
-
- // Only one context link per Constraint
- if (viewSource != null && source instanceof Constraint) {
- List<?> sourceConnections = ViewUtil.getSourceConnections(viewSource);
- if (!sourceConnections.isEmpty()) {
- return false;
- }
- }
- return true;
- }
-
- /**
- * Set the Constraint context and update Constraint name with new owner ownedRules if necessary
- */
- @Override
- protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- if (!canExecute()) {
- throw new ExecutionException("Invalid arguments in create link command"); //$NON-NLS-1$
- }
- Namespace context = getTarget();
- if (getSource() != null && context != null) {
- getSource().setContext(context);
- String defaultNameWithIncrementFromBase = NamedElementHelper.getDefaultNameWithIncrementFromBase(Constraint.class.getSimpleName(), context.getOwnedRules(), getSource());
- getSource().setName(defaultNameWithIncrementFromBase);
- return CommandResult.newOKCommandResult();
- }
- else {
- return CommandResult.newErrorCommandResult("Try to define Constraint context to a non Namespace element");
- }
- }
-
- private View findView(EObject element) {
- if (element == null) {
- return null;
- }
- Collection<Setting> settings = CacheAdapter.getInstance().getNonNavigableInverseReferences(element);
- for (Setting ref : settings) {
- if (NotationPackage.eINSTANCE.getView_Element().equals(ref.getEStructuralFeature())) {
- View view = (View) ref.getEObject();
- if (view != null) {
- return view;
- }
- }
- }
- return null;
- }
-
- /**
- * Get the property Namespace in case of property typed by a Namespace
- */
- @Override
- protected Namespace getTarget() {
- EObject targetNamespace;
- if (target instanceof Property) {
- targetNamespace = ((Property) target).getType();
- }
- else {
- targetNamespace = target;
- }
- if (targetNamespace instanceof Namespace) {
- return (Namespace) targetNamespace;
- }
- else {
- return null;
- }
- }
-}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/commands/CustomParametricContextLinkReorientCommand.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/commands/CustomParametricContextLinkReorientCommand.java deleted file mode 100644 index 9be8d88e6c6..00000000000 --- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/commands/CustomParametricContextLinkReorientCommand.java +++ /dev/null @@ -1,159 +0,0 @@ -/*****************************************************************************
- * Copyright (c) 2013 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Régis CHEVREL: chevrel.regis <at> gmail.com
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.parametric.commands;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gmf.runtime.common.core.command.CommandResult;
-import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
-import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRequest;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.uml.service.types.utils.NamedElementHelper;
-import org.eclipse.uml2.uml.Constraint;
-import org.eclipse.uml2.uml.Element;
-import org.eclipse.uml2.uml.Namespace;
-import org.eclipse.uml2.uml.Property;
-import org.eclipse.uml2.uml.Type;
-
-/**
- * A context link must have a Constraint as source and a Namespace as target
- *
- * @See ContextLinkReorientCommand
- *
- */
-public class CustomParametricContextLinkReorientCommand extends EditElementCommand {
-
- private final int reorientDirection;
-
- protected ReorientReferenceRelationshipRequestWithGraphical request;
- protected EObject referenceOwner;
- protected EObject oldSource;
- protected EObject newSource;
- protected EObject oldTarget;
- protected EObject newTarget;
-
- public CustomParametricContextLinkReorientCommand(
- ReorientReferenceRelationshipRequestWithGraphical request) {
- super(request.getLabel(), null, request);
- this.request = request;
- reorientDirection = request.getDirection();
- referenceOwner = request.getReferenceOwner();
- oldSource = reorientDirection == ReorientRequest.REORIENT_SOURCE ? request.getOldRelationshipEnd() : request.getReferenceOwner();
- newSource = reorientDirection == ReorientRequest.REORIENT_SOURCE ? request.getNewRelationshipEnd() : request.getReferenceOwner();
- oldTarget = reorientDirection == ReorientRequest.REORIENT_SOURCE ? request.getReferenceOwner() : request.getOldRelationshipEnd();
- newTarget = reorientDirection == ReorientRequest.REORIENT_SOURCE ? request.getReferenceOwner() : request.getNewRelationshipEnd();
- }
-
- @Override
- public boolean canExecute() {
- return getNewSource() instanceof Constraint && resolveNamespace(getNewTarget()) instanceof Namespace;
- }
-
- /**
- * Get the property Namespace in case of property typed by a Namespace
- */
- protected Namespace resolveNamespace(Element element) {
- if (element instanceof Namespace) {
- return (Namespace) element;
- }
- if (element instanceof Property) {
- Type type = ((Property) element).getType();
- if (type instanceof Namespace) {
- return (Namespace) type;
- }
- }
- return null;
- }
-
- @Override
- protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- if (!canExecute()) {
- throw new ExecutionException("Invalid arguments in reorient link command"); //$NON-NLS-1$
- }
- if (reorientDirection == ReorientRequest.REORIENT_SOURCE) {
- return reorientSource();
- }
- if (reorientDirection == ReorientRequest.REORIENT_TARGET) {
- return reorientTarget();
- }
- throw new IllegalStateException();
- }
-
- /**
- * Set a default container for old Constraint (diagram consistency).
- * Set the new context for new Constraint
- * Update new Constraint name with new owner ownedRules if necessary
- */
- protected CommandResult reorientSource() {
- EditPart sourceEditPart = request.getSourceEditPart();
- Namespace nearestNamespace = getNearestNamespace(sourceEditPart);
- getOldSource().setContext(nearestNamespace); // set a default container
- Namespace context = resolveNamespace(getNewTarget());
- // Check name
- String defaultNameWithIncrementFromBase = NamedElementHelper.getDefaultNameWithIncrementFromBase(Constraint.class.getSimpleName(), context.getOwnedRules(), getNewSource());
- ((Constraint) getNewSource()).setName(defaultNameWithIncrementFromBase);
- // set the context
- ((Constraint) getNewSource()).setContext(resolveNamespace(getNewTarget()));
-
- return CommandResult.newOKCommandResult(referenceOwner);
- }
-
- private Namespace getNearestNamespace(EditPart editPart) {
- if (editPart != null) {
- EObject semanticElement = ViewUtil.resolveSemanticElement((View) editPart.getModel());
- if (semanticElement != null) {
- Namespace resolvedNamespace = resolveNamespace((Element) semanticElement);
- if (resolvedNamespace instanceof Namespace) {
- return resolvedNamespace;
- }
- return getNearestNamespace(editPart.getParent());
- }
- }
- return null;
- }
-
- /**
- * Set the new context for new Constraint
- * Update new Constraint name with new owner ownedRules if necessary
- */
- protected CommandResult reorientTarget() {
- Namespace context = resolveNamespace(getNewTarget());
- // Check name
- String defaultNameWithIncrementFromBase = NamedElementHelper.getDefaultNameWithIncrementFromBase(Constraint.class.getSimpleName(), context.getOwnedRules(), getNewSource());
- ((Constraint) getNewSource()).setName(defaultNameWithIncrementFromBase);
- // Set the context
- ((Constraint) getNewSource()).setContext(context);
- return CommandResult.newOKCommandResult(referenceOwner);
- }
-
- protected Constraint getOldSource() {
- return (Constraint) oldSource;
- }
-
- protected Element getNewSource() {
- return (Element) newSource;
- }
-
- protected Element getOldTarget() {
- return (Element) oldTarget;
- }
-
- protected Element getNewTarget() {
- return (Element) newTarget;
- }
-}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/commands/ReorientReferenceRelationshipRequestWithGraphical.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/commands/ReorientReferenceRelationshipRequestWithGraphical.java deleted file mode 100644 index 5bad23d08ad..00000000000 --- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/commands/ReorientReferenceRelationshipRequestWithGraphical.java +++ /dev/null @@ -1,51 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Régis CHEVREL: chevrel.regis <at> gmail.com - * CEA LIST - Initial API and implementation - * - *****************************************************************************/ -package org.eclipse.papyrus.sysml.diagram.parametric.commands; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.transaction.TransactionalEditingDomain; -import org.eclipse.gef.EditPart; -import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientReferenceRelationshipRequest; - -/** - * This class extends "classical" ReorientReferenceRelationshipRequest with the source and the target editPart. - * These EditPart are needed for algorithms based on graphics: - * - determine if a property is a ConstraintParameter - * - calculate nestedPath - */ -public class ReorientReferenceRelationshipRequestWithGraphical extends - ReorientReferenceRelationshipRequest { - - private EditPart sourceEditPart; - private EditPart targetEditPart; - - public ReorientReferenceRelationshipRequestWithGraphical( - TransactionalEditingDomain editingDomain, EObject referenceOwner, - EObject newRelationshipEnd, EObject oldRelationshipEnd, - int direction, EditPart sourceEditPart, EditPart targetEditPart) { - super(editingDomain, referenceOwner, newRelationshipEnd, oldRelationshipEnd, direction); - this.sourceEditPart = sourceEditPart; - this.targetEditPart = targetEditPart; - } - - - public EditPart getSourceEditPart() { - return sourceEditPart; - } - - public EditPart getTargetEditPart() { - return targetEditPart; - } - -} diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/commands/switchrepresentation/ShowHideConstraintExpressionCommand.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/commands/switchrepresentation/ShowHideConstraintExpressionCommand.java deleted file mode 100644 index 87ff2fdcde7..00000000000 --- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/commands/switchrepresentation/ShowHideConstraintExpressionCommand.java +++ /dev/null @@ -1,72 +0,0 @@ -/*****************************************************************************
- * Copyright (c) 2013 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Régis CHEVREL: chevrel.regis <at> gmail.com
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.parametric.commands.switchrepresentation;
-
-import org.eclipse.gef.GraphicalEditPart;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.sysml.diagram.parametric.edit.part.CustomConstraintBlockPropertyCompositeEditPart;
-import org.eclipse.papyrus.uml.diagram.common.edit.part.ConstraintNodeLabelEditPart;
-
-/**
- * This command allow to show/hide the Constraint expression of a ConstraintProperty
- */
-public class ShowHideConstraintExpressionCommand extends Command {
-
- private final GraphicalEditPart editPartToSwitch;
-
- public GraphicalEditPart getEditPartToSwitch() {
- return editPartToSwitch;
- }
-
- public ShowHideConstraintExpressionCommand(final GraphicalEditPart editPartToRefresh) {
- this.editPartToSwitch = editPartToRefresh;
- }
-
- @Override
- public void execute() {
- if (this.getEditPartToSwitch() instanceof CustomConstraintBlockPropertyCompositeEditPart) {
- CustomConstraintBlockPropertyCompositeEditPart constraintBlockPropertyCompositeEditPart = (CustomConstraintBlockPropertyCompositeEditPart) this.getEditPartToSwitch();
- // get the Constraint expression graphical label
- WrappingLabel constraintLabel = constraintBlockPropertyCompositeEditPart.getPrimaryShape().getConstraintLabel();
- ConstraintNodeLabelEditPart constraintNodeLabelEditPart = null;
- // get the EditPart which contains this label
- for (Object currentEditPart : constraintBlockPropertyCompositeEditPart.getChildren()) {
- if (currentEditPart instanceof ConstraintNodeLabelEditPart) {
- if (((ConstraintNodeLabelEditPart) currentEditPart).getFigure() == constraintLabel) {
- constraintNodeLabelEditPart = (ConstraintNodeLabelEditPart) currentEditPart;
- }
- }
- }
-
- // switch visibility of this EditPart
- if (constraintNodeLabelEditPart != null) {
- View constraintLabelView = (View) constraintNodeLabelEditPart.getModel();
- constraintLabelView.setVisible(!constraintLabelView.isVisible());
- }
- }
- }
-
- @Override
- public void undo() {
- execute(); // switch
- }
-
- @Override
- public void redo() {
- execute(); // switch
- }
-
-}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/commands/switchrepresentation/ShowHideConstraintExpressionCommandHandler.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/commands/switchrepresentation/ShowHideConstraintExpressionCommandHandler.java deleted file mode 100644 index 1bf8802b52a..00000000000 --- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/commands/switchrepresentation/ShowHideConstraintExpressionCommandHandler.java +++ /dev/null @@ -1,37 +0,0 @@ -/*****************************************************************************
- * Copyright (c) 2013 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Régis CHEVREL: chevrel.regis <at> gmail.com
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.parametric.commands.switchrepresentation;
-
-import java.util.List;
-
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.commands.CompoundCommand;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.papyrus.sysml.diagram.parametric.edit.part.CustomConstraintBlockPropertyCompositeEditPart;
-import org.eclipse.papyrus.uml.diagram.common.handlers.GraphicalCommandHandler;
-
-public class ShowHideConstraintExpressionCommandHandler extends GraphicalCommandHandler {
-
- @Override
- protected Command getCommand() {
- CompoundCommand command = new CompoundCommand("Show/Hide ConstraintProperty Constraint Expression");
- final List<IGraphicalEditPart> selectedElements = getSelectedElements();
- for (final IGraphicalEditPart selectedElement : selectedElements) {
- if (selectedElement instanceof CustomConstraintBlockPropertyCompositeEditPart) {
- command.add(new ShowHideConstraintExpressionCommand(selectedElement));
- }
- }
- return command;
- }
-}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/commands/switchrepresentation/SwitchConstraintPropertyRepresentationCommand.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/commands/switchrepresentation/SwitchConstraintPropertyRepresentationCommand.java deleted file mode 100644 index 3eb6b985581..00000000000 --- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/commands/switchrepresentation/SwitchConstraintPropertyRepresentationCommand.java +++ /dev/null @@ -1,138 +0,0 @@ -/*****************************************************************************
- * Copyright (c) 2013 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Régis CHEVREL: chevrel.regis <at> gmail.com
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.parametric.commands.switchrepresentation;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.gef.GraphicalEditPart;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gmf.runtime.diagram.core.preferences.PreferencesHint;
-import org.eclipse.gmf.runtime.diagram.core.services.ViewService;
-import org.eclipse.gmf.runtime.notation.NotationFactory;
-import org.eclipse.gmf.runtime.notation.NotationPackage;
-import org.eclipse.gmf.runtime.notation.StringValueStyle;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.sysml.diagram.common.edit.part.ConstraintBlockPropertyCompositeEditPart;
-import org.eclipse.papyrus.sysml.diagram.common.figure.ConstraintBlockPropertyCompositeFigure;
-import org.eclipse.papyrus.sysml.diagram.common.utils.SysMLGraphicalTypes;
-import org.eclipse.papyrus.sysml.diagram.parametric.edit.part.CustomConstraintBlockPropertyCompositeEditPart;
-
-/**
- * This command allow to switch ConstraintProperty representation to rounded corner one to square one with structure compartment
- */
-public class SwitchConstraintPropertyRepresentationCommand extends Command {
-
- private final GraphicalEditPart editPartToSwitch;
-
- public SwitchConstraintPropertyRepresentationCommand(final GraphicalEditPart editPartToRefresh) {
- this.editPartToSwitch = editPartToRefresh;
- }
-
- public GraphicalEditPart getEditPartToSwitch() {
- return this.editPartToSwitch;
- }
-
-
- @Override
- public void execute() {
- if (this.getEditPartToSwitch() instanceof CustomConstraintBlockPropertyCompositeEditPart) {
- CustomConstraintBlockPropertyCompositeEditPart constraintBlockPropertyCompositeEditPart = (CustomConstraintBlockPropertyCompositeEditPart) this.getEditPartToSwitch();
- ConstraintBlockPropertyCompositeFigure figure = constraintBlockPropertyCompositeEditPart.getPrimaryShape();
- if (figure instanceof ConstraintBlockPropertyCompositeFigure) {
- if (figure.getCorner() != 0) {
- switchToSquareRepresentationWithStructure(constraintBlockPropertyCompositeEditPart, figure);
- }
- else {
- switchToRoundedRepresentationWithoutStructure(constraintBlockPropertyCompositeEditPart, figure);
- }
- }
- }
- }
-
- @SuppressWarnings("unchecked")
- private void switchToSquareRepresentationWithStructure(CustomConstraintBlockPropertyCompositeEditPart editPart, IFigure figure) {
-
- // Set corner as square
- int newCorner = 0;
- ((ConstraintBlockPropertyCompositeFigure) figure).setCorner(newCorner);
-
- // add structure compartment (create if does not exist, set visible if exist)
- View structureCompartment = editPart.getChildViewBySemanticHint(SysMLGraphicalTypes.COMPARTMENT_SYSML_BLOCKPROPERTY_STRUCTURE_ID);
- if (structureCompartment != null) {
- structureCompartment.setVisible(true);
- }
- else {
- structureCompartment = ViewService.createNode((View) editPart.getModel(), SysMLGraphicalTypes.COMPARTMENT_SYSML_BLOCKPROPERTY_STRUCTURE_ID, new PreferencesHint("org.eclipse.papyrus.sysml.diagram.parametric"));
- if (structureCompartment != null) {
- structureCompartment.setElement(editPart.resolveSemanticElement());
- }
- }
-
- // add the << constraint >> tag
- editPart.getPrimaryShape().setTagLabel(String.valueOf("\u00AB") + "constraint" + String.valueOf("\u00BB"));
-
- // set the style to persist representation
- StringValueStyle style = (StringValueStyle) ((View) editPart.getModel()).getStyle(NotationPackage.eINSTANCE.getStringValueStyle());
- if (style == null) {
- ((View) editPart.getModel()).getStyles().add(NotationFactory.eINSTANCE.createStringValueStyle());
- }
- style = (StringValueStyle) ((View) editPart.getModel()).getStyle(NotationPackage.eINSTANCE.getStringValueStyle());
- style.setName(ConstraintBlockPropertyCompositeEditPart.REPRESENTATION_MODE_STYLE);
- style.setStringValue(ConstraintBlockPropertyCompositeEditPart.SQUARE_REPRESENTATION_WITH_STRUCTURE);
-
- // set the default style for new elements
- ConstraintBlockPropertyCompositeEditPart.setLastRepresentation(ConstraintBlockPropertyCompositeEditPart.SQUARE_REPRESENTATION_WITH_STRUCTURE);
- editPart.setCornerLocators(newCorner);
- }
-
- @SuppressWarnings("unchecked")
- private void switchToRoundedRepresentationWithoutStructure(CustomConstraintBlockPropertyCompositeEditPart editPart, IFigure figure) {
- // rounded corner
- int newCorner = 50;
- ((ConstraintBlockPropertyCompositeFigure) figure).setCorner(newCorner);
-
-
- // hide structure compartment if exist
- View structureCompartmentFigure = editPart.getChildViewBySemanticHint(SysMLGraphicalTypes.COMPARTMENT_SYSML_BLOCKPROPERTY_STRUCTURE_ID);
- if (structureCompartmentFigure != null) {
- structureCompartmentFigure.setVisible(false);
- }
-
- // remove the << constraint >> tag
- editPart.getPrimaryShape().setTagLabel("");
-
- // set the style to persist representation
- StringValueStyle style = (StringValueStyle) ((View) editPart.getModel()).getStyle(NotationPackage.eINSTANCE.getStringValueStyle());
- if (style == null) {
- ((View) editPart.getModel()).getStyles().add(NotationFactory.eINSTANCE.createStringValueStyle());
- }
- style = (StringValueStyle) ((View) editPart.getModel()).getStyle(NotationPackage.eINSTANCE.getStringValueStyle());
- style.setName(ConstraintBlockPropertyCompositeEditPart.REPRESENTATION_MODE_STYLE);
- style.setStringValue(ConstraintBlockPropertyCompositeEditPart.ROUNDED_REPRESENTATION);
-
- // set the default style for new elements
- ConstraintBlockPropertyCompositeEditPart.setLastRepresentation(ConstraintBlockPropertyCompositeEditPart.ROUNDED_REPRESENTATION);
- editPart.setCornerLocators(newCorner);
- }
-
- @Override
- public void undo() {
- execute(); // switch
- }
-
- @Override
- public void redo() {
- execute(); // switch
- }
-
-}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/commands/switchrepresentation/SwitchConstraintPropertyRepresentationCommandHandler.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/commands/switchrepresentation/SwitchConstraintPropertyRepresentationCommandHandler.java deleted file mode 100644 index 68f12cea669..00000000000 --- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/commands/switchrepresentation/SwitchConstraintPropertyRepresentationCommandHandler.java +++ /dev/null @@ -1,42 +0,0 @@ -/*****************************************************************************
- * Copyright (c) 2013 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Régis CHEVREL: chevrel.regis <at> gmail.com
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.parametric.commands.switchrepresentation;
-
-import java.util.List;
-
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.commands.CompoundCommand;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.papyrus.sysml.diagram.parametric.edit.part.CustomConstraintBlockPropertyCompositeEditPart;
-import org.eclipse.papyrus.uml.diagram.common.handlers.GraphicalCommandHandler;
-
-public class SwitchConstraintPropertyRepresentationCommandHandler extends GraphicalCommandHandler {
-
- @Override
- protected Command getCommand() {
- CompoundCommand command = new CompoundCommand("Switch ConstraintProperty Representation");
- final List<IGraphicalEditPart> selectedElements = getSelectedElements();
- for (final IGraphicalEditPart selectedElement : selectedElements) {
- if (selectedElement instanceof CustomConstraintBlockPropertyCompositeEditPart) {
- if (selectedElement.getParent() instanceof GraphicalEditPart) {
- command.add(new SwitchConstraintPropertyRepresentationCommand(selectedElement));
- }
- }
- }
- return command;
- }
-
-
-}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/part/CustomBlockCompositeEditPartTN.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/part/CustomBlockCompositeEditPartTN.java deleted file mode 100644 index 05e26dcca13..00000000000 --- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/part/CustomBlockCompositeEditPartTN.java +++ /dev/null @@ -1,153 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Régis CHEVREL: chevrel.regis <at> gmail.com - * CEA LIST - Initial API and implementation - * - *****************************************************************************/ -package org.eclipse.papyrus.sysml.diagram.parametric.edit.part; - -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.draw2d.IFigure; -import org.eclipse.draw2d.PositionConstants; -import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.gef.EditPart; -import org.eclipse.gef.editpolicies.LayoutEditPolicy; -import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart; -import org.eclipse.gmf.runtime.diagram.ui.figures.IBorderItemLocator; -import org.eclipse.gmf.runtime.notation.View; -import org.eclipse.papyrus.sysml.blocks.Block; -import org.eclipse.papyrus.sysml.constraints.ConstraintBlock; -import org.eclipse.papyrus.sysml.diagram.common.edit.part.BlockLabelNameEditPart; -import org.eclipse.papyrus.sysml.diagram.common.edit.part.StructureCompartmentEditPart; -import org.eclipse.papyrus.sysml.diagram.parametric.figures.ParametricDiagramFrameFigure; -import org.eclipse.papyrus.uml.diagram.common.edit.part.AbstractElementEditPart; -import org.eclipse.papyrus.uml.diagram.common.edit.part.ConstraintParameterAffixedNodeEditPart; -import org.eclipse.papyrus.uml.diagram.common.editpolicies.AffixedNodeAlignmentEditPolicy; -import org.eclipse.papyrus.uml.diagram.common.editpolicies.ShowHideRelatedContentsEditPolicy; -import org.eclipse.papyrus.uml.diagram.common.locator.FullInsidePortPositionLocator; -import org.eclipse.uml2.uml.Element; -import org.eclipse.uml2.uml.util.UMLUtil; - - -public class CustomBlockCompositeEditPartTN extends AbstractElementEditPart { - - public CustomBlockCompositeEditPartTN(View view) { - super(view); - } - - @Override - protected void createDefaultEditPolicies() { - installEditPolicy(ShowHideRelatedContentsEditPolicy.SHOW_HIDE_RELATED_CONTENTS_POLICY, new ShowHideRelatedContentsEditPolicy()); - installEditPolicy(AffixedNodeAlignmentEditPolicy.AFFIXED_CHILD_ALIGNMENT_ROLE, new AffixedNodeAlignmentEditPolicy()); - super.createDefaultEditPolicies(); - } - - @Override - protected IFigure createNodeShape() { - return this.primaryShape = new ParametricDiagramFrameFigure(); - } - - @Override - public ParametricDiagramFrameFigure getPrimaryShape() { - return (ParametricDiagramFrameFigure) primaryShape; - } - - @Override - protected boolean addFixedChild(EditPart childEditPart) { - if (childEditPart instanceof BlockLabelNameEditPart) { - ((BlockLabelNameEditPart) childEditPart).setLabel(getPrimaryShape().getNameLabel()); - return true; - } - if (childEditPart instanceof StructureCompartmentEditPart) { - IFigure pane = getPrimaryShape(); - setupContentPane(pane); - pane.add(((StructureCompartmentEditPart) childEditPart).getFigure()); - return true; - } - if (childEditPart instanceof ConstraintParameterAffixedNodeEditPart) { - IBorderItemLocator locator = new FullInsidePortPositionLocator(getMainFigure(), PositionConstants.NONE); - getBorderedFigure().getBorderItemContainer().add(((ConstraintParameterAffixedNodeEditPart) childEditPart).getFigure(), locator); - return true; - } - return false; - } - - @Override - protected boolean removeFixedChild(EditPart childEditPart) { - if (childEditPart instanceof BlockLabelNameEditPart) { - return true; - } - if (childEditPart instanceof StructureCompartmentEditPart) { - IFigure pane = getPrimaryShape(); - setupContentPane(pane); - pane.remove(((StructureCompartmentEditPart) childEditPart).getFigure()); - return true; - } - if (childEditPart instanceof ConstraintParameterAffixedNodeEditPart) { - getBorderedFigure().getBorderItemContainer().remove(((ConstraintParameterAffixedNodeEditPart) childEditPart).getFigure()); - return true; - } - return false; - } - - @Override - protected IFigure getContentPaneFor(IGraphicalEditPart editPart) { - return getContentPane(); - } - - @Override - public EditPart getPrimaryChildEditPart() { - return null; - } - - @Override - protected LayoutEditPolicy createLayoutEditPolicy() { - return null; - } - - - @Override - protected void refreshVisuals() { - refreshStereotypes(); - super.refreshVisuals(); - } - - protected void refreshStereotypes() { - Element resolveSemanticElement = (Element) this.resolveSemanticElement(); - EList<EObject> stereotypeApplications = resolveSemanticElement.getStereotypeApplications(); - List<EObject> additionnalStereotypeApplications = new ArrayList<EObject>(); - for (EObject currentStereotypeApplication : stereotypeApplications) { - if (!(currentStereotypeApplication instanceof Block) && !(currentStereotypeApplication instanceof ConstraintBlock)) { - additionnalStereotypeApplications.add(currentStereotypeApplication); - } - } - StringBuilder stereotypeLabel = new StringBuilder(); - String separator = ", "; - for (EObject eObject : additionnalStereotypeApplications) { - if (eObject != additionnalStereotypeApplications.get(0)) { - stereotypeLabel.append(separator); - } - stereotypeLabel.append(firstLetterToLowerCase(UMLUtil.getStereotype(eObject).getName())); - } - getPrimaryShape().setStereotypeLabel(stereotypeLabel.toString()); - } - - private String firstLetterToLowerCase(String string) { - String result = ""; - if (string != null && string.length() != 0) { - String lowerCaseFirstLetter = string.substring(0, 1).toLowerCase(); - result = lowerCaseFirstLetter + string.substring(1); - } - return result; - } -} diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/part/CustomBlockLabelNameEditPart.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/part/CustomBlockLabelNameEditPart.java deleted file mode 100644 index f53b3b6be81..00000000000 --- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/part/CustomBlockLabelNameEditPart.java +++ /dev/null @@ -1,35 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * R�gis CHEVREL: chevrel.regis <at> gmail.com - * CEA LIST - Initial API and implementation - * Nicolas FAUVERGUE (ALL4TEC) nicolas.fauvergue@all4tec.net - Bug 496905 - * - *****************************************************************************/ -package org.eclipse.papyrus.sysml.diagram.parametric.edit.part; - -import org.eclipse.gmf.runtime.notation.View; -import org.eclipse.papyrus.infra.internationalization.utils.utils.LabelInternationalization; -import org.eclipse.papyrus.sysml.diagram.common.edit.part.BlockLabelNameEditPart; - -public class CustomBlockLabelNameEditPart extends BlockLabelNameEditPart { - - public CustomBlockLabelNameEditPart(View view) { - super(view); - } - - /** - * Respect the SysML diagram frame "par [Block] Block1 [DiagramName]" - */ - @Override - protected String getLabelText() { - String diagramName = LabelInternationalization.getInstance().getDiagramLabel(getDiagramView()); - return super.getLabelText() + " [" + diagramName + "]"; - } -} diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/part/CustomBlockPropertyCompositeEditPart.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/part/CustomBlockPropertyCompositeEditPart.java deleted file mode 100644 index fcb15dc092d..00000000000 --- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/part/CustomBlockPropertyCompositeEditPart.java +++ /dev/null @@ -1,33 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Régis CHEVREL: chevrel.regis <at> gmail.com - * CEA LIST - Initial API and implementation - * - *****************************************************************************/ -package org.eclipse.papyrus.sysml.diagram.parametric.edit.part; - -import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles; -import org.eclipse.gmf.runtime.notation.View; -import org.eclipse.papyrus.sysml.diagram.common.edit.part.BlockPropertyCompositeEditPart; -import org.eclipse.papyrus.sysml.diagram.parametric.policies.CustomParametricSemanticPolicy; - -public class CustomBlockPropertyCompositeEditPart extends - BlockPropertyCompositeEditPart { - - public CustomBlockPropertyCompositeEditPart(View view) { - super(view); - } - - @Override - protected void createDefaultEditPolicies() { - super.createDefaultEditPolicies(); - installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new CustomParametricSemanticPolicy()); - } -} diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/part/CustomConstraintBlockPropertyCompositeEditPart.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/part/CustomConstraintBlockPropertyCompositeEditPart.java deleted file mode 100644 index e3da15a19a4..00000000000 --- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/part/CustomConstraintBlockPropertyCompositeEditPart.java +++ /dev/null @@ -1,34 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Régis CHEVREL: chevrel.regis <at> gmail.com - * CEA LIST - Initial API and implementation - * - *****************************************************************************/ -package org.eclipse.papyrus.sysml.diagram.parametric.edit.part; - -import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles; -import org.eclipse.gmf.runtime.notation.View; -import org.eclipse.papyrus.sysml.diagram.common.edit.part.ConstraintBlockPropertyCompositeEditPart; -import org.eclipse.papyrus.sysml.diagram.parametric.policies.CustomParametricSemanticPolicy; - -public class CustomConstraintBlockPropertyCompositeEditPart extends - ConstraintBlockPropertyCompositeEditPart { - - public CustomConstraintBlockPropertyCompositeEditPart(View view) { - super(view); - } - - @Override - protected void createDefaultEditPolicies() { - super.createDefaultEditPolicies(); - installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new CustomParametricSemanticPolicy()); - } - -} diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/part/CustomConstraintParameterAffixedNodeEditPart.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/part/CustomConstraintParameterAffixedNodeEditPart.java deleted file mode 100644 index 51b0360b413..00000000000 --- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/part/CustomConstraintParameterAffixedNodeEditPart.java +++ /dev/null @@ -1,32 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Régis CHEVREL: chevrel.regis <at> gmail.com - * CEA LIST - Initial API and implementation - * - *****************************************************************************/ -package org.eclipse.papyrus.sysml.diagram.parametric.edit.part; - -import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles; -import org.eclipse.gmf.runtime.notation.View; -import org.eclipse.papyrus.sysml.diagram.parametric.policies.CustomParametricSemanticPolicy; -import org.eclipse.papyrus.uml.diagram.common.edit.part.ConstraintParameterAffixedNodeEditPart; - -public class CustomConstraintParameterAffixedNodeEditPart extends ConstraintParameterAffixedNodeEditPart { - - public CustomConstraintParameterAffixedNodeEditPart(View view) { - super(view); - } - - @Override - protected void createDefaultEditPolicies() { - super.createDefaultEditPolicies(); - installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new CustomParametricSemanticPolicy()); - } -} diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/part/CustomPortAffixedNodeEditPart.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/part/CustomPortAffixedNodeEditPart.java deleted file mode 100644 index 76155592691..00000000000 --- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/part/CustomPortAffixedNodeEditPart.java +++ /dev/null @@ -1,33 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Régis CHEVREL: chevrel.regis <at> gmail.com - * CEA LIST - Initial API and implementation - * - *****************************************************************************/ -package org.eclipse.papyrus.sysml.diagram.parametric.edit.part; - -import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles; -import org.eclipse.gmf.runtime.notation.View; -import org.eclipse.papyrus.sysml.diagram.parametric.policies.CustomParametricSemanticPolicy; -import org.eclipse.papyrus.uml.diagram.common.edit.part.PortAffixedNodeEditPart; - -public class CustomPortAffixedNodeEditPart extends PortAffixedNodeEditPart { - - public CustomPortAffixedNodeEditPart(View view) { - super(view); - } - - @Override - protected void createDefaultEditPolicies() { - super.createDefaultEditPolicies(); - installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new CustomParametricSemanticPolicy()); - } - -} diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/figures/CustomBlockPropertyCompositeFigure.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/figures/CustomBlockPropertyCompositeFigure.java deleted file mode 100644 index 40d68f20e0b..00000000000 --- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/figures/CustomBlockPropertyCompositeFigure.java +++ /dev/null @@ -1,38 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * R�gis CHEVREL: chevrel.regis <at> gmail.com - * CEA LIST - Initial API and implementation - * - *****************************************************************************/ -package org.eclipse.papyrus.sysml.diagram.parametric.figures; - -import org.eclipse.draw2d.Label; -import org.eclipse.papyrus.sysml.diagram.common.figure.BlockPropertyCompositeFigure; -import org.eclipse.papyrus.infra.gmfdiag.common.figure.node.PapyrusWrappingLabel; - -public class CustomBlockPropertyCompositeFigure extends - BlockPropertyCompositeFigure { - - @Override - protected void initTagLabel(String value) { - // do nothing: we don't want a two lines element (tag + name) - } - - @Override - public PapyrusWrappingLabel getTaggedLabel() { - // return a mock Label - return new PapyrusWrappingLabel(); - } - - @Override - public void setNameLabelIcon(boolean displayNameLabelIcon) { - getNameLabel().setIcon(null); - } -} diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/figures/ParametricDiagramFrameFigure.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/figures/ParametricDiagramFrameFigure.java deleted file mode 100644 index b3ac246b4b3..00000000000 --- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/figures/ParametricDiagramFrameFigure.java +++ /dev/null @@ -1,20 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Régis CHEVREL: chevrel.regis <at> gmail.com - * CEA LIST - Initial API and implementation - * - *****************************************************************************/ -package org.eclipse.papyrus.sysml.diagram.parametric.figures; - -import org.eclipse.papyrus.sysml.diagram.common.figure.SysMLDiagramFrameFigure; - -public class ParametricDiagramFrameFigure extends SysMLDiagramFrameFigure { - -} diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/handler/ShowHideRelatedContentsAction.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/handler/ShowHideRelatedContentsAction.java deleted file mode 100644 index 605e687ac70..00000000000 --- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/handler/ShowHideRelatedContentsAction.java +++ /dev/null @@ -1,120 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Régis CHEVREL: chevrel.regis <at> gmail.com - * CEA LIST - Initial API and implementation - * - *****************************************************************************/ -package org.eclipse.papyrus.sysml.diagram.parametric.handler; - -import java.util.ArrayList; -import java.util.HashSet; -import java.util.List; -import java.util.Set; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.papyrus.sysml.diagram.common.utils.ConstraintBlockHelper; - -/** - * This class allow to take into account the ConstraintParameter which are AffixedNode, not a "classical" property (Part/Reference/ConstraintProperty in structure). - * Also filter non allowed elements from AffixedNode (Port). - */ -public class ShowHideRelatedContentsAction extends org.eclipse.papyrus.sysml.diagram.internalblock.handler.ShowHideRelatedContentsAction { - - /** Constructor. */ - public ShowHideRelatedContentsAction() { - super(); - } - - /** - * @see org.eclipse.papyrus.diagram.common.actions.AbstractShowHideAction#initAction() - */ - @Override - protected void initAction() { - super.initAction(); - - // Only ConstraintParameter are allowed => remove Ports (and subclasses) from AffixedNode selection - List<EditPartRepresentation> editPartRepresentationsToRemove = new ArrayList<EditPartRepresentation>(); - Set<EObject> representedAffixedElements = new HashSet<EObject>(); - AffixedChildrenEditPartRepresentation affixedNodeRepresentations = getAffixedNodeRepresentation(this.representations); - - // Select only affixedNode which semantic element could be a ConstraintParameter - for (EditPartRepresentation currentRepresentation : affixedNodeRepresentations.getPossibleElement()) { - EObject semanticElement = currentRepresentation.getSemanticElement(); - if (!(semanticElement == null || ConstraintBlockHelper.couldBeConstraintParameter(semanticElement, getOwnerSemanticElement()))) { - editPartRepresentationsToRemove.add(currentRepresentation); - } - else { - representedAffixedElements.add(semanticElement); - } - } - for (EditPartRepresentation editPartRepresentationToRemove : editPartRepresentationsToRemove) { - affixedNodeRepresentations.getPossibleElement().remove(editPartRepresentationToRemove); - } - - // Remove from structure category elements which match as AffixedNode - editPartRepresentationsToRemove = new ArrayList<EditPartRepresentation>(); - CompartmentEditPartRepresentation compartmentEditPartRepresentation = getCompartmentEditPartRepresentation(this.representations); - if (compartmentEditPartRepresentation != null) { - for (EditPartRepresentation currentRepresentation : compartmentEditPartRepresentation.getPossibleElement()) { - EObject semanticElement = currentRepresentation.getSemanticElement(); - if (representedAffixedElements.contains(semanticElement)) { - editPartRepresentationsToRemove.add(currentRepresentation); - } - } - for (EditPartRepresentation editPartRepresentationToRemove : editPartRepresentationsToRemove) { - compartmentEditPartRepresentation.getPossibleElement().remove(editPartRepresentationToRemove); - } - } - } - - private EObject getOwnerSemanticElement() { - return this.representations.size() >= 1 ? this.representations.get(0).getSemanticElement() : null; - } - - /** - * - * @param editPartRepresentations - * @return - */ - private AffixedChildrenEditPartRepresentation getAffixedNodeRepresentation(List<EditPartRepresentation> editPartRepresentations) { - - for (EditPartRepresentation representation : editPartRepresentations) { - if (representation instanceof AffixedChildrenEditPartRepresentation) { - return (AffixedChildrenEditPartRepresentation) representation; - } - // recursive search - AffixedChildrenEditPartRepresentation affixedNodeRepresentation = getAffixedNodeRepresentation(representation.getPossibleElement()); - if (affixedNodeRepresentation != null) { - return affixedNodeRepresentation; - } - } - return null; - } - - /** - * - * @param editPartRepresentations - * @return - */ - private CompartmentEditPartRepresentation getCompartmentEditPartRepresentation(List<EditPartRepresentation> editPartRepresentations) { - - for (EditPartRepresentation representation : editPartRepresentations) { - if (representation instanceof CompartmentEditPartRepresentation && !(representation instanceof AffixedChildrenEditPartRepresentation)) { - return (CompartmentEditPartRepresentation) representation; - } - // recursive search - CompartmentEditPartRepresentation compartmentEditPartRepresentation = getCompartmentEditPartRepresentation(representation.getPossibleElement()); - if (compartmentEditPartRepresentation != null) { - return compartmentEditPartRepresentation; - } - } - return null; - } -} diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/handler/ShowHideRelatedContentsHandler.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/handler/ShowHideRelatedContentsHandler.java deleted file mode 100644 index 5a37e5ff666..00000000000 --- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/handler/ShowHideRelatedContentsHandler.java +++ /dev/null @@ -1,28 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Régis CHEVREL: chevrel.regis <at> gmail.com - * CEA LIST - Initial API and implementation - * - *****************************************************************************/ -package org.eclipse.papyrus.sysml.diagram.parametric.handler; - -import org.eclipse.papyrus.uml.diagram.common.actions.handlers.AbstractShowHideHandler; -import org.eclipse.papyrus.uml.diagram.common.editpolicies.ShowHideRelatedContentsEditPolicy; - -/** - * Handler for the {@link ShowHideRelatedContentsAction} - */ -public class ShowHideRelatedContentsHandler extends AbstractShowHideHandler { - - /** Constructor. */ - public ShowHideRelatedContentsHandler() { - super(new ShowHideRelatedContentsAction(), ShowHideRelatedContentsEditPolicy.SHOW_HIDE_RELATED_CONTENTS_POLICY); - } -} diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/migration/ParametricReconciler_1_2_0.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/migration/ParametricReconciler_1_2_0.java deleted file mode 100644 index bcfbb443efe..00000000000 --- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/migration/ParametricReconciler_1_2_0.java +++ /dev/null @@ -1,96 +0,0 @@ -/*****************************************************************************
- * Copyright (c) 2010, 2015 CEA LIST 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:
- * Florian Noyrit (CEA) florian.noyrit@cea.fr - Initial API and Implementation
- * Mickael ADAM (ALL4TEC) mickael.adam@all4tec.net - reconciler to add floating label
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.parametric.migration;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.emf.common.util.TreeIterator;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gmf.runtime.common.core.command.AbstractCommand;
-import org.eclipse.gmf.runtime.common.core.command.CommandResult;
-import org.eclipse.gmf.runtime.common.core.command.CompositeCommand;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.notation.Diagram;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.infra.gmfdiag.common.reconciler.DiagramReconciler;
-
-/**
- * Parametric Diagram Reconciler from 1.1.0 to 1.2.0
- */
-public class ParametricReconciler_1_2_0 extends DiagramReconciler {
-
- @Override
- public ICommand getReconcileCommand(Diagram diagram) {
- CompositeCommand cc = new CompositeCommand("Migrate diagram from 1.1.0 to 1.2.0");
- cc.add(new ChangeVisualIDsCommand(diagram));
- return cc;
- }
-
- protected class ChangeVisualIDsCommand extends AbstractCommand {
-
- protected final Diagram diagram;
-
- public ChangeVisualIDsCommand(Diagram diagram) {
- super("Change the diagram's visual ids from 1.1.0 to 1.2.0");
- this.diagram = diagram;
- }
-
- @Override
- protected CommandResult doExecuteWithResult(IProgressMonitor progressMonitor, IAdaptable info) throws ExecutionException {
- TreeIterator<EObject> allContentIterator = diagram.eAllContents();
-
- while (allContentIterator.hasNext()) {
- EObject eObject = allContentIterator.next();
- if (eObject instanceof View) {
- View view = (View) eObject;
- view.setType(getNewVisualID(view.getType()));
- }
- }
-
- return CommandResult.newOKCommandResult();
- }
-
- @Override
- public boolean canUndo() {
- return false;
- }
-
- @Override
- public boolean canRedo() {
- return false;
- }
-
- @Override
- protected CommandResult doRedoWithResult(IProgressMonitor progressMonitor, IAdaptable info) throws ExecutionException {
- throw new ExecutionException("Should not be called, canRedo false");
- }
-
- @Override
- protected CommandResult doUndoWithResult(IProgressMonitor progressMonitor, IAdaptable info) throws ExecutionException {
- throw new ExecutionException("Should not be called, canUndo false");
- }
- }
-
- public static String getNewVisualID(String oldVisualID) {
- switch (oldVisualID) {
- case "8500":
- return "Constraint_ContextEdge";
- case "8501":
- return "Constraint_KeywordLabel";
- default:
- return oldVisualID;
- }
- }
-}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/parser/ParametricFrameParser.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/parser/ParametricFrameParser.java deleted file mode 100644 index 6cbbdb9ca27..00000000000 --- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/parser/ParametricFrameParser.java +++ /dev/null @@ -1,47 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Régis CHEVREL: chevrel.regis <at> gmail.com - * CEA LIST - Initial API and implementation - * Trung-Truc Nguyen Bug 439935 - *****************************************************************************/ -package org.eclipse.papyrus.sysml.diagram.parametric.parser; - -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.papyrus.infra.gmfdiag.common.commands.SemanticAdapter; -import org.eclipse.papyrus.sysml.constraints.ConstraintBlock; -import org.eclipse.papyrus.uml.diagram.common.parser.NamedElementLabelParser; -import org.eclipse.uml2.uml.util.UMLUtil; - -public class ParametricFrameParser extends NamedElementLabelParser { - - /** - * /** - * Respect the SysML diagram frame "diagramKind [modelElementType] modelElementName [diagramName]" - * For the parametric diagram, the modelElementName might be a Block or a ConstraintBlock element - * - * A parametric diagram frame, therefore, may be: - * - * par [Block] blockName [diagramName] OR - * par [ConstraintBlock] constraintBlockName [diagramName] - * - */ - @Override - public String getPrintString(IAdaptable element, int flags) { - String elementType = null; - if(element instanceof SemanticAdapter){ - Object realObject = ((SemanticAdapter) element).getAdapter(EObject.class); - if (realObject instanceof org.eclipse.uml2.uml.Class) { - elementType = UMLUtil.getStereotypeApplication(((org.eclipse.uml2.uml.Class) realObject), ConstraintBlock.class) != null ? "ConstraintBlock" : "Block"; - } - } - return "par [" + elementType + "] " + super.getPrintString(element, flags); - } -} diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/policies/CustomBlockCompositeDropEditPolicy.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/policies/CustomBlockCompositeDropEditPolicy.java deleted file mode 100644 index 8e553b2e2fc..00000000000 --- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/policies/CustomBlockCompositeDropEditPolicy.java +++ /dev/null @@ -1,129 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013, 2016 CEA LIST, Esterel Technologies SAS 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: - * Régis CHEVREL: chevrel.regis <at> gmail.com - * CEA LIST - Initial API and implementation - * Alain Le Guennec (Esterel Technologies SAS) - bug 497400 - * - *****************************************************************************/ -package org.eclipse.papyrus.sysml.diagram.parametric.policies; - -import java.util.ArrayList; -import java.util.List; -import java.util.Set; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.transaction.RunnableWithResult; -import org.eclipse.gef.commands.Command; -import org.eclipse.gef.commands.UnexecutableCommand; -import org.eclipse.gmf.runtime.common.core.command.ICommand; -import org.eclipse.gmf.runtime.diagram.ui.commands.CommandProxy; -import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy; -import org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart; -import org.eclipse.gmf.runtime.diagram.ui.requests.DropObjectsRequest; -import org.eclipse.papyrus.infra.gmfdiag.common.commands.SelectAndExecuteCommand; -import org.eclipse.papyrus.sysml.diagram.internalblock.utils.TypeDropHelper; -import org.eclipse.papyrus.sysml.diagram.parametric.provider.CustomGraphicalTypeRegistry; -import org.eclipse.papyrus.sysml.diagram.parametric.utils.ConstraintParameterDropHelper; -import org.eclipse.papyrus.uml.diagram.common.utils.UMLGraphicalTypes; -import org.eclipse.swt.widgets.Display; -import org.eclipse.ui.PlatformUI; -import org.eclipse.uml2.uml.Property; - -/** - * <pre> - * Customization of the DND edit policy for BlockPropertyComposite that enables - * type modification, or creation of new Port and FlowPort by a drop on target. - * </pre> - */ -public class CustomBlockCompositeDropEditPolicy extends CustomDragDropEditPolicy { - - /** Default constructor */ - public CustomBlockCompositeDropEditPolicy() { - super(); - registry = new CustomGraphicalTypeRegistry(); - } - - /** - * {@inheritDoc} - */ - @Override - protected Set<String> getSpecificDropBehaviorTypes() { - Set<String> specificDropBehaviorTypes = super.getSpecificDropBehaviorTypes(); - - specificDropBehaviorTypes.add(UMLGraphicalTypes.SHAPE_UML_PROPERTY_AS_AFFIXED_ID); - - return specificDropBehaviorTypes; - } - - /** - * {@inheritDoc} - */ - @Override - protected ICommand getSpecificDropCommand(DropObjectsRequest dropRequest, EObject droppedEObject, String nodeType, String edgeType) { - if (UMLGraphicalTypes.SHAPE_UML_PROPERTY_AS_AFFIXED_ID.equals(nodeType)) { - ConstraintParameterDropHelper constraintParameterDropHelper = new ConstraintParameterDropHelper(getEditingDomain()); - Command commandParameterDropCommand = constraintParameterDropHelper.getDropConstraintParameter((Property) droppedEObject, dropRequest.getLocation().getCopy(), (GraphicalEditPart) getHost()); - return new CommandProxy(commandParameterDropCommand); - } - - return super.getSpecificDropCommand(dropRequest, droppedEObject, nodeType, edgeType); - } - - /** - * {@inheritedDoc}. - */ - @Override - public Command getDropObjectsCommand(DropObjectsRequest dropRequest) { - TypeDropHelper helper = new TypeDropHelper(getEditingDomain()); - - // Single drop management possible drop action list can be proposed - if (dropRequest.getObjects().size() == 1) { - - // List of available drop commands - final List<Command> commandChoice = new ArrayList<Command>(); - - // 1. Try to set the target element type with dropped object - Command dropAsSetType = helper.getDropAsTypedElementType(dropRequest, (GraphicalEditPart) getHost()); - if ((dropAsSetType != null) && (dropAsSetType.canExecute())) { - commandChoice.add(dropAsSetType); - } - - // 2. Build default drop command (show view of the dropped object) - Command defaultDropCommand = super.getDropObjectsCommand(dropRequest); - if ((defaultDropCommand != null) && (defaultDropCommand.canExecute())) { - defaultDropCommand.setLabel("Default drop (Show dropped object in diagram)"); - commandChoice.add(defaultDropCommand); - } - - // Prepare the selection command (if several command are available) or return the drop command - if (commandChoice.size() > 1) { - RunnableWithResult<ICommand> runnable; - Display.getDefault().syncExec(runnable = new RunnableWithResult.Impl<ICommand>() { - - public void run() { - setResult(new SelectAndExecuteCommand("Select drop action for ", PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), commandChoice)); - } - }); - - ICommand selectCommand = runnable.getResult(); - - return new ICommandProxy(selectCommand); - } else if (commandChoice.size() == 1) { - return commandChoice.get(0); - } - - // else (command choice is empty) - return UnexecutableCommand.INSTANCE; - - } - - return super.getDropObjectsCommand(dropRequest); - } -} diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/policies/CustomBlockPropertyCompositeDropEditPolicy.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/policies/CustomBlockPropertyCompositeDropEditPolicy.java deleted file mode 100644 index ea8909b4942..00000000000 --- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/policies/CustomBlockPropertyCompositeDropEditPolicy.java +++ /dev/null @@ -1,129 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013, 2016 CEA LIST, Esterel Technologies SAS 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: - * Régis CHEVREL: chevrel.regis <at> gmail.com - * CEA LIST - Initial API and implementation - * Alain Le Guennec (Esterel Technologies SAS) - bug 497400 - * - *****************************************************************************/ -package org.eclipse.papyrus.sysml.diagram.parametric.policies; - -import java.util.ArrayList; -import java.util.List; -import java.util.Set; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.transaction.RunnableWithResult; -import org.eclipse.gef.commands.Command; -import org.eclipse.gef.commands.UnexecutableCommand; -import org.eclipse.gmf.runtime.common.core.command.ICommand; -import org.eclipse.gmf.runtime.diagram.ui.commands.CommandProxy; -import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy; -import org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart; -import org.eclipse.gmf.runtime.diagram.ui.requests.DropObjectsRequest; -import org.eclipse.papyrus.infra.gmfdiag.common.commands.SelectAndExecuteCommand; -import org.eclipse.papyrus.sysml.diagram.internalblock.utils.TypeDropHelper; -import org.eclipse.papyrus.sysml.diagram.parametric.provider.CustomGraphicalTypeRegistry; -import org.eclipse.papyrus.sysml.diagram.parametric.utils.ConstraintParameterDropHelper; -import org.eclipse.papyrus.uml.diagram.common.utils.UMLGraphicalTypes; -import org.eclipse.swt.widgets.Display; -import org.eclipse.ui.PlatformUI; -import org.eclipse.uml2.uml.Property; - -/** - * <pre> - * Customization of the DND edit policy for BlockPropertyComposite that enables - * type modification, or creation of new Port and FlowPort by a drop on target. - * </pre> - */ -public class CustomBlockPropertyCompositeDropEditPolicy extends CustomDragDropEditPolicy { - - /** Default constructor */ - public CustomBlockPropertyCompositeDropEditPolicy() { - super(); - registry = new CustomGraphicalTypeRegistry(); - } - - /** - * {@inheritDoc} - */ - @Override - protected Set<String> getSpecificDropBehaviorTypes() { - Set<String> specificDropBehaviorTypes = super.getSpecificDropBehaviorTypes(); - - specificDropBehaviorTypes.add(UMLGraphicalTypes.SHAPE_UML_PROPERTY_AS_AFFIXED_ID); - - return specificDropBehaviorTypes; - } - - /** - * {@inheritDoc} - */ - @Override - protected ICommand getSpecificDropCommand(DropObjectsRequest dropRequest, EObject droppedEObject, String nodeType, String edgeType) { - if (UMLGraphicalTypes.SHAPE_UML_PROPERTY_AS_AFFIXED_ID.equals(nodeType)) { - ConstraintParameterDropHelper constraintParameterDropHelper = new ConstraintParameterDropHelper(getEditingDomain()); - Command commandParameterDropCommand = constraintParameterDropHelper.getDropConstraintParameterOnPart((Property) droppedEObject, dropRequest.getLocation().getCopy(), (GraphicalEditPart) getHost()); - return new CommandProxy(commandParameterDropCommand); - } - - return super.getSpecificDropCommand(dropRequest, droppedEObject, nodeType, edgeType); - } - - /** - * {@inheritedDoc}. - */ - @Override - public Command getDropObjectsCommand(DropObjectsRequest dropRequest) { - TypeDropHelper helper = new TypeDropHelper(getEditingDomain()); - - // Single drop management possible drop action list can be proposed - if (dropRequest.getObjects().size() == 1) { - - // List of available drop commands - final List<Command> commandChoice = new ArrayList<Command>(); - - // 1. Try to set the target element type with dropped object - Command dropAsSetType = helper.getDropAsTypedElementType(dropRequest, (GraphicalEditPart) getHost()); - if ((dropAsSetType != null) && (dropAsSetType.canExecute())) { - commandChoice.add(dropAsSetType); - } - - // 2. Build default drop command (show view of the dropped object) - Command defaultDropCommand = super.getDropObjectsCommand(dropRequest); - if ((defaultDropCommand != null) && (defaultDropCommand.canExecute())) { - defaultDropCommand.setLabel("Default drop (Show dropped object in diagram)"); - commandChoice.add(defaultDropCommand); - } - - // Prepare the selection command (if several command are available) or return the drop command - if (commandChoice.size() > 1) { - RunnableWithResult<ICommand> runnable; - Display.getDefault().syncExec(runnable = new RunnableWithResult.Impl<ICommand>() { - - public void run() { - setResult(new SelectAndExecuteCommand("Select drop action for ", PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), commandChoice)); - } - }); - - ICommand selectCommand = runnable.getResult(); - - return new ICommandProxy(selectCommand); - } else if (commandChoice.size() == 1) { - return commandChoice.get(0); - } - - // else (command choice is empty) - return UnexecutableCommand.INSTANCE; - - } - - return super.getDropObjectsCommand(dropRequest); - } -} diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/policies/CustomBlockPropertyStructureCompartmentEditPartDropEditPolicy.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/policies/CustomBlockPropertyStructureCompartmentEditPartDropEditPolicy.java deleted file mode 100644 index 9692542fc86..00000000000 --- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/policies/CustomBlockPropertyStructureCompartmentEditPartDropEditPolicy.java +++ /dev/null @@ -1,146 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013, 2016 CEA LIST, Esterel Technologies SAS 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: - * Régis CHEVREL: chevrel.regis <at> gmail.com - * CEA LIST - Initial API and implementation - * Alain Le Guennec (Esterel Technologies SAS) - bug 497400 - * - *****************************************************************************/ -package org.eclipse.papyrus.sysml.diagram.parametric.policies; - -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.emf.transaction.RunnableWithResult; -import org.eclipse.gef.commands.Command; -import org.eclipse.gef.commands.UnexecutableCommand; -import org.eclipse.gmf.runtime.common.core.command.ICommand; -import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil; -import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy; -import org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart; -import org.eclipse.gmf.runtime.diagram.ui.requests.DropObjectsRequest; -import org.eclipse.gmf.runtime.notation.View; -import org.eclipse.papyrus.infra.gmfdiag.common.commands.SelectAndExecuteCommand; -import org.eclipse.papyrus.sysml.diagram.internalblock.utils.PartDropHelper; -import org.eclipse.papyrus.sysml.diagram.parametric.utils.BlockDropHelper; -import org.eclipse.papyrus.sysml.service.types.element.SysMLElementTypes; -import org.eclipse.papyrus.uml.service.types.element.UMLElementTypes; -import org.eclipse.swt.widgets.Display; -import org.eclipse.ui.PlatformUI; - -/** - * <pre> - * Customization of the DND edit policy for BlockPropertyComposite that enables - * type modification, or creation of new Port and FlowPort by a drop on target. - * </pre> - */ -public class CustomBlockPropertyStructureCompartmentEditPartDropEditPolicy extends CustomDragDropEditPolicy { - - /** Default constructor */ - public CustomBlockPropertyStructureCompartmentEditPartDropEditPolicy() { - super(); - } - - /** - * {@inheritedDoc}. - */ - @Override - public Command getDropObjectsCommand(DropObjectsRequest dropRequest) { - - BlockDropHelper helper = new BlockDropHelper(getEditingDomain()); - - // Single drop management possible drop action list can be proposed - if (dropRequest.getObjects().size() == 1) { - - // List of available drop commands - final List<Command> commandChoice = new ArrayList<Command>(); - - // 1. Build command to drop BlockProperty - PartDropHelper partDropHelper = new PartDropHelper(getEditingDomain()); - Command dropPartOnPart = partDropHelper.getDropPartOnPart(dropRequest, (GraphicalEditPart) getHost()); - if ((dropPartOnPart != null) && (dropPartOnPart.canExecute())) { - commandChoice.add(dropPartOnPart); - } - - // 2. Try to create a Part typed by the dropped object - Command dropAsTypedPart = helper.getDropAsStructureItemOnPart(dropRequest, (GraphicalEditPart) getHost(), SysMLElementTypes.PART_PROPERTY); - if ((dropAsTypedPart != null) && (dropAsTypedPart.canExecute())) { - commandChoice.add(dropAsTypedPart); - } - - // 3. Try to create a Reference typed by the dropped object - Command dropAsTypedReference = helper.getDropAsStructureItemOnPart(dropRequest, (GraphicalEditPart) getHost(), SysMLElementTypes.REFERENCE_PROPERTY); - if ((dropAsTypedReference != null) && (dropAsTypedReference.canExecute())) { - commandChoice.add(dropAsTypedReference); - } - - // 4. Try to create an ActorPart typed by the dropped object - Command dropAsTypedActorPart = helper.getDropAsStructureItemOnPart(dropRequest, (GraphicalEditPart) getHost(), SysMLElementTypes.ACTOR_PART_PROPERTY); - if ((dropAsTypedActorPart != null) && (dropAsTypedActorPart.canExecute())) { - commandChoice.add(dropAsTypedActorPart); - } - - // 5. Try to create a Value typed by the dropped object - Command dropAsTypedValue = helper.getDropAsStructureItemOnPart(dropRequest, (GraphicalEditPart) getHost(), SysMLElementTypes.VALUE_PROPERTY); - if ((dropAsTypedValue != null) && (dropAsTypedValue.canExecute())) { - commandChoice.add(dropAsTypedValue); - } - - // 6. Try to create a Property typed by the dropped object - Command dropAsTypedProperty = helper.getDropAsStructureItemOnPart(dropRequest, (GraphicalEditPart) getHost(), UMLElementTypes.PROPERTY); - if ((dropAsTypedProperty != null) && (dropAsTypedProperty.canExecute())) { - commandChoice.add(dropAsTypedProperty); - } - - // 7. Try to create a Property typed by the dropped object - Command dropAsTypedConstraintProperty = helper.getDropAsStructureItemOnPart(dropRequest, (GraphicalEditPart) getHost(), SysMLElementTypes.CONSTRAINT_PROPERTY); - if ((dropAsTypedConstraintProperty != null) && (dropAsTypedConstraintProperty.canExecute())) { - commandChoice.add(dropAsTypedConstraintProperty); - } - - // 8. Build default drop command (show view of the dropped object) - Command defaultDropCommand = super.getDropObjectsCommand(dropRequest); - if ((defaultDropCommand != null) && (defaultDropCommand.canExecute())) { - defaultDropCommand.setLabel("Default drop (Show dropped object in diagram)"); - commandChoice.add(defaultDropCommand); - } - - // Prepare the selection command (if several command are available) or return the drop command - if (commandChoice.size() > 1) { - RunnableWithResult<ICommand> runnable; - Display.getDefault().syncExec(runnable = new RunnableWithResult.Impl<ICommand>() { - - public void run() { - setResult(new SelectAndExecuteCommand("Select drop action for ", PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), commandChoice)); - } - }); - - ICommand selectCommand = runnable.getResult(); - - return new ICommandProxy(selectCommand); - } else if (commandChoice.size() == 1) { - return commandChoice.get(0); - } - - // else (command choice is empty) - return UnexecutableCommand.INSTANCE; - - } - - return super.getDropObjectsCommand(dropRequest); - } - - /** - * {@inheritDoc} - */ - @Override - protected View getReferenceViewForConnectorEnd() { - return ViewUtil.getContainerView(super.getReferenceViewForConnectorEnd()); - } -} diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/policies/CustomBlockPropertyStructureCompartmentSemanticEditPolicy.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/policies/CustomBlockPropertyStructureCompartmentSemanticEditPolicy.java deleted file mode 100644 index a5481a1015c..00000000000 --- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/policies/CustomBlockPropertyStructureCompartmentSemanticEditPolicy.java +++ /dev/null @@ -1,65 +0,0 @@ -/*****************************************************************************
- * Copyright (c) 2013 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Régis CHEVREL: chevrel.regis <at> gmail.com
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.parametric.policies;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.commands.UnexecutableCommand;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.emf.type.core.IElementType;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.sysml.constraints.ConstraintBlock;
-import org.eclipse.papyrus.sysml.diagram.common.edit.policy.BlockPropertyStructureCompartmentSemanticEditPolicy;
-import org.eclipse.papyrus.sysml.service.types.element.SysMLElementTypes;
-import org.eclipse.papyrus.uml.service.types.element.UMLElementTypes;
-import org.eclipse.uml2.uml.Element;
-import org.eclipse.uml2.uml.Property;
-import org.eclipse.uml2.uml.util.UMLUtil;
-
-public class CustomBlockPropertyStructureCompartmentSemanticEditPolicy extends
- BlockPropertyStructureCompartmentSemanticEditPolicy {
-
- @Override
- protected Command getCreateCommand(CreateElementRequest req) {
-
- View dropTargetView = ((IGraphicalEditPart) getHost()).getNotationView();
- EObject eContainer = dropTargetView.eContainer();
- Element parent = null;
- if (eContainer != null && eContainer instanceof View) {
- parent = (Element) ((View) eContainer).getElement();
- }
- if (parent instanceof Property) {
- parent = ((Property) parent).getType();
- }
-
- if (parent != null) {
- if (UMLUtil.getStereotypeApplication(parent, ConstraintBlock.class) != null) {
- IElementType elementType = req.getElementType();
- if (elementType != UMLElementTypes.CONSTRAINT
- && elementType != UMLElementTypes.COMMENT) {
- // ConstraintBlock
- if (elementType != SysMLElementTypes.CONSTRAINT_PROPERTY) {
- // only ConstraintProperty can be dropped in structure
- // compartment of a diagram owned by a ConstraintBlock
- // (except common Comment and Constraint)
- return UnexecutableCommand.INSTANCE;
- }
- }
- }
- }
-
- return super.getCreateCommand(req);
- }
-}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/policies/CustomDefaultSemanticEditPolicy.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/policies/CustomDefaultSemanticEditPolicy.java deleted file mode 100644 index f3e58bef495..00000000000 --- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/policies/CustomDefaultSemanticEditPolicy.java +++ /dev/null @@ -1,103 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Régis CHEVREL: chevrel.regis <at> gmail.com - * CEA LIST - Initial API and implementation - * - *****************************************************************************/ -package org.eclipse.papyrus.sysml.diagram.parametric.policies; - -import org.eclipse.gef.commands.Command; -import org.eclipse.gef.commands.UnexecutableCommand; -import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest; -import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientReferenceRelationshipRequest; -import org.eclipse.gmf.runtime.notation.View; -import org.eclipse.papyrus.gmf.diagram.common.provider.IGraphicalTypeRegistry; -import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.DefaultSemanticEditPolicy; -import org.eclipse.papyrus.infra.services.edit.utils.RequestParameterConstants; -import org.eclipse.papyrus.sysml.diagram.parametric.commands.CustomBindingConnectorReorientCommand; -import org.eclipse.papyrus.sysml.diagram.parametric.commands.CustomParametricContextLinkCreateCommand; -import org.eclipse.papyrus.sysml.diagram.parametric.commands.ReorientReferenceRelationshipRequestWithGraphical; -import org.eclipse.papyrus.sysml.diagram.parametric.provider.CustomGraphicalTypeRegistry; -import org.eclipse.papyrus.sysml.diagram.parametric.provider.ElementTypes; -import org.eclipse.papyrus.sysml.diagram.parametric.provider.GraphicalTypeRegistry; -import org.eclipse.papyrus.uml.diagram.common.utils.UMLGraphicalTypes; -import org.eclipse.papyrus.uml.service.types.command.CommentAnnotatedElementsCreateCommand; -import org.eclipse.papyrus.uml.service.types.command.CommentAnnotatedElementsReorientCommand; -import org.eclipse.papyrus.uml.service.types.command.ConnectorReorientCommand; - -/** - * <pre> - * Custom semantic edit policy that replace DefaultSemanticEditPolicy - * in order to manage Class Diagram specific elements (reference - * relationships COMMENT_ANNOTATED_ELEMENT and CONSTRAINT_CONSTRAINED_ELEMENT). - * </pre> - */ -public class CustomDefaultSemanticEditPolicy extends DefaultSemanticEditPolicy { - - /** Local graphical type registry for graphical elements */ - private IGraphicalTypeRegistry registry = new CustomGraphicalTypeRegistry(); - - /** Local graphical type registry for inherited graphical elements */ - private IGraphicalTypeRegistry inheritedRegistry = new GraphicalTypeRegistry(); - - /** - * {@inheritDoc} - */ - @Override - protected Command getCreateRelationshipCommand(CreateRelationshipRequest req) { - - if (ElementTypes.COMMENT_ANNOTATED_ELEMENT == req.getElementType()) { - return getGEFWrapper(new CommentAnnotatedElementsCreateCommand(req)); - } - - if (ElementTypes.CONTEXT_LINK == req.getElementType()) { - return getGEFWrapper(new CustomParametricContextLinkCreateCommand(req)); - } - - String newEdgeGraphicalType = registry.getEdgeGraphicalType(req.getElementType()); - - if (inheritedRegistry.isKnownEdgeType(newEdgeGraphicalType)) { - return UnexecutableCommand.INSTANCE; - } - - if (!registry.isKnownEdgeType(newEdgeGraphicalType)) { - return UnexecutableCommand.INSTANCE; - } - - return super.getCreateRelationshipCommand(req); - } - - /** - * {@inheritDoc} - */ - @Override - protected Command getReorientReferenceRelationshipCommand(ReorientReferenceRelationshipRequest req) { - - View reconnectedView = (View) req.getParameter(RequestParameterConstants.GRAPHICAL_RECONNECTED_EDGE); - String reconnectedViewType = (reconnectedView != null) ? reconnectedView.getType() : org.eclipse.papyrus.infra.gmfdiag.common.providers.IGraphicalTypeRegistry.UNDEFINED_TYPE; - - if (ElementTypes.COMMENT_ANNOTATED_ELEMENT.getSemanticHint().equals(reconnectedViewType)) { - return getGEFWrapper(new CommentAnnotatedElementsReorientCommand(req)); - } - - if (UMLGraphicalTypes.LINK_UML_CONNECTOR_ID.equals(reconnectedViewType)) { - if (req instanceof ReorientReferenceRelationshipRequestWithGraphical) { - return getGEFWrapper(new CustomBindingConnectorReorientCommand((ReorientReferenceRelationshipRequestWithGraphical) req)); - } - else { - return getGEFWrapper(new ConnectorReorientCommand(req)); - } - } - - - return super.getReorientReferenceRelationshipCommand(req); - } - -} diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/policies/CustomDragDropEditPolicy.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/policies/CustomDragDropEditPolicy.java deleted file mode 100644 index 7ce99306223..00000000000 --- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/policies/CustomDragDropEditPolicy.java +++ /dev/null @@ -1,278 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Régis CHEVREL: chevrel.regis <at> gmail.com - * CEA LIST - Initial API and implementation - * - *****************************************************************************/ -package org.eclipse.papyrus.sysml.diagram.parametric.policies; - -import java.util.Collection; -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; -import java.util.Set; - -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.EReference; -import org.eclipse.gmf.runtime.common.core.command.ICommand; -import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil; -import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart; -import org.eclipse.gmf.runtime.diagram.ui.requests.CreateConnectionViewRequest; -import org.eclipse.gmf.runtime.diagram.ui.requests.DropObjectsRequest; -import org.eclipse.gmf.runtime.emf.core.util.EMFCoreUtil; -import org.eclipse.gmf.runtime.notation.Diagram; -import org.eclipse.gmf.runtime.notation.NotationPackage; -import org.eclipse.gmf.runtime.notation.View; -import org.eclipse.papyrus.gmf.diagram.common.edit.policy.CommonDiagramDragDropEditPolicy; -import org.eclipse.papyrus.sysml.blocks.NestedConnectorEnd; -import org.eclipse.papyrus.sysml.diagram.internalblock.dnd.helper.CustomLinkMappingHelper; -import org.eclipse.papyrus.sysml.diagram.parametric.provider.CustomGraphicalTypeRegistry; -import org.eclipse.papyrus.sysml.service.types.utils.ConnectorUtils; -import org.eclipse.papyrus.uml.diagram.common.commands.CommonDeferredCreateConnectionViewCommand; -import org.eclipse.papyrus.uml.diagram.common.commands.SemanticAdapter; -import org.eclipse.papyrus.uml.diagram.common.utils.UMLGraphicalTypes; -import org.eclipse.uml2.uml.Connector; -import org.eclipse.uml2.uml.ConnectorEnd; -import org.eclipse.uml2.uml.EncapsulatedClassifier; -import org.eclipse.uml2.uml.Port; -import org.eclipse.uml2.uml.Property; -import org.eclipse.uml2.uml.util.UMLUtil; - -/** Customization of the DND edit policy for the Internal Block Diagram */ -public class CustomDragDropEditPolicy extends CommonDiagramDragDropEditPolicy { - - private ConnectorUtils utils = new ConnectorUtils(); - - /** Default constructor. */ - public CustomDragDropEditPolicy() { - super(new CustomLinkMappingHelper()); - registry = new CustomGraphicalTypeRegistry(); - } - - /** - * {@inheritDoc} - */ - @Override - protected Set<String> getSpecificDropBehaviorTypes() { - Set<String> specificDropBehaviorTypes = new HashSet<String>(); - - specificDropBehaviorTypes.add(UMLGraphicalTypes.LINK_UML_CONNECTOR_ID); - - return specificDropBehaviorTypes; - } - - /** - * {@inheritDoc} - */ - @Override - protected ICommand getSpecificDropCommand(DropObjectsRequest dropRequest, EObject droppedEObject, String nodeType, String edgeType) { - if ((UMLGraphicalTypes.LINK_UML_CONNECTOR_ID.equals(edgeType)) && (droppedEObject instanceof Connector)) { - return getConnectorDropCommand(dropRequest, (Connector) droppedEObject, edgeType); - } - - return org.eclipse.gmf.runtime.common.core.command.UnexecutableCommand.INSTANCE; - } - - protected ICommand getConnectorDropCommand(DropObjectsRequest dropRequest, Connector droppedEObject, String edgeType) { - - // Only manage binary link during drop - if (droppedEObject.getEnds().size() != 2) { - return org.eclipse.gmf.runtime.common.core.command.UnexecutableCommand.INSTANCE; - } - - ConnectorEnd source = droppedEObject.getEnds().get(0); - ConnectorEnd target = droppedEObject.getEnds().get(1); - - // Find views in current diagram representing source and target - Collection<View> sourceViews = getViewsForConnectorEnd(source); - Collection<View> targetViews = getViewsForConnectorEnd(target); - - IAdaptable sourceViewAdapter = null; - IAdaptable targetViewAdapter = null; - - // If either a source or target lacks create view for these elements, abort... - if (sourceViews.isEmpty() || targetViews.isEmpty()) { - return org.eclipse.gmf.runtime.common.core.command.UnexecutableCommand.INSTANCE; - } - - View selectedSourceView = null; - View selectedTargetView = null; - // until a correct one is found, check that source and target views selected are correct given the current path for the connector... - for (View sourceView : sourceViews) { - View targetView = getFirstValidTargetViewForSource(sourceView, targetViews, droppedEObject); - if (targetView != null) { - selectedSourceView = sourceView; - selectedTargetView = targetView; - break; - } - } - - - // Create source adapter - if (selectedSourceView != null) { // sourceViewAdapter should still be null in this case - sourceViewAdapter = new SemanticAdapter(null, selectedSourceView); - } else { - return org.eclipse.gmf.runtime.common.core.command.UnexecutableCommand.INSTANCE; - } - - // Create target adapter - if (selectedTargetView != null) { // targetViewAdapter should still be null in this case - targetViewAdapter = new SemanticAdapter(null, selectedTargetView); - } else { - return org.eclipse.gmf.runtime.common.core.command.UnexecutableCommand.INSTANCE; - } - - // Create a view for the dropped link between the source and target view adapters - IAdaptable droppedObjectAdapter = new SemanticAdapter(droppedEObject, null); - - CreateConnectionViewRequest.ConnectionViewDescriptor linkdescriptor = new CreateConnectionViewRequest.ConnectionViewDescriptor(droppedObjectAdapter, edgeType, getDiagramPreferencesHint()); - - CommonDeferredCreateConnectionViewCommand createConnectionViewCommand = new CommonDeferredCreateConnectionViewCommand(getEditingDomain(), edgeType, sourceViewAdapter, targetViewAdapter, getViewer(), getDiagramPreferencesHint(), linkdescriptor, null); - createConnectionViewCommand.setElement(droppedEObject); - - return createConnectionViewCommand; - } - - /** - * get the first valid target view for the given source. the couple source/target is valid if the path to them from the future container is valid - * - * @param sourceView - * @param targetViews - * @return - */ - private View getFirstValidTargetViewForSource(View sourceView, Collection<View> targetViews, Connector droppedConnector) { - for (View targetView : targetViews) { - if (isValidTargetViewForSource(sourceView, targetView, droppedConnector)) { - return targetView; - } - } - - return null; - } - - private boolean isValidTargetViewForSource(View sourceView, View targetView, Connector droppedConnector) { - if (!(utils.isCrossingEncapsulation(sourceView, targetView))) { - // no encapsulation. Computes the end paths - List<Property> sourceNestedPaths = utils.getNestedPropertyPath(sourceView, targetView); - List<Property> targetNestedPaths = utils.getNestedPropertyPath(targetView, sourceView); - - // check this is compatible with current connector - ConnectorEnd sourceConnectorEnd = utils.getSourceConnectorEnd(droppedConnector); - NestedConnectorEnd nestedSourceConnectorEnd = UMLUtil.getStereotypeApplication(sourceConnectorEnd, NestedConnectorEnd.class); - if (nestedSourceConnectorEnd != null) { - List<Property> currentSourceConnectorPropertyPath = nestedSourceConnectorEnd.getPropertyPath(); - // compare the 2 list - if (!sourceNestedPaths.equals(currentSourceConnectorPropertyPath)) { - return false; - } - - } else { // no end for the current connector, so the sourceNestedPath should be empty - if (!sourceNestedPaths.isEmpty()) { - return false; - } - } - - - ConnectorEnd targetConnectorEnd = utils.getTargetConnectorEnd(droppedConnector); - NestedConnectorEnd nestedTargetConnectorEnd = UMLUtil.getStereotypeApplication(targetConnectorEnd, NestedConnectorEnd.class); - if (nestedTargetConnectorEnd != null) { - List<Property> currentTargetConnectorPropertyPath = nestedTargetConnectorEnd.getPropertyPath(); - // compare the 2 list - if (!targetNestedPaths.equals(currentTargetConnectorPropertyPath)) { - return false; - } - - } else { // no end for the current connector, so the targetNestedPaths should be empty - if (!targetNestedPaths.isEmpty()) { - return false; - } - } - } - return true; - } - - /** - * This methods looks for views representing a given {@link ConnectorEnd} in the host diagram. - * - * @param end - * the {@link ConnectorEnd} to look for. - * @return the list of {@link View} representing the eObject. - */ - protected Set<View> getViewsForConnectorEnd(ConnectorEnd end) { - Set<View> views = new HashSet<View>(); - - // Retrieve host diagram - View hostView = ((IGraphicalEditPart) getHost()).getNotationView(); - View hostDiagram = (hostView instanceof Diagram) ? hostView : hostView.getDiagram(); - - // Retrieve all views for the ConnectorEnd role - EReference[] refs = { NotationPackage.eINSTANCE.getView_Element() }; - @SuppressWarnings("unchecked") - Collection<View> relatedViews = EMFCoreUtil.getReferencers(end.getRole(), refs); - - // TODO: We should filter views not only for the current diagram, - // but also consider only views nested within the owner of the connector that are closest to the host view - // (in case there are several instances of a Part within which the connector could appear). - // Connector connector = (Connector)end.getOwner(); - // StructuredClassifier connectorOwner = (StructuredClassifier)connector.getOwner(); - // Parse and select views from host diagram only - Iterator<View> it = relatedViews.iterator(); - while (it.hasNext()) { - View currentView = it.next(); - if (currentView.getDiagram() == hostDiagram) { // FIXME: Cf TODO above. - - boolean isInView = false; - View containerView = currentView; - while (containerView != null && !(containerView instanceof Diagram)) { - if (containerView == getReferenceViewForConnectorEnd()) { - isInView = true; - } - containerView = ViewUtil.getContainerView(containerView); - } - - if (isInView) { - - EObject containerElement = ViewUtil.getContainerView(currentView).getElement(); - - // If the ConnectorEnd partWithPort is not null, only select Views for which - // the graphical parent reference partWithPort. - if (end.getPartWithPort() != null) { - if (containerElement == end.getPartWithPort()) { - views.add(currentView); - } - } else { - // If the role is a Port, its graphical parent is a EncapsulatedClassifier - if (end.getRole() instanceof Port) { - if (containerElement instanceof EncapsulatedClassifier) { - views.add(currentView); - } else if (containerElement instanceof Property) { - Property property = (Property) containerElement; - if (property.getType() == end.getRole().getOwner()) { - views.add(currentView); - } - } - } else { // No further test needed - views.add(currentView); - } - - } - } - } - } - - return views; - } - - protected View getReferenceViewForConnectorEnd() { - return ((IGraphicalEditPart) getHost()).getNotationView(); - } - -} diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/policies/CustomParametricSemanticPolicy.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/policies/CustomParametricSemanticPolicy.java deleted file mode 100644 index 32c432e2eb7..00000000000 --- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/policies/CustomParametricSemanticPolicy.java +++ /dev/null @@ -1,270 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Régis CHEVREL: chevrel.regis <at> gmail.com - * CEA LIST - Initial API and implementation - * - *****************************************************************************/ -package org.eclipse.papyrus.sysml.diagram.parametric.policies; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.transaction.TransactionalEditingDomain; -import org.eclipse.gef.EditPart; -import org.eclipse.gef.commands.Command; -import org.eclipse.gef.commands.UnexecutableCommand; -import org.eclipse.gef.requests.ReconnectRequest; -import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil; -import org.eclipse.gmf.runtime.diagram.ui.editparts.ConnectionEditPart; -import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart; -import org.eclipse.gmf.runtime.emf.type.core.IElementMatcher; -import org.eclipse.gmf.runtime.emf.type.core.SpecializationType; -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.IEditCommandRequest; -import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientReferenceRelationshipRequest; -import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRequest; -import org.eclipse.gmf.runtime.notation.View; -import org.eclipse.papyrus.sysml.constraints.ConstraintBlock; -import org.eclipse.papyrus.sysml.diagram.common.edit.part.BlockPropertyCompositeEditPart; -import org.eclipse.papyrus.sysml.diagram.parametric.commands.CustomBindingConnectorCreateCommand; -import org.eclipse.papyrus.sysml.diagram.parametric.commands.CustomParametricContextLinkReorientCommand; -import org.eclipse.papyrus.sysml.diagram.parametric.commands.ReorientReferenceRelationshipRequestWithGraphical; -import org.eclipse.papyrus.sysml.diagram.parametric.edit.part.CustomBlockCompositeEditPartTN; -import org.eclipse.papyrus.sysml.diagram.parametric.edit.part.CustomConstraintBlockPropertyCompositeEditPart; -import org.eclipse.papyrus.sysml.diagram.parametric.edit.policy.DiagramSemanticEditPolicy; -import org.eclipse.papyrus.sysml.service.types.matcher.PartPropertyMatcher; -import org.eclipse.papyrus.sysml.service.types.matcher.ReferencePropertyMatcher; -import org.eclipse.papyrus.sysml.service.types.matcher.ValuePropertyMatcher; -import org.eclipse.papyrus.uml.diagram.clazz.edit.parts.ContextLinkEditPart; -import org.eclipse.papyrus.uml.diagram.common.edit.part.ConstraintParameterAffixedNodeEditPart; -import org.eclipse.papyrus.uml.diagram.common.edit.part.PortAffixedNodeEditPart; -import org.eclipse.papyrus.uml.tools.utils.UMLUtil; -import org.eclipse.uml2.uml.Class; -import org.eclipse.uml2.uml.Element; -import org.eclipse.uml2.uml.UMLPackage; - -public class CustomParametricSemanticPolicy extends DiagramSemanticEditPolicy { - - @Override - protected Command getSemanticCommand(IEditCommandRequest request) { - if (request instanceof CreateElementRequest) { - if (((CreateElementRequest) request).getElementType().getEClass() == UMLPackage.eINSTANCE.getProperty()) { - // Could create a ConstraintParameter on the diagram frame only if host element is a ConstraintBlock - Element semanticOwner = UMLUtil.resolveUMLElement(this.getHost()); - if (semanticOwner instanceof Class && org.eclipse.uml2.uml.util.UMLUtil.getStereotypeApplication(semanticOwner, ConstraintBlock.class) == null) { - return UnexecutableCommand.INSTANCE; - } - // Could not create Part/Reference/Value - if (request instanceof CreateElementRequest && ((CreateElementRequest) request).getElementType() instanceof SpecializationType) { - IElementMatcher matcher = ((SpecializationType) ((CreateElementRequest) request).getElementType()).getMatcher(); - if (matcher instanceof PartPropertyMatcher) { - return UnexecutableCommand.INSTANCE; - } - if (matcher instanceof ReferencePropertyMatcher) { - return UnexecutableCommand.INSTANCE; - } - if (matcher instanceof ValuePropertyMatcher) { - return UnexecutableCommand.INSTANCE; - } - } - } - } - return super.getSemanticCommand(request); - } - - @Override - protected Command getCreateRelationshipCommand(CreateRelationshipRequest req) { - if (req.getElementType().getEClass() == UMLPackage.eINSTANCE.getConnector()) { - if (getHost() instanceof CustomBlockCompositeEditPartTN) { - return UnexecutableCommand.INSTANCE; - } - if (getHost() instanceof CustomConstraintBlockPropertyCompositeEditPart) { - return UnexecutableCommand.INSTANCE; - } - if (getHost() instanceof ConstraintParameterAffixedNodeEditPart) { - return getGEFWrapper(new CustomBindingConnectorCreateCommand(req)); - } - if (getHost() instanceof PortAffixedNodeEditPart) { - return getGEFWrapper(new CustomBindingConnectorCreateCommand(req)); - } - if (getHost() instanceof BlockPropertyCompositeEditPart) { - return getGEFWrapper(new CustomBindingConnectorCreateCommand(req)); - } - } - return super.getCreateRelationshipCommand(req); - } - - /** - * Method getReorientRefRelationshipTargetCommand. Removes the reference the - * ConnectionEditPart current has an add the new TargetEditPart - * - * @param request - * @return Command - */ - @Override - protected Command getReorientRelationshipSourceCommand( - ReconnectRequest request) { - - EditPart target = request.getTarget(); - if (target instanceof CustomBlockCompositeEditPartTN) { - return UnexecutableCommand.INSTANCE; - } - if (target instanceof CustomConstraintBlockPropertyCompositeEditPart) { - return UnexecutableCommand.INSTANCE; - } - - org.eclipse.gef.ConnectionEditPart connectionEP = (request).getConnectionEditPart(); - - if (connectionEP instanceof ConnectionEditPart) { - if (!((ConnectionEditPart) connectionEP).isSemanticConnection()) { - return null; - } - } - - EditPart sourceEditPart = connectionEP.getSource(); - EditPart targetEditPart = connectionEP.getTarget(); - EObject referenceOwner = ViewUtil - .resolveSemanticElement((View) targetEditPart.getModel()); - EObject oldTarget = ViewUtil - .resolveSemanticElement((View) sourceEditPart.getModel()); - EObject newTarget = ViewUtil - .resolveSemanticElement((View) request.getTarget().getModel()); - - TransactionalEditingDomain editingDomain = ((IGraphicalEditPart) getHost()) - .getEditingDomain(); - - ReorientReferenceRelationshipRequest semRequest = new ReorientReferenceRelationshipRequestWithGraphical( - editingDomain, referenceOwner, newTarget, oldTarget, - ReorientRequest.REORIENT_SOURCE, - request.getTarget(), targetEditPart); - - semRequest.addParameters(request.getExtendedData()); - return getSemanticCommand(semRequest); - } - - - - /** - * Method getReorientRefRelationshipTargetCommand. Removes the reference the - * ConnectionEditPart current has an add the new TargetEditPart - * - * @param request - * @return Command - */ - @Override - protected Command getReorientRelationshipTargetCommand( - ReconnectRequest request) { - - EditPart target = request.getTarget(); - if (target instanceof CustomBlockCompositeEditPartTN) { - return UnexecutableCommand.INSTANCE; - } - if (target instanceof CustomConstraintBlockPropertyCompositeEditPart) { - return UnexecutableCommand.INSTANCE; - } - - org.eclipse.gef.ConnectionEditPart connectionEP = (request).getConnectionEditPart(); - - if (connectionEP instanceof ConnectionEditPart) { - if (!((ConnectionEditPart) connectionEP).isSemanticConnection()) { - return null; - } - } - - EditPart sourceEditPart = connectionEP.getSource(); - EditPart targetEditPart = connectionEP.getTarget(); - EObject referenceOwner = ViewUtil - .resolveSemanticElement((View) sourceEditPart.getModel()); - EObject oldTarget = ViewUtil - .resolveSemanticElement((View) targetEditPart.getModel()); - EObject newTarget = ViewUtil - .resolveSemanticElement((View) request.getTarget().getModel()); - - TransactionalEditingDomain editingDomain = ((IGraphicalEditPart) getHost()) - .getEditingDomain(); - - ReorientReferenceRelationshipRequest semRequest = new ReorientReferenceRelationshipRequestWithGraphical( - editingDomain, referenceOwner, newTarget, oldTarget, - ReorientRequest.REORIENT_TARGET, - sourceEditPart, request.getTarget()); - - semRequest.addParameters(request.getExtendedData()); - - return getSemanticCommand(semRequest); - } - - @Override - protected Command getReorientRefRelationshipSourceCommand( - ReconnectRequest request) { - - if (request.getConnectionEditPart() instanceof ContextLinkEditPart) { - org.eclipse.gef.ConnectionEditPart connectionEP = request.getConnectionEditPart(); - - if (connectionEP instanceof ConnectionEditPart) { - if (!((ConnectionEditPart) connectionEP).isSemanticConnection()) { - return null; - } - } - - EditPart sourceEditPart = connectionEP.getSource(); - EditPart targetEditPart = connectionEP.getTarget(); - EObject referenceOwner = ViewUtil - .resolveSemanticElement((View) targetEditPart.getModel()); - EObject oldTarget = ViewUtil - .resolveSemanticElement((View) sourceEditPart.getModel()); - EObject newTarget = ViewUtil - .resolveSemanticElement((View) request.getTarget().getModel()); - - TransactionalEditingDomain editingDomain = ((IGraphicalEditPart) getHost()) - .getEditingDomain(); - - ReorientReferenceRelationshipRequestWithGraphical semRequest = new ReorientReferenceRelationshipRequestWithGraphical( - editingDomain, referenceOwner, newTarget, oldTarget, - ReorientRequest.REORIENT_SOURCE, - sourceEditPart, targetEditPart); - return getGEFWrapper(new CustomParametricContextLinkReorientCommand(semRequest)); - } - return super.getReorientRefRelationshipTargetCommand(request); - } - - @Override - protected Command getReorientRefRelationshipTargetCommand( - ReconnectRequest request) { - if (request.getConnectionEditPart() instanceof ContextLinkEditPart) { - org.eclipse.gef.ConnectionEditPart connectionEP = request.getConnectionEditPart(); - - if (connectionEP instanceof ConnectionEditPart) { - if (!((ConnectionEditPart) connectionEP).isSemanticConnection()) { - return null; - } - } - - EditPart sourceEditPart = connectionEP.getSource(); - EditPart targetEditPart = connectionEP.getTarget(); - EObject referenceOwner = ViewUtil - .resolveSemanticElement((View) sourceEditPart.getModel()); - EObject oldTarget = ViewUtil - .resolveSemanticElement((View) targetEditPart.getModel()); - EObject newTarget = ViewUtil - .resolveSemanticElement((View) request.getTarget().getModel()); - - TransactionalEditingDomain editingDomain = ((IGraphicalEditPart) getHost()) - .getEditingDomain(); - - ReorientReferenceRelationshipRequestWithGraphical semRequest = new ReorientReferenceRelationshipRequestWithGraphical( - editingDomain, referenceOwner, newTarget, oldTarget, - ReorientRequest.REORIENT_TARGET, - sourceEditPart, targetEditPart); - return getGEFWrapper(new CustomParametricContextLinkReorientCommand(semRequest)); - } - return super.getReorientRefRelationshipTargetCommand(request); - } - - -} diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/policies/CustomStructureClassifierDropEditPolicy.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/policies/CustomStructureClassifierDropEditPolicy.java deleted file mode 100644 index 2b1881ab51c..00000000000 --- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/policies/CustomStructureClassifierDropEditPolicy.java +++ /dev/null @@ -1,167 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Régis CHEVREL: chevrel.regis <at> gmail.com - * CEA LIST - Initial API and implementation - * - *****************************************************************************/ -package org.eclipse.papyrus.sysml.diagram.parametric.policies; - -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.transaction.RunnableWithResult; -import org.eclipse.gef.commands.Command; -import org.eclipse.gef.commands.UnexecutableCommand; -import org.eclipse.gmf.runtime.common.core.command.ICommand; -import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil; -import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy; -import org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart; -import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart; -import org.eclipse.gmf.runtime.diagram.ui.requests.DropObjectsRequest; -import org.eclipse.gmf.runtime.notation.Diagram; -import org.eclipse.gmf.runtime.notation.View; -import org.eclipse.papyrus.infra.gmfdiag.common.commands.SelectAndExecuteCommand; -import org.eclipse.papyrus.sysml.constraints.ConstraintBlock; -import org.eclipse.papyrus.sysml.constraints.ConstraintProperty; -import org.eclipse.papyrus.sysml.diagram.parametric.utils.BlockDropHelper; -import org.eclipse.papyrus.sysml.service.types.element.SysMLElementTypes; -import org.eclipse.papyrus.uml.service.types.element.UMLElementTypes; -import org.eclipse.swt.widgets.Display; -import org.eclipse.ui.PlatformUI; -import org.eclipse.uml2.uml.Element; -import org.eclipse.uml2.uml.util.UMLUtil; - -/** - * <pre> - * Customization of the DND edit policy for the StructureClassifier compartments, that enables the direct - * creation of typed Part, Reference, ConstraintProperty, Value, ActorPart or Property by dragging types in a Block structure compartment. - * </pre> - */ -public class CustomStructureClassifierDropEditPolicy extends CustomDragDropEditPolicy { - - /** Default constructor */ - public CustomStructureClassifierDropEditPolicy() { - super(); - } - - /** - * {@inheritedDoc}. - */ - @Override - public Command getDropObjectsCommand(DropObjectsRequest dropRequest) { - - BlockDropHelper helper = new BlockDropHelper(getEditingDomain()); - - // Single drop management possible drop action list can be proposed - if (dropRequest.getObjects().size() == 1) { - - // List of available drop commands - final List<Command> commandChoice = new ArrayList<Command>(); - - // 1. Try to create a Part typed by the dropped object - Command dropAsTypedPart = helper.getDropAsStructureItem(dropRequest, (GraphicalEditPart) getHost(), SysMLElementTypes.PART_PROPERTY); - if ((dropAsTypedPart != null) && (dropAsTypedPart.canExecute())) { - commandChoice.add(dropAsTypedPart); - } - - // 2. Try to create a Reference typed by the dropped object - Command dropAsTypedReference = helper.getDropAsStructureItem(dropRequest, (GraphicalEditPart) getHost(), SysMLElementTypes.REFERENCE_PROPERTY); - if ((dropAsTypedReference != null) && (dropAsTypedReference.canExecute())) { - commandChoice.add(dropAsTypedReference); - } - - // 3. Try to create an ActorPart typed by the dropped object - Command dropAsTypedActorPart = helper.getDropAsStructureItem(dropRequest, (GraphicalEditPart) getHost(), SysMLElementTypes.ACTOR_PART_PROPERTY); - if ((dropAsTypedActorPart != null) && (dropAsTypedActorPart.canExecute())) { - commandChoice.add(dropAsTypedActorPart); - } - - // 4. Try to create a Value typed by the dropped object - Command dropAsTypedValue = helper.getDropAsStructureItem(dropRequest, (GraphicalEditPart) getHost(), SysMLElementTypes.VALUE_PROPERTY); - if ((dropAsTypedValue != null) && (dropAsTypedValue.canExecute())) { - commandChoice.add(dropAsTypedValue); - } - - // 5. Try to create a Property typed by the dropped object - Command dropAsTypedProperty = helper.getDropAsStructureItem(dropRequest, (GraphicalEditPart) getHost(), UMLElementTypes.PROPERTY); - if ((dropAsTypedProperty != null) && (dropAsTypedProperty.canExecute())) { - commandChoice.add(dropAsTypedProperty); - } - - // 6. Try to create a ConstraintProperty typed by the dropped object - Command dropAsTypedConstraintProperty = helper.getDropAsStructureItem(dropRequest, (GraphicalEditPart) getHost(), SysMLElementTypes.CONSTRAINT_PROPERTY); - if ((dropAsTypedConstraintProperty != null) && (dropAsTypedConstraintProperty.canExecute())) { - commandChoice.add(dropAsTypedConstraintProperty); - } - - // 7. Build default drop command (show view of the dropped object) - Command defaultDropCommand = super.getDropObjectsCommand(dropRequest); - if ((defaultDropCommand != null) && (defaultDropCommand.canExecute())) { - defaultDropCommand.setLabel("Default drop (Show dropped object in diagram)"); - commandChoice.add(defaultDropCommand); - } - - // Prepare the selection command (if several command are available) or return the drop command - if (commandChoice.size() > 1) { - RunnableWithResult<ICommand> runnable; - Display.getDefault().syncExec(runnable = new RunnableWithResult.Impl<ICommand>() { - - public void run() { - setResult(new SelectAndExecuteCommand("Select drop action for ", PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), commandChoice)); - } - }); - - ICommand selectCommand = runnable.getResult(); - - return new ICommandProxy(selectCommand); - - } else if (commandChoice.size() == 1) { - return commandChoice.get(0); - } - - // else (command choice is empty) - return UnexecutableCommand.INSTANCE; - - } - - return super.getDropObjectsCommand(dropRequest); - } - - /** - * {@inheritDoc} - */ - @Override - protected View getReferenceViewForConnectorEnd() { - return ViewUtil.getContainerView(super.getReferenceViewForConnectorEnd()); - } - - @Override - protected ICommand getDropObjectCommand(DropObjectsRequest dropRequest, EObject droppedObject) { - View dropTargetView = ((IGraphicalEditPart) getHost()).getNotationView(); - EObject dropTargetElement = dropTargetView.getElement(); - - EObject diagramOwner = getDiagramOwner(dropTargetView); - if (UMLUtil.getStereotypeApplication((Element) diagramOwner, ConstraintBlock.class) != null) { - // ConstraintBlock - if (UMLUtil.getStereotypeApplication((Element) dropTargetElement, ConstraintProperty.class) == null) { - // only ConstraintProperty can be dropped in structure compartment of a diagram owned by a ConstraintBlock - return org.eclipse.gmf.runtime.common.core.command.UnexecutableCommand.INSTANCE; - } - } - return super.getDropObjectCommand(dropRequest, droppedObject); - } - - private EObject getDiagramOwner(View dropTargetView) { - Diagram diagram = dropTargetView.getDiagram(); - EObject diagramOwer = diagram.getElement(); - return diagramOwer; - } -} diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/policies/CustomStructureCompartmentSemanticEditPolicy.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/policies/CustomStructureCompartmentSemanticEditPolicy.java deleted file mode 100644 index 1b6fddafcef..00000000000 --- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/policies/CustomStructureCompartmentSemanticEditPolicy.java +++ /dev/null @@ -1,65 +0,0 @@ -/*****************************************************************************
- * Copyright (c) 2013 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Régis CHEVREL: chevrel.regis <at> gmail.com
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.parametric.policies;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.commands.UnexecutableCommand;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.emf.type.core.IElementType;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.sysml.constraints.ConstraintBlock;
-import org.eclipse.papyrus.sysml.diagram.common.edit.policy.StructureCompartmentSemanticEditPolicy;
-import org.eclipse.papyrus.sysml.service.types.element.SysMLElementTypes;
-import org.eclipse.papyrus.uml.service.types.element.UMLElementTypes;
-import org.eclipse.uml2.uml.Element;
-import org.eclipse.uml2.uml.Property;
-import org.eclipse.uml2.uml.util.UMLUtil;
-
-public class CustomStructureCompartmentSemanticEditPolicy extends
- StructureCompartmentSemanticEditPolicy {
-
- @Override
- protected Command getCreateCommand(CreateElementRequest req) {
-
- View dropTargetView = ((IGraphicalEditPart) getHost()).getNotationView();
- EObject eContainer = dropTargetView.eContainer();
- Element parent = null;
- if (eContainer != null && eContainer instanceof View) {
- parent = (Element) ((View) eContainer).getElement();
- }
- if (parent instanceof Property) {
- parent = ((Property) parent).getType();
- }
-
- if (parent != null) {
- if (UMLUtil.getStereotypeApplication(parent, ConstraintBlock.class) != null) {
- IElementType elementType = req.getElementType();
- if (elementType != UMLElementTypes.CONSTRAINT
- && elementType != UMLElementTypes.COMMENT) {
- // ConstraintBlock
- if (elementType != SysMLElementTypes.CONSTRAINT_PROPERTY) {
- // only ConstraintProperty can be dropped in structure
- // compartment of a diagram owned by a ConstraintBlock
- // (except common Comment and Constraint)
- return UnexecutableCommand.INSTANCE;
- }
- }
- }
- }
-
- return super.getCreateCommand(req);
- }
-}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/policies/StructureClassifierDropEditPolicy.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/policies/StructureClassifierDropEditPolicy.java deleted file mode 100644 index 2fda6946d81..00000000000 --- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/policies/StructureClassifierDropEditPolicy.java +++ /dev/null @@ -1,139 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013, 2016 CEA LIST, Esterel Technologies SAS 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: - * Régis CHEVREL: chevrel.regis <at> gmail.com - * CEA LIST - Initial API and implementation - * Alain Le Guennec (Esterel Technologies SAS) - bug 497400 - * - *****************************************************************************/ -package org.eclipse.papyrus.sysml.diagram.parametric.policies; - -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.emf.transaction.RunnableWithResult; -import org.eclipse.gef.commands.Command; -import org.eclipse.gef.commands.UnexecutableCommand; -import org.eclipse.gmf.runtime.common.core.command.ICommand; -import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil; -import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy; -import org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart; -import org.eclipse.gmf.runtime.diagram.ui.requests.DropObjectsRequest; -import org.eclipse.gmf.runtime.notation.View; -import org.eclipse.papyrus.infra.gmfdiag.common.commands.SelectAndExecuteCommand; -import org.eclipse.papyrus.sysml.diagram.parametric.utils.BlockDropHelper; -import org.eclipse.papyrus.sysml.service.types.element.SysMLElementTypes; -import org.eclipse.papyrus.uml.service.types.element.UMLElementTypes; -import org.eclipse.swt.widgets.Display; -import org.eclipse.ui.PlatformUI; - -/** - * <pre> - * Customization of the DND edit policy for the StructureClassifier compartments, that enables the direct - * creation of typed Part, Reference, Value, ActorPart or Property by dragging types in a Block structure compartment. - * </pre> - */ -public class StructureClassifierDropEditPolicy extends CustomDragDropEditPolicy { - - /** Default constructor */ - public StructureClassifierDropEditPolicy() { - super(); - } - - /** - * {@inheritedDoc}. - */ - @Override - public Command getDropObjectsCommand(DropObjectsRequest dropRequest) { - - BlockDropHelper helper = new BlockDropHelper(getEditingDomain()); - - // Single drop management possible drop action list can be proposed - if (dropRequest.getObjects().size() == 1) { - - // List of available drop commands - final List<Command> commandChoice = new ArrayList<Command>(); - - // 1. Try to create a Part typed by the dropped object - Command dropAsTypedPart = helper.getDropAsStructureItem(dropRequest, (GraphicalEditPart) getHost(), SysMLElementTypes.PART_PROPERTY); - if ((dropAsTypedPart != null) && (dropAsTypedPart.canExecute())) { - commandChoice.add(dropAsTypedPart); - } - - // 2. Try to create a Reference typed by the dropped object - Command dropAsTypedReference = helper.getDropAsStructureItem(dropRequest, (GraphicalEditPart) getHost(), SysMLElementTypes.REFERENCE_PROPERTY); - if ((dropAsTypedReference != null) && (dropAsTypedReference.canExecute())) { - commandChoice.add(dropAsTypedReference); - } - - // 3. Try to create an ActorPart typed by the dropped object - Command dropAsTypedActorPart = helper.getDropAsStructureItem(dropRequest, (GraphicalEditPart) getHost(), SysMLElementTypes.ACTOR_PART_PROPERTY); - if ((dropAsTypedActorPart != null) && (dropAsTypedActorPart.canExecute())) { - commandChoice.add(dropAsTypedActorPart); - } - - // 4. Try to create a Value typed by the dropped object - Command dropAsTypedValue = helper.getDropAsStructureItem(dropRequest, (GraphicalEditPart) getHost(), SysMLElementTypes.VALUE_PROPERTY); - if ((dropAsTypedValue != null) && (dropAsTypedValue.canExecute())) { - commandChoice.add(dropAsTypedValue); - } - - // 5. Try to create a Property typed by the dropped object - Command dropAsTypedProperty = helper.getDropAsStructureItem(dropRequest, (GraphicalEditPart) getHost(), UMLElementTypes.PROPERTY); - if ((dropAsTypedProperty != null) && (dropAsTypedProperty.canExecute())) { - commandChoice.add(dropAsTypedProperty); - } - - // 6. Try to create a ConstraintProperty typed by the dropped object - Command dropAsTypedConstraintProperty = helper.getDropAsStructureItem(dropRequest, (GraphicalEditPart) getHost(), SysMLElementTypes.CONSTRAINT_PROPERTY); - if ((dropAsTypedConstraintProperty != null) && (dropAsTypedConstraintProperty.canExecute())) { - commandChoice.add(dropAsTypedConstraintProperty); - } - - // 7. Build default drop command (show view of the dropped object) - Command defaultDropCommand = super.getDropObjectsCommand(dropRequest); - if ((defaultDropCommand != null) && (defaultDropCommand.canExecute())) { - defaultDropCommand.setLabel("Default drop (Show dropped object in diagram)"); - commandChoice.add(defaultDropCommand); - } - - // Prepare the selection command (if several command are available) or return the drop command - if (commandChoice.size() > 1) { - RunnableWithResult<ICommand> runnable; - Display.getDefault().syncExec(runnable = new RunnableWithResult.Impl<ICommand>() { - - public void run() { - setResult(new SelectAndExecuteCommand("Select drop action for ", PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), commandChoice)); - } - }); - - ICommand selectCommand = runnable.getResult(); - - return new ICommandProxy(selectCommand); - - } else if (commandChoice.size() == 1) { - return commandChoice.get(0); - } - - // else (command choice is empty) - return UnexecutableCommand.INSTANCE; - - } - - return super.getDropObjectsCommand(dropRequest); - } - - /** - * {@inheritDoc} - */ - @Override - protected View getReferenceViewForConnectorEnd() { - return ViewUtil.getContainerView(super.getReferenceViewForConnectorEnd()); - } -} diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/preferences/BlockPropertyCompositePreferencePage.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/preferences/BlockPropertyCompositePreferencePage.java deleted file mode 100644 index bbdd7af189a..00000000000 --- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/preferences/BlockPropertyCompositePreferencePage.java +++ /dev/null @@ -1,42 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Régis CHEVREL: chevrel.regis <at> gmail.com - * CEA LIST - Initial API and implementation - * - *****************************************************************************/ -package org.eclipse.papyrus.sysml.diagram.parametric.preferences; - -import org.eclipse.gmf.runtime.common.ui.preferences.AbstractPreferencePage; -import org.eclipse.jface.preference.IPreferenceStore; -import org.eclipse.swt.widgets.Composite; - -public class BlockPropertyCompositePreferencePage extends AbstractPreferencePage { - - /** Constructor */ - public BlockPropertyCompositePreferencePage() { - super(); - } - - /** Default preferences initializer */ - public static void initDefaults(IPreferenceStore store) { - CustomBlockPropertyCompositePreferencePage.initDefaults(store); - /* CustomNestedBlockPropertyCompositePreferencePage.initDefaults(store); */ - } - - @Override - protected void addFields(Composite parent) { - - } - - @Override - protected void initHelp() { - - } -} diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/preferences/ConstraintParameterAsBorderItemPreferencePage.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/preferences/ConstraintParameterAsBorderItemPreferencePage.java deleted file mode 100644 index f47329a8d25..00000000000 --- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/preferences/ConstraintParameterAsBorderItemPreferencePage.java +++ /dev/null @@ -1,44 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * R�gis CHEVREL: chevrel.regis <at> gmail.com - * CEA LIST - Initial API and implementation - * - *****************************************************************************/ -package org.eclipse.papyrus.sysml.diagram.parametric.preferences; - -import org.eclipse.jface.preference.IPreferenceStore; -import org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper; -import org.eclipse.papyrus.sysml.diagram.parametric.provider.ElementTypes; -import org.eclipse.papyrus.uml.diagram.common.utils.UMLGraphicalTypes; - -/** - * {@link Port} preference page. - */ -public class ConstraintParameterAsBorderItemPreferencePage extends ParametricDiagramNodePreferencePage { - - /** Constant key to access preferences */ - public static String prefKey = ElementTypes.DIAGRAM_ID + "_" + UMLGraphicalTypes.SHAPE_UML_PROPERTY_AS_AFFIXED_ID; //$NON-NLS-1$ - - public static String prefLabelKey = prefKey + "-" + UMLGraphicalTypes.AFFIXEDLABEL_UML_PORT_LABEL_ID; //$NON-NLS-1$ - - /** Constructor */ - public ConstraintParameterAsBorderItemPreferencePage() { - super(); - setPreferenceKey(ElementTypes.DIAGRAM_ID + "_" + UMLGraphicalTypes.SHAPE_UML_PROPERTY_AS_AFFIXED_ID); //$NON-NLS-1$ - } - - /** Default preferences initializer */ - public static void initDefaults(IPreferenceStore store) { - store.setDefault(PreferencesConstantsHelper.getElementConstant(prefKey, PreferencesConstantsHelper.WIDTH), 20); - store.setDefault(PreferencesConstantsHelper.getElementConstant(prefKey, PreferencesConstantsHelper.HEIGHT), 20); - store.setDefault(PreferencesConstantsHelper.getElementConstant(prefKey, PreferencesConstantsHelper.ELEMENTICON), 0); - } - -} diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/preferences/CustomBlockPropertyCompositePreferencePage.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/preferences/CustomBlockPropertyCompositePreferencePage.java deleted file mode 100644 index 2ffc26dbd2c..00000000000 --- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/preferences/CustomBlockPropertyCompositePreferencePage.java +++ /dev/null @@ -1,105 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * R�gis CHEVREL: chevrel.regis <at> gmail.com - * CEA LIST - Initial API and implementation - * - *****************************************************************************/ -package org.eclipse.papyrus.sysml.diagram.parametric.preferences; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; - -import org.eclipse.jface.preference.IPreferenceStore; -import org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper; -import org.eclipse.papyrus.sysml.diagram.common.utils.SysMLGraphicalTypes; -import org.eclipse.papyrus.sysml.diagram.parametric.provider.ElementTypes; -import org.eclipse.papyrus.uml.diagram.common.utils.UMLGraphicalTypes; - -/** - * Preference page for Part and References. - */ -public class CustomBlockPropertyCompositePreferencePage extends ParametricDiagramNodePreferencePage { - - /** Constant key to access preferences */ - public static String prefKey = ElementTypes.DIAGRAM_ID + "_" + SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID; //$NON-NLS-1$ - - public static String prefLabelKey = prefKey + "-" + UMLGraphicalTypes.LABEL_UML_PROPERTY_LABEL_ID; //$NON-NLS-1$ - - /** The compartments default visibility for preferences */ - public static final Map<String, Boolean> compartmentDefaultVisibilityMap; - - /** The compartment titles default visibility for preferences */ - public static final Map<String, Boolean> compartmentTitleDefaultVisibilityMap; - - /** Static attribute initialization */ - static { - compartmentDefaultVisibilityMap = new LinkedHashMap<String, Boolean>(); - compartmentDefaultVisibilityMap.put("structure", Boolean.TRUE); //$NON-NLS-1$ - - compartmentTitleDefaultVisibilityMap = new LinkedHashMap<String, Boolean>(); - compartmentTitleDefaultVisibilityMap.put("structure", Boolean.TRUE); //$NON-NLS-1$ - - // Start of user code custom static initializations - compartmentTitleDefaultVisibilityMap.remove("structure"); //$NON-NLS-1$ - compartmentTitleDefaultVisibilityMap.put("structure", Boolean.FALSE); //$NON-NLS-1$ - // End of user code - - Collections.unmodifiableMap(compartmentDefaultVisibilityMap); - Collections.unmodifiableMap(compartmentTitleDefaultVisibilityMap); - } - - /** Constructor */ - public CustomBlockPropertyCompositePreferencePage() { - super(); - setPreferenceKey(ElementTypes.DIAGRAM_ID + "_" + SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID); //$NON-NLS-1$ - } - - /** Default preferences initializer */ - public static void initDefaults(IPreferenceStore store) { - // Start of user code custom default initializations - store.setDefault(PreferencesConstantsHelper.getElementConstant(prefKey, PreferencesConstantsHelper.WIDTH), 200); - store.setDefault(PreferencesConstantsHelper.getElementConstant(prefKey, PreferencesConstantsHelper.HEIGHT), 100); - // End of user code - - // Initialize default visibility for compartments in preference page. - for (String compartmentName : compartmentDefaultVisibilityMap.keySet()) { - String showCompartmentKey = PreferencesConstantsHelper.getCompartmentElementConstant(prefKey, compartmentName, PreferencesConstantsHelper.COMPARTMENT_VISIBILITY); - store.setDefault(showCompartmentKey, compartmentDefaultVisibilityMap.get(compartmentName)); - } - - // Initialize default title visibility for compartments in preference page. - for (String compartmentName : compartmentTitleDefaultVisibilityMap.keySet()) { - String showCompartmentTitleKey = PreferencesConstantsHelper.getCompartmentElementConstant(prefKey, compartmentName, PreferencesConstantsHelper.COMPARTMENT_NAME_VISIBILITY); - store.setDefault(showCompartmentTitleKey, compartmentTitleDefaultVisibilityMap.get(compartmentName)); - } - } - - /** - * {@inheritDoc} - */ - @Override - protected void initializeCompartmentNamesList() { - for (String name : compartmentDefaultVisibilityMap.keySet()) { - this.compartmentNamesList.add(name); - } - } - - /** - * {@inheritDoc} - */ - @Override - protected void initializeCompartmentTitlesList() { - for (String name : compartmentTitleDefaultVisibilityMap.keySet()) { - this.compartmentTitlesList.add(name); - } - } - -} diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/preferences/CustomConstraintPropertyCompositePreferencePage.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/preferences/CustomConstraintPropertyCompositePreferencePage.java deleted file mode 100644 index 7634ef678be..00000000000 --- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/preferences/CustomConstraintPropertyCompositePreferencePage.java +++ /dev/null @@ -1,103 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * R�gis CHEVREL: chevrel.regis <at> gmail.com - * CEA LIST - Initial API and implementation - * - *****************************************************************************/ -package org.eclipse.papyrus.sysml.diagram.parametric.preferences; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; - -import org.eclipse.jface.preference.IPreferenceStore; -import org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper; -import org.eclipse.papyrus.sysml.diagram.common.utils.SysMLGraphicalTypes; -import org.eclipse.papyrus.sysml.diagram.parametric.provider.ElementTypes; -import org.eclipse.papyrus.uml.diagram.common.utils.UMLGraphicalTypes; - -/** - * Preference page for Part and References. - */ -public class CustomConstraintPropertyCompositePreferencePage extends ParametricDiagramNodePreferencePage { - - /** Constant key to access preferences */ - public static String prefKey = ElementTypes.DIAGRAM_ID + "_" + SysMLGraphicalTypes.SHAPE_SYSML_CONSTRAINTBLOCKPROPERTY_AS_COMPOSITE_ID; //$NON-NLS-1$ - - public static String prefLabelKey = prefKey + "-" + UMLGraphicalTypes.LABEL_UML_PROPERTY_LABEL_ID; //$NON-NLS-1$ - - /** The compartments default visibility for preferences */ - public static final Map<String, Boolean> compartmentDefaultVisibilityMap; - - /** The compartment titles default visibility for preferences */ - public static final Map<String, Boolean> compartmentTitleDefaultVisibilityMap; - - /** Static attribute initialization */ - static { - compartmentDefaultVisibilityMap = new LinkedHashMap<String, Boolean>(); - compartmentDefaultVisibilityMap.put("structure", Boolean.TRUE); //$NON-NLS-1$ - - compartmentTitleDefaultVisibilityMap = new LinkedHashMap<String, Boolean>(); - compartmentTitleDefaultVisibilityMap.put("structure", Boolean.TRUE); //$NON-NLS-1$ - - // Start of user code custom static initializations - compartmentTitleDefaultVisibilityMap.remove("structure"); //$NON-NLS-1$ - compartmentTitleDefaultVisibilityMap.put("structure", Boolean.FALSE); //$NON-NLS-1$ - // End of user code - - Collections.unmodifiableMap(compartmentDefaultVisibilityMap); - Collections.unmodifiableMap(compartmentTitleDefaultVisibilityMap); - } - - /** Constructor */ - public CustomConstraintPropertyCompositePreferencePage() { - super(); - setPreferenceKey(ElementTypes.DIAGRAM_ID + "_" + SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID); //$NON-NLS-1$ - } - - /** Default preferences initializer */ - public static void initDefaults(IPreferenceStore store) { - // Start of user code custom default initializations - // End of user code - - // Initialize default visibility for compartments in preference page. - for (String compartmentName : compartmentDefaultVisibilityMap.keySet()) { - String showCompartmentKey = PreferencesConstantsHelper.getCompartmentElementConstant(prefKey, compartmentName, PreferencesConstantsHelper.COMPARTMENT_VISIBILITY); - store.setDefault(showCompartmentKey, compartmentDefaultVisibilityMap.get(compartmentName)); - } - - // Initialize default title visibility for compartments in preference page. - for (String compartmentName : compartmentTitleDefaultVisibilityMap.keySet()) { - String showCompartmentTitleKey = PreferencesConstantsHelper.getCompartmentElementConstant(prefKey, compartmentName, PreferencesConstantsHelper.COMPARTMENT_NAME_VISIBILITY); - store.setDefault(showCompartmentTitleKey, compartmentTitleDefaultVisibilityMap.get(compartmentName)); - } - } - - /** - * {@inheritDoc} - */ - @Override - protected void initializeCompartmentNamesList() { - for (String name : compartmentDefaultVisibilityMap.keySet()) { - this.compartmentNamesList.add(name); - } - } - - /** - * {@inheritDoc} - */ - @Override - protected void initializeCompartmentTitlesList() { - for (String name : compartmentTitleDefaultVisibilityMap.keySet()) { - this.compartmentTitlesList.add(name); - } - } - -} diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/preferences/CustomPreferenceInitializer.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/preferences/CustomPreferenceInitializer.java deleted file mode 100644 index 7987ab758c1..00000000000 --- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/preferences/CustomPreferenceInitializer.java +++ /dev/null @@ -1,75 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * R�gis CHEVREL: chevrel.regis <at> gmail.com - * CEA LIST - Initial API and implementation - * - *****************************************************************************/ -package org.eclipse.papyrus.sysml.diagram.parametric.preferences; - -import org.eclipse.jface.preference.IPreferenceStore; -import org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper; -import org.eclipse.papyrus.sysml.diagram.parametric.Activator; -import org.eclipse.papyrus.sysml.diagram.parametric.provider.ElementTypes; -import org.eclipse.papyrus.uml.diagram.common.utils.UMLGraphicalTypes; - -/** - * Custom preferences initializer. - */ -public class CustomPreferenceInitializer extends ParametricDiagramPreferenceInitializer { - - @Override - protected IPreferenceStore getPreferenceStore() { - return Activator.getInstance().getPreferenceStore(); - } - - @Override - public void initializeDefaultPreferences() { - super.initializeDefaultPreferences(); - - IPreferenceStore store = getPreferenceStore(); - - ConstraintParameterAsBorderItemPreferencePage.initDefaults(store); - BlockPropertyCompositePreferencePage.initDefaults(store); - CustomConstraintPropertyCompositePreferencePage.initDefaults(store); - - // Initialize default positions for labels. - initDefaultPosition(UMLGraphicalTypes.LINK_UML_DEPENDENCY_ID, UMLGraphicalTypes.LINKLABEL_UML_NAMEDELEMENT_NAME_ID, 0, -10); - initDefaultPosition(UMLGraphicalTypes.LINK_UML_DEPENDENCY_ID, UMLGraphicalTypes.LINKLABEL_UML_APPLIEDSTEREOTYPE_ID, 0, -30); - - initDefaultPosition(UMLGraphicalTypes.LINK_UML_CONNECTOR_ID, UMLGraphicalTypes.LINKLABEL_UML_CONNECTOR_LABEL_ID, 0, -10); - initDefaultPosition(UMLGraphicalTypes.LINK_UML_CONNECTOR_ID, UMLGraphicalTypes.LINKLABEL_UML_APPLIEDSTEREOTYPE_ID, 0, -30); - initDefaultPosition(UMLGraphicalTypes.LINK_UML_CONNECTOR_ID, UMLGraphicalTypes.LINKLABEL_UML_CONNECTOR_SOURCE_MULTIPLICITY_ID, 0, 10); - initDefaultPosition(UMLGraphicalTypes.LINK_UML_CONNECTOR_ID, UMLGraphicalTypes.LINKLABEL_UML_CONNECTOR_TARGET_MULTIPLICITY_ID, 0, 10); - - initDefaultPosition(UMLGraphicalTypes.SHAPE_UML_PROPERTY_AS_AFFIXED_ID, UMLGraphicalTypes.AFFIXEDLABEL_UML_PORT_LABEL_ID, -40, -15); - initDefaultPosition(UMLGraphicalTypes.SHAPE_UML_PROPERTY_AS_AFFIXED_ID, UMLGraphicalTypes.AFFIXEDLABEL_UML_APPLIEDSTEREOTYPE_ID, 30, -20); - - } - - /** - * Initialize default position of a link label in preferences. - * - * @param parentGraphicalType - * the graphical type of the view owning the label - * @param graphicalType - * the graphical type of the label - * @param x - * @param y - */ - protected void initDefaultPosition(String parentGraphicalType, String graphicalType, int x, int y) { - IPreferenceStore store = getPreferenceStore(); - - String xKey = PreferencesConstantsHelper.getElementConstant(ElementTypes.DIAGRAM_ID + "_" + parentGraphicalType + "-" + graphicalType, PreferencesConstantsHelper.LOCATION_X); - String yKey = PreferencesConstantsHelper.getElementConstant(ElementTypes.DIAGRAM_ID + "_" + parentGraphicalType + "-" + graphicalType, PreferencesConstantsHelper.LOCATION_Y); - - store.setDefault(xKey, x); - store.setDefault(yKey, y); - } -} diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/provider/CustomEditPolicyProvider.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/provider/CustomEditPolicyProvider.java deleted file mode 100644 index 62f6b2a58b4..00000000000 --- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/provider/CustomEditPolicyProvider.java +++ /dev/null @@ -1,187 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * R�gis CHEVREL: chevrel.regis <at> gmail.com - * CEA LIST - Initial API and implementation - * - *****************************************************************************/ -package org.eclipse.papyrus.sysml.diagram.parametric.provider; - -import org.eclipse.gef.EditPart; -import org.eclipse.gef.EditPolicy; -import org.eclipse.gmf.runtime.common.core.service.IOperation; -import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart; -import org.eclipse.gmf.runtime.diagram.ui.editparts.ResizableCompartmentEditPart; -import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles; -import org.eclipse.gmf.runtime.diagram.ui.services.editpolicy.CreateEditPoliciesOperation; -import org.eclipse.papyrus.gmf.diagram.common.edit.policy.DefaultXYLayoutEditPolicy; -import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.DefaultCreationEditPolicy; -import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.DefaultGraphicalNodeEditPolicy; -import org.eclipse.papyrus.sysml.diagram.common.edit.part.BlockPropertyCompositeEditPart; -import org.eclipse.papyrus.sysml.diagram.common.edit.part.BlockPropertyStructureCompartmentEditPart; -import org.eclipse.papyrus.sysml.diagram.common.edit.part.StructureCompartmentEditPart; -import org.eclipse.papyrus.sysml.diagram.common.edit.policy.CustomDuplicatePasteEditPolicy; -import org.eclipse.papyrus.sysml.diagram.internalblock.edit.policy.CustomBlockCompositeSemanticEditPolicy; -import org.eclipse.papyrus.sysml.diagram.internalblock.edit.policy.CustomDefaultSemanticEditPolicy; -import org.eclipse.papyrus.sysml.diagram.internalblock.edit.policy.CustomDiagramDropEditPolicy; -import org.eclipse.papyrus.sysml.diagram.internalblock.edit.policy.CustomDragDropEditPolicy; -import org.eclipse.papyrus.sysml.diagram.internalblock.edit.policy.TypedElementDropEditPolicy; -import org.eclipse.papyrus.sysml.diagram.parametric.edit.part.CustomBlockCompositeEditPartTN; -import org.eclipse.papyrus.sysml.diagram.parametric.edit.part.CustomConstraintBlockPropertyCompositeEditPart; -import org.eclipse.papyrus.sysml.diagram.parametric.edit.part.ParametricDiagramEditPart; -import org.eclipse.papyrus.sysml.diagram.parametric.policies.CustomBlockCompositeDropEditPolicy; -import org.eclipse.papyrus.sysml.diagram.parametric.policies.CustomBlockPropertyCompositeDropEditPolicy; -import org.eclipse.papyrus.sysml.diagram.parametric.policies.CustomBlockPropertyStructureCompartmentEditPartDropEditPolicy; -import org.eclipse.papyrus.sysml.diagram.parametric.policies.CustomBlockPropertyStructureCompartmentSemanticEditPolicy; -import org.eclipse.papyrus.sysml.diagram.parametric.policies.CustomParametricSemanticPolicy; -import org.eclipse.papyrus.sysml.diagram.parametric.policies.CustomStructureClassifierDropEditPolicy; -import org.eclipse.papyrus.sysml.diagram.parametric.policies.CustomStructureCompartmentSemanticEditPolicy; -import org.eclipse.papyrus.uml.diagram.common.edit.part.AbstractElementBorderEditPart; -import org.eclipse.papyrus.uml.diagram.common.edit.part.AbstractElementEditPart; -import org.eclipse.papyrus.uml.diagram.common.edit.part.AbstractElementLinkEditPart; -import org.eclipse.papyrus.uml.diagram.common.edit.part.ConnectorEditPart; -import org.eclipse.papyrus.uml.diagram.common.edit.part.ConstraintParameterAffixedNodeEditPart; -import org.eclipse.papyrus.uml.diagram.common.edit.part.DependencyEditPart; -import org.eclipse.papyrus.uml.diagram.common.edit.policy.StructuredClassifierCreationEditPolicy; -import org.eclipse.papyrus.uml.diagram.common.editpolicies.PasteEditPolicy; -import org.eclipse.papyrus.uml.diagram.composite.edit.parts.CommentEditPart; -import org.eclipse.papyrus.uml.diagram.composite.edit.parts.CommentEditPartCN; -import org.eclipse.papyrus.uml.diagram.composite.edit.parts.ConstraintEditPart; -import org.eclipse.papyrus.uml.diagram.composite.edit.parts.ConstraintEditPartCN; -import org.eclipse.papyrus.uml.diagram.composite.edit.parts.ConstraintSpecificationEditPartCN; - -/** - * Custom edit policy provider. - */ -public class CustomEditPolicyProvider extends ParametricDiagramEditPolicyProvider { - - @Override - public boolean provides(IOperation operation) { - - CreateEditPoliciesOperation epOperation = (CreateEditPoliciesOperation) operation; - if (!(epOperation.getEditPart() instanceof IGraphicalEditPart)) { - return false; - } - - // Make sure this concern Parametric Diagram only - IGraphicalEditPart gep = (IGraphicalEditPart) epOperation.getEditPart(); - String diagramType = gep.getNotationView().getDiagram().getType(); - if (!ElementTypes.DIAGRAM_ID.equals(diagramType)) { - return false; - } - - // provides for the main diagram edit part - if (gep instanceof ParametricDiagramEditPart) { - return true; - } - - // Provides for edit parts that represent nodes in Internal Block diagram - if (gep instanceof AbstractElementEditPart) { - return true; - } - if (gep instanceof AbstractElementBorderEditPart) { - return true; - } - - // Provides for edit parts that represent edges in Internal Block diagram - if (gep instanceof AbstractElementLinkEditPart) { - return true; - } - - if (gep instanceof ResizableCompartmentEditPart) { - return true; - } - - if (gep instanceof ConstraintSpecificationEditPartCN) { - return true; - } - - if (gep instanceof ConstraintEditPartCN) { - return true; - } - - return super.provides(operation); - } - - @Override - public void createEditPolicies(EditPart editPart) { - super.createEditPolicies(editPart); - if(editPart instanceof ParametricDiagramEditPart) { - editPart.installEditPolicy(PasteEditPolicy.PASTE_ROLE, new CustomDuplicatePasteEditPolicy()); - editPart.installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new CustomDiagramDropEditPolicy()); - // no installation of other policies. - return; - } - - editPart.installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new CustomDragDropEditPolicy()); - - if ((editPart instanceof ConstraintEditPart) || (editPart instanceof ConstraintEditPartCN)) { - editPart.installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new CustomParametricSemanticPolicy()); - editPart.installEditPolicy(EditPolicyRoles.CREATION_ROLE, new DefaultCreationEditPolicy()); - editPart.installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy()); - } - - if ((editPart instanceof CommentEditPart) || (editPart instanceof CommentEditPartCN)) { - editPart.installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new CustomDefaultSemanticEditPolicy()); - editPart.installEditPolicy(EditPolicyRoles.CREATION_ROLE, new DefaultCreationEditPolicy()); - editPart.installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy()); - } - - if (editPart instanceof BlockPropertyCompositeEditPart) { - editPart.installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new CustomBlockPropertyCompositeDropEditPolicy()); - editPart.installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new CustomParametricSemanticPolicy()); - } - - if (editPart instanceof BlockPropertyStructureCompartmentEditPart) { - editPart.installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new CustomBlockPropertyStructureCompartmentSemanticEditPolicy()); - editPart.installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new CustomBlockPropertyStructureCompartmentEditPartDropEditPolicy()); - editPart.installEditPolicy(EditPolicy.LAYOUT_ROLE, new DefaultXYLayoutEditPolicy()); - } - - if (editPart instanceof CustomBlockCompositeEditPartTN) { - editPart.installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new CustomBlockCompositeDropEditPolicy()); - editPart.installEditPolicy(EditPolicyRoles.CREATION_ROLE, new StructuredClassifierCreationEditPolicy()); - - editPart.installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new CustomBlockCompositeSemanticEditPolicy()); - } - - if (editPart instanceof StructureCompartmentEditPart) { - editPart.installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new CustomStructureCompartmentSemanticEditPolicy()); - editPart.installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new CustomStructureClassifierDropEditPolicy()); - editPart.installEditPolicy(EditPolicy.LAYOUT_ROLE, new DefaultXYLayoutEditPolicy()); - } - - if (editPart instanceof DependencyEditPart) { - editPart.installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new CustomDefaultSemanticEditPolicy()); - } - - if (editPart instanceof ConnectorEditPart) { - editPart.installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new CustomDefaultSemanticEditPolicy()); - } - - if (editPart instanceof CustomConstraintBlockPropertyCompositeEditPart) { - editPart.installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new CustomBlockPropertyCompositeDropEditPolicy()); - editPart.installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new CustomParametricSemanticPolicy()); - } - if (editPart instanceof ConstraintParameterAffixedNodeEditPart) { - editPart.installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new TypedElementDropEditPolicy()); - editPart.installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new CustomParametricSemanticPolicy()); - } - if (editPart instanceof CustomBlockCompositeEditPartTN) { - editPart.installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new CustomParametricSemanticPolicy()); - } - if (editPart instanceof ConstraintSpecificationEditPartCN) { - editPart.installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new CustomParametricSemanticPolicy()); - } - if (editPart instanceof ConstraintEditPartCN) { - editPart.installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new CustomParametricSemanticPolicy()); - } - } - -} diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/provider/ParametricVisualTypeProvider.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/provider/ParametricVisualTypeProvider.java deleted file mode 100644 index 4a48162d265..00000000000 --- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/provider/ParametricVisualTypeProvider.java +++ /dev/null @@ -1,28 +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.papyrus.sysml.diagram.parametric.provider; - -import org.eclipse.papyrus.gmf.diagram.common.provider.SysMLVisualTypeProvider; -import org.eclipse.papyrus.uml.diagram.composite.providers.UMLVisualTypeProvider; - -/** - * Visual type provider for the SysML Parametric Diagram. - */ -public class ParametricVisualTypeProvider extends SysMLVisualTypeProvider { - - public ParametricVisualTypeProvider() { - super(new CustomGraphicalTypeRegistry(), new UMLVisualTypeProvider()); - } - -} diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/provider/ParserProvider.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/provider/ParserProvider.java deleted file mode 100644 index da517cf5297..00000000000 --- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/provider/ParserProvider.java +++ /dev/null @@ -1,107 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Régis CHEVREL: chevrel.regis <at> gmail.com - * CEA LIST - Initial API and implementation - * - *****************************************************************************/ -package org.eclipse.papyrus.sysml.diagram.parametric.provider; - -import java.util.HashMap; -import java.util.Map; - -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.gmf.runtime.common.core.service.AbstractProvider; -import org.eclipse.gmf.runtime.common.core.service.IOperation; -import org.eclipse.gmf.runtime.common.ui.services.parser.GetParserOperation; -import org.eclipse.gmf.runtime.common.ui.services.parser.IParser; -import org.eclipse.gmf.runtime.common.ui.services.parser.IParserProvider; -import org.eclipse.gmf.runtime.notation.Diagram; -import org.eclipse.gmf.runtime.notation.View; -import org.eclipse.papyrus.sysml.diagram.common.parser.FlowPortLabelParser; -import org.eclipse.papyrus.sysml.diagram.common.utils.SysMLGraphicalTypes; -import org.eclipse.papyrus.sysml.diagram.parametric.parser.ParametricFrameParser; -import org.eclipse.papyrus.uml.diagram.common.parser.ConnectorLabelParser; -import org.eclipse.papyrus.uml.diagram.common.parser.ConstraintLabelParser; -import org.eclipse.papyrus.uml.diagram.common.parser.MultiplicityElementLabelParser; -import org.eclipse.papyrus.uml.diagram.common.parser.NamedElementLabelParser; -import org.eclipse.papyrus.uml.diagram.common.parser.PropertyLabelParser; -import org.eclipse.papyrus.uml.diagram.common.utils.UMLGraphicalTypes; - -/** - * Parser provider for labels used by this diagram. - */ -public class ParserProvider extends AbstractProvider implements IParserProvider { - - /** map from graphical hint to parsers */ - private static final Map<String, IParser> graphicalHintToParser = new HashMap<String, IParser>(); - - static { - graphicalHintToParser.put(SysMLGraphicalTypes.LABEL_SYSML_BLOCK_NAME_ID, new ParametricFrameParser()); - graphicalHintToParser.put(UMLGraphicalTypes.LABEL_UML_PROPERTY_LABEL_ID, new PropertyLabelParser()); - graphicalHintToParser.put(UMLGraphicalTypes.SHAPE_UML_CONSTRAINT_AS_LABEL_ID, new ConstraintLabelParser()); - - graphicalHintToParser.put(UMLGraphicalTypes.AFFIXEDLABEL_UML_PORT_LABEL_ID, new PropertyLabelParser()); - graphicalHintToParser.put(SysMLGraphicalTypes.AFFIXEDLABEL_SYSML_FLOWPORT_LABEL_ID, new FlowPortLabelParser()); - - graphicalHintToParser.put(UMLGraphicalTypes.LINKLABEL_UML_NAMEDELEMENT_NAME_ID, new NamedElementLabelParser()); - graphicalHintToParser.put(UMLGraphicalTypes.LINKLABEL_UML_CONNECTOR_LABEL_ID, new ConnectorLabelParser()); - graphicalHintToParser.put(UMLGraphicalTypes.LINKLABEL_UML_CONNECTOR_SOURCE_MULTIPLICITY_ID, new MultiplicityElementLabelParser()); - graphicalHintToParser.put(UMLGraphicalTypes.LINKLABEL_UML_CONNECTOR_TARGET_MULTIPLICITY_ID, new MultiplicityElementLabelParser()); - } - - /** - * {@inheritDoc} - */ - public boolean provides(IOperation operation) { - if (operation instanceof GetParserOperation) { - IAdaptable hint = ((GetParserOperation) operation).getHint(); - - if (!ElementTypes.DIAGRAM_ID.equals(getDiagramType(hint))) { - return false; - } - - return getParser(hint) != null; - } - return false; - } - - /** - * {@inheritDoc} - */ - public IParser getParser(IAdaptable hint) { - String parserHint = (String) hint.getAdapter(String.class); - if (parserHint != null) { - IParser parser = graphicalHintToParser.get(parserHint); - if (parser != null) { - return parser; - } - } - - View view = (View) hint.getAdapter(View.class); - if (view != null) { - IParser parser = graphicalHintToParser.get(view.getType()); - if (parser != null) { - return parser; - } - } - - return null; - } - - private String getDiagramType(IAdaptable hint) { - Diagram diagram = (Diagram) hint.getAdapter(Diagram.class); - if (diagram != null) { - return diagram.getType(); - } - - return "undefined"; - } - -} diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/utils/BlockDropHelper.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/utils/BlockDropHelper.java deleted file mode 100644 index 6f7d5d57c10..00000000000 --- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/utils/BlockDropHelper.java +++ /dev/null @@ -1,301 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Régis CHEVREL: chevrel.regis <at> gmail.com - * CEA LIST - Initial API and implementation - * - *****************************************************************************/ -package org.eclipse.papyrus.sysml.diagram.parametric.utils; - -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.transaction.TransactionalEditingDomain; -import org.eclipse.gef.commands.Command; -import org.eclipse.gef.commands.CompoundCommand; -import org.eclipse.gef.commands.UnexecutableCommand; -import org.eclipse.gmf.runtime.common.core.command.ICommand; -import org.eclipse.gmf.runtime.diagram.core.edithelpers.CreateElementRequestAdapter; -import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil; -import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy; -import org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart; -import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequest; -import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequest.ViewDescriptor; -import org.eclipse.gmf.runtime.diagram.ui.requests.DropObjectsRequest; -import org.eclipse.gmf.runtime.emf.type.core.IElementType; -import org.eclipse.gmf.runtime.emf.type.core.ISpecializationType; -import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest; -import org.eclipse.gmf.runtime.notation.Node; -import org.eclipse.gmf.runtime.notation.View; -import org.eclipse.papyrus.infra.gmfdiag.common.utils.ViewDescriptorUtil; -import org.eclipse.papyrus.infra.services.edit.commands.ConfigureFeatureCommandFactory; -import org.eclipse.papyrus.infra.services.edit.commands.IConfigureCommandFactory; -import org.eclipse.papyrus.infra.services.edit.service.ElementEditServiceUtils; -import org.eclipse.papyrus.infra.services.edit.service.IElementEditService; -import org.eclipse.papyrus.sysml.service.types.element.SysMLElementTypes; -import org.eclipse.papyrus.uml.diagram.common.helper.ElementHelper; -import org.eclipse.papyrus.uml.service.types.element.UMLElementTypes; -import org.eclipse.uml2.uml.Actor; -import org.eclipse.uml2.uml.Association; -import org.eclipse.uml2.uml.DataType; -import org.eclipse.uml2.uml.Element; -import org.eclipse.uml2.uml.Property; -import org.eclipse.uml2.uml.Type; -import org.eclipse.uml2.uml.TypedElement; -import org.eclipse.uml2.uml.UMLPackage; - -/** - * This class provides convenience methods to create Block specific drop action (Part, Reference or ConstraintProperty creation). - */ -public class BlockDropHelper extends ElementHelper { - - public BlockDropHelper(TransactionalEditingDomain editDomain) { - this.editDomain = editDomain; - } - - public Command getDropAsStructureItemOnPart(DropObjectsRequest request, GraphicalEditPart host, IElementType elementType) { - Object droppedEObject = request.getObjects().get(0); - String label = ""; - if (elementType == SysMLElementTypes.PART_PROPERTY) { - label = "Create a new Part"; - // Exclude ConstraintProperty - if (droppedEObject instanceof Type) { - if (((ISpecializationType) SysMLElementTypes.CONSTRAINT_BLOCK).getMatcher().matches((Type) droppedEObject)) { - return UnexecutableCommand.INSTANCE; - } - } - // Exclude reference drop in diagram owned by a ConstraintBlock - Element editPartOwner = (Element) host.resolveSemanticElement(); - if (editPartOwner instanceof Property) { - editPartOwner = ((Property) editPartOwner).getType(); - } - if (editPartOwner != null && ((ISpecializationType) SysMLElementTypes.CONSTRAINT_BLOCK).getMatcher().matches(editPartOwner)) { - return UnexecutableCommand.INSTANCE; - } - } - if (elementType == SysMLElementTypes.REFERENCE_PROPERTY) { - label = "Create a new Reference"; - // Exclude ConstraintProperty - if (droppedEObject instanceof Type) { - if (((ISpecializationType) SysMLElementTypes.CONSTRAINT_BLOCK).getMatcher().matches((Type) droppedEObject)) { - return UnexecutableCommand.INSTANCE; - } - } - // Exclude reference drop in diagram owned by a ConstraintBlock - Element editPartOwner = (Element) host.resolveSemanticElement(); - if (editPartOwner instanceof Property) { - editPartOwner = ((Property) editPartOwner).getType(); - } - if (editPartOwner != null && ((ISpecializationType) SysMLElementTypes.CONSTRAINT_BLOCK).getMatcher().matches(editPartOwner)) { - return UnexecutableCommand.INSTANCE; - } - } - if (elementType == SysMLElementTypes.ACTOR_PART_PROPERTY) { - label = "Create a new ActorPart"; - } - if (elementType == SysMLElementTypes.VALUE_PROPERTY) { - label = "Create a new Value"; - } - if (elementType == UMLElementTypes.PROPERTY) { - label = "Create a new Property"; - } - // New kind of element - if (elementType == SysMLElementTypes.CONSTRAINT_PROPERTY) { - label = "Create a new ConstraintProperty"; - // Constraint Property on ConstraintBlock strictly - if (droppedEObject instanceof Type) { - if (!((ISpecializationType) SysMLElementTypes.CONSTRAINT_BLOCK).getMatcher().matches((Type) droppedEObject)) { - return UnexecutableCommand.INSTANCE; - } - } - } - - CompoundCommand cc = new CompoundCommand(label); - - if (!isValidStructureItemType(droppedEObject, elementType)) { - return UnexecutableCommand.INSTANCE; - } - - // Verify target nature - EObject target = getHostEObject(host); - if ((!(target instanceof TypedElement)) || (((TypedElement) target).getType() == null)) { - return UnexecutableCommand.INSTANCE; - } - - // The target type has to be a Block (will hold the created Port) - Type targetType = ((TypedElement) target).getType(); - if (!((ISpecializationType) SysMLElementTypes.BLOCK).getMatcher().matches(targetType)) { - return UnexecutableCommand.INSTANCE; - } - - // Prepare a command for the element creation and the drop in diagram - - // 1. Prepare creation command - ICommand createElementCommand = null; - CreateElementRequest createElementRequest = new CreateElementRequest(getEditingDomain(), targetType, elementType); - createElementRequest.setParameter(IConfigureCommandFactory.CONFIGURE_COMMAND_FACTORY_ID, new ConfigureFeatureCommandFactory(UMLPackage.eINSTANCE.getTypedElement_Type(), request.getObjects().get(0))); - IElementEditService provider = ElementEditServiceUtils.getCommandProvider(targetType); - if (provider != null) { - createElementCommand = provider.getEditCommand(createElementRequest); - } - IAdaptable createElementRequestAdapter = new CreateElementRequestAdapter(createElementRequest); - - // 2. Prepare the drop command - ViewDescriptor descriptor = new ViewDescriptor(createElementRequestAdapter, Node.class, /* explicit semantic hint is mandatory */null, ViewDescriptorUtil.PERSISTED, host.getDiagramPreferencesHint()); - CreateViewRequest createViewRequest = new CreateViewRequest(descriptor); - createViewRequest.setLocation(request.getLocation().getCopy()); - Command viewCreateCommand = host.getCommand(createViewRequest); - - // 3. Create the compound command - cc.add(new ICommandProxy(createElementCommand)); - cc.add(viewCreateCommand); - - return cc; - } - - public Command getDropAsStructureItem(DropObjectsRequest request, GraphicalEditPart host, IElementType elementType) { - Object droppedEObject = request.getObjects().get(0); - String label = ""; - - // Filter part/reference : a property type by a ConstraintBlock MUST be a ConstraintProperty - if (elementType == SysMLElementTypes.PART_PROPERTY) { - label = "Create a new Part"; - // Exclude ConstraintProperty - if (droppedEObject instanceof Type) { - if (((ISpecializationType) SysMLElementTypes.CONSTRAINT_BLOCK).getMatcher().matches((Type) droppedEObject)) { - return UnexecutableCommand.INSTANCE; - } - } - // Exclude reference drop in diagram owned by a ConstraintBlock - Element diagramOwner = getDiagramOwner(host); - if (diagramOwner != null && ((ISpecializationType) SysMLElementTypes.CONSTRAINT_BLOCK).getMatcher().matches(diagramOwner)) { - return UnexecutableCommand.INSTANCE; - } - } - if (elementType == SysMLElementTypes.REFERENCE_PROPERTY) { - label = "Create a new Reference"; - // Exclude ConstraintProperty - if (droppedEObject instanceof Type) { - if (((ISpecializationType) SysMLElementTypes.CONSTRAINT_BLOCK).getMatcher().matches((Type) droppedEObject)) { - return UnexecutableCommand.INSTANCE; - } - } - // Exclude reference drop in diagram owned by a ConstraintBlock - Element diagramOwner = getDiagramOwner(host); - if (diagramOwner != null && ((ISpecializationType) SysMLElementTypes.CONSTRAINT_BLOCK).getMatcher().matches(diagramOwner)) { - return UnexecutableCommand.INSTANCE; - } - } - if (elementType == SysMLElementTypes.ACTOR_PART_PROPERTY) { - label = "Create a new ActorPart"; - } - if (elementType == SysMLElementTypes.VALUE_PROPERTY) { - label = "Create a new Value"; - } - if (elementType == UMLElementTypes.PROPERTY) { - label = "Create a new Property"; - } - - // New kind of element - if (elementType == SysMLElementTypes.CONSTRAINT_PROPERTY) { - label = "Create a new ConstraintProperty"; - // Constraint Property on ConstraintBlock strictly - if (droppedEObject instanceof Type) { - if (!((ISpecializationType) SysMLElementTypes.CONSTRAINT_BLOCK).getMatcher().matches((Type) droppedEObject)) { - return UnexecutableCommand.INSTANCE; - } - } - } - CompoundCommand cc = new CompoundCommand(label); - - if (!isValidStructureItemType(droppedEObject, elementType)) { - return UnexecutableCommand.INSTANCE; - } - - // Prepare a command for the element creation and the drop in diagram - - // 1. Prepare creation command - ICommand createElementCommand = null; - CreateElementRequest createElementRequest = new CreateElementRequest(getEditingDomain(), getHostEObject(host), elementType); - createElementRequest.setParameter(IConfigureCommandFactory.CONFIGURE_COMMAND_FACTORY_ID, new ConfigureFeatureCommandFactory(UMLPackage.eINSTANCE.getTypedElement_Type(), request.getObjects().get(0))); - IElementEditService provider = ElementEditServiceUtils.getCommandProvider(getHostEObject(host)); - if (provider != null) { - createElementCommand = provider.getEditCommand(createElementRequest); - } - IAdaptable createElementRequestAdapter = new CreateElementRequestAdapter(createElementRequest); - - // 2. Prepare the drop command - ViewDescriptor descriptor = new ViewDescriptor(createElementRequestAdapter, Node.class, /* explicit semantic hint is mandatory */null, ViewDescriptorUtil.PERSISTED, host.getDiagramPreferencesHint()); - CreateViewRequest createViewRequest = new CreateViewRequest(descriptor); - createViewRequest.setLocation(request.getLocation().getCopy()); - Command viewCreateCommand = host.getCommand(createViewRequest); - - // 3. Create the compound command - cc.add(new ICommandProxy(createElementCommand)); - cc.add(viewCreateCommand); - - return cc; - } - - private Element getDiagramOwner(GraphicalEditPart host) { - Object model = host.getRoot().getContents().getModel(); - if (model instanceof View) { - return (Element) ((View) model).getElement(); - } - return null; - } - - private boolean isValidStructureItemType(Object object, IElementType elementType) { - boolean isValid = false; - - if ((object != null) && (object instanceof Type) && !(object instanceof Association)) { - - Type type = (Type) object; - if ((elementType == SysMLElementTypes.PART_PROPERTY) || (elementType == SysMLElementTypes.REFERENCE_PROPERTY)) { - if (((ISpecializationType) SysMLElementTypes.BLOCK).getMatcher().matches(type)) { - isValid = true; - } - } - if (elementType == SysMLElementTypes.ACTOR_PART_PROPERTY) { - if (type instanceof Actor) { - isValid = true; - } - } - if (elementType == SysMLElementTypes.VALUE_PROPERTY) { - if (((ISpecializationType) SysMLElementTypes.VALUE_TYPE).getMatcher().matches(type) || (type instanceof DataType)) { - isValid = true; - } - } - if ((elementType == SysMLElementTypes.CONSTRAINT_PROPERTY)) { - if (((ISpecializationType) SysMLElementTypes.BLOCK).getMatcher().matches(type)) { - isValid = true; - } - } - if (elementType == UMLElementTypes.PROPERTY) { - if (!((ISpecializationType) SysMLElementTypes.BLOCK).getMatcher().matches(type) - && !(type instanceof Actor) - && !(type instanceof DataType) - && !((ISpecializationType) SysMLElementTypes.VALUE_TYPE).getMatcher().matches(type)) { - isValid = true; - } - } - } - - return isValid; - } - - /** - * return the host Edit Part's semantic element, if the semantic element - * is <code>null</code> or unresolvable it will return <code>null</code> - * - * @return EObject - */ - protected EObject getHostEObject(GraphicalEditPart host) { - return ViewUtil.resolveSemanticElement((View) host.getModel()); - } -} diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/utils/ConstraintParameterDropHelper.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/utils/ConstraintParameterDropHelper.java deleted file mode 100644 index 957993c457e..00000000000 --- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/utils/ConstraintParameterDropHelper.java +++ /dev/null @@ -1,94 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Régis CHEVREL: chevrel.regis <at> gmail.com - * CEA LIST - Initial API and implementation - * - *****************************************************************************/ -package org.eclipse.papyrus.sysml.diagram.parametric.utils; - -import org.eclipse.draw2d.geometry.Point; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.transaction.TransactionalEditingDomain; -import org.eclipse.gef.commands.Command; -import org.eclipse.gef.commands.UnexecutableCommand; -import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil; -import org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart; -import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequest; -import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequest.ViewDescriptor; -import org.eclipse.gmf.runtime.notation.Node; -import org.eclipse.gmf.runtime.notation.View; -import org.eclipse.papyrus.infra.gmfdiag.common.utils.ViewDescriptorUtil; -import org.eclipse.papyrus.sysml.constraints.ConstraintBlock; -import org.eclipse.papyrus.sysml.constraints.ConstraintProperty; -import org.eclipse.papyrus.uml.diagram.common.commands.SemanticAdapter; -import org.eclipse.papyrus.uml.diagram.common.helper.ElementHelper; -import org.eclipse.uml2.uml.Class; -import org.eclipse.uml2.uml.Port; -import org.eclipse.uml2.uml.Property; -import org.eclipse.uml2.uml.Type; -import org.eclipse.uml2.uml.util.UMLUtil; - -/** - * This class provides convenience methods to create Type specific drop action (Show Port on BlockPropertyComposite). - */ -public class ConstraintParameterDropHelper extends ElementHelper { - - public ConstraintParameterDropHelper(TransactionalEditingDomain editDomain) { - this.editDomain = editDomain; - } - - public Command getDropConstraintParameter(Property droppedConstraintParameter, Point location, GraphicalEditPart host) { - return getDropConstraintParameterOnPart(droppedConstraintParameter, location, host); - } - - public Command getDropConstraintParameterOnPart(Property droppedConstraintParameter, Point location, GraphicalEditPart host) { - - if (!isValidConstraintParameter(droppedConstraintParameter, getHostEObject(host))) { - return UnexecutableCommand.INSTANCE; - } - - // Prepare the view creation command - ViewDescriptor descriptor = new ViewDescriptor(new SemanticAdapter(droppedConstraintParameter, null), Node.class, /* explicit semantic hint is mandatory */null, ViewDescriptorUtil.PERSISTED, host.getDiagramPreferencesHint()); - CreateViewRequest createViewRequest = new CreateViewRequest(descriptor); - createViewRequest.setLocation(location); - Command viewCreateCommand = host.getCommand(createViewRequest); - - return viewCreateCommand; - } - - private boolean isValidConstraintParameter(Object object, EObject dropTarget) { - // check if not a Port/FlowPort ... - if (object instanceof Port) { - return false; - } - // drop on a Block/ConstraintBlock - if (dropTarget instanceof Class && UMLUtil.getStereotypeApplication((Class) dropTarget, ConstraintBlock.class) != null) { - return ((Class) dropTarget).getOwnedAttributes().contains(object); - } - // drop on a part - if (dropTarget instanceof Property && UMLUtil.getStereotypeApplication((Property) dropTarget, ConstraintProperty.class) != null) { - Type type = ((Property) dropTarget).getType(); - if (type instanceof Class && UMLUtil.getStereotypeApplication(type, ConstraintBlock.class) != null) { - return ((Class) type).getOwnedAttributes().contains(object); - } - } - return false; - } - - /** - * return the host Edit Part's semantic element, if the semantic element - * is <code>null</code> or unresolvable it will return <code>null</code> - * - * @return EObject - */ - protected EObject getHostEObject(GraphicalEditPart host) { - return ViewUtil.resolveSemanticElement((View) host.getModel()); - } -} |