From 0dd9684630a433d601214c604c13b137de5e21a0 Mon Sep 17 00:00:00 2001 From: Vincent Lorenzo Date: Wed, 4 Aug 2021 11:24:07 +0200 Subject: Bug 575254: [Toolsmiths] Remove the plugin org.eclipse.papyrus.gmfgenextension Signed-off-by: Vincent Lorenzo Change-Id: I560e7206ce15f5af7bee91eb30453d13fe71ad81 --- .../feature.xml | 7 - .../resource/guidelines.mediawiki | 29 +- .../images/PapyrusDiagramGenInstallation.png | Bin 0 -> 28946 bytes .../org.eclipse.m2m.qvt.oml.mmodel.urimap | 4 - .../org.eclipse.papyrus.gmfgenextension/.classpath | 7 - .../org.eclipse.papyrus.gmfgenextension/.project | 52 -- .../.settings/org.eclipse.core.resources.prefs | 2 - .../.settings/org.eclipse.core.runtime.prefs | 2 - .../.settings/org.eclipse.jdt.core.prefs | 319 ------------ .../.settings/org.eclipse.jdt.ui.prefs | 127 ----- .../.settings/org.eclipse.pde.api.tools.prefs | 104 ---- .../META-INF/MANIFEST.MF | 17 - .../org.eclipse.papyrus.gmfgenextension/about.html | 26 - .../build.properties | 17 - .../icons/GenerateMetamodelType.gif | Bin 547 -> 0 bytes .../icons/PapyrusLogo16x16.gif | Bin 561 -> 0 bytes .../icons/none_comp_vis.gif | Bin 115 -> 0 bytes .../icons/palette_view.gif | Bin 633 -> 0 bytes .../icons/updateElementType.gif | Bin 330 -> 0 bytes .../model/gmfgneExtension.uml | 169 ------ .../model/papyrusGmfgenExtension.ecore | 202 -------- .../model/papyrusGmfgenExtension.genmodel | 121 ----- .../plugin.properties | 14 - .../org.eclipse.papyrus.gmfgenextension/plugin.xml | 303 ----------- .../org.eclipse.papyrus.gmfgenextension/pom.xml | 15 - .../papyrusgmfgenextension/popupaction/Action.java | 182 ------- .../popupaction/AddDefaultNamedElementAction.java | 165 ------ ...ddExternalNodeFloatingLabelDisplayBehavior.java | 225 -------- .../AddExternalNodeStereotypeDisplayBehavior.java | 169 ------ .../AddGenLinkStereotypeDisplayBehavior.java | 221 -------- .../popupaction/AddHyperLinkPopupBarBehavior.java | 70 --- .../popupaction/AddNodeQualifiedNameBehavior.java | 71 --- .../AddNodeShowHideCompartmentBehavior.java | 58 --- .../AddNodeShowHideContentsBehavior.java | 53 -- .../popupaction/AddNodeShowHideLabelsBehavior.java | 55 -- .../AddNodeStereotypeDisplayBehavior.java | 71 --- .../popupaction/AddOrUpdateCommentEditParts.java | 577 --------------------- .../AddSemanticElementTypeInGenericTopNode.java | 191 ------- .../popupaction/AddShapeNamedElementAction.java | 175 ------- .../AddSmallAndLargeIconForPaletteAction.java | 215 -------- .../popupaction/DisplayReport.java | 147 ------ .../popupaction/EditpartGenHelper.java | 261 ---------- .../popupaction/Messages.java | 53 -- .../SetCompartmentNeedsTitleToTrueAction.java | 68 --- .../popupaction/SetVisualIDWithUnusedValue.java | 123 ----- .../popupaction/TestCodeSetGeneration.java | 204 -------- .../UpdateElementTypeToMatchGenericType.java | 256 --------- .../popupaction/messages.properties | 5 - .../release.xml | 2 - plugins/toolsmiths/pom.xml | 1 - .../META-INF/MANIFEST.MF | 1 - ...clipse.papyrus.uml.diagram.profile.tests.launch | 44 -- 52 files changed, 17 insertions(+), 5183 deletions(-) create mode 100644 plugins/doc/org.eclipse.papyrus.developer.doc/resource/images/PapyrusDiagramGenInstallation.png delete mode 100644 plugins/toolsmiths/org.eclipse.papyrus.dev.types/.settings/org.eclipse.m2m.qvt.oml.mmodel.urimap delete mode 100644 plugins/toolsmiths/org.eclipse.papyrus.gmfgenextension/.classpath delete mode 100644 plugins/toolsmiths/org.eclipse.papyrus.gmfgenextension/.project delete mode 100644 plugins/toolsmiths/org.eclipse.papyrus.gmfgenextension/.settings/org.eclipse.core.resources.prefs delete mode 100644 plugins/toolsmiths/org.eclipse.papyrus.gmfgenextension/.settings/org.eclipse.core.runtime.prefs delete mode 100755 plugins/toolsmiths/org.eclipse.papyrus.gmfgenextension/.settings/org.eclipse.jdt.core.prefs delete mode 100644 plugins/toolsmiths/org.eclipse.papyrus.gmfgenextension/.settings/org.eclipse.jdt.ui.prefs delete mode 100644 plugins/toolsmiths/org.eclipse.papyrus.gmfgenextension/.settings/org.eclipse.pde.api.tools.prefs delete mode 100644 plugins/toolsmiths/org.eclipse.papyrus.gmfgenextension/META-INF/MANIFEST.MF delete mode 100644 plugins/toolsmiths/org.eclipse.papyrus.gmfgenextension/about.html delete mode 100644 plugins/toolsmiths/org.eclipse.papyrus.gmfgenextension/build.properties delete mode 100644 plugins/toolsmiths/org.eclipse.papyrus.gmfgenextension/icons/GenerateMetamodelType.gif delete mode 100644 plugins/toolsmiths/org.eclipse.papyrus.gmfgenextension/icons/PapyrusLogo16x16.gif delete mode 100644 plugins/toolsmiths/org.eclipse.papyrus.gmfgenextension/icons/none_comp_vis.gif delete mode 100644 plugins/toolsmiths/org.eclipse.papyrus.gmfgenextension/icons/palette_view.gif delete mode 100644 plugins/toolsmiths/org.eclipse.papyrus.gmfgenextension/icons/updateElementType.gif delete mode 100644 plugins/toolsmiths/org.eclipse.papyrus.gmfgenextension/model/gmfgneExtension.uml delete mode 100644 plugins/toolsmiths/org.eclipse.papyrus.gmfgenextension/model/papyrusGmfgenExtension.ecore delete mode 100644 plugins/toolsmiths/org.eclipse.papyrus.gmfgenextension/model/papyrusGmfgenExtension.genmodel delete mode 100644 plugins/toolsmiths/org.eclipse.papyrus.gmfgenextension/plugin.properties delete mode 100644 plugins/toolsmiths/org.eclipse.papyrus.gmfgenextension/plugin.xml delete mode 100644 plugins/toolsmiths/org.eclipse.papyrus.gmfgenextension/pom.xml delete mode 100644 plugins/toolsmiths/org.eclipse.papyrus.gmfgenextension/src/org/eclipse/papyrus/papyrusgmfgenextension/popupaction/Action.java delete mode 100644 plugins/toolsmiths/org.eclipse.papyrus.gmfgenextension/src/org/eclipse/papyrus/papyrusgmfgenextension/popupaction/AddDefaultNamedElementAction.java delete mode 100644 plugins/toolsmiths/org.eclipse.papyrus.gmfgenextension/src/org/eclipse/papyrus/papyrusgmfgenextension/popupaction/AddExternalNodeFloatingLabelDisplayBehavior.java delete mode 100644 plugins/toolsmiths/org.eclipse.papyrus.gmfgenextension/src/org/eclipse/papyrus/papyrusgmfgenextension/popupaction/AddExternalNodeStereotypeDisplayBehavior.java delete mode 100644 plugins/toolsmiths/org.eclipse.papyrus.gmfgenextension/src/org/eclipse/papyrus/papyrusgmfgenextension/popupaction/AddGenLinkStereotypeDisplayBehavior.java delete mode 100644 plugins/toolsmiths/org.eclipse.papyrus.gmfgenextension/src/org/eclipse/papyrus/papyrusgmfgenextension/popupaction/AddHyperLinkPopupBarBehavior.java delete mode 100644 plugins/toolsmiths/org.eclipse.papyrus.gmfgenextension/src/org/eclipse/papyrus/papyrusgmfgenextension/popupaction/AddNodeQualifiedNameBehavior.java delete mode 100644 plugins/toolsmiths/org.eclipse.papyrus.gmfgenextension/src/org/eclipse/papyrus/papyrusgmfgenextension/popupaction/AddNodeShowHideCompartmentBehavior.java delete mode 100644 plugins/toolsmiths/org.eclipse.papyrus.gmfgenextension/src/org/eclipse/papyrus/papyrusgmfgenextension/popupaction/AddNodeShowHideContentsBehavior.java delete mode 100644 plugins/toolsmiths/org.eclipse.papyrus.gmfgenextension/src/org/eclipse/papyrus/papyrusgmfgenextension/popupaction/AddNodeShowHideLabelsBehavior.java delete mode 100644 plugins/toolsmiths/org.eclipse.papyrus.gmfgenextension/src/org/eclipse/papyrus/papyrusgmfgenextension/popupaction/AddNodeStereotypeDisplayBehavior.java delete mode 100644 plugins/toolsmiths/org.eclipse.papyrus.gmfgenextension/src/org/eclipse/papyrus/papyrusgmfgenextension/popupaction/AddOrUpdateCommentEditParts.java delete mode 100644 plugins/toolsmiths/org.eclipse.papyrus.gmfgenextension/src/org/eclipse/papyrus/papyrusgmfgenextension/popupaction/AddSemanticElementTypeInGenericTopNode.java delete mode 100644 plugins/toolsmiths/org.eclipse.papyrus.gmfgenextension/src/org/eclipse/papyrus/papyrusgmfgenextension/popupaction/AddShapeNamedElementAction.java delete mode 100644 plugins/toolsmiths/org.eclipse.papyrus.gmfgenextension/src/org/eclipse/papyrus/papyrusgmfgenextension/popupaction/AddSmallAndLargeIconForPaletteAction.java delete mode 100644 plugins/toolsmiths/org.eclipse.papyrus.gmfgenextension/src/org/eclipse/papyrus/papyrusgmfgenextension/popupaction/DisplayReport.java delete mode 100644 plugins/toolsmiths/org.eclipse.papyrus.gmfgenextension/src/org/eclipse/papyrus/papyrusgmfgenextension/popupaction/EditpartGenHelper.java delete mode 100644 plugins/toolsmiths/org.eclipse.papyrus.gmfgenextension/src/org/eclipse/papyrus/papyrusgmfgenextension/popupaction/Messages.java delete mode 100644 plugins/toolsmiths/org.eclipse.papyrus.gmfgenextension/src/org/eclipse/papyrus/papyrusgmfgenextension/popupaction/SetCompartmentNeedsTitleToTrueAction.java delete mode 100644 plugins/toolsmiths/org.eclipse.papyrus.gmfgenextension/src/org/eclipse/papyrus/papyrusgmfgenextension/popupaction/SetVisualIDWithUnusedValue.java delete mode 100644 plugins/toolsmiths/org.eclipse.papyrus.gmfgenextension/src/org/eclipse/papyrus/papyrusgmfgenextension/popupaction/TestCodeSetGeneration.java delete mode 100644 plugins/toolsmiths/org.eclipse.papyrus.gmfgenextension/src/org/eclipse/papyrus/papyrusgmfgenextension/popupaction/UpdateElementTypeToMatchGenericType.java delete mode 100644 plugins/toolsmiths/org.eclipse.papyrus.gmfgenextension/src/org/eclipse/papyrus/papyrusgmfgenextension/popupaction/messages.properties delete mode 100644 tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.profile.tests/org.eclipse.papyrus.uml.diagram.profile.tests.launch diff --git a/features/papyrus-toolsmiths-features/org.eclipse.papyrus.diagramgen.feature/feature.xml b/features/papyrus-toolsmiths-features/org.eclipse.papyrus.diagramgen.feature/feature.xml index d9282e0f915..b83b066756a 100755 --- a/features/papyrus-toolsmiths-features/org.eclipse.papyrus.diagramgen.feature/feature.xml +++ b/features/papyrus-toolsmiths-features/org.eclipse.papyrus.diagramgen.feature/feature.xml @@ -75,13 +75,6 @@ version="0.0.0" unpack="false"/> - - - - - diff --git a/plugins/toolsmiths/org.eclipse.papyrus.gmfgenextension/.classpath b/plugins/toolsmiths/org.eclipse.papyrus.gmfgenextension/.classpath deleted file mode 100644 index e801ebfb468..00000000000 --- a/plugins/toolsmiths/org.eclipse.papyrus.gmfgenextension/.classpath +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/plugins/toolsmiths/org.eclipse.papyrus.gmfgenextension/.project b/plugins/toolsmiths/org.eclipse.papyrus.gmfgenextension/.project deleted file mode 100644 index 66017c63787..00000000000 --- a/plugins/toolsmiths/org.eclipse.papyrus.gmfgenextension/.project +++ /dev/null @@ -1,52 +0,0 @@ - - - org.eclipse.papyrus.gmfgenextension - - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - org.eclipse.oomph.version.VersionBuilder - - - check.maven.pom - true - - - ignore.lower.bound.dependency.ranges - true - - - release.path - /org.eclipse.papyrus.releng.dev.release/release.xml - - - - - org.eclipse.pde.api.tools.apiAnalysisBuilder - - - - - - org.eclipse.jdt.core.javanature - org.eclipse.pde.PluginNature - org.eclipse.oomph.version.VersionNature - org.eclipse.pde.api.tools.apiAnalysisNature - - diff --git a/plugins/toolsmiths/org.eclipse.papyrus.gmfgenextension/.settings/org.eclipse.core.resources.prefs b/plugins/toolsmiths/org.eclipse.papyrus.gmfgenextension/.settings/org.eclipse.core.resources.prefs deleted file mode 100644 index 896a9a53a53..00000000000 --- a/plugins/toolsmiths/org.eclipse.papyrus.gmfgenextension/.settings/org.eclipse.core.resources.prefs +++ /dev/null @@ -1,2 +0,0 @@ -eclipse.preferences.version=1 -encoding/=UTF-8 \ No newline at end of file diff --git a/plugins/toolsmiths/org.eclipse.papyrus.gmfgenextension/.settings/org.eclipse.core.runtime.prefs b/plugins/toolsmiths/org.eclipse.papyrus.gmfgenextension/.settings/org.eclipse.core.runtime.prefs deleted file mode 100644 index 5a0ad22d2a7..00000000000 --- a/plugins/toolsmiths/org.eclipse.papyrus.gmfgenextension/.settings/org.eclipse.core.runtime.prefs +++ /dev/null @@ -1,2 +0,0 @@ -eclipse.preferences.version=1 -line.separator=\n diff --git a/plugins/toolsmiths/org.eclipse.papyrus.gmfgenextension/.settings/org.eclipse.jdt.core.prefs b/plugins/toolsmiths/org.eclipse.papyrus.gmfgenextension/.settings/org.eclipse.jdt.core.prefs deleted file mode 100755 index 037f04a07c2..00000000000 --- a/plugins/toolsmiths/org.eclipse.papyrus.gmfgenextension/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,319 +0,0 @@ -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate -org.eclipse.jdt.core.compiler.codegen.targetPlatform=11 -org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve -org.eclipse.jdt.core.compiler.compliance=11 -org.eclipse.jdt.core.compiler.debug.lineNumber=generate -org.eclipse.jdt.core.compiler.debug.localVariable=generate -org.eclipse.jdt.core.compiler.debug.sourceFile=generate -org.eclipse.jdt.core.compiler.problem.assertIdentifier=error -org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning -org.eclipse.jdt.core.compiler.release=enabled -org.eclipse.jdt.core.compiler.source=11 -org.eclipse.jdt.core.formatter.align_type_members_on_columns=false -org.eclipse.jdt.core.formatter.alignment_for_additive_operator=16 -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_bitwise_operator=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_logical_operator=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_multiplicative_operator=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_string_concatenation=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_additive_operator=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_bitwise_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_logical_operator=insert -org.eclipse.jdt.core.formatter.insert_space_after_multiplicative_operator=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_relational_operator=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_shift_operator=insert -org.eclipse.jdt.core.formatter.insert_space_after_string_concatenation=insert -org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_additive_operator=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_bitwise_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_logical_operator=insert -org.eclipse.jdt.core.formatter.insert_space_before_multiplicative_operator=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_relational_operator=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_shift_operator=insert -org.eclipse.jdt.core.formatter.insert_space_before_string_concatenation=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_additive_operator=true -org.eclipse.jdt.core.formatter.wrap_before_bitwise_operator=true -org.eclipse.jdt.core.formatter.wrap_before_logical_operator=true -org.eclipse.jdt.core.formatter.wrap_before_multiplicative_operator=true -org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true -org.eclipse.jdt.core.formatter.wrap_before_string_concatenation=true -org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true diff --git a/plugins/toolsmiths/org.eclipse.papyrus.gmfgenextension/.settings/org.eclipse.jdt.ui.prefs b/plugins/toolsmiths/org.eclipse.papyrus.gmfgenextension/.settings/org.eclipse.jdt.ui.prefs deleted file mode 100644 index ba7542ef658..00000000000 --- a/plugins/toolsmiths/org.eclipse.papyrus.gmfgenextension/.settings/org.eclipse.jdt.ui.prefs +++ /dev/null @@ -1,127 +0,0 @@ -cleanup.add_default_serial_version_id=true -cleanup.add_generated_serial_version_id=false -cleanup.add_missing_annotations=true -cleanup.add_missing_deprecated_annotations=true -cleanup.add_missing_methods=false -cleanup.add_missing_nls_tags=false -cleanup.add_missing_override_annotations=true -cleanup.add_missing_override_annotations_interface_methods=true -cleanup.add_serial_version_id=false -cleanup.always_use_blocks=true -cleanup.always_use_parentheses_in_expressions=false -cleanup.always_use_this_for_non_static_field_access=false -cleanup.always_use_this_for_non_static_method_access=false -cleanup.convert_functional_interfaces=false -cleanup.convert_to_enhanced_for_loop=false -cleanup.correct_indentation=false -cleanup.format_source_code=false -cleanup.format_source_code_changes_only=false -cleanup.insert_inferred_type_arguments=false -cleanup.make_local_variable_final=true -cleanup.make_parameters_final=false -cleanup.make_private_fields_final=true -cleanup.make_type_abstract_if_missing_method=false -cleanup.make_variable_declarations_final=false -cleanup.never_use_blocks=false -cleanup.never_use_parentheses_in_expressions=true -cleanup.organize_imports=false -cleanup.qualify_static_field_accesses_with_declaring_class=false -cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true -cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true -cleanup.qualify_static_member_accesses_with_declaring_class=true -cleanup.qualify_static_method_accesses_with_declaring_class=false -cleanup.remove_private_constructors=true -cleanup.remove_redundant_type_arguments=true -cleanup.remove_trailing_whitespaces=true -cleanup.remove_trailing_whitespaces_all=true -cleanup.remove_trailing_whitespaces_ignore_empty=false -cleanup.remove_unnecessary_casts=true -cleanup.remove_unnecessary_nls_tags=true -cleanup.remove_unused_imports=true -cleanup.remove_unused_local_variables=false -cleanup.remove_unused_private_fields=true -cleanup.remove_unused_private_members=false -cleanup.remove_unused_private_methods=true -cleanup.remove_unused_private_types=true -cleanup.sort_members=false -cleanup.sort_members_all=false -cleanup.use_anonymous_class_creation=false -cleanup.use_blocks=true -cleanup.use_blocks_only_for_return_and_throw=false -cleanup.use_lambda=true -cleanup.use_parentheses_in_expressions=false -cleanup.use_this_for_non_static_field_access=false -cleanup.use_this_for_non_static_field_access_only_if_necessary=true -cleanup.use_this_for_non_static_method_access=false -cleanup.use_this_for_non_static_method_access_only_if_necessary=true -cleanup.use_type_arguments=false -cleanup_profile=_Papyrus -cleanup_settings_version=2 -eclipse.preferences.version=1 -editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true -formatter_profile=_Papyrus -formatter_settings_version=12 -org.eclipse.jdt.ui.ignorelowercasenames=true -org.eclipse.jdt.ui.importorder=java;javax;org;com; -org.eclipse.jdt.ui.javadoc=true -org.eclipse.jdt.ui.ondemandthreshold=99 -org.eclipse.jdt.ui.staticondemandthreshold=99 -org.eclipse.jdt.ui.text.custom_code_templates= -sp_cleanup.add_default_serial_version_id=true -sp_cleanup.add_generated_serial_version_id=false -sp_cleanup.add_missing_annotations=true -sp_cleanup.add_missing_deprecated_annotations=true -sp_cleanup.add_missing_methods=false -sp_cleanup.add_missing_nls_tags=false -sp_cleanup.add_missing_override_annotations=true -sp_cleanup.add_missing_override_annotations_interface_methods=true -sp_cleanup.add_serial_version_id=false -sp_cleanup.always_use_blocks=true -sp_cleanup.always_use_parentheses_in_expressions=false -sp_cleanup.always_use_this_for_non_static_field_access=false -sp_cleanup.always_use_this_for_non_static_method_access=false -sp_cleanup.convert_functional_interfaces=false -sp_cleanup.convert_to_enhanced_for_loop=false -sp_cleanup.correct_indentation=false -sp_cleanup.format_source_code=true -sp_cleanup.format_source_code_changes_only=false -sp_cleanup.insert_inferred_type_arguments=false -sp_cleanup.make_local_variable_final=true -sp_cleanup.make_parameters_final=false -sp_cleanup.make_private_fields_final=true -sp_cleanup.make_type_abstract_if_missing_method=false -sp_cleanup.make_variable_declarations_final=false -sp_cleanup.never_use_blocks=false -sp_cleanup.never_use_parentheses_in_expressions=true -sp_cleanup.on_save_use_additional_actions=true -sp_cleanup.organize_imports=true -sp_cleanup.qualify_static_field_accesses_with_declaring_class=false -sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true -sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true -sp_cleanup.qualify_static_member_accesses_with_declaring_class=false -sp_cleanup.qualify_static_method_accesses_with_declaring_class=false -sp_cleanup.remove_private_constructors=true -sp_cleanup.remove_redundant_modifiers=false -sp_cleanup.remove_redundant_type_arguments=true -sp_cleanup.remove_trailing_whitespaces=true -sp_cleanup.remove_trailing_whitespaces_all=true -sp_cleanup.remove_trailing_whitespaces_ignore_empty=false -sp_cleanup.remove_unnecessary_casts=true -sp_cleanup.remove_unnecessary_nls_tags=true -sp_cleanup.remove_unused_imports=true -sp_cleanup.remove_unused_local_variables=false -sp_cleanup.remove_unused_private_fields=true -sp_cleanup.remove_unused_private_members=false -sp_cleanup.remove_unused_private_methods=true -sp_cleanup.remove_unused_private_types=true -sp_cleanup.sort_members=false -sp_cleanup.sort_members_all=false -sp_cleanup.use_anonymous_class_creation=false -sp_cleanup.use_blocks=true -sp_cleanup.use_blocks_only_for_return_and_throw=false -sp_cleanup.use_lambda=true -sp_cleanup.use_parentheses_in_expressions=false -sp_cleanup.use_this_for_non_static_field_access=false -sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true -sp_cleanup.use_this_for_non_static_method_access=false -sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true diff --git a/plugins/toolsmiths/org.eclipse.papyrus.gmfgenextension/.settings/org.eclipse.pde.api.tools.prefs b/plugins/toolsmiths/org.eclipse.papyrus.gmfgenextension/.settings/org.eclipse.pde.api.tools.prefs deleted file mode 100644 index b2260f87129..00000000000 --- a/plugins/toolsmiths/org.eclipse.papyrus.gmfgenextension/.settings/org.eclipse.pde.api.tools.prefs +++ /dev/null @@ -1,104 +0,0 @@ -ANNOTATION_ELEMENT_TYPE_ADDED_FIELD=Error -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=Warning -API_COMPONENT_ELEMENT_TYPE_REMOVED_REEXPORTED_TYPE=Warning -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_FIELD=Warning -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=Warning -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=Warning -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_DEFAULT_METHOD=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 -changed_execution_env=Warning -eclipse.preferences.version=1 -incompatible_api_component_version=Warning -incompatible_api_component_version_include_major_without_breaking_change=Disabled -incompatible_api_component_version_include_minor_without_api_change=Disabled -incompatible_api_component_version_report_major_without_breaking_change=Error -incompatible_api_component_version_report_minor_without_api_change=Error -invalid_since_tag_version=Error -malformed_since_tag=Error -missing_since_tag=Error -report_api_breakage_when_major_version_incremented=Disabled -report_resolution_errors_api_component=Warning diff --git a/plugins/toolsmiths/org.eclipse.papyrus.gmfgenextension/META-INF/MANIFEST.MF b/plugins/toolsmiths/org.eclipse.papyrus.gmfgenextension/META-INF/MANIFEST.MF deleted file mode 100644 index 3ac906b409a..00000000000 --- a/plugins/toolsmiths/org.eclipse.papyrus.gmfgenextension/META-INF/MANIFEST.MF +++ /dev/null @@ -1,17 +0,0 @@ -Manifest-Version: 1.0 -Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.18.0,4.0.0)", - org.eclipse.papyrus.gmf.codegen;bundle-version="[2.11.0,3.0.0)", - org.eclipse.ui;bundle-version="[3.117.0,4.0.0)", - org.eclipse.uml2.codegen.ecore;bundle-version="[2.5.0,3.0.0)", - org.eclipse.uml2.uml.edit;bundle-version="[5.5.0,6.0.0)" -Export-Package: org.eclipse.papyrus.papyrusgmfgenextension.popupaction -Bundle-Vendor: %providerName -Bundle-ActivationPolicy: lazy -Bundle-ClassPath: . -Bundle-Version: 3.0.0.qualifier -Bundle-Localization: plugin -Bundle-Name: %pluginName -Bundle-ManifestVersion: 2 -Bundle-SymbolicName: org.eclipse.papyrus.gmfgenextension;singleton:=true -Bundle-RequiredExecutionEnvironment: JavaSE-11 -Automatic-Module-Name: org.eclipse.papyrus.gmfgenextension diff --git a/plugins/toolsmiths/org.eclipse.papyrus.gmfgenextension/about.html b/plugins/toolsmiths/org.eclipse.papyrus.gmfgenextension/about.html deleted file mode 100644 index ba32bad959c..00000000000 --- a/plugins/toolsmiths/org.eclipse.papyrus.gmfgenextension/about.html +++ /dev/null @@ -1,26 +0,0 @@ - - - - - -About - -

About This Content

- -

November 30, 2017

-

License

- -

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 2.0 ("EPL"). A copy of the EPL is available -at https://www.eclipse.org/legal/epl-2.0/. -For purposes of the EPL, "Program" will mean the Content.

- -

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 http://www.eclipse.org.

- - \ No newline at end of file diff --git a/plugins/toolsmiths/org.eclipse.papyrus.gmfgenextension/build.properties b/plugins/toolsmiths/org.eclipse.papyrus.gmfgenextension/build.properties deleted file mode 100644 index dde0974666b..00000000000 --- a/plugins/toolsmiths/org.eclipse.papyrus.gmfgenextension/build.properties +++ /dev/null @@ -1,17 +0,0 @@ - -# -# -# -# $Id$ - -bin.includes = .,\ - model/,\ - META-INF/,\ - plugin.xml,\ - plugin.properties,\ - icons/,\ - about.html -jars.compile.order = . -source.. = src/ -output.. = bin/ -src.includes = about.html diff --git a/plugins/toolsmiths/org.eclipse.papyrus.gmfgenextension/icons/GenerateMetamodelType.gif b/plugins/toolsmiths/org.eclipse.papyrus.gmfgenextension/icons/GenerateMetamodelType.gif deleted file mode 100644 index b6831627209..00000000000 Binary files a/plugins/toolsmiths/org.eclipse.papyrus.gmfgenextension/icons/GenerateMetamodelType.gif and /dev/null differ diff --git a/plugins/toolsmiths/org.eclipse.papyrus.gmfgenextension/icons/PapyrusLogo16x16.gif b/plugins/toolsmiths/org.eclipse.papyrus.gmfgenextension/icons/PapyrusLogo16x16.gif deleted file mode 100644 index 8a31f458379..00000000000 Binary files a/plugins/toolsmiths/org.eclipse.papyrus.gmfgenextension/icons/PapyrusLogo16x16.gif and /dev/null differ diff --git a/plugins/toolsmiths/org.eclipse.papyrus.gmfgenextension/icons/none_comp_vis.gif b/plugins/toolsmiths/org.eclipse.papyrus.gmfgenextension/icons/none_comp_vis.gif deleted file mode 100644 index a2017d01c82..00000000000 Binary files a/plugins/toolsmiths/org.eclipse.papyrus.gmfgenextension/icons/none_comp_vis.gif and /dev/null differ diff --git a/plugins/toolsmiths/org.eclipse.papyrus.gmfgenextension/icons/palette_view.gif b/plugins/toolsmiths/org.eclipse.papyrus.gmfgenextension/icons/palette_view.gif deleted file mode 100644 index 80c152ab6b4..00000000000 Binary files a/plugins/toolsmiths/org.eclipse.papyrus.gmfgenextension/icons/palette_view.gif and /dev/null differ diff --git a/plugins/toolsmiths/org.eclipse.papyrus.gmfgenextension/icons/updateElementType.gif b/plugins/toolsmiths/org.eclipse.papyrus.gmfgenextension/icons/updateElementType.gif deleted file mode 100644 index e3831471a65..00000000000 Binary files a/plugins/toolsmiths/org.eclipse.papyrus.gmfgenextension/icons/updateElementType.gif and /dev/null differ diff --git a/plugins/toolsmiths/org.eclipse.papyrus.gmfgenextension/model/gmfgneExtension.uml b/plugins/toolsmiths/org.eclipse.papyrus.gmfgenextension/model/gmfgneExtension.uml deleted file mode 100644 index c59fc6f5165..00000000000 --- a/plugins/toolsmiths/org.eclipse.papyrus.gmfgenextension/model/gmfgneExtension.uml +++ /dev/null @@ -1,169 +0,0 @@ - - - - This element is always linked to a genNode (topLevel, or child) -Used set if an editPart is abstract. -SuperGenNodes is a list of all superEditPart. - -Thanks to this, it is possible to factorize code and to decrease the number of generated classes. - - - All extended classes have a comment in order to describe the purpose of this extension - - - The purpose of this class is point to an external class (for example java classes). -the classpath is the path to the this extenal class. - - - This class is used to refresh the figure by taking in account a property of domain element (in the case of Ecore, it can be an Efeature or EReference) -The triggeringCondtion describe the needed condition to launch the action on the figure. these two properties can be code lines. - -For instance we would like to display active class when the efeature class is "active". Or display composite kind of the association when the kind of the property end is "composite". - - - The purpose of this class is to define our own initializer. -For example in the case of UML, the intialize for name may be "name"_'number". -The initAction is code that call this helper use to fill static method " String name_Metaclass_VisualID(Metaclass self) " - - - This class is used to precise itw own locator used for the border item, like port or template. - -for example, in the case of templateSignature of ClassEditPart in the method protected boolean addFixedChild(EditPart childEditPart): -replacement of the general BorderItemLocator is needed in order to constrain the movement. - -if (childEditPart instanceof RedefinableTemplateSignatureEditPart) { - // BorderItemLocator locator = new BorderItemLocator(getMainFigure(), PositionConstants.NORTH); - BorderItemLocator locator = new TemplateClassifierBorderItemLocator(getMainFigure(), PositionConstants.NORTH); - getBorderedFigure().getBorderItemContainer().add(((RedefinableTemplateSignatureEditPart) childEditPart).getFigure(), locator); - return true; -} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/plugins/toolsmiths/org.eclipse.papyrus.gmfgenextension/model/papyrusGmfgenExtension.ecore b/plugins/toolsmiths/org.eclipse.papyrus.gmfgenextension/model/papyrusGmfgenExtension.ecore deleted file mode 100644 index 9ce9871bbcf..00000000000 --- a/plugins/toolsmiths/org.eclipse.papyrus.gmfgenextension/model/papyrusGmfgenExtension.ecore +++ /dev/null @@ -1,202 +0,0 @@ - - - - -
- - - - - - - - - - - -
- - - - - -
- - - - - - -
- - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - -
- - - - - - - - -
- - - - - - -
- - - - - - -
- - - - - - - - - -
- - - - - - -
- - - - - - -
- - - - - -
- - - - -
- - - - - -
- - - - - - - -
- - - - - - - - - diff --git a/plugins/toolsmiths/org.eclipse.papyrus.gmfgenextension/model/papyrusGmfgenExtension.genmodel b/plugins/toolsmiths/org.eclipse.papyrus.gmfgenextension/model/papyrusGmfgenExtension.genmodel deleted file mode 100644 index 53e3c347edf..00000000000 --- a/plugins/toolsmiths/org.eclipse.papyrus.gmfgenextension/model/papyrusGmfgenExtension.genmodel +++ /dev/null @@ -1,121 +0,0 @@ - - - papyrusGmfgenExtension.ecore - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - -
- - - - -
- - - - - - - - - - - - - - - - - - diff --git a/plugins/toolsmiths/org.eclipse.papyrus.gmfgenextension/plugin.properties b/plugins/toolsmiths/org.eclipse.papyrus.gmfgenextension/plugin.properties deleted file mode 100644 index 39147a30961..00000000000 --- a/plugins/toolsmiths/org.eclipse.papyrus.gmfgenextension/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 2.0 -# which accompanies this distribution, and is available at -# https://www.eclipse.org/legal/epl-2.0/ -# -# SPDX-License-Identifier: EPL-2.0 -# -# Contributors: -# Patrick Tessier patrick.tessier@cea.fr - Initial API and implementation -################################################################################## -pluginName = Papyrus Extensions to the GMFGen Model Plugin -providerName=Eclipse Modeling Project diff --git a/plugins/toolsmiths/org.eclipse.papyrus.gmfgenextension/plugin.xml b/plugins/toolsmiths/org.eclipse.papyrus.gmfgenextension/plugin.xml deleted file mode 100644 index 01ba66d85fe..00000000000 --- a/plugins/toolsmiths/org.eclipse.papyrus.gmfgenextension/plugin.xml +++ /dev/null @@ -1,303 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/plugins/toolsmiths/org.eclipse.papyrus.gmfgenextension/pom.xml b/plugins/toolsmiths/org.eclipse.papyrus.gmfgenextension/pom.xml deleted file mode 100644 index 36a15d06064..00000000000 --- a/plugins/toolsmiths/org.eclipse.papyrus.gmfgenextension/pom.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - 4.0.0 - - org.eclipse.papyrus-toolsmiths - org.eclipse.papyrus - 0.0.1-SNAPSHOT - - org.eclipse.papyrus.gmfgenextension - org.eclipse.papyrus - 3.0.0-SNAPSHOT - eclipse-plugin - \ No newline at end of file diff --git a/plugins/toolsmiths/org.eclipse.papyrus.gmfgenextension/src/org/eclipse/papyrus/papyrusgmfgenextension/popupaction/Action.java b/plugins/toolsmiths/org.eclipse.papyrus.gmfgenextension/src/org/eclipse/papyrus/papyrusgmfgenextension/popupaction/Action.java deleted file mode 100644 index 2b1a1a18b46..00000000000 --- a/plugins/toolsmiths/org.eclipse.papyrus.gmfgenextension/src/org/eclipse/papyrus/papyrusgmfgenextension/popupaction/Action.java +++ /dev/null @@ -1,182 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2009 CEA LIST. - * All rights reserved. This program and the accompanying materials - * are property of the CEA, their use is subject to specific agreement - * with the CEA. - * - * Contributors: - * CEA LIST - initial API and implementation - *******************************************************************************/ - -package org.eclipse.papyrus.papyrusgmfgenextension.popupaction; - -import java.util.Iterator; -import java.util.LinkedList; -import java.util.List; - -import org.eclipse.emf.codegen.ecore.genmodel.GenClass; -import org.eclipse.emf.codegen.ecore.genmodel.GenFeature; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.resource.Resource; -import org.eclipse.jface.action.IAction; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.papyrus.gmf.codegen.gmfgen.Behaviour; -import org.eclipse.papyrus.gmf.codegen.gmfgen.CustomBehaviour; -import org.eclipse.papyrus.gmf.codegen.gmfgen.GMFGenFactory; -import org.eclipse.papyrus.gmf.codegen.gmfgen.GenCommonBase; -import org.eclipse.ui.IObjectActionDelegate; -import org.eclipse.ui.IWorkbenchPart; - -public abstract class Action implements IObjectActionDelegate { - - private List selectedListEObject; - - /** - * Convert each selected elements from the explorer menu, or modeling view to an EObject and add it to a list - * - * @return list of EObject - */ - public void updateSelectedEObject(IStructuredSelection selection) { - - List selectedCurrentListEObjects = new LinkedList(); - - Iterator eltIt = selection.iterator(); - while (eltIt.hasNext()) { - - Object currentObject = eltIt.next(); - if (currentObject instanceof EObject) { - selectedCurrentListEObjects.add((EObject) currentObject); - } - } - selectedListEObject = selectedCurrentListEObjects; - } - - public List getSelectedEObject() { - return selectedListEObject; - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection) - */ - @Override - public void selectionChanged(IAction action, ISelection selection) { - // Convert selection into EObject list - updateSelectedEObject((IStructuredSelection) selection); - } - - @Override - public void setActivePart(IAction action, IWorkbenchPart targetPart) { - // NO OP. - } - - /** - * Check if the CustomBehavior for policyKey is already added - * - * @param genlink - * the GenLink to test - * @param policyKey - * that we look for - * @return true if the behavior with correct key already exists - */ - protected boolean hasCustomBehavior(GenCommonBase genCommonBase, String policyKey) { - - boolean hasCustomBehavior = false; - - Iterator it = genCommonBase.getBehaviour().iterator(); - while (it.hasNext() && !(hasCustomBehavior)) { - Behaviour behaviour = it.next(); - - if (behaviour instanceof CustomBehaviour) { - CustomBehaviour customBehavior = (CustomBehaviour) behaviour; - if (policyKey.equals(customBehavior.getKey())) { - hasCustomBehavior = true; - } - } - } - - return hasCustomBehavior; - } - - /** - * Add the CustomBehavior for Applied Stereotype label display to the GenLink node given as - * parameter - * - * @param genCommonBase - * where the CustomBehavior is added - */ - protected void addCustomBehavior(GenCommonBase genCommonBase, String policyKey, String policyValue) { - - CustomBehaviour behavior = GMFGenFactory.eINSTANCE.createCustomBehaviour(); - behavior.setKey(policyKey); - behavior.setEditPolicyQualifiedClassName(policyValue); - - genCommonBase.getBehaviour().add(behavior); - } - - /** - * Find the GenClass node with specified name in the resource model (GenModel expected here) - * - * @param resource - * the genmodel - * @param name - * of the searched GenClass - * @return genClass with chosen name or null - */ - protected GenClass findGenClass(Resource resource, String name) { - - GenClass genClass = null; - Iterator it = resource.getAllContents(); - while (it.hasNext() && (genClass == null)) { - EObject eobject = it.next(); - - if (eobject instanceof GenClass) { - GenClass current = (GenClass) eobject; - if (name.equals(current.getName())) { - genClass = current; - } - } - } - return genClass; - } - - /** - * Finds a GenFeature owned by a specified GenClass in the resource (genmodel) - * - * @param resource - * the genmodel - * @param genClassName - * the name of GenClass owning the searched feature - * @param genFeatureName - * the name of the GenFeature - * @return the found GenFeature node or null - */ - protected GenFeature findGenFeature(Resource resource, String genClassName, String genFeatureName) { - - GenFeature genFeature = null; - - Iterator it = resource.getAllContents(); - while (it.hasNext() && (genFeature == null)) { - EObject eobject = it.next(); - - if (eobject instanceof GenClass) { - GenClass genClass = (GenClass) eobject; - - if (genClassName.equals(genClass.getName())) { - - Iterator itGF = genClass.getAllGenFeatures().iterator(); - while (itGF.hasNext() && (genFeature == null)) { - GenFeature currentGenFeature = itGF.next(); - - if (genFeatureName.equals(currentGenFeature.getEcoreFeature().getName())) { - genFeature = currentGenFeature; - } - } - } - } - } - return genFeature; - } -} diff --git a/plugins/toolsmiths/org.eclipse.papyrus.gmfgenextension/src/org/eclipse/papyrus/papyrusgmfgenextension/popupaction/AddDefaultNamedElementAction.java b/plugins/toolsmiths/org.eclipse.papyrus.gmfgenextension/src/org/eclipse/papyrus/papyrusgmfgenextension/popupaction/AddDefaultNamedElementAction.java deleted file mode 100644 index 42c299e86ee..00000000000 --- a/plugins/toolsmiths/org.eclipse.papyrus.gmfgenextension/src/org/eclipse/papyrus/papyrusgmfgenextension/popupaction/AddDefaultNamedElementAction.java +++ /dev/null @@ -1,165 +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 2.0 - * which accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation - * - *****************************************************************************/ -package org.eclipse.papyrus.papyrusgmfgenextension.popupaction; - -import java.util.Iterator; - -import org.eclipse.emf.common.util.URI; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.resource.Resource; -import org.eclipse.jface.action.IAction; -import org.eclipse.jface.dialogs.MessageDialog; -import org.eclipse.papyrus.gmf.codegen.gmfgen.GenDiagram; -import org.eclipse.papyrus.gmf.codegen.gmfgen.GenLabel; -import org.eclipse.papyrus.gmf.codegen.gmfgen.GenTopLevelNode; -import org.eclipse.swt.widgets.Shell; - - -/** - * The Class AddDefaultNamedElementAction it create an edti part to show a named element in the diagram - */ -public class AddDefaultNamedElementAction extends Action { - - - /** The Constant PACKAGED_ELEMENT_ATTRIBUTE. */ - protected static final String PACKAGED_ELEMENT_ATTRIBUTE = "packagedElement"; //$NON-NLS-1$ - - /** The Constant PACKAGE_NAME. */ - protected static final String PACKAGE_NAME = "Package"; //$NON-NLS-1$ - - /** The Constant UNKNOW_EDITPOLICY. */ - protected static final String UNKNOW_EDITPOLICY = "YOUR OWN CHANGE SHAPE EDIT POLICY"; //$NON-NLS-1$ - - /** The Constant QUALIFIED_NAME_DISPLAY_EDIT_POLICY_VALUE. */ - protected static final String QUALIFIED_NAME_DISPLAY_EDIT_POLICY_VALUE = "org.eclipse.papyrus.diagram.common.editpolicies.QualifiedNameDisplayEditPolicy"; //$NON-NLS-1$ - - /** The Constant NODE_LABEL_DISPLAY_EDIT_POLICY_VALUE. */ - protected static final String NODE_LABEL_DISPLAY_EDIT_POLICY_VALUE = "org.eclipse.papyrus.diagram.common.editpolicies.AppliedStereotypeNodeLabelDisplayEditPolicy"; //$NON-NLS-1$ - - /** The Constant POPUP_BAR_EDIT_POLICY_VALUE. */ - protected static final String POPUP_BAR_EDIT_POLICY_VALUE = "org.eclipse.papyrus.diagram.common.editpolicies.HyperLinkPopupBarEditPolicy"; //$NON-NLS-1$ - - /** The Constant CHANGE_SHAPE_POLICY_KEY. */ - protected static final String CHANGE_SHAPE_POLICY_KEY = "org.eclipse.papyrus.diagram.common.editpolicies.ChangeStereotypedShapeEditPolicy.CHANGE_SHAPE_POLICY"; //$NON-NLS-1$ - - /** The Constant POLICY_QUALIFIED_NAME_POLICY_KEY. */ - protected static final String POLICY_QUALIFIED_NAME_POLICY_KEY = "org.eclipse.papyrus.diagram.common.editpolicies.QualifiedNameDisplayEditPolicy.QUALIFIED_NAME_POLICY"; //$NON-NLS-1$ - - /** The Constant STEREOTYPE_LABEL_POLICY_KEY. */ - protected static final String STEREOTYPE_LABEL_POLICY_KEY = "org.eclipse.papyrus.diagram.common.editpolicies.AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY"; //$NON-NLS-1$ - - /** The Constant POPUPBAR_ROLE_KEY. */ - protected static final String POPUPBAR_ROLE_KEY = "org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.POPUPBAR_ROLE"; //$NON-NLS-1$ - - /** The Constant NAME_ATTRIBUTE. */ - protected static final String NAME_ATTRIBUTE = "name"; //$NON-NLS-1$ - - /** The Constant NAMED_ELEMENT_NAME. */ - protected static final String NAMED_ELEMENT_NAME = "NamedElement"; //$NON-NLS-1$ - - /** The Constant NODE_NAMED_ELEMENT_FIGURE. */ - protected static final String NODE_NAMED_ELEMENT_FIGURE = "org.eclipse.papyrus.diagram.common.figure.node.NodeNamedElementFigure"; //$NON-NLS-1$ - - /** The Constant GMF_NODE. */ - protected static final String GMF_NODE = "Node"; //$NON-NLS-1$ - - /** The Constant WRAPPING_LABEL. */ - protected static final String WRAPPING_LABEL = "org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel"; //$NON-NLS-1$ - - /** The Constant DEFAULT_NAMED_ELEMENT_NAME. */ - protected static final String DEFAULT_NAMED_ELEMENT_NAME = "DefaultNamedElementName"; //$NON-NLS-1$ - - /** The Constant URI_UML_GENMODEL. */ - protected static final String URI_UML_GENMODEL = "org.eclipse.uml2.uml/model/UML.genmodel"; //$NON-NLS-1$ - - /** The Constant URI_NOTATION_GENMODEL. */ - protected static final String URI_NOTATION_GENMODEL = "org.eclipse.gmf.runtime.notation/model/notation.genmodel"; //$NON-NLS-1$ - - /** The Constant DEFAULT_NAMED_ELEMENT. */ - private static final String DEFAULT_NAMED_ELEMENT = "DefaultNamedElement"; //$NON-NLS-1$ - - /** - * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction) - * - * @param action - */ - @Override - public void run(IAction action) { - Iterator it = getSelectedEObject().iterator(); - while (it.hasNext()) { - EObject eObject = it.next(); - if (eObject instanceof GenDiagram) { - GenDiagram genDiagram = ((GenDiagram) eObject); - createTopNode(genDiagram); - } - } - } - - /** - * Creates the top node. - * - * @param genDiagram - * the gen diagram - */ - public void createTopNode(GenDiagram genDiagram) { - URI uri_notation = URI.createPlatformPluginURI(URI_NOTATION_GENMODEL, false); - - Resource notation = genDiagram.eResource().getResourceSet().getResource(uri_notation, true); - - GenTopLevelNode topNode = EditpartGenHelper.createTopNode(genDiagram, DEFAULT_NAMED_ELEMENT, findGenClass(notation, GMF_NODE)); - genDiagram.getTopLevelNodes().add(topNode); - EditpartGenHelper.createMetaModelType(topNode, DEFAULT_NAMED_ELEMENT); - addBehavior(topNode); - addModelFacet(topNode); - GenLabel label = EditpartGenHelper.createGenNodeLabel(topNode, DEFAULT_NAMED_ELEMENT_NAME, findGenClass(notation, GMF_NODE)); - EditpartGenHelper.createLabelViewMap(label, WRAPPING_LABEL); - findGenClass(notation, GMF_NODE); - EditpartGenHelper.createFigureViewMap(topNode, NODE_NAMED_ELEMENT_FIGURE, 100, 50); - URI uri_uml = URI.createPlatformPluginURI(URI_UML_GENMODEL, false); - Resource uml = topNode.eResource().getResourceSet().getResource(uri_uml, true); - EditpartGenHelper.createLabelModelFacet(label, findGenFeature(uml, NAMED_ELEMENT_NAME, NAME_ATTRIBUTE), EditpartGenHelper.getFirstPredefinedParse(genDiagram.getEditorGen())); - MessageDialog.open(MessageDialog.INFORMATION, new Shell(), Messages.generalInformation, Messages.message_Intro + Messages.rulesAboutNamedElement + Messages.ruleAboutChangeEditPolicy, MessageDialog.NONE); - - } - - /** - * Adds behaviors. - * - * @param topNode - * the top node - */ - public void addBehavior(GenTopLevelNode topNode) { - // add behavior - EditpartGenHelper.addBehavior(topNode, POPUPBAR_ROLE_KEY, POPUP_BAR_EDIT_POLICY_VALUE); - EditpartGenHelper.addBehavior(topNode, STEREOTYPE_LABEL_POLICY_KEY, NODE_LABEL_DISPLAY_EDIT_POLICY_VALUE); - EditpartGenHelper.addBehavior(topNode, POLICY_QUALIFIED_NAME_POLICY_KEY, QUALIFIED_NAME_DISPLAY_EDIT_POLICY_VALUE); - EditpartGenHelper.addBehavior(topNode, CHANGE_SHAPE_POLICY_KEY, UNKNOW_EDITPOLICY); - } - - /** - * Adds the model facet. - * - * @param topNode - * the top node - */ - public void addModelFacet(GenTopLevelNode topNode) { - URI uri_uml = URI.createPlatformPluginURI(URI_UML_GENMODEL, false); - Resource uml = topNode.eResource().getResourceSet().getResource(uri_uml, true); - EditpartGenHelper.createModelFacet(topNode, findGenFeature(uml, PACKAGE_NAME, PACKAGED_ELEMENT_ATTRIBUTE), findGenClass(uml, NAMED_ELEMENT_NAME)); - - } - -} diff --git a/plugins/toolsmiths/org.eclipse.papyrus.gmfgenextension/src/org/eclipse/papyrus/papyrusgmfgenextension/popupaction/AddExternalNodeFloatingLabelDisplayBehavior.java b/plugins/toolsmiths/org.eclipse.papyrus.gmfgenextension/src/org/eclipse/papyrus/papyrusgmfgenextension/popupaction/AddExternalNodeFloatingLabelDisplayBehavior.java deleted file mode 100644 index ca9e558edb4..00000000000 --- a/plugins/toolsmiths/org.eclipse.papyrus.gmfgenextension/src/org/eclipse/papyrus/papyrusgmfgenextension/popupaction/AddExternalNodeFloatingLabelDisplayBehavior.java +++ /dev/null @@ -1,225 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2009, 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 2.0 - * which accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Mickael ADAM (ALL4TEC) mickael.adam@all4tec.net - Initial API and implementation - * - *****************************************************************************/ - -package org.eclipse.papyrus.papyrusgmfgenextension.popupaction; - -import java.util.Iterator; - -import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.common.util.URI; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.resource.Resource; -import org.eclipse.jface.action.IAction; -import org.eclipse.papyrus.gmf.codegen.gmfgen.FeatureLabelModelFacet; -import org.eclipse.papyrus.gmf.codegen.gmfgen.FigureViewmap; -import org.eclipse.papyrus.gmf.codegen.gmfgen.GMFGenFactory; -import org.eclipse.papyrus.gmf.codegen.gmfgen.GenEditorGenerator; -import org.eclipse.papyrus.gmf.codegen.gmfgen.GenExternalNodeLabel; -import org.eclipse.papyrus.gmf.codegen.gmfgen.GenLinkLabel; -import org.eclipse.papyrus.gmf.codegen.gmfgen.GenNode; -import org.eclipse.papyrus.gmf.codegen.gmfgen.GenNodeLabel; -import org.eclipse.papyrus.gmf.codegen.gmfgen.GenParsers; -import org.eclipse.papyrus.gmf.codegen.gmfgen.PredefinedParser; -import org.eclipse.ui.IViewPart; - -/** - * this class is used to add a label to display name from external node - */ -public class AddExternalNodeFloatingLabelDisplayBehavior extends Action { - - public static final String FIGURE_VIEWMAP_PATH = "org.eclipse.papyrus.infra.gmfdiag.common.figure.node.PapyrusWrappingLabel";// "org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel"; //$NON-NLS-1$ - - public static final String LABEL_POLICY_CLASS = "org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.ExternalLabelPrimaryDragRoleEditPolicy"; //$NON-NLS-1$ - - public static final String LABEL_POLICY_KEY = "org.eclipse.gef.EditPolicy.PRIMARY_DRAG_ROLE"; //$NON-NLS-1$ - - public static final String DEFAULT_GETTER_NAME = "getFloatingNameLabel"; //$NON-NLS-1$ - - public static final String DEFAULT_EDITPART_NAME_SUFFIX = "FloatingLabelEditPart"; //$NON-NLS-1$ - - public static final String DEFAULT_EDITPOLICY_NAME_SUFFIX = "FloatingLabelItemSemanticEditPolicy"; //$NON-NLS-1$ - - // public static final String DEFAULT_WRAPPING_LABEL_CLASS = "org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel"; //$NON-NLS-1$ - - public static final String DEFAULT_PARSER_PATTERN = ""; //$NON-NLS-1$ - - public static final String GEN_CLASS_RT_CLASS = "Node"; //$NON-NLS-1$ - - public static final String GEN_CLASS_FACET_META_FEATURE = "NamedElement"; //$NON-NLS-1$ - - public static final String GEN_FEATURE_FACET_META_FEATURE = "name"; //$NON-NLS-1$ - - public static final String URI_NOTATION_GENMODEL = "org.eclipse.gmf.runtime.notation/model/notation.genmodel"; //$NON-NLS-1$ - - public static final String URI_UML_GENMODEL = "org.eclipse.uml2.uml/model/UML.genmodel"; //$NON-NLS-1$ - - /* - * (non-Javadoc) - * - * @see org.eclipse.ui.IViewActionDelegate#init(org.eclipse.ui.IViewPart) - */ - public void init(IViewPart view) { - // NO OP - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction) - */ - @Override - public void run(IAction action) { - // Parse selected GenLink(s) and add the desired CustomBehavior - Iterator it = getSelectedEObject().iterator(); - while (it.hasNext()) { - EObject eObject = it.next(); - if (eObject instanceof GenNode) { - // test if it has got a external node to display floating name - if (!hasAnFloatingNameExternalNode((GenNode) eObject)) { - createAnFloatingNameExternalNode((GenNode) eObject); - } - } - } - } - - /** - * creation an external node floating name - * - * @param genNode - * the parent genNode - */ - private void createAnFloatingNameExternalNode(GenNode genNode) { - // Create une external node label - GenExternalNodeLabel label = GMFGenFactory.eINSTANCE.createGenExternalNodeLabel(); - - // Set Name of the edit part - // label.setEditPartClassName(genNode.getClassNamePrefix() + DEFAULT_EDITPART_NAME_SUFFIX); - - String editPartClassName = genNode.getEditPartClassName(); - int index = editPartClassName.indexOf("EditPart"); - String name = editPartClassName.substring(0, index) + DEFAULT_EDITPART_NAME_SUFFIX + editPartClassName.substring(index + "EditPart".length()); - label.setEditPartClassName(name); - // Set item semantic edit policy - label.setItemSemanticEditPolicyClassName(genNode.getClassNamePrefix() + DEFAULT_EDITPOLICY_NAME_SUFFIX); - // Set the Read only - label.setReadOnly(false); - - // Set GenLinkLabel VisualID with new unique ID - int visualID = SetVisualIDWithUnusedValue.getNewVisualID(genNode.eResource(), GenLinkLabel.class); - label.setVisualID(visualID); - - // Retrieve DiagramRunTimeClass in notation.genmodel (Node -> View) - URI uri_notation = URI.createPlatformPluginURI(URI_NOTATION_GENMODEL, false); - Resource notation = genNode.eResource().getResourceSet().getResource(uri_notation, true); - label.setDiagramRunTimeClass(findGenClass(notation, GEN_CLASS_RT_CLASS)); - - // Create Viewmap - FigureViewmap viewmap = GMFGenFactory.eINSTANCE.createFigureViewmap(); - viewmap.setFigureQualifiedClassName(FIGURE_VIEWMAP_PATH); - - // Create FeatureLabelModelFacet - FeatureLabelModelFacet facet = GMFGenFactory.eINSTANCE.createFeatureLabelModelFacet(); - facet.setEditPattern(DEFAULT_PARSER_PATTERN); - facet.setEditorPattern(DEFAULT_PARSER_PATTERN); - facet.setViewPattern(DEFAULT_PARSER_PATTERN); - - // Select NamedElement::name property in UML.genmodel for MetaFeatures - URI uri_uml = URI.createPlatformPluginURI(URI_UML_GENMODEL, false); - Resource uml = genNode.eResource().getResourceSet().getResource(uri_uml, true); - facet.getMetaFeatures().add(findGenFeature(uml, GEN_CLASS_FACET_META_FEATURE, GEN_FEATURE_FACET_META_FEATURE)); - // Attach Predefined Parser MessageFormatParser - // not good must find the predifined parser of the model... - - // Get the predefined parser. - PredefinedParser parser = getPredefinedParser(genNode); - facet.setParser(parser); - - // Attach created element one to another in the model - label.setViewmap(viewmap); - label.setModelFacet(facet); - - // Add custom Policy to have feedback - // addCustomBehavior(label, LABEL_POLICY_KEY, LABEL_POLICY_CLASS); - - // edit policy which permit to take into account of specific locator of external label - addCustomBehavior(genNode, "org.eclipse.gef.EditPolicy.LAYOUT_ROLE", "org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.GetChildLayoutEditPolicy"); - - genNode.getLabels().add(label); - } - - /** - * Gets the predefined parser. - * - * @param eObject - * the e object - * @return the predefined parser - */ - private PredefinedParser getPredefinedParser(GenNode eObject) { - PredefinedParser parser = null; - // /get the ressource contents - EList ressourceContents = eObject.eResource().getContents(); - for (EObject ressourceContent : ressourceContents) { - // get the Gen Editor Node - if (ressourceContent instanceof GenEditorGenerator) { - // Get Parsers node - GenParsers genParsers = ((GenEditorGenerator) ressourceContent).getLabelParsers(); - for (EObject GenParsersContent : genParsers.eContents()) { - // Get the predefined parser - if (GenParsersContent instanceof PredefinedParser) { - parser = (PredefinedParser) GenParsersContent; - } - } - } - } - return parser; - } - - /** - * Checks for a floating name external node. - * - * @param node - * the node - * @return true, if successful - */ - public boolean hasAnFloatingNameExternalNode(GenNode node) { - Iterator iterator = node.getLabels().iterator(); - while (iterator.hasNext()) { - GenNodeLabel currentGenNodeLabel = iterator.next(); - // check each child node - if (currentGenNodeLabel instanceof GenExternalNodeLabel) { - if (isAnFloatingNameExternalNode((GenExternalNodeLabel) currentGenNodeLabel)) { - return true; - } - } - } - return false; - } - - /** - * Checks if is an floating name external node. - * - * @param node - * the node - * @return true, if is an floating name external node - */ - public boolean isAnFloatingNameExternalNode(GenExternalNodeLabel node) { - // Look if the edit part name contains the default edit part name suffix - if (node.getEditPartClassName().contains(DEFAULT_EDITPART_NAME_SUFFIX)) { - return true; - } else { - return false; - } - } -} diff --git a/plugins/toolsmiths/org.eclipse.papyrus.gmfgenextension/src/org/eclipse/papyrus/papyrusgmfgenextension/popupaction/AddExternalNodeStereotypeDisplayBehavior.java b/plugins/toolsmiths/org.eclipse.papyrus.gmfgenextension/src/org/eclipse/papyrus/papyrusgmfgenextension/popupaction/AddExternalNodeStereotypeDisplayBehavior.java deleted file mode 100644 index 85203a75a97..00000000000 --- a/plugins/toolsmiths/org.eclipse.papyrus.gmfgenextension/src/org/eclipse/papyrus/papyrusgmfgenextension/popupaction/AddExternalNodeStereotypeDisplayBehavior.java +++ /dev/null @@ -1,169 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2009 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License 2.0 - * which accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation - * - *****************************************************************************/ - - -package org.eclipse.papyrus.papyrusgmfgenextension.popupaction; - -import java.util.Iterator; - -import org.eclipse.emf.common.util.URI; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.resource.Resource; -import org.eclipse.jface.action.IAction; -import org.eclipse.papyrus.gmf.codegen.gmfgen.FeatureLabelModelFacet; -import org.eclipse.papyrus.gmf.codegen.gmfgen.FigureViewmap; -import org.eclipse.papyrus.gmf.codegen.gmfgen.GMFGenFactory; -import org.eclipse.papyrus.gmf.codegen.gmfgen.GenExternalNodeLabel; -import org.eclipse.papyrus.gmf.codegen.gmfgen.GenLinkLabel; -import org.eclipse.papyrus.gmf.codegen.gmfgen.GenNode; -import org.eclipse.papyrus.gmf.codegen.gmfgen.GenNodeLabel; -import org.eclipse.ui.IViewPart; - -/** - * this class is used to add a label to display applied stereotypes for external node - */ -public class AddExternalNodeStereotypeDisplayBehavior extends Action { - - public static final String FIGURE_VIEWMAP_PATH = "org.eclipse.papyrus.diagram.common.figure.node.AppliedStereotypeWrappingLabelFigure"; //$NON-NLS-1$ - - public static final String STEREOTYPE_LABEL_POLICY_KEY = "org.eclipse.papyrus.diagram.common.editpolicies.AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY"; //$NON-NLS-1$ - - public static final String STEREOTYPE_LABEL_POLICY_CLASS = "org.eclipse.papyrus.diagram.common.editpolicies.AppliedStereotypeExternalNodeEditPolicy"; //$NON-NLS-1$ - - public static final String DEFAULT_GETTER_NAME = "getAppliedStereotypeLabel"; //$NON-NLS-1$ - - public static final String DEFAULT_EDITPART_NAME_SUFFIX = "AppliedStereotypeEditPart"; //$NON-NLS-1$ - - public static final String DEFAULT_EDITPOLICY_NAME_SUFFIX = "AppliedStereotypeItemSemanticEditPolicy"; //$NON-NLS-1$ - - public static final String DEFAULT_WRAPPING_LABEL_CLASS = "org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel"; //$NON-NLS-1$ - - public static final int DEFAULT_OFFSET_X = 0; - - public static final int DEFAULT_OFFSET_Y = 60; - - public static final String DEFAULT_PARSER_PATTERN = "<<{0}>>"; //$NON-NLS-1$ - - public static final String APPLIED_STEREOTYPE_CUSTOM_PARSER_CLASS = "org.eclipse.papyrus.diagram.common.parser.stereotype.AppliedStereotypeParser"; //$NON-NLS-1$ - - public static final String GEN_CLASS_RT_CLASS = "Node"; //$NON-NLS-1$ - - public static final String GEN_CLASS_FACET_META_FEATURE = "NamedElement"; //$NON-NLS-1$ - - public static final String GEN_FEATURE_FACET_META_FEATURE = "name"; //$NON-NLS-1$ - - public static final String URI_NOTATION_GENMODEL = "org.eclipse.gmf.runtime.notation/model/notation.genmodel"; //$NON-NLS-1$ - - public static final String URI_UML_GENMODEL = "org.eclipse.uml2.uml/model/UML.genmodel"; //$NON-NLS-1$ - - /* - * (non-Javadoc) - * - * @see org.eclipse.ui.IViewActionDelegate#init(org.eclipse.ui.IViewPart) - */ - public void init(IViewPart view) { - // NO OP - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction) - */ - @Override - public void run(IAction action) { - - // Parse selected GenLink(s) and add the desired CustomBehavior - Iterator it = getSelectedEObject().iterator(); - while (it.hasNext()) { - EObject eObject = it.next(); - if (eObject instanceof GenNode) { - // test if it has got a external node to display applied stereotype - if (!hasAnAppliedStereotypExternalNode((GenNode) eObject)) { - createAnAppliedStereotypExternalNode((GenNode) eObject); - } - } - } - } - - - /** - * creation an external node stereotype - * - * @param eObject - * the parent genNode - */ - private void createAnAppliedStereotypExternalNode(GenNode eObject) { - GenExternalNodeLabel label = GMFGenFactory.eINSTANCE.createGenExternalNodeLabel(); - label.setEditPartClassName(eObject.getClassNamePrefix() + DEFAULT_EDITPART_NAME_SUFFIX); - label.setItemSemanticEditPolicyClassName(eObject.getClassNamePrefix() + DEFAULT_EDITPOLICY_NAME_SUFFIX); - label.setReadOnly(true); - - // Set GenLinkLabel VisualID with new unique ID - int visualID = SetVisualIDWithUnusedValue.getNewVisualID(eObject.eResource(), GenLinkLabel.class); - label.setVisualID(visualID); - - // Retrieve DiagramRunTimeClass in notation.genmodel (Node -> View) - URI uri_notation = URI.createPlatformPluginURI(URI_NOTATION_GENMODEL, false); - Resource notation = eObject.eResource().getResourceSet().getResource(uri_notation, true); - label.setDiagramRunTimeClass(findGenClass(notation, GEN_CLASS_RT_CLASS)); - - // Create Viewmap - FigureViewmap viewmap = GMFGenFactory.eINSTANCE.createFigureViewmap(); - viewmap.setFigureQualifiedClassName(FIGURE_VIEWMAP_PATH); - - - // Create FeatureLabelModelFacet - FeatureLabelModelFacet facet = GMFGenFactory.eINSTANCE.createFeatureLabelModelFacet(); - facet.setEditPattern(DEFAULT_PARSER_PATTERN); - facet.setEditorPattern(DEFAULT_PARSER_PATTERN); - facet.setViewPattern(DEFAULT_PARSER_PATTERN); - // Select NamedElement::name property in UML.genmodel for MetaFeatures - URI uri_uml = URI.createPlatformPluginURI(URI_UML_GENMODEL, false); - Resource uml = eObject.eResource().getResourceSet().getResource(uri_uml, true); - facet.getMetaFeatures().add(findGenFeature(uml, GEN_CLASS_FACET_META_FEATURE, GEN_FEATURE_FACET_META_FEATURE)); - - // Attach created element one to another in the model - label.setViewmap(viewmap); - label.setModelFacet(facet); - - addCustomBehavior(label, STEREOTYPE_LABEL_POLICY_KEY, STEREOTYPE_LABEL_POLICY_CLASS); - eObject.getLabels().add(label); - - - } - - - public boolean hasAnAppliedStereotypExternalNode(GenNode node) { - Iterator iterator = node.getLabels().iterator(); - while (iterator.hasNext()) { - GenNodeLabel currentGenNodeLabel = iterator.next(); - if (currentGenNodeLabel instanceof GenExternalNodeLabel) { - if (isAnAppliedStereotypExternalNode((GenExternalNodeLabel) currentGenNodeLabel)) { - return true; - } - } - } - return false; - } - - public boolean isAnAppliedStereotypExternalNode(GenExternalNodeLabel node) { - return hasCustomBehavior(node, STEREOTYPE_LABEL_POLICY_KEY); - } - - - -} diff --git a/plugins/toolsmiths/org.eclipse.papyrus.gmfgenextension/src/org/eclipse/papyrus/papyrusgmfgenextension/popupaction/AddGenLinkStereotypeDisplayBehavior.java b/plugins/toolsmiths/org.eclipse.papyrus.gmfgenextension/src/org/eclipse/papyrus/papyrusgmfgenextension/popupaction/AddGenLinkStereotypeDisplayBehavior.java deleted file mode 100644 index def73510654..00000000000 --- a/plugins/toolsmiths/org.eclipse.papyrus.gmfgenextension/src/org/eclipse/papyrus/papyrusgmfgenextension/popupaction/AddGenLinkStereotypeDisplayBehavior.java +++ /dev/null @@ -1,221 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2009 CEA LIST. - * All rights reserved. This program and the accompanying materials - * are property of the CEA, their use is subject to specific agreement - * with the CEA. - * - * Contributors: - * CEA LIST - initial API and implementation - *******************************************************************************/ - -package org.eclipse.papyrus.papyrusgmfgenextension.popupaction; - -import java.util.Iterator; - -import org.eclipse.emf.common.util.URI; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.resource.Resource; -import org.eclipse.jface.action.IAction; -import org.eclipse.papyrus.gmf.codegen.gmfgen.CustomParser; -import org.eclipse.papyrus.gmf.codegen.gmfgen.FeatureLabelModelFacet; -import org.eclipse.papyrus.gmf.codegen.gmfgen.GMFGenFactory; -import org.eclipse.papyrus.gmf.codegen.gmfgen.GenEditorGenerator; -import org.eclipse.papyrus.gmf.codegen.gmfgen.GenLink; -import org.eclipse.papyrus.gmf.codegen.gmfgen.GenLinkLabel; -import org.eclipse.papyrus.gmf.codegen.gmfgen.GenParserImplementation; -import org.eclipse.papyrus.gmf.codegen.gmfgen.LabelOffsetAttributes; -import org.eclipse.papyrus.gmf.codegen.gmfgen.LinkLabelAlignment; -import org.eclipse.papyrus.gmf.codegen.gmfgen.ParentAssignedViewmap; -import org.eclipse.ui.IViewPart; - -/** - * Implementation class for AddGenLinkStereotypeDisplayBehavior action - */ -public class AddGenLinkStereotypeDisplayBehavior extends Action { - - public static final String STEREOTYPE_LABEL_POLICY_KEY = "org.eclipse.papyrus.diagram.common.editpolicies.AppliedStereotypeLinkLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY"; //$NON-NLS-1$ - - public static final String STEREOTYPE_LABEL_POLICY_CLASS = "org.eclipse.papyrus.diagram.common.editpolicies.AppliedStereotypeLinkLabelDisplayEditPolicy"; //$NON-NLS-1$ - - public static final String DEFAULT_GETTER_NAME = "getAppliedStereotypeLabel"; //$NON-NLS-1$ - - public static final String DEFAULT_EDITPART_NAME_SUFFIX = "AppliedStereotypeEditPart"; //$NON-NLS-1$ - - public static final String DEFAULT_EDITPOLICY_NAME_SUFFIX = "AppliedStereotypeItemSemanticEditPolicy"; //$NON-NLS-1$ - - public static final String DEFAULT_WRAPPING_LABEL_CLASS = "org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel"; //$NON-NLS-1$ - - public static final int DEFAULT_OFFSET_X = 0; - - public static final int DEFAULT_OFFSET_Y = 60; - - public static final String DEFAULT_PARSER_PATTERN = "<<{0}>>"; //$NON-NLS-1$ - - public static final String APPLIED_STEREOTYPE_CUSTOM_PARSER_CLASS = "org.eclipse.papyrus.diagram.common.parser.stereotype.AppliedStereotypeParser"; //$NON-NLS-1$ - - public static final String GEN_CLASS_RT_CLASS = "Node"; //$NON-NLS-1$ - - public static final String GEN_CLASS_FACET_META_FEATURE = "NamedElement"; //$NON-NLS-1$ - - public static final String GEN_FEATURE_FACET_META_FEATURE = "name"; //$NON-NLS-1$ - - public static final String URI_NOTATION_GENMODEL = "org.eclipse.gmf.runtime.notation/model/notation.genmodel"; //$NON-NLS-1$ - - public static final String URI_UML_GENMODEL = "org.eclipse.uml2.uml/model/UML.genmodel"; //$NON-NLS-1$ - - /* - * (non-Javadoc) - * - * @see org.eclipse.ui.IViewActionDelegate#init(org.eclipse.ui.IViewPart) - */ - public void init(IViewPart view) { - // NO OP - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction) - */ - @Override - public void run(IAction action) { - - // Parse selected GenLink(s) and add the desired CustomBehavior - Iterator it = getSelectedEObject().iterator(); - while (it.hasNext()) { - EObject eObject = it.next(); - if (eObject instanceof GenLink) { - - // Create the behavior required by stereotype management (if not already created) - if (!hasCustomBehavior(((GenLink) eObject), STEREOTYPE_LABEL_POLICY_KEY)) { - addCustomBehavior((GenLink) eObject, STEREOTYPE_LABEL_POLICY_KEY, STEREOTYPE_LABEL_POLICY_CLASS); - } - - // Create the GenLinkLabel used for stereotypes (if not already created) - if (!hasCustomLabel((GenLink) eObject)) { - addCustomLabel((GenLink) eObject); - } - } - } - } - - - - - /** - * Add the CustomBehavior for Applied Stereotype label display to the GenLink node given as - * parameter - * - * @param genlink - * where the CustomBehavior is added - */ - private void addCustomLabel(GenLink genlink) { - - // Create a GenLinkLabel - GenLinkLabel label = GMFGenFactory.eINSTANCE.createGenLinkLabel(); - label.setEditPartClassName(genlink.getClassNamePrefix() + DEFAULT_EDITPART_NAME_SUFFIX); - label.setItemSemanticEditPolicyClassName(genlink.getClassNamePrefix() + DEFAULT_EDITPOLICY_NAME_SUFFIX); - label.setAlignment(LinkLabelAlignment.MIDDLE_LITERAL); - label.setReadOnly(true); - - // Set GenLinkLabel VisualID with new unique ID - int visualID = SetVisualIDWithUnusedValue.getNewVisualID(genlink.eResource(), GenLinkLabel.class); - label.setVisualID(visualID); - - // Retrieve DiagramRunTimeClass in notation.genmodel (Node -> View) - URI uri_notation = URI.createPlatformPluginURI(URI_NOTATION_GENMODEL, false); - Resource notation = genlink.eResource().getResourceSet().getResource(uri_notation, true); - label.setDiagramRunTimeClass(findGenClass(notation, GEN_CLASS_RT_CLASS)); - - // Create Viewmap - ParentAssignedViewmap viewmap = GMFGenFactory.eINSTANCE.createParentAssignedViewmap(); - viewmap.setGetterName(DEFAULT_GETTER_NAME); - viewmap.setFigureQualifiedClassName(DEFAULT_WRAPPING_LABEL_CLASS); - - LabelOffsetAttributes offset = GMFGenFactory.eINSTANCE.createLabelOffsetAttributes(); - offset.setX(DEFAULT_OFFSET_X); - offset.setY(DEFAULT_OFFSET_Y); - - // Create FeatureLabelModelFacet - FeatureLabelModelFacet facet = GMFGenFactory.eINSTANCE.createFeatureLabelModelFacet(); - facet.setEditPattern(DEFAULT_PARSER_PATTERN); - facet.setEditorPattern(DEFAULT_PARSER_PATTERN); - facet.setViewPattern(DEFAULT_PARSER_PATTERN); - // Select NamedElement::name property in UML.genmodel for MetaFeatures - URI uri_uml = URI.createPlatformPluginURI(URI_UML_GENMODEL, false); - Resource uml = genlink.eResource().getResourceSet().getResource(uri_uml, true); - facet.getMetaFeatures().add(findGenFeature(uml, GEN_CLASS_FACET_META_FEATURE, GEN_FEATURE_FACET_META_FEATURE)); - facet.setParser(findCustomParser(genlink.getDiagram().getEditorGen(), APPLIED_STEREOTYPE_CUSTOM_PARSER_CLASS)); - - // Attach created element one to another in the model - viewmap.getAttributes().add(offset); - label.setViewmap(viewmap); - label.setModelFacet(facet); - - genlink.getLabels().add(label); - } - - /** - * Check if the CustomBehavior for Applied Stereotype label display is already added - * - * @param genlink - * the GenLink to test - * @return true if the behavior with correct key already exists - */ - private boolean hasCustomLabel(GenLink genlink) { - - boolean hasCustomLabel = false; - String expectedName = genlink.getClassNamePrefix() + DEFAULT_EDITPART_NAME_SUFFIX; - - Iterator it = genlink.getLabels().iterator(); - while (it.hasNext() && !(hasCustomLabel)) { - GenLinkLabel genLinkLabel = it.next(); - - if (expectedName.equals(genLinkLabel.getEditPartClassName())) { - hasCustomLabel = true; - } - } - - return hasCustomLabel; - } - - /** - * Finds the custom parser used for stereotype display. Creates the parser if not already - * existing - * - * - * @param gmfgen - * the model owning the parser - * @param name - * the parser qualified name - * @return the parser node - */ - private CustomParser findCustomParser(GenEditorGenerator genEditor, String name) { - - CustomParser customParser = null; - - Iterator it = genEditor.getLabelParsers().getImplementations().iterator(); - while (it.hasNext() && (customParser == null)) { - GenParserImplementation parserImpl = it.next(); - - if (parserImpl instanceof CustomParser) { - CustomParser current = (CustomParser) parserImpl; - if (name.equals(current.getQualifiedName())) { - customParser = current; - } - } - } - - if (customParser == null) { - customParser = GMFGenFactory.eINSTANCE.createCustomParser(); - customParser.setQualifiedName(APPLIED_STEREOTYPE_CUSTOM_PARSER_CLASS); - customParser.setGenerateBoilerplate(false); - - genEditor.getLabelParsers().getImplementations().add(customParser); - } - - return customParser; - } - - -} diff --git a/plugins/toolsmiths/org.eclipse.papyrus.gmfgenextension/src/org/eclipse/papyrus/papyrusgmfgenextension/popupaction/AddHyperLinkPopupBarBehavior.java b/plugins/toolsmiths/org.eclipse.papyrus.gmfgenextension/src/org/eclipse/papyrus/papyrusgmfgenextension/popupaction/AddHyperLinkPopupBarBehavior.java deleted file mode 100644 index c1a9ccacfcc..00000000000 --- a/plugins/toolsmiths/org.eclipse.papyrus.gmfgenextension/src/org/eclipse/papyrus/papyrusgmfgenextension/popupaction/AddHyperLinkPopupBarBehavior.java +++ /dev/null @@ -1,70 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2009 CEA LIST. - * All rights reserved. This program and the accompanying materials - * are property of the CEA, their use is subject to specific agreement - * with the CEA. - * - * Contributors: - * CEA LIST - initial API and implementation - *******************************************************************************/ - -package org.eclipse.papyrus.papyrusgmfgenextension.popupaction; - -import java.util.Iterator; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.jface.action.IAction; -import org.eclipse.papyrus.gmf.codegen.gmfgen.GenNode; -import org.eclipse.ui.IViewPart; - -/** - * Implementation class for AddGenLinkStereotypeDisplayBehavior action - */ -public class AddHyperLinkPopupBarBehavior extends Action { - - public static final String POPUP_POLICY_KEY = "org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.POPUPBAR_ROLE"; //$NON-NLS-1$ - - public static final String HYPERLINK_POPUPBAR_POLICY_CLASS = "org.eclipse.papyrus.diagram.common.editpolicies.HyperLinkPopupBarEditPolicy"; //$NON-NLS-1$ - - - public static final String URI_NOTATION_GENMODEL = "org.eclipse.gmf.runtime.notation/model/notation.genmodel"; //$NON-NLS-1$ - - public static final String URI_UML_GENMODEL = "org.eclipse.uml2.uml/model/UML.genmodel"; //$NON-NLS-1$ - - /* - * (non-Javadoc) - * - * @see org.eclipse.ui.IViewActionDelegate#init(org.eclipse.ui.IViewPart) - */ - public void init(IViewPart view) { - // NO OP - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction) - */ - @Override - public void run(IAction action) { - - // Parse selected GenLink(s) and add the desired CustomBehavior - Iterator it = getSelectedEObject().iterator(); - while (it.hasNext()) { - EObject eObject = it.next(); - if (eObject instanceof GenNode) { - - // Create the behavior required by stereotype management (if not already created) - if (!hasCustomBehavior((GenNode) eObject, POPUP_POLICY_KEY)) { - addCustomBehavior((GenNode) eObject, POPUP_POLICY_KEY, HYPERLINK_POPUPBAR_POLICY_CLASS); - } - - } - } - } - - - - - -} diff --git a/plugins/toolsmiths/org.eclipse.papyrus.gmfgenextension/src/org/eclipse/papyrus/papyrusgmfgenextension/popupaction/AddNodeQualifiedNameBehavior.java b/plugins/toolsmiths/org.eclipse.papyrus.gmfgenextension/src/org/eclipse/papyrus/papyrusgmfgenextension/popupaction/AddNodeQualifiedNameBehavior.java deleted file mode 100644 index 8ddbc9880bf..00000000000 --- a/plugins/toolsmiths/org.eclipse.papyrus.gmfgenextension/src/org/eclipse/papyrus/papyrusgmfgenextension/popupaction/AddNodeQualifiedNameBehavior.java +++ /dev/null @@ -1,71 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2009 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License 2.0 - * which accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation - * - *****************************************************************************/ - - -package org.eclipse.papyrus.papyrusgmfgenextension.popupaction; - -import java.util.Iterator; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.jface.action.IAction; -import org.eclipse.papyrus.gmf.codegen.gmfgen.GenNode; -import org.eclipse.ui.IViewPart; - -/** - * this class is used to add a label to display applied stereotypes for external node - */ -public class AddNodeQualifiedNameBehavior extends Action { - - public static final String STEREOTYPE_LABEL_POLICY_KEY = "org.eclipse.papyrus.diagram.common.editpolicies.QualifiedNameDisplayEditPolicy.QUALIFIED_NAME_POLICY"; //$NON-NLS-1$ - - public static final String STEREOTYPE_LABEL_POLICY_CLASS = "org.eclipse.papyrus.diagram.common.editpolicies.QualifiedNameDisplayEditPolicy"; //$NON-NLS-1$ - - - /* - * (non-Javadoc) - * - * @see org.eclipse.ui.IViewActionDelegate#init(org.eclipse.ui.IViewPart) - */ - public void init(IViewPart view) { - // NO OP - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction) - */ - @Override - public void run(IAction action) { - - // Parse selected GenLink(s) and add the desired CustomBehavior - Iterator it = getSelectedEObject().iterator(); - while (it.hasNext()) { - EObject eObject = it.next(); - if (eObject instanceof GenNode) { - // test if it has got a external node to display applied stereotype - if (!hasCustomBehavior(((GenNode) eObject), STEREOTYPE_LABEL_POLICY_KEY)) { - addCustomBehavior((GenNode) eObject, STEREOTYPE_LABEL_POLICY_KEY, STEREOTYPE_LABEL_POLICY_CLASS); - } - } - } - } - - - - - -} diff --git a/plugins/toolsmiths/org.eclipse.papyrus.gmfgenextension/src/org/eclipse/papyrus/papyrusgmfgenextension/popupaction/AddNodeShowHideCompartmentBehavior.java b/plugins/toolsmiths/org.eclipse.papyrus.gmfgenextension/src/org/eclipse/papyrus/papyrusgmfgenextension/popupaction/AddNodeShowHideCompartmentBehavior.java deleted file mode 100644 index 501c2c4699d..00000000000 --- a/plugins/toolsmiths/org.eclipse.papyrus.gmfgenextension/src/org/eclipse/papyrus/papyrusgmfgenextension/popupaction/AddNodeShowHideCompartmentBehavior.java +++ /dev/null @@ -1,58 +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 2.0 - * which accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation - * - *****************************************************************************/ -package org.eclipse.papyrus.papyrusgmfgenextension.popupaction; - -import java.util.Iterator; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.jface.action.IAction; -import org.eclipse.papyrus.gmf.codegen.gmfgen.GenNode; - - -/** - * This class is used to add a behavior for node which have compartments. - * This behavior allows to show or hide the compartments - */ -public class AddNodeShowHideCompartmentBehavior extends Action { - - /** the key for the EditPolicy to add */ - public static final String SHOW_HIDE_COMPARTMENT_POLICY_KEY = "org.eclipse.papyrus.diagram.common.editpolicies.ShowHideCompartmentEditPolicy.SHOW_HIDE_COMPARTMENT_POLICY"; //$NON-NLS-1$ - - /** the path for the EditPolicy */ - public static final String SHOW_HIDE_COMPARTMENT_POLICY_CLASS = "org.eclipse.papyrus.diagram.common.editpolicies.ShowHideCompartmentEditPolicy"; //$NON-NLS-1$ - - - /* - * (non-Javadoc) - * - * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction) - */ - @Override - public void run(IAction action) { - // Parse selected GenLink(s) and add the desired CustomBehavior - Iterator it = getSelectedEObject().iterator(); - while (it.hasNext()) { - EObject eObject = it.next(); - if (eObject instanceof GenNode) { - // test if it has got a external node to display applied stereotype - if (!hasCustomBehavior(((GenNode) eObject), SHOW_HIDE_COMPARTMENT_POLICY_KEY)) { - addCustomBehavior((GenNode) eObject, SHOW_HIDE_COMPARTMENT_POLICY_KEY, SHOW_HIDE_COMPARTMENT_POLICY_CLASS); - } - } - } - } - -} diff --git a/plugins/toolsmiths/org.eclipse.papyrus.gmfgenextension/src/org/eclipse/papyrus/papyrusgmfgenextension/popupaction/AddNodeShowHideContentsBehavior.java b/plugins/toolsmiths/org.eclipse.papyrus.gmfgenextension/src/org/eclipse/papyrus/papyrusgmfgenextension/popupaction/AddNodeShowHideContentsBehavior.java deleted file mode 100644 index dab31e8ba92..00000000000 --- a/plugins/toolsmiths/org.eclipse.papyrus.gmfgenextension/src/org/eclipse/papyrus/papyrusgmfgenextension/popupaction/AddNodeShowHideContentsBehavior.java +++ /dev/null @@ -1,53 +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 2.0 - * which accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation - * - *****************************************************************************/ -package org.eclipse.papyrus.papyrusgmfgenextension.popupaction; - -import java.util.Iterator; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.jface.action.IAction; -import org.eclipse.papyrus.gmf.codegen.gmfgen.GenNode; - - -public class AddNodeShowHideContentsBehavior extends Action { - - /** the key for the EditPolicy to add. */ - public static final String SHOW_HIDE_CLASSIFIER_CONTENTS_POLICY_KEY = "org.eclipse.papyrus.diagram.common.editpolicies.ShowHideClassifierContentsEditPolicy.SHOW_HIDE_CLASSIFIER_CONTENTS_POLICY"; //$NON-NLS-1$ - - /** the path for the EditPolicy */ - public static final String SHOW_HIDE_CLASSIFIER_CONTENTS_POLICY_CLASS = "org.eclipse.papyrus.diagram.common.editpolicies.ShowHideClassifierContentsEditPolicy"; //$NON-NLS-1$ - - - /* - * (non-Javadoc) - * - * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction) - */ - @Override - public void run(IAction action) { - // Parse selected GenLink(s) and add the desired CustomBehavior - Iterator it = getSelectedEObject().iterator(); - while (it.hasNext()) { - EObject eObject = it.next(); - if (eObject instanceof GenNode) { - // test if it has got a external node to display applied stereotype - if (!hasCustomBehavior(((GenNode) eObject), SHOW_HIDE_CLASSIFIER_CONTENTS_POLICY_KEY)) { - addCustomBehavior((GenNode) eObject, SHOW_HIDE_CLASSIFIER_CONTENTS_POLICY_KEY, SHOW_HIDE_CLASSIFIER_CONTENTS_POLICY_CLASS); - } - } - } - } -} diff --git a/plugins/toolsmiths/org.eclipse.papyrus.gmfgenextension/src/org/eclipse/papyrus/papyrusgmfgenextension/popupaction/AddNodeShowHideLabelsBehavior.java b/plugins/toolsmiths/org.eclipse.papyrus.gmfgenextension/src/org/eclipse/papyrus/papyrusgmfgenextension/popupaction/AddNodeShowHideLabelsBehavior.java deleted file mode 100644 index b1ccc9b9e89..00000000000 --- a/plugins/toolsmiths/org.eclipse.papyrus.gmfgenextension/src/org/eclipse/papyrus/papyrusgmfgenextension/popupaction/AddNodeShowHideLabelsBehavior.java +++ /dev/null @@ -1,55 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2011 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License 2.0 - * which accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation - *****************************************************************************/ -package org.eclipse.papyrus.papyrusgmfgenextension.popupaction; - -import java.util.Iterator; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.jface.action.IAction; -import org.eclipse.papyrus.gmf.codegen.gmfgen.GenLink; -import org.eclipse.papyrus.gmf.codegen.gmfgen.GenLinkLabel; -import org.eclipse.papyrus.gmf.codegen.gmfgen.GenNode; -import org.eclipse.papyrus.gmf.codegen.gmfgen.GenNodeLabel; - - -public class AddNodeShowHideLabelsBehavior extends Action { - - /** the key for the EditPolicy to add. */ - public static final String SHOW_HIDE_LABEL_POLICY_KEY = "org.eclipse.papyrus.diagram.common.editpolicies.ShowHideLabelEditPolicy.SHOW_HIDE_LABEL_ROLE"; //$NON-NLS-1$ - - /** the path for the EditPolicy */ - public static final String SHOW_HIDE_LABEL_POLICY_CLASS = "org.eclipse.papyrus.diagram.common.editpolicies.ShowHideLabelEditPolicy"; //$NON-NLS-1$ - - - /* - * (non-Javadoc) - * - * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction) - */ - @Override - public void run(IAction action) { - // Parse selected GenLink(s) and add the desired CustomBehavior - Iterator it = getSelectedEObject().iterator(); - while (it.hasNext()) { - EObject eObject = it.next(); - if ((eObject instanceof GenNode || eObject instanceof GenLink) && (!(eObject instanceof GenNodeLabel) && !(eObject instanceof GenLinkLabel))) { - // test if it has got a external node to display applied stereotype - if (!hasCustomBehavior(((GenNode) eObject), SHOW_HIDE_LABEL_POLICY_KEY)) { - addCustomBehavior((GenNode) eObject, SHOW_HIDE_LABEL_POLICY_KEY, SHOW_HIDE_LABEL_POLICY_CLASS); - } - } - } - } -} \ No newline at end of file diff --git a/plugins/toolsmiths/org.eclipse.papyrus.gmfgenextension/src/org/eclipse/papyrus/papyrusgmfgenextension/popupaction/AddNodeStereotypeDisplayBehavior.java b/plugins/toolsmiths/org.eclipse.papyrus.gmfgenextension/src/org/eclipse/papyrus/papyrusgmfgenextension/popupaction/AddNodeStereotypeDisplayBehavior.java deleted file mode 100644 index 3354ec9e914..00000000000 --- a/plugins/toolsmiths/org.eclipse.papyrus.gmfgenextension/src/org/eclipse/papyrus/papyrusgmfgenextension/popupaction/AddNodeStereotypeDisplayBehavior.java +++ /dev/null @@ -1,71 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2009 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License 2.0 - * which accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation - * - *****************************************************************************/ - - -package org.eclipse.papyrus.papyrusgmfgenextension.popupaction; - -import java.util.Iterator; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.jface.action.IAction; -import org.eclipse.papyrus.gmf.codegen.gmfgen.GenNode; -import org.eclipse.ui.IViewPart; - -/** - * this class is used to add a label to display applied stereotypes for external node - */ -public class AddNodeStereotypeDisplayBehavior extends Action { - - public static final String STEREOTYPE_LABEL_POLICY_KEY = "org.eclipse.papyrus.diagram.common.editpolicies.AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY"; //$NON-NLS-1$ - - public static final String STEREOTYPE_LABEL_POLICY_CLASS = "org.eclipse.papyrus.diagram.common.editpolicies.AppliedStereotypeNodeLabelDisplayEditPolicy"; //$NON-NLS-1$ - - - /* - * (non-Javadoc) - * - * @see org.eclipse.ui.IViewActionDelegate#init(org.eclipse.ui.IViewPart) - */ - public void init(IViewPart view) { - // NO OP - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction) - */ - @Override - public void run(IAction action) { - - // Parse selected GenLink(s) and add the desired CustomBehavior - Iterator it = getSelectedEObject().iterator(); - while (it.hasNext()) { - EObject eObject = it.next(); - if (eObject instanceof GenNode) { - // test if it has got a external node to display applied stereotype - if (!hasCustomBehavior(((GenNode) eObject), STEREOTYPE_LABEL_POLICY_KEY)) { - addCustomBehavior((GenNode) eObject, STEREOTYPE_LABEL_POLICY_KEY, STEREOTYPE_LABEL_POLICY_CLASS); - } - } - } - } - - - - - -} diff --git a/plugins/toolsmiths/org.eclipse.papyrus.gmfgenextension/src/org/eclipse/papyrus/papyrusgmfgenextension/popupaction/AddOrUpdateCommentEditParts.java b/plugins/toolsmiths/org.eclipse.papyrus.gmfgenextension/src/org/eclipse/papyrus/papyrusgmfgenextension/popupaction/AddOrUpdateCommentEditParts.java deleted file mode 100644 index 3a21b97dc01..00000000000 --- a/plugins/toolsmiths/org.eclipse.papyrus.gmfgenextension/src/org/eclipse/papyrus/papyrusgmfgenextension/popupaction/AddOrUpdateCommentEditParts.java +++ /dev/null @@ -1,577 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2009 CEA LIST. - * All rights reserved. This program and the accompanying materials - * are property of the CEA, their use is subject to specific agreement - * with the CEA. - * - * Contributors: - * CEA LIST - initial API and implementation - *******************************************************************************/ - -package org.eclipse.papyrus.papyrusgmfgenextension.popupaction; - -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; - -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.NullProgressMonitor; -import org.eclipse.emf.codegen.ecore.genmodel.GenClass; -import org.eclipse.emf.codegen.ecore.genmodel.GenFeature; -import org.eclipse.emf.common.util.URI; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.resource.Resource; -import org.eclipse.emf.ecore.util.EcoreUtil; -import org.eclipse.jface.action.IAction; -import org.eclipse.jface.dialogs.MessageDialog; -import org.eclipse.papyrus.gmf.codegen.gmfgen.Behaviour; -import org.eclipse.papyrus.gmf.codegen.gmfgen.CustomBehaviour; -import org.eclipse.papyrus.gmf.codegen.gmfgen.CustomParser; -import org.eclipse.papyrus.gmf.codegen.gmfgen.FeatureLabelModelFacet; -import org.eclipse.papyrus.gmf.codegen.gmfgen.FigureViewmap; -import org.eclipse.papyrus.gmf.codegen.gmfgen.GMFGenFactory; -import org.eclipse.papyrus.gmf.codegen.gmfgen.GenChildNode; -import org.eclipse.papyrus.gmf.codegen.gmfgen.GenDiagram; -import org.eclipse.papyrus.gmf.codegen.gmfgen.GenEditorGenerator; -import org.eclipse.papyrus.gmf.codegen.gmfgen.GenExpressionInterpreter; -import org.eclipse.papyrus.gmf.codegen.gmfgen.GenExpressionProviderBase; -import org.eclipse.papyrus.gmf.codegen.gmfgen.GenExpressionProviderContainer; -import org.eclipse.papyrus.gmf.codegen.gmfgen.GenFeatureSeqInitializer; -import org.eclipse.papyrus.gmf.codegen.gmfgen.GenFeatureValueSpec; -import org.eclipse.papyrus.gmf.codegen.gmfgen.GenNode; -import org.eclipse.papyrus.gmf.codegen.gmfgen.GenNodeLabel; -import org.eclipse.papyrus.gmf.codegen.gmfgen.GenParserImplementation; -import org.eclipse.papyrus.gmf.codegen.gmfgen.GenParsers; -import org.eclipse.papyrus.gmf.codegen.gmfgen.GenTopLevelNode; -import org.eclipse.papyrus.gmf.codegen.gmfgen.OpenDiagramBehaviour; -import org.eclipse.papyrus.gmf.codegen.gmfgen.ParentAssignedViewmap; -import org.eclipse.papyrus.gmf.codegen.gmfgen.StyleAttributes; -import org.eclipse.papyrus.gmf.codegen.gmfgen.TypeModelFacet; -import org.eclipse.papyrus.gmf.codegen.gmfgen.ValueExpression; -import org.eclipse.swt.widgets.Display; - -/** - * Implementation class for AddOrUpdateCommentEditParts action - */ -public class AddOrUpdateCommentEditParts extends Action { - - /** output messages for user information */ - protected List messages = new ArrayList(); - - /** number of modified elements */ - protected int modifiedElements = 0; - - /** top node comment edit parts */ - protected List topNodeComments = new ArrayList(); - - /** child node comment edit parts */ - protected List childNodeComments = new ArrayList(); - - /** comment parser */ - protected CustomParser commentParser = null; - - final URI uri_UML2 = URI.createPlatformPluginURI("org.eclipse.uml2.uml/model/UML.genmodel", false); - - // final URI uri_GenModel = URI.createPlatformPluginURI("org.eclipse.gmf.runtime.notation/model/notation.genmodel", false); - - final URI uri_notation = URI.createPlatformPluginURI("org.eclipse.gmf.runtime.notation/model/notation.genmodel", false); - - /** - * {@inheritDoc} - */ - @Override - public void run(IAction action) { - - IProgressMonitor monitor = new NullProgressMonitor(); - messages.clear(); - modifiedElements = 0; - - boolean generateTopNode = true; - boolean generateChildNode = true; - - // 1. retrieve existing elements: CommentEditParts (one top node, and one child node) and CommentParser - // 2. update if existing, or create if necessary - // selection should be the gen editor generator (root element) - Iterator it = getSelectedEObject().iterator(); - while (it.hasNext()) { - EObject eObject = it.next(); - if (eObject instanceof GenEditorGenerator) { - monitor.beginTask("Retrieve existing comments", IProgressMonitor.UNKNOWN); - retrieveTopNodeCommentEditPart((GenEditorGenerator) eObject, monitor); - monitor.worked(1); - retrieveChildNodeCommentEditPart((GenEditorGenerator) eObject, monitor); - monitor.worked(1); - retrieveCommentParser((GenEditorGenerator) eObject, monitor); - monitor.worked(1); - } - - // elements have been retrieve. create new ones if necessary - // 1. create the parser if necessary - if (commentParser == null) { - commentParser = createCommentParser((GenEditorGenerator) eObject, monitor); - } - - // 2. create top node - if (topNodeComments.isEmpty()) { - generateTopNode = false; - // remove the creation, because it causes problems in the update - // createTopNodeComment((GenEditorGenerator)eObject, monitor); - } - - // 3. create child node - if (childNodeComments.isEmpty()) { - generateChildNode = false; - // createChildNodeComment((GenEditorGenerator)eObject, monitor); - } - - // check if updates shall be done or the action should be aborted - if (commentParser == null || (topNodeComments.isEmpty() && generateTopNode) || (childNodeComments.isEmpty() && generateChildNode)) { - return; - } - - // do the update - updateCommentParser(); - if (generateTopNode) { - updateTopLevelNodes(); - } - if (generateChildNode) { - updateChildNodes(); - } - - - try { - eObject.eResource().save(new HashMap()); - } catch (IOException e) { - e.printStackTrace(); - } - - if (!messages.isEmpty()) { - MessageDialog.openInformation(Display.getCurrent().getActiveShell(), "Information", messages.toString()); - } - } - } - - /** - * Update the child nodes - */ - protected void updateChildNodes() { - for (GenChildNode childNode : childNodeComments) { - // set figure view map - FigureViewmap figureViewmap = GMFGenFactory.eINSTANCE.createFigureViewmap(); - figureViewmap.setFigureQualifiedClassName("org.eclipse.papyrus.diagram.common.figure.node.HTMLCornerBentFigure"); - childNode.setViewmap(figureViewmap); - - updateBehaviours(childNode); - - updateTypeModelFacet(childNode); - - updateGenNodeLabel(childNode); - - messages.add("update child: " + childNode); - } - - } - - /** - * Removes existing child edit part and creates a new one - * - * @param childNode - * the child node currently edited - */ - protected void updateGenNodeLabel(GenNode childNode) { - // save information on existing child nodes and delete them - int childVisualID = -1; - String editPartClassName = ""; - String itemSemantic = ""; - if (childNode.getLabels().size() > 0) { - // assume the first one is the child edit part for the body - childVisualID = childNode.getLabels().get(0).getVisualID(); - editPartClassName = childNode.getLabels().get(0).getEditPartClassName(); - itemSemantic = childNode.getLabels().get(0).getItemSemanticEditPolicyClassName(); - - // clear child nodes (remove the first one, as there should be only one) - EcoreUtil.delete(childNode.getLabels().get(0).getModelFacet()); - EcoreUtil.delete(childNode.getLabels().get(0)); - } - - // generate values if wrong - if (childVisualID < 1) { - childVisualID = SetVisualIDWithUnusedValue.getNewVisualID(childNode.eResource(), childNode.getClass()); - } - if (editPartClassName == null || editPartClassName == "") { - String parentEditPartClassName = childNode.getEditPartClassName(); - String number = parentEditPartClassName.substring("Comment".length(), parentEditPartClassName.length() - "EditPart".length()); - editPartClassName = "CommentBody" + ((number == null) ? "" : number) + "EditPart"; - itemSemantic = "CommentBody" + ((number == null) ? "" : number) + "ItemSemanticEditPolicy"; - } - - - GenNodeLabel bodyGenNode = GMFGenFactory.eINSTANCE.createGenNodeLabel(); - bodyGenNode.setEditPartClassName(editPartClassName); - bodyGenNode.setItemSemanticEditPolicyClassName(itemSemantic); - - bodyGenNode.setVisualID(childVisualID); - GenClass nodeGenClass = findGenClassForNotation(childNode, "Node"); - - // GenModelFactory.eINSTANCE.createGenClass(); - // nodeGenClass.setEcoreClass(GMFGenPackage.eINSTANCE.getGenNode()); - bodyGenNode.setDiagramRunTimeClass(nodeGenClass); - bodyGenNode.setElementIcon(false); - bodyGenNode.setReadOnly(false); - - childNode.getLabels().add(bodyGenNode); - - // generate children for bodygen node - FeatureLabelModelFacet childModelFacet = GMFGenFactory.eINSTANCE.createFeatureLabelModelFacet(); - childModelFacet.setParser(commentParser); - GenFeature bodyFeature = findGenAttributeForMetaclass(childNode, "Comment", "body"); - childModelFacet.getMetaFeatures().add(bodyFeature); - bodyGenNode.setModelFacet(childModelFacet); - - - ParentAssignedViewmap viewMap = GMFGenFactory.eINSTANCE.createParentAssignedViewmap(); - viewMap.setGetterName("getCornerBentFigure"); - viewMap.setFigureQualifiedClassName("org.eclipse.papyrus.diagram.common.figure.node.HTMLCornerBentFigure"); - StyleAttributes styleAttribute = GMFGenFactory.eINSTANCE.createStyleAttributes(); - styleAttribute.setFixedBackground(false); - styleAttribute.setFixedFont(true); - styleAttribute.setFixedForeground(false); - viewMap.getAttributes().add(styleAttribute); - - bodyGenNode.setViewmap(viewMap); - - } - - /** - * Update Type model facet - * - * @param childNode - * the child node currently edited - */ - protected void updateTypeModelFacet(GenNode childNode) { - // set model facet - /* - * - * - * - * - * - * - * - * - * - * - */ - TypeModelFacet typeModelFacet = GMFGenFactory.eINSTANCE.createTypeModelFacet(); - GenClass commentMetaClass = findGenClassForMetaclass(childNode, "Comment"); - typeModelFacet.setMetaClass(commentMetaClass); - - // containment metafeature - GenFeature containmentMetaFeature = findGenAttributeForMetaclass(childNode, "Element", "ownedComment"); - typeModelFacet.setContainmentMetaFeature(containmentMetaFeature); - - // child metafeature - GenFeature childMetaFeature = findGenAttributeForMetaclass(childNode, "Element", "ownedComment"); - typeModelFacet.setChildMetaFeature(childMetaFeature); - - GenFeatureSeqInitializer elementInitializer = GMFGenFactory.eINSTANCE.createGenFeatureSeqInitializer(); - GenFeatureValueSpec featureValueSpec = GMFGenFactory.eINSTANCE.createGenFeatureValueSpec(); - GenFeature bodyFeature = findGenAttributeForMetaclass(childNode, "Comment", "body"); - featureValueSpec.setFeature(bodyFeature); - // retrieve value expression ('') - featureValueSpec.setValue(retrieveValueExpression(childNode)); - elementInitializer.getInitializers().add(featureValueSpec); - typeModelFacet.setModelElementInitializer(elementInitializer); - - } - - /** - * Retrieve value expression ('') - * - * @param childNode - * the child node currently edited - * @return - */ - protected ValueExpression retrieveValueExpression(GenNode childNode) { - final String expressionBody = "\' \'"; - GenExpressionProviderContainer expressionProviderContainer = childNode.getDiagram().getEditorGen().getExpressionProviders(); - for (GenExpressionProviderBase base : expressionProviderContainer.getProviders()) { - if (base instanceof GenExpressionInterpreter) { - for (ValueExpression expression : ((GenExpressionInterpreter) base).getExpressions()) { - if (expressionBody.equals(expression.getBody())) { - return expression; - } - } - - } - } - - GenExpressionInterpreter base = null; - // create a new one if none exists - for (GenExpressionProviderBase provider : expressionProviderContainer.getProviders()) { - if (provider instanceof GenExpressionInterpreter) { - base = (GenExpressionInterpreter) provider; - } - } - if (base == null) { - base = GMFGenFactory.eINSTANCE.createGenExpressionInterpreter(); - expressionProviderContainer.getProviders().add(base); - } - - // base should not be null now - ValueExpression expression = GMFGenFactory.eINSTANCE.createValueExpression(); - expression.setBody(expressionBody); - base.getExpressions().add(expression); - return expression; - } - - /** - * Update behaviors for the comment edit part - * - * @param childNode - * the node currently edited - */ - protected void updateBehaviours(GenNode childNode) { - boolean createOpenDiagramBehaviour = true; - boolean createGraphicalNodeRole = false; - boolean createStereotypeBehaviour = true; - - - // retrieve existing behaviours - List behaviours = childNode.getBehaviour(); - for (Behaviour behaviour : behaviours) { - if (behaviour instanceof OpenDiagramBehaviour) { - createOpenDiagramBehaviour = false; - } else if (behaviour instanceof CustomBehaviour) { - // look for the role - if ("org.eclipse.gef.EditPolicy.GRAPHICAL_NODE_ROLE".equals(((CustomBehaviour) behaviour).getKey())) { - createGraphicalNodeRole = false; - } else if ("org.eclipse.papyrus.diagram.common.editpolicies.AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY".equals(((CustomBehaviour) behaviour).getKey())) { - createStereotypeBehaviour = false; - } - - } - } - - // if(createOpenDiagramBehaviour) { - // OpenDiagramBehaviour diagramBehaviour = GMFGenFactory.eINSTANCE.createOpenDiagramBehaviour(); - // diagramBehaviour.setEditPolicyClassName("OpenDiagramEditPolicy"); - // diagramBehaviour.setOpenAsEclipseEditor(true); - // childNode.getBehaviour().add(diagramBehaviour); - // } - - if (createGraphicalNodeRole) { - // add a custom edit policy if necessary for graphical node role - CustomBehaviour customBehaviour = GMFGenFactory.eINSTANCE.createCustomBehaviour(); - customBehaviour.setEditPolicyQualifiedClassName(""); - customBehaviour.setKey("org.eclipse.gef.EditPolicy.GRAPHICAL_NODE_ROLE"); - childNode.getBehaviour().add(customBehaviour); - } - - if (createStereotypeBehaviour) { - // add a custom edit policy if necessary - CustomBehaviour stereotypeBehaviour = GMFGenFactory.eINSTANCE.createCustomBehaviour(); - stereotypeBehaviour.setEditPolicyQualifiedClassName("org.eclipse.papyrus.diagram.common.editpolicies.AppliedStereotypeNodeLabelDisplayEditPolicy"); - stereotypeBehaviour.setKey("org.eclipse.papyrus.diagram.common.editpolicies.AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY"); - childNode.getBehaviour().add(stereotypeBehaviour); - } - - } - - /** - * Update the top nodes - */ - protected void updateTopLevelNodes() { - for (GenTopLevelNode node : topNodeComments) { - // set figure view map - FigureViewmap figureViewmap = GMFGenFactory.eINSTANCE.createFigureViewmap(); - figureViewmap.setFigureQualifiedClassName("org.eclipse.papyrus.diagram.common.figure.node.HTMLCornerBentFigure"); - node.setViewmap(figureViewmap); - - updateBehaviours(node); - - updateTypeModelFacet(node); - - updateGenNodeLabel(node); - - messages.add("update top: " + node); - } - } - - /** - * update the comment parser - */ - protected void updateCommentParser() { - if (!"org.eclipse.papyrus.diagram.common.parser.CommentParser".equals(commentParser.getQualifiedName())) { - commentParser.setQualifiedName("org.eclipse.papyrus.diagram.common.parser.CommentParser"); - } - - if (commentParser.isGenerateBoilerplate()) { - commentParser.setGenerateBoilerplate(false); - } - - } - - /** - * Creates and returns the comment custom parser - * - * @param editorGenerator - * the root node of the gmfgen - * @param monitor - * the progress monitor - * @return the comment custom parser - */ - protected CustomParser createCommentParser(GenEditorGenerator editorGenerator, IProgressMonitor monitor) { - GenParsers parsers = editorGenerator.getLabelParsers(); - if (parsers == null) { - MessageDialog.openError(Display.getCurrent().getActiveShell(), "Impossible to find the parsers associated to this editor", "No parser container was found for this editor. \n\nYou should create the parsers container before running this action"); - } - CustomParser parser = GMFGenFactory.eINSTANCE.createCustomParser(); - parsers.getImplementations().add(parser); - return parser; - } - - /** - * Creates and returns the comment custom parser - * - * @param editorGenerator - * the root node of the gmfgen - * @param monitor - * the progress monitor - * @return the comment custom parser - */ - protected void createTopNodeComment(GenEditorGenerator editorGenerator, IProgressMonitor monitor) { - GenDiagram diagram = editorGenerator.getDiagram(); - if (diagram == null) { - return; - } - - GenTopLevelNode topNode = GMFGenFactory.eINSTANCE.createGenTopLevelNode(); - diagram.getTopLevelNodes().add(topNode); - topNodeComments.add(topNode); - } - - /** - * Creates and returns the child node comment - * - * @param editorGenerator - * the root node of the gmfgen - * @param monitor - * the progress monitor - */ - protected void createChildNodeComment(GenEditorGenerator editorGenerator, IProgressMonitor monitor) { - GenDiagram diagram = editorGenerator.getDiagram(); - if (diagram == null) { - return; - } - - GenChildNode childNode = GMFGenFactory.eINSTANCE.createGenChildNode(); - diagram.getChildNodes().add(childNode); - childNodeComments.add(childNode); - } - - /** - * Retrieves the top node comment edit parts - * - * @param editorGenerator - * the root node of the gmfgen - * @param monitor - * the progress monitor - */ - protected void retrieveTopNodeCommentEditPart(GenEditorGenerator editorGenerator, IProgressMonitor monitor) { - GenDiagram diagram = editorGenerator.getDiagram(); - if (diagram == null) { - MessageDialog.openError(Display.getCurrent().getActiveShell(), "Impossible to find the diagram associated to this editor", "No diagram was found for this editor. \n\nYou should create one diagram before running this action"); - } - - GenClass commentGenClass = findGenClassForMetaclass(editorGenerator, "Comment"); - for (GenTopLevelNode topLevelNode : diagram.getTopLevelNodes()) { - TypeModelFacet modelFacet = topLevelNode.getModelFacet(); - if (modelFacet != null && modelFacet.getMetaClass() != null) { - if (commentGenClass.equals(modelFacet.getMetaClass())) { - topNodeComments.add(topLevelNode); - } - } - } - } - - /** - * Retrieves the child node comment edit parts - * - * @param editorGenerator - * the root node of the gmfgen - * @param monitor - * the progress monitor - */ - protected void retrieveChildNodeCommentEditPart(GenEditorGenerator editorGenerator, IProgressMonitor monitor) { - GenDiagram diagram = editorGenerator.getDiagram(); - if (diagram == null) { - MessageDialog.openError(Display.getCurrent().getActiveShell(), "Impossible to find the diagram associated to this editor", "No diagram was found for this editor. \n\nYou should create one diagram before running this action"); - } - GenClass commentGenClass = findGenClassForMetaclass(editorGenerator, "Comment"); - for (GenChildNode childNode : diagram.getChildNodes()) { - TypeModelFacet modelFacet = childNode.getModelFacet(); - if (modelFacet != null && modelFacet.getMetaClass() != null) { - if (commentGenClass.equals(modelFacet.getMetaClass())) { - childNodeComments.add(childNode); - } - } - } - } - - /** - * Retrieves the child node comment edit parts - * - * @param editorGenerator - * the root node of the gmfgen - * @param monitor - * the progress monitor - */ - protected void retrieveCommentParser(GenEditorGenerator editorGenerator, IProgressMonitor monitor) { - GenParsers parsers = editorGenerator.getLabelParsers(); - if (parsers == null) { - MessageDialog.openError(Display.getCurrent().getActiveShell(), "Impossible to find the parsers associated to this editor", "No parser container was found for this editor. \n\nYou should create the parsers container before running this action"); - } - for (GenParserImplementation parserImplementation : parsers.getImplementations()) { - if (parserImplementation instanceof CustomParser) { - if ("org.eclipse.papyrus.diagram.common.parser.CommentParser".equals(((CustomParser) parserImplementation).getQualifiedName())) { - commentParser = ((CustomParser) parserImplementation); - } - } - } - } - - - /** - * - */ - protected GenClass findGenClassForMetaclass(EObject eObject, String name) { - Resource notation = eObject.eResource().getResourceSet().getResource(uri_UML2, true); - return findGenClass(notation, name); - } - - /** - * - */ - protected GenClass findGenClassForNotation(EObject eObject, String name) { - Resource notation = eObject.eResource().getResourceSet().getResource(uri_notation, true); - return findGenClass(notation, name); - } - - /** - * - */ - protected GenFeature findGenAttributeForMetaclass(EObject eObject, String genClassName, String genFeatureName) { - Resource notation = eObject.eResource().getResourceSet().getResource(uri_UML2, true); - return findGenFeature(notation, genClassName, genFeatureName); - } -} diff --git a/plugins/toolsmiths/org.eclipse.papyrus.gmfgenextension/src/org/eclipse/papyrus/papyrusgmfgenextension/popupaction/AddSemanticElementTypeInGenericTopNode.java b/plugins/toolsmiths/org.eclipse.papyrus.gmfgenextension/src/org/eclipse/papyrus/papyrusgmfgenextension/popupaction/AddSemanticElementTypeInGenericTopNode.java deleted file mode 100644 index 22fc174ea94..00000000000 --- a/plugins/toolsmiths/org.eclipse.papyrus.gmfgenextension/src/org/eclipse/papyrus/papyrusgmfgenextension/popupaction/AddSemanticElementTypeInGenericTopNode.java +++ /dev/null @@ -1,191 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2009 CEA LIST. - * All rights reserved. This program and the accompanying materials - * are property of the CEA, their use is subject to specific agreement - * with the CEA. - * - * Contributors: - * CEA LIST - initial API and implementation - *******************************************************************************/ - -package org.eclipse.papyrus.papyrusgmfgenextension.popupaction; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -import org.eclipse.emf.codegen.ecore.genmodel.GenClass; -import org.eclipse.emf.common.util.URI; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.resource.Resource; -import org.eclipse.emf.ecore.resource.ResourceSet; -import org.eclipse.jface.action.IAction; -import org.eclipse.jface.dialogs.MessageDialog; -import org.eclipse.papyrus.gmf.codegen.gmfgen.ElementType; -import org.eclipse.papyrus.gmf.codegen.gmfgen.GMFGenFactory; -import org.eclipse.papyrus.gmf.codegen.gmfgen.GenDiagram; -import org.eclipse.papyrus.gmf.codegen.gmfgen.GenTopLevelNode; -import org.eclipse.papyrus.gmf.codegen.gmfgen.TypeModelFacet; -import org.eclipse.swt.widgets.Display; -import org.eclipse.ui.IViewPart; - -/** - * Implementation class for AddSemanticElementTypeInGenericTopNode action - */ -public class AddSemanticElementTypeInGenericTopNode extends Action { - - /** prefix for Metamodel type identifier */ - private static final String ORG_ECLIPSE_PAPYRUS_UML = "org.eclipse.papyrus.uml."; - - public static final String GEN_CLASS_RT_CLASS = "Node"; //$NON-NLS-1$ - - public static final String GEN_CLASS_FACET_META_FEATURE = "NamedElement"; //$NON-NLS-1$ - - public static final String GEN_FEATURE_FACET_META_FEATURE = "name"; //$NON-NLS-1$ - - public static final String URI_NOTATION_GENMODEL = "org.eclipse.gmf.runtime.notation/model/notation.genmodel"; //$NON-NLS-1$ - - public static final String URI_UML_GENMODEL = "org.eclipse.uml2.uml/model/UML.genmodel"; //$NON-NLS-1$ - - - - /* - * (non-Javadoc) - * - * @see org.eclipse.ui.IViewActionDelegate#init(org.eclipse.ui.IViewPart) - */ - public void init(IViewPart view) { - // NO OP - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction) - */ - @Override - public void run(IAction action) { - - // Parse selected GenLink(s) and add the desired CustomBehavior - Iterator it = getSelectedEObject().iterator(); - while (it.hasNext()) { - EObject eObject = it.next(); - if (eObject instanceof GenDiagram) { - - GenDiagram genDiagram = (GenDiagram) eObject; - ResourceSet resourceSet = genDiagram.eResource().getResourceSet(); - int updated = 0; - int created = 0; - - // create and set values for top node and sub children - List concreteUMLMetaclasses = getAllUMLConcreteClasses(resourceSet); - for (GenClass currentGenClass : concreteUMLMetaclasses) { - boolean needsCreation = false; - - String metaclassName = currentGenClass.getEcoreClass().getName(); - GenTopLevelNode node = findTopLevelNode(genDiagram, currentGenClass); - if (node == null) { - needsCreation = true; - node = createNewTopNode(genDiagram, metaclassName); - created++; - } - updateToplevelNode(node, resourceSet, currentGenClass); - - if (needsCreation) { - genDiagram.getTopLevelNodes().add(node); - } - updated++; - } - - MessageDialog.openInformation(Display.getCurrent().getActiveShell(), "Generation", created + " nodes were created.\n " + updated + " nodes were updated"); - } - } - } - - - - /** - * Returns all the UML {@link GenClass} that are related to UML constructs which are not abstract - * - * @param resourceSet - * @return - */ - protected List getAllUMLConcreteClasses(ResourceSet resourceSet) { - Resource umlResource = resourceSet.getResource(URI.createPlatformPluginURI(URI_UML_GENMODEL, false), true); - List classes = new ArrayList(); - Iterator it = umlResource.getAllContents(); - while (it.hasNext()) { - EObject next = it.next(); - if (next instanceof GenClass) { - GenClass genClass = (GenClass) next; - EClass umlEClass = genClass.getEcoreClass(); - if (umlEClass != null && !umlEClass.isAbstract() && !umlEClass.isInterface()) { - classes.add(genClass); - } - } - } - return classes; - } - - /** - * Returns the top level node that corresponds to this metaclass - * - * @param metaclassName - * name of the metaclass for which element type has to be defined - * @return the top level node found or null; - */ - protected GenTopLevelNode findTopLevelNode(GenDiagram genDiagram, GenClass genClass) { - for (GenTopLevelNode topNode : genDiagram.getTopLevelNodes()) { - TypeModelFacet facet = topNode.getModelFacet(); - if (facet != null) { - if (genClass.equals(facet.getMetaClass())) { - return topNode; - } - ; - } - } - return null; - } - - protected void updateToplevelNode(GenTopLevelNode topLevelNode, ResourceSet resourceSet, GenClass genClass) { - String metaclassName = genClass.getEcoreClass().getName(); - topLevelNode.setDiagramRunTimeClass(getNodeViewClass(resourceSet)); - - TypeModelFacet typeModelFacet = topLevelNode.getModelFacet(); - if (typeModelFacet == null) { - typeModelFacet = GMFGenFactory.eINSTANCE.createTypeModelFacet(); - topLevelNode.setModelFacet(typeModelFacet); - } - - typeModelFacet.setMetaClass(genClass); - - ElementType type = topLevelNode.getElementType(); - if (type == null) { - type = GMFGenFactory.eINSTANCE.createMetamodelType(); - topLevelNode.setElementType(type); - } - type.setDefinedExternally(true); - type.setDisplayName(metaclassName + "_Semantic"); - type.setUniqueIdentifier(ORG_ECLIPSE_PAPYRUS_UML + metaclassName); - } - - public GenTopLevelNode createNewTopNode(GenDiagram genDiagram, String metaclassName) { - GenTopLevelNode topLevelNode = GMFGenFactory.eINSTANCE.createGenTopLevelNode(); - return topLevelNode; - } - - - protected GenClass getNodeViewClass(ResourceSet resourceSet) { - URI uri_notation = URI.createPlatformPluginURI(URI_NOTATION_GENMODEL, false); - Resource notation = resourceSet.getResource(uri_notation, true); - return findGenClass(notation, GEN_CLASS_RT_CLASS); - } - - protected GenClass getMetaclassGenClass(ResourceSet resourceSet, String metaclassName) { - URI uri_uml = URI.createPlatformPluginURI(URI_UML_GENMODEL, false); - Resource umlResource = resourceSet.getResource(uri_uml, true); - return findGenClass(umlResource, metaclassName); - } - -} diff --git a/plugins/toolsmiths/org.eclipse.papyrus.gmfgenextension/src/org/eclipse/papyrus/papyrusgmfgenextension/popupaction/AddShapeNamedElementAction.java b/plugins/toolsmiths/org.eclipse.papyrus.gmfgenextension/src/org/eclipse/papyrus/papyrusgmfgenextension/popupaction/AddShapeNamedElementAction.java deleted file mode 100644 index ace0b540cd3..00000000000 --- a/plugins/toolsmiths/org.eclipse.papyrus.gmfgenextension/src/org/eclipse/papyrus/papyrusgmfgenextension/popupaction/AddShapeNamedElementAction.java +++ /dev/null @@ -1,175 +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 2.0 - * which accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation - * - *****************************************************************************/ -package org.eclipse.papyrus.papyrusgmfgenextension.popupaction; - -import java.util.Iterator; - -import org.eclipse.emf.common.util.URI; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.resource.Resource; -import org.eclipse.jface.action.IAction; -import org.eclipse.jface.dialogs.MessageDialog; -import org.eclipse.papyrus.gmf.codegen.gmfgen.GenDiagram; -import org.eclipse.papyrus.gmf.codegen.gmfgen.GenLabel; -import org.eclipse.papyrus.gmf.codegen.gmfgen.GenTopLevelNode; -import org.eclipse.swt.widgets.Shell; - - - -/** - * The Class AddShapeNamedElementAction: create an edit part to display an element as the shape that comes from applied stereotypes. - */ -public class AddShapeNamedElementAction extends Action { - - - /** The Constant MESSAGE_INTRO. */ - protected static final String MESSAGE_INTRO = Messages.message_Intro; - - /** The Constant MESSAGE_INFO_1. */ - protected static final String MESSAGE_INFO_1 = Messages.rulesAboutShapeEditPart; - - /** The Constant MESSAGE_INFO_2. */ - protected static final String MESSAGE_INFO_2 = Messages.ruleAboutChangeEditPolicy; - - /** The Constant PACKAGED_ELEMENT_ATTRIBUTE. */ - protected static final String PACKAGED_ELEMENT_ATTRIBUTE = "packagedElement"; //$NON-NLS-1$ - - /** The Constant PACKAGE_NAME. */ - protected static final String PACKAGE_NAME = "Package"; //$NON-NLS-1$ - - /** The Constant UNKNOW_EDITPOLICY. */ - protected static final String UNKNOW_EDITPOLICY = "YOUR OWN CHANGE SHAPE EDIT POLICY"; //$NON-NLS-1$ - - /** The Constant QUALIFIED_NAME_DISPLAY_EDIT_POLICY_VALUE. */ - protected static final String QUALIFIED_NAME_DISPLAY_EDIT_POLICY_VALUE = "org.eclipse.papyrus.diagram.common.editpolicies.QualifiedNameDisplayEditPolicy"; //$NON-NLS-1$ - - /** The Constant NODE_LABEL_DISPLAY_EDIT_POLICY_VALUE. */ - protected static final String NODE_LABEL_DISPLAY_EDIT_POLICY_VALUE = "org.eclipse.papyrus.diagram.common.editpolicies.AppliedStereotypeNodeLabelDisplayEditPolicy"; //$NON-NLS-1$ - - /** The Constant POPUP_BAR_EDIT_POLICY_VALUE. */ - protected static final String POPUP_BAR_EDIT_POLICY_VALUE = "org.eclipse.papyrus.diagram.common.editpolicies.HyperLinkPopupBarEditPolicy"; //$NON-NLS-1$ - - /** The Constant CHANGE_SHAPE_POLICY_KEY. */ - protected static final String CHANGE_SHAPE_POLICY_KEY = "org.eclipse.papyrus.diagram.common.editpolicies.ChangeStereotypedShapeEditPolicy.CHANGE_SHAPE_POLICY"; //$NON-NLS-1$ - - /** The Constant POLICY_QUALIFIED_NAME_POLICY_KEY. */ - protected static final String POLICY_QUALIFIED_NAME_POLICY_KEY = "org.eclipse.papyrus.diagram.common.editpolicies.QualifiedNameDisplayEditPolicy.QUALIFIED_NAME_POLICY"; //$NON-NLS-1$ - - /** The Constant STEREOTYPE_LABEL_POLICY_KEY. */ - protected static final String STEREOTYPE_LABEL_POLICY_KEY = "org.eclipse.papyrus.diagram.common.editpolicies.AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY"; //$NON-NLS-1$ - - /** The Constant POPUPBAR_ROLE_KEY. */ - protected static final String POPUPBAR_ROLE_KEY = "org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.POPUPBAR_ROLE"; //$NON-NLS-1$ - - /** The Constant NAME_ATTRIBUTE. */ - protected static final String NAME_ATTRIBUTE = "name"; //$NON-NLS-1$ - - /** The Constant NAMED_ELEMENT_NAME. */ - protected static final String NAMED_ELEMENT_NAME = "NamedElement"; //$NON-NLS-1$ - - /** The Constant NODE_NAMED_ELEMENT_FIGURE. */ - protected static final String NODE_NAMED_ELEMENT_FIGURE = "org.eclipse.papyrus.diagram.common.figure.node.ShapeNamedElementFigure"; //$NON-NLS-1$ - - /** The Constant GMF_NODE. */ - protected static final String GMF_NODE = "Node"; //$NON-NLS-1$ - - /** The Constant WRAPPING_LABEL. */ - protected static final String WRAPPING_LABEL = "org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel"; //$NON-NLS-1$ - - /** The Constant DEFAULT_NAMED_ELEMENT_NAME. */ - protected static final String DEFAULT_NAMED_ELEMENT_NAME = "ShapeNamedElementName"; //$NON-NLS-1$ - - /** The Constant URI_UML_GENMODEL. */ - protected static final String URI_UML_GENMODEL = "org.eclipse.uml2.uml/model/UML.genmodel"; //$NON-NLS-1$ - - /** The Constant URI_NOTATION_GENMODEL. */ - protected static final String URI_NOTATION_GENMODEL = "org.eclipse.gmf.runtime.notation/model/notation.genmodel"; //$NON-NLS-1$ - - /** The Constant DEFAULT_NAMED_ELEMENT. */ - private static final String DEFAULT_NAMED_ELEMENT = "ShapeNamedElement"; //$NON-NLS-1$ - - /** - * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction) - * - * @param action - */ - @Override - public void run(IAction action) { - Iterator it = getSelectedEObject().iterator(); - while (it.hasNext()) { - EObject eObject = it.next(); - if (eObject instanceof GenDiagram) { - GenDiagram genDiagram = ((GenDiagram) eObject); - createTopNode(genDiagram); - } - } - } - - /** - * Creates the top node. - * - * @param genDiagram - * the gen diagram - */ - public void createTopNode(GenDiagram genDiagram) { - URI uri_notation = URI.createPlatformPluginURI(URI_NOTATION_GENMODEL, false); - - Resource notation = genDiagram.eResource().getResourceSet().getResource(uri_notation, true); - - GenTopLevelNode topNode = EditpartGenHelper.createTopNode(genDiagram, DEFAULT_NAMED_ELEMENT, findGenClass(notation, GMF_NODE)); - genDiagram.getTopLevelNodes().add(topNode); - EditpartGenHelper.createMetaModelType(topNode, DEFAULT_NAMED_ELEMENT); - addBehavior(topNode); - addModelFacet(topNode); - GenLabel label = EditpartGenHelper.createExternalGenNodeLabel(topNode, DEFAULT_NAMED_ELEMENT_NAME, findGenClass(notation, GMF_NODE)); - EditpartGenHelper.createLabelViewMap(label, WRAPPING_LABEL); - findGenClass(notation, GMF_NODE); - EditpartGenHelper.createFigureViewMap(topNode, NODE_NAMED_ELEMENT_FIGURE, 100, 50); - URI uri_uml = URI.createPlatformPluginURI(URI_UML_GENMODEL, false); - Resource uml = topNode.eResource().getResourceSet().getResource(uri_uml, true); - EditpartGenHelper.createLabelModelFacet(label, findGenFeature(uml, NAMED_ELEMENT_NAME, NAME_ATTRIBUTE), EditpartGenHelper.getFirstPredefinedParse(genDiagram.getEditorGen())); - MessageDialog.open(MessageDialog.INFORMATION, new Shell(), Messages.generalInformation, MESSAGE_INTRO + MESSAGE_INFO_1 + MESSAGE_INFO_2, MessageDialog.NONE); - - } - - /** - * Adds the behavior. - * - * @param topNode - * the top node - */ - public void addBehavior(GenTopLevelNode topNode) { - // add behavior - EditpartGenHelper.addBehavior(topNode, POPUPBAR_ROLE_KEY, POPUP_BAR_EDIT_POLICY_VALUE); - EditpartGenHelper.addBehavior(topNode, STEREOTYPE_LABEL_POLICY_KEY, NODE_LABEL_DISPLAY_EDIT_POLICY_VALUE); - EditpartGenHelper.addBehavior(topNode, POLICY_QUALIFIED_NAME_POLICY_KEY, QUALIFIED_NAME_DISPLAY_EDIT_POLICY_VALUE); - EditpartGenHelper.addBehavior(topNode, CHANGE_SHAPE_POLICY_KEY, UNKNOW_EDITPOLICY); - } - - /** - * Adds the model facet. - * - * @param topNode - * the top node - */ - public void addModelFacet(GenTopLevelNode topNode) { - URI uri_uml = URI.createPlatformPluginURI(URI_UML_GENMODEL, false); - Resource uml = topNode.eResource().getResourceSet().getResource(uri_uml, true); - EditpartGenHelper.createModelFacet(topNode, findGenFeature(uml, PACKAGE_NAME, PACKAGED_ELEMENT_ATTRIBUTE), findGenClass(uml, NAMED_ELEMENT_NAME)); - - } - -} diff --git a/plugins/toolsmiths/org.eclipse.papyrus.gmfgenextension/src/org/eclipse/papyrus/papyrusgmfgenextension/popupaction/AddSmallAndLargeIconForPaletteAction.java b/plugins/toolsmiths/org.eclipse.papyrus.gmfgenextension/src/org/eclipse/papyrus/papyrusgmfgenextension/popupaction/AddSmallAndLargeIconForPaletteAction.java deleted file mode 100644 index 3cb31bced90..00000000000 --- a/plugins/toolsmiths/org.eclipse.papyrus.gmfgenextension/src/org/eclipse/papyrus/papyrusgmfgenextension/popupaction/AddSmallAndLargeIconForPaletteAction.java +++ /dev/null @@ -1,215 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2009 CEA LIST. - * All rights reserved. This program and the accompanying materials - * are property of the CEA, their use is subject to specific agreement - * with the CEA. - * - * Contributors: - * CEA LIST - initial API and implementation - *******************************************************************************/ - -package org.eclipse.papyrus.papyrusgmfgenextension.popupaction; - -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; - -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.NullProgressMonitor; -import org.eclipse.emf.codegen.ecore.genmodel.GenClass; -import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.EPackage; -import org.eclipse.jface.action.IAction; -import org.eclipse.jface.dialogs.MessageDialog; -import org.eclipse.papyrus.gmf.codegen.gmfgen.GenCommonBase; -import org.eclipse.papyrus.gmf.codegen.gmfgen.GenLink; -import org.eclipse.papyrus.gmf.codegen.gmfgen.GenNode; -import org.eclipse.papyrus.gmf.codegen.gmfgen.LinkModelFacet; -import org.eclipse.papyrus.gmf.codegen.gmfgen.Palette; -import org.eclipse.papyrus.gmf.codegen.gmfgen.ToolEntry; -import org.eclipse.papyrus.gmf.codegen.gmfgen.ToolGroup; -import org.eclipse.papyrus.gmf.codegen.gmfgen.ToolGroupItem; -import org.eclipse.papyrus.gmf.codegen.gmfgen.TypeLinkModelFacet; -import org.eclipse.papyrus.gmf.codegen.gmfgen.TypeModelFacet; -import org.eclipse.swt.widgets.Display; - -/** - * Implementation class for AddGenLinkStereotypeDisplayBehavior action - */ -public class AddSmallAndLargeIconForPaletteAction extends Action { - - /** output messages for user information */ - protected List messages = new ArrayList(); - - /** number of modified elements */ - protected int modifiedElements = 0; - - /** - * {@inheritDoc} - */ - @Override - public void run(IAction action) { - - IProgressMonitor monitor = new NullProgressMonitor(); - messages.clear(); - modifiedElements = 0; - - // Parse selected GenLink(s) and add the desired CustomBehavior - Iterator it = getSelectedEObject().iterator(); - while (it.hasNext()) { - EObject eObject = it.next(); - if (eObject instanceof Palette) { - monitor.beginTask("Generate palette icons", IProgressMonitor.UNKNOWN); - generateIconsForEntry((Palette) eObject, monitor); - } else if (eObject instanceof ToolGroup) { - monitor.beginTask("Generate group icons", IProgressMonitor.UNKNOWN); - generateIconsForGroup((ToolGroup) eObject, monitor); - } else if (eObject instanceof ToolEntry) { - monitor.beginTask("Generate entry icons", IProgressMonitor.UNKNOWN); - generateIconsForEntry((ToolEntry) eObject, monitor); - } - try { - eObject.eResource().save(new HashMap()); - } catch (IOException e) { - e.printStackTrace(); - } - - if (!messages.isEmpty()) { - MessageDialog.openInformation(Display.getCurrent().getActiveShell(), "Information", messages.toString()); - System.err.println(messages); - } - } - } - - /** - * Generates both the small and large icons field for the specified group, and the sub tools - * - * @param toolEntry - * the tool entry to modify - * @param monitor - * the progress monitor that displays the task currently run - */ - private void generateIconsForGroup(ToolGroup group, IProgressMonitor monitor) { - // monitor.subTask("Generate " + ((group.getTitle() != null) ? group.getTitle() : "") - // + "icons"); - if (group.getSmallIconPath() == null) { - group.setSmallIconPath("platform:/plugin/org.eclipse.gmf.runtime.diagram.ui/icons/group.gif"); - messages.add("INFO: added small icon for " + group); - modifiedElements++; - } - - if (group.getLargeIconPath() == null) { - group.setLargeIconPath("platform:/plugin/org.eclipse.gmf.runtime.diagram.ui/icons/group.gif"); - messages.add("INFO: added large icon for " + group); - } - - monitor.subTask("Generate group entries icons"); - // get all sub tools, and generate for them - for (ToolGroupItem entry : group.getEntries()) { - if (entry instanceof ToolEntry) { - generateIconsForEntry((ToolEntry) entry, monitor); - } - } - } - - private void generateIconsForEntry(Palette eObject, IProgressMonitor monitor) { - Iterator it = eObject.getGroups().iterator(); - while (it.hasNext()) { - generateIconsForGroup(it.next(), monitor); - } - - } - - /** - * Generates both the small and large icons field for the specified toolentry - * - * @param toolEntry - * the tool entry to modify - * @param monitor - * the progress monitor that displays the task currently run - */ - private void generateIconsForEntry(ToolEntry toolEntry, IProgressMonitor monitor) { - // retrieve viewed model element - EList list = toolEntry.getElements(); - GenClass genClass = null; - String name = ""; - if (!list.isEmpty()) { - // two possiblities: either entry is a genNode or a genLink - GenCommonBase base = list.get(0); - if (base instanceof GenNode) { - TypeModelFacet facet = ((GenNode) base).getModelFacet(); - if (facet != null) { - genClass = facet.getMetaClass(); - - } - } else if (base instanceof GenLink) { - LinkModelFacet facet = ((GenLink) base).getModelFacet(); - if (facet instanceof TypeLinkModelFacet) { - genClass = ((TypeLinkModelFacet) facet).getMetaClass(); - } - } - } - - if (genClass == null) { - messages.add("ERROR: " + toolEntry + " : impossible to find its gen class associated"); - return; - } - - // check name is not null null - if (genClass != null) { - name = genClass.getName(); - } - assert name != null : "impossible to find a name for model element: " + toolEntry; - - String smallIconPath = ""; - // retrieve icon for the element - // TODO: should be filled using a configuration - - if (getEclassPackageNsURI(genClass).equals("http://www.eclipse.org/uml2/3.0.0/UML")) { - smallIconPath = "platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/" + name + ".gif"; - } else { - return; - } - - String largeIconPath = smallIconPath; - - if (toolEntry.getSmallIconPath() == null || "".equals(toolEntry.getSmallIconPath())) { - toolEntry.setSmallIconPath(smallIconPath); - modifiedElements++; - } else { - messages.add("INFO: " + toolEntry + " small icon field was not modified because it was already filled"); - } - if (toolEntry.getLargeIconPath() == null || "".equals(toolEntry.getLargeIconPath())) { - toolEntry.setLargeIconPath(largeIconPath); - messages.add("INFO: " + toolEntry + " large icon field was not modified because it was already filled"); - } - - monitor.worked(1); - } - - /** - * Returns the nsURI of the EPackage of the given gen class - * - * @param genClass - * the gen class the nsuri should retrieved from. - * @return "" if nothing was found - */ - private String getEclassPackageNsURI(GenClass genClass) { - final EClass eClass = genClass.getEcoreClass(); - if (eClass != null) { - final EPackage ePackage = eClass.getEPackage(); - if (ePackage != null) { - return (ePackage.getNsURI() != null ? ePackage.getNsURI() : ""); - } else { - messages.add("ERROR: " + eClass + " has no associated epackage"); - } - } else { - messages.add("ERROR: " + genClass + " has no ecore class"); - } - return ""; - } -} diff --git a/plugins/toolsmiths/org.eclipse.papyrus.gmfgenextension/src/org/eclipse/papyrus/papyrusgmfgenextension/popupaction/DisplayReport.java b/plugins/toolsmiths/org.eclipse.papyrus.gmfgenextension/src/org/eclipse/papyrus/papyrusgmfgenextension/popupaction/DisplayReport.java deleted file mode 100644 index 75026ca3285..00000000000 --- a/plugins/toolsmiths/org.eclipse.papyrus.gmfgenextension/src/org/eclipse/papyrus/papyrusgmfgenextension/popupaction/DisplayReport.java +++ /dev/null @@ -1,147 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2014 CEA LIST. - * All rights reserved. This program and the accompanying materials - * are property of the CEA, their use is subject to specific agreement - * with the CEA. - * - * Contributors: - * CEA LIST - initial API and implementation - *******************************************************************************/ - -package org.eclipse.papyrus.papyrusgmfgenextension.popupaction; - -import java.util.Iterator; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.resource.Resource; -import org.eclipse.jface.action.IAction; -import org.eclipse.papyrus.gmf.codegen.gmfgen.GenChildLabelNode; -import org.eclipse.papyrus.gmf.codegen.gmfgen.GenChildNode; -import org.eclipse.papyrus.gmf.codegen.gmfgen.GenChildSideAffixedNode; -import org.eclipse.papyrus.gmf.codegen.gmfgen.GenCommonBase; -import org.eclipse.papyrus.gmf.codegen.gmfgen.GenLink; -import org.eclipse.papyrus.gmf.codegen.gmfgen.GenTopLevelNode; -import org.eclipse.papyrus.gmf.codegen.gmfgen.TypeLinkModelFacet; -import org.eclipse.swt.SWT; -import org.eclipse.swt.layout.FillLayout; -import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.swt.widgets.Text; -import org.eclipse.ui.IViewPart; - -/** - * Display the lis of nodes - */ -public class DisplayReport extends Action { - - /* - * (non-Javadoc) - * - * @see org.eclipse.ui.IViewActionDelegate#init(org.eclipse.ui.IViewPart) - */ - public void init(IViewPart view) { - // NO OP - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction) - */ - @Override - public void run(IAction action) { - - Iterator it = getSelectedEObject().iterator(); - while (it.hasNext()) { - EObject eObject = it.next(); - - // Action should not be available on objects that are not GenCommonBase - if (eObject instanceof GenCommonBase) { - GenCommonBase genCommonBase = (GenCommonBase) eObject; - StringBuffer out = getTopNodes(genCommonBase.eResource()); - Shell shell = new Shell(Display.getCurrent()); - - shell.setText("report"); - shell.setLayout(new FillLayout()); - Text text1 = new Text(shell, SWT.MULTI | SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL); - text1.setText(out.toString()); - shell.pack(); - shell.open(); - - } - - } - } - - public StringBuffer getTopNodes(Resource gmfgen) { - StringBuffer out = new StringBuffer(); - // Find the highest VisualID used by the chosen kind of node (given by clazz) - Iterator it = gmfgen.getAllContents(); - out = out.append("TopNode\n"); - // topNode - while (it.hasNext()) { - EObject eObject = it.next(); - if (eObject instanceof GenTopLevelNode) { - GenTopLevelNode genTopLevelNode = (GenTopLevelNode) eObject; - if (genTopLevelNode.getModelFacet() != null) { - out = out.append(genTopLevelNode.getModelFacet().getMetaClass().getEcoreClass().getName() + " " + genTopLevelNode.getVisualID() + "\n"); - } - } - } - - out = out.append("\nChildNode\n"); - it = gmfgen.getAllContents(); - // topNode - while (it.hasNext()) { - EObject eObject = it.next(); - if (eObject instanceof GenChildNode) { - GenChildNode genTopLevelNode = (GenChildNode) eObject; - if (genTopLevelNode.getModelFacet() != null) { - out = out.append(genTopLevelNode.getModelFacet().getMetaClass().getEcoreClass().getName() + " " + genTopLevelNode.getVisualID() + "\n"); - } - } - } - - out = out.append("\nChildLabelNode\n"); - it = gmfgen.getAllContents(); - // topNode - while (it.hasNext()) { - EObject eObject = it.next(); - if (eObject instanceof GenChildLabelNode) { - GenChildLabelNode genTopLevelNode = (GenChildLabelNode) eObject; - if (genTopLevelNode.getModelFacet() != null) { - out = out.append(genTopLevelNode.getModelFacet().getMetaClass().getEcoreClass().getName() + " " + genTopLevelNode.getVisualID() + "\n"); - } - } - } - - out = out.append("\nAffixedNode\n"); - it = gmfgen.getAllContents(); - // topNode - while (it.hasNext()) { - EObject eObject = it.next(); - if (eObject instanceof GenChildSideAffixedNode) { - GenChildSideAffixedNode genTopLevelNode = (GenChildSideAffixedNode) eObject; - if (genTopLevelNode.getModelFacet() != null) { - out = out.append(genTopLevelNode.getModelFacet().getMetaClass().getEcoreClass().getName() + " " + genTopLevelNode.getVisualID() + "\n"); - } - } - } - out = out.append("\nLink\n"); - it = gmfgen.getAllContents(); - // topNode - while (it.hasNext()) { - EObject eObject = it.next(); - if (eObject instanceof GenLink) { - GenLink genTopLevelNode = (GenLink) eObject; - if (genTopLevelNode.getModelFacet() != null) { - if (genTopLevelNode.getModelFacet() instanceof TypeLinkModelFacet) { - out = out.append(((TypeLinkModelFacet) genTopLevelNode.getModelFacet()).getMetaClass().getEcoreClass().getName() + " " + genTopLevelNode.getVisualID() + "\n"); - } - } - } - } - return out; - } - -} diff --git a/plugins/toolsmiths/org.eclipse.papyrus.gmfgenextension/src/org/eclipse/papyrus/papyrusgmfgenextension/popupaction/EditpartGenHelper.java b/plugins/toolsmiths/org.eclipse.papyrus.gmfgenextension/src/org/eclipse/papyrus/papyrusgmfgenextension/popupaction/EditpartGenHelper.java deleted file mode 100644 index 816c8fd219b..00000000000 --- a/plugins/toolsmiths/org.eclipse.papyrus.gmfgenextension/src/org/eclipse/papyrus/papyrusgmfgenextension/popupaction/EditpartGenHelper.java +++ /dev/null @@ -1,261 +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 2.0 - * which accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation - * - *****************************************************************************/ -package org.eclipse.papyrus.papyrusgmfgenextension.popupaction; - -import java.util.Iterator; - -import org.eclipse.emf.codegen.ecore.genmodel.GenClass; -import org.eclipse.emf.codegen.ecore.genmodel.GenFeature; -import org.eclipse.papyrus.gmf.codegen.gmfgen.CustomBehaviour; -import org.eclipse.papyrus.gmf.codegen.gmfgen.DefaultSizeAttributes; -import org.eclipse.papyrus.gmf.codegen.gmfgen.FeatureLabelModelFacet; -import org.eclipse.papyrus.gmf.codegen.gmfgen.FigureViewmap; -import org.eclipse.papyrus.gmf.codegen.gmfgen.GMFGenFactory; -import org.eclipse.papyrus.gmf.codegen.gmfgen.GenCommonBase; -import org.eclipse.papyrus.gmf.codegen.gmfgen.GenDiagram; -import org.eclipse.papyrus.gmf.codegen.gmfgen.GenEditorGenerator; -import org.eclipse.papyrus.gmf.codegen.gmfgen.GenLabel; -import org.eclipse.papyrus.gmf.codegen.gmfgen.GenNode; -import org.eclipse.papyrus.gmf.codegen.gmfgen.GenNodeLabel; -import org.eclipse.papyrus.gmf.codegen.gmfgen.GenParserImplementation; -import org.eclipse.papyrus.gmf.codegen.gmfgen.GenTopLevelNode; -import org.eclipse.papyrus.gmf.codegen.gmfgen.MetamodelType; -import org.eclipse.papyrus.gmf.codegen.gmfgen.ParentAssignedViewmap; -import org.eclipse.papyrus.gmf.codegen.gmfgen.PredefinedParser; -import org.eclipse.papyrus.gmf.codegen.gmfgen.StyleAttributes; -import org.eclipse.papyrus.gmf.codegen.gmfgen.TypeModelFacet; - - - -/** - * The Class EditpartGenHelper tha contains a lot of useful method to create gennodes etc.. - */ -public class EditpartGenHelper { - - /** The Constant EDIT_HELPER. */ - public static final String EDIT_HELPER = "EditHelper"; - - /** The Constant CANONICAL_EDIT_POLICY. */ - protected static final String CANONICAL_EDIT_POLICY = "CanonicalEditPolicy"; //$NON-NLS-1$ - - /** The Constant EDIT_PART. */ - private static final String EDIT_PART = "EditPart"; //$NON-NLS-1$ - - /** - * Adds the behavior. - * - * @param base - * the base where we want to add a behvior - * @param key - * the key - * @param value - * the value - */ - public static void addBehavior(GenCommonBase base, String key, String value) { - CustomBehaviour behaviour = GMFGenFactory.eINSTANCE.createCustomBehaviour(); - behaviour.setKey(key); - behaviour.setEditPolicyQualifiedClassName(value); - base.getBehaviour().add(behaviour); - } - - /** - * Creates the top node. - * - * @param genDiagram - * the gen diagram - * @param name - * the name - * @param visualClass - * the visual class node etc.. - * @return the gen top level node - */ - public static GenTopLevelNode createTopNode(GenDiagram genDiagram, String name, GenClass visualClass) { - GenTopLevelNode topNode = GMFGenFactory.eINSTANCE.createGenTopLevelNode(); - topNode.setEditPartClassName(name + EDIT_PART); - topNode.setCanonicalEditPolicyClassName(name + CANONICAL_EDIT_POLICY); - topNode.setCreateCommandClassName(name + "CreateCommand"); //$NON-NLS-1$ - topNode.setGraphicalNodeEditPolicyClassName(name + "GraphicalNodeEditPolicy"); //$NON-NLS-1$ - topNode.setItemSemanticEditPolicyClassName(name + "ItemSemanticEditPolicy"); //$NON-NLS-1$ - topNode.setDiagramRunTimeClass(visualClass); - genDiagram.getTopLevelNodes().add(topNode); - topNode.setVisualID(SetVisualIDWithUnusedValue.getNewVisualID(topNode.eResource(), topNode.getClass())); - - - return topNode; - - } - - /** - * Creates the gen node label. - * - * @param genNode - * the gen node - * @param name - * the name - * @param visualClass - * the visual class node etc... - * @return the gen node label - */ - public static GenNodeLabel createGenNodeLabel(GenNode genNode, String name, GenClass visualClass) { - GenNodeLabel nodeLabel = GMFGenFactory.eINSTANCE.createGenNodeLabel(); - nodeLabel.setEditPartClassName(name + EDIT_PART); - nodeLabel.setItemSemanticEditPolicyClassName(name + "ItemSemanticEditPolicy"); //$NON-NLS-1$ - nodeLabel.setDiagramRunTimeClass(visualClass); - genNode.getLabels().add(nodeLabel); - nodeLabel.setVisualID(SetVisualIDWithUnusedValue.getNewVisualID(genNode.eResource(), GenCommonBase.class)); - - return nodeLabel; - - } - - /** - * Creates the external gen node label. - * - * @param genNode - * the gen node - * @param name - * the name - * @param visualClass - * the visual class node etc ... - * @return the gen node label - */ - public static GenNodeLabel createExternalGenNodeLabel(GenNode genNode, String name, GenClass visualClass) { - GenNodeLabel nodeLabel = GMFGenFactory.eINSTANCE.createGenExternalNodeLabel(); - nodeLabel.setEditPartClassName(name + EDIT_PART); - nodeLabel.setItemSemanticEditPolicyClassName(name + "ItemSemanticEditPolicy"); //$NON-NLS-1$ - nodeLabel.setDiagramRunTimeClass(visualClass); - genNode.getLabels().add(nodeLabel); - nodeLabel.setVisualID(SetVisualIDWithUnusedValue.getNewVisualID(genNode.eResource(), GenCommonBase.class)); - - return nodeLabel; - - } - - /** - * Creates the meta model type. - * - * @param base - * the base that will contains the metamodel type - * @param name - * the name of the edit class helper - */ - public static void createMetaModelType(GenCommonBase base, String name) { - MetamodelType metamodelType = GMFGenFactory.eINSTANCE.createMetamodelType(); - metamodelType.setDefinedExternally(false); - metamodelType.setDisplayName(name); - metamodelType.setEditHelperClassName(name + EDIT_HELPER); - metamodelType.setDiagramElement(base); - } - - - /** - * Creates the label view map. - * - * @param base - * the base that will contains the labelview map - * @param qualifiedNameFigure - * the qualified name figure - */ - public static void createLabelViewMap(GenCommonBase base, String qualifiedNameFigure) { - ParentAssignedViewmap figureViewmap = GMFGenFactory.eINSTANCE.createParentAssignedViewmap(); - figureViewmap.setFigureQualifiedClassName(qualifiedNameFigure); - figureViewmap.setGetterName("getNameLabel"); - StyleAttributes styleAttributes = GMFGenFactory.eINSTANCE.createStyleAttributes(); - styleAttributes.setFixedBackground(false); - styleAttributes.setFixedFont(true); - styleAttributes.setFixedForeground(false); - - figureViewmap.getAttributes().add(styleAttributes); - base.setViewmap(figureViewmap); - } - - /** - * Creates the figure view map. - * - * @param base - * the base that will contains the labelview map - * @param qualifiedNameFigure - * the qualified name figure - * @param width - * the width of the default figure - * @param height - * the height of the default figure - */ - public static void createFigureViewMap(GenCommonBase base, String qualifiedNameFigure, int width, int height) { - FigureViewmap figureViewmap = GMFGenFactory.eINSTANCE.createFigureViewmap(); - figureViewmap.setFigureQualifiedClassName(qualifiedNameFigure); - DefaultSizeAttributes defaultSizeAttributes = GMFGenFactory.eINSTANCE.createDefaultSizeAttributes(); - defaultSizeAttributes.setWidth(width); - defaultSizeAttributes.setHeight(height); - figureViewmap.getAttributes().add(defaultSizeAttributes); - base.setViewmap(figureViewmap); - } - - /** - * Creates the model facet. - * - * @param base - * the base that will contains the model facet - * @param genFeature - * the gen feature - * @param genclass - * the genclass - */ - public static void createModelFacet(GenNode base, GenFeature genFeature, GenClass genclass) { - TypeModelFacet facet = GMFGenFactory.eINSTANCE.createTypeModelFacet(); - facet.setMetaClass(genclass); - facet.setContainmentMetaFeature(genFeature); - base.setModelFacet(facet); - - } - - /** - * Creates the label model facet. - * - * @param label - * the label that will contains the label model facet - * @param genFeature - * the gen feature - * @param value - * the value - */ - public static void createLabelModelFacet(GenLabel label, GenFeature genFeature, GenParserImplementation value) { - FeatureLabelModelFacet facet = GMFGenFactory.eINSTANCE.createFeatureLabelModelFacet(); - facet.getMetaFeatures().add(genFeature); - facet.setParser(value); - label.setModelFacet(facet); - - } - - /** - * Gets the first predefined parse. - * - * @param editorView - * the editor view - * @return the first predefined parse - */ - public static PredefinedParser getFirstPredefinedParse(GenEditorGenerator editorView) { - Iterator iter = editorView.getLabelParsers().getImplementations().iterator(); - while (iter.hasNext()) { - GenParserImplementation base = iter.next(); - if (base instanceof PredefinedParser) { - return (PredefinedParser) base; - } - - } - return null; - } -} diff --git a/plugins/toolsmiths/org.eclipse.papyrus.gmfgenextension/src/org/eclipse/papyrus/papyrusgmfgenextension/popupaction/Messages.java b/plugins/toolsmiths/org.eclipse.papyrus.gmfgenextension/src/org/eclipse/papyrus/papyrusgmfgenextension/popupaction/Messages.java deleted file mode 100644 index a30dd3771eb..00000000000 --- a/plugins/toolsmiths/org.eclipse.papyrus.gmfgenextension/src/org/eclipse/papyrus/papyrusgmfgenextension/popupaction/Messages.java +++ /dev/null @@ -1,53 +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 2.0 - * which accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation - * - *****************************************************************************/ -package org.eclipse.papyrus.papyrusgmfgenextension.popupaction; - -import org.eclipse.osgi.util.NLS; - - -/** - * The Class Messages. - */ -public class Messages extends NLS { - - /** The Constant BUNDLE_NAME. */ - private static final String BUNDLE_NAME = "org.eclipse.papyrus.papyrusgmfgenextension.popupaction.messages"; //$NON-NLS-1$ - - /** The rules about named element. */ - public static String rulesAboutNamedElement; - - /** The message_ intro. */ - public static String message_Intro; - - /** The rules about shape edit part. */ - public static String rulesAboutShapeEditPart; - - /** The rule about change edit policy. */ - public static String ruleAboutChangeEditPolicy; - - /** The general information. */ - public static String generalInformation; - static { - // initialize resource bundle - NLS.initializeMessages(BUNDLE_NAME, Messages.class); - } - - /** - * Instantiates a new messages. - */ - private Messages() { - } -} diff --git a/plugins/toolsmiths/org.eclipse.papyrus.gmfgenextension/src/org/eclipse/papyrus/papyrusgmfgenextension/popupaction/SetCompartmentNeedsTitleToTrueAction.java b/plugins/toolsmiths/org.eclipse.papyrus.gmfgenextension/src/org/eclipse/papyrus/papyrusgmfgenextension/popupaction/SetCompartmentNeedsTitleToTrueAction.java deleted file mode 100644 index 1223037a019..00000000000 --- a/plugins/toolsmiths/org.eclipse.papyrus.gmfgenextension/src/org/eclipse/papyrus/papyrusgmfgenextension/popupaction/SetCompartmentNeedsTitleToTrueAction.java +++ /dev/null @@ -1,68 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2011 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License 2.0 - * which accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation - *****************************************************************************/ - - -package org.eclipse.papyrus.papyrusgmfgenextension.popupaction; - -import java.util.Iterator; -import java.util.List; - -import org.eclipse.core.runtime.Assert; -import org.eclipse.emf.common.command.Command; -import org.eclipse.emf.common.command.CompoundCommand; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.edit.command.SetCommand; -import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain; -import org.eclipse.emf.edit.domain.EditingDomain; -import org.eclipse.jface.action.IAction; -import org.eclipse.papyrus.gmf.codegen.gmfgen.GMFGenPackage; -import org.eclipse.papyrus.gmf.codegen.gmfgen.GenCompartment; - -/** - * This action allows to set the field Needs Title in the Selected Compartments to true - * - * This action was created for the bug 343092. - * - */ -public class SetCompartmentNeedsTitleToTrueAction extends Action { - - - @Override - public void run(IAction action) { - - CompoundCommand command = new CompoundCommand(); - List selection = getSelectedEObject(); - if (!selection.isEmpty()) { - EditingDomain domain = AdapterFactoryEditingDomain.getEditingDomainFor(selection.get(0)); - Assert.isNotNull(domain); - Iterator iter = selection.iterator(); - while (iter.hasNext()) { - Object current = iter.next(); - if (current instanceof GenCompartment) { - GenCompartment compartment = (GenCompartment) current; - // we set that the compartment needs to have a Title - Command cmd = SetCommand.create(domain, compartment, GMFGenPackage.eINSTANCE.getGenCompartment_NeedsTitle(), true); - if (cmd.canExecute()) { - command.append(cmd); - } - } - } - - if (command.canExecute()) { - domain.getCommandStack().execute(command); - } - } - } -} diff --git a/plugins/toolsmiths/org.eclipse.papyrus.gmfgenextension/src/org/eclipse/papyrus/papyrusgmfgenextension/popupaction/SetVisualIDWithUnusedValue.java b/plugins/toolsmiths/org.eclipse.papyrus.gmfgenextension/src/org/eclipse/papyrus/papyrusgmfgenextension/popupaction/SetVisualIDWithUnusedValue.java deleted file mode 100644 index 4b267b02908..00000000000 --- a/plugins/toolsmiths/org.eclipse.papyrus.gmfgenextension/src/org/eclipse/papyrus/papyrusgmfgenextension/popupaction/SetVisualIDWithUnusedValue.java +++ /dev/null @@ -1,123 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2009 CEA LIST. - * All rights reserved. This program and the accompanying materials - * are property of the CEA, their use is subject to specific agreement - * with the CEA. - * - * Contributors: - * CEA LIST - initial API and implementation - *******************************************************************************/ - -package org.eclipse.papyrus.papyrusgmfgenextension.popupaction; - -import java.util.Iterator; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.resource.Resource; -import org.eclipse.jface.action.IAction; -import org.eclipse.papyrus.gmf.codegen.gmfgen.GenCommonBase; -import org.eclipse.ui.IViewPart; - -/** - * Implementation class for SetVisualIDWithUnusedValue action - */ -public class SetVisualIDWithUnusedValue extends Action { - - /* - * (non-Javadoc) - * - * @see org.eclipse.ui.IViewActionDelegate#init(org.eclipse.ui.IViewPart) - */ - public void init(IViewPart view) { - // NO OP - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction) - */ - @Override - public void run(IAction action) { - - Iterator it = getSelectedEObject().iterator(); - while (it.hasNext()) { - EObject eObject = it.next(); - - // Action should not be available on objects that are not GenCommonBase - if (eObject instanceof GenCommonBase) { - GenCommonBase genCommonBase = (GenCommonBase) eObject; - int visualID = getNewVisualID(genCommonBase.eResource(), genCommonBase.getClass()); - - genCommonBase.setVisualID(visualID); - } - - } - } - - /** - * This method returns an unused VisualID The method first parse all the VisualID of a particular kind of node (clazz) to find the highest. The - * new VisualID is the highest + 1 (also tested against - * the case another kind of node uses same id) - * - * @param gmfgen - * the gmfgen model - * @param clazz - * kind of GenCommonBase node tested - * @return an unused VisualID (following the highest VisualID used by same kind of node) - */ - public static int getNewVisualID(Resource gmfgen, Class clazz) { - int visualID = -1; - - // Find the highest VisualID used by the chosen kind of node (given by clazz) - int lastUsed = 0; - Iterator it = gmfgen.getAllContents(); - while (it.hasNext()) { - EObject eObject = it.next(); - if (clazz.isInstance(eObject)) { - GenCommonBase genCommonBase = (GenCommonBase) eObject; - if (lastUsed < genCommonBase.getVisualID()) { - lastUsed = genCommonBase.getVisualID(); - } - } - } - - // Check if another kind of node does not already use visualID - // increment result in such a case - visualID = lastUsed + 1; - while (isUsedVisualID(gmfgen, visualID)) { - visualID++; - } - return visualID; - } - - /** - * Tests if the VisualID parameter is already used in the resource - * - * @param gmfgen - * the gmfgen model - * @param visualID - * the id to check - * @return true if visualID is already used, else returns false - */ - public static boolean isUsedVisualID(Resource gmfgen, int visualID) { - - boolean used = false; - - // Iterate over the gmfgen model - Iterator it = gmfgen.getAllContents(); - while (it.hasNext() && !used) { - EObject eObject = it.next(); - - // Most Gen node inherits from GenCommonBase (owns VisualID) - if (eObject instanceof GenCommonBase) { - GenCommonBase genCommonBase = (GenCommonBase) eObject; - if (visualID == genCommonBase.getVisualID()) { - used = true; - } - } - } - - return used; - } -} diff --git a/plugins/toolsmiths/org.eclipse.papyrus.gmfgenextension/src/org/eclipse/papyrus/papyrusgmfgenextension/popupaction/TestCodeSetGeneration.java b/plugins/toolsmiths/org.eclipse.papyrus.gmfgenextension/src/org/eclipse/papyrus/papyrusgmfgenextension/popupaction/TestCodeSetGeneration.java deleted file mode 100644 index 8d5b05b2eba..00000000000 --- a/plugins/toolsmiths/org.eclipse.papyrus.gmfgenextension/src/org/eclipse/papyrus/papyrusgmfgenextension/popupaction/TestCodeSetGeneration.java +++ /dev/null @@ -1,204 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2014 CEA LIST. - * All rights reserved. This program and the accompanying materials - * are property of the CEA, their use is subject to specific agreement - * with the CEA. - * - * Contributors: - * CEA LIST - initial API and implementation - *******************************************************************************/ - -package org.eclipse.papyrus.papyrusgmfgenextension.popupaction; - -import java.util.Iterator; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.resource.Resource; -import org.eclipse.jface.action.IAction; -import org.eclipse.papyrus.gmf.codegen.gmfgen.GenChildLabelNode; -import org.eclipse.papyrus.gmf.codegen.gmfgen.GenChildNode; -import org.eclipse.papyrus.gmf.codegen.gmfgen.GenChildSideAffixedNode; -import org.eclipse.papyrus.gmf.codegen.gmfgen.GenCommonBase; -import org.eclipse.papyrus.gmf.codegen.gmfgen.GenLink; -import org.eclipse.papyrus.gmf.codegen.gmfgen.GenTopLevelNode; -import org.eclipse.papyrus.gmf.codegen.gmfgen.TypeLinkModelFacet; -import org.eclipse.swt.SWT; -import org.eclipse.swt.layout.FillLayout; -import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.swt.widgets.Text; -import org.eclipse.ui.IViewPart; - -/** - * Display the lis of nodes - */ -public class TestCodeSetGeneration extends Action { - - /* - * (non-Javadoc) - * - * @see org.eclipse.ui.IViewActionDelegate#init(org.eclipse.ui.IViewPart) - */ - public void init(IViewPart view) { - // NO OP - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction) - */ - @Override - public void run(IAction action) { - - Iterator it = getSelectedEObject().iterator(); - while (it.hasNext()) { - EObject eObject = it.next(); - - // Action should not be available on objects that are not GenCommonBase - if (eObject instanceof GenCommonBase) { - GenCommonBase genCommonBase = (GenCommonBase) eObject; - StringBuffer out = getTopNodes(genCommonBase.eResource()); - Shell shell = new Shell(Display.getCurrent()); - - shell.setText("report"); - shell.setLayout(new FillLayout()); - Text text1 = new Text(shell, SWT.MULTI | SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL); - text1.setText(out.toString()); - shell.pack(); - shell.open(); - - } - - } - } - - public StringBuffer getTopNodes(Resource gmfgen) { - StringBuffer out = new StringBuffer(); - // Find the highest VisualID used by the chosen kind of node (given by clazz) - Iterator it = gmfgen.getAllContents(); - out = out.append("\n*************************************************\nTopNode\n******************************************************\n"); - // topNode - while (it.hasNext()) { - EObject eObject = it.next(); - if (eObject instanceof GenTopLevelNode) { - GenTopLevelNode genTopLevelNode = (GenTopLevelNode) eObject; - if (genTopLevelNode.getModelFacet() != null) { - String name = genTopLevelNode.getModelFacet().getMetaClass().getEcoreClass().getName(); - String visalId = "" + genTopLevelNode.getVisualID(); - out = out.append( - "/**\n" + - "* Test to manage " + name + ".\n" + - "*/\n" + - "@Test\n" + - "public void testTo" + name + "() {\n" + - " testToManageNode(UMLElementTypes." + name + "_" + visalId + ", UMLPackage.eINSTANCE.get" + name + "(), UMLElementTypes." + name + "_" + visalId + ", false);\n" + - "}\n"); - } - } - } - - out = out.append("\n************************************************************************************************************************\n" - + "ChildNode\n" - + "************************************************************************************************************************\n"); - it = gmfgen.getAllContents(); - // topNode - while (it.hasNext()) { - EObject eObject = it.next(); - if (eObject instanceof GenChildNode && !(eObject instanceof GenChildLabelNode) && !(eObject instanceof GenChildSideAffixedNode)) { - GenChildNode genTopLevelNode = (GenChildNode) eObject; - if (genTopLevelNode.getModelFacet() != null) { - String name = genTopLevelNode.getModelFacet().getMetaClass().getEcoreClass().getName(); - String visalId = "" + genTopLevelNode.getVisualID(); - out = out.append( - "/**\n" + - "* Test to manage " + name + ".\n" + - "*/\n" + - "@Test\n" + - "public void testTo" + name + "() {\n" + - " testToManageNode(UMLElementTypes." + name + "_" + visalId + ", UMLPackage.eINSTANCE.get" + name + "(), container, true);\n" + - - "}\n"); - } - } - } - - out = out.append("\n********************************************************************************************************************" - + "*\nChildLabelNode\n" - + "******************************************************************************************************************************\n"); - it = gmfgen.getAllContents(); - // topNode - while (it.hasNext()) { - EObject eObject = it.next(); - if (eObject instanceof GenChildLabelNode) { - GenChildLabelNode genTopLevelNode = (GenChildLabelNode) eObject; - if (genTopLevelNode.getModelFacet() != null) { - String name = genTopLevelNode.getModelFacet().getMetaClass().getEcoreClass().getName(); - String visalId = "" + genTopLevelNode.getVisualID(); - out = out.append( - "/**\n" + - "* Test to manage " + name + ".\n" + - "*/\n" + - "@Test\n" + - "public void testTo" + name + "() {\n" + - "testToManageTopNodeWithMask(UMLElementTypes.Container,UMLElementTypes." + name + "_" + visalId + ", Compartment.VISUAL_ID,null);\n" + - "}\n"); - } - } - } - - out = out.append("\n**************************************************************************************************************\n" - + "AffixedNode\n" - + "*************************************************************************************************************************\n"); - it = gmfgen.getAllContents(); - // topNode - while (it.hasNext()) { - EObject eObject = it.next(); - if (eObject instanceof GenChildSideAffixedNode) { - GenChildSideAffixedNode genTopLevelNode = (GenChildSideAffixedNode) eObject; - if (genTopLevelNode.getModelFacet() != null) { - String name = genTopLevelNode.getModelFacet().getMetaClass().getEcoreClass().getName(); - String visalId = "" + genTopLevelNode.getVisualID(); - out = out.append( - "/**\n" + - "* Test to manage " + name + ".\n" + - "*/\n" + - "@Test\n" + - "public void testTo" + name + "() {\n" + - "setTestAffixedNode(true);\n" + - " testToManageNode(UMLElementTypes." + name + "_" + visalId + ", UMLPackage.eINSTANCE.get" + name + "(), container, true);\n" + - "setTestAffixedNode(false);\n" + - "}\n"); - - } - } - } - out = out.append("\n************************************************************************************************************\n" - + "Link\n" - + "*****************************************************************************************************************************\n"); - it = gmfgen.getAllContents(); - // topNode - while (it.hasNext()) { - EObject eObject = it.next(); - if (eObject instanceof GenLink) { - GenLink genTopLevelNode = (GenLink) eObject; - if (genTopLevelNode.getModelFacet() != null) { - if (genTopLevelNode.getModelFacet() instanceof TypeLinkModelFacet) { - String name = ((TypeLinkModelFacet) genTopLevelNode.getModelFacet()).getMetaClass().getEcoreClass().getName(); - String visalId = "" + genTopLevelNode.getVisualID(); - out = out.append( - "/**\n" + - "* Test to manage component.\n" + - "*/\n" + - "@Test\n" + - "public void testTo" + name + "() {\n" + - "testToManageLink(UMLElementTypes.source, UMLElementTypes.target, UMLElementTypes." + name + "_" + visalId + ", container, true);\n" + - "}\n"); - } - } - } - } - return out; - } - -} diff --git a/plugins/toolsmiths/org.eclipse.papyrus.gmfgenextension/src/org/eclipse/papyrus/papyrusgmfgenextension/popupaction/UpdateElementTypeToMatchGenericType.java b/plugins/toolsmiths/org.eclipse.papyrus.gmfgenextension/src/org/eclipse/papyrus/papyrusgmfgenextension/popupaction/UpdateElementTypeToMatchGenericType.java deleted file mode 100644 index 87dc09c3453..00000000000 --- a/plugins/toolsmiths/org.eclipse.papyrus.gmfgenextension/src/org/eclipse/papyrus/papyrusgmfgenextension/popupaction/UpdateElementTypeToMatchGenericType.java +++ /dev/null @@ -1,256 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2009 CEA LIST. - * All rights reserved. This program and the accompanying materials - * are property of the CEA, their use is subject to specific agreement - * with the CEA. - * - * Contributors: - * CEA LIST - initial API and implementation - *******************************************************************************/ -package org.eclipse.papyrus.papyrusgmfgenextension.popupaction; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -import org.eclipse.emf.codegen.ecore.genmodel.GenClass; -import org.eclipse.emf.common.util.URI; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.resource.Resource; -import org.eclipse.emf.ecore.resource.ResourceSet; -import org.eclipse.jface.action.IAction; -import org.eclipse.jface.dialogs.MessageDialog; -import org.eclipse.papyrus.gmf.codegen.gmfgen.ElementType; -import org.eclipse.papyrus.gmf.codegen.gmfgen.GMFGenFactory; -import org.eclipse.papyrus.gmf.codegen.gmfgen.GenCommonBase; -import org.eclipse.papyrus.gmf.codegen.gmfgen.GenDiagram; -import org.eclipse.papyrus.gmf.codegen.gmfgen.GenTopLevelNode; -import org.eclipse.papyrus.gmf.codegen.gmfgen.MetamodelType; -import org.eclipse.papyrus.gmf.codegen.gmfgen.SpecializationType; -import org.eclipse.papyrus.gmf.codegen.gmfgen.TypeModelFacet; -import org.eclipse.swt.widgets.Display; -import org.eclipse.ui.IViewPart; - -/** - * Implementation class for AddSemanticElementTypeInGenericTopNode action - */ -public class UpdateElementTypeToMatchGenericType extends Action { - - private static final String GENERIC_UML_GMFGEN = "GenericUML.gmfgen"; - - /** prefix for Metamodel type identifier */ - private static final String ORG_ECLIPSE_PAPYRUS_UML = "org.eclipse.papyrus.uml."; - - public static final String GEN_CLASS_RT_CLASS = "Node"; //$NON-NLS-1$ - - public static final String GEN_CLASS_FACET_META_FEATURE = "NamedElement"; //$NON-NLS-1$ - - public static final String GEN_FEATURE_FACET_META_FEATURE = "name"; //$NON-NLS-1$ - - public static final String URI_NOTATION_GENMODEL = "org.eclipse.gmf.runtime.notation/model/notation.genmodel"; //$NON-NLS-1$ - - public static final String URI_UML_GENMODEL = "org.eclipse.uml2.uml/model/UML.genmodel"; //$NON-NLS-1$ - - /* - * (non-Javadoc) - * - * @see org.eclipse.ui.IViewActionDelegate#init(org.eclipse.ui.IViewPart) - */ - public void init(IViewPart view) { - // NO OP - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction) - */ - @Override - public void run(IAction action) { - // Parse selected GenLink(s) and add the desired CustomBehavior - Iterator it = getSelectedEObject().iterator(); - while (it.hasNext()) { - EObject eObject = it.next(); - if (eObject instanceof SpecializationType) { - SpecializationType specializationType = (SpecializationType) eObject; - Resource genericTypeResource = getGenericTypeResource(specializationType.eResource().getResourceSet()); - if (genericTypeResource == null) { - MessageDialog.openError(Display.getCurrent().getActiveShell(), "Error", "no " + GENERIC_UML_GMFGEN + " resource has been found."); - return; - } - // retrieve associated metaclass - GenClass metaclass = specializationType.getMetamodelType().getMetaClass(); - String id = specializationType.getUniqueIdentifier(); - String displayName = specializationType.getDisplayName(); - // check precondition before creating a duplicate - if (metaclass == null) { - MessageDialog.openError(Display.getCurrent().getActiveShell(), "Error", "metaclass is null"); - } else { - // create the specialization type and update it - SpecializationType newType = GMFGenFactory.eINSTANCE.createSpecializationType(); - newType.setUniqueIdentifier(id); - newType.setDefinedExternally(false); - newType.setDisplayName(displayName); - - // find generic element type - EClass eClass = metaclass.getEcoreClass(); - - Iterator genericTypes = genericTypeResource.getAllContents(); - while (genericTypes.hasNext()) { - EObject object = genericTypes.next(); - if (object instanceof MetamodelType) { - MetamodelType type = ((MetamodelType) object); - if (type.getMetaClass().getEcoreClass().equals(eClass)) { - newType.setMetamodelType(type); - } - } - } - - // replace existing type - GenCommonBase commonBase = specializationType.getDiagramElement(); - commonBase.setElementType(newType); - MessageDialog.openInformation(Display.getCurrent().getActiveShell(), "Generation", "Specialization type was created and has replaced the specialization type\n" + newType); - } - } else if (eObject instanceof MetamodelType) { - MetamodelType metamodelType = (MetamodelType) eObject; - Resource genericTypeResource = getGenericTypeResource(metamodelType.eResource().getResourceSet()); - if (genericTypeResource == null) { - MessageDialog.openError(Display.getCurrent().getActiveShell(), "Error", "no " + GENERIC_UML_GMFGEN + " resource has been found."); - return; - } - // retrieve associated metaclass - GenClass metaclass = metamodelType.getMetaClass(); - String id = metamodelType.getUniqueIdentifier(); - String displayName = metamodelType.getDisplayName(); - // check precondition before creating a duplicate - if (metaclass == null) { - MessageDialog.openError(Display.getCurrent().getActiveShell(), "Error", "metaclass is null"); - } else { - // create the specialization type and update it - SpecializationType newType = GMFGenFactory.eINSTANCE.createSpecializationType(); - newType.setUniqueIdentifier(id); - newType.setDefinedExternally(false); - newType.setDisplayName(displayName); - - // find generic element type - EClass eClass = metaclass.getEcoreClass(); - - Iterator genericTypes = genericTypeResource.getAllContents(); - while (genericTypes.hasNext()) { - EObject object = genericTypes.next(); - if (object instanceof MetamodelType) { - MetamodelType type = ((MetamodelType) object); - if (type.getMetaClass().getEcoreClass().equals(eClass)) { - newType.setMetamodelType(type); - } - } - } - - // replace existing type - GenCommonBase commonBase = metamodelType.getDiagramElement(); - commonBase.setElementType(newType); - MessageDialog.openInformation(Display.getCurrent().getActiveShell(), "Generation", "Specialization type was created and has replaced the metamodel type\n" + newType); - } - } - } - } - - /** - * @param resourceSet - * @return - */ - protected Resource getGenericTypeResource(ResourceSet resourceSet) { - for (Resource resource : resourceSet.getResources()) { - URI resourceURI = resource.getURI(); - String resourceName = resourceURI.segment(resourceURI.segmentCount() - 1); - if (GENERIC_UML_GMFGEN.equals(resourceName)) { - return resource; - } - } - return null; - } - - protected MetamodelType getGenericType(ResourceSet resourceSet, EClass eClass) { - return null; - } - - /** - * Returns all the UML {@link GenClass} that are related to UML constructs which are not abstract - * - * @param resourceSet - * @return - */ - protected List getAllUMLConcreteClasses(ResourceSet resourceSet) { - Resource umlResource = resourceSet.getResource(URI.createPlatformPluginURI(URI_UML_GENMODEL, false), true); - List classes = new ArrayList(); - Iterator it = umlResource.getAllContents(); - while (it.hasNext()) { - EObject next = it.next(); - if (next instanceof GenClass) { - GenClass genClass = (GenClass) next; - EClass umlEClass = genClass.getEcoreClass(); - if (umlEClass != null && !umlEClass.isAbstract() && !umlEClass.isInterface()) { - classes.add(genClass); - } - } - } - return classes; - } - - /** - * Returns the top level node that corresponds to this metaclass - * - * @param metaclassName - * name of the metaclass for which element type has to be defined - * @return the top level node found or null; - */ - protected GenTopLevelNode findTopLevelNode(GenDiagram genDiagram, GenClass genClass) { - for (GenTopLevelNode topNode : genDiagram.getTopLevelNodes()) { - TypeModelFacet facet = topNode.getModelFacet(); - if (facet != null) { - if (genClass.equals(facet.getMetaClass())) { - return topNode; - } - ; - } - } - return null; - } - - protected void updateToplevelNode(GenTopLevelNode topLevelNode, ResourceSet resourceSet, GenClass genClass) { - String metaclassName = genClass.getEcoreClass().getName(); - topLevelNode.setDiagramRunTimeClass(getNodeViewClass(resourceSet)); - TypeModelFacet typeModelFacet = topLevelNode.getModelFacet(); - if (typeModelFacet == null) { - typeModelFacet = GMFGenFactory.eINSTANCE.createTypeModelFacet(); - topLevelNode.setModelFacet(typeModelFacet); - } - typeModelFacet.setMetaClass(genClass); - ElementType type = topLevelNode.getElementType(); - if (type == null) { - type = GMFGenFactory.eINSTANCE.createMetamodelType(); - topLevelNode.setElementType(type); - } - type.setDefinedExternally(true); - type.setDisplayName(metaclassName + "_Semantic"); - type.setUniqueIdentifier(ORG_ECLIPSE_PAPYRUS_UML + metaclassName); - } - - public GenTopLevelNode createNewTopNode(GenDiagram genDiagram, String metaclassName) { - GenTopLevelNode topLevelNode = GMFGenFactory.eINSTANCE.createGenTopLevelNode(); - return topLevelNode; - } - - protected GenClass getNodeViewClass(ResourceSet resourceSet) { - URI uri_notation = URI.createPlatformPluginURI(URI_NOTATION_GENMODEL, false); - Resource notation = resourceSet.getResource(uri_notation, true); - return findGenClass(notation, GEN_CLASS_RT_CLASS); - } - - protected GenClass getMetaclassGenClass(ResourceSet resourceSet, String metaclassName) { - URI uri_uml = URI.createPlatformPluginURI(URI_UML_GENMODEL, false); - Resource umlResource = resourceSet.getResource(uri_uml, true); - return findGenClass(umlResource, metaclassName); - } -} diff --git a/plugins/toolsmiths/org.eclipse.papyrus.gmfgenextension/src/org/eclipse/papyrus/papyrusgmfgenextension/popupaction/messages.properties b/plugins/toolsmiths/org.eclipse.papyrus.gmfgenextension/src/org/eclipse/papyrus/papyrusgmfgenextension/popupaction/messages.properties deleted file mode 100644 index 500f4e5ba6e..00000000000 --- a/plugins/toolsmiths/org.eclipse.papyrus.gmfgenextension/src/org/eclipse/papyrus/papyrusgmfgenextension/popupaction/messages.properties +++ /dev/null @@ -1,5 +0,0 @@ -rulesAboutNamedElement=set in the gmf extension that this edit part must inherits from org.eclipse.papyrus.diagram.common.editparts.NamedElementEditPart -message_Intro=Do not forget :\n -rulesAboutShapeEditPart=- set the abstract editpart in the gmf extension: org.eclipse.papyrus.diagram.common.editparts.AbstractShapeEditPart\n -ruleAboutChangeEditPolicy=- Fill the editpolicy CHANGE_SHAPE_POLICY that have to inherit from org.eclipse.papyrus.diagram.common.editpolicies.ChangeStereotypedShapeEditPolicy -generalInformation=Generation Information diff --git a/plugins/toolsmiths/org.eclipse.papyrus.releng.dev.release/release.xml b/plugins/toolsmiths/org.eclipse.papyrus.releng.dev.release/release.xml index 6120467ffd6..9e34f209cd7 100755 --- a/plugins/toolsmiths/org.eclipse.papyrus.releng.dev.release/release.xml +++ b/plugins/toolsmiths/org.eclipse.papyrus.releng.dev.release/release.xml @@ -23,7 +23,6 @@ - @@ -109,7 +108,6 @@ - diff --git a/plugins/toolsmiths/pom.xml b/plugins/toolsmiths/pom.xml index e873526d122..1023d0211d5 100644 --- a/plugins/toolsmiths/pom.xml +++ b/plugins/toolsmiths/pom.xml @@ -45,7 +45,6 @@ org.eclipse.papyrus.gmf.editpartview org.eclipse.papyrus.gmf.editpoliciesstates org.eclipse.papyrus.gmf.figureview - org.eclipse.papyrus.gmfgenextension org.eclipse.papyrus.infra.emf.commandstack org.eclipse.papyrus.infra.gmfdiag.css.debug org.eclipse.papyrus.mwe2.utils diff --git a/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.canonical.tests/META-INF/MANIFEST.MF b/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.canonical.tests/META-INF/MANIFEST.MF index 184d9cafe21..417c9a00216 100644 --- a/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.canonical.tests/META-INF/MANIFEST.MF +++ b/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.canonical.tests/META-INF/MANIFEST.MF @@ -2,7 +2,6 @@ Manifest-Version: 1.0 Require-Bundle: org.eclipse.emf.databinding;bundle-version="[1.5.0,2.0.0)", org.eclipse.papyrus.gmf.codegen;bundle-version="[2.11.0,3.0.0)", org.eclipse.gmf.runtime.diagram.ui.properties;bundle-version="[1.8.0,2.0.0)", - org.eclipse.papyrus.gmfgenextension;bundle-version="[3.0.0,4.0.0)", org.eclipse.papyrus.infra.core;bundle-version="[4.0.0,5.0.0)", org.eclipse.papyrus.infra.emf;bundle-version="[4.0.0,5.0.0)", org.eclipse.papyrus.infra.emf.gmf;bundle-version="[2.0.0,3.0.0)", diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.profile.tests/org.eclipse.papyrus.uml.diagram.profile.tests.launch b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.profile.tests/org.eclipse.papyrus.uml.diagram.profile.tests.launch deleted file mode 100644 index 7e9b36bcc10..00000000000 --- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.profile.tests/org.eclipse.papyrus.uml.diagram.profile.tests.launch +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -- cgit v1.2.3