Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorian Noyrit2015-01-29 13:51:19 +0000
committerFlorian Noyrit2015-01-29 13:51:19 +0000
commitae20f7c9923c61bb0d984acc8b2d34eb0624504a (patch)
treef72388129bc6670a6850bbb22f44aa4caf5dda7b /plugins/developer/org.eclipse.papyrus.def
parent6b3e9e8dc029e80405ba4d63db87877d18091f21 (diff)
parent8c6be54105c3480e839406fe8dd41043570bd8b9 (diff)
downloadorg.eclipse.papyrus-ae20f7c9923c61bb0d984acc8b2d34eb0624504a.tar.gz
org.eclipse.papyrus-ae20f7c9923c61bb0d984acc8b2d34eb0624504a.tar.xz
org.eclipse.papyrus-ae20f7c9923c61bb0d984acc8b2d34eb0624504a.zip
Merge branch 'master' into committers/fnoyrit/elementtypesconfigurations
Conflicts: plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/impl/diagram/editparts/.gitignore plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/metamodel/.gitignore plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/.gitignore plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/diagram/commands/.gitignore plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/diagram/editpolicies/.gitignore plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/editor/.gitignore plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/editor/palette/.gitignore plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/navigator/.gitignore plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/providers/.gitignore plugins/developer/org.eclipse.papyrus.def/xtend/aspects/diagram/editparts/LinkLabelEditPart.xtend plugins/developer/org.eclipse.papyrus.def/xtend/aspects/impl/diagram/editparts/DiagramEditPart.xtend plugins/developer/org.eclipse.papyrus.def/xtend/aspects/impl/diagram/editparts/LinkLabelEditPart.xtend plugins/developer/org.eclipse.papyrus.def/xtend/aspects/impl/diagram/editparts/NodeEditPart.xtend plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.blockdefinition/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/provider/CustomEditPolicyProvider.java plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock/src-gen/org/eclipse/papyrus/sysml/diagram/internalblock/edit/part/InternalBlockDiagramEditPart.java plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock/src/org/eclipse/papyrus/sysml/diagram/internalblock/provider/CustomEditPolicyProvider.java plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.requirement/src-gen/org/eclipse/papyrus/sysml/diagram/requirement/edit/part/RequirementDiagramEditPart.java plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.requirement/src/org/eclipse/papyrus/sysml/diagram/requirement/edit/part/CustomRequirementInformationCompartmentEditPart.java plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/model/activityDiagram.gmfgen plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/plugin.xml plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/command/CInstanceSpecificationLinkCreateCommand.java plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/uml/diagram/clazz/custom/ui/AssociationSelectionDialog.java plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/model/classdiagram.gmfgen plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/src/org/eclipse/papyrus/uml/diagram/clazz/edit/parts/AssociationClassAttributeCompartmentEditPart.java plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/src/org/eclipse/papyrus/uml/diagram/clazz/edit/parts/AssociationClassNestedClassifierCompartmentEditPart.java plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/src/org/eclipse/papyrus/uml/diagram/clazz/edit/parts/AssociationClassOperationCompartmentEditPart.java plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/src/org/eclipse/papyrus/uml/diagram/clazz/edit/parts/AssociationEditPart.java plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/src/org/eclipse/papyrus/uml/diagram/clazz/edit/parts/ClassAttributeCompartmentEditPart.java plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/src/org/eclipse/papyrus/uml/diagram/clazz/edit/parts/ClassAttributeCompartmentEditPartCN.java plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/src/org/eclipse/papyrus/uml/diagram/clazz/edit/parts/ClassNestedClassifierCompartmentEditPart.java plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/src/org/eclipse/papyrus/uml/diagram/clazz/edit/parts/ClassNestedClassifierCompartmentEditPartCN.java plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/src/org/eclipse/papyrus/uml/diagram/clazz/edit/parts/ClassOperationCompartmentEditPart.java plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/src/org/eclipse/papyrus/uml/diagram/clazz/edit/parts/ClassOperationCompartmentEditPartCN.java plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/src/org/eclipse/papyrus/uml/diagram/clazz/edit/parts/ComponentAttributeCompartmentEditPart.java plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/src/org/eclipse/papyrus/uml/diagram/clazz/edit/parts/ComponentAttributeCompartmentEditPartCN.java plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/src/org/eclipse/papyrus/uml/diagram/clazz/edit/parts/ComponentNestedClassifierCompartmentEditPart.java plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/src/org/eclipse/papyrus/uml/diagram/clazz/edit/parts/ComponentNestedClassifierCompartmentEditPartCN.java plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/src/org/eclipse/papyrus/uml/diagram/clazz/edit/parts/ComponentOperationCompartmentEditPart.java plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/src/org/eclipse/papyrus/uml/diagram/clazz/edit/parts/ComponentOperationCompartmentEditPartCN.java plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/src/org/eclipse/papyrus/uml/diagram/clazz/edit/parts/DataTypeAttributeCompartmentEditPart.java plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/src/org/eclipse/papyrus/uml/diagram/clazz/edit/parts/DataTypeAttributeCompartmentEditPartCN.java plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/src/org/eclipse/papyrus/uml/diagram/clazz/edit/parts/DataTypeOperationCompartmentEditPart.java plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/src/org/eclipse/papyrus/uml/diagram/clazz/edit/parts/DataTypeOperationCompartmentEditPartCN.java plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/src/org/eclipse/papyrus/uml/diagram/clazz/edit/parts/DependencyEditPart.java plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/src/org/eclipse/papyrus/uml/diagram/clazz/edit/parts/EnumerationEnumerationLiteralCompartmentEditPart.java plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/src/org/eclipse/papyrus/uml/diagram/clazz/edit/parts/EnumerationEnumerationLiteralCompartmentEditPartCN.java plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/src/org/eclipse/papyrus/uml/diagram/clazz/edit/parts/InstanceSpecificationSlotCompartmentEditPart.java plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/src/org/eclipse/papyrus/uml/diagram/clazz/edit/parts/InstanceSpecificationSlotCompartmentEditPartCN.java plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/src/org/eclipse/papyrus/uml/diagram/clazz/edit/parts/InterfaceAttributeCompartmentEditPart.java plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/src/org/eclipse/papyrus/uml/diagram/clazz/edit/parts/InterfaceAttributeCompartmentEditPartCN.java plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/src/org/eclipse/papyrus/uml/diagram/clazz/edit/parts/InterfaceNestedClassifierCompartmentEditPart.java plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/src/org/eclipse/papyrus/uml/diagram/clazz/edit/parts/InterfaceNestedClassifierCompartmentEditPartCN.java plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/src/org/eclipse/papyrus/uml/diagram/clazz/edit/parts/InterfaceOperationCompartmentEditPart.java plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/src/org/eclipse/papyrus/uml/diagram/clazz/edit/parts/InterfaceOperationCompartmentEditPartCN.java plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/src/org/eclipse/papyrus/uml/diagram/clazz/edit/parts/ModelEditPart.java plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/src/org/eclipse/papyrus/uml/diagram/clazz/edit/parts/ModelPackageableElementCompartmentEditPartCN.java plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/src/org/eclipse/papyrus/uml/diagram/clazz/edit/parts/ModelPackageableElementCompartmentEditPartTN.java plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/src/org/eclipse/papyrus/uml/diagram/clazz/edit/parts/PackagePackageableElementCompartmentEditPart.java plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/src/org/eclipse/papyrus/uml/diagram/clazz/edit/parts/PackagePackageableElementCompartmentEditPartCN.java plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/src/org/eclipse/papyrus/uml/diagram/clazz/edit/parts/PrimitiveTypeAttributeCompartmentEditPart.java plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/src/org/eclipse/papyrus/uml/diagram/clazz/edit/parts/PrimitiveTypeAttributeCompartmentEditPartCN.java plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/src/org/eclipse/papyrus/uml/diagram/clazz/edit/parts/PrimitiveTypeOperationCompartmentEditPart.java plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/src/org/eclipse/papyrus/uml/diagram/clazz/edit/parts/PrimitiveTypeOperationCompartmentEditPartCN.java plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/src/org/eclipse/papyrus/uml/diagram/clazz/edit/parts/RealizationEditPart.java plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/src/org/eclipse/papyrus/uml/diagram/clazz/edit/parts/RedefinableTemplateSignatureTemplateParameterCompartmentEditPart.java plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/src/org/eclipse/papyrus/uml/diagram/clazz/edit/parts/SignalAttributeCompartmentEditPart.java plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/src/org/eclipse/papyrus/uml/diagram/clazz/edit/parts/SignalAttributeCompartmentEditPartCN.java plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/src/org/eclipse/papyrus/uml/diagram/clazz/edit/parts/TemplateSignatureTemplateParameterCompartmentEditPart.java plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/src/org/eclipse/papyrus/uml/diagram/clazz/providers/UMLParserProvider.java plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.usecase/src/org/eclipse/papyrus/uml/diagram/usecase/edit/parts/ComponentUsecases2EditPart.java plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.usecase/src/org/eclipse/papyrus/uml/diagram/usecase/edit/parts/ComponentUsecases3EditPart.java plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.usecase/src/org/eclipse/papyrus/uml/diagram/usecase/edit/parts/PackagePackageableElementCompartment2EditPart.java plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.usecase/src/org/eclipse/papyrus/uml/diagram/usecase/edit/parts/PackagePackageableElementCompartmentEditPart.java plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.usecase/src/org/eclipse/papyrus/uml/diagram/usecase/edit/parts/SubjectComponentUsecasesEditPart.java plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.usecase/src/org/eclipse/papyrus/uml/diagram/usecase/edit/parts/UseCaseDiagramEditPart.java plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.usecase/src/org/eclipse/papyrus/uml/diagram/usecase/edit/parts/UseCasePointsEditPartTN.java plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.usecase/src/org/eclipse/papyrus/uml/diagram/usecase/edit/parts/UseCasePointsInComponentEditPart.java plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.usecase/src/org/eclipse/papyrus/uml/diagram/usecase/edit/parts/UseCasePointsInPackageEditPart.java plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.usecase/src/org/eclipse/papyrus/uml/diagram/usecase/edit/parts/UseCasePointsInRectangleEditPart.java releng/top-pom-main.xml
Diffstat (limited to 'plugins/developer/org.eclipse.papyrus.def')
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/pom.xml42
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend-gen/.gitignore2
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/diagram/editparts/.gitignore8
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/diagram/editparts/ChildNodeLabelEditPart.java108
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/diagram/editparts/CompartmentEditPart.java232
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/diagram/editparts/DiagramEditPart.java34
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/diagram/editparts/ExternalNodeLabelEditPart.java203
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/diagram/editparts/LinkEditPart.java34
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/diagram/editparts/LinkLabelEditPart.java137
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/diagram/editparts/NodeEditPart.java235
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/diagram/editparts/NodeLabelEditPart.java143
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/impl/diagram/editparts/.gitignore10
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/impl/diagram/editparts/ChildNodeLabelEditPart.java64
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/impl/diagram/editparts/ChoiceUtils_qvto.java49
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/impl/diagram/editparts/CompartmentEditPart.java86
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/impl/diagram/editparts/DiagramEditPart.java225
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/impl/diagram/editparts/ExternalNodeLabelEditPart.java28
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/impl/diagram/editparts/LinkEditPart.java271
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/impl/diagram/editparts/LinkLabelEditPart.java63
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/impl/diagram/editparts/NodeEditPart.java1021
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/impl/diagram/editparts/NodeLabelEditPart.java69
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/impl/diagram/editparts/TextAware.java2054
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/impl/diagram/update/.gitignore1
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/impl/diagram/update/CanonicalUpdate.java476
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/impl/parsers/.gitignore1
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/impl/parsers/ParserProvider.java296
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/impl/preferences/.gitignore1
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/impl/preferences/StandardPage.java146
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/metamodel/.gitignore2
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/metamodel/Facility.java96
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/metamodel/MetaModel.java32
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/.gitignore3
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/CodeStyle.java16
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/Common.java44
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/QualifiedClassNameProvider.java55
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/diagram/commands/.gitignore3
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/diagram/commands/CreateLinkUtils.java218
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/diagram/commands/CreateNodeCommand.java491
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/diagram/commands/ReorientLinkUtils.java153
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/diagram/edithelpers/.gitignore1
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/diagram/edithelpers/EditHelper.java69
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/diagram/editparts/.gitignore2
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/diagram/editparts/Common.java72
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/diagram/editparts/EditPartFactory.java162
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/diagram/editpolicies/.gitignore11
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/diagram/editpolicies/BaseItemSemanticEditPolicy.java1161
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/diagram/editpolicies/CompartmentItemSemanticEditPolicy.java328
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/diagram/editpolicies/DiagramItemSemanticEditPolicy.java20
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/diagram/editpolicies/LinkItemSemanticEditPolicy.java133
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/diagram/editpolicies/NodeItemSemanticEditPolicy.java594
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/diagram/editpolicies/OpenDiagram.java188
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/diagram/editpolicies/TextNonResizableEditPolicy.java46
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/diagram/editpolicies/TextSelectionEditPolicy.java93
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/diagram/editpolicies/Utils_qvto.java44
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/diagram/editpolicies/childContainerCreateCommand.java154
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/diagram/editpolicies/linkCommands.java482
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/diagram/preferences/.gitignore2
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/diagram/preferences/PreferenceInitializer.java32
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/diagram/preferences/extensions.java201
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/diagram/updater/.gitignore2
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/diagram/updater/DiagramUpdater.java1082
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/diagram/updater/Extensions.java25
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/diagram/views/.gitignore1
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/diagram/views/ViewStyles.java82
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/editor/.gitignore14
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/editor/ActionBarContributor.java108
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/editor/CreationWizard.java595
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/editor/DeleteElementAction.java21
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/editor/DiagramEditorContextMenuProvider.java159
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/editor/DiagramEditorUtil.java300
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/editor/DocumentProvider.java1036
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/editor/Editor.java1321
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/editor/InitDiagramFileAction.java230
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/editor/NewDiagramFileWizard.java681
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/editor/ResourceSetInfo.java147
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/editor/ResourceSetModificationListener.java153
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/editor/ValidateAction.java568
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/editor/VisualIDRegistry.java534
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/editor/extensions.java90
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/editor/palette/.gitignore2
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/editor/palette/PaletteFactory.java290
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/editor/palette/Utils_qvto.java121
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/expressions/.gitignore1
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/expressions/AbstractExpression.java167
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/navigator/.gitignore7
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/navigator/AbstractNavigatorItem.java142
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/navigator/DomainNavigatorContentProvider.java82
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/navigator/DomainNavigatorItem.java141
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/navigator/NavigatorContentProvider.java1020
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/navigator/NavigatorGroup.java67
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/navigator/NavigatorItem.java117
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/navigator/NavigatorLinkHelper.java82
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/plugin/.gitignore3
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/plugin/ActivatorImpl.java477
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/plugin/manifest.java244
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/plugin/plugin.java624
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/providers/.gitignore7
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/providers/ElementInitializers.java376
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/providers/ElementTypes.java148
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/providers/MarkerNavigationProvider.java254
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/providers/ValidationDecoratorProvider.java192
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/providers/ValidationProvider.java288
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/providers/ViewProvider.java2191
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/providers/extensions.java576
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend-gen/utils/.gitignore5
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend-gen/utils/EditHelperUtils_qvto.java35
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend-gen/utils/EditPartsUtils_qvto.java92
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend-gen/utils/NodeConstraintUtils_qvto.java120
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend-gen/utils/PrefsConstant_qvto.java119
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend-gen/utils/UtilsItemSemanticEditPolicy.java104
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend/aspects/diagram/editparts/LinkLabelEditPart.xtend19
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend/aspects/impl/diagram/editparts/CompartmentEditPart.xtend2
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend/aspects/impl/diagram/editparts/DiagramEditPart.xtend24
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend/aspects/impl/diagram/editparts/LinkLabelEditPart.xtend8
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend/aspects/impl/diagram/editparts/NodeEditPart.xtend35
115 files changed, 109 insertions, 26169 deletions
diff --git a/plugins/developer/org.eclipse.papyrus.def/pom.xml b/plugins/developer/org.eclipse.papyrus.def/pom.xml
index c3b832b0428..90f2ad1e6c5 100644
--- a/plugins/developer/org.eclipse.papyrus.def/pom.xml
+++ b/plugins/developer/org.eclipse.papyrus.def/pom.xml
@@ -11,4 +11,46 @@
<groupId>org.eclipse.papyrus</groupId>
<version>1.1.0-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-clean-plugin</artifactId>
+ <configuration>
+ <filesets>
+ <fileset>
+ <directory>xtend-gen</directory>
+ <includes>
+ <include>**/*</include>
+ </includes>
+ <excludes>
+ <exclude>.gitignore</exclude>
+ </excludes>
+ </fileset>
+ </filesets>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.eclipse.xtend</groupId>
+ <artifactId>xtend-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <phase>generate-sources</phase>
+ <goals>
+ <goal>compile</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <outputDirectory>xtend-gen</outputDirectory>
+ <testOutputDirectory>${project.build.directory}/xtend-gen/test</testOutputDirectory>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
</project> \ No newline at end of file
diff --git a/plugins/developer/org.eclipse.papyrus.def/xtend-gen/.gitignore b/plugins/developer/org.eclipse.papyrus.def/xtend-gen/.gitignore
new file mode 100644
index 00000000000..c96a04f008e
--- /dev/null
+++ b/plugins/developer/org.eclipse.papyrus.def/xtend-gen/.gitignore
@@ -0,0 +1,2 @@
+*
+!.gitignore \ No newline at end of file
diff --git a/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/diagram/editparts/.gitignore b/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/diagram/editparts/.gitignore
deleted file mode 100644
index 1a2600974d6..00000000000
--- a/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/diagram/editparts/.gitignore
+++ /dev/null
@@ -1,8 +0,0 @@
-/ChildNodeLabelEditPart.java
-/CompartmentEditPart.java
-/DiagramEditPart.java
-/ExternalNodeLabelEditPart.java
-/LinkEditPart.java
-/LinkLabelEditPart.java
-/NodeEditPart.java
-/NodeLabelEditPart.java
diff --git a/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/diagram/editparts/ChildNodeLabelEditPart.java b/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/diagram/editparts/ChildNodeLabelEditPart.java
deleted file mode 100644
index a1f87ee247a..00000000000
--- a/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/diagram/editparts/ChildNodeLabelEditPart.java
+++ /dev/null
@@ -1,108 +0,0 @@
-/**
- * Copyright (c) 2006, 2009, 2013 Borland Software Corporation and others
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Dmitry Stadnik (Borland) - initial API and implementation
- * Alexander Shatalin (Borland) - initial API and implementation
- * Michael Golubev (Montages) - #386838 - migrate to Xtend2
- */
-package aspects.diagram.editparts;
-
-import com.google.common.base.Objects;
-import com.google.common.collect.Iterators;
-import com.google.inject.Singleton;
-import java.util.Iterator;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.common.util.TreeIterator;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.gmf.codegen.gmfgen.GenChildLabelNode;
-import org.eclipse.gmf.codegen.gmfgen.GenCommonBase;
-import org.eclipse.papyrus.papyrusgmfgenextension.ExtendedGenView;
-import org.eclipse.xtend2.lib.StringConcatenation;
-import org.eclipse.xtext.xbase.lib.Functions.Function1;
-import org.eclipse.xtext.xbase.lib.IteratorExtensions;
-
-@Singleton
-@SuppressWarnings("all")
-public class ChildNodeLabelEditPart extends diagram.editparts.ChildNodeLabelEditPart {
- public CharSequence extendsList(final GenChildLabelNode it) {
- StringConcatenation _builder = new StringConcatenation();
- {
- Resource _eResource = it.eResource();
- TreeIterator<EObject> _allContents = _eResource.getAllContents();
- Iterator<ExtendedGenView> _filter = Iterators.<ExtendedGenView>filter(_allContents, ExtendedGenView.class);
- final Function1<ExtendedGenView, Boolean> _function = new Function1<ExtendedGenView, Boolean>() {
- public Boolean apply(final ExtendedGenView v) {
- boolean _and = false;
- EList<GenCommonBase> _genView = v.getGenView();
- boolean _contains = _genView.contains(it);
- if (!_contains) {
- _and = false;
- } else {
- String _superOwnedEditPart = v.getSuperOwnedEditPart();
- boolean _notEquals = (!Objects.equal(_superOwnedEditPart, null));
- _and = _notEquals;
- }
- return Boolean.valueOf(_and);
- }
- };
- Iterator<ExtendedGenView> _filter_1 = IteratorExtensions.<ExtendedGenView>filter(_filter, _function);
- int _size = IteratorExtensions.size(_filter_1);
- boolean _notEquals = (_size != 0);
- if (_notEquals) {
- _builder.append("extends ");
- {
- Resource _eResource_1 = it.eResource();
- TreeIterator<EObject> _allContents_1 = _eResource_1.getAllContents();
- Iterator<ExtendedGenView> _filter_2 = Iterators.<ExtendedGenView>filter(_allContents_1, ExtendedGenView.class);
- final Function1<ExtendedGenView, Boolean> _function_1 = new Function1<ExtendedGenView, Boolean>() {
- public Boolean apply(final ExtendedGenView v) {
- boolean _and = false;
- EList<GenCommonBase> _genView = v.getGenView();
- boolean _contains = _genView.contains(it);
- if (!_contains) {
- _and = false;
- } else {
- String _superOwnedEditPart = v.getSuperOwnedEditPart();
- boolean _notEquals = (!Objects.equal(_superOwnedEditPart, null));
- _and = _notEquals;
- }
- return Boolean.valueOf(_and);
- }
- };
- Iterator<ExtendedGenView> _filter_3 = IteratorExtensions.<ExtendedGenView>filter(_filter_2, _function_1);
- Iterable<ExtendedGenView> _iterable = IteratorExtensions.<ExtendedGenView>toIterable(_filter_3);
- for(final ExtendedGenView extendedObject : _iterable) {
- _builder.newLineIfNotEmpty();
- CharSequence _specifyInheritance = this.specifyInheritance(((ExtendedGenView) extendedObject));
- _builder.append(_specifyInheritance, "");
- _builder.newLineIfNotEmpty();
- }
- }
- } else {
- _builder.append("extends org.eclipse.gmf.runtime.diagram.ui.editparts.CompartmentEditPart");
- _builder.newLine();
- }
- }
- return _builder;
- }
-
- public CharSequence specifyInheritance(final ExtendedGenView it) {
- StringConcatenation _builder = new StringConcatenation();
- String _superOwnedEditPart = it.getSuperOwnedEditPart();
- _builder.append(_superOwnedEditPart, "");
- return _builder;
- }
-
- public CharSequence implementsList(final GenChildLabelNode it) {
- StringConcatenation _builder = new StringConcatenation();
- _builder.append("implements org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart, org.eclipse.gmf.runtime.diagram.ui.editparts.IPrimaryEditPart, org.eclipse.papyrus.infra.gmfdiag.common.editpart.IControlParserForDirectEdit");
- return _builder;
- }
-}
diff --git a/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/diagram/editparts/CompartmentEditPart.java b/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/diagram/editparts/CompartmentEditPart.java
deleted file mode 100644
index 1647d4c44cf..00000000000
--- a/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/diagram/editparts/CompartmentEditPart.java
+++ /dev/null
@@ -1,232 +0,0 @@
-/**
- * Copyright (c) 2006, 2009, 2013 Borland Software Corporation and others
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Dmitry Stadnik (Borland) - initial API and implementation
- * Alexander Shatalin (Borland) - initial API and implementation
- * Michael Golubev (Montages) - #386838 - migrate to Xtend2
- */
-package aspects.diagram.editparts;
-
-import com.google.common.base.Objects;
-import com.google.common.collect.Iterators;
-import com.google.inject.Inject;
-import com.google.inject.Singleton;
-import java.util.Iterator;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.common.util.TreeIterator;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.gmf.codegen.gmfgen.GenCommonBase;
-import org.eclipse.gmf.codegen.gmfgen.GenCompartment;
-import org.eclipse.papyrus.papyrusgmfgenextension.ExtendedGenView;
-import org.eclipse.xtend2.lib.StringConcatenation;
-import org.eclipse.xtext.xbase.lib.Extension;
-import org.eclipse.xtext.xbase.lib.Functions.Function1;
-import org.eclipse.xtext.xbase.lib.IteratorExtensions;
-import xpt.Common;
-
-@Singleton
-@SuppressWarnings("all")
-public class CompartmentEditPart extends diagram.editparts.CompartmentEditPart {
- @Inject
- @Extension
- private Common _common;
-
- public CharSequence extendsList(final GenCompartment it) {
- StringConcatenation _builder = new StringConcatenation();
- _builder.newLine();
- {
- Resource _eResource = it.eResource();
- TreeIterator<EObject> _allContents = _eResource.getAllContents();
- Iterator<ExtendedGenView> _filter = Iterators.<ExtendedGenView>filter(_allContents, ExtendedGenView.class);
- final Function1<ExtendedGenView, Boolean> _function = new Function1<ExtendedGenView, Boolean>() {
- public Boolean apply(final ExtendedGenView v) {
- boolean _and = false;
- EList<GenCommonBase> _genView = v.getGenView();
- boolean _contains = _genView.contains(it);
- if (!_contains) {
- _and = false;
- } else {
- String _superOwnedEditPart = v.getSuperOwnedEditPart();
- boolean _notEquals = (!Objects.equal(_superOwnedEditPart, null));
- _and = _notEquals;
- }
- return Boolean.valueOf(_and);
- }
- };
- Iterator<ExtendedGenView> _filter_1 = IteratorExtensions.<ExtendedGenView>filter(_filter, _function);
- int _size = IteratorExtensions.size(_filter_1);
- boolean _notEquals = (_size != 0);
- if (_notEquals) {
- _builder.append("extends ");
- {
- Resource _eResource_1 = it.eResource();
- TreeIterator<EObject> _allContents_1 = _eResource_1.getAllContents();
- Iterator<ExtendedGenView> _filter_2 = Iterators.<ExtendedGenView>filter(_allContents_1, ExtendedGenView.class);
- final Function1<ExtendedGenView, Boolean> _function_1 = new Function1<ExtendedGenView, Boolean>() {
- public Boolean apply(final ExtendedGenView v) {
- boolean _and = false;
- EList<GenCommonBase> _genView = v.getGenView();
- boolean _contains = _genView.contains(it);
- if (!_contains) {
- _and = false;
- } else {
- String _superOwnedEditPart = v.getSuperOwnedEditPart();
- boolean _notEquals = (!Objects.equal(_superOwnedEditPart, null));
- _and = _notEquals;
- }
- return Boolean.valueOf(_and);
- }
- };
- Iterator<ExtendedGenView> _filter_3 = IteratorExtensions.<ExtendedGenView>filter(_filter_2, _function_1);
- Iterable<ExtendedGenView> _iterable = IteratorExtensions.<ExtendedGenView>toIterable(_filter_3);
- for(final ExtendedGenView extendedObject : _iterable) {
- _builder.newLineIfNotEmpty();
- CharSequence _specifyInheritance = this.specifyInheritance(((ExtendedGenView) extendedObject));
- _builder.append(_specifyInheritance, "");
- _builder.newLineIfNotEmpty();
- }
- }
- } else {
- _builder.append("extends ");
- {
- boolean _isListLayout = it.isListLayout();
- if (_isListLayout) {
- _builder.append("org.eclipse.gmf.runtime.diagram.ui.editparts.ListCompartmentEditPart");
- } else {
- _builder.append("org.eclipse.gmf.runtime.diagram.ui.editparts.ShapeCompartmentEditPart");
- }
- }
- _builder.newLineIfNotEmpty();
- }
- }
- return _builder;
- }
-
- public CharSequence specifyInheritance(final ExtendedGenView it) {
- StringConcatenation _builder = new StringConcatenation();
- String _superOwnedEditPart = it.getSuperOwnedEditPart();
- _builder.append(_superOwnedEditPart, "");
- return _builder;
- }
-
- public CharSequence additions(final GenCompartment it) {
- StringConcatenation _builder = new StringConcatenation();
- CharSequence _handleSize = this.handleSize(it);
- _builder.append(_handleSize, "");
- _builder.newLineIfNotEmpty();
- CharSequence _refreshbound = this.refreshbound(it);
- _builder.append(_refreshbound, "");
- _builder.newLineIfNotEmpty();
- CharSequence _refreshvisual = this.refreshvisual(it);
- _builder.append(_refreshvisual, "");
- _builder.newLineIfNotEmpty();
- return _builder;
- }
-
- public CharSequence handleSize(final GenCompartment it) {
- StringConcatenation _builder = new StringConcatenation();
- _builder.append("\t");
- CharSequence _generatedMemberComment = this._common.generatedMemberComment();
- _builder.append(_generatedMemberComment, "\t");
- _builder.newLineIfNotEmpty();
- _builder.append("protected void handleNotificationEvent(org.eclipse.emf.common.notify.Notification notification) {");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("Object feature = notification.getFeature();");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("if (org.eclipse.gmf.runtime.notation.NotationPackage.eINSTANCE.getSize_Width().equals(feature)");
- _builder.newLine();
- _builder.append("\t\t\t");
- _builder.append("|| org.eclipse.gmf.runtime.notation.NotationPackage.eINSTANCE.getSize_Height().equals(feature)");
- _builder.newLine();
- _builder.append("\t\t\t");
- _builder.append("|| org.eclipse.gmf.runtime.notation.NotationPackage.eINSTANCE.getLocation_X().equals(feature)");
- _builder.newLine();
- _builder.append("\t\t\t");
- _builder.append("|| org.eclipse.gmf.runtime.notation.NotationPackage.eINSTANCE.getLocation_Y().equals(feature)) {");
- _builder.newLine();
- _builder.append("\t\t\t");
- _builder.append("refreshBounds();");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("super.handleNotificationEvent(notification);");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("} ");
- _builder.newLine();
- return _builder;
- }
-
- public CharSequence refreshbound(final GenCompartment it) {
- StringConcatenation _builder = new StringConcatenation();
- CharSequence _generatedMemberComment = this._common.generatedMemberComment();
- _builder.append(_generatedMemberComment, "");
- _builder.newLineIfNotEmpty();
- _builder.append("protected void refreshBounds() {");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("int width = ((Integer) getStructuralFeatureValue(org.eclipse.gmf.runtime.notation.NotationPackage.eINSTANCE.getSize_Width())).intValue();");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("int height = ((Integer) getStructuralFeatureValue(org.eclipse.gmf.runtime.notation.NotationPackage.eINSTANCE.getSize_Height())).intValue();");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("org.eclipse.draw2d.geometry.Dimension size = new org.eclipse.draw2d.geometry.Dimension(width, height);");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("int x = ((Integer) getStructuralFeatureValue(org.eclipse.gmf.runtime.notation.NotationPackage.eINSTANCE.getLocation_X())).intValue();");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("int y = ((Integer) getStructuralFeatureValue(org.eclipse.gmf.runtime.notation.NotationPackage.eINSTANCE.getLocation_Y())).intValue();");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("org.eclipse.draw2d.geometry.Point loc = new org.eclipse.draw2d.geometry.Point(x, y);");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("((org.eclipse.gef.GraphicalEditPart) getParent()).setLayoutConstraint(");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("this,");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("getFigure(),");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("new org.eclipse.draw2d.geometry.Rectangle(loc, size));");
- _builder.newLine();
- _builder.append("}");
- _builder.newLine();
- return _builder;
- }
-
- public CharSequence refreshvisual(final GenCompartment it) {
- StringConcatenation _builder = new StringConcatenation();
- _builder.append("\t");
- CharSequence _generatedMemberComment = this._common.generatedMemberComment();
- _builder.append(_generatedMemberComment, "\t");
- _builder.newLineIfNotEmpty();
- _builder.append("protected void refreshVisuals() {");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("super.refreshVisuals();");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("refreshBounds();");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- return _builder;
- }
-}
diff --git a/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/diagram/editparts/DiagramEditPart.java b/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/diagram/editparts/DiagramEditPart.java
deleted file mode 100644
index fc207965c13..00000000000
--- a/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/diagram/editparts/DiagramEditPart.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/**
- * Copyright (c) 2006, 2010, 2013 Borland Software Corporation and others
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Dmitry Stadnik (Borland) - initial API and implementation
- * Alexander Shatalin (Borland) - initial API and implementation
- * Michael Golubev (Montages) - #386838 - migrate to Xtend2
- */
-package aspects.diagram.editparts;
-
-import com.google.inject.Inject;
-import com.google.inject.Singleton;
-import org.eclipse.gmf.codegen.gmfgen.GenDiagram;
-import org.eclipse.xtend2.lib.StringConcatenation;
-
-@Singleton
-@SuppressWarnings("all")
-public class DiagramEditPart extends diagram.editparts.DiagramEditPart {
- @Inject
- private aspects.impl.diagram.editparts.DiagramEditPart aspectDiagramEditPart;
-
- public CharSequence extendsList(final GenDiagram it) {
- StringConcatenation _builder = new StringConcatenation();
- _builder.append("extends ");
- CharSequence _extendsListContents = this.aspectDiagramEditPart.extendsListContents(it);
- _builder.append(_extendsListContents, "");
- return _builder;
- }
-}
diff --git a/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/diagram/editparts/ExternalNodeLabelEditPart.java b/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/diagram/editparts/ExternalNodeLabelEditPart.java
deleted file mode 100644
index 7f5d5a96831..00000000000
--- a/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/diagram/editparts/ExternalNodeLabelEditPart.java
+++ /dev/null
@@ -1,203 +0,0 @@
-/**
- * Copyright (c) 2006, 2009, 2013 Borland Software Corporation and others
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Dmitry Stadnik (Borland) - initial API and implementation
- * Alexander Shatalin (Borland) - initial API and implementation
- * Michael Golubev (Montages) - #386838 - migrate to Xtend2
- */
-package aspects.diagram.editparts;
-
-import com.google.common.base.Objects;
-import com.google.common.collect.Iterators;
-import com.google.inject.Inject;
-import com.google.inject.Singleton;
-import java.util.Iterator;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.common.util.TreeIterator;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.gmf.codegen.gmfgen.GenCommonBase;
-import org.eclipse.gmf.codegen.gmfgen.GenExternalNodeLabel;
-import org.eclipse.papyrus.papyrusgmfgenextension.ExtendedGenView;
-import org.eclipse.papyrus.papyrusgmfgenextension.LabelVisibilityPreference;
-import org.eclipse.xtend2.lib.StringConcatenation;
-import org.eclipse.xtext.xbase.lib.Extension;
-import org.eclipse.xtext.xbase.lib.Functions.Function1;
-import org.eclipse.xtext.xbase.lib.IteratorExtensions;
-import xpt.Common;
-
-@Singleton
-@SuppressWarnings("all")
-public class ExternalNodeLabelEditPart extends diagram.editparts.ExternalNodeLabelEditPart {
- @Inject
- @Extension
- private Common _common;
-
- public CharSequence extendsList(final GenExternalNodeLabel it) {
- StringConcatenation _builder = new StringConcatenation();
- {
- Resource _eResource = it.eResource();
- TreeIterator<EObject> _allContents = _eResource.getAllContents();
- Iterator<ExtendedGenView> _filter = Iterators.<ExtendedGenView>filter(_allContents, ExtendedGenView.class);
- final Function1<ExtendedGenView, Boolean> _function = new Function1<ExtendedGenView, Boolean>() {
- public Boolean apply(final ExtendedGenView v) {
- boolean _and = false;
- EList<GenCommonBase> _genView = v.getGenView();
- boolean _contains = _genView.contains(it);
- if (!_contains) {
- _and = false;
- } else {
- String _superOwnedEditPart = v.getSuperOwnedEditPart();
- boolean _notEquals = (!Objects.equal(_superOwnedEditPart, null));
- _and = _notEquals;
- }
- return Boolean.valueOf(_and);
- }
- };
- Iterator<ExtendedGenView> _filter_1 = IteratorExtensions.<ExtendedGenView>filter(_filter, _function);
- int _size = IteratorExtensions.size(_filter_1);
- boolean _notEquals = (_size != 0);
- if (_notEquals) {
- _builder.append("extends ");
- {
- Resource _eResource_1 = it.eResource();
- TreeIterator<EObject> _allContents_1 = _eResource_1.getAllContents();
- Iterator<ExtendedGenView> _filter_2 = Iterators.<ExtendedGenView>filter(_allContents_1, ExtendedGenView.class);
- final Function1<ExtendedGenView, Boolean> _function_1 = new Function1<ExtendedGenView, Boolean>() {
- public Boolean apply(final ExtendedGenView v) {
- boolean _and = false;
- EList<GenCommonBase> _genView = v.getGenView();
- boolean _contains = _genView.contains(it);
- if (!_contains) {
- _and = false;
- } else {
- String _superOwnedEditPart = v.getSuperOwnedEditPart();
- boolean _notEquals = (!Objects.equal(_superOwnedEditPart, null));
- _and = _notEquals;
- }
- return Boolean.valueOf(_and);
- }
- };
- Iterator<ExtendedGenView> _filter_3 = IteratorExtensions.<ExtendedGenView>filter(_filter_2, _function_1);
- Iterable<ExtendedGenView> _iterable = IteratorExtensions.<ExtendedGenView>toIterable(_filter_3);
- for(final ExtendedGenView extendedObject : _iterable) {
- _builder.newLineIfNotEmpty();
- CharSequence _specifyInheritance = this.specifyInheritance(((ExtendedGenView) extendedObject));
- _builder.append(_specifyInheritance, "");
- _builder.newLineIfNotEmpty();
- }
- }
- } else {
- _builder.append("extends org.eclipse.papyrus.infra.gmfdiag.common.editpart.PapyrusLabelEditPart");
- _builder.newLine();
- }
- }
- return _builder;
- }
-
- public CharSequence implementsList(final GenExternalNodeLabel it) {
- StringConcatenation _builder = new StringConcatenation();
- _builder.append("implements org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart, org.eclipse.gmf.runtime.diagram.ui.editparts.IBorderItemEditPart");
- _builder.newLine();
- {
- Resource _eResource = it.eResource();
- TreeIterator<EObject> _allContents = _eResource.getAllContents();
- Iterator<LabelVisibilityPreference> _filter = Iterators.<LabelVisibilityPreference>filter(_allContents, LabelVisibilityPreference.class);
- final Function1<LabelVisibilityPreference, Boolean> _function = new Function1<LabelVisibilityPreference, Boolean>() {
- public Boolean apply(final LabelVisibilityPreference v) {
- EList<GenExternalNodeLabel> _externalNodeLabels = v.getExternalNodeLabels();
- return Boolean.valueOf(_externalNodeLabels.contains(it));
- }
- };
- Iterator<LabelVisibilityPreference> _filter_1 = IteratorExtensions.<LabelVisibilityPreference>filter(_filter, _function);
- int _size = IteratorExtensions.size(_filter_1);
- boolean _notEquals = (_size != 0);
- if (_notEquals) {
- _builder.append(", org.eclipse.papyrus.uml.diagram.common.editparts.ILabelRoleProvider");
- _builder.newLine();
- }
- }
- return _builder;
- }
-
- public CharSequence additions(final GenExternalNodeLabel it) {
- StringConcatenation _builder = new StringConcatenation();
- {
- Resource _eResource = it.eResource();
- TreeIterator<EObject> _allContents = _eResource.getAllContents();
- Iterator<LabelVisibilityPreference> _filter = Iterators.<LabelVisibilityPreference>filter(_allContents, LabelVisibilityPreference.class);
- final Function1<LabelVisibilityPreference, Boolean> _function = new Function1<LabelVisibilityPreference, Boolean>() {
- public Boolean apply(final LabelVisibilityPreference v) {
- EList<GenExternalNodeLabel> _externalNodeLabels = v.getExternalNodeLabels();
- return Boolean.valueOf(_externalNodeLabels.contains(it));
- }
- };
- Iterator<LabelVisibilityPreference> _filter_1 = IteratorExtensions.<LabelVisibilityPreference>filter(_filter, _function);
- int _size = IteratorExtensions.size(_filter_1);
- boolean _notEquals = (_size != 0);
- if (_notEquals) {
- CharSequence _generatedClassComment = this._common.generatedClassComment();
- _builder.append(_generatedClassComment, "");
- _builder.newLineIfNotEmpty();
- _builder.append("public String getLabelRole(){");
- _builder.newLine();
- _builder.append("return \"");
- Resource _eResource_1 = it.eResource();
- TreeIterator<EObject> _allContents_1 = _eResource_1.getAllContents();
- Iterator<LabelVisibilityPreference> _filter_2 = Iterators.<LabelVisibilityPreference>filter(_allContents_1, LabelVisibilityPreference.class);
- final Function1<LabelVisibilityPreference, Boolean> _function_1 = new Function1<LabelVisibilityPreference, Boolean>() {
- public Boolean apply(final LabelVisibilityPreference v) {
- EList<GenExternalNodeLabel> _externalNodeLabels = v.getExternalNodeLabels();
- return Boolean.valueOf(_externalNodeLabels.contains(it));
- }
- };
- Iterator<LabelVisibilityPreference> _filter_3 = IteratorExtensions.<LabelVisibilityPreference>filter(_filter_2, _function_1);
- LabelVisibilityPreference _head = IteratorExtensions.<LabelVisibilityPreference>head(_filter_3);
- String _role = _head.getRole();
- _builder.append(_role, "");
- _builder.append("\";//$NON-NLS-1$");
- _builder.newLineIfNotEmpty();
- _builder.append("}");
- _builder.newLine();
- _builder.newLine();
- CharSequence _generatedClassComment_1 = this._common.generatedClassComment();
- _builder.append(_generatedClassComment_1, "");
- _builder.newLineIfNotEmpty();
- _builder.append("public String getIconPathRole(){");
- _builder.newLine();
- _builder.append("return \"");
- Resource _eResource_2 = it.eResource();
- TreeIterator<EObject> _allContents_2 = _eResource_2.getAllContents();
- Iterator<LabelVisibilityPreference> _filter_4 = Iterators.<LabelVisibilityPreference>filter(_allContents_2, LabelVisibilityPreference.class);
- final Function1<LabelVisibilityPreference, Boolean> _function_2 = new Function1<LabelVisibilityPreference, Boolean>() {
- public Boolean apply(final LabelVisibilityPreference v) {
- EList<GenExternalNodeLabel> _externalNodeLabels = v.getExternalNodeLabels();
- return Boolean.valueOf(_externalNodeLabels.contains(it));
- }
- };
- Iterator<LabelVisibilityPreference> _filter_5 = IteratorExtensions.<LabelVisibilityPreference>filter(_filter_4, _function_2);
- LabelVisibilityPreference _head_1 = IteratorExtensions.<LabelVisibilityPreference>head(_filter_5);
- String _iconPathRole = _head_1.getIconPathRole();
- _builder.append(_iconPathRole, "");
- _builder.append("\";//$NON-NLS-1$");
- _builder.newLineIfNotEmpty();
- _builder.append("}");
- _builder.newLine();
- }
- }
- return _builder;
- }
-
- public CharSequence specifyInheritance(final ExtendedGenView it) {
- StringConcatenation _builder = new StringConcatenation();
- String _superOwnedEditPart = it.getSuperOwnedEditPart();
- _builder.append(_superOwnedEditPart, "");
- return _builder;
- }
-}
diff --git a/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/diagram/editparts/LinkEditPart.java b/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/diagram/editparts/LinkEditPart.java
deleted file mode 100644
index e477faf65c2..00000000000
--- a/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/diagram/editparts/LinkEditPart.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/**
- * Copyright (c) 2006, 2009, 2013 Borland Software Corporation and others
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Dmitry Stadnik (Borland) - initial API and implementation
- * Alexander Shatalin (Borland) - initial API and implementation
- * Michael Golubev (Montages) - #386838 - migrate to Xtend2
- */
-package aspects.diagram.editparts;
-
-import com.google.inject.Inject;
-import com.google.inject.Singleton;
-import org.eclipse.gmf.codegen.gmfgen.GenLink;
-import org.eclipse.xtend2.lib.StringConcatenation;
-
-@Singleton
-@SuppressWarnings("all")
-public class LinkEditPart extends diagram.editparts.LinkEditPart {
- @Inject
- private aspects.impl.diagram.editparts.LinkEditPart aspectsLinkEditPart;
-
- public CharSequence extendsList(final GenLink it) {
- StringConcatenation _builder = new StringConcatenation();
- _builder.append("extends ");
- CharSequence _extendsListContents = this.aspectsLinkEditPart.extendsListContents(it);
- _builder.append(_extendsListContents, "");
- return _builder;
- }
-}
diff --git a/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/diagram/editparts/LinkLabelEditPart.java b/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/diagram/editparts/LinkLabelEditPart.java
deleted file mode 100644
index 44cdc74c4d9..00000000000
--- a/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/diagram/editparts/LinkLabelEditPart.java
+++ /dev/null
@@ -1,137 +0,0 @@
-/**
- * Copyright (c) 2006, 2009, 2013 Borland Software Corporation and others
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Dmitry Stadnik (Borland) - initial API and implementation
- * Alexander Shatalin (Borland) - initial API and implementation
- * Michael Golubev (Montages) - #386838 - migrate to Xtend2
- */
-package aspects.diagram.editparts;
-
-import com.google.common.collect.Iterators;
-import com.google.inject.Inject;
-import com.google.inject.Singleton;
-import java.util.Iterator;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.common.util.TreeIterator;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.gmf.codegen.gmfgen.GenLinkLabel;
-import org.eclipse.papyrus.papyrusgmfgenextension.LabelVisibilityPreference;
-import org.eclipse.xtend2.lib.StringConcatenation;
-import org.eclipse.xtext.xbase.lib.Extension;
-import org.eclipse.xtext.xbase.lib.Functions.Function1;
-import org.eclipse.xtext.xbase.lib.IteratorExtensions;
-import xpt.Common;
-
-@Singleton
-@SuppressWarnings("all")
-public class LinkLabelEditPart extends diagram.editparts.LinkLabelEditPart {
- @Inject
- @Extension
- private Common _common;
-
- public CharSequence implementsList(final GenLinkLabel it) {
- StringConcatenation _builder = new StringConcatenation();
- _builder.append("implements org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart, org.eclipse.papyrus.infra.gmfdiag.common.editpart.IControlParserForDirectEdit");
- _builder.newLine();
- {
- Resource _eResource = it.eResource();
- TreeIterator<EObject> _allContents = _eResource.getAllContents();
- Iterator<LabelVisibilityPreference> _filter = Iterators.<LabelVisibilityPreference>filter(_allContents, LabelVisibilityPreference.class);
- final Function1<LabelVisibilityPreference, Boolean> _function = new Function1<LabelVisibilityPreference, Boolean>() {
- public Boolean apply(final LabelVisibilityPreference v) {
- EList<GenLinkLabel> _linkLabels = v.getLinkLabels();
- return Boolean.valueOf(_linkLabels.contains(it));
- }
- };
- Iterator<LabelVisibilityPreference> _filter_1 = IteratorExtensions.<LabelVisibilityPreference>filter(_filter, _function);
- int _size = IteratorExtensions.size(_filter_1);
- boolean _notEquals = (_size != 0);
- if (_notEquals) {
- _builder.append(", org.eclipse.papyrus.uml.diagram.common.editparts.ILabelRoleProvider");
- _builder.newLine();
- }
- }
- return _builder;
- }
-
- public CharSequence additions(final GenLinkLabel it) {
- StringConcatenation _builder = new StringConcatenation();
- {
- Resource _eResource = it.eResource();
- TreeIterator<EObject> _allContents = _eResource.getAllContents();
- Iterator<LabelVisibilityPreference> _filter = Iterators.<LabelVisibilityPreference>filter(_allContents, LabelVisibilityPreference.class);
- final Function1<LabelVisibilityPreference, Boolean> _function = new Function1<LabelVisibilityPreference, Boolean>() {
- public Boolean apply(final LabelVisibilityPreference v) {
- EList<GenLinkLabel> _linkLabels = v.getLinkLabels();
- return Boolean.valueOf(_linkLabels.contains(it));
- }
- };
- Iterator<LabelVisibilityPreference> _filter_1 = IteratorExtensions.<LabelVisibilityPreference>filter(_filter, _function);
- int _size = IteratorExtensions.size(_filter_1);
- boolean _notEquals = (_size != 0);
- if (_notEquals) {
- CharSequence _generatedClassComment = this._common.generatedClassComment();
- _builder.append(_generatedClassComment, "");
- _builder.newLineIfNotEmpty();
- _builder.append("public String getLabelRole(){");
- _builder.newLine();
- _builder.append("return \"");
- Resource _eResource_1 = it.eResource();
- TreeIterator<EObject> _allContents_1 = _eResource_1.getAllContents();
- Iterator<LabelVisibilityPreference> _filter_2 = Iterators.<LabelVisibilityPreference>filter(_allContents_1, LabelVisibilityPreference.class);
- final Function1<LabelVisibilityPreference, Boolean> _function_1 = new Function1<LabelVisibilityPreference, Boolean>() {
- public Boolean apply(final LabelVisibilityPreference v) {
- EList<GenLinkLabel> _linkLabels = v.getLinkLabels();
- return Boolean.valueOf(_linkLabels.contains(it));
- }
- };
- Iterator<LabelVisibilityPreference> _filter_3 = IteratorExtensions.<LabelVisibilityPreference>filter(_filter_2, _function_1);
- LabelVisibilityPreference _head = IteratorExtensions.<LabelVisibilityPreference>head(_filter_3);
- String _role = _head.getRole();
- _builder.append(_role, "");
- _builder.append("\";//$NON-NLS-1$");
- _builder.newLineIfNotEmpty();
- _builder.append("}");
- _builder.newLine();
- _builder.newLine();
- CharSequence _generatedClassComment_1 = this._common.generatedClassComment();
- _builder.append(_generatedClassComment_1, "");
- _builder.newLineIfNotEmpty();
- _builder.append("public String getIconPathRole(){");
- _builder.newLine();
- _builder.append("return \"");
- Resource _eResource_2 = it.eResource();
- TreeIterator<EObject> _allContents_2 = _eResource_2.getAllContents();
- Iterator<LabelVisibilityPreference> _filter_4 = Iterators.<LabelVisibilityPreference>filter(_allContents_2, LabelVisibilityPreference.class);
- final Function1<LabelVisibilityPreference, Boolean> _function_2 = new Function1<LabelVisibilityPreference, Boolean>() {
- public Boolean apply(final LabelVisibilityPreference v) {
- EList<GenLinkLabel> _linkLabels = v.getLinkLabels();
- return Boolean.valueOf(_linkLabels.contains(it));
- }
- };
- Iterator<LabelVisibilityPreference> _filter_5 = IteratorExtensions.<LabelVisibilityPreference>filter(_filter_4, _function_2);
- LabelVisibilityPreference _head_1 = IteratorExtensions.<LabelVisibilityPreference>head(_filter_5);
- String _iconPathRole = _head_1.getIconPathRole();
- _builder.append(_iconPathRole, "");
- _builder.append("\";//$NON-NLS-1$");
- _builder.newLineIfNotEmpty();
- _builder.append("}");
- _builder.newLine();
- }
- }
- return _builder;
- }
-
- public CharSequence extendsList(final GenLinkLabel it) {
- StringConcatenation _builder = new StringConcatenation();
- _builder.append("extends org.eclipse.papyrus.infra.gmfdiag.common.editpart.PapyrusLabelEditPart");
- return _builder;
- }
-}
diff --git a/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/diagram/editparts/NodeEditPart.java b/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/diagram/editparts/NodeEditPart.java
deleted file mode 100644
index 9b9ea94aedb..00000000000
--- a/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/diagram/editparts/NodeEditPart.java
+++ /dev/null
@@ -1,235 +0,0 @@
-/**
- * Copyright (c) 2006, 2009, 2013 Borland Software Corporation and others
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Dmitry Stadnik (Borland) - initial API and implementation
- * Alexander Shatalin (Borland) - initial API and implementation
- * Michael Golubev (Montages) - #386838 - migrate to Xtend2
- */
-package aspects.diagram.editparts;
-
-import com.google.inject.Inject;
-import com.google.inject.Singleton;
-import org.eclipse.gmf.codegen.gmfgen.GenDiagram;
-import org.eclipse.gmf.codegen.gmfgen.GenEditorGenerator;
-import org.eclipse.gmf.codegen.gmfgen.GenNode;
-import org.eclipse.gmf.codegen.gmfgen.Viewmap;
-import org.eclipse.xtend2.lib.StringConcatenation;
-import org.eclipse.xtext.xbase.lib.Extension;
-import xpt.Common;
-import xpt.diagram.editparts.Utils_qvto;
-
-@Singleton
-@SuppressWarnings("all")
-public class NodeEditPart extends diagram.editparts.NodeEditPart {
- @Inject
- @Extension
- private Common _common;
-
- @Inject
- @Extension
- private Utils_qvto _utils_qvto;
-
- @Inject
- private impl.diagram.editparts.NodeEditPart xptNodeEditPartImpl;
-
- @Inject
- private aspects.impl.diagram.editparts.NodeEditPart aspectsNodeEditPartImpl;
-
- public CharSequence Main(final GenNode it) {
- StringConcatenation _builder = new StringConcatenation();
- GenDiagram _diagram = it.getDiagram();
- GenEditorGenerator _editorGen = _diagram.getEditorGen();
- CharSequence _copyright = this._common.copyright(_editorGen);
- _builder.append(_copyright, "");
- _builder.newLineIfNotEmpty();
- _builder.append("package ");
- CharSequence _packageName = this.xptNodeEditPartImpl.packageName(it);
- _builder.append(_packageName, "");
- _builder.append(";");
- _builder.newLineIfNotEmpty();
- _builder.newLine();
- CharSequence _generatedClassComment = this._common.generatedClassComment();
- _builder.append(_generatedClassComment, "");
- _builder.newLineIfNotEmpty();
- _builder.append("public class ");
- CharSequence _className = this.xptNodeEditPartImpl.className(it);
- _builder.append(_className, "");
- _builder.append(" ");
- CharSequence _extendsList = this.extendsList(it);
- _builder.append(_extendsList, "");
- _builder.append(" ");
- CharSequence _implementsList = this.implementsList(it);
- _builder.append(_implementsList, "");
- _builder.append(" {");
- _builder.newLineIfNotEmpty();
- _builder.newLine();
- _builder.append("\t");
- CharSequence _attributes = this.attributes(it);
- _builder.append(_attributes, "\t");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.newLine();
- _builder.append("\t");
- CharSequence _constructor = this.xptNodeEditPartImpl.constructor(it);
- _builder.append(_constructor, "\t");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.newLine();
- _builder.append("\t");
- CharSequence _createDefaultEditPolicies = this.createDefaultEditPolicies(it);
- _builder.append(_createDefaultEditPolicies, "\t");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.newLine();
- _builder.append("\t");
- CharSequence _createLayoutEditPolicy = this.xptNodeEditPartImpl.createLayoutEditPolicy(it);
- _builder.append(_createLayoutEditPolicy, "\t");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.newLine();
- CharSequence _specificHandleNotificationEvent = this.aspectsNodeEditPartImpl.specificHandleNotificationEvent(it);
- _builder.append(_specificHandleNotificationEvent, "");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.newLine();
- _builder.append("\t");
- Viewmap _viewmap = it.getViewmap();
- CharSequence _createNodeShape = this.xptNodeEditPartImpl.createNodeShape(_viewmap, it);
- _builder.append(_createNodeShape, "\t");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.newLine();
- {
- boolean _hasFixedChildren = this._utils_qvto.hasFixedChildren(it);
- if (_hasFixedChildren) {
- _builder.append("\t");
- CharSequence _addFixedChild = this.xptNodeEditPartImpl.addFixedChild(it);
- _builder.append(_addFixedChild, "\t");
- _builder.newLineIfNotEmpty();
- _builder.newLine();
- _builder.append("\t");
- CharSequence _removeFixedChild = this.xptNodeEditPartImpl.removeFixedChild(it);
- _builder.append(_removeFixedChild, "\t");
- _builder.newLineIfNotEmpty();
- _builder.newLine();
- _builder.append("\t");
- CharSequence _addChildVisual = this.xptNodeEditPartImpl.addChildVisual(it);
- _builder.append(_addChildVisual, "\t");
- _builder.newLineIfNotEmpty();
- _builder.newLine();
- _builder.append("\t");
- CharSequence _removeChildVisual = this.xptNodeEditPartImpl.removeChildVisual(it);
- _builder.append(_removeChildVisual, "\t");
- _builder.newLineIfNotEmpty();
- _builder.newLine();
- _builder.append("\t");
- CharSequence _contentPaneFor = this.xptNodeEditPartImpl.getContentPaneFor(it);
- _builder.append(_contentPaneFor, "\t");
- _builder.newLineIfNotEmpty();
- }
- }
- _builder.newLine();
- _builder.append("\t");
- CharSequence _addBorderItem = this.xptNodeEditPartImpl.addBorderItem(it);
- _builder.append(_addBorderItem, "\t");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.newLine();
- _builder.append("\t");
- CharSequence _createNodePlate = this.xptNodeEditPartImpl.createNodePlate(it);
- _builder.append(_createNodePlate, "\t");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.newLine();
- _builder.append("\t");
- CharSequence _primaryDragEditPolicy = this.xptNodeEditPartImpl.getPrimaryDragEditPolicy(it);
- _builder.append(_primaryDragEditPolicy, "\t");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.newLine();
- _builder.append("\t");
- CharSequence _createFigure = this.xptNodeEditPartImpl.createFigure(it);
- _builder.append(_createFigure, "\t");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.newLine();
- _builder.append("\t");
- CharSequence _setupContentPane = this.xptNodeEditPartImpl.setupContentPane(it);
- _builder.append(_setupContentPane, "\t");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.newLine();
- _builder.append("\t");
- CharSequence _contentPane = this.xptNodeEditPartImpl.getContentPane(it);
- _builder.append(_contentPane, "\t");
- _builder.newLineIfNotEmpty();
- _builder.newLine();
- _builder.append("\t");
- CharSequence _setForegroundColor = this.xptNodeEditPartImpl.setForegroundColor(it);
- _builder.append(_setForegroundColor, "\t");
- _builder.newLineIfNotEmpty();
- _builder.newLine();
- _builder.newLine();
- _builder.append("\t");
- CharSequence _setLineWidth = this.xptNodeEditPartImpl.setLineWidth(it);
- _builder.append(_setLineWidth, "\t");
- _builder.newLineIfNotEmpty();
- _builder.newLine();
- _builder.append("\t");
- CharSequence _setLineStyle = this.xptNodeEditPartImpl.setLineStyle(it);
- _builder.append(_setLineStyle, "\t");
- _builder.newLineIfNotEmpty();
- _builder.newLine();
- _builder.append("\t");
- CharSequence _primaryChildEditPart = this.xptNodeEditPartImpl.getPrimaryChildEditPart(it);
- _builder.append(_primaryChildEditPart, "\t");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.newLine();
- _builder.newLine();
- _builder.newLine();
- {
- boolean _hasChildrenInListCompartments = this._utils_qvto.hasChildrenInListCompartments(it);
- if (_hasChildrenInListCompartments) {
- CharSequence _targetEditPartMethod = this.xptNodeEditPartImpl.getTargetEditPartMethod(it);
- _builder.append(_targetEditPartMethod, "");
- _builder.newLineIfNotEmpty();
- }
- }
- _builder.newLine();
- _builder.append("\t");
- CharSequence _handleNotificationEvent = this.handleNotificationEvent(it);
- _builder.append(_handleNotificationEvent, "\t");
- _builder.newLineIfNotEmpty();
- _builder.newLine();
- _builder.append("\t");
- Viewmap _viewmap_1 = it.getViewmap();
- CharSequence _innerClassDeclaration = this.xptNodeEditPartImpl.innerClassDeclaration(_viewmap_1);
- _builder.append(_innerClassDeclaration, "\t");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.newLine();
- _builder.append("\t");
- CharSequence _additions = this.additions(it);
- _builder.append(_additions, "\t");
- _builder.newLineIfNotEmpty();
- _builder.append("}");
- _builder.newLine();
- return _builder;
- }
-
- public CharSequence extendsList(final GenNode it) {
- StringConcatenation _builder = new StringConcatenation();
- _builder.append(" ");
- _builder.append("extends ");
- CharSequence _extendsListContents = this.aspectsNodeEditPartImpl.extendsListContents(it);
- _builder.append(_extendsListContents, " ");
- return _builder;
- }
-}
diff --git a/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/diagram/editparts/NodeLabelEditPart.java b/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/diagram/editparts/NodeLabelEditPart.java
deleted file mode 100644
index e82f69e6fe2..00000000000
--- a/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/diagram/editparts/NodeLabelEditPart.java
+++ /dev/null
@@ -1,143 +0,0 @@
-/**
- * Copyright (c) 2006, 2009, 2013 Borland Software Corporation and others
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Dmitry Stadnik (Borland) - initial API and implementation
- * Alexander Shatalin (Borland) - initial API and implementation
- * Michael Golubev (Montages) - #386838 - migrate to Xtend2
- */
-package aspects.diagram.editparts;
-
-import com.google.inject.Inject;
-import com.google.inject.Singleton;
-import org.eclipse.gmf.codegen.gmfgen.GenNodeLabel;
-import org.eclipse.xtend2.lib.StringConcatenation;
-import org.eclipse.xtext.xbase.lib.Extension;
-import xpt.Common;
-
-@Singleton
-@SuppressWarnings("all")
-public class NodeLabelEditPart extends diagram.editparts.NodeLabelEditPart {
- @Inject
- @Extension
- private Common _common;
-
- @Inject
- private impl.diagram.editparts.NodeLabelEditPart xptNodeLabelEditPart;
-
- public CharSequence implementsList(final GenNodeLabel it) {
- StringConcatenation _builder = new StringConcatenation();
- _builder.append("implements org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart, org.eclipse.papyrus.infra.gmfdiag.common.editpart.IControlParserForDirectEdit");
- return _builder;
- }
-
- public CharSequence extendsList(final GenNodeLabel it) {
- StringConcatenation _builder = new StringConcatenation();
- _builder.append("extends org.eclipse.papyrus.infra.gmfdiag.common.editpart.PapyrusCompartmentEditPart");
- return _builder;
- }
-
- public CharSequence handleNotificationEvent(final GenNodeLabel it) {
- StringConcatenation _builder = new StringConcatenation();
- CharSequence _generatedMemberComment = this._common.generatedMemberComment();
- _builder.append(_generatedMemberComment, "");
- _builder.newLineIfNotEmpty();
- _builder.append("protected void handleNotificationEvent(org.eclipse.emf.common.notify.Notification event) {");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("refreshLabel();");
- _builder.newLine();
- _builder.append("\t");
- CharSequence _handleNotificationEventBody = this.xptNodeLabelEditPart.handleNotificationEventBody(it);
- _builder.append(_handleNotificationEventBody, "\t");
- _builder.newLineIfNotEmpty();
- _builder.append("}");
- _builder.newLine();
- return _builder;
- }
-
- public CharSequence additions(final GenNodeLabel it) {
- StringConcatenation _builder = new StringConcatenation();
- _builder.append("\t");
- _builder.newLine();
- CharSequence _generatedMemberComment = this._common.generatedMemberComment();
- _builder.append(_generatedMemberComment, "");
- _builder.newLineIfNotEmpty();
- _builder.append("private static final String ADD_PARENT_MODEL = \"AddParentModel\";");
- _builder.newLine();
- _builder.newLine();
- _builder.append("\t");
- _builder.newLine();
- CharSequence _generatedMemberComment_1 = this._common.generatedMemberComment();
- _builder.append(_generatedMemberComment_1, "");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.append("public void activate() {");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("super.activate();");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("addOwnerElementListeners();");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- _builder.newLine();
- _builder.append("\t");
- CharSequence _generatedMemberComment_2 = this._common.generatedMemberComment();
- _builder.append(_generatedMemberComment_2, "\t");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.append("protected void addOwnerElementListeners() {");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("addListenerFilter(ADD_PARENT_MODEL, this, ((org.eclipse.gmf.runtime.notation.View) getParent().getModel()));");
- _builder.newLine();
- _builder.newLine();
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- _builder.newLine();
- _builder.append("\t");
- CharSequence _generatedMemberComment_3 = this._common.generatedMemberComment();
- _builder.append(_generatedMemberComment_3, "\t");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.append("public void deactivate() {");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("removeOwnerElementListeners();");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("super.deactivate();");
- _builder.newLine();
- _builder.newLine();
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- _builder.newLine();
- _builder.newLine();
- _builder.append("\t");
- CharSequence _generatedMemberComment_4 = this._common.generatedMemberComment();
- _builder.append(_generatedMemberComment_4, "\t");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.append("protected void removeOwnerElementListeners() {");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("removeListenerFilter(ADD_PARENT_MODEL);");
- _builder.newLine();
- _builder.newLine();
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- _builder.newLine();
- return _builder;
- }
-}
diff --git a/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/impl/diagram/editparts/.gitignore b/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/impl/diagram/editparts/.gitignore
deleted file mode 100644
index c5f67666460..00000000000
--- a/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/impl/diagram/editparts/.gitignore
+++ /dev/null
@@ -1,10 +0,0 @@
-/ExternalNodeLabelEditPart.java
-/ChildNodeLabelEditPart.java
-/ChoiceUtils_qvto.java
-/CompartmentEditPart.java
-/DiagramEditPart.java
-/LinkEditPart.java
-/LinkLabelEditPart.java
-/NodeEditPart.java
-/NodeLabelEditPart.java
-/TextAware.java
diff --git a/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/impl/diagram/editparts/ChildNodeLabelEditPart.java b/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/impl/diagram/editparts/ChildNodeLabelEditPart.java
deleted file mode 100644
index 1cd170c4b6a..00000000000
--- a/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/impl/diagram/editparts/ChildNodeLabelEditPart.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/**
- * Copyright (c) 2006, 2009, 2013 Borland Software Corporation and others
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Dmitry Stadnik (Borland) - initial API and implementation
- * Alexander Shatalin (Borland) - initial API and implementation
- * Michael Golubev (Montages) - #386838 - migrate to Xtend2
- */
-package aspects.impl.diagram.editparts;
-
-import com.google.inject.Inject;
-import com.google.inject.Singleton;
-import org.eclipse.gmf.codegen.gmfgen.GenChildLabelNode;
-import org.eclipse.xtend2.lib.StringConcatenation;
-import org.eclipse.xtext.xbase.lib.Extension;
-import xpt.diagram.editparts.Common;
-
-/**
- * Revisit: [MG]: @Inject extension same-named-api-class -> template extends api-class?
- */
-@Singleton
-@SuppressWarnings("all")
-public class ChildNodeLabelEditPart extends impl.diagram.editparts.ChildNodeLabelEditPart {
- @Inject
- @Extension
- private Common _common;
-
- public CharSequence handleNotificationEventBody(final GenChildLabelNode it) {
- StringConcatenation _builder = new StringConcatenation();
- _builder.append("\t\t");
- _builder.append("Object feature = event.getFeature();");
- _builder.newLine();
- CharSequence _handleText = this._common.handleText(it);
- _builder.append(_handleText, "");
- _builder.newLineIfNotEmpty();
- {
- boolean _isLabelElementIcon = it.isLabelElementIcon();
- if (_isLabelElementIcon) {
- _builder.append("if(event.getNewValue() instanceof org.eclipse.emf.ecore.EAnnotation && org.eclipse.papyrus.infra.emf.appearance.helper.VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((org.eclipse.emf.ecore.EAnnotation)event.getNewValue()).getSource())){\t");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("refreshLabel();");
- _builder.newLine();
- _builder.append("}");
- _builder.newLine();
- }
- }
- _builder.append("if (org.eclipse.uml2.uml.UMLPackage.eINSTANCE.getFeature_IsStatic().equals(feature)) {");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("refreshUnderline();");
- _builder.newLine();
- _builder.append("}");
- _builder.newLine();
- _builder.append("super.handleNotificationEvent(event);");
- _builder.newLine();
- return _builder;
- }
-}
diff --git a/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/impl/diagram/editparts/ChoiceUtils_qvto.java b/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/impl/diagram/editparts/ChoiceUtils_qvto.java
deleted file mode 100644
index d06df4f7b09..00000000000
--- a/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/impl/diagram/editparts/ChoiceUtils_qvto.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/**
- * Copyright (c) 2011 - 2013 Montages AG
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Svyatoslav Kovalsky (Montages) - initial API and implementation
- * Michael Golubev (Montages) - #386838 - migrate to Xtend2
- */
-package aspects.impl.diagram.editparts;
-
-import com.google.common.base.Objects;
-import com.google.inject.Inject;
-import com.google.inject.Singleton;
-import org.eclipse.gmf.codegen.gmfgen.GenParserImplementation;
-import org.eclipse.gmf.codegen.gmfgen.LabelModelFacet;
-import org.eclipse.gmf.codegen.gmfgen.OclChoiceParser;
-import org.eclipse.gmf.codegen.gmfgen.PredefinedEnumParser;
-import org.eclipse.xtext.xbase.lib.Extension;
-import xpt.Common_qvto;
-
-@Singleton
-@SuppressWarnings("all")
-public class ChoiceUtils_qvto extends impl.diagram.editparts.ChoiceUtils_qvto {
- @Inject
- @Extension
- private Common_qvto _common_qvto;
-
- public boolean isChoiceLabel(final LabelModelFacet modelFacet) {
- GenParserImplementation parser = modelFacet.getParser();
- boolean _notEquals = (!Objects.equal(parser, null));
- if (_notEquals) {
- boolean _or = false;
- boolean _oclIsKindOf = this._common_qvto.oclIsKindOf(parser, PredefinedEnumParser.class);
- if (_oclIsKindOf) {
- _or = true;
- } else {
- boolean _oclIsKindOf_1 = this._common_qvto.oclIsKindOf(parser, OclChoiceParser.class);
- _or = _oclIsKindOf_1;
- }
- return _or;
- } else {
- return false;
- }
- }
-}
diff --git a/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/impl/diagram/editparts/CompartmentEditPart.java b/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/impl/diagram/editparts/CompartmentEditPart.java
deleted file mode 100644
index 5a37181bdf2..00000000000
--- a/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/impl/diagram/editparts/CompartmentEditPart.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/**
- * Copyright (c) 2006, 2009 Borland Software Corporation
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Dmitry Stadnik (Borland) - initial API and implementation
- * Alexander Shatalin (Borland) - initial API and implementation
- * Michael Golubev (Montages) - #386838 - migrate to Xtend2
- */
-package aspects.impl.diagram.editparts;
-
-import com.google.inject.Inject;
-import com.google.inject.Singleton;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.gmf.codegen.gmfgen.GenChildNode;
-import org.eclipse.gmf.codegen.gmfgen.GenCompartment;
-import org.eclipse.xtend2.lib.StringConcatenation;
-import org.eclipse.xtext.xbase.lib.Extension;
-import xpt.Common;
-
-@Singleton
-@SuppressWarnings("all")
-public class CompartmentEditPart extends impl.diagram.editparts.CompartmentEditPart {
- @Inject
- @Extension
- private Common _common;
-
- @Inject
- private xpt.diagram.editparts.Common xptEditpartsCommon;
-
- public CharSequence createDefaultEditPoliciesBody(final GenCompartment it) {
- StringConcatenation _builder = new StringConcatenation();
- _builder.append("super.createDefaultEditPolicies();");
- _builder.newLine();
- {
- boolean _isCanCollapse = it.isCanCollapse();
- if (_isCanCollapse) {
- _builder.append("installEditPolicy(org.eclipse.gef.EditPolicy.PRIMARY_DRAG_ROLE, new org.eclipse.gmf.runtime.diagram.ui.editpolicies.ResizableCompartmentEditPolicy());");
- _builder.newLine();
- }
- }
- CharSequence _installSemanticEditPolicy = this.xptEditpartsCommon.installSemanticEditPolicy(it);
- _builder.append(_installSemanticEditPolicy, "");
- _builder.newLineIfNotEmpty();
- {
- EList<GenChildNode> _childNodes = it.getChildNodes();
- boolean _isEmpty = _childNodes.isEmpty();
- boolean _not = (!_isEmpty);
- if (_not) {
- _builder.append("installEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CREATION_ROLE, new org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.DefaultCreationEditPolicy());");
- _builder.newLine();
- _builder.append("installEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.DRAG_DROP_ROLE, new org.eclipse.gmf.runtime.diagram.ui.editpolicies.DragDropEditPolicy());");
- _builder.newLine();
- _builder.append("installEditPolicy(org.eclipse.papyrus.uml.diagram.common.editpolicies.DuplicatePasteEditPolicy.PASTE_ROLE, new org.eclipse.papyrus.uml.diagram.common.editpolicies.DuplicatePasteEditPolicy());");
- _builder.newLine();
- }
- }
- CharSequence _installCanonicalEditPolicy = this.xptEditpartsCommon.installCanonicalEditPolicy(it);
- _builder.append(_installCanonicalEditPolicy, "");
- _builder.newLineIfNotEmpty();
- CharSequence _behaviour = this.xptEditpartsCommon.behaviour(it);
- _builder.append(_behaviour, "");
- _builder.newLineIfNotEmpty();
- return _builder;
- }
-
- public CharSequence getTargetEditPartMethod(final GenCompartment it) {
- StringConcatenation _builder = new StringConcatenation();
- CharSequence _generatedMemberComment = this._common.generatedMemberComment();
- _builder.append(_generatedMemberComment, "");
- _builder.newLineIfNotEmpty();
- _builder.append("public org.eclipse.gef.EditPart getTargetEditPart(org.eclipse.gef.Request request) {");
- _builder.newLine();
- _builder.newLine();
- _builder.append("\t");
- _builder.append("return super.getTargetEditPart(request);");
- _builder.newLine();
- _builder.append("}");
- _builder.newLine();
- return _builder;
- }
-}
diff --git a/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/impl/diagram/editparts/DiagramEditPart.java b/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/impl/diagram/editparts/DiagramEditPart.java
deleted file mode 100644
index 94726f3e76f..00000000000
--- a/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/impl/diagram/editparts/DiagramEditPart.java
+++ /dev/null
@@ -1,225 +0,0 @@
-/**
- * Copyright (c) 2006, 2010, 2013 Borland Software Corporation and others
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Dmitry Stadnik (Borland) - initial API and implementation
- * Alexander Shatalin (Borland) - initial API and implementation
- * Michael Golubev (Montages) - #386838 - migrate to Xtend2
- */
-package aspects.impl.diagram.editparts;
-
-import com.google.common.base.Objects;
-import com.google.inject.Inject;
-import com.google.inject.Singleton;
-import metamodel.MetaModel;
-import org.eclipse.emf.codegen.ecore.genmodel.GenClass;
-import org.eclipse.emf.codegen.ecore.genmodel.GenFeature;
-import org.eclipse.gmf.codegen.gmfgen.GenApplication;
-import org.eclipse.gmf.codegen.gmfgen.GenDiagram;
-import org.eclipse.gmf.codegen.gmfgen.GenEditorGenerator;
-import org.eclipse.gmf.codegen.gmfgen.GenNode;
-import org.eclipse.gmf.codegen.gmfgen.TypeModelFacet;
-import org.eclipse.xtend2.lib.StringConcatenation;
-import org.eclipse.xtext.xbase.lib.Extension;
-import xpt.diagram.commands.CreateShortcutDecorationsCommand;
-import xpt.diagram.editparts.Common;
-import xpt.diagram.editparts.Utils_qvto;
-
-/**
- * Revisit: [MG]: @Inject extension same-named-api-class -> template extends api-class?
- */
-@Singleton
-@SuppressWarnings("all")
-public class DiagramEditPart extends impl.diagram.editparts.DiagramEditPart {
- @Inject
- @Extension
- private MetaModel _metaModel;
-
- @Inject
- @Extension
- private Utils_qvto _utils_qvto;
-
- @Inject
- private Common xptEditpartsCommon;
-
- @Inject
- private CreateShortcutDecorationsCommand createShoutrtcutDecorationCommand;
-
- public CharSequence extendsListContents(final GenDiagram it) {
- StringConcatenation _builder = new StringConcatenation();
- _builder.append("org.eclipse.papyrus.infra.gmfdiag.common.editpart.PapyrusDiagramEditPart");
- _builder.newLine();
- return _builder;
- }
-
- public CharSequence createDefaultEditPoliciesBody(final GenDiagram it) {
- StringConcatenation _builder = new StringConcatenation();
- _builder.append("super.createDefaultEditPolicies();");
- _builder.newLine();
- _builder.newLine();
- _builder.append("installEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CREATION_ROLE, new org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.DefaultCreationEditPolicy());");
- _builder.newLine();
- _builder.append("installEditPolicy(org.eclipse.papyrus.uml.diagram.common.editpolicies.DuplicatePasteEditPolicy.PASTE_ROLE, new org.eclipse.papyrus.uml.diagram.common.editpolicies.DuplicatePasteEditPolicy());");
- _builder.newLine();
- _builder.newLine();
- CharSequence _installSemanticEditPolicy = this.xptEditpartsCommon.installSemanticEditPolicy(it);
- _builder.append(_installSemanticEditPolicy, "");
- _builder.newLineIfNotEmpty();
- CharSequence _installCanonicalEditPolicy = this.xptEditpartsCommon.installCanonicalEditPolicy(it);
- _builder.append(_installCanonicalEditPolicy, "");
- _builder.newLineIfNotEmpty();
- {
- boolean _and = false;
- boolean _generateCreateShortcutAction = it.generateCreateShortcutAction();
- if (!_generateCreateShortcutAction) {
- _and = false;
- } else {
- GenEditorGenerator _editorGen = it.getEditorGen();
- GenApplication _application = _editorGen.getApplication();
- boolean _equals = Objects.equal(null, _application);
- _and = _equals;
- }
- if (_and) {
- _builder.append("installEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.DRAG_DROP_ROLE, new org.eclipse.gmf.runtime.diagram.ui.editpolicies.DiagramDragDropEditPolicy() {");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("public org.eclipse.gef.commands.Command getDropObjectsCommand(org.eclipse.gmf.runtime.diagram.ui.requests.DropObjectsRequest dropRequest) {");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("java.util.List<org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequest.ViewDescriptor> viewDescriptors = new java.util.ArrayList<org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequest.ViewDescriptor>();");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("for (java.util.Iterator<?> it = dropRequest.getObjects().iterator(); it.hasNext();) {");
- _builder.newLine();
- _builder.append("\t\t\t");
- _builder.append("Object nextObject = it.next();");
- _builder.newLine();
- _builder.append("\t\t\t");
- _builder.append("if (false == nextObject instanceof org.eclipse.emf.ecore.EObject) {");
- _builder.newLine();
- _builder.append("\t\t\t\t");
- _builder.append("continue;");
- _builder.newLine();
- _builder.append("\t\t\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t\t\t");
- _builder.append("viewDescriptors.add(new org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequest.ViewDescriptor(new org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter((org.eclipse.emf.ecore.EObject) nextObject), org.eclipse.gmf.runtime.notation.Node.class, null, getDiagramPreferencesHint()));");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("return createShortcutsCommand(dropRequest, viewDescriptors);");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- _builder.newLine();
- _builder.append("\t");
- _builder.append("private org.eclipse.gef.commands.Command createShortcutsCommand(org.eclipse.gmf.runtime.diagram.ui.requests.DropObjectsRequest dropRequest, java.util.List<org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequest.ViewDescriptor> viewDescriptors) {");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("org.eclipse.gef.commands.Command command = createViewsAndArrangeCommand(dropRequest, viewDescriptors);");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("if (command != null) {");
- _builder.newLine();
- _builder.append("\t\t\t");
- _builder.append("return command.chain(new org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy(new ");
- CharSequence _qualifiedClassName = this.createShoutrtcutDecorationCommand.qualifiedClassName(it);
- _builder.append(_qualifiedClassName, "\t\t\t");
- _builder.append("(getEditingDomain(), (org.eclipse.gmf.runtime.notation.View) getModel(), viewDescriptors)));");
- _builder.newLineIfNotEmpty();
- _builder.append("\t\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("return null;");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("});");
- _builder.newLine();
- }
- }
- {
- boolean _shouldGenerateDiagramViewmap = this._utils_qvto.shouldGenerateDiagramViewmap(it);
- if (_shouldGenerateDiagramViewmap) {
- _builder.append("// diagram figure does layout; need to install child editpolicy to show selection feedback");
- _builder.newLine();
- _builder.append("installEditPolicy(org.eclipse.gef.EditPolicy.LAYOUT_ROLE, new org.eclipse.gmf.runtime.diagram.ui.editpolicies.LayoutEditPolicy() {");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("protected org.eclipse.gef.EditPolicy createChildEditPolicy(org.eclipse.gef.EditPart child) {");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("final org.eclipse.gef.editpolicies.NonResizableEditPolicy p = new org.eclipse.gef.editpolicies.NonResizableEditPolicy();");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("p.setDragAllowed(false);");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("return p;");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("protected org.eclipse.gef.commands.Command getMoveChildrenCommand(org.eclipse.gef.Request request) {");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("return null;");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("protected org.eclipse.gef.commands.Command getCreateCommand(org.eclipse.gef.requests.CreateRequest request) {");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("return null;");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("});");
- _builder.newLine();
- }
- }
- CharSequence _behaviour = this.xptEditpartsCommon.behaviour(it);
- _builder.append(_behaviour, "");
- _builder.newLineIfNotEmpty();
- _builder.append("// removeEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.POPUPBAR_ROLE);");
- _builder.newLine();
- return _builder;
- }
-
- public CharSequence featureForMetaclass(final GenNode it) {
- StringConcatenation _builder = new StringConcatenation();
- _builder.append("if (");
- TypeModelFacet _modelFacet = it.getModelFacet();
- GenClass _metaClass = _modelFacet.getMetaClass();
- CharSequence _MetaClass = this._metaModel.MetaClass(_metaClass);
- _builder.append(_MetaClass, "");
- _builder.append(".equals(class1)) {");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.append("return ");
- TypeModelFacet _modelFacet_1 = it.getModelFacet();
- GenFeature _containmentMetaFeature = _modelFacet_1.getContainmentMetaFeature();
- CharSequence _MetaFeature = this._metaModel.MetaFeature(_containmentMetaFeature);
- _builder.append(_MetaFeature, "\t");
- _builder.append(";");
- _builder.newLineIfNotEmpty();
- _builder.append("}");
- _builder.newLine();
- return _builder;
- }
-}
diff --git a/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/impl/diagram/editparts/ExternalNodeLabelEditPart.java b/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/impl/diagram/editparts/ExternalNodeLabelEditPart.java
deleted file mode 100644
index cd06d1d00a7..00000000000
--- a/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/impl/diagram/editparts/ExternalNodeLabelEditPart.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/**
- * Copyright (c) 2014 CEA LIST and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * CEA LIST - Initial API and implementation
- */
-package aspects.impl.diagram.editparts;
-
-import org.eclipse.gmf.codegen.gmfgen.GenExternalNodeLabel;
-import org.eclipse.xtend2.lib.StringConcatenation;
-
-/**
- * @author Mickael ADAM
- */
-@SuppressWarnings("all")
-public class ExternalNodeLabelEditPart extends impl.diagram.editparts.ExternalNodeLabelEditPart {
- public CharSequence additionalEditPolicies(final GenExternalNodeLabel it) {
- StringConcatenation _builder = new StringConcatenation();
- _builder.append("installEditPolicy(org.eclipse.gef.EditPolicy.PRIMARY_DRAG_ROLE, new org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.ExternalLabelPrimaryDragRoleEditPolicy());");
- _builder.newLine();
- return _builder;
- }
-}
diff --git a/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/impl/diagram/editparts/LinkEditPart.java b/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/impl/diagram/editparts/LinkEditPart.java
deleted file mode 100644
index 12463f983ed..00000000000
--- a/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/impl/diagram/editparts/LinkEditPart.java
+++ /dev/null
@@ -1,271 +0,0 @@
-/**
- * Copyright (c) 2006, 2010, 2013 Borland Software Corporation and others
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Dmitry Stadnik (Borland) - initial API and implementation
- * Alexander Shatalin (Borland) - initial API and implementation
- * Michael Golubev (Montages) - #386838 - migrate to Xtend2
- * Remi Schnekenburger (CEA LIST) - modification for Papyrus MDT
- */
-package aspects.impl.diagram.editparts;
-
-import com.google.common.base.Objects;
-import com.google.common.collect.Iterators;
-import com.google.inject.Inject;
-import com.google.inject.Singleton;
-import java.util.Arrays;
-import java.util.Iterator;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.common.util.TreeIterator;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.gmf.codegen.gmfgen.FigureViewmap;
-import org.eclipse.gmf.codegen.gmfgen.GenCommonBase;
-import org.eclipse.gmf.codegen.gmfgen.GenLink;
-import org.eclipse.gmf.codegen.gmfgen.GenLinkLabel;
-import org.eclipse.gmf.codegen.gmfgen.InnerClassViewmap;
-import org.eclipse.gmf.codegen.gmfgen.ModeledViewmap;
-import org.eclipse.gmf.codegen.gmfgen.SnippetViewmap;
-import org.eclipse.gmf.codegen.gmfgen.Viewmap;
-import org.eclipse.papyrus.papyrusgmfgenextension.ExtendedGenView;
-import org.eclipse.xtend2.lib.StringConcatenation;
-import org.eclipse.xtext.xbase.lib.Extension;
-import org.eclipse.xtext.xbase.lib.Functions.Function1;
-import org.eclipse.xtext.xbase.lib.IteratorExtensions;
-import xpt.Common;
-
-/**
- * Revisit: [MG]: @Inject extension same-named-api-class -> template extends api-class?
- */
-@Singleton
-@SuppressWarnings("all")
-public class LinkEditPart extends impl.diagram.editparts.LinkEditPart {
- @Inject
- @Extension
- private Common _common;
-
- public CharSequence extendsListContents(final GenLink it) {
- StringConcatenation _builder = new StringConcatenation();
- {
- Resource _eResource = it.eResource();
- TreeIterator<EObject> _allContents = _eResource.getAllContents();
- Iterator<ExtendedGenView> _filter = Iterators.<ExtendedGenView>filter(_allContents, ExtendedGenView.class);
- final Function1<ExtendedGenView, Boolean> _function = new Function1<ExtendedGenView, Boolean>() {
- public Boolean apply(final ExtendedGenView v) {
- boolean _and = false;
- EList<GenCommonBase> _genView = v.getGenView();
- boolean _contains = _genView.contains(it);
- if (!_contains) {
- _and = false;
- } else {
- String _superOwnedEditPart = v.getSuperOwnedEditPart();
- boolean _notEquals = (!Objects.equal(_superOwnedEditPart, null));
- _and = _notEquals;
- }
- return Boolean.valueOf(_and);
- }
- };
- Iterator<ExtendedGenView> _filter_1 = IteratorExtensions.<ExtendedGenView>filter(_filter, _function);
- int _size = IteratorExtensions.size(_filter_1);
- boolean _notEquals = (_size != 0);
- if (_notEquals) {
- {
- Resource _eResource_1 = it.eResource();
- TreeIterator<EObject> _allContents_1 = _eResource_1.getAllContents();
- Iterator<ExtendedGenView> _filter_2 = Iterators.<ExtendedGenView>filter(_allContents_1, ExtendedGenView.class);
- final Function1<ExtendedGenView, Boolean> _function_1 = new Function1<ExtendedGenView, Boolean>() {
- public Boolean apply(final ExtendedGenView v) {
- boolean _and = false;
- EList<GenCommonBase> _genView = v.getGenView();
- boolean _contains = _genView.contains(it);
- if (!_contains) {
- _and = false;
- } else {
- String _superOwnedEditPart = v.getSuperOwnedEditPart();
- boolean _notEquals = (!Objects.equal(_superOwnedEditPart, null));
- _and = _notEquals;
- }
- return Boolean.valueOf(_and);
- }
- };
- Iterator<ExtendedGenView> _filter_3 = IteratorExtensions.<ExtendedGenView>filter(_filter_2, _function_1);
- Iterable<ExtendedGenView> _iterable = IteratorExtensions.<ExtendedGenView>toIterable(_filter_3);
- for(final ExtendedGenView extendedObject : _iterable) {
- CharSequence _specifyInheritance = this.specifyInheritance(extendedObject);
- _builder.append(_specifyInheritance, "");
- _builder.newLineIfNotEmpty();
- }
- }
- } else {
- _builder.append("org.eclipse.papyrus.infra.gmfdiag.common.editpart.ConnectionEditPart");
- _builder.newLine();
- }
- }
- return _builder;
- }
-
- public CharSequence specifyInheritance(final ExtendedGenView it) {
- StringConcatenation _builder = new StringConcatenation();
- String _superOwnedEditPart = it.getSuperOwnedEditPart();
- _builder.append(_superOwnedEditPart, "");
- return _builder;
- }
-
- public CharSequence addFixedChild(final GenLink it) {
- StringConcatenation _builder = new StringConcatenation();
- {
- EList<GenLinkLabel> _labels = it.getLabels();
- int _size = _labels.size();
- boolean _greaterThan = (_size > 0);
- if (_greaterThan) {
- CharSequence _generatedMemberComment = this._common.generatedMemberComment();
- _builder.append(_generatedMemberComment, "");
- _builder.newLineIfNotEmpty();
- _builder.append("protected boolean addFixedChild(org.eclipse.gef.EditPart childEditPart) {");
- _builder.newLine();
- {
- EList<GenLinkLabel> _labels_1 = it.getLabels();
- for(final GenLinkLabel label : _labels_1) {
- _builder.append("\t");
- Viewmap _viewmap = label.getViewmap();
- CharSequence _addLabel = this.addLabel(_viewmap, label);
- _builder.append(_addLabel, "\t");
- _builder.newLineIfNotEmpty();
- }
- }
- _builder.append("\t");
- _builder.append("return false;");
- _builder.newLine();
- _builder.append("}");
- _builder.newLine();
- }
- }
- return _builder;
- }
-
- public CharSequence removeFixedChild(final GenLink it) {
- StringConcatenation _builder = new StringConcatenation();
- {
- EList<GenLinkLabel> _labels = it.getLabels();
- boolean _isEmpty = _labels.isEmpty();
- boolean _not = (!_isEmpty);
- if (_not) {
- CharSequence _generatedMemberComment = this._common.generatedMemberComment();
- _builder.append(_generatedMemberComment, "");
- _builder.newLineIfNotEmpty();
- _builder.append("protected boolean removeFixedChild(org.eclipse.gef.EditPart childEditPart) {");
- _builder.newLine();
- {
- EList<GenLinkLabel> _labels_1 = it.getLabels();
- for(final GenLinkLabel label : _labels_1) {
- _builder.append("\t");
- Viewmap _viewmap = label.getViewmap();
- CharSequence _removeLabel = this.removeLabel(_viewmap, label);
- _builder.append(_removeLabel, "\t");
- _builder.newLineIfNotEmpty();
- }
- }
- _builder.append("\t");
- _builder.append("return false;");
- _builder.newLine();
- _builder.append("}");
- _builder.newLine();
- }
- }
- return _builder;
- }
-
- public CharSequence addChildVisual(final GenLink it) {
- StringConcatenation _builder = new StringConcatenation();
- {
- EList<GenLinkLabel> _labels = it.getLabels();
- boolean _isEmpty = _labels.isEmpty();
- boolean _not = (!_isEmpty);
- if (_not) {
- CharSequence _generatedMemberComment = this._common.generatedMemberComment();
- _builder.append(_generatedMemberComment, "");
- _builder.newLineIfNotEmpty();
- _builder.append("protected void addChildVisual(org.eclipse.gef.EditPart childEditPart, int index) {");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("if (addFixedChild(childEditPart)) {");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("return;");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("super.addChildVisual(childEditPart, -1);");
- _builder.newLine();
- _builder.append("}");
- _builder.newLine();
- }
- }
- return _builder;
- }
-
- public CharSequence removeChildVisual(final GenLink it) {
- StringConcatenation _builder = new StringConcatenation();
- {
- EList<GenLinkLabel> _labels = it.getLabels();
- boolean _isEmpty = _labels.isEmpty();
- boolean _not = (!_isEmpty);
- if (_not) {
- CharSequence _generatedMemberComment = this._common.generatedMemberComment();
- _builder.append(_generatedMemberComment, "");
- _builder.newLineIfNotEmpty();
- _builder.append("protected void removeChildVisual(org.eclipse.gef.EditPart childEditPart) {");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("if (removeFixedChild(childEditPart)) {");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("return;");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("super.removeChildVisual(childEditPart);");
- _builder.newLine();
- _builder.append("}");
- _builder.newLine();
- }
- }
- return _builder;
- }
-
- protected CharSequence _createLinkFigure(final ModeledViewmap it, final GenLink link) {
- StringConcatenation _builder = new StringConcatenation();
- return _builder;
- }
-
- public CharSequence modeledViewmapFigureFQN(final ModeledViewmap it) {
- StringConcatenation _builder = new StringConcatenation();
- return _builder;
- }
-
- public CharSequence createLinkFigure(final Viewmap it, final GenLink link) {
- if (it instanceof FigureViewmap) {
- return _createLinkFigure((FigureViewmap)it, link);
- } else if (it instanceof InnerClassViewmap) {
- return _createLinkFigure((InnerClassViewmap)it, link);
- } else if (it instanceof ModeledViewmap) {
- return _createLinkFigure((ModeledViewmap)it, link);
- } else if (it instanceof SnippetViewmap) {
- return _createLinkFigure((SnippetViewmap)it, link);
- } else if (it != null) {
- return _createLinkFigure(it, link);
- } else {
- throw new IllegalArgumentException("Unhandled parameter types: " +
- Arrays.<Object>asList(it, link).toString());
- }
- }
-}
diff --git a/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/impl/diagram/editparts/LinkLabelEditPart.java b/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/impl/diagram/editparts/LinkLabelEditPart.java
deleted file mode 100644
index 41d0335f5d7..00000000000
--- a/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/impl/diagram/editparts/LinkLabelEditPart.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/**
- * Copyright (c) 2006, 2010, 2013 Borland Software Corporation and others
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Dmitry Stadnik (Borland) - initial API and implementation
- * Alexander Shatalin (Borland) - initial API and implementation
- * Michael Golubev (Montages) - #386838 - migrate to Xtend2
- * Thibault Landre (Atos Origin) - initial API and implementation
- */
-package aspects.impl.diagram.editparts;
-
-import com.google.inject.Inject;
-import com.google.inject.Singleton;
-import org.eclipse.gmf.codegen.gmfgen.GenDiagram;
-import org.eclipse.gmf.codegen.gmfgen.GenLinkLabel;
-import org.eclipse.xtend2.lib.StringConcatenation;
-import org.eclipse.xtext.xbase.lib.Extension;
-import xpt.diagram.editparts.Common;
-
-@Singleton
-@SuppressWarnings("all")
-public class LinkLabelEditPart extends impl.diagram.editparts.LinkLabelEditPart {
- @Inject
- @Extension
- private Common _common;
-
- public CharSequence handleNotificationEventBody(final GenLinkLabel it) {
- StringConcatenation _builder = new StringConcatenation();
- _builder.append("Object feature = event.getFeature();");
- _builder.newLine();
- CharSequence _handleText = this._common.handleText(it);
- _builder.append(_handleText, "");
- _builder.newLineIfNotEmpty();
- _builder.newLine();
- {
- boolean _isElementIcon = it.isElementIcon();
- if (_isElementIcon) {
- _builder.append("if(event.getNewValue() instanceof org.eclipse.emf.ecore.EAnnotation && org.eclipse.papyrus.infra.emf.appearance.helper.VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((org.eclipse.emf.ecore.EAnnotation)event.getNewValue()).getSource())){\t");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("refreshLabel();");
- _builder.newLine();
- _builder.append("}");
- _builder.newLine();
- }
- }
- _builder.append("\t\t");
- _builder.append("super.handleNotificationEvent(event);");
- _builder.newLine();
- return _builder;
- }
-
- public CharSequence linkLabelDragPolicyQualifiedClassName(final GenDiagram it) {
- StringConcatenation _builder = new StringConcatenation();
- _builder.append("org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.PapyrusLinkLabelDragPolicy");
- return _builder;
- }
-}
diff --git a/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/impl/diagram/editparts/NodeEditPart.java b/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/impl/diagram/editparts/NodeEditPart.java
deleted file mode 100644
index 20e5a7b52bc..00000000000
--- a/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/impl/diagram/editparts/NodeEditPart.java
+++ /dev/null
@@ -1,1021 +0,0 @@
-/**
- * Copyright (c) 2006, 2010 Borland Software Corporation and others
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Dmitry Stadnik (Borland) - initial API and implementation
- * Alexander Shatalin (Borland) - initial API and implementation
- * Michael Golubev (Montages) - #386838 - migrate to Xtend2
- * Patrick Tessier (CEA) - initial API and implementation
- * Thibault Landre (Atos Origin) - initial API and implementation
- * Vincent Lorenzo (CEA-LIST) - Bug 335987 [General][Enhancement] Show/Hide Connectors Labels and External Nodes Labels
- */
-package aspects.impl.diagram.editparts;
-
-import aspects.xpt.CodeStyle;
-import aspects.xpt.editor.VisualIDRegistry;
-import com.google.common.base.Objects;
-import com.google.common.collect.Iterables;
-import com.google.common.collect.Iterators;
-import com.google.inject.Inject;
-import com.google.inject.Singleton;
-import impl.diagram.editparts.TextAware;
-import java.util.Arrays;
-import java.util.Iterator;
-import java.util.List;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.common.util.TreeIterator;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.gmf.codegen.gmfgen.GenChildSideAffixedNode;
-import org.eclipse.gmf.codegen.gmfgen.GenCommonBase;
-import org.eclipse.gmf.codegen.gmfgen.GenCompartment;
-import org.eclipse.gmf.codegen.gmfgen.GenDiagram;
-import org.eclipse.gmf.codegen.gmfgen.GenExternalNodeLabel;
-import org.eclipse.gmf.codegen.gmfgen.GenLabel;
-import org.eclipse.gmf.codegen.gmfgen.GenNavigatorChildReference;
-import org.eclipse.gmf.codegen.gmfgen.GenNode;
-import org.eclipse.gmf.codegen.gmfgen.GenNodeLabel;
-import org.eclipse.gmf.codegen.gmfgen.ParentAssignedViewmap;
-import org.eclipse.gmf.codegen.gmfgen.ToolEntry;
-import org.eclipse.gmf.codegen.gmfgen.Viewmap;
-import org.eclipse.papyrus.papyrusgmfgenextension.ExtendedGenView;
-import org.eclipse.papyrus.papyrusgmfgenextension.PropertyRefreshHook;
-import org.eclipse.papyrus.papyrusgmfgenextension.SpecificLocator;
-import org.eclipse.xtend2.lib.StringConcatenation;
-import org.eclipse.xtext.xbase.lib.Extension;
-import org.eclipse.xtext.xbase.lib.Functions.Function1;
-import org.eclipse.xtext.xbase.lib.IterableExtensions;
-import org.eclipse.xtext.xbase.lib.IteratorExtensions;
-import utils.EditPartsUtils_qvto;
-import xpt.Common;
-import xpt.diagram.editparts.EditPartFactory;
-import xpt.diagram.editparts.Utils_qvto;
-
-@Singleton
-@SuppressWarnings("all")
-public class NodeEditPart extends impl.diagram.editparts.NodeEditPart {
- @Inject
- @Extension
- private Common _common;
-
- @Inject
- @Extension
- private CodeStyle _codeStyle;
-
- @Inject
- @Extension
- private EditPartsUtils_qvto _editPartsUtils_qvto;
-
- @Inject
- @Extension
- private VisualIDRegistry _visualIDRegistry;
-
- @Inject
- @Extension
- private Utils_qvto _utils_qvto;
-
- @Inject
- private EditPartFactory xptEditPartFactory;
-
- @Inject
- private TextAware xptTextAware;
-
- protected CharSequence _extendsListContents(final GenNode it) {
- StringConcatenation _builder = new StringConcatenation();
- {
- Resource _eResource = it.eResource();
- TreeIterator<EObject> _allContents = _eResource.getAllContents();
- Iterator<ExtendedGenView> _filter = Iterators.<ExtendedGenView>filter(_allContents, ExtendedGenView.class);
- final Function1<ExtendedGenView, Boolean> _function = new Function1<ExtendedGenView, Boolean>() {
- public Boolean apply(final ExtendedGenView v) {
- boolean _and = false;
- EList<GenCommonBase> _genView = v.getGenView();
- boolean _contains = _genView.contains(it);
- if (!_contains) {
- _and = false;
- } else {
- String _superOwnedEditPart = v.getSuperOwnedEditPart();
- boolean _notEquals = (!Objects.equal(_superOwnedEditPart, null));
- _and = _notEquals;
- }
- return Boolean.valueOf(_and);
- }
- };
- Iterator<ExtendedGenView> _filter_1 = IteratorExtensions.<ExtendedGenView>filter(_filter, _function);
- int _size = IteratorExtensions.size(_filter_1);
- boolean _notEquals = (_size != 0);
- if (_notEquals) {
- {
- Resource _eResource_1 = it.eResource();
- TreeIterator<EObject> _allContents_1 = _eResource_1.getAllContents();
- Iterator<ExtendedGenView> _filter_2 = Iterators.<ExtendedGenView>filter(_allContents_1, ExtendedGenView.class);
- final Function1<ExtendedGenView, Boolean> _function_1 = new Function1<ExtendedGenView, Boolean>() {
- public Boolean apply(final ExtendedGenView v) {
- boolean _and = false;
- EList<GenCommonBase> _genView = v.getGenView();
- boolean _contains = _genView.contains(it);
- if (!_contains) {
- _and = false;
- } else {
- String _superOwnedEditPart = v.getSuperOwnedEditPart();
- boolean _notEquals = (!Objects.equal(_superOwnedEditPart, null));
- _and = _notEquals;
- }
- return Boolean.valueOf(_and);
- }
- };
- Iterator<ExtendedGenView> _filter_3 = IteratorExtensions.<ExtendedGenView>filter(_filter_2, _function_1);
- Iterable<ExtendedGenView> _iterable = IteratorExtensions.<ExtendedGenView>toIterable(_filter_3);
- for(final ExtendedGenView extendedObject : _iterable) {
- CharSequence _specifyInheritance = this.specifyInheritance(((ExtendedGenView) extendedObject));
- _builder.append(_specifyInheritance, "");
- _builder.newLineIfNotEmpty();
- }
- }
- } else {
- _builder.append("org.eclipse.papyrus.infra.gmfdiag.common.editpart.NodeEditPart");
- _builder.newLine();
- }
- }
- return _builder;
- }
-
- protected CharSequence _extendsListContents(final GenChildSideAffixedNode it) {
- StringConcatenation _builder = new StringConcatenation();
- {
- Resource _eResource = it.eResource();
- TreeIterator<EObject> _allContents = _eResource.getAllContents();
- Iterator<ExtendedGenView> _filter = Iterators.<ExtendedGenView>filter(_allContents, ExtendedGenView.class);
- final Function1<ExtendedGenView, Boolean> _function = new Function1<ExtendedGenView, Boolean>() {
- public Boolean apply(final ExtendedGenView v) {
- boolean _and = false;
- EList<GenCommonBase> _genView = v.getGenView();
- boolean _contains = _genView.contains(it);
- if (!_contains) {
- _and = false;
- } else {
- String _superOwnedEditPart = v.getSuperOwnedEditPart();
- boolean _notEquals = (!Objects.equal(_superOwnedEditPart, null));
- _and = _notEquals;
- }
- return Boolean.valueOf(_and);
- }
- };
- Iterator<ExtendedGenView> _filter_1 = IteratorExtensions.<ExtendedGenView>filter(_filter, _function);
- int _size = IteratorExtensions.size(_filter_1);
- boolean _notEquals = (_size != 0);
- if (_notEquals) {
- {
- Resource _eResource_1 = it.eResource();
- TreeIterator<EObject> _allContents_1 = _eResource_1.getAllContents();
- Iterator<ExtendedGenView> _filter_2 = Iterators.<ExtendedGenView>filter(_allContents_1, ExtendedGenView.class);
- final Function1<ExtendedGenView, Boolean> _function_1 = new Function1<ExtendedGenView, Boolean>() {
- public Boolean apply(final ExtendedGenView v) {
- boolean _and = false;
- EList<GenCommonBase> _genView = v.getGenView();
- boolean _contains = _genView.contains(it);
- if (!_contains) {
- _and = false;
- } else {
- String _superOwnedEditPart = v.getSuperOwnedEditPart();
- boolean _notEquals = (!Objects.equal(_superOwnedEditPart, null));
- _and = _notEquals;
- }
- return Boolean.valueOf(_and);
- }
- };
- Iterator<ExtendedGenView> _filter_3 = IteratorExtensions.<ExtendedGenView>filter(_filter_2, _function_1);
- Iterable<ExtendedGenView> _iterable = IteratorExtensions.<ExtendedGenView>toIterable(_filter_3);
- for(final ExtendedGenView extendedObject : _iterable) {
- CharSequence _specifyInheritance = this.specifyInheritance(extendedObject);
- _builder.append(_specifyInheritance, "");
- _builder.newLineIfNotEmpty();
- }
- }
- } else {
- {
- boolean _hasBorderItems = this._utils_qvto.hasBorderItems(it);
- if (_hasBorderItems) {
- _builder.append("org.eclipse.gmf.runtime.diagram.ui.editparts.BorderedBorderItemEditPart");
- } else {
- _builder.append("org.eclipse.gmf.runtime.diagram.ui.editparts.AbstractBorderItemEditPart");
- }
- }
- _builder.newLineIfNotEmpty();
- }
- }
- return _builder;
- }
-
- public CharSequence addFixedChild(final GenNode it) {
- StringConcatenation _builder = new StringConcatenation();
- _builder.append("\t");
- CharSequence _generatedMemberComment = this._common.generatedMemberComment();
- _builder.append(_generatedMemberComment, "\t");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.append("protected boolean addFixedChild(org.eclipse.gef.EditPart childEditPart) {");
- _builder.newLine();
- {
- Iterable<? extends GenLabel> _innerFixedLabels = this._utils_qvto.getInnerFixedLabels(it);
- for(final GenLabel label : _innerFixedLabels) {
- Viewmap _viewmap = label.getViewmap();
- ParentAssignedViewmap childViewmap = ((ParentAssignedViewmap) _viewmap);
- _builder.newLineIfNotEmpty();
- _builder.append("\t\t");
- _builder.append("if (childEditPart instanceof ");
- CharSequence _editPartQualifiedClassName = this.xptEditPartFactory.getEditPartQualifiedClassName(label);
- _builder.append(_editPartQualifiedClassName, "\t\t");
- _builder.append(") {");
- _builder.newLineIfNotEmpty();
- _builder.append("\t\t\t");
- _builder.append("((");
- CharSequence _editPartQualifiedClassName_1 = this.xptEditPartFactory.getEditPartQualifiedClassName(label);
- _builder.append(_editPartQualifiedClassName_1, "\t\t\t");
- _builder.append(") childEditPart).");
- CharSequence _labelSetterName = this.xptTextAware.labelSetterName(childViewmap);
- _builder.append(_labelSetterName, "\t\t\t");
- _builder.append("(getPrimaryShape().");
- String _getterName = childViewmap.getGetterName();
- _builder.append(_getterName, "\t\t\t");
- _builder.append("());");
- _builder.newLineIfNotEmpty();
- _builder.append("\t\t\t");
- _builder.append("return true;");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("}");
- _builder.newLine();
- }
- }
- _builder.newLine();
- {
- Iterable<GenCompartment> _pinnedCompartments = this._utils_qvto.getPinnedCompartments(it);
- for(final GenCompartment compartment : _pinnedCompartments) {
- Viewmap _viewmap_1 = compartment.getViewmap();
- ParentAssignedViewmap childViewmap_1 = ((ParentAssignedViewmap) _viewmap_1);
- _builder.newLineIfNotEmpty();
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("if (childEditPart instanceof ");
- String _editPartQualifiedClassName_2 = compartment.getEditPartQualifiedClassName();
- _builder.append(_editPartQualifiedClassName_2, "\t\t");
- _builder.append(") {");
- _builder.newLineIfNotEmpty();
- _builder.append("\t\t\t");
- _builder.append("org.eclipse.draw2d.IFigure pane = getPrimaryShape().");
- String _getterName_1 = childViewmap_1.getGetterName();
- _builder.append(_getterName_1, "\t\t\t");
- _builder.append("();");
- _builder.newLineIfNotEmpty();
- _builder.append("\t\t\t");
- _builder.append("setupContentPane(pane); // FIXME each comparment should handle his content pane in his own way ");
- _builder.newLine();
- _builder.append("\t\t\t");
- _builder.append("pane.add(((");
- String _editPartQualifiedClassName_3 = compartment.getEditPartQualifiedClassName();
- _builder.append(_editPartQualifiedClassName_3, "\t\t\t");
- _builder.append(") childEditPart).getFigure());");
- _builder.newLineIfNotEmpty();
- _builder.append("\t\t\t");
- _builder.append("return true;");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("}\t");
- _builder.newLine();
- }
- }
- _builder.newLine();
- {
- Iterable<GenChildSideAffixedNode> _sideAffixedChildren = this._utils_qvto.getSideAffixedChildren(it);
- for(final GenChildSideAffixedNode child : _sideAffixedChildren) {
- _builder.append("\t\t");
- _builder.newLine();
- _builder.newLine();
- {
- Resource _eResource = it.eResource();
- TreeIterator<EObject> _allContents = _eResource.getAllContents();
- Iterator<SpecificLocator> _filter = Iterators.<SpecificLocator>filter(_allContents, SpecificLocator.class);
- final Function1<SpecificLocator, Boolean> _function = new Function1<SpecificLocator, Boolean>() {
- public Boolean apply(final SpecificLocator v) {
- EList<GenChildSideAffixedNode> _genChildSideAffixedNode = v.getGenChildSideAffixedNode();
- return Boolean.valueOf(_genChildSideAffixedNode.contains(child));
- }
- };
- Iterator<SpecificLocator> _filter_1 = IteratorExtensions.<SpecificLocator>filter(_filter, _function);
- int _size = IteratorExtensions.size(_filter_1);
- boolean _notEquals = (_size != 0);
- if (_notEquals) {
- {
- Resource _eResource_1 = it.eResource();
- TreeIterator<EObject> _allContents_1 = _eResource_1.getAllContents();
- Iterator<SpecificLocator> _filter_2 = Iterators.<SpecificLocator>filter(_allContents_1, SpecificLocator.class);
- final Function1<SpecificLocator, Boolean> _function_1 = new Function1<SpecificLocator, Boolean>() {
- public Boolean apply(final SpecificLocator v) {
- EList<GenChildSideAffixedNode> _genChildSideAffixedNode = v.getGenChildSideAffixedNode();
- return Boolean.valueOf(_genChildSideAffixedNode.contains(child));
- }
- };
- Iterator<SpecificLocator> _filter_3 = IteratorExtensions.<SpecificLocator>filter(_filter_2, _function_1);
- Iterable<SpecificLocator> _iterable = IteratorExtensions.<SpecificLocator>toIterable(_filter_3);
- for(final SpecificLocator extendedObject : _iterable) {
- CharSequence _genSpecificLocator = this.genSpecificLocator(extendedObject, child);
- _builder.append(_genSpecificLocator, "");
- _builder.newLineIfNotEmpty();
- }
- }
- _builder.newLine();
- } else {
- _builder.append("if (childEditPart instanceof ");
- String _editPartQualifiedClassName_4 = child.getEditPartQualifiedClassName();
- _builder.append(_editPartQualifiedClassName_4, "");
- _builder.append(") {");
- _builder.newLineIfNotEmpty();
- _builder.append("\t\t\t");
- _builder.append("org.eclipse.gmf.runtime.diagram.ui.figures.BorderItemLocator locator = new org.eclipse.gmf.runtime.diagram.ui.figures.BorderItemLocator(getMainFigure(), org.eclipse.draw2d.PositionConstants.");
- String _preferredSideName = child.getPreferredSideName();
- _builder.append(_preferredSideName, "\t\t\t");
- _builder.append(");");
- _builder.newLineIfNotEmpty();
- _builder.append("\t\t\t");
- _builder.append("getBorderedFigure().getBorderItemContainer().add(((");
- String _editPartQualifiedClassName_5 = child.getEditPartQualifiedClassName();
- _builder.append(_editPartQualifiedClassName_5, "\t\t\t");
- _builder.append(") childEditPart).getFigure(), locator);");
- _builder.newLineIfNotEmpty();
- _builder.append("\t\t\t");
- _builder.append("return true;");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("}");
- _builder.newLine();
- }
- }
- }
- }
- _builder.append("\t\t");
- _builder.append("return false;");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- return _builder;
- }
-
- public CharSequence installGraphicalNodeEditPolicy(final GenNode it) {
- StringConcatenation _builder = new StringConcatenation();
- _builder.append("\t\t");
- _builder.newLine();
- _builder.append("installEditPolicy(org.eclipse.gef.EditPolicy.GRAPHICAL_NODE_ROLE, new org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.DefaultGraphicalNodeEditPolicy());");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.newLine();
- return _builder;
- }
-
- public CharSequence setLineWidth(final GenNode it) {
- StringConcatenation _builder = new StringConcatenation();
- CharSequence _generatedMemberComment = this._common.generatedMemberComment();
- _builder.append(_generatedMemberComment, "");
- _builder.newLineIfNotEmpty();
- _builder.append("protected void setLineWidth(int width) {");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("super.setLineWidth(width);");
- _builder.newLine();
- _builder.append("}");
- _builder.newLine();
- return _builder;
- }
-
- public CharSequence setLineStyle(final GenNode it) {
- StringConcatenation _builder = new StringConcatenation();
- CharSequence _generatedMemberComment = this._common.generatedMemberComment();
- _builder.append(_generatedMemberComment, "");
- _builder.newLineIfNotEmpty();
- _builder.append("protected void setLineType(int style) {");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("if (primaryShape instanceof org.eclipse.papyrus.infra.gmfdiag.common.figure.node.IPapyrusNodeFigure) {\t");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("((org.eclipse.papyrus.infra.gmfdiag.common.figure.node.IPapyrusNodeFigure) primaryShape).setLineStyle(style);");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("}");
- _builder.newLine();
- return _builder;
- }
-
- public CharSequence createFigure(final GenNode it) {
- StringConcatenation _builder = new StringConcatenation();
- CharSequence _generatedMemberComment = this._common.generatedMemberComment(
- ((("Creates figure for this edit part.\n" +
- "\n") +
- "Body of this method does not depend on settings in generation model\n") +
- "so you may safely remove <i>generated</i> tag and modify it.\n"));
- _builder.append(_generatedMemberComment, "");
- _builder.newLineIfNotEmpty();
- _builder.append("protected org.eclipse.gmf.runtime.gef.ui.figures.NodeFigure create");
- {
- boolean _hasBorderItems = this._utils_qvto.hasBorderItems(it);
- if (_hasBorderItems) {
- _builder.append("Main");
- } else {
- _builder.append("Node");
- }
- }
- _builder.append("Figure() {");
- _builder.newLineIfNotEmpty();
- {
- if ((it instanceof GenChildSideAffixedNode)) {
- _builder.append("\t");
- _builder.append("org.eclipse.gmf.runtime.gef.ui.figures.NodeFigure figure = createNodePlate();");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("figure.setLayoutManager(new org.eclipse.draw2d.StackLayout());");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("org.eclipse.draw2d.IFigure shape = createNodeShape();");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("figure.add(shape);");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("contentPane = setupContentPane(shape);");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("return figure;");
- _builder.newLine();
- } else {
- _builder.append("\t");
- _builder.append("return new org.eclipse.papyrus.infra.gmfdiag.common.figure.node.SelectableBorderedNodeFigure(createMainFigureWithSVG());");
- _builder.newLine();
- }
- }
- _builder.append("\t");
- _builder.newLine();
- _builder.append("}");
- _builder.newLine();
- return _builder;
- }
-
- public CharSequence borderItemSelectionEditPolicy(final GenNode it) {
- StringConcatenation _builder = new StringConcatenation();
- {
- boolean _hasBorderItems = this._utils_qvto.hasBorderItems(it);
- if (_hasBorderItems) {
- _builder.append("org.eclipse.gmf.runtime.notation.View childView = (org.eclipse.gmf.runtime.notation.View) child.getModel();");
- _builder.newLine();
- _builder.append("switch (");
- GenDiagram _diagram = it.getDiagram();
- CharSequence _visualIDMethodCall = this._visualIDRegistry.getVisualIDMethodCall(_diagram);
- _builder.append(_visualIDMethodCall, "");
- _builder.append("(childView)) {");
- _builder.newLineIfNotEmpty();
- {
- Iterable<GenExternalNodeLabel> _externalLabels = this._utils_qvto.getExternalLabels(it);
- int _size = IterableExtensions.size(_externalLabels);
- boolean _greaterThan = (_size > 0);
- if (_greaterThan) {
- {
- Iterable<GenExternalNodeLabel> _externalLabels_1 = this._utils_qvto.getExternalLabels(it);
- for(final GenExternalNodeLabel nextLabel : _externalLabels_1) {
- CharSequence _caseVisualID = this._visualIDRegistry.caseVisualID(nextLabel);
- _builder.append(_caseVisualID, "");
- _builder.newLineIfNotEmpty();
- }
- }
- _builder.append("\t");
- _builder.append("return ");
- CharSequence _borderItemSelectionEP = this.borderItemSelectionEP(it);
- _builder.append(_borderItemSelectionEP, "\t");
- _builder.append(";");
- _builder.newLineIfNotEmpty();
- }
- }
- {
- Iterable<GenChildSideAffixedNode> _sideAffixedChildren = this._utils_qvto.getSideAffixedChildren(it);
- int _size_1 = IterableExtensions.size(_sideAffixedChildren);
- boolean _greaterThan_1 = (_size_1 > 0);
- if (_greaterThan_1) {
- {
- Iterable<GenChildSideAffixedNode> _sideAffixedChildren_1 = this._utils_qvto.getSideAffixedChildren(it);
- for(final GenChildSideAffixedNode nextBorderItem : _sideAffixedChildren_1) {
- CharSequence _caseVisualID_1 = this._visualIDRegistry.caseVisualID(nextBorderItem);
- _builder.append(_caseVisualID_1, "");
- _builder.newLineIfNotEmpty();
- }
- }
- _builder.append("\t\t\t\t\t");
- _builder.append("return new org.eclipse.papyrus.uml.diagram.common.editpolicies.BorderItemResizableEditPolicy();");
- _builder.newLine();
- }
- }
- _builder.append("}");
- _builder.newLine();
- }
- }
- return _builder;
- }
-
- public CharSequence createLayoutEditPolicyBody_FLOW_LAYOUT(final GenNode it) {
- StringConcatenation _builder = new StringConcatenation();
- _builder.append("org.eclipse.gmf.runtime.diagram.ui.editpolicies.FlowLayoutEditPolicy lep = new org.eclipse.gmf.runtime.diagram.ui.editpolicies.FlowLayoutEditPolicy() {");
- _builder.newLine();
- {
- boolean _hasBorderItems = this._utils_qvto.hasBorderItems(it);
- if (_hasBorderItems) {
- _builder.append("\t");
- CharSequence _extraLineBreak = this._common.extraLineBreak();
- _builder.append(_extraLineBreak, "\t");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- CharSequence _overrideC = this._codeStyle.overrideC(it);
- _builder.append(_overrideC, "\t");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.append("protected org.eclipse.gef.EditPolicy createChildEditPolicy(org.eclipse.gef.EditPart child) {");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("\t");
- CharSequence _borderItemSelectionEditPolicy = this.borderItemSelectionEditPolicy(it);
- _builder.append(_borderItemSelectionEditPolicy, "\t\t");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.append("\t");
- _builder.append("return super.createChildEditPolicy(child);");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- }
- }
- _builder.newLine();
- _builder.append("\t");
- CharSequence _overrideC_1 = this._codeStyle.overrideC(it);
- _builder.append(_overrideC_1, "\t");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.append("protected org.eclipse.gef.commands.Command createAddCommand(org.eclipse.gef.EditPart child, org.eclipse.gef.EditPart after) {");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("return null;");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- _builder.newLine();
- _builder.append("\t");
- CharSequence _overrideC_2 = this._codeStyle.overrideC(it);
- _builder.append(_overrideC_2, "\t");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.append("protected org.eclipse.gef.commands.Command createMoveChildCommand(org.eclipse.gef.EditPart child, org.eclipse.gef.EditPart after) {");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("return null;");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- _builder.newLine();
- _builder.append("\t");
- CharSequence _overrideC_3 = this._codeStyle.overrideC(it);
- _builder.append(_overrideC_3, "\t");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.append("protected org.eclipse.gef.commands.Command getCreateCommand(org.eclipse.gef.requests.CreateRequest request) {");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("return null;");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("};");
- _builder.newLine();
- _builder.append("return lep;");
- _builder.newLine();
- return _builder;
- }
-
- public CharSequence createLayoutEditPolicyBody_DEFAULT(final GenNode it) {
- StringConcatenation _builder = new StringConcatenation();
- _builder.append("org.eclipse.gmf.runtime.diagram.ui.editpolicies.LayoutEditPolicy lep = new org.eclipse.gmf.runtime.diagram.ui.editpolicies.LayoutEditPolicy() {");
- _builder.newLine();
- _builder.newLine();
- _builder.append("\t");
- CharSequence _overrideC = this._codeStyle.overrideC(it);
- _builder.append(_overrideC, "\t");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.append("protected org.eclipse.gef.EditPolicy createChildEditPolicy(org.eclipse.gef.EditPart child) {");
- _builder.newLine();
- _builder.append("\t\t");
- CharSequence _borderItemSelectionEditPolicy = this.borderItemSelectionEditPolicy(it);
- _builder.append(_borderItemSelectionEditPolicy, "\t\t");
- _builder.newLineIfNotEmpty();
- _builder.append("\t\t");
- _builder.append("org.eclipse.gef.EditPolicy result = child.getEditPolicy(org.eclipse.gef.EditPolicy.PRIMARY_DRAG_ROLE);");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("if (result == null) {");
- _builder.newLine();
- _builder.append("\t\t\t");
- _builder.append("result = new org.eclipse.gef.editpolicies.NonResizableEditPolicy();");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("return result;");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- _builder.newLine();
- _builder.append("\t");
- CharSequence _overrideC_1 = this._codeStyle.overrideC(it);
- _builder.append(_overrideC_1, "\t");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.append("protected org.eclipse.gef.commands.Command getMoveChildrenCommand(org.eclipse.gef.Request request) {");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("return null;");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- _builder.newLine();
- _builder.append("\t");
- CharSequence _overrideC_2 = this._codeStyle.overrideC(it);
- _builder.append(_overrideC_2, "\t");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.append("protected org.eclipse.gef.commands.Command getCreateCommand(org.eclipse.gef.requests.CreateRequest request) {");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("return null;");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("};");
- _builder.newLine();
- _builder.append("return lep;");
- _builder.newLine();
- return _builder;
- }
-
- public CharSequence specifyInheritance(final ExtendedGenView it) {
- StringConcatenation _builder = new StringConcatenation();
- String _superOwnedEditPart = it.getSuperOwnedEditPart();
- _builder.append(_superOwnedEditPart, "");
- return _builder;
- }
-
- public CharSequence genSpecificLocator(final GenCommonBase it, final GenChildSideAffixedNode child) {
- StringConcatenation _builder = new StringConcatenation();
- return _builder;
- }
-
- public CharSequence genSpecificLocator(final ToolEntry it, final GenChildSideAffixedNode child) {
- StringConcatenation _builder = new StringConcatenation();
- return _builder;
- }
-
- public CharSequence genSpecificLocator(final GenNavigatorChildReference it, final GenChildSideAffixedNode child) {
- StringConcatenation _builder = new StringConcatenation();
- return _builder;
- }
-
- public CharSequence genSpecificLocator(final SpecificLocator it, final GenChildSideAffixedNode child) {
- StringConcatenation _builder = new StringConcatenation();
- _builder.append("//Papyrus Gencode :");
- String _comment = it.getComment();
- _builder.append(_comment, "");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.append("if (childEditPart instanceof ");
- String _editPartQualifiedClassName = child.getEditPartQualifiedClassName();
- _builder.append(_editPartQualifiedClassName, "\t");
- _builder.append(") {");
- _builder.newLineIfNotEmpty();
- _builder.append("\t\t\t");
- _builder.append("org.eclipse.gmf.runtime.diagram.ui.figures.IBorderItemLocator locator = new ");
- String _classpath = it.getClasspath();
- _builder.append(_classpath, "\t\t\t");
- _builder.append("(getMainFigure(), org.eclipse.draw2d.PositionConstants.");
- String _preferredSideName = child.getPreferredSideName();
- _builder.append(_preferredSideName, "\t\t\t");
- _builder.append(");");
- _builder.newLineIfNotEmpty();
- _builder.append("\t\t\t");
- _builder.append("getBorderedFigure().getBorderItemContainer().add(((");
- String _editPartQualifiedClassName_1 = child.getEditPartQualifiedClassName();
- _builder.append(_editPartQualifiedClassName_1, "\t\t\t");
- _builder.append(") childEditPart).getFigure(), locator);");
- _builder.newLineIfNotEmpty();
- _builder.append("\t\t\t");
- _builder.append("return true;");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.newLine();
- return _builder;
- }
-
- public CharSequence borderItemSelectionEP(final GenNode it) {
- StringConcatenation _builder = new StringConcatenation();
- _builder.append("new org.eclipse.gmf.runtime.diagram.ui.editpolicies.BorderItemSelectionEditPolicy() {");
- _builder.newLine();
- _builder.newLine();
- _builder.append("\t");
- CharSequence _overrideC = this._codeStyle.overrideC(it);
- _builder.append(_overrideC, "\t");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.append("protected java.util.List<?> createSelectionHandles() {");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("org.eclipse.gef.handles.MoveHandle mh = new org.eclipse.gef.handles.MoveHandle((org.eclipse.gef.GraphicalEditPart) getHost());");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("mh.setBorder(null);");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("return java.util.Collections.singletonList(mh);");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("}");
- _builder.newLine();
- return _builder;
- }
-
- public CharSequence specificHandleNotificationEvent(final GenNode it) {
- StringConcatenation _builder = new StringConcatenation();
- _builder.newLine();
- {
- Resource _eResource = it.eResource();
- TreeIterator<EObject> _allContents = _eResource.getAllContents();
- Iterator<ExtendedGenView> _filter = Iterators.<ExtendedGenView>filter(_allContents, ExtendedGenView.class);
- final Function1<ExtendedGenView, Boolean> _function = new Function1<ExtendedGenView, Boolean>() {
- public Boolean apply(final ExtendedGenView v) {
- EList<GenCommonBase> _genView = v.getGenView();
- return Boolean.valueOf(_genView.contains(it));
- }
- };
- Iterator<ExtendedGenView> _filter_1 = IteratorExtensions.<ExtendedGenView>filter(_filter, _function);
- int _size = IteratorExtensions.size(_filter_1);
- boolean _notEquals = (_size != 0);
- if (_notEquals) {
- _builder.append("/**");
- _builder.newLine();
- _builder.append("*Papyrus codeGen");
- _builder.newLine();
- _builder.append("*@generated");
- _builder.newLine();
- _builder.append("**/");
- _builder.newLine();
- _builder.append("protected void handleNotificationEvent(org.eclipse.emf.common.notify.Notification event) {");
- _builder.newLine();
- {
- EList<GenNodeLabel> _labels = it.getLabels();
- Iterable<GenExternalNodeLabel> _filter_2 = Iterables.<GenExternalNodeLabel>filter(_labels, GenExternalNodeLabel.class);
- int _size_1 = IterableExtensions.size(_filter_2);
- boolean _notEquals_1 = (_size_1 != 0);
- if (_notEquals_1) {
- _builder.append("/*");
- _builder.newLine();
- _builder.append(" ");
- _builder.append("* when a node have external node labels, the methods refreshChildren() remove the EditPart corresponding to the Label from the EditPart");
- _builder.newLine();
- _builder.append(" ");
- _builder.append("* Registry. After that, we can\'t reset the visibility to true (using the Show/Hide Label Action)!");
- _builder.newLine();
- _builder.append(" ");
- _builder.append("*/");
- _builder.newLine();
- _builder.append("if(org.eclipse.gmf.runtime.notation.NotationPackage.eINSTANCE.getView_Visible().equals(event.getFeature())) {");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("Object notifier = event.getNotifier();");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("java.util.List<?> modelChildren = ((org.eclipse.gmf.runtime.notation.View)getModel()).getChildren();");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("if(!(notifier instanceof org.eclipse.gmf.runtime.notation.Edge)) {");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("if(modelChildren.contains(event.getNotifier())) {");
- _builder.newLine();
- _builder.append("\t\t\t");
- _builder.append("return;");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("}");
- _builder.newLine();
- }
- }
- _builder.append("\t");
- _builder.append("super.handleNotificationEvent(event);");
- _builder.newLine();
- {
- Resource _eResource_1 = it.eResource();
- TreeIterator<EObject> _allContents_1 = _eResource_1.getAllContents();
- Iterator<ExtendedGenView> _filter_3 = Iterators.<ExtendedGenView>filter(_allContents_1, ExtendedGenView.class);
- final Function1<ExtendedGenView, Boolean> _function_1 = new Function1<ExtendedGenView, Boolean>() {
- public Boolean apply(final ExtendedGenView v) {
- EList<GenCommonBase> _genView = v.getGenView();
- return Boolean.valueOf(_genView.contains(it));
- }
- };
- Iterator<ExtendedGenView> _filter_4 = IteratorExtensions.<ExtendedGenView>filter(_filter_3, _function_1);
- Iterable<ExtendedGenView> _iterable = IteratorExtensions.<ExtendedGenView>toIterable(_filter_4);
- for(final ExtendedGenView extendedObject : _iterable) {
- {
- PropertyRefreshHook _propRefreshHook = extendedObject.getPropRefreshHook();
- boolean _notEquals_2 = (!Objects.equal(_propRefreshHook, null));
- if (_notEquals_2) {
- _builder.append("\t");
- PropertyRefreshHook _propRefreshHook_1 = extendedObject.getPropRefreshHook();
- CharSequence _specificHandleNotificationEventBody = this.specificHandleNotificationEventBody(_propRefreshHook_1);
- _builder.append(_specificHandleNotificationEventBody, "\t");
- _builder.newLineIfNotEmpty();
- }
- }
- }
- }
- _builder.append("\t");
- _builder.newLine();
- _builder.append(" \t");
- _builder.append("}");
- _builder.newLine();
- }
- }
- _builder.newLine();
- return _builder;
- }
-
- public CharSequence specificHandleNotificationEventBody(final PropertyRefreshHook it) {
- StringConcatenation _builder = new StringConcatenation();
- {
- String _comment = it.getComment();
- boolean _notEquals = (!Objects.equal(_comment, null));
- if (_notEquals) {
- _builder.append("//");
- String _comment_1 = it.getComment();
- _builder.append(_comment_1, "");
- _builder.newLineIfNotEmpty();
- }
- }
- _builder.append("if (resolveSemanticElement() != null) {");
- _builder.newLine();
- _builder.append("if(");
- String _triggeringCondition = it.getTriggeringCondition();
- _builder.append(_triggeringCondition, "");
- _builder.append("){");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- String _action = it.getAction();
- _builder.append(_action, "\t");
- _builder.append(";");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.append("refreshVisuals();");
- _builder.newLine();
- _builder.append("}");
- _builder.newLine();
- _builder.append("}");
- _builder.newLine();
- return _builder;
- }
-
- public CharSequence addBorderItem(final GenNode it) {
- StringConcatenation _builder = new StringConcatenation();
- {
- Iterable<GenExternalNodeLabel> _externalLabels = this._utils_qvto.getExternalLabels(it);
- int _size = IterableExtensions.size(_externalLabels);
- boolean _greaterThan = (_size > 0);
- if (_greaterThan) {
- CharSequence _generatedMemberComment = this._common.generatedMemberComment();
- _builder.append(_generatedMemberComment, "");
- _builder.newLineIfNotEmpty();
- _builder.append("protected void addBorderItem(org.eclipse.draw2d.IFigure borderItemContainer, org.eclipse.gmf.runtime.diagram.ui.editparts.IBorderItemEditPart borderItemEditPart) {");
- _builder.newLine();
- {
- List<GenExternalNodeLabel> _externalLabelsWithoutSpecificLocator = this._editPartsUtils_qvto.getExternalLabelsWithoutSpecificLocator(it);
- int _size_1 = _externalLabelsWithoutSpecificLocator.size();
- boolean _greaterThan_1 = (_size_1 > 0);
- if (_greaterThan_1) {
- _builder.append("if (");
- {
- List<GenExternalNodeLabel> _externalLabelsWithoutSpecificLocator_1 = this._editPartsUtils_qvto.getExternalLabelsWithoutSpecificLocator(it);
- boolean _hasElements = false;
- for(final GenExternalNodeLabel label : _externalLabelsWithoutSpecificLocator_1) {
- if (!_hasElements) {
- _hasElements = true;
- } else {
- _builder.appendImmediate(" || ", "");
- }
- _builder.append("borderItemEditPart instanceof ");
- String _editPartQualifiedClassName = label.getEditPartQualifiedClassName();
- _builder.append(_editPartQualifiedClassName, "");
- }
- }
- _builder.append(") {");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.append("org.eclipse.gmf.runtime.diagram.ui.figures.BorderItemLocator locator = new org.eclipse.gmf.runtime.diagram.ui.figures.BorderItemLocator(getMainFigure(), org.eclipse.draw2d.PositionConstants.SOUTH);");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("locator.setBorderItemOffset(new org.eclipse.draw2d.geometry.Dimension(-20, -20));");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("borderItemContainer.add(borderItemEditPart.getFigure(), locator);");
- _builder.newLine();
- _builder.append("} else");
- _builder.newLine();
- }
- }
- {
- List<GenExternalNodeLabel> _externalLabelsWithSpecificLocator = this._editPartsUtils_qvto.getExternalLabelsWithSpecificLocator(it);
- for(final GenExternalNodeLabel label_1 : _externalLabelsWithSpecificLocator) {
- _builder.append("if (borderItemEditPart instanceof ");
- String _editPartQualifiedClassName_1 = label_1.getEditPartQualifiedClassName();
- _builder.append(_editPartQualifiedClassName_1, "");
- _builder.append(") {");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.append("org.eclipse.gmf.runtime.diagram.ui.figures.IBorderItemLocator locator = new ");
- String _specificLocator = this._editPartsUtils_qvto.getSpecificLocator(label_1);
- _builder.append(_specificLocator, "\t");
- _builder.append("(getMainFigure());");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.append("borderItemContainer.add(borderItemEditPart.getFigure(), locator);");
- _builder.newLine();
- _builder.append("} else");
- _builder.newLine();
- }
- }
- _builder.append("\t");
- _builder.append("{");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("super.addBorderItem(borderItemContainer, borderItemEditPart);");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("}");
- _builder.newLine();
- }
- }
- return _builder;
- }
-
- public CharSequence setupNodePlate(final GenNode it) {
- StringConcatenation _builder = new StringConcatenation();
- return _builder;
- }
-
- public CharSequence setupNodePlate(final GenChildSideAffixedNode it) {
- StringConcatenation _builder = new StringConcatenation();
- _builder.append("//FIXME: workaround for #154536");
- _builder.newLine();
- _builder.append("result.getBounds().setSize(result.getPreferredSize());");
- _builder.newLine();
- return _builder;
- }
-
- public CharSequence extendsListContents(final GenNode it) {
- if (it instanceof GenChildSideAffixedNode) {
- return _extendsListContents((GenChildSideAffixedNode)it);
- } else if (it != null) {
- return _extendsListContents(it);
- } else {
- throw new IllegalArgumentException("Unhandled parameter types: " +
- Arrays.<Object>asList(it).toString());
- }
- }
-}
diff --git a/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/impl/diagram/editparts/NodeLabelEditPart.java b/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/impl/diagram/editparts/NodeLabelEditPart.java
deleted file mode 100644
index 34f9c476455..00000000000
--- a/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/impl/diagram/editparts/NodeLabelEditPart.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/**
- * Copyright (c) 2006, 2009, 2013 Borland Software Corporation and others
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Dmitry Stadnik (Borland) - initial API and implementation
- * Alexander Shatalin (Borland) - initial API and implementation
- * Michael Golubev (Montages) - #386838 - migrate to Xtend2
- * Thibault Landre (Atos Origin) - initial API and implementation
- */
-package aspects.impl.diagram.editparts;
-
-import com.google.inject.Inject;
-import com.google.inject.Singleton;
-import org.eclipse.gmf.codegen.gmfgen.GenNode;
-import org.eclipse.gmf.codegen.gmfgen.GenNodeLabel;
-import org.eclipse.xtend2.lib.StringConcatenation;
-import org.eclipse.xtext.xbase.lib.Extension;
-import xpt.diagram.editparts.Common;
-import xpt.diagram.editparts.Utils_qvto;
-
-@Singleton
-@SuppressWarnings("all")
-public class NodeLabelEditPart extends impl.diagram.editparts.NodeLabelEditPart {
- @Inject
- @Extension
- private Utils_qvto _utils_qvto;
-
- @Inject
- private Common xptEditpartsCommon;
-
- public CharSequence handleNotificationEventBody(final GenNodeLabel it) {
- StringConcatenation _builder = new StringConcatenation();
- _builder.append("Object feature = event.getFeature();");
- _builder.newLine();
- {
- GenNode _node = it.getNode();
- boolean _isStoringChildPositions = this._utils_qvto.isStoringChildPositions(_node);
- if (_isStoringChildPositions) {
- CharSequence _handleBounds = this.xptEditpartsCommon.handleBounds(it);
- _builder.append(_handleBounds, "");
- _builder.newLineIfNotEmpty();
- }
- }
- CharSequence _handleText = this.xptEditpartsCommon.handleText(it);
- _builder.append(_handleText, "");
- _builder.newLineIfNotEmpty();
- {
- boolean _isElementIcon = it.isElementIcon();
- if (_isElementIcon) {
- _builder.append("if(event.getNewValue() instanceof org.eclipse.emf.ecore.EAnnotation && org.eclipse.papyrus.infra.emf.appearance.helper.VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((org.eclipse.emf.ecore.EAnnotation)event.getNewValue()).getSource())){\t");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("refreshLabel();");
- _builder.newLine();
- _builder.append("}");
- _builder.newLine();
- }
- }
- _builder.append("\t\t");
- _builder.append("super.handleNotificationEvent(event);");
- _builder.newLine();
- return _builder;
- }
-}
diff --git a/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/impl/diagram/editparts/TextAware.java b/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/impl/diagram/editparts/TextAware.java
deleted file mode 100644
index 4d98aa5cd31..00000000000
--- a/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/impl/diagram/editparts/TextAware.java
+++ /dev/null
@@ -1,2054 +0,0 @@
-/**
- * Copyright (c) 2006-2013 Borland Software Corporation and others
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Dmitry Stadnik (Borland) - initial API and implementation
- * Alexander Shatalin (Borland) - initial API and implementation
- * Michael Golubev (Montages) - #386838 - migrate to Xtend2
- */
-package aspects.impl.diagram.editparts;
-
-import com.google.common.base.Objects;
-import com.google.inject.Inject;
-import com.google.inject.Singleton;
-import org.eclipse.gmf.codegen.gmfgen.DesignLabelModelFacet;
-import org.eclipse.gmf.codegen.gmfgen.GenCommonBase;
-import org.eclipse.gmf.codegen.gmfgen.GenDiagram;
-import org.eclipse.gmf.codegen.gmfgen.GenLinkLabel;
-import org.eclipse.gmf.codegen.gmfgen.LabelModelFacet;
-import org.eclipse.gmf.codegen.gmfgen.ParentAssignedViewmap;
-import org.eclipse.gmf.codegen.gmfgen.Viewmap;
-import org.eclipse.xtend2.lib.StringConcatenation;
-import org.eclipse.xtext.xbase.lib.Extension;
-import parsers.ParserProvider;
-import xpt.CodeStyle;
-import xpt.Common;
-import xpt.Common_qvto;
-import xpt.diagram.ViewmapAttributesUtils_qvto;
-
-@Singleton
-@SuppressWarnings("all")
-public class TextAware extends impl.diagram.editparts.TextAware {
- @Inject
- @Extension
- private Common _common;
-
- @Inject
- @Extension
- private CodeStyle _codeStyle;
-
- @Inject
- @Extension
- private ViewmapAttributesUtils_qvto _viewmapAttributesUtils_qvto;
-
- @Inject
- @Extension
- private ParserProvider _parserProvider;
-
- @Inject
- @Extension
- private Common_qvto _common_qvto;
-
- public CharSequence fields(final GenCommonBase it) {
- StringConcatenation _builder = new StringConcatenation();
- CharSequence _generatedMemberComment = this._common.generatedMemberComment();
- _builder.append(_generatedMemberComment, "");
- _builder.newLineIfNotEmpty();
- _builder.append("private org.eclipse.gef.tools.DirectEditManager manager;");
- _builder.newLine();
- _builder.newLine();
- CharSequence _generatedMemberComment_1 = this._common.generatedMemberComment();
- _builder.append(_generatedMemberComment_1, "");
- _builder.newLineIfNotEmpty();
- _builder.append("private org.eclipse.gmf.runtime.common.ui.services.parser.IParser parser;");
- _builder.newLine();
- _builder.newLine();
- CharSequence _generatedMemberComment_2 = this._common.generatedMemberComment();
- _builder.append(_generatedMemberComment_2, "");
- _builder.newLineIfNotEmpty();
- _builder.append("private java.util.List<?> parserElements;");
- _builder.newLine();
- _builder.newLine();
- CharSequence _generatedMemberComment_3 = this._common.generatedMemberComment();
- _builder.append(_generatedMemberComment_3, "");
- _builder.newLineIfNotEmpty();
- _builder.append("private String defaultText;");
- _builder.newLine();
- _builder.newLine();
- _builder.append("\t\t");
- CharSequence _generatedMemberComment_4 = this._common.generatedMemberComment("direct edition mode (default, undefined, registered editor, etc.)");
- _builder.append(_generatedMemberComment_4, "\t\t");
- _builder.newLineIfNotEmpty();
- _builder.append("protected int directEditionMode = org.eclipse.papyrus.uml.diagram.common.editpolicies.IDirectEdition.UNDEFINED_DIRECT_EDITOR;");
- _builder.newLine();
- _builder.newLine();
- CharSequence _generatedMemberComment_5 = this._common.generatedMemberComment("configuration from a registered edit dialog");
- _builder.append(_generatedMemberComment_5, "");
- _builder.newLineIfNotEmpty();
- _builder.append("protected org.eclipse.papyrus.extensionpoints.editors.configuration.IDirectEditorConfiguration configuration;");
- _builder.newLine();
- _builder.append("\t");
- _builder.newLine();
- return _builder;
- }
-
- public CharSequence methods(final GenCommonBase it, final boolean needsRefreshBounds, final boolean readOnly, final boolean useElementIcon, final Viewmap viewmap, final LabelModelFacet modelFacet, final GenCommonBase host, final GenDiagram diagram) {
- StringConcatenation _builder = new StringConcatenation();
- _builder.append("\t");
- _builder.newLine();
- CharSequence _labelTextHelper = this.getLabelTextHelper(it);
- _builder.append(_labelTextHelper, "");
- _builder.newLineIfNotEmpty();
- _builder.newLine();
- CharSequence _setLabelTextHelper = this.setLabelTextHelper(it);
- _builder.append(_setLabelTextHelper, "");
- _builder.newLineIfNotEmpty();
- _builder.newLine();
- CharSequence _labelIconHelper = this.getLabelIconHelper(it);
- _builder.append(_labelIconHelper, "");
- _builder.newLineIfNotEmpty();
- _builder.newLine();
- CharSequence _setLabelIconHelper = this.setLabelIconHelper(it);
- _builder.append(_setLabelIconHelper, "");
- _builder.newLineIfNotEmpty();
- _builder.newLine();
- CharSequence _labelSetter = this.labelSetter(it);
- _builder.append(_labelSetter, "");
- _builder.newLineIfNotEmpty();
- _builder.newLine();
- CharSequence _modelChildren = this.getModelChildren(it);
- _builder.append(_modelChildren, "");
- _builder.newLineIfNotEmpty();
- _builder.newLine();
- CharSequence _childBySemanticHint = this.getChildBySemanticHint(it);
- _builder.append(_childBySemanticHint, "");
- _builder.newLineIfNotEmpty();
- CharSequence _setParser = this.setParser(it);
- _builder.append(_setParser, "");
- _builder.newLineIfNotEmpty();
- CharSequence _parserElement = this.getParserElement(it, modelFacet);
- _builder.append(_parserElement, "");
- _builder.newLineIfNotEmpty();
- _builder.newLine();
- CharSequence _labelIcon = this.getLabelIcon(it, useElementIcon, diagram);
- _builder.append(_labelIcon, "");
- _builder.newLineIfNotEmpty();
- _builder.newLine();
- CharSequence _labelText = this.getLabelText(it);
- _builder.append(_labelText, "");
- _builder.newLineIfNotEmpty();
- _builder.newLine();
- CharSequence _setLabelText = this.setLabelText(it, diagram);
- _builder.append(_setLabelText, "");
- _builder.newLineIfNotEmpty();
- _builder.newLine();
- CharSequence _editText = this.getEditText(it);
- _builder.append(_editText, "");
- _builder.newLineIfNotEmpty();
- _builder.newLine();
- CharSequence _isEditable = this.isEditable(it, readOnly);
- _builder.append(_isEditable, "");
- _builder.newLineIfNotEmpty();
- _builder.newLine();
- CharSequence _editTextValidator = this.getEditTextValidator(it);
- _builder.append(_editTextValidator, "");
- _builder.newLineIfNotEmpty();
- _builder.newLine();
- CharSequence _completionProcessor = this.getCompletionProcessor(it);
- _builder.append(_completionProcessor, "");
- _builder.newLineIfNotEmpty();
- _builder.newLine();
- CharSequence _parserOptions = this.getParserOptions(it);
- _builder.append(_parserOptions, "");
- _builder.newLineIfNotEmpty();
- _builder.newLine();
- CharSequence _parser = this.getParser(it, modelFacet, diagram, host);
- _builder.append(_parser, "");
- _builder.newLineIfNotEmpty();
- _builder.newLine();
- CharSequence _manager = this.getManager(it, diagram);
- _builder.append(_manager, "");
- _builder.newLineIfNotEmpty();
- _builder.newLine();
- CharSequence _setManager = this.setManager(it);
- _builder.append(_setManager, "");
- _builder.newLineIfNotEmpty();
- _builder.newLine();
- CharSequence _performDirectEdit = this.performDirectEdit(it);
- _builder.append(_performDirectEdit, "");
- _builder.newLineIfNotEmpty();
- _builder.newLine();
- CharSequence _performDirectEditAtPoint = this.performDirectEditAtPoint(it);
- _builder.append(_performDirectEditAtPoint, "");
- _builder.newLineIfNotEmpty();
- _builder.newLine();
- CharSequence _performDirectEditWithInitialChar = this.performDirectEditWithInitialChar(it);
- _builder.append(_performDirectEditWithInitialChar, "");
- _builder.newLineIfNotEmpty();
- _builder.newLine();
- CharSequence _performDirectEditRequest = this.performDirectEditRequest(it, diagram);
- _builder.append(_performDirectEditRequest, "");
- _builder.newLineIfNotEmpty();
- _builder.newLine();
- CharSequence _initializeDirectEditManager = this.initializeDirectEditManager(it);
- _builder.append(_initializeDirectEditManager, "");
- _builder.newLineIfNotEmpty();
- _builder.newLine();
- CharSequence _refreshVisuals = this.refreshVisuals(it, needsRefreshBounds);
- _builder.append(_refreshVisuals, "");
- _builder.newLineIfNotEmpty();
- _builder.newLine();
- CharSequence _refreshLabel = this.refreshLabel(it, diagram);
- _builder.append(_refreshLabel, "");
- _builder.newLineIfNotEmpty();
- _builder.newLine();
- CharSequence _refreshUnderline = this.refreshUnderline(it);
- _builder.append(_refreshUnderline, "");
- _builder.newLineIfNotEmpty();
- _builder.newLine();
- CharSequence _refreshStrikeThrough = this.refreshStrikeThrough(it);
- _builder.append(_refreshStrikeThrough, "");
- _builder.newLineIfNotEmpty();
- _builder.newLine();
- CharSequence _refreshFont = this.refreshFont(it);
- _builder.append(_refreshFont, "");
- _builder.newLineIfNotEmpty();
- _builder.newLine();
- CharSequence _setFontColor = this.setFontColor(it);
- _builder.append(_setFontColor, "");
- _builder.newLineIfNotEmpty();
- _builder.newLine();
- CharSequence _addSemanticListeners = this.addSemanticListeners(it);
- _builder.append(_addSemanticListeners, "");
- _builder.newLineIfNotEmpty();
- _builder.newLine();
- CharSequence _removeSemanticListeners = this.removeSemanticListeners(it);
- _builder.append(_removeSemanticListeners, "");
- _builder.newLineIfNotEmpty();
- _builder.newLine();
- CharSequence _accessibleEditPart = this.getAccessibleEditPart(it);
- _builder.append(_accessibleEditPart, "");
- _builder.newLineIfNotEmpty();
- _builder.newLine();
- CharSequence _fontStyleOwnerView = this.getFontStyleOwnerView(it, viewmap);
- _builder.append(_fontStyleOwnerView, "");
- _builder.newLineIfNotEmpty();
- _builder.newLine();
- _builder.append("\t\t");
- CharSequence _directEditionType = this.getDirectEditionType(it, Boolean.valueOf(readOnly));
- _builder.append(_directEditionType, "\t\t");
- _builder.newLineIfNotEmpty();
- _builder.newLine();
- CharSequence _checkExtendedEditor = this.checkExtendedEditor(it);
- _builder.append(_checkExtendedEditor, "");
- _builder.newLineIfNotEmpty();
- _builder.newLine();
- CharSequence _checkDefaultEdition = this.checkDefaultEdition(it);
- _builder.append(_checkDefaultEdition, "");
- _builder.newLineIfNotEmpty();
- _builder.newLine();
- CharSequence _initExtendedEditorConfiguration = this.initExtendedEditorConfiguration(it);
- _builder.append(_initExtendedEditorConfiguration, "");
- _builder.newLineIfNotEmpty();
- _builder.newLine();
- CharSequence _updateExtendedEditorConfiguration = this.updateExtendedEditorConfiguration(it);
- _builder.append(_updateExtendedEditorConfiguration, "");
- _builder.newLineIfNotEmpty();
- _builder.newLine();
- CharSequence _performDefaultDirectEditorEdit = this.performDefaultDirectEditorEdit(it);
- _builder.append(_performDefaultDirectEditorEdit, "");
- _builder.newLineIfNotEmpty();
- _builder.newLine();
- return _builder;
- }
-
- public CharSequence labelSetterName(final ParentAssignedViewmap it) {
- StringConcatenation _builder = new StringConcatenation();
- {
- String _setterName = it.getSetterName();
- boolean _notEquals = (!Objects.equal(_setterName, null));
- if (_notEquals) {
- String _setterName_1 = it.getSetterName();
- _builder.append(_setterName_1, "");
- } else {
- _builder.append("setLabel");
- }
- }
- _builder.newLineIfNotEmpty();
- return _builder;
- }
-
- public CharSequence labelSetterName(final Viewmap it) {
- StringConcatenation _builder = new StringConcatenation();
- _builder.append("setLabel");
- return _builder;
- }
-
- public CharSequence getLabelTextHelper(final GenCommonBase it) {
- StringConcatenation _builder = new StringConcatenation();
- CharSequence _generatedMemberComment = this._common.generatedMemberComment();
- _builder.append(_generatedMemberComment, "");
- _builder.newLineIfNotEmpty();
- _builder.append("protected String getLabelTextHelper(org.eclipse.draw2d.IFigure figure) {");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("if (figure instanceof org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel) {");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("return ((org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel) figure).getText();");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("} else if (figure instanceof org.eclipse.papyrus.uml.diagram.common.figure.node.ILabelFigure) {");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("return ((org.eclipse.papyrus.uml.diagram.common.figure.node.ILabelFigure) figure).getText();");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("} else {");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("return ((org.eclipse.draw2d.Label) figure).getText();");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("}");
- _builder.newLine();
- return _builder;
- }
-
- public CharSequence setLabelTextHelper(final GenCommonBase it) {
- StringConcatenation _builder = new StringConcatenation();
- CharSequence _generatedMemberComment = this._common.generatedMemberComment();
- _builder.append(_generatedMemberComment, "");
- _builder.newLineIfNotEmpty();
- _builder.append("protected void setLabelTextHelper(org.eclipse.draw2d.IFigure figure, String text) {");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("if (figure instanceof org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel) {");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("((org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel) figure).setText(text);");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("} else if (figure instanceof org.eclipse.papyrus.uml.diagram.common.figure.node.ILabelFigure) {");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("((org.eclipse.papyrus.uml.diagram.common.figure.node.ILabelFigure) figure).setText(text);");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("} else {");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("((org.eclipse.draw2d.Label) figure).setText(text);");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("}");
- _builder.newLine();
- return _builder;
- }
-
- public CharSequence getLabelIconHelper(final GenCommonBase it) {
- StringConcatenation _builder = new StringConcatenation();
- CharSequence _generatedMemberComment = this._common.generatedMemberComment();
- _builder.append(_generatedMemberComment, "");
- _builder.newLineIfNotEmpty();
- _builder.append("protected org.eclipse.swt.graphics.Image getLabelIconHelper(org.eclipse.draw2d.IFigure figure) {");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("if (figure instanceof org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel) {");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("return ((org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel) figure).getIcon();");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("} else if (figure instanceof org.eclipse.papyrus.uml.diagram.common.figure.node.ILabelFigure) {");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("return ((org.eclipse.papyrus.uml.diagram.common.figure.node.ILabelFigure) figure).getIcon();");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("} else {");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("return ((org.eclipse.draw2d.Label) figure).getIcon();");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("}");
- _builder.newLine();
- return _builder;
- }
-
- public CharSequence setLabelIconHelper(final GenCommonBase it) {
- StringConcatenation _builder = new StringConcatenation();
- CharSequence _generatedMemberComment = this._common.generatedMemberComment();
- _builder.append(_generatedMemberComment, "");
- _builder.newLineIfNotEmpty();
- _builder.append("protected void setLabelIconHelper(org.eclipse.draw2d.IFigure figure, org.eclipse.swt.graphics.Image icon) {");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("if (figure instanceof org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel) {");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("((org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel) figure).setIcon(icon);");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("} else if (figure instanceof org.eclipse.papyrus.uml.diagram.common.figure.node.ILabelFigure) {");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("((org.eclipse.papyrus.uml.diagram.common.figure.node.ILabelFigure) figure).setIcon(icon);");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("} else {");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("((org.eclipse.draw2d.Label) figure).setIcon(icon);");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("}");
- _builder.newLine();
- return _builder;
- }
-
- public CharSequence labelSetter(final GenCommonBase it) {
- StringConcatenation _builder = new StringConcatenation();
- CharSequence _generatedMemberComment = this._common.generatedMemberComment();
- _builder.append(_generatedMemberComment, "");
- _builder.newLineIfNotEmpty();
- _builder.append("public void ");
- Viewmap _viewmap = it.getViewmap();
- CharSequence _labelSetterName = this.labelSetterName(_viewmap);
- _builder.append(_labelSetterName, "");
- _builder.append("(");
- Viewmap _viewmap_1 = it.getViewmap();
- CharSequence _labelSetterFigureClassName = this.labelSetterFigureClassName(_viewmap_1);
- _builder.append(_labelSetterFigureClassName, "");
- _builder.append(" figure) {");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.append("unregisterVisuals();");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("setFigure(figure);");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("defaultText = getLabelTextHelper(figure);");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("registerVisuals();");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("refreshVisuals();");
- _builder.newLine();
- _builder.append("}");
- _builder.newLine();
- return _builder;
- }
-
- public CharSequence labelSetterFigureClassName(final ParentAssignedViewmap it) {
- StringConcatenation _builder = new StringConcatenation();
- {
- String _figureQualifiedClassName = it.getFigureQualifiedClassName();
- boolean _notEquals = (!Objects.equal(_figureQualifiedClassName, null));
- if (_notEquals) {
- String _figureQualifiedClassName_1 = it.getFigureQualifiedClassName();
- _builder.append(_figureQualifiedClassName_1, "");
- _builder.newLineIfNotEmpty();
- } else {
- _builder.append("org.eclipse.draw2d.IFigure");
- _builder.newLine();
- }
- }
- return _builder;
- }
-
- public CharSequence labelSetterFigureClassName(final Viewmap it) {
- StringConcatenation _builder = new StringConcatenation();
- _builder.append("org.eclipse.draw2d.IFigure");
- _builder.newLine();
- return _builder;
- }
-
- public CharSequence getModelChildren(final GenCommonBase it) {
- StringConcatenation _builder = new StringConcatenation();
- CharSequence _generatedMemberComment = this._common.generatedMemberComment();
- _builder.append(_generatedMemberComment, "");
- _builder.newLineIfNotEmpty();
- _builder.append("protected java.util.List<?> getModelChildren() {");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("return java.util.Collections.EMPTY_LIST;");
- _builder.newLine();
- _builder.append("}");
- _builder.newLine();
- return _builder;
- }
-
- public CharSequence getChildBySemanticHint(final GenCommonBase it) {
- StringConcatenation _builder = new StringConcatenation();
- CharSequence _generatedMemberComment = this._common.generatedMemberComment();
- _builder.append(_generatedMemberComment, "");
- _builder.newLineIfNotEmpty();
- _builder.append("public org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart getChildBySemanticHint(String semanticHint) {");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("return null;");
- _builder.newLine();
- _builder.append("}");
- _builder.newLine();
- return _builder;
- }
-
- public CharSequence setParser(final GenCommonBase it) {
- StringConcatenation _builder = new StringConcatenation();
- CharSequence _generatedMemberComment = this._common.generatedMemberComment();
- _builder.append(_generatedMemberComment, "");
- _builder.newLineIfNotEmpty();
- _builder.append("public void setParser(org.eclipse.gmf.runtime.common.ui.services.parser.IParser parser) {");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("this.parser = parser;");
- _builder.newLine();
- _builder.append("}");
- _builder.newLine();
- return _builder;
- }
-
- public CharSequence getParserElement(final GenCommonBase it, final LabelModelFacet modelFacet) {
- StringConcatenation _builder = new StringConcatenation();
- CharSequence _generatedMemberComment = this._common.generatedMemberComment();
- _builder.append(_generatedMemberComment, "");
- _builder.newLineIfNotEmpty();
- _builder.append("protected org.eclipse.emf.ecore.EObject getParserElement() {");
- _builder.newLine();
- {
- boolean _equals = Objects.equal(modelFacet, null);
- if (_equals) {
- _builder.append("org.eclipse.emf.ecore.EObject element = resolveSemanticElement();");
- _builder.newLine();
- _builder.append("return element != null ? element : (org.eclipse.gmf.runtime.notation.View) getModel();");
- _builder.newLine();
- _builder.append("\t");
- } else {
- CharSequence _parserElement = this.getParserElement(modelFacet);
- _builder.append(_parserElement, "");
- }
- }
- _builder.newLineIfNotEmpty();
- _builder.append("}");
- _builder.newLine();
- return _builder;
- }
-
- public CharSequence getParserElement(final LabelModelFacet it) {
- StringConcatenation _builder = new StringConcatenation();
- _builder.append("return resolveSemanticElement();");
- _builder.newLine();
- return _builder;
- }
-
- public CharSequence getParserElement(final DesignLabelModelFacet it) {
- StringConcatenation _builder = new StringConcatenation();
- _builder.append("return (org.eclipse.gmf.runtime.notation.View) getModel();");
- _builder.newLine();
- return _builder;
- }
-
- public CharSequence getLabelIcon(final GenCommonBase it, final boolean useElementIcon, final GenDiagram diagram) {
- StringConcatenation _builder = new StringConcatenation();
- CharSequence _generatedMemberComment = this._common.generatedMemberComment();
- _builder.append(_generatedMemberComment, "");
- _builder.newLineIfNotEmpty();
- _builder.append("protected org.eclipse.swt.graphics.Image getLabelIcon() {");
- _builder.newLine();
- {
- if (useElementIcon) {
- _builder.append("\t");
- _builder.append("org.eclipse.emf.ecore.EObject parserElement = getParserElement();");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("if (parserElement == null) {");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("\t");
- _builder.append("return null;");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("\t");
- _builder.append("java.util.List<org.eclipse.gmf.runtime.notation.View> views = org.eclipse.papyrus.uml.diagram.common.util.DiagramEditPartsUtil.findViews(parserElement, getViewer());");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("for (org.eclipse.gmf.runtime.notation.View view : views) {");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("\t");
- _builder.append("if (org.eclipse.papyrus.infra.emf.appearance.helper.AppearanceHelper.showElementIcon(view)) {");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("\t\t");
- _builder.append("return ");
- String _elementTypesQualifiedClassName = diagram.getElementTypesQualifiedClassName();
- _builder.append(_elementTypesQualifiedClassName, "\t\t\t");
- _builder.append(".getImage(parserElement.eClass());");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("return null;");
- _builder.newLine();
- } else {
- _builder.append("\t");
- _builder.append("return null;");
- _builder.newLine();
- }
- }
- _builder.append("}");
- _builder.newLine();
- return _builder;
- }
-
- public CharSequence getLabelText(final GenCommonBase it) {
- StringConcatenation _builder = new StringConcatenation();
- CharSequence _generatedMemberComment = this._common.generatedMemberComment();
- _builder.append(_generatedMemberComment, "");
- _builder.newLineIfNotEmpty();
- _builder.append("protected String getLabelText() {");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("String text = null;");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("org.eclipse.emf.ecore.EObject parserElement = getParserElement();");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("if (parserElement != null && getParser() != null) {");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("text = getParser().getPrintString(");
- _builder.newLine();
- _builder.append("\t\t\t");
- _builder.append("new org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter(parserElement),");
- _builder.newLine();
- _builder.append("\t\t\t");
- _builder.append("getParserOptions().intValue());");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("if (text == null || text.length() == 0) {");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("text = defaultText;");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("return text;");
- _builder.newLine();
- _builder.append("}");
- _builder.newLine();
- return _builder;
- }
-
- public CharSequence setLabelText(final GenCommonBase it, final GenDiagram diagram) {
- StringConcatenation _builder = new StringConcatenation();
- CharSequence _generatedMemberComment = this._common.generatedMemberComment();
- _builder.append(_generatedMemberComment, "");
- _builder.newLineIfNotEmpty();
- _builder.append("public void setLabelText(String text) {");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("setLabelTextHelper(getFigure(), text);");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("Object pdEditPolicy = getEditPolicy(org.eclipse.gef.EditPolicy.PRIMARY_DRAG_ROLE);");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("if (pdEditPolicy instanceof ");
- String _textSelectionEditPolicyQualifiedClassName = diagram.getTextSelectionEditPolicyQualifiedClassName();
- _builder.append(_textSelectionEditPolicyQualifiedClassName, "\t");
- _builder.append(") {");
- _builder.newLineIfNotEmpty();
- _builder.append("\t\t");
- _builder.append("((");
- String _textSelectionEditPolicyQualifiedClassName_1 = diagram.getTextSelectionEditPolicyQualifiedClassName();
- _builder.append(_textSelectionEditPolicyQualifiedClassName_1, "\t\t");
- _builder.append(") pdEditPolicy).refreshFeedback();");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("Object sfEditPolicy = getEditPolicy(org.eclipse.gef.EditPolicy.SELECTION_FEEDBACK_ROLE);");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("if (sfEditPolicy instanceof ");
- String _textSelectionEditPolicyQualifiedClassName_2 = diagram.getTextSelectionEditPolicyQualifiedClassName();
- _builder.append(_textSelectionEditPolicyQualifiedClassName_2, "\t");
- _builder.append(") {");
- _builder.newLineIfNotEmpty();
- _builder.append("\t\t");
- _builder.append("((");
- String _textSelectionEditPolicyQualifiedClassName_3 = diagram.getTextSelectionEditPolicyQualifiedClassName();
- _builder.append(_textSelectionEditPolicyQualifiedClassName_3, "\t\t");
- _builder.append(") sfEditPolicy).refreshFeedback();");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("}");
- _builder.newLine();
- return _builder;
- }
-
- public CharSequence getEditText(final GenCommonBase it) {
- StringConcatenation _builder = new StringConcatenation();
- CharSequence _generatedMemberComment = this._common.generatedMemberComment();
- _builder.append(_generatedMemberComment, "");
- _builder.newLineIfNotEmpty();
- _builder.append("public String getEditText() {");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("if (getParserElement() == null || getParser() == null) {");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("return \"\"; ");
- CharSequence _nonNLS = this._common.nonNLS();
- _builder.append(_nonNLS, "\t\t");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("return getParser().getEditString(");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("new org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter(getParserElement()),");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("getParserOptions().intValue());");
- _builder.newLine();
- _builder.append("}");
- _builder.newLine();
- return _builder;
- }
-
- public CharSequence isEditable(final GenCommonBase it, final boolean readOnly) {
- StringConcatenation _builder = new StringConcatenation();
- CharSequence _generatedMemberComment = this._common.generatedMemberComment();
- _builder.append(_generatedMemberComment, "");
- _builder.newLineIfNotEmpty();
- _builder.append("protected boolean isEditable() {");
- _builder.newLine();
- {
- if (readOnly) {
- _builder.append("\t");
- _builder.append("return false;");
- _builder.newLine();
- } else {
- _builder.append("\t");
- _builder.append("return getParser() != null;");
- _builder.newLine();
- }
- }
- _builder.append("}");
- _builder.newLine();
- return _builder;
- }
-
- public CharSequence getEditTextValidator(final GenCommonBase it) {
- StringConcatenation _builder = new StringConcatenation();
- CharSequence _generatedMemberComment = this._common.generatedMemberComment();
- _builder.append(_generatedMemberComment, "");
- _builder.newLineIfNotEmpty();
- _builder.append("public org.eclipse.jface.viewers.ICellEditorValidator getEditTextValidator() {");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("return new org.eclipse.jface.viewers.ICellEditorValidator() {");
- _builder.newLine();
- _builder.newLine();
- _builder.append("\t\t");
- CharSequence _overrideI = this._codeStyle.overrideI(it);
- _builder.append(_overrideI, "\t\t");
- _builder.newLineIfNotEmpty();
- _builder.append("\t\t");
- _builder.append("public String isValid(final Object value) {");
- _builder.newLine();
- _builder.append("\t\t\t");
- _builder.append("if (value instanceof String) {");
- _builder.newLine();
- _builder.append("\t\t\t\t");
- _builder.append("final org.eclipse.emf.ecore.EObject element = getParserElement();");
- _builder.newLine();
- _builder.append("\t\t\t\t");
- _builder.append("final org.eclipse.gmf.runtime.common.ui.services.parser.IParser parser = getParser();");
- _builder.newLine();
- _builder.append("\t\t\t\t");
- _builder.append("try {");
- _builder.newLine();
- _builder.append("\t\t\t\t\t");
- _builder.append("org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus valid =");
- _builder.newLine();
- _builder.append("\t\t\t\t\t\t");
- _builder.append("(org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus) getEditingDomain().runExclusive(");
- _builder.newLine();
- _builder.append("\t\t\t\t\t\t\t");
- _builder.append("new org.eclipse.emf.transaction.RunnableWithResult.Impl<java.lang.Object>() {");
- _builder.newLine();
- _builder.newLine();
- _builder.append("\t\t\t\t\t\t");
- CharSequence _overrideI_1 = this._codeStyle.overrideI(it);
- _builder.append(_overrideI_1, "\t\t\t\t\t\t");
- _builder.newLineIfNotEmpty();
- _builder.append("\t\t\t\t\t\t");
- _builder.append("public void run() {");
- _builder.newLine();
- _builder.append("\t\t\t\t\t\t\t");
- _builder.append("setResult(parser.isValidEditString(new org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter(element), (String) value));");
- _builder.newLine();
- _builder.append("\t\t\t\t\t\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t\t\t\t\t");
- _builder.append("});");
- _builder.newLine();
- _builder.append("\t\t\t\t\t");
- _builder.append("return valid.getCode() == org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus.EDITABLE ? null : valid.getMessage();");
- _builder.newLine();
- _builder.append("\t\t\t\t");
- _builder.append("} catch (InterruptedException ie) {");
- _builder.newLine();
- _builder.append("\t\t\t\t\t");
- _builder.append("ie.printStackTrace();");
- _builder.newLine();
- _builder.append("\t\t\t\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t\t\t");
- _builder.append("}");
- _builder.newLine();
- _builder.newLine();
- _builder.append("\t\t\t");
- _builder.append("// shouldn\'t get here");
- _builder.newLine();
- _builder.append("\t\t\t");
- _builder.append("return null;");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("};");
- _builder.newLine();
- _builder.append("}");
- _builder.newLine();
- return _builder;
- }
-
- public CharSequence getCompletionProcessor(final GenCommonBase it) {
- StringConcatenation _builder = new StringConcatenation();
- CharSequence _generatedMemberComment = this._common.generatedMemberComment();
- _builder.append(_generatedMemberComment, "");
- _builder.newLineIfNotEmpty();
- _builder.append("public org.eclipse.jface.text.contentassist.IContentAssistProcessor getCompletionProcessor() {");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("if (getParserElement() == null || getParser() == null) {");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("return null;");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("return getParser().getCompletionProcessor(new org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter(getParserElement()));");
- _builder.newLine();
- _builder.append("}");
- _builder.newLine();
- return _builder;
- }
-
- public CharSequence getParserOptions(final GenCommonBase it) {
- StringConcatenation _builder = new StringConcatenation();
- CharSequence _generatedMemberComment = this._common.generatedMemberComment();
- _builder.append(_generatedMemberComment, "");
- _builder.newLineIfNotEmpty();
- _builder.append("public org.eclipse.gmf.runtime.common.ui.services.parser.ParserOptions getParserOptions() {");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("return org.eclipse.gmf.runtime.common.ui.services.parser.ParserOptions.NONE;");
- _builder.newLine();
- _builder.append("}");
- _builder.newLine();
- return _builder;
- }
-
- public CharSequence getParser(final GenCommonBase it, final LabelModelFacet modelFacet, final GenDiagram diagram, final GenCommonBase host) {
- StringConcatenation _builder = new StringConcatenation();
- CharSequence _generatedMemberComment = this._common.generatedMemberComment();
- _builder.append(_generatedMemberComment, "");
- _builder.newLineIfNotEmpty();
- _builder.append("public org.eclipse.gmf.runtime.common.ui.services.parser.IParser getParser() {");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("if (parser == null) {");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("parser = ");
- CharSequence _accessorCall = this._parserProvider.accessorCall(it, host, modelFacet, "getParserElement()");
- _builder.append(_accessorCall, "\t\t");
- _builder.append(";");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("return parser;");
- _builder.newLine();
- _builder.append("}");
- _builder.newLine();
- return _builder;
- }
-
- public CharSequence getManager(final GenCommonBase it, final GenDiagram diagram) {
- StringConcatenation _builder = new StringConcatenation();
- CharSequence _generatedMemberComment = this._common.generatedMemberComment();
- _builder.append(_generatedMemberComment, "");
- _builder.newLineIfNotEmpty();
- _builder.append("protected org.eclipse.gef.tools.DirectEditManager getManager() {");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("if (manager == null) {");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("setManager(new org.eclipse.papyrus.uml.diagram.common.directedit.MultilineLabelDirectEditManager(this,");
- _builder.newLine();
- _builder.append("\t\t\t");
- _builder.append("org.eclipse.papyrus.uml.diagram.common.directedit.MultilineLabelDirectEditManager.getTextCellEditorClass(this),");
- _builder.newLine();
- _builder.append("\t\t\t");
- String _editPartFactoryQualifiedClassName = diagram.getEditPartFactoryQualifiedClassName();
- _builder.append(_editPartFactoryQualifiedClassName, "\t\t\t");
- _builder.append(".getTextCellEditorLocator(this)));");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("return manager;");
- _builder.newLine();
- _builder.append("}");
- _builder.newLine();
- return _builder;
- }
-
- public CharSequence setManager(final GenCommonBase it) {
- StringConcatenation _builder = new StringConcatenation();
- CharSequence _generatedMemberComment = this._common.generatedMemberComment();
- _builder.append(_generatedMemberComment, "");
- _builder.newLineIfNotEmpty();
- _builder.append("protected void setManager(org.eclipse.gef.tools.DirectEditManager manager) {");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("this.manager = manager;");
- _builder.newLine();
- _builder.append("}");
- _builder.newLine();
- return _builder;
- }
-
- public CharSequence performDirectEdit(final GenCommonBase it) {
- StringConcatenation _builder = new StringConcatenation();
- CharSequence _generatedMemberComment = this._common.generatedMemberComment();
- _builder.append(_generatedMemberComment, "");
- _builder.newLineIfNotEmpty();
- _builder.append("protected void performDirectEdit() {");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("org.eclipse.swt.custom.BusyIndicator.showWhile(org.eclipse.swt.widgets.Display.getDefault(), new java.lang.Runnable() {");
- _builder.newLine();
- _builder.append("\t\t\t\t");
- _builder.newLine();
- _builder.append("\t\t");
- CharSequence _overrideI = this._codeStyle.overrideI(it);
- _builder.append(_overrideI, "\t\t");
- _builder.newLineIfNotEmpty();
- _builder.append("\t\t");
- _builder.append("public void run() {");
- _builder.newLine();
- _builder.append("\t\t\t");
- _builder.append("getManager().show();");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("});");
- _builder.newLine();
- _builder.append("}");
- _builder.newLine();
- return _builder;
- }
-
- public CharSequence performDirectEditAtPoint(final GenCommonBase it) {
- StringConcatenation _builder = new StringConcatenation();
- CharSequence _generatedMemberComment = this._common.generatedMemberComment();
- _builder.append(_generatedMemberComment, "");
- _builder.newLineIfNotEmpty();
- _builder.append("protected void performDirectEdit(org.eclipse.draw2d.geometry.Point eventLocation) {");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("if (getManager() instanceof org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager) {");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("((org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("}");
- _builder.newLine();
- return _builder;
- }
-
- public CharSequence performDirectEditWithInitialChar(final GenCommonBase it) {
- StringConcatenation _builder = new StringConcatenation();
- CharSequence _generatedMemberComment = this._common.generatedMemberComment();
- _builder.append(_generatedMemberComment, "");
- _builder.newLineIfNotEmpty();
- _builder.append("private void performDirectEdit(char initialCharacter) {");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("if (getManager() instanceof org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager) {");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("((org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager) getManager()).show(initialCharacter);");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("} else {");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("performDirectEdit();");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("}");
- _builder.newLine();
- return _builder;
- }
-
- public CharSequence performDirectEditRequest(final GenCommonBase it, final GenDiagram diagram) {
- StringConcatenation _builder = new StringConcatenation();
- CharSequence _generatedMemberComment = this._common.generatedMemberComment();
- _builder.append(_generatedMemberComment, "");
- _builder.newLineIfNotEmpty();
- _builder.append("protected void performDirectEditRequest(org.eclipse.gef.Request request) {");
- _builder.newLine();
- _builder.append("\t");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("final org.eclipse.gef.Request theRequest = request;");
- _builder.newLine();
- _builder.newLine();
- _builder.append("\t");
- _builder.append("if (org.eclipse.papyrus.uml.diagram.common.editpolicies.IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("directEditionMode = getDirectEditionType();");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("switch (directEditionMode) {");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("case org.eclipse.papyrus.uml.diagram.common.editpolicies.IDirectEdition.NO_DIRECT_EDITION:");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("// no direct edition mode => does nothing");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("return;");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("case org.eclipse.papyrus.uml.diagram.common.editpolicies.IDirectEdition.EXTENDED_DIRECT_EDITOR:");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("updateExtendedEditorConfiguration();");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("if (configuration == null || configuration.getLanguage() == null) {");
- _builder.newLine();
- _builder.append("\t\t\t");
- _builder.append("// Create default edit manager");
- _builder.newLine();
- _builder.append("\t\t\t");
- _builder.append("setManager(new org.eclipse.papyrus.uml.diagram.common.directedit.MultilineLabelDirectEditManager(this,");
- _builder.newLine();
- _builder.append("\t\t\t");
- _builder.append("org.eclipse.papyrus.uml.diagram.common.directedit.MultilineLabelDirectEditManager.getTextCellEditorClass(this),");
- _builder.newLine();
- _builder.append("\t\t\t");
- String _editPartFactoryQualifiedClassName = diagram.getEditPartFactoryQualifiedClassName();
- _builder.append(_editPartFactoryQualifiedClassName, "\t\t\t");
- _builder.append(".getTextCellEditorLocator(this)));");
- _builder.newLineIfNotEmpty();
- _builder.append("\t\t\t");
- _builder.append("performDefaultDirectEditorEdit(theRequest);");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("} else {");
- _builder.newLine();
- _builder.append("\t\t\t");
- _builder.append("configuration.preEditAction(resolveSemanticElement());");
- _builder.newLine();
- _builder.append("\t\t\t");
- _builder.append("org.eclipse.jface.dialogs.Dialog dialog = null;");
- _builder.newLine();
- _builder.append("\t\t\t");
- _builder.append("if (configuration instanceof org.eclipse.papyrus.extensionpoints.editors.configuration.ICustomDirectEditorConfiguration) {");
- _builder.newLine();
- _builder.append("\t\t\t\t");
- _builder.append("setManager(((org.eclipse.papyrus.extensionpoints.editors.configuration.ICustomDirectEditorConfiguration) configuration).createDirectEditManager(this));");
- _builder.newLine();
- _builder.append("\t\t\t\t");
- _builder.append("initializeDirectEditManager(theRequest);");
- _builder.newLine();
- _builder.append("\t\t\t\t");
- _builder.append("return;");
- _builder.newLine();
- _builder.append("\t\t\t");
- _builder.append("} else if (configuration instanceof org.eclipse.papyrus.extensionpoints.editors.configuration.IPopupEditorConfiguration) {");
- _builder.newLine();
- _builder.append("\t\t\t\t");
- _builder.append("org.eclipse.papyrus.extensionpoints.editors.ui.IPopupEditorHelper helper = ((org.eclipse.papyrus.extensionpoints.editors.configuration.IPopupEditorConfiguration)configuration).createPopupEditorHelper(this) ;");
- _builder.newLine();
- _builder.append("\t\t\t\t");
- _builder.append("helper.showEditor() ;");
- _builder.newLine();
- _builder.append("\t\t\t\t");
- _builder.append("return ;");
- _builder.newLine();
- _builder.append("\t\t\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t\t\t");
- _builder.append("else if(configuration instanceof org.eclipse.papyrus.extensionpoints.editors.configuration.IAdvancedEditorConfiguration) {");
- _builder.newLine();
- _builder.append("\t\t\t\t");
- _builder.append("dialog = ((org.eclipse.papyrus.extensionpoints.editors.configuration.IAdvancedEditorConfiguration)configuration).createDialog(org.eclipse.ui.PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));");
- _builder.newLine();
- _builder.append("\t\t\t");
- _builder.append("} else if(configuration instanceof org.eclipse.papyrus.extensionpoints.editors.configuration.IDirectEditorConfiguration) {");
- _builder.newLine();
- _builder.append("\t\t\t\t");
- _builder.append("dialog = new org.eclipse.papyrus.extensionpoints.editors.ui.ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);");
- _builder.newLine();
- _builder.append("\t\t\t");
- _builder.append("} else {");
- _builder.newLine();
- _builder.append("\t\t\t\t");
- _builder.append("return;");
- _builder.newLine();
- _builder.append("\t\t\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t\t\t");
- _builder.append("final org.eclipse.jface.dialogs.Dialog finalDialog = dialog;");
- _builder.newLine();
- _builder.append("\t\t\t");
- _builder.newLine();
- _builder.append("\t\t\t");
- _builder.append("if (org.eclipse.jface.window.Window.OK == dialog.open()) {");
- _builder.newLine();
- _builder.append("\t\t\t\t");
- _builder.append("org.eclipse.emf.transaction.TransactionalEditingDomain domain = getEditingDomain();");
- _builder.newLine();
- _builder.append("\t\t\t\t");
- _builder.append("org.eclipse.emf.transaction.RecordingCommand command = new org.eclipse.emf.transaction.RecordingCommand(domain, \"Edit Label\") {");
- _builder.newLine();
- _builder.append("\t");
- _builder.newLine();
- _builder.append("\t\t\t\t\t");
- _builder.append("@Override");
- _builder.newLine();
- _builder.append("\t\t\t\t\t");
- _builder.append("protected void doExecute() {");
- _builder.newLine();
- _builder.append("\t\t\t\t\t\t");
- _builder.append("configuration.postEditAction(resolveSemanticElement(), ((org.eclipse.papyrus.extensionpoints.editors.ui.ILabelEditorDialog)finalDialog).getValue());");
- _builder.newLine();
- _builder.append("\t");
- _builder.newLine();
- _builder.append("\t\t\t\t\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t\t\t\t");
- _builder.append("};");
- _builder.newLine();
- _builder.append("\t\t\t\t");
- _builder.append("domain.getCommandStack().execute(command);");
- _builder.newLine();
- _builder.append("\t\t\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("break;");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("case org.eclipse.papyrus.uml.diagram.common.editpolicies.IDirectEdition.DEFAULT_DIRECT_EDITOR:");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("initializeDirectEditManager(theRequest);");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("break;");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("default:");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("break;");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("}");
- _builder.newLine();
- return _builder;
- }
-
- public CharSequence initializeDirectEditManager(final GenCommonBase it) {
- StringConcatenation _builder = new StringConcatenation();
- CharSequence _generatedMemberComment = this._common.generatedMemberComment();
- _builder.append(_generatedMemberComment, "");
- _builder.newLineIfNotEmpty();
- _builder.append("protected void initializeDirectEditManager(final org.eclipse.gef.Request request) {");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("// initialize the direct edit manager");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("try {");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("getEditingDomain().runExclusive(new Runnable() {");
- _builder.newLine();
- _builder.append("\t\t\t");
- CharSequence _overrideI = this._codeStyle.overrideI(it);
- _builder.append(_overrideI, "\t\t\t");
- _builder.newLineIfNotEmpty();
- _builder.append("\t\t\t");
- _builder.append("public void run() {");
- _builder.newLine();
- _builder.append("\t\t\t\t");
- _builder.append("if (isActive() && isEditable()) {");
- _builder.newLine();
- _builder.append("\t\t\t\t\t");
- _builder.append("if (request.getExtendedData().get(");
- _builder.newLine();
- _builder.append("\t\t\t\t\t\t");
- _builder.append("org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {");
- _builder.newLine();
- _builder.append("\t\t\t\t\t\t");
- _builder.append("Character initialChar = (Character) request.getExtendedData().get(org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);");
- _builder.newLine();
- _builder.append("\t\t\t\t\t\t");
- _builder.append("performDirectEdit(initialChar.charValue());");
- _builder.newLine();
- _builder.append("\t\t\t\t\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t\t\t\t\t");
- _builder.append("else {");
- _builder.newLine();
- _builder.append("\t\t\t\t\t\t");
- _builder.append("performDirectEdit();");
- _builder.newLine();
- _builder.append("\t\t\t\t\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t\t\t\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t\t\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("});");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("} catch (InterruptedException e) {");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("e.printStackTrace();");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("}");
- _builder.newLine();
- return _builder;
- }
-
- public CharSequence refreshVisuals(final GenCommonBase it, final boolean needsRefreshBounds) {
- StringConcatenation _builder = new StringConcatenation();
- CharSequence _generatedMemberComment = this._common.generatedMemberComment();
- _builder.append(_generatedMemberComment, "");
- _builder.newLineIfNotEmpty();
- _builder.append("protected void refreshVisuals() {");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("super.refreshVisuals();");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("refreshLabel();");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("refreshFont();");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("refreshFontColor();");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("refreshUnderline();");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("refreshStrikeThrough();");
- _builder.newLine();
- {
- if (needsRefreshBounds) {
- _builder.append("\t");
- _builder.append("refreshBounds();");
- _builder.newLine();
- }
- }
- _builder.append("}");
- _builder.newLine();
- return _builder;
- }
-
- public CharSequence refreshLabel(final GenCommonBase it, final GenDiagram diagram) {
- StringConcatenation _builder = new StringConcatenation();
- CharSequence _generatedMemberComment = this._common.generatedMemberComment();
- _builder.append(_generatedMemberComment, "");
- _builder.newLineIfNotEmpty();
- _builder.append("protected void refreshLabel() {");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("org.eclipse.gef.EditPolicy maskLabelPolicy = getEditPolicy(org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("if(maskLabelPolicy==null){");
- _builder.newLine();
- _builder.append("\t\t ");
- _builder.append("maskLabelPolicy = getEditPolicy(org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("if (maskLabelPolicy == null) {");
- _builder.newLine();
- {
- boolean _oclIsKindOf = this._common_qvto.oclIsKindOf(it, GenLinkLabel.class);
- if (_oclIsKindOf) {
- _builder.append("\t");
- _builder.append("setLabelTextHelper(getFigure(), getLabelText());");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("setLabelIconHelper(getFigure(), getLabelIcon());");
- _builder.newLine();
- } else {
- _builder.append("\t");
- _builder.append("org.eclipse.gmf.runtime.notation.View view = (org.eclipse.gmf.runtime.notation.View)getModel();");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("if(view.isVisible()) {");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("\t");
- _builder.append("setLabelTextHelper(getFigure(), getLabelText());");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("\t");
- _builder.append("setLabelIconHelper(getFigure(), getLabelIcon());");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("else {");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("\t");
- _builder.append("setLabelTextHelper(getFigure(), \"\"); //$NON-NLS-1$");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("\t");
- _builder.append("setLabelIconHelper(getFigure(), null);");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("}\t");
- _builder.newLine();
- }
- }
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("Object pdEditPolicy = getEditPolicy(org.eclipse.gef.EditPolicy.PRIMARY_DRAG_ROLE);");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("if (pdEditPolicy instanceof ");
- String _textSelectionEditPolicyQualifiedClassName = diagram.getTextSelectionEditPolicyQualifiedClassName();
- _builder.append(_textSelectionEditPolicyQualifiedClassName, "\t");
- _builder.append(") {");
- _builder.newLineIfNotEmpty();
- _builder.append("\t\t");
- _builder.append("((");
- String _textSelectionEditPolicyQualifiedClassName_1 = diagram.getTextSelectionEditPolicyQualifiedClassName();
- _builder.append(_textSelectionEditPolicyQualifiedClassName_1, "\t\t");
- _builder.append(") pdEditPolicy).refreshFeedback();");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("Object sfEditPolicy = getEditPolicy(org.eclipse.gef.EditPolicy.SELECTION_FEEDBACK_ROLE);");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("if (sfEditPolicy instanceof ");
- String _textSelectionEditPolicyQualifiedClassName_2 = diagram.getTextSelectionEditPolicyQualifiedClassName();
- _builder.append(_textSelectionEditPolicyQualifiedClassName_2, "\t");
- _builder.append(") {");
- _builder.newLineIfNotEmpty();
- _builder.append("\t\t");
- _builder.append("((");
- String _textSelectionEditPolicyQualifiedClassName_3 = diagram.getTextSelectionEditPolicyQualifiedClassName();
- _builder.append(_textSelectionEditPolicyQualifiedClassName_3, "\t\t");
- _builder.append(") sfEditPolicy).refreshFeedback();");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("}");
- _builder.newLine();
- return _builder;
- }
-
- public CharSequence refreshUnderline(final GenCommonBase it) {
- StringConcatenation _builder = new StringConcatenation();
- CharSequence _generatedMemberComment = this._common.generatedMemberComment();
- _builder.append(_generatedMemberComment, "");
- _builder.newLineIfNotEmpty();
- _builder.append("protected void refreshUnderline() {");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("org.eclipse.gmf.runtime.notation.FontStyle style =");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("(org.eclipse.gmf.runtime.notation.FontStyle) getFontStyleOwnerView().getStyle(");
- _builder.newLine();
- _builder.append("\t\t\t");
- _builder.append("org.eclipse.gmf.runtime.notation.NotationPackage.eINSTANCE.getFontStyle());");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("if (style != null && getFigure() instanceof org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel) {");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("((org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("if(resolveSemanticElement() instanceof org.eclipse.uml2.uml.Feature){");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("if(((org.eclipse.uml2.uml.Feature)resolveSemanticElement()).isStatic()){");
- _builder.newLine();
- _builder.append("\t\t\t");
- _builder.append("((org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel)getFigure()).setTextUnderline(true);");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("else{((org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel)getFigure()).setTextUnderline(false);}");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("}");
- _builder.newLine();
- return _builder;
- }
-
- public CharSequence refreshStrikeThrough(final GenCommonBase it) {
- StringConcatenation _builder = new StringConcatenation();
- CharSequence _generatedMemberComment = this._common.generatedMemberComment();
- _builder.append(_generatedMemberComment, "");
- _builder.newLineIfNotEmpty();
- _builder.append("protected void refreshStrikeThrough() {");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("org.eclipse.gmf.runtime.notation.FontStyle style =");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("(org.eclipse.gmf.runtime.notation.FontStyle) getFontStyleOwnerView().getStyle(");
- _builder.newLine();
- _builder.append("\t\t\t");
- _builder.append("org.eclipse.gmf.runtime.notation.NotationPackage.eINSTANCE.getFontStyle());");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("if (style != null && getFigure() instanceof org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel) {");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("((org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("}");
- _builder.newLine();
- return _builder;
- }
-
- public CharSequence refreshFont(final GenCommonBase it) {
- StringConcatenation _builder = new StringConcatenation();
- CharSequence _generatedMemberComment = this._common.generatedMemberComment();
- _builder.append(_generatedMemberComment, "");
- _builder.newLineIfNotEmpty();
- _builder.append("protected void refreshFont() {");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("org.eclipse.gmf.runtime.notation.FontStyle style =");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("(org.eclipse.gmf.runtime.notation.FontStyle) getFontStyleOwnerView().getStyle(");
- _builder.newLine();
- _builder.append("\t\t\t");
- _builder.append("org.eclipse.gmf.runtime.notation.NotationPackage.eINSTANCE.getFontStyle());");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("if (style != null) {");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("org.eclipse.swt.graphics.FontData fontData = new org.eclipse.swt.graphics.FontData(");
- _builder.newLine();
- _builder.append("\t\t\t");
- _builder.append("style.getFontName(), style.getFontHeight(),");
- _builder.newLine();
- _builder.append("\t\t\t");
- _builder.append("(style.isBold() ? org.eclipse.swt.SWT.BOLD : org.eclipse.swt.SWT.NORMAL) |");
- _builder.newLine();
- _builder.append("\t\t\t");
- _builder.append("(style.isItalic() ? org.eclipse.swt.SWT.ITALIC : org.eclipse.swt.SWT.NORMAL));");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("setFont(fontData);");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("}");
- _builder.newLine();
- return _builder;
- }
-
- public CharSequence setFontColor(final GenCommonBase it) {
- StringConcatenation _builder = new StringConcatenation();
- CharSequence _generatedMemberComment = this._common.generatedMemberComment();
- _builder.append(_generatedMemberComment, "");
- _builder.newLineIfNotEmpty();
- _builder.append("protected void setFontColor(org.eclipse.swt.graphics.Color color) {");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("getFigure().setForegroundColor(color);");
- _builder.newLine();
- _builder.append("}");
- _builder.newLine();
- return _builder;
- }
-
- public CharSequence addSemanticListeners(final GenCommonBase it) {
- StringConcatenation _builder = new StringConcatenation();
- CharSequence _generatedMemberComment = this._common.generatedMemberComment();
- _builder.append(_generatedMemberComment, "");
- _builder.newLineIfNotEmpty();
- _builder.append("protected void addSemanticListeners() {");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("if (getParser() instanceof org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser) {");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("org.eclipse.emf.ecore.EObject element = resolveSemanticElement();");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("parserElements = ((org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("for (int i = 0; i < parserElements.size(); i++) {");
- _builder.newLine();
- _builder.append("\t\t\t");
- _builder.append("addListenerFilter(\"SemanticModel\" + i, this, (org.eclipse.emf.ecore.EObject) parserElements.get(i)); ");
- CharSequence _nonNLS = this._common.nonNLS();
- _builder.append(_nonNLS, "\t\t\t");
- _builder.newLineIfNotEmpty();
- _builder.append("\t\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("} else {");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("super.addSemanticListeners();");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("}");
- _builder.newLine();
- return _builder;
- }
-
- public CharSequence removeSemanticListeners(final GenCommonBase it) {
- StringConcatenation _builder = new StringConcatenation();
- CharSequence _generatedMemberComment = this._common.generatedMemberComment();
- _builder.append(_generatedMemberComment, "");
- _builder.newLineIfNotEmpty();
- _builder.append("protected void removeSemanticListeners() {");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("if (parserElements != null) {");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("for (int i = 0; i < parserElements.size(); i++) {");
- _builder.newLine();
- _builder.append("\t\t\t");
- _builder.append("removeListenerFilter(\"SemanticModel\" + i); ");
- CharSequence _nonNLS = this._common.nonNLS();
- _builder.append(_nonNLS, "\t\t\t");
- _builder.newLineIfNotEmpty();
- _builder.append("\t\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("} else {");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("super.removeSemanticListeners();");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("}");
- _builder.newLine();
- return _builder;
- }
-
- public CharSequence getAccessibleEditPart(final GenCommonBase it) {
- StringConcatenation _builder = new StringConcatenation();
- CharSequence _generatedMemberComment = this._common.generatedMemberComment();
- _builder.append(_generatedMemberComment, "");
- _builder.newLineIfNotEmpty();
- _builder.append("protected org.eclipse.gef.AccessibleEditPart getAccessibleEditPart() {");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("if (accessibleEP == null) {");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("accessibleEP = new AccessibleGraphicalEditPart() {");
- _builder.newLine();
- _builder.newLine();
- _builder.append("\t\t\t");
- CharSequence _overrideC = this._codeStyle.overrideC(it);
- _builder.append(_overrideC, "\t\t\t");
- _builder.newLineIfNotEmpty();
- _builder.append("\t\t\t");
- _builder.append("public void getName(org.eclipse.swt.accessibility.AccessibleEvent e) {");
- _builder.newLine();
- _builder.append("\t\t\t\t");
- _builder.append("e.result = getLabelTextHelper(getFigure());");
- _builder.newLine();
- _builder.append("\t\t\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("};");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("return accessibleEP;");
- _builder.newLine();
- _builder.append("}");
- _builder.newLine();
- return _builder;
- }
-
- public CharSequence getFontStyleOwnerView(final GenCommonBase it, final Viewmap viewmap) {
- StringConcatenation _builder = new StringConcatenation();
- CharSequence _generatedMemberComment = this._common.generatedMemberComment();
- _builder.append(_generatedMemberComment, "");
- _builder.newLineIfNotEmpty();
- _builder.append(" ");
- _builder.append("private org.eclipse.gmf.runtime.notation.View getFontStyleOwnerView() {");
- _builder.newLine();
- {
- boolean _isFixedFont = this._viewmapAttributesUtils_qvto.isFixedFont(viewmap);
- if (_isFixedFont) {
- _builder.append("\t");
- _builder.append("return (org.eclipse.gmf.runtime.notation.View) getModel();");
- _builder.newLine();
- } else {
- _builder.append("\t");
- _builder.append("return getPrimaryView();");
- _builder.newLine();
- }
- }
- _builder.append(" ");
- _builder.append("}");
- _builder.newLine();
- return _builder;
- }
-
- public CharSequence getDirectEditionType(final GenCommonBase it, final Boolean readOnly) {
- StringConcatenation _builder = new StringConcatenation();
- _builder.append("/**");
- _builder.newLine();
- _builder.append(" ");
- _builder.append("* Returns the kind of associated editor for direct edition.");
- _builder.newLine();
- _builder.append(" ");
- _builder.append("* ");
- _builder.newLine();
- _builder.append(" ");
- _builder.append("* @return an <code>int</code> corresponding to the kind of direct editor, @see org.eclipse.papyrus.uml.diagram.common.editpolicies.IDirectEdition");
- _builder.newLine();
- _builder.append(" ");
- _builder.append("* @generated");
- _builder.newLine();
- _builder.append(" ");
- _builder.append("*/");
- _builder.newLine();
- _builder.append("public int getDirectEditionType() {");
- _builder.newLine();
- {
- if ((readOnly).booleanValue()) {
- _builder.append("\t");
- _builder.append("// The label is read-only (defined in GMFGen model)");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("return org.eclipse.papyrus.uml.diagram.common.editpolicies.IDirectEdition.NO_DIRECT_EDITION;");
- _builder.newLine();
- } else {
- _builder.append("\t");
- _builder.append("if (checkExtendedEditor()) {");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("\t");
- _builder.append("initExtendedEditorConfiguration();");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("\t");
- _builder.append("return org.eclipse.papyrus.uml.diagram.common.editpolicies.IDirectEdition.EXTENDED_DIRECT_EDITOR;");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("if (checkDefaultEdition()) {");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("\t");
- _builder.append("return org.eclipse.papyrus.uml.diagram.common.editpolicies.IDirectEdition.DEFAULT_DIRECT_EDITOR;");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- _builder.newLine();
- _builder.append("\t");
- _builder.append("// not a named element. no specific editor => do nothing");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("return org.eclipse.papyrus.uml.diagram.common.editpolicies.IDirectEdition.NO_DIRECT_EDITION;");
- _builder.newLine();
- }
- }
- _builder.append("}");
- _builder.newLine();
- return _builder;
- }
-
- public CharSequence checkExtendedEditor(final GenCommonBase it) {
- StringConcatenation _builder = new StringConcatenation();
- _builder.append("/**");
- _builder.newLine();
- _builder.append(" ");
- _builder.append("* Checks if an extended editor is present.");
- _builder.newLine();
- _builder.append(" ");
- _builder.append("* ");
- _builder.newLine();
- _builder.append(" ");
- _builder.append("* @return <code>true</code> if an extended editor is present.");
- _builder.newLine();
- _builder.append(" ");
- _builder.append("* @generated");
- _builder.newLine();
- _builder.append(" ");
- _builder.append("*/");
- _builder.newLine();
- _builder.append("protected boolean checkExtendedEditor() {");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("if (resolveSemanticElement() != null) {");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("return org.eclipse.papyrus.extensionpoints.editors.utils.DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("return false;");
- _builder.newLine();
- _builder.append("}");
- _builder.newLine();
- return _builder;
- }
-
- public CharSequence checkDefaultEdition(final GenCommonBase it) {
- StringConcatenation _builder = new StringConcatenation();
- _builder.append("/**");
- _builder.newLine();
- _builder.append(" ");
- _builder.append("* Checks if a default direct edition is available");
- _builder.newLine();
- _builder.append(" ");
- _builder.append("* ");
- _builder.newLine();
- _builder.append(" ");
- _builder.append("* @return <code>true</code> if a default direct edition is available");
- _builder.newLine();
- _builder.append(" ");
- _builder.append("* @generated");
- _builder.newLine();
- _builder.append(" ");
- _builder.append("*/");
- _builder.newLine();
- _builder.append("protected boolean checkDefaultEdition() {");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("return (getParser() != null);");
- _builder.newLine();
- _builder.append("}");
- _builder.newLine();
- return _builder;
- }
-
- public CharSequence initExtendedEditorConfiguration(final GenCommonBase it) {
- StringConcatenation _builder = new StringConcatenation();
- _builder.append("/**");
- _builder.newLine();
- _builder.append(" ");
- _builder.append("* Initializes the extended editor configuration");
- _builder.newLine();
- _builder.append(" ");
- _builder.append("* @generated");
- _builder.newLine();
- _builder.append(" ");
- _builder.append("*/");
- _builder.newLine();
- _builder.append("protected void initExtendedEditorConfiguration() {");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("if (configuration == null) {");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("final String languagePreferred = org.eclipse.papyrus.extensionpoints.editors.Activator.getDefault().getPreferenceStore().getString(org.eclipse.papyrus.extensionpoints.editors.utils.IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("if (languagePreferred != null && !languagePreferred.equals(\"\")) {");
- _builder.newLine();
- _builder.append("\t\t\t");
- _builder.append("configuration = org.eclipse.papyrus.extensionpoints.editors.utils.DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("} else {");
- _builder.newLine();
- _builder.append("\t\t\t");
- _builder.append("configuration = org.eclipse.papyrus.extensionpoints.editors.utils.DirectEditorsUtil.findEditorConfiguration(org.eclipse.papyrus.extensionpoints.editors.utils.IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("}");
- _builder.newLine();
- return _builder;
- }
-
- public CharSequence updateExtendedEditorConfiguration(final GenCommonBase it) {
- StringConcatenation _builder = new StringConcatenation();
- _builder.append("/**");
- _builder.newLine();
- _builder.append(" ");
- _builder.append("* Updates the preference configuration");
- _builder.newLine();
- _builder.append(" ");
- _builder.append("* @generated");
- _builder.newLine();
- _builder.append(" ");
- _builder.append("*/");
- _builder.newLine();
- _builder.append("protected void updateExtendedEditorConfiguration() {");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("String languagePreferred = org.eclipse.papyrus.extensionpoints.editors.Activator.getDefault().getPreferenceStore().getString(");
- _builder.newLine();
- _builder.append("\t\t\t");
- _builder.append("org.eclipse.papyrus.extensionpoints.editors.utils.IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("if (languagePreferred != null && !languagePreferred.equals(\"\") && !languagePreferred.equals(configuration.getLanguage())) {");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("configuration = org.eclipse.papyrus.extensionpoints.editors.utils.DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement()");
- _builder.newLine();
- _builder.append("\t\t\t\t");
- _builder.append(".eClass().getInstanceClassName());");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("} else if (org.eclipse.papyrus.extensionpoints.editors.utils.IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("configuration = null;");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("}");
- _builder.newLine();
- return _builder;
- }
-
- public CharSequence performDefaultDirectEditorEdit(final GenCommonBase it) {
- StringConcatenation _builder = new StringConcatenation();
- _builder.append("/**");
- _builder.newLine();
- _builder.append("* Performs the direct edit usually used by GMF editors.");
- _builder.newLine();
- _builder.append("* @param theRequest the direct edit request that starts the direct edit system");
- _builder.newLine();
- _builder.append("* @generated");
- _builder.newLine();
- _builder.append("*/");
- _builder.newLine();
- _builder.append("protected void performDefaultDirectEditorEdit(final org.eclipse.gef.Request theRequest) {");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("// initialize the direct edit manager");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("try {");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("getEditingDomain().runExclusive(new Runnable() {");
- _builder.newLine();
- _builder.newLine();
- _builder.append("\t\t\t");
- CharSequence _overrideI = this._codeStyle.overrideI(it);
- _builder.append(_overrideI, "\t\t\t");
- _builder.newLineIfNotEmpty();
- _builder.append("\t\t\t");
- _builder.append("public void run() {");
- _builder.newLine();
- _builder.append("\t\t\t\t");
- _builder.append("if (isActive() && isEditable()) {");
- _builder.newLine();
- _builder.append("\t\t\t\t\t");
- _builder.append("if (theRequest.getExtendedData().get(org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {");
- _builder.newLine();
- _builder.append("\t\t\t\t\t\t");
- _builder.append("Character initialChar = (Character) theRequest.getExtendedData().get(");
- _builder.newLine();
- _builder.append("\t\t\t\t\t\t\t\t");
- _builder.append("org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);");
- _builder.newLine();
- _builder.append("\t\t\t\t\t\t");
- _builder.append("performDirectEdit(initialChar.charValue());");
- _builder.newLine();
- _builder.append("\t\t\t\t\t");
- _builder.append("} else if ((theRequest instanceof org.eclipse.gef.requests.DirectEditRequest) && (getEditText().equals(getLabelText()))) {");
- _builder.newLine();
- _builder.append("\t\t\t\t\t\t");
- _builder.append("org.eclipse.gef.requests.DirectEditRequest editRequest = (org.eclipse.gef.requests.DirectEditRequest) theRequest;");
- _builder.newLine();
- _builder.append("\t\t\t\t\t\t");
- _builder.append("performDirectEdit(editRequest.getLocation());");
- _builder.newLine();
- _builder.append("\t\t\t\t\t");
- _builder.append("} else {");
- _builder.newLine();
- _builder.append("\t\t\t\t\t\t");
- _builder.append("performDirectEdit();");
- _builder.newLine();
- _builder.append("\t\t\t\t\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t\t\t\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t\t\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("});");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("} catch (InterruptedException e) {");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("e.printStackTrace();");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("}");
- _builder.newLine();
- return _builder;
- }
-}
diff --git a/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/impl/diagram/update/.gitignore b/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/impl/diagram/update/.gitignore
deleted file mode 100644
index ed6fc740e88..00000000000
--- a/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/impl/diagram/update/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-/CanonicalUpdate.java
diff --git a/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/impl/diagram/update/CanonicalUpdate.java b/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/impl/diagram/update/CanonicalUpdate.java
deleted file mode 100644
index ab98ad62ffb..00000000000
--- a/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/impl/diagram/update/CanonicalUpdate.java
+++ /dev/null
@@ -1,476 +0,0 @@
-/**
- * Copyright (c) 2007, 2010, 2013 Borland Software Corporation and others
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Alexander Shatalin (Borland) - initial API and implementation
- * Artem Tikhomirov - refactoring of containerBaseCanonicalMethods.xpt; extraction of API/non-API of CEP templates
- * Michael Golubev (Montages) - #386838 - migrate to Xtend2
- */
-package aspects.impl.diagram.update;
-
-import com.google.common.base.Objects;
-import com.google.inject.Inject;
-import com.google.inject.Singleton;
-import java.util.Set;
-import metamodel.MetaModel;
-import org.eclipse.emf.codegen.ecore.genmodel.GenFeature;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.gmf.codegen.gmfgen.GenCommonBase;
-import org.eclipse.gmf.codegen.gmfgen.GenContainerBase;
-import org.eclipse.gmf.codegen.gmfgen.GenDiagram;
-import org.eclipse.gmf.codegen.gmfgen.GenDiagramUpdater;
-import org.eclipse.gmf.codegen.gmfgen.GenEditorGenerator;
-import org.eclipse.gmf.codegen.gmfgen.GenLink;
-import org.eclipse.gmf.codegen.gmfgen.LinkModelFacet;
-import org.eclipse.xtend2.lib.StringConcatenation;
-import org.eclipse.xtext.xbase.lib.Extension;
-import org.eclipse.xtext.xbase.lib.Functions.Function1;
-import org.eclipse.xtext.xbase.lib.IterableExtensions;
-import xpt.Common;
-import xpt.diagram.updater.DiagramUpdater;
-import xpt.diagram.updater.LinkDescriptor;
-import xpt.diagram.updater.NodeDescriptor;
-import xpt.diagram.updater.Utils_qvto;
-import xpt.editor.VisualIDRegistry;
-
-@Singleton
-@SuppressWarnings("all")
-public class CanonicalUpdate extends impl.diagram.update.CanonicalUpdate {
- @Inject
- @Extension
- private Common _common;
-
- @Inject
- @Extension
- private Utils_qvto _utils_qvto;
-
- @Inject
- private NodeDescriptor nodeDescriptor;
-
- @Inject
- private MetaModel xptMetaModel;
-
- @Inject
- private DiagramUpdater xptDiagramUpdater;
-
- @Inject
- private LinkDescriptor linkDescriptor;
-
- @Inject
- private VisualIDRegistry xptVisualIDRegistry;
-
- public CharSequence getFeaturesToSynchronizeMethod(final GenContainerBase it) {
- StringConcatenation _builder = new StringConcatenation();
- {
- Set<GenFeature> _semanticChildrenChildFeatures = this._utils_qvto.getSemanticChildrenChildFeatures(it);
- int _size = _semanticChildrenChildFeatures.size();
- boolean _equals = (_size == 1);
- if (_equals) {
- _builder.newLine();
- _builder.append("\t");
- CharSequence _generatedMemberComment = this._common.generatedMemberComment();
- _builder.append(_generatedMemberComment, "\t");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.append("protected org.eclipse.emf.ecore.EStructuralFeature getFeatureToSynchronize() {");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("return ");
- Set<GenFeature> _semanticChildrenContainmentFeatures = this._utils_qvto.getSemanticChildrenContainmentFeatures(it);
- GenFeature _head = IterableExtensions.<GenFeature>head(_semanticChildrenContainmentFeatures);
- CharSequence _MetaFeature = this.xptMetaModel.MetaFeature(_head);
- _builder.append(_MetaFeature, "\t\t");
- _builder.append(";");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- } else {
- Set<GenFeature> _semanticChildrenChildFeatures_1 = this._utils_qvto.getSemanticChildrenChildFeatures(it);
- int _size_1 = _semanticChildrenChildFeatures_1.size();
- boolean _greaterThan = (_size_1 > 1);
- if (_greaterThan) {
- _builder.newLine();
- _builder.append("\t");
- CharSequence _generatedMemberComment_1 = this._common.generatedMemberComment();
- _builder.append(_generatedMemberComment_1, "\t");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.append("protected java.util.Set<org.eclipse.emf.ecore.EStructuralFeature> getFeaturesToSynchronize() {");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("if (myFeaturesToSynchronize == null) {");
- _builder.newLine();
- _builder.append("\t\t\t");
- _builder.append("myFeaturesToSynchronize = new java.util.HashSet<org.eclipse.emf.ecore.EStructuralFeature>();");
- _builder.newLine();
- {
- Set<GenFeature> _semanticChildrenContainmentFeatures_1 = this._utils_qvto.getSemanticChildrenContainmentFeatures(it);
- for(final GenFeature f : _semanticChildrenContainmentFeatures_1) {
- _builder.append("\t\t\t");
- CharSequence _addContainmentFeature = this.addContainmentFeature(f);
- _builder.append(_addContainmentFeature, "\t\t\t");
- _builder.newLineIfNotEmpty();
- }
- }
- _builder.append("\t\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("return myFeaturesToSynchronize;");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- }
- }
- }
- return _builder;
- }
-
- public CharSequence getSemanticChildrenListMethod(final GenContainerBase it) {
- StringConcatenation _builder = new StringConcatenation();
- CharSequence _generatedMemberComment = this._common.generatedMemberComment();
- _builder.append(_generatedMemberComment, "");
- _builder.newLineIfNotEmpty();
- _builder.append("protected java.util.List<org.eclipse.emf.ecore.EObject> getSemanticChildrenList() {");
- _builder.newLine();
- {
- boolean _hasSemanticChildren = this._utils_qvto.hasSemanticChildren(it);
- if (_hasSemanticChildren) {
- _builder.append("\t");
- _builder.append("org.eclipse.gmf.runtime.notation.View viewObject = (org.eclipse.gmf.runtime.notation.View) getHost().getModel();");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("java.util.LinkedList<org.eclipse.emf.ecore.EObject> result = new java.util.LinkedList<org.eclipse.emf.ecore.EObject>();");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("java.util.List<");
- GenDiagram _diagram = it.getDiagram();
- GenEditorGenerator _editorGen = _diagram.getEditorGen();
- GenDiagramUpdater _diagramUpdater = _editorGen.getDiagramUpdater();
- CharSequence _qualifiedClassName = this.nodeDescriptor.qualifiedClassName(_diagramUpdater);
- _builder.append(_qualifiedClassName, "\t");
- _builder.append("> childDescriptors = ");
- CharSequence _semanticChildrenMethodCall = this.xptDiagramUpdater.getSemanticChildrenMethodCall(it);
- _builder.append(_semanticChildrenMethodCall, "\t");
- _builder.append("(viewObject);");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.append("for (");
- GenDiagram _diagram_1 = it.getDiagram();
- GenEditorGenerator _editorGen_1 = _diagram_1.getEditorGen();
- GenDiagramUpdater _diagramUpdater_1 = _editorGen_1.getDiagramUpdater();
- CharSequence _qualifiedClassName_1 = this.nodeDescriptor.qualifiedClassName(_diagramUpdater_1);
- _builder.append(_qualifiedClassName_1, "\t");
- _builder.append(" d : childDescriptors) {");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.append("\t");
- _builder.append("result.add(d.getModelElement());");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("return result;");
- _builder.newLine();
- } else {
- _builder.append("\t");
- _builder.append("return java.util.Collections.EMPTY_LIST;");
- _builder.newLine();
- }
- }
- _builder.append("}");
- _builder.newLine();
- return _builder;
- }
-
- public CharSequence refreshConnectionsBody(final GenDiagram it) {
- StringConcatenation _builder = new StringConcatenation();
- CharSequence _Domain2Notation = this.Domain2Notation(it);
- _builder.append(_Domain2Notation, "");
- _builder.append(" domain2NotationMap = new ");
- CharSequence _Domain2Notation_1 = this.Domain2Notation(it);
- _builder.append(_Domain2Notation_1, "");
- _builder.append("();");
- _builder.newLineIfNotEmpty();
- _builder.append("java.util.Collection<");
- GenEditorGenerator _editorGen = it.getEditorGen();
- GenDiagramUpdater _diagramUpdater = _editorGen.getDiagramUpdater();
- CharSequence _qualifiedClassName = this.linkDescriptor.qualifiedClassName(_diagramUpdater);
- _builder.append(_qualifiedClassName, "");
- _builder.append("> linkDescriptors = collectAllLinks(getDiagram(), domain2NotationMap);");
- _builder.newLineIfNotEmpty();
- _builder.append("java.util.List<org.eclipse.gmf.runtime.notation.View> edges = new java.util.ArrayList<org.eclipse.gmf.runtime.notation.View>();");
- _builder.newLine();
- _builder.append("for (Object edge : getDiagram().getEdges())");
- _builder.newLine();
- _builder.append("{");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("if (edge instanceof org.eclipse.gmf.runtime.notation.View)");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("{");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("edges.add((org.eclipse.gmf.runtime.notation.View) edge);");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("}");
- _builder.newLine();
- _builder.append("java.util.Collection<org.eclipse.gmf.runtime.notation.View> existingLinks = new java.util.LinkedList<org.eclipse.gmf.runtime.notation.View>(edges);");
- _builder.newLine();
- _builder.append("for (java.util.Iterator<org.eclipse.gmf.runtime.notation.View> linksIterator = existingLinks.iterator(); linksIterator.hasNext();) {");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("org.eclipse.gmf.runtime.notation.Edge nextDiagramLink = (org.eclipse.gmf.runtime.notation.Edge) linksIterator.next();");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("int diagramLinkVisualID = ");
- CharSequence _visualIDMethodCall = this.xptVisualIDRegistry.getVisualIDMethodCall(it);
- _builder.append(_visualIDMethodCall, "\t");
- _builder.append("(nextDiagramLink);");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.append("if (diagramLinkVisualID == -1");
- {
- EList<GenLink> _links = it.getLinks();
- final Function1<GenLink, Boolean> _function = new Function1<GenLink, Boolean>() {
- public Boolean apply(final GenLink gl) {
- LinkModelFacet _modelFacet = gl.getModelFacet();
- return Boolean.valueOf(Objects.equal(_modelFacet, null));
- }
- };
- Iterable<GenLink> _filter = IterableExtensions.<GenLink>filter(_links, _function);
- for(final GenLink link : _filter) {
- CharSequence _compareLinkVisualID = this.compareLinkVisualID(link);
- _builder.append(_compareLinkVisualID, "\t");
- }
- }
- _builder.append(") {");
- _builder.newLineIfNotEmpty();
- _builder.append("\t\t");
- _builder.append("if (nextDiagramLink.getSource() != null && nextDiagramLink.getTarget() != null) {");
- _builder.newLine();
- _builder.append("\t\t\t");
- _builder.append("linksIterator.remove();");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("continue;");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("org.eclipse.emf.ecore.EObject diagramLinkObject = nextDiagramLink.getElement();");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("org.eclipse.emf.ecore.EObject diagramLinkSrc = nextDiagramLink.getSource().getElement();");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("org.eclipse.emf.ecore.EObject diagramLinkDst = nextDiagramLink.getTarget().getElement();");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("for (java.util.Iterator<");
- GenEditorGenerator _editorGen_1 = it.getEditorGen();
- GenDiagramUpdater _diagramUpdater_1 = _editorGen_1.getDiagramUpdater();
- String _linkDescriptorQualifiedClassName = _diagramUpdater_1.getLinkDescriptorQualifiedClassName();
- _builder.append(_linkDescriptorQualifiedClassName, "\t");
- _builder.append("> linkDescriptorsIterator = linkDescriptors.iterator(); linkDescriptorsIterator.hasNext();) {");
- _builder.newLineIfNotEmpty();
- _builder.append("\t\t");
- GenEditorGenerator _editorGen_2 = it.getEditorGen();
- GenDiagramUpdater _diagramUpdater_2 = _editorGen_2.getDiagramUpdater();
- CharSequence _qualifiedClassName_1 = this.linkDescriptor.qualifiedClassName(_diagramUpdater_2);
- _builder.append(_qualifiedClassName_1, "\t\t");
- _builder.append(" nextLinkDescriptor = linkDescriptorsIterator.next();");
- _builder.newLineIfNotEmpty();
- _builder.append("\t\t");
- _builder.append("if (diagramLinkObject == nextLinkDescriptor.getModelElement() && diagramLinkSrc == nextLinkDescriptor.getSource() && diagramLinkDst == nextLinkDescriptor.getDestination() && diagramLinkVisualID == nextLinkDescriptor.getVisualID()) {");
- _builder.newLine();
- _builder.append("\t\t\t");
- _builder.append("linksIterator.remove();");
- _builder.newLine();
- _builder.append("\t\t\t");
- _builder.append("linkDescriptorsIterator.remove();");
- _builder.newLine();
- _builder.append("\t\t\t");
- _builder.append("break;");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("}");
- _builder.newLine();
- _builder.append("deleteViews(existingLinks.iterator());");
- _builder.newLine();
- _builder.append("return createConnections(linkDescriptors, domain2NotationMap);");
- _builder.newLine();
- return _builder;
- }
-
- public CharSequence collectAllLinksMethod(final GenDiagram it) {
- StringConcatenation _builder = new StringConcatenation();
- CharSequence _generatedMemberComment = this._common.generatedMemberComment();
- _builder.append(_generatedMemberComment, "");
- _builder.newLineIfNotEmpty();
- _builder.append("private java.util.Collection<");
- GenEditorGenerator _editorGen = it.getEditorGen();
- GenDiagramUpdater _diagramUpdater = _editorGen.getDiagramUpdater();
- CharSequence _qualifiedClassName = this.linkDescriptor.qualifiedClassName(_diagramUpdater);
- _builder.append(_qualifiedClassName, "");
- _builder.append("> collectAllLinks(org.eclipse.gmf.runtime.notation.View view, ");
- CharSequence _Domain2Notation = this.Domain2Notation(it);
- _builder.append(_Domain2Notation, "");
- _builder.append(" domain2NotationMap) {");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.append("if (!");
- CharSequence _modelID = VisualIDRegistry.modelID(it);
- _builder.append(_modelID, "\t");
- _builder.append(".equals(");
- CharSequence _modelIDMethodCall = this.xptVisualIDRegistry.getModelIDMethodCall(it);
- _builder.append(_modelIDMethodCall, "\t");
- _builder.append("(view))) {");
- _builder.newLineIfNotEmpty();
- _builder.append("\t\t");
- _builder.append("return java.util.Collections.emptyList();");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("java.util.LinkedList<");
- GenEditorGenerator _editorGen_1 = it.getEditorGen();
- GenDiagramUpdater _diagramUpdater_1 = _editorGen_1.getDiagramUpdater();
- CharSequence _qualifiedClassName_1 = this.linkDescriptor.qualifiedClassName(_diagramUpdater_1);
- _builder.append(_qualifiedClassName_1, "\t");
- _builder.append("> result = new java.util.LinkedList<");
- GenEditorGenerator _editorGen_2 = it.getEditorGen();
- GenDiagramUpdater _diagramUpdater_2 = _editorGen_2.getDiagramUpdater();
- CharSequence _qualifiedClassName_2 = this.linkDescriptor.qualifiedClassName(_diagramUpdater_2);
- _builder.append(_qualifiedClassName_2, "\t");
- _builder.append(">();");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.append("switch (");
- CharSequence _visualIDMethodCall = this.xptVisualIDRegistry.getVisualIDMethodCall(it);
- _builder.append(_visualIDMethodCall, "\t");
- _builder.append("(view)) {");
- _builder.newLineIfNotEmpty();
- {
- Iterable<GenCommonBase> _allSemanticElements = this._utils_qvto.getAllSemanticElements(it);
- for(final GenCommonBase se : _allSemanticElements) {
- _builder.append("\t\t");
- CharSequence _caseSemanticElement = this.caseSemanticElement(se);
- _builder.append(_caseSemanticElement, "\t\t");
- _builder.newLineIfNotEmpty();
- }
- }
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("for (java.util.Iterator<?> children = view.getChildren().iterator(); children.hasNext();) {");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("result.addAll(collectAllLinks((org.eclipse.gmf.runtime.notation.View) children.next(), domain2NotationMap));");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("for (java.util.Iterator<?> edges = view.getSourceEdges().iterator(); edges.hasNext();) {");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("result.addAll(collectAllLinks((org.eclipse.gmf.runtime.notation.View) edges.next(), domain2NotationMap));");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("return result;");
- _builder.newLine();
- _builder.append("}");
- _builder.newLine();
- return _builder;
- }
-
- public CharSequence getEditPartMethod(final GenDiagram it) {
- StringConcatenation _builder = new StringConcatenation();
- CharSequence _generatedMemberComment = this._common.generatedMemberComment();
- _builder.append(_generatedMemberComment, "");
- _builder.newLineIfNotEmpty();
- _builder.append("private org.eclipse.gef.EditPart getEditPart(org.eclipse.emf.ecore.EObject domainModelElement, ");
- CharSequence _Domain2Notation = this.Domain2Notation(it);
- _builder.append(_Domain2Notation, "");
- _builder.append(" domain2NotationMap) {");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.append("org.eclipse.gmf.runtime.notation.View view = domain2NotationMap.get(domainModelElement);");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("if (view != null) {");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("return (org.eclipse.gef.EditPart) getHost().getViewer().getEditPartRegistry().get(view);");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("return null;");
- _builder.newLine();
- _builder.append("}");
- _builder.newLine();
- return _builder;
- }
-
- public CharSequence getHintedEditPartMethod(final GenDiagram it) {
- StringConcatenation _builder = new StringConcatenation();
- CharSequence _generatedMemberComment = this._common.generatedMemberComment();
- _builder.append(_generatedMemberComment, "");
- _builder.newLineIfNotEmpty();
- _builder.append("protected final org.eclipse.gef.EditPart getHintedEditPart(org.eclipse.emf.ecore.EObject domainModelElement, ");
- CharSequence _Domain2Notation = this.Domain2Notation(it);
- _builder.append(_Domain2Notation, "");
- _builder.append(" domain2NotationMap, int hintVisualId) { ");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.append("org.eclipse.gmf.runtime.notation.View view = domain2NotationMap.getHinted(domainModelElement, ");
- CharSequence _typeMethodCall = this.xptVisualIDRegistry.typeMethodCall(it, "hintVisualId");
- _builder.append(_typeMethodCall, "\t");
- _builder.append(");");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.append("if (view != null) {");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("return (org.eclipse.gef.EditPart) getHost().getViewer().getEditPartRegistry().get(view);");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("return null;");
- _builder.newLine();
- _builder.append("}");
- _builder.newLine();
- return _builder;
- }
-}
diff --git a/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/impl/parsers/.gitignore b/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/impl/parsers/.gitignore
deleted file mode 100644
index c89b20955f1..00000000000
--- a/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/impl/parsers/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-/ParserProvider.java
diff --git a/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/impl/parsers/ParserProvider.java b/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/impl/parsers/ParserProvider.java
deleted file mode 100644
index bfba1a3a55c..00000000000
--- a/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/impl/parsers/ParserProvider.java
+++ /dev/null
@@ -1,296 +0,0 @@
-/**
- * Copyright (c) 2007-2013 Borland Software Corporation and others
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Dmitry Stadnik (Borland) - initial API and implementation
- * Artem Tikhomirov (Borland) - [235113] alternative parser access
- * [244419] custom parsers
- * [138179] expression-backed labels
- * Michael Golubev (Montages) - #386838 - migrate to Xtend2
- */
-package aspects.impl.parsers;
-
-import com.google.common.base.Objects;
-import com.google.inject.Inject;
-import com.google.inject.Singleton;
-import impl.parsers.expression_qvto;
-import java.util.Arrays;
-import metamodel.MetaModel;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.gmf.codegen.gmfgen.GenChildLabelNode;
-import org.eclipse.gmf.codegen.gmfgen.GenLink;
-import org.eclipse.gmf.codegen.gmfgen.GenLinkEnd;
-import org.eclipse.gmf.codegen.gmfgen.GenLinkLabel;
-import org.eclipse.gmf.codegen.gmfgen.GenNode;
-import org.eclipse.gmf.codegen.gmfgen.GenNodeLabel;
-import org.eclipse.gmf.codegen.gmfgen.GenParserImplementation;
-import org.eclipse.gmf.codegen.gmfgen.GenParsers;
-import org.eclipse.gmf.codegen.gmfgen.LabelModelFacet;
-import org.eclipse.gmf.codegen.gmfgen.TypeModelFacet;
-import org.eclipse.xtend2.lib.StringConcatenation;
-import org.eclipse.xtext.xbase.lib.Extension;
-import parsers.ExpressionLabelParser;
-import parsers.PredefinedParser;
-import plugin.Activator;
-import xpt.Common;
-import xpt.Common_qvto;
-import xpt.editor.VisualIDRegistry;
-import xpt.expressions.OclTracker_qvto;
-import xpt.expressions.getExpression;
-import xpt.providers.ElementTypes;
-import xpt.providers.ParserUtils_qvto;
-
-@Singleton
-@SuppressWarnings("all")
-public class ParserProvider extends impl.parsers.ParserProvider {
- @Inject
- @Extension
- private Common _common;
-
- @Inject
- @Extension
- private Common_qvto _common_qvto;
-
- @Inject
- @Extension
- private OclTracker_qvto _oclTracker_qvto;
-
- @Inject
- @Extension
- private ParserUtils_qvto _parserUtils_qvto;
-
- @Inject
- @Extension
- private expression_qvto _expression_qvto;
-
- @Inject
- @Extension
- private ExpressionLabelParser _expressionLabelParser;
-
- @Inject
- @Extension
- private PredefinedParser _predefinedParser;
-
- @Inject
- private getExpression xptGetExpression;
-
- @Inject
- private MetaModel xptMetaModel;
-
- @Inject
- private VisualIDRegistry xptVisualIDRegistry;
-
- @Inject
- private ElementTypes xptElementTypes;
-
- @Inject
- private parsers.ParserProvider xptParsers;
-
- @Inject
- private Activator xptActivator;
-
- public CharSequence HintAdapterClass(final GenParsers it) {
- StringConcatenation _builder = new StringConcatenation();
- _builder.append("\t");
- CharSequence _generatedMemberComment = this._common.generatedMemberComment();
- _builder.append(_generatedMemberComment, "\t");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.append("private static class HintAdapter extends org.eclipse.gmf.runtime.emf.ui.services.parser.ParserHintAdapter {");
- _builder.newLine();
- _builder.newLine();
- _builder.append("\t\t");
- CharSequence _generatedMemberComment_1 = this._common.generatedMemberComment();
- _builder.append(_generatedMemberComment_1, "\t\t");
- _builder.newLineIfNotEmpty();
- _builder.append("\t\t");
- _builder.append("private final org.eclipse.gmf.runtime.emf.type.core.IElementType elementType;");
- _builder.newLine();
- _builder.newLine();
- _builder.append("\t\t");
- CharSequence _generatedMemberComment_2 = this._common.generatedMemberComment();
- _builder.append(_generatedMemberComment_2, "\t\t");
- _builder.newLineIfNotEmpty();
- _builder.append("\t\t");
- _builder.append("public HintAdapter(org.eclipse.gmf.runtime.emf.type.core.IElementType type,");
- _builder.newLine();
- _builder.append("\t\t\t\t");
- _builder.append("org.eclipse.emf.ecore.EObject object, String parserHint) {");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("super(object, parserHint);");
- _builder.newLine();
- _builder.append("\t\t");
- CharSequence __assert = this._common._assert("type != null");
- _builder.append(__assert, "\t\t");
- _builder.newLineIfNotEmpty();
- _builder.append("\t\t");
- _builder.append("elementType = type;");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("}");
- _builder.newLine();
- _builder.newLine();
- _builder.append("\t\t");
- CharSequence _generatedMemberComment_3 = this._common.generatedMemberComment();
- _builder.append(_generatedMemberComment_3, "\t\t");
- _builder.newLineIfNotEmpty();
- _builder.append("\t\t");
- _builder.append("public Object getAdapter(@SuppressWarnings(\"rawtypes\") Class adapter) {");
- _builder.newLine();
- _builder.append("\t\t\t");
- _builder.append("if (org.eclipse.gmf.runtime.emf.type.core.IElementType.class.equals(adapter)) {");
- _builder.newLine();
- _builder.append("\t\t\t\t");
- _builder.append("return elementType;");
- _builder.newLine();
- _builder.append("\t\t\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t\t\t");
- _builder.append("return super.getAdapter(adapter);");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- return _builder;
- }
-
- protected CharSequence _dispatch_parsers(final GenNode it) {
- StringConcatenation _builder = new StringConcatenation();
- {
- EList<GenNodeLabel> _labels = it.getLabels();
- for(final GenNodeLabel label : _labels) {
- {
- LabelModelFacet _modelFacet = label.getModelFacet();
- boolean _notEquals = (!Objects.equal(_modelFacet, null));
- if (_notEquals) {
- LabelModelFacet _modelFacet_1 = label.getModelFacet();
- GenParserImplementation _parser = _modelFacet_1.getParser();
- LabelModelFacet _modelFacet_2 = label.getModelFacet();
- CharSequence _dispatch_parser = this.dispatch_parser(_parser, _modelFacet_2, label);
- _builder.append(_dispatch_parser, "");
- _builder.newLineIfNotEmpty();
- }
- }
- }
- }
- return _builder;
- }
-
- protected CharSequence _dispatch_parsers(final GenLink it) {
- StringConcatenation _builder = new StringConcatenation();
- {
- EList<GenLinkLabel> _labels = it.getLabels();
- for(final GenLinkLabel label : _labels) {
- {
- LabelModelFacet _modelFacet = label.getModelFacet();
- boolean _notEquals = (!Objects.equal(_modelFacet, null));
- if (_notEquals) {
- LabelModelFacet _modelFacet_1 = label.getModelFacet();
- GenParserImplementation _parser = _modelFacet_1.getParser();
- LabelModelFacet _modelFacet_2 = label.getModelFacet();
- CharSequence _dispatch_parser = this.dispatch_parser(_parser, _modelFacet_2, label);
- _builder.append(_dispatch_parser, "");
- _builder.newLineIfNotEmpty();
- }
- }
- }
- }
- return _builder;
- }
-
- protected CharSequence _dispatch_getParsers(final GenNode it) {
- StringConcatenation _builder = new StringConcatenation();
- {
- EList<GenNodeLabel> _labels = it.getLabels();
- for(final GenNodeLabel label : _labels) {
- {
- LabelModelFacet _modelFacet = label.getModelFacet();
- boolean _notEquals = (!Objects.equal(_modelFacet, null));
- if (_notEquals) {
- LabelModelFacet _modelFacet_1 = label.getModelFacet();
- GenParserImplementation _parser = _modelFacet_1.getParser();
- CharSequence _doGetParser = this.doGetParser(_parser, label);
- _builder.append(_doGetParser, "");
- _builder.newLineIfNotEmpty();
- }
- }
- }
- }
- _builder.newLine();
- return _builder;
- }
-
- protected CharSequence _dispatch_getParsers(final GenLink it) {
- StringConcatenation _builder = new StringConcatenation();
- {
- EList<GenLinkLabel> _labels = it.getLabels();
- for(final GenLinkLabel label : _labels) {
- {
- LabelModelFacet _modelFacet = label.getModelFacet();
- boolean _notEquals = (!Objects.equal(_modelFacet, null));
- if (_notEquals) {
- LabelModelFacet _modelFacet_1 = label.getModelFacet();
- GenParserImplementation _parser = _modelFacet_1.getParser();
- CharSequence _doGetParser = this.doGetParser(_parser, label);
- _builder.append(_doGetParser, "");
- _builder.newLineIfNotEmpty();
- }
- }
- }
- }
- _builder.newLine();
- return _builder;
- }
-
- protected CharSequence _dispatch_getParsers(final GenChildLabelNode it) {
- StringConcatenation _builder = new StringConcatenation();
- {
- TypeModelFacet _modelFacet = it.getModelFacet();
- boolean _notEquals = (!Objects.equal(_modelFacet, null));
- if (_notEquals) {
- LabelModelFacet _labelModelFacet = it.getLabelModelFacet();
- GenParserImplementation _parser = _labelModelFacet.getParser();
- CharSequence _doGetParser = this.doGetParser(_parser, it);
- _builder.append(_doGetParser, "");
- _builder.newLineIfNotEmpty();
- }
- }
- return _builder;
- }
-
- public CharSequence dispatch_parsers(final GenLinkEnd it) {
- if (it instanceof GenChildLabelNode) {
- return _dispatch_parsers((GenChildLabelNode)it);
- } else if (it instanceof GenNode) {
- return _dispatch_parsers((GenNode)it);
- } else if (it instanceof GenLink) {
- return _dispatch_parsers((GenLink)it);
- } else {
- throw new IllegalArgumentException("Unhandled parameter types: " +
- Arrays.<Object>asList(it).toString());
- }
- }
-
- public CharSequence dispatch_getParsers(final GenLinkEnd it) {
- if (it instanceof GenChildLabelNode) {
- return _dispatch_getParsers((GenChildLabelNode)it);
- } else if (it instanceof GenNode) {
- return _dispatch_getParsers((GenNode)it);
- } else if (it instanceof GenLink) {
- return _dispatch_getParsers((GenLink)it);
- } else {
- throw new IllegalArgumentException("Unhandled parameter types: " +
- Arrays.<Object>asList(it).toString());
- }
- }
-}
diff --git a/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/impl/preferences/.gitignore b/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/impl/preferences/.gitignore
deleted file mode 100644
index 6511bd48b3f..00000000000
--- a/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/impl/preferences/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-/StandardPage.java
diff --git a/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/impl/preferences/StandardPage.java b/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/impl/preferences/StandardPage.java
deleted file mode 100644
index a189e623e38..00000000000
--- a/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/impl/preferences/StandardPage.java
+++ /dev/null
@@ -1,146 +0,0 @@
-/**
- * Copyright (c) 2006, 2009, 2013 Borland Software Corporation and others
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Dmitry Stadnik (Borland) - initial API and implementation
- * Michael Golubev (Montages) - #386838 - migrate to Xtend2
- */
-package aspects.impl.preferences;
-
-import com.google.common.base.Objects;
-import com.google.inject.Inject;
-import com.google.inject.Singleton;
-import org.eclipse.gmf.codegen.gmfgen.GenDiagram;
-import org.eclipse.gmf.codegen.gmfgen.GenEditorGenerator;
-import org.eclipse.gmf.codegen.gmfgen.GenPlugin;
-import org.eclipse.gmf.codegen.gmfgen.GenStandardPreferencePage;
-import org.eclipse.gmf.codegen.gmfgen.StandardPreferencePages;
-import org.eclipse.xtend2.lib.StringConcatenation;
-import org.eclipse.xtext.xbase.lib.Extension;
-import xpt.Common;
-
-@Singleton
-@SuppressWarnings("all")
-public class StandardPage extends impl.preferences.StandardPage {
- @Inject
- @Extension
- private Common _common;
-
- public CharSequence Main(final GenStandardPreferencePage it) {
- StringConcatenation _builder = new StringConcatenation();
- GenDiagram _diagram = it.getDiagram();
- GenEditorGenerator _editorGen = _diagram.getEditorGen();
- CharSequence _copyright = this._common.copyright(_editorGen);
- _builder.append(_copyright, "");
- _builder.newLineIfNotEmpty();
- _builder.append("package ");
- CharSequence _packageName = this.packageName(it);
- _builder.append(_packageName, "");
- _builder.append(";");
- _builder.newLineIfNotEmpty();
- _builder.newLine();
- CharSequence _generatedClassComment = this._common.generatedClassComment();
- _builder.append(_generatedClassComment, "");
- _builder.newLineIfNotEmpty();
- _builder.append("public class ");
- CharSequence _className = this.className(it);
- _builder.append(_className, "");
- _builder.append(" ");
- CharSequence _extendsList = this.extendsList(it);
- _builder.append(_extendsList, "");
- _builder.append(" ");
- CharSequence _implementsList = this.implementsList(it);
- _builder.append(_implementsList, "");
- _builder.append(" {");
- _builder.newLineIfNotEmpty();
- _builder.newLine();
- _builder.append("\t");
- CharSequence _generatedMemberComment = this._common.generatedMemberComment();
- _builder.append(_generatedMemberComment, "\t");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.append("public ");
- CharSequence _className_1 = this.className(it);
- _builder.append(_className_1, "\t");
- _builder.append("() {");
- _builder.newLineIfNotEmpty();
- _builder.append("\t\t");
- _builder.append("setPreferenceStore(");
- GenDiagram _diagram_1 = it.getDiagram();
- GenEditorGenerator _editorGen_1 = _diagram_1.getEditorGen();
- GenPlugin _plugin = _editorGen_1.getPlugin();
- String _activatorQualifiedClassName = _plugin.getActivatorQualifiedClassName();
- _builder.append(_activatorQualifiedClassName, "\t\t");
- _builder.append(".getInstance().getPreferenceStore());");
- _builder.newLineIfNotEmpty();
- {
- StandardPreferencePages _kind = it.getKind();
- boolean _equals = Objects.equal(StandardPreferencePages.GENERAL_LITERAL, _kind);
- if (_equals) {
- _builder.append("\t\t");
- _builder.append("setPreferenceKey(");
- GenDiagram _diagram_2 = it.getDiagram();
- String _editPartsPackageName = _diagram_2.getEditPartsPackageName();
- _builder.append(_editPartsPackageName, "\t\t");
- _builder.append(".");
- GenDiagram _diagram_3 = it.getDiagram();
- String _editPartClassName = _diagram_3.getEditPartClassName();
- _builder.append(_editPartClassName, "\t\t");
- _builder.append(".MODEL_ID);");
- _builder.newLineIfNotEmpty();
- }
- }
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("}");
- _builder.newLine();
- return _builder;
- }
-
- public CharSequence extendsList(final GenStandardPreferencePage it) {
- StringConcatenation _builder = new StringConcatenation();
- {
- StandardPreferencePages _kind = it.getKind();
- boolean _equals = Objects.equal(_kind, StandardPreferencePages.GENERAL_LITERAL);
- if (_equals) {
- _builder.append("extends org.eclipse.papyrus.infra.gmfdiag.preferences.pages.DiagramPreferencePage");
- _builder.newLine();
- } else {
- StandardPreferencePages _kind_1 = it.getKind();
- boolean _equals_1 = Objects.equal(_kind_1, StandardPreferencePages.APPEARANCE_LITERAL);
- if (_equals_1) {
- _builder.append("extends org.eclipse.gmf.runtime.diagram.ui.preferences.AppearancePreferencePage");
- _builder.newLine();
- } else {
- StandardPreferencePages _kind_2 = it.getKind();
- boolean _equals_2 = Objects.equal(_kind_2, StandardPreferencePages.CONNECTIONS_LITERAL);
- if (_equals_2) {
- _builder.append("extends org.eclipse.gmf.runtime.diagram.ui.preferences.ConnectionsPreferencePage");
- _builder.newLine();
- } else {
- StandardPreferencePages _kind_3 = it.getKind();
- boolean _equals_3 = Objects.equal(_kind_3, StandardPreferencePages.PRINTING_LITERAL);
- if (_equals_3) {
- _builder.append("extends org.eclipse.gmf.runtime.diagram.ui.preferences.PrintingPreferencePage");
- _builder.newLine();
- } else {
- StandardPreferencePages _kind_4 = it.getKind();
- boolean _equals_4 = Objects.equal(_kind_4, StandardPreferencePages.RULERS_AND_GRID_LITERAL);
- if (_equals_4) {
- _builder.append("extends org.eclipse.gmf.runtime.diagram.ui.preferences.RulerGridPreferencePage");
- _builder.newLine();
- }
- }
- }
- }
- }
- }
- return _builder;
- }
-}
diff --git a/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/metamodel/.gitignore b/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/metamodel/.gitignore
deleted file mode 100644
index b7dc6c2bc33..00000000000
--- a/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/metamodel/.gitignore
+++ /dev/null
@@ -1,2 +0,0 @@
-/MetaModel.java
-/Facility.java
diff --git a/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/metamodel/Facility.java b/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/metamodel/Facility.java
deleted file mode 100644
index 27c7367c362..00000000000
--- a/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/metamodel/Facility.java
+++ /dev/null
@@ -1,96 +0,0 @@
-package aspects.metamodel;
-
-import com.google.inject.Inject;
-import com.google.inject.Singleton;
-import metamodel.Facility_qvto;
-import org.eclipse.emf.codegen.ecore.genmodel.GenPackage;
-import org.eclipse.emf.ecore.EPackage;
-import org.eclipse.gmf.codegen.gmfgen.DynamicModelAccess;
-import org.eclipse.xtend2.lib.StringConcatenation;
-import org.eclipse.xtext.xbase.lib.Extension;
-import xpt.Common;
-
-@Singleton
-@SuppressWarnings("all")
-public class Facility extends metamodel.Facility {
- @Inject
- @Extension
- private Common _common;
-
- @Inject
- @Extension
- private Facility_qvto _facility_qvto;
-
- public CharSequence getMethod(final GenPackage it, final DynamicModelAccess dma) {
- StringConcatenation _builder = new StringConcatenation();
- CharSequence _generatedMemberComment = this._common.generatedMemberComment("@throws IllegalStateException if no EPackage with given URI is registered.");
- _builder.append(_generatedMemberComment, "");
- _builder.newLineIfNotEmpty();
- _builder.append("public static ");
- CharSequence _className = this.className(dma);
- _builder.append(_className, "");
- _builder.append(" get");
- String _nameToken = this._facility_qvto.getNameToken(it);
- _builder.append(_nameToken, "");
- _builder.append("() {");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.append("if (");
- String _fieldName = this._facility_qvto.fieldName(it);
- _builder.append(_fieldName, "\t");
- _builder.append(" == null) {");
- _builder.newLineIfNotEmpty();
- _builder.append("\t\t");
- _builder.append("org.eclipse.emf.ecore.EPackage pkg = getRegistry().getEPackage(\"");
- EPackage _ecorePackage = it.getEcorePackage();
- String _nsURI = _ecorePackage.getNsURI();
- _builder.append(_nsURI, "\t\t");
- _builder.append("\");");
- _builder.newLineIfNotEmpty();
- _builder.append("\t\t");
- _builder.append("if (pkg == null) {");
- _builder.newLine();
- _builder.append("\t\t\t");
- _builder.append("throw new IllegalStateException(\"Package ");
- EPackage _ecorePackage_1 = it.getEcorePackage();
- String _name = _ecorePackage_1.getName();
- _builder.append(_name, "\t\t\t");
- _builder.append("(");
- EPackage _ecorePackage_2 = it.getEcorePackage();
- String _nsURI_1 = _ecorePackage_2.getNsURI();
- _builder.append(_nsURI_1, "\t\t\t");
- _builder.append(") not found\");");
- _builder.newLineIfNotEmpty();
- _builder.append("\t\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t\t");
- String _fieldName_1 = this._facility_qvto.fieldName(it);
- _builder.append(_fieldName_1, "\t\t");
- _builder.append(" = new ");
- CharSequence _className_1 = this.className(dma);
- _builder.append(_className_1, "\t\t");
- _builder.append("(pkg);");
- _builder.newLineIfNotEmpty();
- _builder.append("\t\t");
- String _fieldName_2 = this._facility_qvto.fieldName(it);
- _builder.append(_fieldName_2, "\t\t");
- _builder.append(".init");
- String _nameToken_1 = this._facility_qvto.getNameToken(it);
- _builder.append(_nameToken_1, "\t\t");
- _builder.append("();");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("return ");
- String _fieldName_3 = this._facility_qvto.fieldName(it);
- _builder.append(_fieldName_3, "\t");
- _builder.append(";");
- _builder.newLineIfNotEmpty();
- _builder.append("}");
- _builder.newLine();
- return _builder;
- }
-}
diff --git a/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/metamodel/MetaModel.java b/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/metamodel/MetaModel.java
deleted file mode 100644
index 9f8c59dd416..00000000000
--- a/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/metamodel/MetaModel.java
+++ /dev/null
@@ -1,32 +0,0 @@
-package aspects.metamodel;
-
-import com.google.inject.Inject;
-import com.google.inject.Singleton;
-import metamodel.MetaModel_qvto;
-import org.eclipse.emf.codegen.ecore.genmodel.GenClass;
-import org.eclipse.emf.codegen.ecore.genmodel.GenFeature;
-import org.eclipse.xtend2.lib.StringConcatenation;
-import org.eclipse.xtext.xbase.lib.Extension;
-
-@Singleton
-@SuppressWarnings("all")
-public class MetaModel extends metamodel.MetaModel {
- @Inject
- @Extension
- private MetaModel_qvto _metaModel_qvto;
-
- public CharSequence DeclareAndAssign2(final GenClass it, final String assignee, final String src, final GenClass srcMetaClass, final GenFeature srcFeature, final String srcExt, final boolean needCast) {
- StringConcatenation _builder = new StringConcatenation();
- String _qualifiedInterfaceName = this._metaModel_qvto.getQualifiedInterfaceName(it);
- _builder.append(_qualifiedInterfaceName, "");
- _builder.append(" ");
- _builder.append(assignee, "");
- _builder.append(" = ");
- CharSequence _featureValue = this.getFeatureValue(srcFeature, src, srcMetaClass);
- _builder.append(_featureValue, "");
- _builder.append(".");
- _builder.append(srcExt, "");
- _builder.append(";");
- return _builder;
- }
-}
diff --git a/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/.gitignore b/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/.gitignore
deleted file mode 100644
index 72cb9ea4c3a..00000000000
--- a/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/.gitignore
+++ /dev/null
@@ -1,3 +0,0 @@
-/CodeStyle.java
-/Common.java
-/QualifiedClassNameProvider.java
diff --git a/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/CodeStyle.java b/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/CodeStyle.java
deleted file mode 100644
index 2b34b5de8ff..00000000000
--- a/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/CodeStyle.java
+++ /dev/null
@@ -1,16 +0,0 @@
-package aspects.xpt;
-
-import com.google.inject.Singleton;
-import org.eclipse.gmf.codegen.gmfgen.GenCommonBase;
-import org.eclipse.xtend2.lib.StringConcatenation;
-
-@Singleton
-@SuppressWarnings("all")
-public class CodeStyle extends xpt.CodeStyle {
- public CharSequence overrideI(final GenCommonBase xptSelf) {
- StringConcatenation _builder = new StringConcatenation();
- _builder.append("@Override");
- _builder.newLine();
- return _builder;
- }
-}
diff --git a/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/Common.java b/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/Common.java
deleted file mode 100644
index 994402ea8b4..00000000000
--- a/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/Common.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/**
- * Copyright (c) 2006-2013 Borland Software Corporation and others
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Dmitry Stadnik (Borland) - initial API and implementation
- * Michael Golubev (Montages) - #386838 - migrate to Xtend2
- */
-package aspects.xpt;
-
-import com.google.common.base.Objects;
-import com.google.inject.Singleton;
-import org.eclipse.gmf.codegen.gmfgen.GenEditorGenerator;
-import org.eclipse.xtend2.lib.StringConcatenation;
-
-@Singleton
-@SuppressWarnings("all")
-public class Common extends xpt.Common {
- public CharSequence copyright(final GenEditorGenerator it) {
- StringConcatenation _builder = new StringConcatenation();
- {
- String _copyrightText = it.getCopyrightText();
- boolean _notEquals = (!Objects.equal(_copyrightText, null));
- if (_notEquals) {
- _builder.append("/**");
- _builder.newLine();
- _builder.append(" ");
- _builder.append("* ");
- String _copyrightText_1 = it.getCopyrightText();
- String _replaceAll = _copyrightText_1.replaceAll("\n", "\n * ");
- _builder.append(_replaceAll, " ");
- _builder.newLineIfNotEmpty();
- _builder.append(" ");
- _builder.append("*/");
- _builder.newLine();
- }
- }
- return _builder;
- }
-}
diff --git a/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/QualifiedClassNameProvider.java b/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/QualifiedClassNameProvider.java
deleted file mode 100644
index ff97a9e8d24..00000000000
--- a/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/QualifiedClassNameProvider.java
+++ /dev/null
@@ -1,55 +0,0 @@
-package aspects.xpt;
-
-import com.google.inject.Singleton;
-import java.util.Arrays;
-import org.eclipse.gmf.codegen.gmfgen.GenCommonBase;
-import org.eclipse.gmf.codegen.gmfgen.GenCompartment;
-import org.eclipse.gmf.codegen.gmfgen.GenDiagram;
-import org.eclipse.gmf.codegen.gmfgen.GenLink;
-import org.eclipse.gmf.codegen.gmfgen.GenNode;
-import org.eclipse.xtend2.lib.StringConcatenation;
-
-@Singleton
-@SuppressWarnings("all")
-public class QualifiedClassNameProvider extends xpt.QualifiedClassNameProvider {
- protected CharSequence _getItemSemanticEditPolicyQualifiedClassName(final GenDiagram it) {
- StringConcatenation _builder = new StringConcatenation();
- _builder.append("org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.DefaultCompartmentSemanticEditPolicy");
- return _builder;
- }
-
- protected CharSequence _getItemSemanticEditPolicyQualifiedClassName(final GenCompartment it) {
- StringConcatenation _builder = new StringConcatenation();
- _builder.append("org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.DefaultCompartmentSemanticEditPolicy");
- return _builder;
- }
-
- protected CharSequence _getItemSemanticEditPolicyQualifiedClassName(final GenLink it) {
- StringConcatenation _builder = new StringConcatenation();
- _builder.append("org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.DefaultSemanticEditPolicy");
- return _builder;
- }
-
- protected CharSequence _getItemSemanticEditPolicyQualifiedClassName(final GenNode it) {
- StringConcatenation _builder = new StringConcatenation();
- _builder.append("org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.DefaultSemanticEditPolicy");
- return _builder;
- }
-
- public CharSequence getItemSemanticEditPolicyQualifiedClassName(final GenCommonBase it) {
- if (it instanceof GenCompartment) {
- return _getItemSemanticEditPolicyQualifiedClassName((GenCompartment)it);
- } else if (it instanceof GenNode) {
- return _getItemSemanticEditPolicyQualifiedClassName((GenNode)it);
- } else if (it instanceof GenDiagram) {
- return _getItemSemanticEditPolicyQualifiedClassName((GenDiagram)it);
- } else if (it instanceof GenLink) {
- return _getItemSemanticEditPolicyQualifiedClassName((GenLink)it);
- } else if (it != null) {
- return _getItemSemanticEditPolicyQualifiedClassName(it);
- } else {
- throw new IllegalArgumentException("Unhandled parameter types: " +
- Arrays.<Object>asList(it).toString());
- }
- }
-}
diff --git a/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/diagram/commands/.gitignore b/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/diagram/commands/.gitignore
deleted file mode 100644
index 5a536933138..00000000000
--- a/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/diagram/commands/.gitignore
+++ /dev/null
@@ -1,3 +0,0 @@
-/ReorientLinkUtils.java
-/CreateLinkUtils.java
-/CreateNodeCommand.java
diff --git a/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/diagram/commands/CreateLinkUtils.java b/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/diagram/commands/CreateLinkUtils.java
deleted file mode 100644
index c8c21995b28..00000000000
--- a/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/diagram/commands/CreateLinkUtils.java
+++ /dev/null
@@ -1,218 +0,0 @@
-/**
- * Copyright (c) 2007-2012 Borland Software Corporation and others
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Dmitry Stadnik (Borland) - initial API and implementation
- * Michael Golubev (Montages) - #386838 - migrate to Xtend2
- */
-package aspects.xpt.diagram.commands;
-
-import com.google.inject.Inject;
-import com.google.inject.Singleton;
-import java.util.Arrays;
-import metamodel.MetaModel;
-import org.eclipse.emf.codegen.ecore.genmodel.GenClass;
-import org.eclipse.emf.codegen.ecore.genmodel.GenFeature;
-import org.eclipse.gmf.codegen.gmfgen.LinkModelFacet;
-import org.eclipse.gmf.codegen.gmfgen.TypeLinkModelFacet;
-import org.eclipse.xtend2.lib.StringConcatenation;
-import org.eclipse.xtext.xbase.lib.Extension;
-import xpt.Common;
-import xpt.diagram.Utils_qvto;
-
-@Singleton
-@SuppressWarnings("all")
-public class CreateLinkUtils extends xpt.diagram.commands.CreateLinkUtils {
- @Inject
- @Extension
- private Common _common;
-
- @Inject
- @Extension
- private Utils_qvto _utils_qvto;
-
- @Inject
- private MetaModel xptMetaModel;
-
- /**
- * Fields of command that creates link.
- */
- protected CharSequence _fields(final LinkModelFacet it) {
- StringConcatenation _builder = new StringConcatenation();
- CharSequence _extraLineBreak = this._common.extraLineBreak();
- _builder.append(_extraLineBreak, "");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- CharSequence _generatedMemberComment = this._common.generatedMemberComment();
- _builder.append(_generatedMemberComment, "\t");
- _builder.append(" ");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.append("protected final org.eclipse.emf.ecore.EObject source;");
- _builder.newLine();
- _builder.newLine();
- _builder.append("\t");
- CharSequence _generatedMemberComment_1 = this._common.generatedMemberComment();
- _builder.append(_generatedMemberComment_1, "\t");
- _builder.append(" ");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.append("protected final org.eclipse.emf.ecore.EObject target;");
- _builder.newLine();
- return _builder;
- }
-
- protected CharSequence _fields(final TypeLinkModelFacet it) {
- StringConcatenation _builder = new StringConcatenation();
- CharSequence _extraLineBreak = this._common.extraLineBreak();
- _builder.append(_extraLineBreak, "");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- CharSequence _generatedMemberComment = this._common.generatedMemberComment();
- _builder.append(_generatedMemberComment, "\t");
- _builder.append(" ");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.append("protected final org.eclipse.emf.ecore.EObject source;");
- _builder.newLine();
- _builder.newLine();
- _builder.append("\t");
- CharSequence _generatedMemberComment_1 = this._common.generatedMemberComment();
- _builder.append(_generatedMemberComment_1, "\t");
- _builder.append(" ");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.append("protected final org.eclipse.emf.ecore.EObject target;");
- _builder.newLine();
- {
- boolean _hasContainerOtherThanSource = this._utils_qvto.hasContainerOtherThanSource(it);
- if (_hasContainerOtherThanSource) {
- _builder.newLine();
- CharSequence _generatedMemberComment_2 = this._common.generatedMemberComment();
- _builder.append(_generatedMemberComment_2, "");
- _builder.append(" ");
- _builder.newLineIfNotEmpty();
- _builder.append("protected ");
- GenFeature _containmentMetaFeature = it.getContainmentMetaFeature();
- GenClass _genClass = _containmentMetaFeature.getGenClass();
- CharSequence _QualifiedClassName = this.xptMetaModel.QualifiedClassName(_genClass);
- _builder.append(_QualifiedClassName, "");
- _builder.append(" container;");
- _builder.newLineIfNotEmpty();
- }
- }
- return _builder;
- }
-
- protected CharSequence _containerAccessor(final TypeLinkModelFacet it) {
- StringConcatenation _builder = new StringConcatenation();
- {
- boolean _hasContainerOtherThanSource = this._utils_qvto.hasContainerOtherThanSource(it);
- if (_hasContainerOtherThanSource) {
- _builder.newLine();
- _builder.append("\t");
- CharSequence _generatedMemberComment = this._common.generatedMemberComment();
- _builder.append(_generatedMemberComment, "\t");
- _builder.append(" ");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.append("public ");
- GenFeature _containmentMetaFeature = it.getContainmentMetaFeature();
- GenClass _genClass = _containmentMetaFeature.getGenClass();
- CharSequence _QualifiedClassName = this.xptMetaModel.QualifiedClassName(_genClass);
- _builder.append(_QualifiedClassName, "\t");
- _builder.append(" getContainer() {");
- _builder.newLineIfNotEmpty();
- _builder.append("\t\t");
- _builder.append("return container;");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- _builder.newLine();
- _builder.append("\t");
- CharSequence _generatedMemberComment_1 = this._common.generatedMemberComment(
- ("Default approach is to traverse ancestors of the source to find instance of container.\n" + "Modify with appropriate logic."));
- _builder.append(_generatedMemberComment_1, "\t");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.append("protected ");
- GenFeature _containmentMetaFeature_1 = it.getContainmentMetaFeature();
- GenClass _genClass_1 = _containmentMetaFeature_1.getGenClass();
- CharSequence _QualifiedClassName_1 = this.xptMetaModel.QualifiedClassName(_genClass_1);
- _builder.append(_QualifiedClassName_1, "\t");
- _builder.append(" deduceContainer(org.eclipse.emf.ecore.EObject source, org.eclipse.emf.ecore.EObject target) {");
- _builder.newLineIfNotEmpty();
- _builder.append("\t\t");
- _builder.append("// Find container element for the new link.");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("// Climb up by containment hierarchy starting from the source");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("// and return the first element that is instance of the container class.");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("for (org.eclipse.emf.ecore.EObject element = source; element != null; element = element.eContainer()) {");
- _builder.newLine();
- _builder.append("\t\t\t");
- _builder.append("if (");
- GenFeature _containmentMetaFeature_2 = it.getContainmentMetaFeature();
- GenClass _genClass_2 = _containmentMetaFeature_2.getGenClass();
- CharSequence _IsInstance = this.xptMetaModel.IsInstance(_genClass_2, "element");
- _builder.append(_IsInstance, "\t\t\t");
- _builder.append(") {");
- _builder.newLineIfNotEmpty();
- _builder.append("\t\t\t\t");
- _builder.append("return ");
- GenFeature _containmentMetaFeature_3 = it.getContainmentMetaFeature();
- GenClass _genClass_3 = _containmentMetaFeature_3.getGenClass();
- CharSequence _CastEObject = this.xptMetaModel.CastEObject(_genClass_3, "element");
- _builder.append(_CastEObject, "\t\t\t\t");
- _builder.append(";");
- _builder.newLineIfNotEmpty();
- _builder.append("\t\t\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("return null;");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- }
- }
- _builder.newLine();
- return _builder;
- }
-
- public CharSequence fields(final LinkModelFacet it) {
- if (it instanceof TypeLinkModelFacet) {
- return _fields((TypeLinkModelFacet)it);
- } else if (it != null) {
- return _fields(it);
- } else {
- throw new IllegalArgumentException("Unhandled parameter types: " +
- Arrays.<Object>asList(it).toString());
- }
- }
-
- public CharSequence containerAccessor(final LinkModelFacet it) {
- if (it instanceof TypeLinkModelFacet) {
- return _containerAccessor((TypeLinkModelFacet)it);
- } else if (it != null) {
- return _containerAccessor(it);
- } else {
- throw new IllegalArgumentException("Unhandled parameter types: " +
- Arrays.<Object>asList(it).toString());
- }
- }
-}
diff --git a/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/diagram/commands/CreateNodeCommand.java b/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/diagram/commands/CreateNodeCommand.java
deleted file mode 100644
index ffd713507f9..00000000000
--- a/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/diagram/commands/CreateNodeCommand.java
+++ /dev/null
@@ -1,491 +0,0 @@
-/**
- * Copyright (c) 2007, 2010 Borland Software Corporation and others
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Dmitry Stadnik (Borland) - initial API and implementation
- * Michael Golubev (Montages) - #386838 - migrate to Xtend2
- */
-package aspects.xpt.diagram.commands;
-
-import com.google.common.base.Objects;
-import com.google.inject.Inject;
-import com.google.inject.Singleton;
-import metamodel.MetaModel;
-import org.eclipse.emf.codegen.ecore.genmodel.GenClass;
-import org.eclipse.emf.codegen.ecore.genmodel.GenFeature;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.gmf.codegen.gmfgen.GenDiagram;
-import org.eclipse.gmf.codegen.gmfgen.GenEditorGenerator;
-import org.eclipse.gmf.codegen.gmfgen.GenNode;
-import org.eclipse.gmf.codegen.gmfgen.TypeModelFacet;
-import org.eclipse.xtend2.lib.StringConcatenation;
-import org.eclipse.xtext.xbase.lib.Extension;
-import xpt.Common;
-import xpt.OclMigrationProblems_qvto;
-import xpt.diagram.Utils_qvto;
-
-@Singleton
-@SuppressWarnings("all")
-public class CreateNodeCommand extends xpt.diagram.commands.CreateNodeCommand {
- @Inject
- @Extension
- private Common _common;
-
- @Inject
- @Extension
- private OclMigrationProblems_qvto _oclMigrationProblems_qvto;
-
- @Inject
- @Extension
- private MetaModel _metaModel;
-
- @Inject
- @Extension
- private Utils_qvto _utils_qvto;
-
- @Inject
- private MetaModel xptMetaModel;
-
- public CharSequence CreateNodeCommand(final GenNode it) {
- StringConcatenation _builder = new StringConcatenation();
- GenDiagram _diagram = it.getDiagram();
- GenEditorGenerator _editorGen = _diagram.getEditorGen();
- CharSequence _copyright = this._common.copyright(_editorGen);
- _builder.append(_copyright, "");
- _builder.newLineIfNotEmpty();
- _builder.append("package ");
- CharSequence _packageName = this.packageName(it);
- _builder.append(_packageName, "");
- _builder.append(";");
- _builder.newLineIfNotEmpty();
- _builder.newLine();
- _builder.newLine();
- _builder.newLine();
- CharSequence _generatedClassComment = this._common.generatedClassComment();
- _builder.append(_generatedClassComment, "");
- _builder.newLineIfNotEmpty();
- _builder.append("public class ");
- CharSequence _className = this.className(it);
- _builder.append(_className, "");
- _builder.append(" extends org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand {");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.newLine();
- {
- TypeModelFacet _modelFacet = it.getModelFacet();
- boolean _isPhantomElement = _modelFacet.isPhantomElement();
- boolean _not = (!_isPhantomElement);
- if (_not) {
- _builder.append("\t");
- CharSequence _generatedMemberComment = this._common.generatedMemberComment();
- _builder.append(_generatedMemberComment, "\t");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.append("private org.eclipse.gmf.runtime.notation.Diagram diagram = null;");
- _builder.newLine();
- }
- }
- _builder.newLine();
- _builder.append("\t");
- CharSequence __constructor = this._constructor(it);
- _builder.append(__constructor, "\t");
- _builder.newLineIfNotEmpty();
- _builder.newLine();
- _builder.append("\t");
- CharSequence _elementToEdit = this.getElementToEdit(it);
- _builder.append(_elementToEdit, "\t");
- _builder.newLineIfNotEmpty();
- _builder.newLine();
- _builder.append("\t");
- CharSequence _canExecuteMethod = this.canExecuteMethod(it);
- _builder.append(_canExecuteMethod, "\t");
- _builder.newLineIfNotEmpty();
- _builder.newLine();
- _builder.append("\t");
- CharSequence _doExecuteWithResultMethod = this.doExecuteWithResultMethod(it);
- _builder.append(_doExecuteWithResultMethod, "\t");
- _builder.newLineIfNotEmpty();
- _builder.newLine();
- _builder.append("\t");
- CharSequence _doConfigureMethod = this.doConfigureMethod(it);
- _builder.append(_doConfigureMethod, "\t");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.newLine();
- _builder.append("\t");
- CharSequence _additions = this.additions(it);
- _builder.append(_additions, "\t");
- _builder.append("\t");
- _builder.newLineIfNotEmpty();
- _builder.append("}");
- _builder.newLine();
- return _builder;
- }
-
- public CharSequence _constructor(final GenNode it) {
- StringConcatenation _builder = new StringConcatenation();
- CharSequence _generatedMemberComment = this._common.generatedMemberComment();
- _builder.append(_generatedMemberComment, "");
- _builder.newLineIfNotEmpty();
- _builder.append("public ");
- CharSequence _className = this.className(it);
- _builder.append(_className, "");
- _builder.append("(org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest req, org.eclipse.gmf.runtime.notation.Diagram diagram) {");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.append("super(req.getLabel(), null, req);");
- _builder.newLine();
- {
- TypeModelFacet _modelFacet = it.getModelFacet();
- boolean _isPhantomElement = _modelFacet.isPhantomElement();
- boolean _not = (!_isPhantomElement);
- if (_not) {
- _builder.append("\t");
- _builder.append("this.diagram = diagram;");
- _builder.newLine();
- }
- }
- _builder.append("}");
- _builder.newLine();
- return _builder;
- }
-
- public CharSequence doExecuteWithResultMethod(final GenNode it) {
- StringConcatenation _builder = new StringConcatenation();
- CharSequence _generatedMemberComment = this._common.generatedMemberComment();
- _builder.append(_generatedMemberComment, "");
- _builder.newLineIfNotEmpty();
- _builder.append("protected org.eclipse.gmf.runtime.common.core.command.CommandResult doExecuteWithResult(org.eclipse.core.runtime.IProgressMonitor monitor, org.eclipse.core.runtime.IAdaptable info) throws org.eclipse.core.commands.ExecutionException {");
- _builder.newLine();
- _builder.append(" \t\t\t\t");
- _builder.newLine();
- {
- TypeModelFacet _modelFacet = it.getModelFacet();
- GenClass _metaClass = _modelFacet.getMetaClass();
- EClass _ecoreClass = _metaClass.getEcoreClass();
- boolean _isAbstract = _ecoreClass.isAbstract();
- boolean _notEquals = (_isAbstract != true);
- if (_notEquals) {
- {
- TypeModelFacet _modelFacet_1 = it.getModelFacet();
- boolean _isPhantomElement = _modelFacet_1.isPhantomElement();
- if (_isPhantomElement) {
- TypeModelFacet _modelFacet_2 = it.getModelFacet();
- CharSequence _phantomElementCreation = this.phantomElementCreation(_modelFacet_2, it, "newElement");
- _builder.append(_phantomElementCreation, "");
- _builder.newLineIfNotEmpty();
- } else {
- TypeModelFacet _modelFacet_3 = it.getModelFacet();
- CharSequence _normalElementCreation = this.normalElementCreation(_modelFacet_3, it, "newElement");
- _builder.append(_normalElementCreation, "");
- _builder.newLineIfNotEmpty();
- }
- }
- CharSequence _extraLineBreak = this._common.extraLineBreak();
- _builder.append(_extraLineBreak, "");
- _builder.newLineIfNotEmpty();
- TypeModelFacet _modelFacet_4 = it.getModelFacet();
- CharSequence _initialize = this.initialize(_modelFacet_4, it, "newElement");
- _builder.append(_initialize, "");
- _builder.newLineIfNotEmpty();
- {
- if (true) {
- CharSequence _extraLineBreak_1 = this._common.extraLineBreak();
- _builder.append(_extraLineBreak_1, "");
- _builder.newLineIfNotEmpty();
- _builder.append("doConfigure(newElement, monitor, info);");
- _builder.newLine();
- CharSequence _extraLineBreak_2 = this._common.extraLineBreak();
- _builder.append(_extraLineBreak_2, "");
- _builder.newLineIfNotEmpty();
- }
- }
- _builder.append("\t");
- _builder.append("((org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest) getRequest()).setNewElement(");
- TypeModelFacet _modelFacet_5 = it.getModelFacet();
- GenClass _metaClass_1 = _modelFacet_5.getMetaClass();
- CharSequence _DowncastToEObject = this.xptMetaModel.DowncastToEObject(_metaClass_1, "newElement");
- _builder.append(_DowncastToEObject, "\t");
- _builder.append(");");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.append("return org.eclipse.gmf.runtime.common.core.command.CommandResult.newOKCommandResult(newElement);");
- _builder.newLine();
- _builder.append("}");
- _builder.newLine();
- } else {
- _builder.append("\t");
- _builder.append("throw new UnsupportedOperationException(\"Unimplemented operation (abstract domain element).\");");
- _builder.newLine();
- _builder.append("}");
- _builder.newLine();
- }
- }
- return _builder;
- }
-
- public CharSequence canExecute_Normal(final TypeModelFacet it) {
- StringConcatenation _builder = new StringConcatenation();
- {
- GenFeature _containmentMetaFeature = it.getContainmentMetaFeature();
- boolean _notEquals = (!Objects.equal(_containmentMetaFeature, null));
- if (_notEquals) {
- {
- GenFeature _containmentMetaFeature_1 = it.getContainmentMetaFeature();
- EStructuralFeature _ecoreFeature = _containmentMetaFeature_1.getEcoreFeature();
- boolean _notEquals_1 = (!Objects.equal(_ecoreFeature, null));
- if (_notEquals_1) {
- {
- boolean _or = false;
- GenFeature _containmentMetaFeature_2 = it.getContainmentMetaFeature();
- EStructuralFeature _ecoreFeature_1 = _containmentMetaFeature_2.getEcoreFeature();
- boolean _isUnbounded = this._oclMigrationProblems_qvto.isUnbounded(_ecoreFeature_1);
- boolean _not = (!_isUnbounded);
- if (_not) {
- _or = true;
- } else {
- boolean _and = false;
- GenFeature _childMetaFeature = it.getChildMetaFeature();
- GenFeature _containmentMetaFeature_3 = it.getContainmentMetaFeature();
- boolean _notEquals_2 = (!Objects.equal(_childMetaFeature, _containmentMetaFeature_3));
- if (!_notEquals_2) {
- _and = false;
- } else {
- GenFeature _childMetaFeature_1 = it.getChildMetaFeature();
- EStructuralFeature _ecoreFeature_2 = _childMetaFeature_1.getEcoreFeature();
- boolean _isUnbounded_1 = this._oclMigrationProblems_qvto.isUnbounded(_ecoreFeature_2);
- boolean _not_1 = (!_isUnbounded_1);
- _and = _not_1;
- }
- _or = _and;
- }
- if (_or) {
- {
- GenFeature _containmentMetaFeature_4 = it.getContainmentMetaFeature();
- EStructuralFeature _ecoreFeature_3 = _containmentMetaFeature_4.getEcoreFeature();
- boolean _isUnbounded_2 = this._oclMigrationProblems_qvto.isUnbounded(_ecoreFeature_3);
- boolean _not_2 = (!_isUnbounded_2);
- if (_not_2) {
- GenFeature _containmentMetaFeature_5 = it.getContainmentMetaFeature();
- GenClass _genClass = _containmentMetaFeature_5.getGenClass();
- CharSequence _DeclareAndAssign = this._metaModel.DeclareAndAssign(_genClass, "container", "getElementToEdit()");
- _builder.append(_DeclareAndAssign, "");
- _builder.newLineIfNotEmpty();
- {
- GenFeature _containmentMetaFeature_6 = it.getContainmentMetaFeature();
- EStructuralFeature _ecoreFeature_4 = _containmentMetaFeature_6.getEcoreFeature();
- boolean _isSingleValued = this._oclMigrationProblems_qvto.isSingleValued(_ecoreFeature_4);
- if (_isSingleValued) {
- _builder.append("\t\t");
- _builder.append("if (");
- GenFeature _containmentMetaFeature_7 = it.getContainmentMetaFeature();
- GenFeature _containmentMetaFeature_8 = it.getContainmentMetaFeature();
- GenClass _genClass_1 = _containmentMetaFeature_8.getGenClass();
- CharSequence _featureValue = this._metaModel.getFeatureValue(_containmentMetaFeature_7, "container", _genClass_1);
- _builder.append(_featureValue, "\t\t");
- _builder.append(" != null) {");
- _builder.newLineIfNotEmpty();
- } else {
- _builder.append("\t\t");
- _builder.append("if (");
- GenFeature _containmentMetaFeature_9 = it.getContainmentMetaFeature();
- GenFeature _containmentMetaFeature_10 = it.getContainmentMetaFeature();
- GenClass _genClass_2 = _containmentMetaFeature_10.getGenClass();
- CharSequence _featureValue_1 = this._metaModel.getFeatureValue(_containmentMetaFeature_9, "container", _genClass_2);
- _builder.append(_featureValue_1, "\t\t");
- _builder.append(".size() >= ");
- GenFeature _containmentMetaFeature_11 = it.getContainmentMetaFeature();
- EStructuralFeature _ecoreFeature_5 = _containmentMetaFeature_11.getEcoreFeature();
- int _upperBound = _ecoreFeature_5.getUpperBound();
- _builder.append(_upperBound, "\t\t");
- _builder.append(") {");
- _builder.newLineIfNotEmpty();
- }
- }
- _builder.append("\t\t\t");
- _builder.append("return false;");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("}");
- _builder.newLine();
- }
- }
- {
- boolean _and_1 = false;
- GenFeature _childMetaFeature_2 = it.getChildMetaFeature();
- GenFeature _containmentMetaFeature_12 = it.getContainmentMetaFeature();
- boolean _notEquals_3 = (!Objects.equal(_childMetaFeature_2, _containmentMetaFeature_12));
- if (!_notEquals_3) {
- _and_1 = false;
- } else {
- GenFeature _childMetaFeature_3 = it.getChildMetaFeature();
- EStructuralFeature _ecoreFeature_6 = _childMetaFeature_3.getEcoreFeature();
- boolean _isUnbounded_3 = this._oclMigrationProblems_qvto.isUnbounded(_ecoreFeature_6);
- boolean _not_3 = (!_isUnbounded_3);
- _and_1 = _not_3;
- }
- if (_and_1) {
- {
- GenFeature _childMetaFeature_4 = it.getChildMetaFeature();
- EStructuralFeature _ecoreFeature_7 = _childMetaFeature_4.getEcoreFeature();
- boolean _isSingleValued_1 = this._oclMigrationProblems_qvto.isSingleValued(_ecoreFeature_7);
- if (_isSingleValued_1) {
- _builder.append("\t\t");
- _builder.append("if (");
- GenFeature _childMetaFeature_5 = it.getChildMetaFeature();
- GenFeature _containmentMetaFeature_13 = it.getContainmentMetaFeature();
- GenClass _genClass_3 = _containmentMetaFeature_13.getGenClass();
- CharSequence _featureValue_2 = this._metaModel.getFeatureValue(_childMetaFeature_5, "container", _genClass_3);
- _builder.append(_featureValue_2, "\t\t");
- _builder.append(" != null) {");
- _builder.newLineIfNotEmpty();
- } else {
- _builder.append("\t\t");
- _builder.append("if (");
- GenFeature _childMetaFeature_6 = it.getChildMetaFeature();
- GenFeature _containmentMetaFeature_14 = it.getContainmentMetaFeature();
- GenClass _genClass_4 = _containmentMetaFeature_14.getGenClass();
- CharSequence _featureValue_3 = this._metaModel.getFeatureValue(_childMetaFeature_6, "container", _genClass_4);
- _builder.append(_featureValue_3, "\t\t");
- _builder.append(".size() >= ");
- GenFeature _childMetaFeature_7 = it.getChildMetaFeature();
- EStructuralFeature _ecoreFeature_8 = _childMetaFeature_7.getEcoreFeature();
- int _upperBound_1 = _ecoreFeature_8.getUpperBound();
- _builder.append(_upperBound_1, "\t\t");
- _builder.append(") {");
- _builder.newLineIfNotEmpty();
- }
- }
- _builder.append("\t\t");
- _builder.append("\t\t");
- _builder.append("return false;");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- }
- }
- }
- }
- }
- }
- }
- }
- _builder.newLine();
- _builder.append("org.eclipse.emf.ecore.EObject target = getElementToEdit();");
- _builder.newLine();
- _builder.append("org.eclipse.papyrus.infra.viewpoints.policy.ModelAddData data = org.eclipse.papyrus.infra.viewpoints.policy.PolicyChecker.getCurrent().getChildAddData(diagram, target.eClass(), ");
- GenClass _metaClass = it.getMetaClass();
- CharSequence _MetaClass = this._metaModel.MetaClass(_metaClass);
- _builder.append(_MetaClass, "");
- _builder.append(");");
- _builder.newLineIfNotEmpty();
- _builder.append("return data.isPermitted();");
- _builder.newLine();
- _builder.newLine();
- return _builder;
- }
-
- public CharSequence normalElementCreation(final TypeModelFacet it, final GenNode node, final String varName) {
- StringConcatenation _builder = new StringConcatenation();
- GenClass _metaClass = it.getMetaClass();
- CharSequence _NewInstance = this.xptMetaModel.NewInstance(_metaClass, varName);
- _builder.append(_NewInstance, "");
- _builder.newLineIfNotEmpty();
- _builder.newLine();
- _builder.append("org.eclipse.emf.ecore.EObject target = getElementToEdit();");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("org.eclipse.papyrus.infra.viewpoints.policy.ModelAddData data = org.eclipse.papyrus.infra.viewpoints.policy.PolicyChecker.getCurrent().getChildAddData(diagram, target, ");
- _builder.append(varName, "\t\t");
- _builder.append(");");
- _builder.newLineIfNotEmpty();
- _builder.append("\t\t");
- _builder.append("if (data.isPermitted()) {");
- _builder.newLine();
- _builder.append("\t\t\t");
- _builder.append("if (data.isPathDefined()) {");
- _builder.newLine();
- _builder.append("\t\t\t\t");
- _builder.append("if (!data.execute(target, ");
- _builder.append(varName, "\t\t\t\t");
- _builder.append(")) {");
- _builder.newLineIfNotEmpty();
- _builder.append("\t\t\t\t\t");
- _builder.append("return org.eclipse.gmf.runtime.common.core.command.CommandResult.newErrorCommandResult(\"Failed to follow the policy-specified for the insertion of the new element\");");
- _builder.newLine();
- _builder.append("\t\t\t\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t\t\t");
- _builder.append("} else {");
- _builder.newLine();
- CharSequence _extraLineBreak = this._common.extraLineBreak();
- _builder.append(_extraLineBreak, "");
- _builder.newLineIfNotEmpty();
- {
- GenFeature _containmentMetaFeature = it.getContainmentMetaFeature();
- boolean _notEquals = (!Objects.equal(_containmentMetaFeature, null));
- if (_notEquals) {
- GenFeature _containmentMetaFeature_1 = it.getContainmentMetaFeature();
- GenClass _genClass = _containmentMetaFeature_1.getGenClass();
- CharSequence _DeclareAndAssign = this.xptMetaModel.DeclareAndAssign(_genClass, "qualifiedTarget", "target");
- _builder.append(_DeclareAndAssign, "");
- _builder.newLineIfNotEmpty();
- GenFeature _containmentMetaFeature_2 = it.getContainmentMetaFeature();
- GenFeature _containmentMetaFeature_3 = it.getContainmentMetaFeature();
- GenClass _genClass_1 = _containmentMetaFeature_3.getGenClass();
- CharSequence _modifyFeature = this.xptMetaModel.modifyFeature(_containmentMetaFeature_2, "qualifiedTarget", _genClass_1, varName);
- _builder.append(_modifyFeature, "");
- _builder.newLineIfNotEmpty();
- } else {
- _builder.append("//");
- _builder.newLine();
- _builder.append("// FIXME no containment feature found in the genmodel, toolsmith need to manually write code here to add ");
- _builder.append(varName, "");
- _builder.append(" to a parent");
- _builder.newLineIfNotEmpty();
- _builder.append("//");
- _builder.newLine();
- }
- }
- _builder.newLine();
- _builder.append("\t\t\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("} else {");
- _builder.newLine();
- _builder.append("\t\t\t");
- _builder.append("return org.eclipse.gmf.runtime.common.core.command.CommandResult.newErrorCommandResult(\"The active policy restricts the addition of this element\");");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("}");
- _builder.newLine();
- _builder.newLine();
- {
- boolean _hasExplicitChildFeature = this._utils_qvto.hasExplicitChildFeature(it);
- if (_hasExplicitChildFeature) {
- GenFeature _childMetaFeature = it.getChildMetaFeature();
- GenClass _genClass_2 = _childMetaFeature.getGenClass();
- CharSequence _DeclareAndAssign_1 = this.xptMetaModel.DeclareAndAssign(_genClass_2, "childHolder", "getElementToEdit()");
- _builder.append(_DeclareAndAssign_1, "");
- _builder.newLineIfNotEmpty();
- GenFeature _childMetaFeature_1 = it.getChildMetaFeature();
- GenFeature _childMetaFeature_2 = it.getChildMetaFeature();
- GenClass _genClass_3 = _childMetaFeature_2.getGenClass();
- CharSequence _modifyFeature_1 = this.xptMetaModel.modifyFeature(_childMetaFeature_1, "childHolder", _genClass_3, varName);
- _builder.append(_modifyFeature_1, "");
- _builder.newLineIfNotEmpty();
- }
- }
- return _builder;
- }
-}
diff --git a/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/diagram/commands/ReorientLinkUtils.java b/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/diagram/commands/ReorientLinkUtils.java
deleted file mode 100644
index 76e12c3efc1..00000000000
--- a/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/diagram/commands/ReorientLinkUtils.java
+++ /dev/null
@@ -1,153 +0,0 @@
-package aspects.xpt.diagram.commands;
-
-import com.google.inject.Inject;
-import com.google.inject.Singleton;
-import org.eclipse.gmf.codegen.gmfgen.GenLink;
-import org.eclipse.gmf.codegen.gmfgen.LinkModelFacet;
-import org.eclipse.xtend2.lib.StringConcatenation;
-import org.eclipse.xtext.xbase.lib.Extension;
-import xpt.Common;
-
-@Singleton
-@SuppressWarnings("all")
-public class ReorientLinkUtils extends xpt.diagram.commands.ReorientLinkUtils {
- @Inject
- @Extension
- private Common _common;
-
- public CharSequence canReorient(final LinkModelFacet it, final GenLink link) {
- StringConcatenation _builder = new StringConcatenation();
- CharSequence _generatedMemberComment = this._common.generatedMemberComment();
- _builder.append(_generatedMemberComment, "");
- _builder.newLineIfNotEmpty();
- _builder.append("public boolean canExecute() {");
- _builder.newLine();
- _builder.append("\t");
- CharSequence _checkLinkValidity = this.checkLinkValidity(it);
- _builder.append(_checkLinkValidity, "\t");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.append("if (reorientDirection == org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRequest.REORIENT_SOURCE) {");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("return canReorientSource();");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("if (reorientDirection == org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRequest.REORIENT_TARGET) {");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("return canReorientTarget();");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("return false;");
- _builder.newLine();
- _builder.append("}");
- _builder.newLine();
- _builder.newLine();
- CharSequence _generatedMemberComment_1 = this._common.generatedMemberComment();
- _builder.append(_generatedMemberComment_1, "");
- _builder.newLineIfNotEmpty();
- _builder.append("protected boolean canReorientSource() {");
- _builder.newLine();
- _builder.append("\t");
- CharSequence _checkSourceRequestValidity = this.checkSourceRequestValidity(it, link);
- _builder.append(_checkSourceRequestValidity, "\t");
- _builder.newLineIfNotEmpty();
- _builder.append("}");
- _builder.newLine();
- _builder.newLine();
- CharSequence _generatedMemberComment_2 = this._common.generatedMemberComment();
- _builder.append(_generatedMemberComment_2, "");
- _builder.newLineIfNotEmpty();
- _builder.append("protected boolean canReorientTarget() {");
- _builder.newLine();
- _builder.append("\t");
- CharSequence _checkTargetRequestValidity = this.checkTargetRequestValidity(it, link);
- _builder.append(_checkTargetRequestValidity, "\t");
- _builder.newLineIfNotEmpty();
- _builder.append("}");
- _builder.newLine();
- return _builder;
- }
-
- public CharSequence reorient(final LinkModelFacet it) {
- StringConcatenation _builder = new StringConcatenation();
- _builder.newLine();
- CharSequence _generatedMemberComment = this._common.generatedMemberComment();
- _builder.append(_generatedMemberComment, "");
- _builder.newLineIfNotEmpty();
- _builder.append("protected org.eclipse.gmf.runtime.common.core.command.CommandResult doExecuteWithResult(");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("org.eclipse.core.runtime.IProgressMonitor monitor, org.eclipse.core.runtime.IAdaptable info)");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("throws org.eclipse.core.commands.ExecutionException {");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("if (!canExecute()) {");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("throw new org.eclipse.core.commands.ExecutionException(\"Invalid arguments in reorient link command\"); ");
- CharSequence _nonNLS = this._common.nonNLS();
- _builder.append(_nonNLS, "\t");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("if (reorientDirection == org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRequest.REORIENT_SOURCE) {");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("return reorientSource();");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("if (reorientDirection == org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRequest.REORIENT_TARGET) {");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("return reorientTarget();");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("throw new IllegalStateException();");
- _builder.newLine();
- _builder.append("}");
- _builder.newLine();
- _builder.newLine();
- CharSequence _generatedMemberComment_1 = this._common.generatedMemberComment();
- _builder.append(_generatedMemberComment_1, "");
- _builder.newLineIfNotEmpty();
- _builder.append("protected org.eclipse.gmf.runtime.common.core.command.CommandResult reorientSource() throws org.eclipse.core.commands.ExecutionException {");
- _builder.newLine();
- _builder.append("\t");
- CharSequence _reorientSource = this.reorientSource(it);
- _builder.append(_reorientSource, "\t");
- _builder.newLineIfNotEmpty();
- _builder.append("}");
- _builder.newLine();
- _builder.newLine();
- CharSequence _generatedMemberComment_2 = this._common.generatedMemberComment();
- _builder.append(_generatedMemberComment_2, "");
- _builder.newLineIfNotEmpty();
- _builder.append("protected org.eclipse.gmf.runtime.common.core.command.CommandResult reorientTarget() throws org.eclipse.core.commands.ExecutionException {");
- _builder.newLine();
- _builder.append("\t");
- CharSequence _reorientTarget = this.reorientTarget(it);
- _builder.append(_reorientTarget, "\t");
- _builder.newLineIfNotEmpty();
- _builder.append("}");
- _builder.newLine();
- return _builder;
- }
-}
diff --git a/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/diagram/edithelpers/.gitignore b/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/diagram/edithelpers/.gitignore
deleted file mode 100644
index 03f041845c9..00000000000
--- a/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/diagram/edithelpers/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-/EditHelper.java
diff --git a/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/diagram/edithelpers/EditHelper.java b/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/diagram/edithelpers/EditHelper.java
deleted file mode 100644
index dfa999d2a84..00000000000
--- a/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/diagram/edithelpers/EditHelper.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/**
- * Copyright (c) 2006-2013 Borland Software Corporation and others
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Dmitry Stadnik (Borland) - initial API and implementation
- * Michael Golubev (Montages) - #386838 - migrate to Xtend2
- */
-package aspects.xpt.diagram.edithelpers;
-
-import com.google.inject.Inject;
-import org.eclipse.gmf.codegen.gmfgen.GenCommonBase;
-import org.eclipse.gmf.codegen.gmfgen.GenDiagram;
-import org.eclipse.gmf.codegen.gmfgen.GenEditorGenerator;
-import org.eclipse.gmf.codegen.gmfgen.MetamodelType;
-import org.eclipse.xtend2.lib.StringConcatenation;
-import org.eclipse.xtext.xbase.lib.Extension;
-import utils.EditHelperUtils_qvto;
-import xpt.Common;
-
-@SuppressWarnings("all")
-public class EditHelper extends xpt.diagram.edithelpers.EditHelper {
- @Inject
- @Extension
- private Common _common;
-
- @Inject
- @Extension
- private EditHelperUtils_qvto _editHelperUtils_qvto;
-
- public CharSequence EditHelper(final MetamodelType it) {
- StringConcatenation _builder = new StringConcatenation();
- GenCommonBase _diagramElement = it.getDiagramElement();
- GenDiagram _diagram = _diagramElement.getDiagram();
- GenEditorGenerator _editorGen = _diagram.getEditorGen();
- CharSequence _copyright = this._common.copyright(_editorGen);
- _builder.append(_copyright, "");
- _builder.newLineIfNotEmpty();
- _builder.append("package ");
- CharSequence _packageName = this.packageName(it);
- _builder.append(_packageName, "");
- _builder.append(";");
- _builder.newLineIfNotEmpty();
- _builder.newLine();
- CharSequence _generatedClassComment = this._common.generatedClassComment();
- _builder.append(_generatedClassComment, "");
- _builder.newLineIfNotEmpty();
- _builder.append("public class ");
- String _editHelperClassName = it.getEditHelperClassName();
- _builder.append(_editHelperClassName, "");
- _builder.append(" extends ");
- GenCommonBase _diagramElement_1 = it.getDiagramElement();
- GenDiagram _diagram_1 = _diagramElement_1.getDiagram();
- String _baseEditHelperFullName = this._editHelperUtils_qvto.getBaseEditHelperFullName(_diagram_1);
- _builder.append(_baseEditHelperFullName, "");
- _builder.append(" {");
- _builder.newLineIfNotEmpty();
- CharSequence _additions = this.additions(it);
- _builder.append(_additions, "");
- _builder.newLineIfNotEmpty();
- _builder.append("}");
- _builder.newLine();
- return _builder;
- }
-}
diff --git a/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/diagram/editparts/.gitignore b/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/diagram/editparts/.gitignore
deleted file mode 100644
index 4c1df60d4fc..00000000000
--- a/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/diagram/editparts/.gitignore
+++ /dev/null
@@ -1,2 +0,0 @@
-/Common.java
-/EditPartFactory.java
diff --git a/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/diagram/editparts/Common.java b/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/diagram/editparts/Common.java
deleted file mode 100644
index 5308199cff1..00000000000
--- a/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/diagram/editparts/Common.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/**
- * Copyright (c) 2006, 2010 Borland Software Corporation and others
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Dmitry Stadnik (Borland) - initial API and implementation
- * Michael Golubev (Montages) - #386838 - migrate to Xtend2
- * Patrick Tessier (CEA LIST)
- */
-package aspects.xpt.diagram.editparts;
-
-import aspects.xpt.QualifiedClassNameProvider;
-import com.google.inject.Inject;
-import com.google.inject.Singleton;
-import org.eclipse.gmf.codegen.gmfgen.GenCommonBase;
-import org.eclipse.gmf.codegen.gmfgen.GenContainerBase;
-import org.eclipse.xtend2.lib.StringConcatenation;
-
-@Singleton
-@SuppressWarnings("all")
-public class Common extends xpt.diagram.editparts.Common {
- @Inject
- private QualifiedClassNameProvider qualifiedClassNameProvider;
-
- public CharSequence installCanonicalEditPolicy(final GenContainerBase it) {
- StringConcatenation _builder = new StringConcatenation();
- {
- boolean _needsCanonicalEditPolicy = it.needsCanonicalEditPolicy();
- if (_needsCanonicalEditPolicy) {
- _builder.append("\t\t\t\t");
- _builder.append("//in Papyrus diagrams are not strongly synchronised");
- _builder.newLine();
- _builder.append("//installEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CANONICAL_ROLE, new ");
- String _canonicalEditPolicyQualifiedClassName = it.getCanonicalEditPolicyQualifiedClassName();
- _builder.append(_canonicalEditPolicyQualifiedClassName, "");
- _builder.append("());");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.newLine();
- }
- }
- return _builder;
- }
-
- public CharSequence creationEditPolicyNewInstance(final GenCommonBase it) {
- StringConcatenation _builder = new StringConcatenation();
- _builder.append("new org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.DefaultCreationEditPolicy()");
- return _builder;
- }
-
- public CharSequence installSemanticEditPolicy(final GenCommonBase it) {
- StringConcatenation _builder = new StringConcatenation();
- {
- boolean _isSansDomain = it.isSansDomain();
- if (_isSansDomain) {
- _builder.append("removeEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.SEMANTIC_ROLE);");
- _builder.newLine();
- } else {
- _builder.append("installEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.SEMANTIC_ROLE, new ");
- CharSequence _itemSemanticEditPolicyQualifiedClassName = this.qualifiedClassNameProvider.getItemSemanticEditPolicyQualifiedClassName(it);
- _builder.append(_itemSemanticEditPolicyQualifiedClassName, "");
- _builder.append("());");
- _builder.newLineIfNotEmpty();
- }
- }
- return _builder;
- }
-}
diff --git a/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/diagram/editparts/EditPartFactory.java b/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/diagram/editparts/EditPartFactory.java
deleted file mode 100644
index 0832764b243..00000000000
--- a/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/diagram/editparts/EditPartFactory.java
+++ /dev/null
@@ -1,162 +0,0 @@
-/**
- * Copyright (c) 2006, 2010, 2013 Borland Software Corporation and others
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Dmitry Stadnik (Borland) - initial API and implementation
- * Michael Golubev (Montages) - #386838 - migrate to Xtend2
- */
-package aspects.xpt.diagram.editparts;
-
-import com.google.inject.Inject;
-import com.google.inject.Singleton;
-import org.eclipse.gmf.codegen.gmfgen.GenDiagram;
-import org.eclipse.xtend2.lib.StringConcatenation;
-import org.eclipse.xtext.xbase.lib.Extension;
-import xpt.Common;
-
-@Singleton
-@SuppressWarnings("all")
-public class EditPartFactory extends xpt.diagram.editparts.EditPartFactory {
- @Inject
- @Extension
- private Common _common;
-
- public CharSequence getTextCellEditorLocator(final GenDiagram it) {
- StringConcatenation _builder = new StringConcatenation();
- CharSequence _generatedMemberComment = this._common.generatedMemberComment();
- _builder.append(_generatedMemberComment, "");
- _builder.newLineIfNotEmpty();
- _builder.append("public static org.eclipse.gef.tools.CellEditorLocator getTextCellEditorLocator(");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart source) {");
- _builder.newLine();
- _builder.append("\t\t ");
- _builder.append("if (source.getFigure() instanceof org.eclipse.papyrus.uml.diagram.common.figure.node.IMultilineEditableFigure){");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("return new MultilineCellEditorLocator(");
- _builder.newLine();
- _builder.append("\t\t\t\t");
- _builder.append("(org.eclipse.papyrus.uml.diagram.common.figure.node.IMultilineEditableFigure) source.getFigure());");
- _builder.newLine();
- _builder.append("\t\t\t\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t\t\t\t ");
- _builder.append("else {");
- _builder.newLine();
- _builder.append("\t\t\t\t ");
- _builder.append("return org.eclipse.gmf.tooling.runtime.directedit.locator.CellEditorLocatorAccess.INSTANCE.getTextCellEditorLocator(source);");
- _builder.newLine();
- _builder.newLine();
- _builder.append(" ");
- _builder.append("}");
- _builder.newLine();
- _builder.append(" ");
- _builder.append("}");
- _builder.newLine();
- _builder.append(" ");
- _builder.newLine();
- _builder.append(" ");
- _builder.newLine();
- _builder.append(" ");
- CharSequence _generatedClassComment = this._common.generatedClassComment();
- _builder.append(_generatedClassComment, " ");
- _builder.newLineIfNotEmpty();
- _builder.append(" ");
- _builder.append("static private class MultilineCellEditorLocator implements org.eclipse.gef.tools.CellEditorLocator {");
- _builder.newLine();
- _builder.newLine();
- _builder.append("\t");
- CharSequence _generatedClassComment_1 = this._common.generatedClassComment();
- _builder.append(_generatedClassComment_1, "\t");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.append("private org.eclipse.papyrus.uml.diagram.common.figure.node.IMultilineEditableFigure multilineEditableFigure;");
- _builder.newLine();
- _builder.newLine();
- _builder.append("\t");
- CharSequence _generatedClassComment_2 = this._common.generatedClassComment();
- _builder.append(_generatedClassComment_2, "\t");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.append("public MultilineCellEditorLocator(org.eclipse.papyrus.uml.diagram.common.figure.node.IMultilineEditableFigure figure) {");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("this.multilineEditableFigure = figure;");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- _builder.newLine();
- _builder.append("\t");
- CharSequence _generatedClassComment_3 = this._common.generatedClassComment();
- _builder.append(_generatedClassComment_3, "\t");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.append("public org.eclipse.papyrus.uml.diagram.common.figure.node.IMultilineEditableFigure getMultilineEditableFigure() {");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("return multilineEditableFigure;");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- _builder.newLine();
- _builder.append("\t");
- CharSequence _generatedClassComment_4 = this._common.generatedClassComment();
- _builder.append(_generatedClassComment_4, "\t");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.append("public void relocate(org.eclipse.jface.viewers.CellEditor celleditor) {");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("org.eclipse.swt.widgets.Text text = (org.eclipse.swt.widgets.Text) celleditor.getControl();");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("org.eclipse.draw2d.geometry.Rectangle rect = getMultilineEditableFigure().getBounds().getCopy();");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("rect.x=getMultilineEditableFigure().getEditionLocation().x;");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("rect.y=getMultilineEditableFigure().getEditionLocation().y;");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("getMultilineEditableFigure().translateToAbsolute(rect);");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("if (getMultilineEditableFigure().getText().length() > 0) {");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("rect.setSize(new org.eclipse.draw2d.geometry.Dimension(text.computeSize(rect.width,");
- _builder.newLine();
- _builder.append("\t\t\t\t");
- _builder.append("org.eclipse.swt.SWT.DEFAULT)));");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("if (!rect.equals(new org.eclipse.draw2d.geometry.Rectangle(text.getBounds()))) {");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("text.setBounds(rect.x, rect.y, rect.width, rect.height);");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("}");
- _builder.newLine();
- return _builder;
- }
-}
diff --git a/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/diagram/editpolicies/.gitignore b/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/diagram/editpolicies/.gitignore
deleted file mode 100644
index ebafb7ab176..00000000000
--- a/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/diagram/editpolicies/.gitignore
+++ /dev/null
@@ -1,11 +0,0 @@
-/TextSelectionEditPolicy.java
-/BaseItemSemanticEditPolicy.java
-/CompartmentItemSemanticEditPolicy.java
-/DiagramItemSemanticEditPolicy.java
-/LinkItemSemanticEditPolicy.java
-/NodeItemSemanticEditPolicy.java
-/OpenDiagram.java
-/TextNonResizableEditPolicy.java
-/Utils_qvto.java
-/childContainerCreateCommand.java
-/linkCommands.java
diff --git a/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/diagram/editpolicies/BaseItemSemanticEditPolicy.java b/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/diagram/editpolicies/BaseItemSemanticEditPolicy.java
deleted file mode 100644
index 83407a31f13..00000000000
--- a/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/diagram/editpolicies/BaseItemSemanticEditPolicy.java
+++ /dev/null
@@ -1,1161 +0,0 @@
-/**
- * Copyright (c) 2007, 2010 Borland Software Corporation and others
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Alexander Shatalin (Borland) - initial API and implementation
- * Michael Golubev (Montages) - #386838 - migrate to Xtend2
- */
-package aspects.xpt.diagram.editpolicies;
-
-import com.google.common.base.Objects;
-import com.google.common.collect.Iterators;
-import com.google.inject.Inject;
-import com.google.inject.Singleton;
-import java.util.Iterator;
-import metamodel.MetaModel;
-import org.eclipse.emf.codegen.ecore.genmodel.GenClass;
-import org.eclipse.emf.codegen.ecore.genmodel.GenFeature;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.common.util.TreeIterator;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.gmf.codegen.gmfgen.GenConstraint;
-import org.eclipse.gmf.codegen.gmfgen.GenDiagram;
-import org.eclipse.gmf.codegen.gmfgen.GenEditorGenerator;
-import org.eclipse.gmf.codegen.gmfgen.GenExpressionProviderBase;
-import org.eclipse.gmf.codegen.gmfgen.GenExpressionProviderContainer;
-import org.eclipse.gmf.codegen.gmfgen.GenLink;
-import org.eclipse.gmf.codegen.gmfgen.GenLinkConstraints;
-import org.eclipse.gmf.codegen.gmfgen.LinkModelFacet;
-import org.eclipse.gmf.codegen.gmfgen.TypeLinkModelFacet;
-import org.eclipse.papyrus.papyrusgmfgenextension.GenerateUsingElementTypeCreationCommand;
-import org.eclipse.xtend2.lib.StringConcatenation;
-import org.eclipse.xtext.xbase.lib.Extension;
-import org.eclipse.xtext.xbase.lib.Functions.Function1;
-import org.eclipse.xtext.xbase.lib.IterableExtensions;
-import org.eclipse.xtext.xbase.lib.IteratorExtensions;
-import plugin.Activator;
-import xpt.Common;
-import xpt.OclMigrationProblems_qvto;
-import xpt.diagram.editpolicies.Utils_qvto;
-import xpt.editor.VisualIDRegistry;
-import xpt.providers.ElementTypes;
-
-@Singleton
-@SuppressWarnings("all")
-public class BaseItemSemanticEditPolicy extends xpt.diagram.editpolicies.BaseItemSemanticEditPolicy {
- @Inject
- @Extension
- private Common _common;
-
- @Inject
- private Activator xptPluginActivator;
-
- @Inject
- @Extension
- private VisualIDRegistry _visualIDRegistry;
-
- @Inject
- private ElementTypes xptElementTypes;
-
- @Inject
- @Extension
- private OclMigrationProblems_qvto _oclMigrationProblems_qvto;
-
- @Inject
- @Extension
- private Utils_qvto _utils_qvto;
-
- @Inject
- private MetaModel xptMetaModel;
-
- public CharSequence BaseItemSemanticEditPolicy(final GenDiagram it) {
- StringConcatenation _builder = new StringConcatenation();
- GenEditorGenerator _editorGen = it.getEditorGen();
- CharSequence _copyright = this._common.copyright(_editorGen);
- _builder.append(_copyright, "");
- _builder.newLineIfNotEmpty();
- _builder.append("package ");
- CharSequence _packageName = this.packageName(it);
- _builder.append(_packageName, "");
- _builder.append(";");
- _builder.newLineIfNotEmpty();
- _builder.newLine();
- CharSequence _generatedClassComment = this._common.generatedClassComment();
- _builder.append(_generatedClassComment, "");
- _builder.newLineIfNotEmpty();
- _builder.append("public class ");
- CharSequence _className = this.className(it);
- _builder.append(_className, "");
- _builder.append(" extends org.eclipse.gmf.runtime.diagram.ui.editpolicies.SemanticEditPolicy {");
- _builder.newLineIfNotEmpty();
- _builder.newLine();
- _builder.append("\t");
- CharSequence _attributes = this.attributes(it);
- _builder.append(_attributes, "\t");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.newLine();
- _builder.append("\t");
- CharSequence _constructor = this.constructor(it);
- _builder.append(_constructor, "\t");
- _builder.newLineIfNotEmpty();
- _builder.newLine();
- _builder.append("\t");
- CharSequence _generatedMemberComment = this._common.generatedMemberComment(
- ((((((("Extended request data key to hold editpart visual id.\n" + "Add visual id of edited editpart to extended data of the request\n") + "so command switch can decide what kind of diagram element is being edited.\n") + "It is done in those cases when it\'s not possible to deduce diagram\n") + "element kind from domain element.\n") + "Add the reoriented view to the request extended data so that the view\n ") + "currently edited can be distinguished from other views of the same element\n ") +
- "and these latter possibly removed if they become inconsistent after reconnect\n"));
- _builder.append(_generatedMemberComment, "\t");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.append("@SuppressWarnings(\"unchecked\")");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("public org.eclipse.gef.commands.Command getCommand(org.eclipse.gef.Request request) {");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("if (request instanceof org.eclipse.gef.requests.ReconnectRequest) {");
- _builder.newLine();
- _builder.append("\t\t\t");
- _builder.append("Object view = ((org.eclipse.gef.requests.ReconnectRequest) request).getConnectionEditPart().getModel();");
- _builder.newLine();
- _builder.append("\t\t\t");
- _builder.append("if (view instanceof org.eclipse.gmf.runtime.notation.View) {");
- _builder.newLine();
- _builder.append("\t\t\t\t");
- _builder.append("Integer id = new Integer(");
- CharSequence _visualIDMethodCall = this._visualIDRegistry.getVisualIDMethodCall(it);
- _builder.append(_visualIDMethodCall, "\t\t\t\t");
- _builder.append("((org.eclipse.gmf.runtime.notation.View) view));");
- _builder.newLineIfNotEmpty();
- _builder.append("\t\t\t\t");
- _builder.append("request.getExtendedData().put(VISUAL_ID_KEY, id);");
- _builder.newLine();
- _builder.append("\t\t\t\t");
- _builder.append("request.getExtendedData().put(GRAPHICAL_RECONNECTED_EDGE, view);");
- _builder.newLine();
- _builder.append("\t\t\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("return super.getCommand(request);");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t");
- _builder.newLine();
- _builder.append("\t");
- CharSequence _generatedMemberComment_1 = this._common.generatedMemberComment("Returns visual id from request parameters.");
- _builder.append(_generatedMemberComment_1, "\t");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.append("protected int getVisualID(org.eclipse.gmf.runtime.emf.type.core.requests.IEditCommandRequest request) {");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("Object id = request.getParameter(VISUAL_ID_KEY);");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("return id instanceof Integer ? ((Integer) id).intValue() : -1;");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- _builder.newLine();
- _builder.append("\t");
- CharSequence _semanticPart = this.semanticPart(it);
- _builder.append(_semanticPart, "\t");
- _builder.newLineIfNotEmpty();
- _builder.newLine();
- _builder.append("\t");
- CharSequence _generatedMemberComment_2 = this._common.generatedMemberComment("Returns editing domain from the host edit part.");
- _builder.append(_generatedMemberComment_2, "\t");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.append("protected org.eclipse.emf.transaction.TransactionalEditingDomain getEditingDomain() {");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("return ((org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart) getHost()).getEditingDomain();");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- _builder.newLine();
- _builder.append("\t");
- CharSequence _addDestroyShortcutsCommand = this.addDestroyShortcutsCommand(it);
- _builder.append(_addDestroyShortcutsCommand, "\t");
- _builder.newLineIfNotEmpty();
- _builder.newLine();
- {
- EList<GenLink> _links = it.getLinks();
- final Function1<GenLink, Boolean> _function = new Function1<GenLink, Boolean>() {
- public Boolean apply(final GenLink link) {
- boolean _isSansDomain = link.isSansDomain();
- return Boolean.valueOf((!_isSansDomain));
- }
- };
- boolean _exists = IterableExtensions.<GenLink>exists(_links, _function);
- if (_exists) {
- CharSequence _linkConstraints = this.linkConstraints(it);
- _builder.append(_linkConstraints, "");
- _builder.newLineIfNotEmpty();
- }
- }
- _builder.newLine();
- _builder.append("\t");
- CharSequence _additions = this.additions(it);
- _builder.append(_additions, "\t");
- _builder.newLineIfNotEmpty();
- _builder.append("}");
- _builder.newLine();
- return _builder;
- }
-
- public CharSequence addDestroyShortcutsCommand(final GenDiagram it) {
- StringConcatenation _builder = new StringConcatenation();
- CharSequence _generatedMemberComment = this._common.generatedMemberComment("Clean all shortcuts to the host element from the same diagram");
- _builder.append(_generatedMemberComment, "");
- _builder.newLineIfNotEmpty();
- _builder.append("protected void addDestroyShortcutsCommand(org.eclipse.gmf.runtime.common.core.command.ICompositeCommand cmd, org.eclipse.gmf.runtime.notation.View view) {");
- _builder.newLine();
- _builder.append("\t");
- CharSequence __assert = this._common._assert("view.getEAnnotation(\"Shortcut\") == null");
- _builder.append(__assert, "\t");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.append("for (java.util.Iterator<?> it = view.getDiagram().getChildren().iterator(); it.hasNext();) {");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("org.eclipse.gmf.runtime.notation.View nextView = (org.eclipse.gmf.runtime.notation.View) it.next();");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("if (nextView.getEAnnotation(\"Shortcut\") == null || !nextView.isSetElement() || nextView.getElement() != view.getElement()) { ");
- CharSequence _nonNLS = this._common.nonNLS();
- _builder.append(_nonNLS, "\t\t");
- _builder.newLineIfNotEmpty();
- _builder.append("\t\t\t");
- _builder.append("continue;");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("cmd.add(new org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), nextView));");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("}");
- _builder.newLine();
- return _builder;
- }
-
- public CharSequence attributes(final GenDiagram it) {
- StringConcatenation _builder = new StringConcatenation();
- CharSequence _generatedMemberComment = this._common.generatedMemberComment("Extended request data key to hold editpart visual id.");
- _builder.append(_generatedMemberComment, "");
- _builder.newLineIfNotEmpty();
- _builder.append("public static final String VISUAL_ID_KEY = \"visual_id\"; ");
- CharSequence _nonNLS = this._common.nonNLS();
- _builder.append(_nonNLS, "");
- _builder.newLineIfNotEmpty();
- CharSequence _generatedMemberComment_1 = this._common.generatedMemberComment("Extended request data key to hold the edge view during a reconnect request.");
- _builder.append(_generatedMemberComment_1, "");
- _builder.newLineIfNotEmpty();
- _builder.append("public static final String GRAPHICAL_RECONNECTED_EDGE = \"graphical_edge\"; ");
- CharSequence _nonNLS_1 = this._common.nonNLS();
- _builder.append(_nonNLS_1, "");
- _builder.newLineIfNotEmpty();
- CharSequence _generatedMemberComment_2 = this._common.generatedMemberComment();
- _builder.append(_generatedMemberComment_2, "");
- _builder.newLineIfNotEmpty();
- _builder.append("private final org.eclipse.gmf.runtime.emf.type.core.IElementType myElementType;");
- _builder.newLine();
- return _builder;
- }
-
- public CharSequence semanticPart(final GenDiagram it) {
- StringConcatenation _builder = new StringConcatenation();
- CharSequence _semanticCommand = this.getSemanticCommand(it);
- _builder.append(_semanticCommand, "");
- _builder.newLineIfNotEmpty();
- _builder.newLine();
- CharSequence _addDeleteViewCommand = this.addDeleteViewCommand(it);
- _builder.append(_addDeleteViewCommand, "");
- _builder.newLineIfNotEmpty();
- _builder.newLine();
- CharSequence _editHelperCommand = this.getEditHelperCommand(it);
- _builder.append(_editHelperCommand, "");
- _builder.newLineIfNotEmpty();
- _builder.newLine();
- CharSequence _contextElementType = this.getContextElementType(it);
- _builder.append(_contextElementType, "");
- _builder.newLineIfNotEmpty();
- _builder.newLine();
- CharSequence _semanticCommandSwitch = this.getSemanticCommandSwitch(it);
- _builder.append(_semanticCommandSwitch, "");
- _builder.newLineIfNotEmpty();
- _builder.newLine();
- CharSequence _configureCommand = this.getConfigureCommand(it);
- _builder.append(_configureCommand, "");
- _builder.newLineIfNotEmpty();
- _builder.newLine();
- CharSequence _createRelationshipCommand = this.getCreateRelationshipCommand(it);
- _builder.append(_createRelationshipCommand, "");
- _builder.newLineIfNotEmpty();
- _builder.newLine();
- CharSequence _createCommand = this.getCreateCommand(it);
- _builder.append(_createCommand, "");
- _builder.newLineIfNotEmpty();
- _builder.newLine();
- _builder.append("// RS: add code for extended types");
- _builder.newLine();
- CharSequence _createExtendedTypeCommand = this.getCreateExtendedTypeCommand(it);
- _builder.append(_createExtendedTypeCommand, "");
- _builder.newLineIfNotEmpty();
- CharSequence _extendedStartCreateRelationshipCommand = this.getExtendedStartCreateRelationshipCommand(it);
- _builder.append(_extendedStartCreateRelationshipCommand, "");
- _builder.newLineIfNotEmpty();
- CharSequence _extendedCompleteCreateRelationshipCommand = this.getExtendedCompleteCreateRelationshipCommand(it);
- _builder.append(_extendedCompleteCreateRelationshipCommand, "");
- _builder.newLineIfNotEmpty();
- _builder.append("// RS: End of add code for extended types");
- _builder.newLine();
- CharSequence _createSemanticServiceEditCommand = this.getCreateSemanticServiceEditCommand(it);
- _builder.append(_createSemanticServiceEditCommand, "");
- _builder.newLineIfNotEmpty();
- _builder.newLine();
- CharSequence _setCommand = this.getSetCommand(it);
- _builder.append(_setCommand, "");
- _builder.newLineIfNotEmpty();
- _builder.newLine();
- CharSequence _editContextCommand = this.getEditContextCommand(it);
- _builder.append(_editContextCommand, "");
- _builder.newLineIfNotEmpty();
- _builder.newLine();
- CharSequence _destroyElementCommand = this.getDestroyElementCommand(it);
- _builder.append(_destroyElementCommand, "");
- _builder.newLineIfNotEmpty();
- _builder.newLine();
- CharSequence _destroyReferenceCommand = this.getDestroyReferenceCommand(it);
- _builder.append(_destroyReferenceCommand, "");
- _builder.newLineIfNotEmpty();
- _builder.newLine();
- CharSequence _duplicateCommand = this.getDuplicateCommand(it);
- _builder.append(_duplicateCommand, "");
- _builder.newLineIfNotEmpty();
- _builder.newLine();
- CharSequence _moveCommand = this.getMoveCommand(it);
- _builder.append(_moveCommand, "");
- _builder.newLineIfNotEmpty();
- _builder.newLine();
- CharSequence _reorientReferenceRelationshipCommand = this.getReorientReferenceRelationshipCommand(it);
- _builder.append(_reorientReferenceRelationshipCommand, "");
- _builder.newLineIfNotEmpty();
- _builder.newLine();
- CharSequence _reorientRelationshipCommand = this.getReorientRelationshipCommand(it);
- _builder.append(_reorientRelationshipCommand, "");
- _builder.newLineIfNotEmpty();
- _builder.newLine();
- CharSequence _gEFWrapper = this.getGEFWrapper(it);
- _builder.append(_gEFWrapper, "");
- _builder.newLineIfNotEmpty();
- return _builder;
- }
-
- public CharSequence getContextElementType(final GenDiagram it) {
- StringConcatenation _builder = new StringConcatenation();
- CharSequence _generatedMemberComment = this._common.generatedMemberComment();
- _builder.append(_generatedMemberComment, "");
- _builder.newLineIfNotEmpty();
- _builder.append("protected org.eclipse.gmf.runtime.emf.type.core.IElementType getContextElementType(org.eclipse.gmf.runtime.emf.type.core.requests.IEditCommandRequest request) {");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("org.eclipse.gmf.runtime.emf.type.core.IElementType requestContextElementType = ");
- CharSequence _qualifiedClassName = this.xptElementTypes.qualifiedClassName(it);
- _builder.append(_qualifiedClassName, "\t");
- _builder.append(".getElementType(getVisualID(request));");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.append("return requestContextElementType != null ? requestContextElementType : myElementType;");
- _builder.newLine();
- _builder.append("}");
- _builder.newLine();
- return _builder;
- }
-
- public CharSequence getCreateRelationshipCommand(final GenDiagram it) {
- StringConcatenation _builder = new StringConcatenation();
- CharSequence _generatedMemberComment = this._common.generatedMemberComment();
- _builder.append(_generatedMemberComment, "");
- _builder.newLineIfNotEmpty();
- _builder.append("protected org.eclipse.gef.commands.Command getCreateRelationshipCommand(org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest req) {");
- _builder.newLine();
- {
- Resource _eResource = it.eResource();
- TreeIterator<EObject> _allContents = _eResource.getAllContents();
- Iterator<GenerateUsingElementTypeCreationCommand> _filter = Iterators.<GenerateUsingElementTypeCreationCommand>filter(_allContents, GenerateUsingElementTypeCreationCommand.class);
- int _size = IteratorExtensions.size(_filter);
- boolean _lessThan = (_size < 1);
- if (_lessThan) {
- _builder.append("\t");
- _builder.append("return null;");
- _builder.newLine();
- }
- }
- {
- Resource _eResource_1 = it.eResource();
- TreeIterator<EObject> _allContents_1 = _eResource_1.getAllContents();
- Iterator<GenerateUsingElementTypeCreationCommand> _filter_1 = Iterators.<GenerateUsingElementTypeCreationCommand>filter(_allContents_1, GenerateUsingElementTypeCreationCommand.class);
- int _size_1 = IteratorExtensions.size(_filter_1);
- boolean _greaterThan = (_size_1 > 0);
- if (_greaterThan) {
- _builder.append("\t");
- _builder.append("org.eclipse.papyrus.infra.services.edit.service.IElementEditService commandService = org.eclipse.papyrus.infra.services.edit.service.ElementEditServiceUtils.getCommandProvider(((org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart)getHost()).resolveSemanticElement());");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("if(req.getElementType() != null) {");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("\t");
- _builder.append("commandService = org.eclipse.papyrus.infra.services.edit.service.ElementEditServiceUtils.getCommandProvider(req.getElementType());");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- _builder.newLine();
- _builder.append("\t");
- _builder.append("if(commandService == null) {");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("\t");
- _builder.append("return org.eclipse.gef.commands.UnexecutableCommand.INSTANCE;");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- _builder.newLine();
- _builder.append("\t");
- _builder.append("org.eclipse.gmf.runtime.common.core.command.ICommand semanticCommand = commandService.getEditCommand(req);");
- _builder.newLine();
- _builder.newLine();
- _builder.append("\t");
- _builder.append("if((semanticCommand != null) && (semanticCommand.canExecute())) {");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("\t");
- _builder.append("return getGEFWrapper(semanticCommand);");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("} ");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("return org.eclipse.gef.commands.UnexecutableCommand.INSTANCE;");
- _builder.newLine();
- }
- }
- _builder.append("}");
- _builder.newLine();
- return _builder;
- }
-
- public CharSequence getCreateCommand(final GenDiagram it) {
- StringConcatenation _builder = new StringConcatenation();
- CharSequence _generatedMemberComment = this._common.generatedMemberComment();
- _builder.append(_generatedMemberComment, "");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.append("protected org.eclipse.gef.commands.Command getCreateCommand(org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest req) {");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("org.eclipse.gmf.runtime.emf.type.core.IElementType requestElementType = req.getElementType();");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("if (requestElementType instanceof org.eclipse.gmf.runtime.emf.type.core.IElementType) {");
- _builder.newLine();
- _builder.append("\t\t\t\t\t\t");
- _builder.append("org.eclipse.papyrus.infra.services.edit.service.IElementEditService commandProvider = org.eclipse.papyrus.infra.services.edit.service.ElementEditServiceUtils.getCommandProvider(req.getContainer());");
- _builder.newLine();
- _builder.append("\t\t\t");
- _builder.append("if (commandProvider != null) {");
- _builder.newLine();
- _builder.append("\t\t\t\t");
- _builder.append("org.eclipse.gmf.runtime.common.core.command.ICommand command = commandProvider.getEditCommand(req);");
- _builder.newLine();
- _builder.append("\t\t\t\t");
- _builder.append("if (command != null && command.canExecute()) {");
- _builder.newLine();
- _builder.append("\t\t\t\t\t");
- _builder.append("return new org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy(command);");
- _builder.newLine();
- _builder.append("\t\t\t\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t\t\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("return null;");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- return _builder;
- }
-
- public CharSequence getCreateExtendedTypeCommand(final GenDiagram it) {
- StringConcatenation _builder = new StringConcatenation();
- CharSequence _generatedMemberComment = this._common.generatedMemberComment();
- _builder.append(_generatedMemberComment, "");
- _builder.newLineIfNotEmpty();
- _builder.append(" ");
- _builder.append("protected org.eclipse.gef.commands.Command getExtendedTypeCreationCommand(org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest request, org.eclipse.gmf.runtime.emf.type.core.IElementType requestElementType) {");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("org.eclipse.papyrus.infra.services.edit.service.IElementEditService provider = org.eclipse.papyrus.infra.services.edit.service.ElementEditServiceUtils.getCommandProvider(request.getContainer());");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("if(provider == null) {");
- _builder.newLine();
- _builder.append("\t\t\t");
- _builder.append("return org.eclipse.gef.commands.UnexecutableCommand.INSTANCE;");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("// Retrieve create command from the Element Edit service");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("org.eclipse.gmf.runtime.common.core.command.ICommand createGMFCommand = provider.getEditCommand(request);");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("return getGEFWrapper(createGMFCommand);");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- return _builder;
- }
-
- public CharSequence getExtendedStartCreateRelationshipCommand(final GenDiagram it) {
- StringConcatenation _builder = new StringConcatenation();
- CharSequence _generatedMemberComment = this._common.generatedMemberComment();
- _builder.append(_generatedMemberComment, "");
- _builder.newLineIfNotEmpty();
- _builder.append(" ");
- _builder.append("protected org.eclipse.gef.commands.Command getExtendedStartCreateRelationshipCommand(org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest request, org.eclipse.gmf.runtime.emf.type.core.IElementType requestElementType) {");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("org.eclipse.papyrus.infra.services.edit.service.IElementEditService provider = org.eclipse.papyrus.infra.services.edit.service.ElementEditServiceUtils.getCommandProvider(requestElementType);");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("if(provider == null) {");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("return org.eclipse.gef.commands.UnexecutableCommand.INSTANCE;");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("// Retrieve create command from the Element Edit service");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("org.eclipse.gmf.runtime.common.core.command.ICommand createGMFCommand = provider.getEditCommand(request);");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("return getGEFWrapper(createGMFCommand);");
- _builder.newLine();
- _builder.append("}");
- _builder.newLine();
- return _builder;
- }
-
- public CharSequence getExtendedCompleteCreateRelationshipCommand(final GenDiagram it) {
- StringConcatenation _builder = new StringConcatenation();
- CharSequence _generatedMemberComment = this._common.generatedMemberComment();
- _builder.append(_generatedMemberComment, "");
- _builder.newLineIfNotEmpty();
- _builder.append(" ");
- _builder.append("protected org.eclipse.gef.commands.Command getExtendedCompleteCreateRelationshipCommand(org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest request, org.eclipse.gmf.runtime.emf.type.core.IElementType requestElementType) {");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("org.eclipse.papyrus.infra.services.edit.service.IElementEditService provider = org.eclipse.papyrus.infra.services.edit.service.ElementEditServiceUtils.getCommandProvider(requestElementType);");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("if(provider == null) {");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("return org.eclipse.gef.commands.UnexecutableCommand.INSTANCE;");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("// Retrieve create command from the Element Edit service");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("org.eclipse.gmf.runtime.common.core.command.ICommand createGMFCommand = provider.getEditCommand(request);");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("return getGEFWrapper(createGMFCommand);");
- _builder.newLine();
- _builder.append("}");
- _builder.newLine();
- return _builder;
- }
-
- public CharSequence getMoveCommand(final GenDiagram it) {
- StringConcatenation _builder = new StringConcatenation();
- CharSequence _generatedMemberComment = this._common.generatedMemberComment();
- _builder.append(_generatedMemberComment, "");
- _builder.newLineIfNotEmpty();
- _builder.append("protected org.eclipse.gef.commands.Command getMoveCommand(org.eclipse.gmf.runtime.emf.type.core.requests.MoveRequest req) {");
- _builder.newLine();
- _builder.append("\t\t\t\t");
- _builder.append("org.eclipse.emf.ecore.EObject targetCEObject = req.getTargetContainer();");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("if(targetCEObject != null) {");
- _builder.newLine();
- _builder.append("\t\t\t");
- _builder.append("org.eclipse.papyrus.infra.services.edit.service.IElementEditService provider = org.eclipse.papyrus.infra.services.edit.service.ElementEditServiceUtils.getCommandProvider(targetCEObject);");
- _builder.newLine();
- _builder.append("\t\t\t");
- _builder.append("if(provider != null) {");
- _builder.newLine();
- _builder.append("\t\t\t\t");
- _builder.append("org.eclipse.gmf.runtime.common.core.command.ICommand moveCommand = provider.getEditCommand(req);");
- _builder.newLine();
- _builder.append("\t\t\t\t");
- _builder.append("if(moveCommand != null) {");
- _builder.newLine();
- _builder.append("\t\t\t\t\t");
- _builder.append("return new org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy(moveCommand);");
- _builder.newLine();
- _builder.append("\t\t\t\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t\t\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t\t\t");
- _builder.append("return org.eclipse.gef.commands.UnexecutableCommand.INSTANCE;");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("} else {");
- _builder.newLine();
- _builder.append("\t\t\t");
- _builder.append("return getGEFWrapper(new org.eclipse.gmf.runtime.emf.type.core.commands.MoveElementsCommand(req));");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.newLine();
- _builder.append("}");
- _builder.newLine();
- return _builder;
- }
-
- /**
- * FIXME need to check constraint's provider to ensure we don't generate a field
- * for e.g. Java (or Literal, which is unlikely, though) expressions
- *
- * [Papyrus Quick Fix] Do not generate field when the expression is provided
- * by a GenJavaExpressionProvider.
- */
- public CharSequence linkConstraints(final GenDiagram it) {
- StringConcatenation _builder = new StringConcatenation();
- _builder.newLine();
- _builder.append("\t");
- CharSequence _generatedMemberComment = this._common.generatedMemberComment();
- _builder.append(_generatedMemberComment, "\t");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.append("public static ");
- String _linkCreationConstraintsClassName = it.getLinkCreationConstraintsClassName();
- _builder.append(_linkCreationConstraintsClassName, "\t");
- _builder.append(" getLinkConstraints() {");
- _builder.newLineIfNotEmpty();
- _builder.append("\t\t");
- String _linkCreationConstraintsClassName_1 = it.getLinkCreationConstraintsClassName();
- _builder.append(_linkCreationConstraintsClassName_1, "\t\t");
- _builder.append(" cached = ");
- GenEditorGenerator _editorGen = it.getEditorGen();
- CharSequence _instanceAccess = this.xptPluginActivator.instanceAccess(_editorGen);
- _builder.append(_instanceAccess, "\t\t");
- _builder.append(".getLinkConstraints();");
- _builder.newLineIfNotEmpty();
- _builder.append("\t\t");
- _builder.append("if (cached == null) {");
- _builder.newLine();
- _builder.append("\t\t\t");
- GenEditorGenerator _editorGen_1 = it.getEditorGen();
- CharSequence _instanceAccess_1 = this.xptPluginActivator.instanceAccess(_editorGen_1);
- _builder.append(_instanceAccess_1, "\t\t\t");
- _builder.append(".setLinkConstraints(cached = new ");
- String _linkCreationConstraintsClassName_2 = it.getLinkCreationConstraintsClassName();
- _builder.append(_linkCreationConstraintsClassName_2, "\t\t\t");
- _builder.append("());");
- _builder.newLineIfNotEmpty();
- _builder.append("\t\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("return cached;");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- _builder.newLine();
- CharSequence _generatedClassComment = this._common.generatedClassComment();
- _builder.append(_generatedClassComment, "");
- _builder.newLineIfNotEmpty();
- _builder.append("public static class ");
- String _linkCreationConstraintsClassName_3 = it.getLinkCreationConstraintsClassName();
- _builder.append(_linkCreationConstraintsClassName_3, "");
- _builder.append(" {");
- _builder.newLineIfNotEmpty();
- _builder.newLine();
- _builder.append("\t");
- CharSequence _generatedMemberComment_1 = this._common.generatedMemberComment();
- _builder.append(_generatedMemberComment_1, "\t");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.append("public ");
- String _linkCreationConstraintsClassName_4 = it.getLinkCreationConstraintsClassName();
- _builder.append(_linkCreationConstraintsClassName_4, "\t");
- _builder.append("() {");
- _builder.append("\t\t// use static method #getLinkConstraints() to access instance");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- _builder.newLine();
- {
- EList<GenLink> _links = it.getLinks();
- for(final GenLink nextLink : _links) {
- _builder.append("\t");
- CharSequence _canCreate = this.canCreate(nextLink);
- _builder.append(_canCreate, "\t");
- _builder.newLineIfNotEmpty();
- }
- }
- _builder.newLine();
- {
- EList<GenLink> _links_1 = it.getLinks();
- for(final GenLink nextLink_1 : _links_1) {
- _builder.append("\t");
- CharSequence _canExist = this.canExist(nextLink_1);
- _builder.append(_canExist, "\t");
- _builder.newLineIfNotEmpty();
- }
- }
- _builder.append("}");
- _builder.newLine();
- return _builder;
- }
-
- /**
- * [MG] extracted from LET statement, @see checkEMFConstraints(TypeLinkModelFacet)
- */
- private boolean checkChildFeatureBounds(final TypeLinkModelFacet it) {
- boolean _and = false;
- GenFeature _childMetaFeature = it.getChildMetaFeature();
- GenFeature _containmentMetaFeature = it.getContainmentMetaFeature();
- boolean _notEquals = (!Objects.equal(_childMetaFeature, _containmentMetaFeature));
- if (!_notEquals) {
- _and = false;
- } else {
- GenFeature _childMetaFeature_1 = it.getChildMetaFeature();
- EStructuralFeature _ecoreFeature = _childMetaFeature_1.getEcoreFeature();
- boolean _isUnbounded = this._oclMigrationProblems_qvto.isUnbounded(_ecoreFeature);
- boolean _not = (!_isUnbounded);
- _and = _not;
- }
- return _and;
- }
-
- public CharSequence checkEMFConstraints(final TypeLinkModelFacet it) {
- StringConcatenation _builder = new StringConcatenation();
- {
- GenFeature _containmentMetaFeature = it.getContainmentMetaFeature();
- EStructuralFeature _ecoreFeature = _containmentMetaFeature.getEcoreFeature();
- boolean _notEquals = (!Objects.equal(_ecoreFeature, null));
- if (_notEquals) {
- {
- boolean _or = false;
- GenFeature _containmentMetaFeature_1 = it.getContainmentMetaFeature();
- EStructuralFeature _ecoreFeature_1 = _containmentMetaFeature_1.getEcoreFeature();
- boolean _isUnbounded = this._oclMigrationProblems_qvto.isUnbounded(_ecoreFeature_1);
- boolean _not = (!_isUnbounded);
- if (_not) {
- _or = true;
- } else {
- boolean _checkChildFeatureBounds = this.checkChildFeatureBounds(it);
- _or = _checkChildFeatureBounds;
- }
- if (_or) {
- _builder.append("if (");
- String _containerVariable = this._utils_qvto.getContainerVariable(it);
- _builder.append(_containerVariable, "");
- _builder.append(" != null) {");
- _builder.newLineIfNotEmpty();
- _builder.append("\t\t\t");
- GenFeature _containmentMetaFeature_2 = it.getContainmentMetaFeature();
- CharSequence _checkEMFConstraints = this.checkEMFConstraints(_containmentMetaFeature_2, it);
- _builder.append(_checkEMFConstraints, "\t\t\t");
- _builder.newLineIfNotEmpty();
- {
- boolean _checkChildFeatureBounds_1 = this.checkChildFeatureBounds(it);
- if (_checkChildFeatureBounds_1) {
- _builder.append("\t\t\t");
- GenFeature _childMetaFeature = it.getChildMetaFeature();
- CharSequence _checkEMFConstraints_1 = this.checkEMFConstraints(_childMetaFeature, it);
- _builder.append(_checkEMFConstraints_1, "\t\t\t");
- _builder.newLineIfNotEmpty();
- }
- }
- _builder.append("}");
- _builder.newLine();
- }
- }
- }
- }
- return _builder;
- }
-
- public CharSequence checkEMFConstraints(final GenFeature it, final TypeLinkModelFacet modelFacet) {
- StringConcatenation _builder = new StringConcatenation();
- {
- GenFeature _containmentMetaFeature = modelFacet.getContainmentMetaFeature();
- EStructuralFeature _ecoreFeature = _containmentMetaFeature.getEcoreFeature();
- boolean _notEquals = (!Objects.equal(_ecoreFeature, null));
- if (_notEquals) {
- {
- EStructuralFeature _ecoreFeature_1 = it.getEcoreFeature();
- boolean _isUnbounded = this._oclMigrationProblems_qvto.isUnbounded(_ecoreFeature_1);
- boolean _not = (!_isUnbounded);
- if (_not) {
- _builder.append("if (");
- String _containerVariable = this._utils_qvto.getContainerVariable(modelFacet);
- GenClass _sourceType = modelFacet.getSourceType();
- CharSequence _featureBoundComparator = this.featureBoundComparator(it, _containerVariable, _sourceType);
- _builder.append(_featureBoundComparator, "");
- _builder.append(") {");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.append("return false;");
- _builder.newLine();
- _builder.append("}");
- _builder.newLine();
- }
- }
- }
- }
- return _builder;
- }
-
- public CharSequence canCreate(final GenLink it) {
- StringConcatenation _builder = new StringConcatenation();
- CharSequence _generatedMemberComment = this._common.generatedMemberComment();
- _builder.append(_generatedMemberComment, "");
- _builder.newLineIfNotEmpty();
- _builder.append("public boolean canCreate");
- String _uniqueIdentifier = it.getUniqueIdentifier();
- _builder.append(_uniqueIdentifier, "");
- _builder.append("(");
- _builder.newLineIfNotEmpty();
- {
- boolean _isSansDomain = it.isSansDomain();
- boolean _not = (!_isSansDomain);
- if (_not) {
- LinkModelFacet _modelFacet = it.getModelFacet();
- CharSequence _canCreateParameters = this.canCreateParameters(_modelFacet);
- _builder.append(_canCreateParameters, "");
- _builder.newLineIfNotEmpty();
- }
- }
- _builder.append(") {");
- _builder.newLine();
- {
- boolean _isSansDomain_1 = it.isSansDomain();
- boolean _not_1 = (!_isSansDomain_1);
- if (_not_1) {
- _builder.append("\t");
- LinkModelFacet _modelFacet_1 = it.getModelFacet();
- CharSequence _checkEMFConstraints = this.checkEMFConstraints(_modelFacet_1);
- _builder.append(_checkEMFConstraints, "\t");
- _builder.newLineIfNotEmpty();
- }
- }
- _builder.append("\t");
- _builder.append("return canExist");
- String _uniqueIdentifier_1 = it.getUniqueIdentifier();
- _builder.append(_uniqueIdentifier_1, "\t");
- _builder.append("(");
- _builder.newLineIfNotEmpty();
- {
- boolean _isSansDomain_2 = it.isSansDomain();
- boolean _not_2 = (!_isSansDomain_2);
- if (_not_2) {
- _builder.append("\t");
- LinkModelFacet _modelFacet_2 = it.getModelFacet();
- CharSequence _canCreateValues = this.canCreateValues(_modelFacet_2);
- _builder.append(_canCreateValues, "\t");
- _builder.newLineIfNotEmpty();
- }
- }
- _builder.append("\t");
- _builder.append(");");
- _builder.newLine();
- _builder.append("}");
- _builder.newLine();
- return _builder;
- }
-
- public CharSequence featureBoundsConditionClause(final GenFeature it, final String targetVar, final GenClass targetType) {
- StringConcatenation _builder = new StringConcatenation();
- {
- EStructuralFeature _ecoreFeature = it.getEcoreFeature();
- boolean _notEquals = (!Objects.equal(_ecoreFeature, null));
- if (_notEquals) {
- {
- EStructuralFeature _ecoreFeature_1 = it.getEcoreFeature();
- boolean _isUnbounded = this._oclMigrationProblems_qvto.isUnbounded(_ecoreFeature_1);
- boolean _not = (!_isUnbounded);
- if (_not) {
- CharSequence _featureBoundComparator = this.featureBoundComparator(it, targetVar, targetType);
- _builder.append(_featureBoundComparator, "");
- }
- }
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- {
- boolean _and = false;
- EStructuralFeature _ecoreFeature_2 = it.getEcoreFeature();
- boolean _isSingleValued = this._oclMigrationProblems_qvto.isSingleValued(_ecoreFeature_2);
- boolean _not_1 = (!_isSingleValued);
- if (!_not_1) {
- _and = false;
- } else {
- EStructuralFeature _ecoreFeature_3 = it.getEcoreFeature();
- boolean _isUnbounded_1 = this._oclMigrationProblems_qvto.isUnbounded(_ecoreFeature_3);
- boolean _not_2 = (!_isUnbounded_1);
- _and = _not_2;
- }
- if (_and) {
- _builder.append(" || ");
- }
- }
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- {
- EStructuralFeature _ecoreFeature_4 = it.getEcoreFeature();
- boolean _isSingleValued_1 = this._oclMigrationProblems_qvto.isSingleValued(_ecoreFeature_4);
- boolean _not_3 = (!_isSingleValued_1);
- if (_not_3) {
- CharSequence _featureUniquenessComparator = this.featureUniquenessComparator(it, targetVar, targetType);
- _builder.append(_featureUniquenessComparator, "\t");
- }
- }
- _builder.newLineIfNotEmpty();
- }
- }
- return _builder;
- }
-
- public CharSequence featureBoundComparator(final GenFeature it, final String featureVar, final GenClass featureVarGenClass) {
- StringConcatenation _builder = new StringConcatenation();
- CharSequence _featureValue = this.xptMetaModel.getFeatureValue(it, featureVar, featureVarGenClass);
- _builder.append(_featureValue, "");
- _builder.newLineIfNotEmpty();
- {
- EStructuralFeature _ecoreFeature = it.getEcoreFeature();
- int _upperBound = _ecoreFeature.getUpperBound();
- boolean _equals = (_upperBound == 1);
- if (_equals) {
- _builder.append("!= null");
- _builder.newLine();
- } else {
- _builder.append(".size() >= ");
- EStructuralFeature _ecoreFeature_1 = it.getEcoreFeature();
- int _upperBound_1 = _ecoreFeature_1.getUpperBound();
- _builder.append(_upperBound_1, "");
- _builder.newLineIfNotEmpty();
- }
- }
- return _builder;
- }
-
- public CharSequence getCreateSemanticServiceEditCommand(final GenDiagram it) {
- StringConcatenation _builder = new StringConcatenation();
- {
- Resource _eResource = it.eResource();
- TreeIterator<EObject> _allContents = _eResource.getAllContents();
- Iterator<GenerateUsingElementTypeCreationCommand> _filter = Iterators.<GenerateUsingElementTypeCreationCommand>filter(_allContents, GenerateUsingElementTypeCreationCommand.class);
- int _size = IteratorExtensions.size(_filter);
- boolean _greaterThan = (_size > 0);
- if (_greaterThan) {
- CharSequence _generatedMemberComment = this._common.generatedMemberComment();
- _builder.append(_generatedMemberComment, "");
- _builder.newLineIfNotEmpty();
- _builder.append("protected org.eclipse.gmf.runtime.common.core.command.ICommand getSemanticCreationCommand(org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest req) {");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("org.eclipse.papyrus.infra.services.edit.service.IElementEditService commandService = org.eclipse.papyrus.infra.services.edit.service.ElementEditServiceUtils.getCommandProvider(req.getContainer());");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("if(commandService == null) {");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("return org.eclipse.gmf.runtime.common.core.command.UnexecutableCommand.INSTANCE;");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("return commandService.getEditCommand(req);");
- _builder.newLine();
- _builder.append("}");
- _builder.newLine();
- }
- }
- return _builder;
- }
-
- /**
- * XXX for now, both constraints are injected into single method
- * which may not be suitable for modification especially when mixing
- * java and ocl constraints (former requires manual code).
- * Better approach would be:
- * if either is non-null and providers are not the same - introduce two methods,
- * to check source and target separately. Otherwize, do it inplace.
- */
- public CharSequence canExist(final GenLink it) {
- StringConcatenation _builder = new StringConcatenation();
- CharSequence _generatedMemberComment = this._common.generatedMemberComment();
- _builder.append(_generatedMemberComment, "");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.append("public boolean canExist");
- String _uniqueIdentifier = it.getUniqueIdentifier();
- _builder.append(_uniqueIdentifier, "\t");
- _builder.append("(");
- _builder.newLineIfNotEmpty();
- {
- boolean _isSansDomain = it.isSansDomain();
- boolean _not = (!_isSansDomain);
- if (_not) {
- LinkModelFacet _modelFacet = it.getModelFacet();
- CharSequence _canExistParameters = this.canExistParameters(_modelFacet);
- _builder.append(_canExistParameters, "");
- _builder.newLineIfNotEmpty();
- }
- }
- _builder.append(") {");
- _builder.newLine();
- {
- boolean _and = false;
- boolean _and_1 = false;
- GenLinkConstraints _creationConstraints = it.getCreationConstraints();
- boolean _notEquals = (!Objects.equal(_creationConstraints, null));
- if (!_notEquals) {
- _and_1 = false;
- } else {
- GenLinkConstraints _creationConstraints_1 = it.getCreationConstraints();
- boolean _isValid = _creationConstraints_1.isValid();
- _and_1 = _isValid;
- }
- if (!_and_1) {
- _and = false;
- } else {
- GenDiagram _diagram = it.getDiagram();
- GenEditorGenerator _editorGen = _diagram.getEditorGen();
- GenExpressionProviderContainer _expressionProviders = _editorGen.getExpressionProviders();
- boolean _notEquals_1 = (!Objects.equal(_expressionProviders, null));
- _and = _notEquals_1;
- }
- if (_and) {
- _builder.append("try {");
- _builder.newLine();
- {
- GenLinkConstraints _creationConstraints_2 = it.getCreationConstraints();
- GenConstraint _sourceEnd = _creationConstraints_2.getSourceEnd();
- boolean _notEquals_2 = (!Objects.equal(_sourceEnd, null));
- if (_notEquals_2) {
- GenLinkConstraints _creationConstraints_3 = it.getCreationConstraints();
- GenConstraint _sourceEnd_1 = _creationConstraints_3.getSourceEnd();
- GenExpressionProviderBase _provider = _sourceEnd_1.getProvider();
- GenLinkConstraints _creationConstraints_4 = it.getCreationConstraints();
- GenConstraint _sourceEnd_2 = _creationConstraints_4.getSourceEnd();
- GenLinkConstraints _creationConstraints_5 = it.getCreationConstraints();
- GenClass _sourceEndContextClass = _creationConstraints_5.getSourceEndContextClass();
- GenLinkConstraints _creationConstraints_6 = it.getCreationConstraints();
- GenClass _targetEndContextClass = _creationConstraints_6.getTargetEndContextClass();
- CharSequence _checkAdditionalConstraint = this.checkAdditionalConstraint(_provider, _sourceEnd_2, "source", "target", _sourceEndContextClass, _targetEndContextClass);
- _builder.append(_checkAdditionalConstraint, "");
- _builder.newLineIfNotEmpty();
- }
- }
- {
- GenLinkConstraints _creationConstraints_7 = it.getCreationConstraints();
- GenConstraint _targetEnd = _creationConstraints_7.getTargetEnd();
- boolean _notEquals_3 = (!Objects.equal(_targetEnd, null));
- if (_notEquals_3) {
- GenLinkConstraints _creationConstraints_8 = it.getCreationConstraints();
- GenConstraint _targetEnd_1 = _creationConstraints_8.getTargetEnd();
- GenExpressionProviderBase _provider_1 = _targetEnd_1.getProvider();
- GenLinkConstraints _creationConstraints_9 = it.getCreationConstraints();
- GenConstraint _targetEnd_2 = _creationConstraints_9.getTargetEnd();
- GenLinkConstraints _creationConstraints_10 = it.getCreationConstraints();
- GenClass _targetEndContextClass_1 = _creationConstraints_10.getTargetEndContextClass();
- GenLinkConstraints _creationConstraints_11 = it.getCreationConstraints();
- GenClass _sourceEndContextClass_1 = _creationConstraints_11.getSourceEndContextClass();
- CharSequence _checkAdditionalConstraint_1 = this.checkAdditionalConstraint(_provider_1, _targetEnd_2, "target", "source", _targetEndContextClass_1, _sourceEndContextClass_1);
- _builder.append(_checkAdditionalConstraint_1, "");
- _builder.newLineIfNotEmpty();
- }
- }
- _builder.append("return true;");
- _builder.newLine();
- _builder.append("} catch(Exception e) {\t");
- _builder.newLine();
- _builder.append("\t");
- GenDiagram _diagram_1 = it.getDiagram();
- GenEditorGenerator _editorGen_1 = _diagram_1.getEditorGen();
- CharSequence _instanceAccess = this.xptPluginActivator.instanceAccess(_editorGen_1);
- _builder.append(_instanceAccess, "\t");
- _builder.append(".logError(\"Link constraint evaluation error\", e); ");
- CharSequence _nonNLS = this._common.nonNLS();
- _builder.append(_nonNLS, "\t");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.append("return false;");
- _builder.newLine();
- _builder.append("}");
- _builder.newLine();
- } else {
- _builder.append("return true;");
- _builder.newLine();
- }
- }
- _builder.append("}");
- _builder.newLine();
- return _builder;
- }
-}
diff --git a/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/diagram/editpolicies/CompartmentItemSemanticEditPolicy.java b/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/diagram/editpolicies/CompartmentItemSemanticEditPolicy.java
deleted file mode 100644
index 4a8cb4d1f8b..00000000000
--- a/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/diagram/editpolicies/CompartmentItemSemanticEditPolicy.java
+++ /dev/null
@@ -1,328 +0,0 @@
-/**
- * Copyright (c) 2006-2013 Borland Software Corporation and others
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Alexander Shatalin (Borland) - initial API and implementation
- * Michael Golubev (Montages) - #386838 - migrate to Xtend2
- */
-package aspects.xpt.diagram.editpolicies;
-
-import aspects.xpt.diagram.editpolicies.BaseItemSemanticEditPolicy;
-import com.google.common.collect.Iterators;
-import com.google.inject.Inject;
-import com.google.inject.Singleton;
-import java.util.Iterator;
-import metamodel.MetaModel;
-import org.eclipse.emf.codegen.ecore.genmodel.GenFeature;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.common.util.TreeIterator;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.gmf.codegen.gmfgen.GenChildNode;
-import org.eclipse.gmf.codegen.gmfgen.GenCommonBase;
-import org.eclipse.gmf.codegen.gmfgen.GenCompartment;
-import org.eclipse.gmf.codegen.gmfgen.GenDiagram;
-import org.eclipse.gmf.codegen.gmfgen.GenEditorGenerator;
-import org.eclipse.gmf.codegen.gmfgen.GenNode;
-import org.eclipse.gmf.codegen.gmfgen.TypeModelFacet;
-import org.eclipse.papyrus.papyrusgmfgenextension.ConstrainedByReferenceCompartmentItemSemanticEditPolicy;
-import org.eclipse.xtend2.lib.StringConcatenation;
-import org.eclipse.xtext.xbase.lib.Extension;
-import org.eclipse.xtext.xbase.lib.Functions.Function1;
-import org.eclipse.xtext.xbase.lib.IteratorExtensions;
-import xpt.Common;
-import xpt.diagram.editpolicies.childContainerCreateCommand;
-
-@Singleton
-@SuppressWarnings("all")
-public class CompartmentItemSemanticEditPolicy extends xpt.diagram.editpolicies.CompartmentItemSemanticEditPolicy {
- @Inject
- @Extension
- private Common _common;
-
- @Inject
- @Extension
- private MetaModel _metaModel;
-
- @Inject
- private childContainerCreateCommand xptChildContainerCreateCommand;
-
- @Inject
- private BaseItemSemanticEditPolicy xptBaseItemSemanticEditPolicy;
-
- public CharSequence CompartmentItemSemanticEditPolicy(final GenCompartment it) {
- StringConcatenation _builder = new StringConcatenation();
- _builder.append("\t");
- GenDiagram _diagram = it.getDiagram();
- GenEditorGenerator _editorGen = _diagram.getEditorGen();
- CharSequence _copyright = this._common.copyright(_editorGen);
- _builder.append(_copyright, "\t");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.append("package ");
- CharSequence _packageName = this.packageName(it);
- _builder.append(_packageName, "\t");
- _builder.append(";");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.newLine();
- _builder.append("\t");
- CharSequence _generatedClassComment = this._common.generatedClassComment();
- _builder.append(_generatedClassComment, "\t");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.append("public class ");
- CharSequence _className = this.className(it);
- _builder.append(_className, "\t");
- _builder.append(" extends ");
- GenDiagram _diagram_1 = it.getDiagram();
- CharSequence _qualifiedClassName = this.xptBaseItemSemanticEditPolicy.qualifiedClassName(_diagram_1);
- _builder.append(_qualifiedClassName, "\t");
- _builder.append(" {");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.newLine();
- _builder.append("\t");
- CharSequence __constructor = this._constructor(it);
- _builder.append(__constructor, "\t");
- _builder.newLineIfNotEmpty();
- _builder.newLine();
- _builder.append("\t");
- EList<GenChildNode> _childNodes = it.getChildNodes();
- CharSequence _childContainerCreateCommand = this.xptChildContainerCreateCommand.childContainerCreateCommand(_childNodes);
- _builder.append(_childContainerCreateCommand, "\t");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.newLine();
- _builder.append("\t");
- CharSequence _additions = this.additions(it);
- _builder.append(_additions, "\t");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.newLine();
- _builder.append("\t\t\t");
- _builder.newLine();
- {
- Resource _eResource = it.eResource();
- TreeIterator<EObject> _allContents = _eResource.getAllContents();
- Iterator<ConstrainedByReferenceCompartmentItemSemanticEditPolicy> _filter = Iterators.<ConstrainedByReferenceCompartmentItemSemanticEditPolicy>filter(_allContents, ConstrainedByReferenceCompartmentItemSemanticEditPolicy.class);
- final Function1<ConstrainedByReferenceCompartmentItemSemanticEditPolicy, Boolean> _function = new Function1<ConstrainedByReferenceCompartmentItemSemanticEditPolicy, Boolean>() {
- public Boolean apply(final ConstrainedByReferenceCompartmentItemSemanticEditPolicy v) {
- EList<GenCommonBase> _genView = v.getGenView();
- return Boolean.valueOf(_genView.contains(it));
- }
- };
- Iterator<ConstrainedByReferenceCompartmentItemSemanticEditPolicy> _filter_1 = IteratorExtensions.<ConstrainedByReferenceCompartmentItemSemanticEditPolicy>filter(_filter, _function);
- int _size = IteratorExtensions.size(_filter_1);
- boolean _notEquals = (_size != 0);
- if (_notEquals) {
- _builder.append("\t");
- EList<GenChildNode> _childNodes_1 = it.getChildNodes();
- CharSequence _childNodeReference = this.getChildNodeReference(_childNodes_1);
- _builder.append(_childNodeReference, "\t");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.append("\t");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("\t");
- CharSequence _isCorrectCompartment = this.isCorrectCompartment(it);
- _builder.append(_isCorrectCompartment, "\t\t");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.append("\t");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("\t");
- CharSequence _constraintedMoveCommand = this.constraintedMoveCommand(it);
- _builder.append(_constraintedMoveCommand, "\t\t");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.newLine();
- }
- }
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- return _builder;
- }
-
- public CharSequence getChildNodeReference(final EList<GenChildNode> it) {
- StringConcatenation _builder = new StringConcatenation();
- {
- boolean _isEmpty = it.isEmpty();
- boolean _not = (!_isEmpty);
- if (_not) {
- CharSequence _generatedMemberComment = this._common.generatedMemberComment();
- _builder.append(_generatedMemberComment, "");
- _builder.newLineIfNotEmpty();
- _builder.append("private static Set<EReference> compartmentReferences;");
- _builder.newLine();
- _builder.newLine();
- CharSequence _generatedMemberComment_1 = this._common.generatedMemberComment();
- _builder.append(_generatedMemberComment_1, "");
- _builder.newLineIfNotEmpty();
- _builder.append("static {");
- _builder.newLine();
- _builder.append("\t\t\t");
- _builder.append("compartmentReferences = new HashSet<EReference>();");
- _builder.newLine();
- _builder.append("\t");
- _builder.newLine();
- {
- for(final GenChildNode n : it) {
- _builder.append("\t");
- TypeModelFacet _modelFacet = n.getModelFacet();
- CharSequence _childRef = this.childRef(_modelFacet, n);
- _builder.append(_childRef, "\t");
- _builder.newLineIfNotEmpty();
- }
- }
- _builder.append("}");
- _builder.newLine();
- CharSequence _generatedMemberComment_2 = this._common.generatedMemberComment();
- _builder.append(_generatedMemberComment_2, "");
- _builder.newLineIfNotEmpty();
- _builder.append("protected Iterable<EReference> getCompartmentReferences() {");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("return compartmentReferences;");
- _builder.newLine();
- _builder.append("}");
- _builder.newLine();
- }
- }
- _builder.newLine();
- return _builder;
- }
-
- public CharSequence childRef(final TypeModelFacet it, final GenNode node) {
- StringConcatenation _builder = new StringConcatenation();
- _builder.append("compartmentReferences.add(");
- TypeModelFacet _modelFacet = node.getModelFacet();
- GenFeature _containmentMetaFeature = _modelFacet.getContainmentMetaFeature();
- CharSequence _MetaFeature = this._metaModel.MetaFeature(_containmentMetaFeature);
- _builder.append(_MetaFeature, "");
- _builder.append(");");
- _builder.newLineIfNotEmpty();
- return _builder;
- }
-
- public CharSequence isCorrectCompartment(final GenCompartment it) {
- StringConcatenation _builder = new StringConcatenation();
- CharSequence _generatedMemberComment = this._common.generatedMemberComment();
- _builder.append(_generatedMemberComment, "");
- _builder.newLineIfNotEmpty();
- _builder.append("protected boolean isMovedIntoCorrectCompartment(MoveRequest req){");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("for(Object entry : req.getElementsToMove().entrySet()) {");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("if(entry instanceof Map.Entry<?, ?>) {");
- _builder.newLine();
- _builder.append("\t\t\t");
- _builder.append("Map.Entry<?, ?> mapEntry = (Map.Entry<?, ?>)entry;");
- _builder.newLine();
- _builder.append("\t\t\t");
- _builder.append("Object key = mapEntry.getKey();");
- _builder.newLine();
- _builder.append("\t\t\t");
- _builder.append("if(key instanceof EObject) {");
- _builder.newLine();
- _builder.append("\t\t\t\t");
- _builder.append("EObject dropppedObject = (EObject)key;");
- _builder.newLine();
- _builder.append("\t\t\t\t");
- _builder.append("EObject semanticHost = ((IGraphicalEditPart)getHost()).resolveSemanticElement();");
- _builder.newLine();
- _builder.append("\t\t\t\t");
- _builder.append("boolean foundERefrences = false;");
- _builder.newLine();
- _builder.append("\t\t\t\t");
- _builder.append("if(semanticHost != null) {");
- _builder.newLine();
- _builder.append("\t\t\t\t\t");
- _builder.append("for(EReference ref : getCompartmentReferences()) {");
- _builder.newLine();
- _builder.append("\t\t\t\t\t\t");
- _builder.append("if(ref.isContainment()) {");
- _builder.newLine();
- _builder.append("\t\t\t\t\t\t\t");
- _builder.append("foundERefrences = PackageUtil.canContain(semanticHost.eClass(), ref, dropppedObject.eClass(), false);");
- _builder.newLine();
- _builder.append("\t\t\t\t\t\t");
- _builder.append("} else {");
- _builder.newLine();
- _builder.append("\t\t\t\t\t\t\t");
- _builder.append("foundERefrences = PackageUtil.canReference(semanticHost.eClass(), ref, dropppedObject.eClass());");
- _builder.newLine();
- _builder.append("\t\t\t\t\t\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t\t\t\t\t\t");
- _builder.append("if(foundERefrences) {");
- _builder.newLine();
- _builder.append("\t\t\t\t\t\t\t");
- _builder.append("return true;");
- _builder.newLine();
- _builder.append("\t\t\t\t\t\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t\t\t\t\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t\t\t\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t\t\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("return false;");
- _builder.newLine();
- _builder.append("}");
- _builder.newLine();
- return _builder;
- }
-
- public CharSequence constraintedMoveCommand(final GenCompartment it) {
- StringConcatenation _builder = new StringConcatenation();
- CharSequence _generatedMemberComment = this._common.generatedMemberComment();
- _builder.append(_generatedMemberComment, "");
- _builder.newLineIfNotEmpty();
- _builder.append("@Override");
- _builder.newLine();
- _builder.append("protected Command getMoveCommand(MoveRequest req) {");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("if (isMovedIntoCorrectCompartment(req)){\t\t\t");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("return super.getMoveCommand(req);");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("} else {");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("return UnexecutableCommand.INSTANCE;");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("}");
- _builder.newLine();
- return _builder;
- }
-}
diff --git a/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/diagram/editpolicies/DiagramItemSemanticEditPolicy.java b/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/diagram/editpolicies/DiagramItemSemanticEditPolicy.java
deleted file mode 100644
index 87f36ff5cd1..00000000000
--- a/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/diagram/editpolicies/DiagramItemSemanticEditPolicy.java
+++ /dev/null
@@ -1,20 +0,0 @@
-/**
- * Copyright (c) 2006, 2009 Borland Software Corporation
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Alexander Shatalin (Borland) - initial API and implementation
- * Michael Golubev (Montages) - #386838 - migrate to Xtend2
- */
-package aspects.xpt.diagram.editpolicies;
-
-import com.google.inject.Singleton;
-
-@Singleton
-@SuppressWarnings("all")
-public class DiagramItemSemanticEditPolicy extends xpt.diagram.editpolicies.DiagramItemSemanticEditPolicy {
-}
diff --git a/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/diagram/editpolicies/LinkItemSemanticEditPolicy.java b/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/diagram/editpolicies/LinkItemSemanticEditPolicy.java
deleted file mode 100644
index 9d484d170e3..00000000000
--- a/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/diagram/editpolicies/LinkItemSemanticEditPolicy.java
+++ /dev/null
@@ -1,133 +0,0 @@
-/**
- * Copyright (c) 2007-2012 Borland Software Corporation and others
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Alexander Shatalin (Borland) - initial API and implementation
- * Michael Golubev (Borland) - [243151] explicit source/target for links
- * - #386838 - migrate to Xtend2
- * Vincent Lorenzo (CEA-LIST)
- */
-package aspects.xpt.diagram.editpolicies;
-
-import com.google.common.collect.Iterators;
-import com.google.inject.Inject;
-import com.google.inject.Singleton;
-import impl.diagram.commands.DeleteLinkCommand;
-import java.util.Arrays;
-import java.util.Iterator;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.common.util.TreeIterator;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.gmf.codegen.gmfgen.FeatureLinkModelFacet;
-import org.eclipse.gmf.codegen.gmfgen.GenCommonBase;
-import org.eclipse.gmf.codegen.gmfgen.GenLink;
-import org.eclipse.gmf.codegen.gmfgen.LinkModelFacet;
-import org.eclipse.gmf.codegen.gmfgen.TypeLinkModelFacet;
-import org.eclipse.papyrus.papyrusgmfgenextension.EditPartUsingDeleteService;
-import org.eclipse.xtend2.lib.StringConcatenation;
-import org.eclipse.xtext.xbase.lib.Extension;
-import org.eclipse.xtext.xbase.lib.Functions.Function1;
-import org.eclipse.xtext.xbase.lib.IteratorExtensions;
-import utils.UtilsItemSemanticEditPolicy;
-import xpt.Common;
-
-@Singleton
-@SuppressWarnings("all")
-public class LinkItemSemanticEditPolicy extends xpt.diagram.editpolicies.LinkItemSemanticEditPolicy {
- @Inject
- @Extension
- private Common _common;
-
- @Inject
- @Extension
- private DeleteLinkCommand _deleteLinkCommand;
-
- @Inject
- @Extension
- private UtilsItemSemanticEditPolicy _utilsItemSemanticEditPolicy;
-
- protected CharSequence _getDestroySemanticCommand(final TypeLinkModelFacet it, final GenLink genLink) {
- StringConcatenation _builder = new StringConcatenation();
- _builder.newLine();
- {
- Resource _eResource = it.eResource();
- TreeIterator<EObject> _allContents = _eResource.getAllContents();
- Iterator<EditPartUsingDeleteService> _filter = Iterators.<EditPartUsingDeleteService>filter(_allContents, EditPartUsingDeleteService.class);
- final Function1<EditPartUsingDeleteService, Boolean> _function = new Function1<EditPartUsingDeleteService, Boolean>() {
- public Boolean apply(final EditPartUsingDeleteService v) {
- EList<GenCommonBase> _genView = v.getGenView();
- return Boolean.valueOf(_genView.contains(genLink));
- }
- };
- Iterator<EditPartUsingDeleteService> _filter_1 = IteratorExtensions.<EditPartUsingDeleteService>filter(_filter, _function);
- int _size = IteratorExtensions.size(_filter_1);
- boolean _notEquals = (_size != 0);
- if (_notEquals) {
- _builder.newLine();
- _builder.append("\t");
- CharSequence _generatedMemberComment = this._common.generatedMemberComment();
- _builder.append(_generatedMemberComment, "\t");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- CharSequence _destroyElementCommandByService = this._utilsItemSemanticEditPolicy.getDestroyElementCommandByService(it);
- _builder.append(_destroyElementCommandByService, "\t");
- _builder.newLineIfNotEmpty();
- } else {
- CharSequence _generatedMemberComment_1 = this._common.generatedMemberComment();
- _builder.append(_generatedMemberComment_1, "");
- _builder.newLineIfNotEmpty();
- _builder.append("protected org.eclipse.gef.commands.Command getDestroyElementCommand(org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest req) {");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("org.eclipse.gmf.runtime.emf.commands.core.command.CompositeTransactionalCommand cmd = new org.eclipse.gmf.runtime.emf.commands.core.command.CompositeTransactionalCommand(getEditingDomain(), null);");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("cmd.setTransactionNestingEnabled(true);");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("java.util.List<org.eclipse.emf.ecore.EObject> todestroy=new java.util.ArrayList<org.eclipse.emf.ecore.EObject>();");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("todestroy.add(req.getElementToDestroy());");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("//cmd.add(new org.eclipse.gmf.runtime.emf.type.core.commands.DestroyElementCommand(req));");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("cmd.add(new org.eclipse.papyrus.commands.wrappers.EMFtoGMFCommandWrapper(new org.eclipse.emf.edit.command.DeleteCommand(getEditingDomain(),todestroy )));");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("return getGEFWrapper(cmd.reduce());");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("//return getGEFWrapper(");
- CharSequence _newDeleteLinkWithClassCommand = this._deleteLinkCommand.newDeleteLinkWithClassCommand(it, genLink, "req");
- _builder.append(_newDeleteLinkWithClassCommand, "\t");
- _builder.append(");");
- _builder.newLineIfNotEmpty();
- _builder.append("}");
- _builder.newLine();
- }
- }
- return _builder;
- }
-
- public CharSequence getDestroySemanticCommand(final LinkModelFacet it, final GenLink genLink) {
- if (it instanceof FeatureLinkModelFacet) {
- return _getDestroySemanticCommand((FeatureLinkModelFacet)it, genLink);
- } else if (it instanceof TypeLinkModelFacet) {
- return _getDestroySemanticCommand((TypeLinkModelFacet)it, genLink);
- } else if (it != null) {
- return _getDestroySemanticCommand(it, genLink);
- } else {
- throw new IllegalArgumentException("Unhandled parameter types: " +
- Arrays.<Object>asList(it, genLink).toString());
- }
- }
-}
diff --git a/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/diagram/editpolicies/NodeItemSemanticEditPolicy.java b/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/diagram/editpolicies/NodeItemSemanticEditPolicy.java
deleted file mode 100644
index a4469464955..00000000000
--- a/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/diagram/editpolicies/NodeItemSemanticEditPolicy.java
+++ /dev/null
@@ -1,594 +0,0 @@
-/**
- * Copyright (c) 2007-2013 Borland Software Corporation and others
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Alexander Shatalin (Borland) - initial API and implementation
- * Artem Tikhomirov (Borland) - [257632] do not rely on EditPart presence for element deletion
- * Michael Golubev (Montages) - #386838 - migrate to Xtend2
- */
-package aspects.xpt.diagram.editpolicies;
-
-import aspects.xpt.diagram.editpolicies.BaseItemSemanticEditPolicy;
-import aspects.xpt.diagram.editpolicies.linkCommands;
-import com.google.common.collect.Iterables;
-import com.google.common.collect.Iterators;
-import com.google.inject.Inject;
-import com.google.inject.Singleton;
-import java.util.Iterator;
-import java.util.List;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.common.util.TreeIterator;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.gmf.codegen.gmfgen.FeatureLinkModelFacet;
-import org.eclipse.gmf.codegen.gmfgen.GenChildNode;
-import org.eclipse.gmf.codegen.gmfgen.GenCommonBase;
-import org.eclipse.gmf.codegen.gmfgen.GenCompartment;
-import org.eclipse.gmf.codegen.gmfgen.GenDiagram;
-import org.eclipse.gmf.codegen.gmfgen.GenEditorGenerator;
-import org.eclipse.gmf.codegen.gmfgen.GenLink;
-import org.eclipse.gmf.codegen.gmfgen.GenNode;
-import org.eclipse.gmf.codegen.gmfgen.LinkModelFacet;
-import org.eclipse.gmf.codegen.gmfgen.TypeLinkModelFacet;
-import org.eclipse.papyrus.papyrusgmfgenextension.EditPartUsingDeleteService;
-import org.eclipse.xtend2.lib.StringConcatenation;
-import org.eclipse.xtext.xbase.lib.CollectionLiterals;
-import org.eclipse.xtext.xbase.lib.Extension;
-import org.eclipse.xtext.xbase.lib.Functions.Function1;
-import org.eclipse.xtext.xbase.lib.IterableExtensions;
-import org.eclipse.xtext.xbase.lib.IteratorExtensions;
-import org.eclipse.xtext.xbase.lib.ListExtensions;
-import utils.UtilsItemSemanticEditPolicy;
-import xpt.Common;
-import xpt.diagram.editpolicies.Utils_qvto;
-import xpt.diagram.editpolicies.childContainerCreateCommand;
-import xpt.editor.VisualIDRegistry;
-
-/**
- * This template should be called only for non-design nodes (modelFacet != null)
- * because *ItemSemanticEditPolicy responsible for dealing with semantic model
- * elements and meaningless (should not be generated) for pure design nodes.
- */
-@Singleton
-@SuppressWarnings("all")
-public class NodeItemSemanticEditPolicy extends xpt.diagram.editpolicies.NodeItemSemanticEditPolicy {
- @Inject
- @Extension
- private Common _common;
-
- @Inject
- @Extension
- private Utils_qvto _utils_qvto;
-
- @Inject
- @Extension
- private UtilsItemSemanticEditPolicy _utilsItemSemanticEditPolicy;
-
- @Inject
- private BaseItemSemanticEditPolicy xptBaseItemSemanticEditPolicy;
-
- @Inject
- private childContainerCreateCommand xptChildContainerCreateCommand;
-
- @Inject
- private linkCommands xptLinkCommands;
-
- @Inject
- private VisualIDRegistry xptVisualIDRegistry;
-
- public CharSequence NodeItemSemanticEditPolicy(final GenNode it) {
- StringConcatenation _builder = new StringConcatenation();
- GenDiagram _diagram = it.getDiagram();
- GenEditorGenerator _editorGen = _diagram.getEditorGen();
- CharSequence _copyright = this._common.copyright(_editorGen);
- _builder.append(_copyright, "");
- _builder.newLineIfNotEmpty();
- _builder.append("package ");
- CharSequence _packageName = this.packageName(it);
- _builder.append(_packageName, "");
- _builder.append(";");
- _builder.newLineIfNotEmpty();
- _builder.newLine();
- CharSequence _generatedClassComment = this._common.generatedClassComment();
- _builder.append(_generatedClassComment, "");
- _builder.newLineIfNotEmpty();
- _builder.append("public class ");
- CharSequence _className = this.className(it);
- _builder.append(_className, "");
- _builder.append(" extends ");
- GenDiagram _diagram_1 = it.getDiagram();
- CharSequence _qualifiedClassName = this.xptBaseItemSemanticEditPolicy.qualifiedClassName(_diagram_1);
- _builder.append(_qualifiedClassName, "");
- _builder.append(" {");
- _builder.newLineIfNotEmpty();
- _builder.newLine();
- _builder.append("\t");
- CharSequence _defaultConstructor = this.xptBaseItemSemanticEditPolicy.defaultConstructor(it);
- _builder.append(_defaultConstructor, "\t");
- _builder.newLineIfNotEmpty();
- _builder.newLine();
- _builder.append("\t");
- EList<GenChildNode> _childNodes = it.getChildNodes();
- CharSequence _childContainerCreateCommand = this.xptChildContainerCreateCommand.childContainerCreateCommand(_childNodes);
- _builder.append(_childContainerCreateCommand, "\t");
- _builder.newLineIfNotEmpty();
- _builder.newLine();
- _builder.append("\t\t");
- _builder.newLine();
- {
- Resource _eResource = it.eResource();
- TreeIterator<EObject> _allContents = _eResource.getAllContents();
- Iterator<EditPartUsingDeleteService> _filter = Iterators.<EditPartUsingDeleteService>filter(_allContents, EditPartUsingDeleteService.class);
- final Function1<EditPartUsingDeleteService, Boolean> _function = new Function1<EditPartUsingDeleteService, Boolean>() {
- public Boolean apply(final EditPartUsingDeleteService v) {
- EList<GenCommonBase> _genView = v.getGenView();
- return Boolean.valueOf(_genView.contains(it));
- }
- };
- Iterator<EditPartUsingDeleteService> _filter_1 = IteratorExtensions.<EditPartUsingDeleteService>filter(_filter, _function);
- int _size = IteratorExtensions.size(_filter_1);
- boolean _notEquals = (_size != 0);
- if (_notEquals) {
- CharSequence _generatedMemberComment = this._common.generatedMemberComment();
- _builder.append(_generatedMemberComment, "");
- _builder.newLineIfNotEmpty();
- CharSequence _destroyElementCommandByService = this._utilsItemSemanticEditPolicy.getDestroyElementCommandByService(it);
- _builder.append(_destroyElementCommandByService, "");
- _builder.newLineIfNotEmpty();
- } else {
- CharSequence _destroyElementCommand = this.getDestroyElementCommand(it);
- _builder.append(_destroyElementCommand, "");
- _builder.newLineIfNotEmpty();
- {
- boolean _hasChildrenOrCompartments = this._utils_qvto.hasChildrenOrCompartments(it);
- if (_hasChildrenOrCompartments) {
- CharSequence _addDestroyChildNodesCommand = this.addDestroyChildNodesCommand(it);
- _builder.append(_addDestroyChildNodesCommand, "");
- _builder.newLineIfNotEmpty();
- }
- }
- }
- }
- _builder.newLine();
- _builder.append("\t");
- CharSequence _linkCommands = this.xptLinkCommands.linkCommands(it);
- _builder.append(_linkCommands, "\t");
- _builder.newLineIfNotEmpty();
- _builder.newLine();
- _builder.append("\t");
- CharSequence _additions = this.additions(it);
- _builder.append(_additions, "\t");
- _builder.newLineIfNotEmpty();
- _builder.append("}");
- _builder.newLine();
- return _builder;
- }
-
- public CharSequence getDestroyElementCommand(final GenNode it) {
- StringConcatenation _builder = new StringConcatenation();
- _builder.append("\t");
- CharSequence _generatedMemberComment = this._common.generatedMemberComment();
- _builder.append(_generatedMemberComment, "\t");
- _builder.newLineIfNotEmpty();
- _builder.append("protected org.eclipse.gef.commands.Command getDestroyElementCommand(org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest req) {");
- _builder.newLine();
- _builder.append(" \t");
- _builder.append("org.eclipse.gmf.runtime.notation.View view = (org.eclipse.gmf.runtime.notation.View) getHost().getModel();");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("org.eclipse.gmf.runtime.emf.commands.core.command.CompositeTransactionalCommand cmd = new org.eclipse.gmf.runtime.emf.commands.core.command.CompositeTransactionalCommand(getEditingDomain(), null);");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("cmd.setTransactionNestingEnabled(true);");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("org.eclipse.emf.ecore.EAnnotation annotation = view.getEAnnotation(\"Shortcut\");");
- CharSequence _nonNLS = this._common.nonNLS();
- _builder.append(_nonNLS, "\t\t");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.append("if (annotation == null) {");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("// there are indirectly referenced children, need extra commands: ");
- EList<GenChildNode> _childNodes = it.getChildNodes();
- EList<GenCompartment> _compartments = it.getCompartments();
- final Function1<GenCompartment, EList<GenChildNode>> _function = new Function1<GenCompartment, EList<GenChildNode>>() {
- public EList<GenChildNode> apply(final GenCompartment c) {
- return c.getChildNodes();
- }
- };
- List<EList<GenChildNode>> _map = ListExtensions.<GenCompartment, EList<GenChildNode>>map(_compartments, _function);
- Iterable<GenChildNode> _flatten = Iterables.<GenChildNode>concat(_map);
- Iterable<GenChildNode> _union = NodeItemSemanticEditPolicy.<GenChildNode>union(_childNodes, _flatten);
- final Function1<GenChildNode, Boolean> _function_1 = new Function1<GenChildNode, Boolean>() {
- public Boolean apply(final GenChildNode gcn) {
- boolean _isDirectlyOwned = NodeItemSemanticEditPolicy.this._utils_qvto.isDirectlyOwned(gcn, it);
- return Boolean.valueOf((!_isDirectlyOwned));
- }
- };
- boolean _exists = IterableExtensions.<GenChildNode>exists(_union, _function_1);
- _builder.append(_exists, "\t\t");
- _builder.newLineIfNotEmpty();
- {
- boolean _hasChildrenOrCompartments = this._utils_qvto.hasChildrenOrCompartments(it);
- if (_hasChildrenOrCompartments) {
- _builder.append("\t");
- _builder.append("addDestroyChildNodesCommand(cmd);");
- _builder.newLine();
- }
- }
- _builder.append("\t\t");
- _builder.append("addDestroyShortcutsCommand(cmd, view);");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("// delete host element");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("java.util.List<org.eclipse.emf.ecore.EObject> todestroy=new java.util.ArrayList<org.eclipse.emf.ecore.EObject>();");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("todestroy.add(req.getElementToDestroy());");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("//cmd.add(new org.eclipse.gmf.runtime.emf.type.core.commands.DestroyElementCommand(req));");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("cmd.add(new org.eclipse.papyrus.commands.wrappers.EMFtoGMFCommandWrapper(new org.eclipse.emf.edit.command.DeleteCommand(getEditingDomain(),todestroy )));");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("} else {");
- _builder.append("\t\tcmd.add(new org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), view));");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("return getGEFWrapper(cmd.reduce());");
- _builder.newLine();
- _builder.append("}");
- _builder.newLine();
- return _builder;
- }
-
- public CharSequence addDestroyChildNodesCommand(final GenNode it) {
- StringConcatenation _builder = new StringConcatenation();
- CharSequence _generatedMemberComment = this._common.generatedMemberComment();
- _builder.append(_generatedMemberComment, "");
- _builder.newLineIfNotEmpty();
- _builder.append("protected void addDestroyChildNodesCommand(org.eclipse.gmf.runtime.common.core.command.ICompositeCommand cmd) {");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("org.eclipse.gmf.runtime.notation.View view = (org.eclipse.gmf.runtime.notation.View) getHost().getModel();");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("for (java.util.Iterator<?> nit = view.getChildren().iterator(); nit.hasNext();) {");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("org.eclipse.gmf.runtime.notation.Node node = (org.eclipse.gmf.runtime.notation.Node) nit.next();");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("switch (");
- GenDiagram _diagram = it.getDiagram();
- CharSequence _visualIDMethodCall = this.xptVisualIDRegistry.getVisualIDMethodCall(_diagram);
- _builder.append(_visualIDMethodCall, "\t\t");
- _builder.append("(node)) {");
- _builder.newLineIfNotEmpty();
- {
- EList<GenChildNode> _childNodes = it.getChildNodes();
- for(final GenChildNode cn : _childNodes) {
- _builder.append("\t\t");
- CharSequence _destroyChildNodes = this.destroyChildNodes(cn, "node", it);
- _builder.append(_destroyChildNodes, "\t\t");
- _builder.append(" ");
- _builder.newLineIfNotEmpty();
- }
- }
- {
- EList<GenCompartment> _compartments = it.getCompartments();
- for(final GenCompartment compartment : _compartments) {
- _builder.append("\t\t");
- CharSequence _caseVisualID = this.xptVisualIDRegistry.caseVisualID(compartment);
- _builder.append(_caseVisualID, "\t\t");
- _builder.newLineIfNotEmpty();
- _builder.append("\t\t");
- _builder.append("\t");
- _builder.append("for (java.util.Iterator<?> cit = node.getChildren().iterator(); cit.hasNext();) {");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("\t\t");
- _builder.append("org.eclipse.gmf.runtime.notation.Node cnode = (org.eclipse.gmf.runtime.notation.Node) cit.next();");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("\t\t");
- _builder.append("switch (");
- GenDiagram _diagram_1 = it.getDiagram();
- CharSequence _visualIDMethodCall_1 = this.xptVisualIDRegistry.getVisualIDMethodCall(_diagram_1);
- _builder.append(_visualIDMethodCall_1, "\t\t\t\t");
- _builder.append("(cnode)) {");
- _builder.newLineIfNotEmpty();
- {
- EList<GenChildNode> _childNodes_1 = compartment.getChildNodes();
- for(final GenChildNode cn_1 : _childNodes_1) {
- _builder.append("\t\t");
- _builder.append("\t\t");
- CharSequence _destroyChildNodes_1 = this.destroyChildNodes(cn_1, "cnode", it);
- _builder.append(_destroyChildNodes_1, "\t\t\t\t");
- _builder.newLineIfNotEmpty();
- }
- }
- _builder.append("\t\t");
- _builder.append("\t\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("\t");
- _builder.append("break;");
- _builder.newLine();
- }
- }
- _builder.append("\t\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("}");
- _builder.newLine();
- return _builder;
- }
-
- /**
- * @param view - Notation element for the passed node
- * assumes 'cmd' to point to composite command
- */
- public CharSequence destroyEdges(final GenNode it, final String view) {
- StringConcatenation _builder = new StringConcatenation();
- _builder.newLine();
- _builder.newLine();
- _builder.newLine();
- _builder.newLine();
- _builder.newLine();
- {
- EList<GenLink> _genIncomingLinks = it.getGenIncomingLinks();
- boolean _isEmpty = _genIncomingLinks.isEmpty();
- boolean _not = (!_isEmpty);
- if (_not) {
- _builder.append("for (java.util.Iterator<?> it = ");
- _builder.append(view, "");
- _builder.append(".getTargetEdges().iterator(); it.hasNext();) {");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.append("org.eclipse.gmf.runtime.notation.Edge incomingLink = (org.eclipse.gmf.runtime.notation.Edge) it.next();");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("switch(");
- GenDiagram _diagram = it.getDiagram();
- CharSequence _visualIDMethodCall = this.xptVisualIDRegistry.getVisualIDMethodCall(_diagram);
- _builder.append(_visualIDMethodCall, "\t");
- _builder.append("(incomingLink)) {");
- _builder.newLineIfNotEmpty();
- {
- EList<GenLink> _genIncomingLinks_1 = it.getGenIncomingLinks();
- final Function1<GenLink, Boolean> _function = new Function1<GenLink, Boolean>() {
- public Boolean apply(final GenLink l) {
- LinkModelFacet _modelFacet = l.getModelFacet();
- return Boolean.valueOf((_modelFacet instanceof FeatureLinkModelFacet));
- }
- };
- Iterable<GenLink> _filter = IterableExtensions.<GenLink>filter(_genIncomingLinks_1, _function);
- boolean _isEmpty_1 = IterableExtensions.isEmpty(_filter);
- boolean _not_1 = (!_isEmpty_1);
- if (_not_1) {
- {
- EList<GenLink> _genIncomingLinks_2 = it.getGenIncomingLinks();
- final Function1<GenLink, Boolean> _function_1 = new Function1<GenLink, Boolean>() {
- public Boolean apply(final GenLink l) {
- LinkModelFacet _modelFacet = l.getModelFacet();
- return Boolean.valueOf((_modelFacet instanceof FeatureLinkModelFacet));
- }
- };
- Iterable<GenLink> _filter_1 = IterableExtensions.<GenLink>filter(_genIncomingLinks_2, _function_1);
- for(final GenLink il : _filter_1) {
- _builder.append("case ");
- CharSequence _visualID = VisualIDRegistry.visualID(il);
- _builder.append(_visualID, "");
- _builder.append(":");
- _builder.newLineIfNotEmpty();
- }
- }
- _builder.append("\t\t\t\t");
- _builder.append("org.eclipse.gmf.runtime.emf.type.core.requests.DestroyReferenceRequest destroyRefReq = new org.eclipse.gmf.runtime.emf.type.core.requests.DestroyReferenceRequest(incomingLink.getSource().getElement(), null, incomingLink.getTarget().getElement(), false);");
- _builder.newLine();
- _builder.append("\t\t\t\t");
- _builder.append("cmd.add(new org.eclipse.gmf.runtime.emf.type.core.commands.DestroyReferenceCommand(destroyRefReq));");
- _builder.newLine();
- _builder.append("\t\t\t\t");
- _builder.append("cmd.add(new org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), incomingLink));");
- _builder.newLine();
- _builder.append("\t\t\t\t");
- _builder.append("break;");
- _builder.newLine();
- }
- }
- {
- EList<GenLink> _genIncomingLinks_3 = it.getGenIncomingLinks();
- final Function1<GenLink, Boolean> _function_2 = new Function1<GenLink, Boolean>() {
- public Boolean apply(final GenLink l) {
- LinkModelFacet _modelFacet = l.getModelFacet();
- return Boolean.valueOf((_modelFacet instanceof TypeLinkModelFacet));
- }
- };
- Iterable<GenLink> _filter_2 = IterableExtensions.<GenLink>filter(_genIncomingLinks_3, _function_2);
- boolean _isEmpty_2 = IterableExtensions.isEmpty(_filter_2);
- boolean _not_2 = (!_isEmpty_2);
- if (_not_2) {
- {
- EList<GenLink> _genIncomingLinks_4 = it.getGenIncomingLinks();
- final Function1<GenLink, Boolean> _function_3 = new Function1<GenLink, Boolean>() {
- public Boolean apply(final GenLink l) {
- LinkModelFacet _modelFacet = l.getModelFacet();
- return Boolean.valueOf((_modelFacet instanceof TypeLinkModelFacet));
- }
- };
- Iterable<GenLink> _filter_3 = IterableExtensions.<GenLink>filter(_genIncomingLinks_4, _function_3);
- for(final GenLink il_1 : _filter_3) {
- _builder.append("case ");
- CharSequence _visualID_1 = VisualIDRegistry.visualID(il_1);
- _builder.append(_visualID_1, "");
- _builder.append(":");
- _builder.newLineIfNotEmpty();
- }
- }
- _builder.append("\t\t\t\t");
- _builder.append("org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest destroyEltReq = new org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest(incomingLink.getElement(), false);");
- _builder.newLine();
- _builder.append("\t\t\t\t");
- _builder.append("cmd.add(new org.eclipse.gmf.runtime.emf.type.core.commands.DestroyElementCommand(destroyEltReq));");
- _builder.newLine();
- _builder.append("\t\t\t\t");
- _builder.append("cmd.add(new org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), incomingLink));");
- _builder.newLine();
- _builder.append("\t\t\t\t");
- _builder.append("break;");
- _builder.newLine();
- }
- }
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("}");
- _builder.newLine();
- }
- }
- _builder.newLine();
- {
- EList<GenLink> _genOutgoingLinks = it.getGenOutgoingLinks();
- boolean _isEmpty_3 = _genOutgoingLinks.isEmpty();
- if (_isEmpty_3) {
- _builder.append("for (java.util.Iterator<?> it = ");
- _builder.append(view, "");
- _builder.append(".getSourceEdges().iterator(); it.hasNext();) {");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.append("org.eclipse.gmf.runtime.notation.Edge outgoingLink = (org.eclipse.gmf.runtime.notation.Edge) it.next();");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("switch(");
- GenDiagram _diagram_1 = it.getDiagram();
- CharSequence _visualIDMethodCall_1 = this.xptVisualIDRegistry.getVisualIDMethodCall(_diagram_1);
- _builder.append(_visualIDMethodCall_1, "\t");
- _builder.append("(outgoingLink)) {");
- _builder.newLineIfNotEmpty();
- {
- EList<GenLink> _genOutgoingLinks_1 = it.getGenOutgoingLinks();
- final Function1<GenLink, Boolean> _function_4 = new Function1<GenLink, Boolean>() {
- public Boolean apply(final GenLink l) {
- LinkModelFacet _modelFacet = l.getModelFacet();
- return Boolean.valueOf((_modelFacet instanceof FeatureLinkModelFacet));
- }
- };
- Iterable<GenLink> _filter_4 = IterableExtensions.<GenLink>filter(_genOutgoingLinks_1, _function_4);
- boolean _isEmpty_4 = IterableExtensions.isEmpty(_filter_4);
- boolean _not_3 = (!_isEmpty_4);
- if (_not_3) {
- {
- EList<GenLink> _genOutgoingLinks_2 = it.getGenOutgoingLinks();
- final Function1<GenLink, Boolean> _function_5 = new Function1<GenLink, Boolean>() {
- public Boolean apply(final GenLink l) {
- LinkModelFacet _modelFacet = l.getModelFacet();
- return Boolean.valueOf((_modelFacet instanceof FeatureLinkModelFacet));
- }
- };
- Iterable<GenLink> _filter_5 = IterableExtensions.<GenLink>filter(_genOutgoingLinks_2, _function_5);
- for(final GenLink ol : _filter_5) {
- _builder.append("case ");
- CharSequence _visualID_2 = VisualIDRegistry.visualID(ol);
- _builder.append(_visualID_2, "");
- _builder.append(":");
- _builder.newLineIfNotEmpty();
- }
- }
- _builder.append("\t\t\t\t");
- _builder.append("org.eclipse.gmf.runtime.emf.type.core.requests.DestroyReferenceRequest destroyRefReq = new org.eclipse.gmf.runtime.emf.type.core.requests.DestroyReferenceRequest(outgoingLink.getSource().getElement(), null, outgoingLink.getTarget().getElement(), false);");
- _builder.newLine();
- _builder.append("\t\t\t\t");
- _builder.append("cmd.add(new org.eclipse.gmf.runtime.emf.type.core.commands.DestroyReferenceCommand(destroyRefReq));");
- _builder.newLine();
- _builder.append("\t\t\t\t");
- _builder.append("cmd.add(new org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), outgoingLink));");
- _builder.newLine();
- _builder.append("\t\t\t\t");
- _builder.append("break;");
- _builder.newLine();
- }
- }
- {
- EList<GenLink> _genOutgoingLinks_3 = it.getGenOutgoingLinks();
- final Function1<GenLink, Boolean> _function_6 = new Function1<GenLink, Boolean>() {
- public Boolean apply(final GenLink l) {
- LinkModelFacet _modelFacet = l.getModelFacet();
- return Boolean.valueOf((_modelFacet instanceof TypeLinkModelFacet));
- }
- };
- Iterable<GenLink> _filter_6 = IterableExtensions.<GenLink>filter(_genOutgoingLinks_3, _function_6);
- boolean _isEmpty_5 = IterableExtensions.isEmpty(_filter_6);
- boolean _not_4 = (!_isEmpty_5);
- if (_not_4) {
- {
- EList<GenLink> _genOutgoingLinks_4 = it.getGenOutgoingLinks();
- final Function1<GenLink, Boolean> _function_7 = new Function1<GenLink, Boolean>() {
- public Boolean apply(final GenLink l) {
- LinkModelFacet _modelFacet = l.getModelFacet();
- return Boolean.valueOf((_modelFacet instanceof TypeLinkModelFacet));
- }
- };
- Iterable<GenLink> _filter_7 = IterableExtensions.<GenLink>filter(_genOutgoingLinks_4, _function_7);
- for(final GenLink ol_1 : _filter_7) {
- _builder.append("case ");
- CharSequence _visualID_3 = VisualIDRegistry.visualID(ol_1);
- _builder.append(_visualID_3, "");
- _builder.append(":");
- _builder.newLineIfNotEmpty();
- }
- }
- _builder.append("\t\t\t\t");
- _builder.append("org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest destroyEltReq = new org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest(outgoingLink.getElement(), false);");
- _builder.newLine();
- _builder.append("\t\t\t\t");
- _builder.append("cmd.add(new org.eclipse.gmf.runtime.emf.type.core.commands.DestroyElementCommand(destroyEltReq));");
- _builder.newLine();
- _builder.append("\t\t\t\t");
- _builder.append("cmd.add(new org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), outgoingLink));");
- _builder.newLine();
- _builder.append("\t\t\t\t");
- _builder.append("break;");
- _builder.newLine();
- }
- }
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("}");
- _builder.newLine();
- }
- }
- return _builder;
- }
-
- private static <T extends Object> Iterable<T> union(final Iterable<? extends T> listA, final Iterable<? extends T> listB) {
- List<T> result = CollectionLiterals.<T>newLinkedList();
- Iterables.<T>addAll(result, listA);
- Iterables.<T>addAll(result, listB);
- return result;
- }
-}
diff --git a/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/diagram/editpolicies/OpenDiagram.java b/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/diagram/editpolicies/OpenDiagram.java
deleted file mode 100644
index 7054e67cd8a..00000000000
--- a/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/diagram/editpolicies/OpenDiagram.java
+++ /dev/null
@@ -1,188 +0,0 @@
-/**
- * Copyright (c) 2007, 2010, 2013 Borland Software Corporation and others
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Artem Tikhomirov (Borland) - initial API and implementation
- * Michael Golubev (Montages) - #386838 - migrate to Xtend2
- */
-package aspects.xpt.diagram.editpolicies;
-
-import com.google.common.base.Objects;
-import com.google.inject.Inject;
-import com.google.inject.Singleton;
-import org.eclipse.gmf.codegen.gmfgen.GenApplication;
-import org.eclipse.gmf.codegen.gmfgen.GenCommonBase;
-import org.eclipse.gmf.codegen.gmfgen.GenDiagram;
-import org.eclipse.gmf.codegen.gmfgen.GenEditorGenerator;
-import org.eclipse.gmf.codegen.gmfgen.OpenDiagramBehaviour;
-import org.eclipse.xtend2.lib.StringConcatenation;
-import org.eclipse.xtext.xbase.lib.Extension;
-import xpt.Common;
-import xpt.editor.DiagramEditorUtil;
-
-@Singleton
-@SuppressWarnings("all")
-public class OpenDiagram extends xpt.diagram.editpolicies.OpenDiagram {
- @Inject
- @Extension
- private Common _common;
-
- @Inject
- private DiagramEditorUtil xptDiagramEditorUtil;
-
- public CharSequence openCommandClass_intializeNewDiagram(final OpenDiagramBehaviour it) {
- StringConcatenation _builder = new StringConcatenation();
- CharSequence _generatedMemberComment = this._common.generatedMemberComment();
- _builder.append(_generatedMemberComment, "");
- _builder.newLineIfNotEmpty();
- _builder.append("protected org.eclipse.gmf.runtime.notation.Diagram intializeNewDiagram() throws org.eclipse.core.commands.ExecutionException {");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("org.eclipse.gmf.runtime.notation.Diagram d = org.eclipse.gmf.runtime.diagram.core.services.ViewService.createDiagram(getDiagramDomainElement(), getDiagramKind(), getPreferencesHint());");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("if (d == null) {");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("throw new org.eclipse.core.commands.ExecutionException(\"Can\'t create diagram of \'\" + getDiagramKind() + \"\' kind\");");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("diagramFacet.setDiagramLink(d);");
- _builder.newLine();
- _builder.append("\t");
- CharSequence __assert = this._common._assert("diagramFacet.eResource() != null");
- _builder.append(__assert, "\t");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.append("diagramFacet.eResource().getContents().add(d);");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("org.eclipse.emf.ecore.EObject container = diagramFacet.eContainer();");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("while (container instanceof org.eclipse.gmf.runtime.notation.View) {");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("((org.eclipse.gmf.runtime.notation.View) container).persist();");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("container = container.eContainer();");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("try {");
- _builder.newLine();
- {
- GenCommonBase _subject = it.getSubject();
- GenDiagram _diagram = _subject.getDiagram();
- GenEditorGenerator _editorGen = _diagram.getEditorGen();
- GenApplication _application = _editorGen.getApplication();
- boolean _equals = Objects.equal(null, _application);
- if (_equals) {
- _builder.append("\t");
- _builder.append("new org.eclipse.ui.actions.WorkspaceModifyOperation() {");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("\t");
- _builder.append("protected void execute(org.eclipse.core.runtime.IProgressMonitor monitor) throws org.eclipse.core.runtime.CoreException, java.lang.reflect.InvocationTargetException, InterruptedException {");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("\t\t");
- _builder.append("try {");
- _builder.newLine();
- }
- }
- _builder.append("\t");
- _builder.append("for (java.util.Iterator<?> it = diagramFacet.eResource().getResourceSet().getResources().iterator(); it.hasNext();) {");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("org.eclipse.emf.ecore.resource.Resource nextResource = (org.eclipse.emf.ecore.resource.Resource) it.next();");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("if (nextResource.isLoaded() && !getEditingDomain().isReadOnly(nextResource)) {");
- _builder.newLine();
- _builder.append("\t\t\t");
- _builder.append("nextResource.save(");
- GenCommonBase _subject_1 = it.getSubject();
- GenDiagram _diagram_1 = _subject_1.getDiagram();
- CharSequence _qualifiedClassName = this.xptDiagramEditorUtil.qualifiedClassName(_diagram_1);
- _builder.append(_qualifiedClassName, "\t\t\t");
- _builder.append(".getSaveOptions());");
- _builder.newLineIfNotEmpty();
- _builder.append("\t\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- {
- GenCommonBase _subject_2 = it.getSubject();
- GenDiagram _diagram_2 = _subject_2.getDiagram();
- GenEditorGenerator _editorGen_1 = _diagram_2.getEditorGen();
- GenApplication _application_1 = _editorGen_1.getApplication();
- boolean _equals_1 = Objects.equal(null, _application_1);
- if (_equals_1) {
- _builder.append("\t");
- _builder.append("} catch (java.io.IOException ex) {");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("\t");
- _builder.append("throw new java.lang.reflect.InvocationTargetException(ex, \"Save operation failed\");");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("}\t\t");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("}.run(null);");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("} catch (java.lang.reflect.InvocationTargetException e) {");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("\t");
- _builder.append("throw new org.eclipse.core.commands.ExecutionException(\"Can\'t create diagram of \'\" + getDiagramKind() + \"\' kind\", e);");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("} catch (InterruptedException e) {");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("\t");
- _builder.append("throw new org.eclipse.core.commands.ExecutionException(\"Can\'t create diagram of \'\" + getDiagramKind() + \"\' kind\", e);");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- } else {
- _builder.append("\t");
- _builder.append("} catch (java.io.IOException ex) {");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("\t");
- _builder.append("throw new org.eclipse.core.commands.ExecutionException(\"Can\'t create diagram of \'\" + getDiagramKind() + \"\' kind\", ex);");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- }
- }
- _builder.append("\t");
- _builder.append("return d;");
- _builder.newLine();
- _builder.append("}");
- _builder.newLine();
- return _builder;
- }
-}
diff --git a/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/diagram/editpolicies/TextNonResizableEditPolicy.java b/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/diagram/editpolicies/TextNonResizableEditPolicy.java
deleted file mode 100644
index e742137b9bc..00000000000
--- a/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/diagram/editpolicies/TextNonResizableEditPolicy.java
+++ /dev/null
@@ -1,46 +0,0 @@
-package aspects.xpt.diagram.editpolicies;
-
-import com.google.inject.Inject;
-import com.google.inject.Singleton;
-import org.eclipse.gmf.codegen.gmfgen.GenDiagram;
-import org.eclipse.xtend2.lib.StringConcatenation;
-import org.eclipse.xtext.xbase.lib.Extension;
-import xpt.Common;
-
-/**
- * FIXME: [MG] - reverse the calls? call common code from here and TextelectionEP and not vice versa
- */
-@Singleton
-@SuppressWarnings("all")
-public class TextNonResizableEditPolicy extends xpt.diagram.editpolicies.TextNonResizableEditPolicy {
- @Inject
- @Extension
- private Common _common;
-
- public CharSequence TextNonResizableEditPolicy_createSelectionHandles(final GenDiagram it) {
- StringConcatenation _builder = new StringConcatenation();
- CharSequence _generatedMemberComment = this._common.generatedMemberComment();
- _builder.append(_generatedMemberComment, "");
- _builder.newLineIfNotEmpty();
- _builder.append("protected java.util.List<?> createSelectionHandles() {");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("org.eclipse.gef.handles.MoveHandle moveHandle =");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("new org.eclipse.gef.handles.MoveHandle((org.eclipse.gef.GraphicalEditPart) getHost());");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("moveHandle.setBorder(null);");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("moveHandle.setDragTracker(new org.eclipse.gmf.runtime.diagram.ui.tools.DragEditPartsTrackerEx(getHost()));");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("return java.util.Collections.singletonList(moveHandle);");
- _builder.newLine();
- _builder.append("}");
- _builder.newLine();
- return _builder;
- }
-}
diff --git a/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/diagram/editpolicies/TextSelectionEditPolicy.java b/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/diagram/editpolicies/TextSelectionEditPolicy.java
deleted file mode 100644
index d917367176a..00000000000
--- a/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/diagram/editpolicies/TextSelectionEditPolicy.java
+++ /dev/null
@@ -1,93 +0,0 @@
-package aspects.xpt.diagram.editpolicies;
-
-import com.google.inject.Inject;
-import com.google.inject.Singleton;
-import org.eclipse.gmf.codegen.gmfgen.GenDiagram;
-import org.eclipse.xtend2.lib.StringConcatenation;
-import org.eclipse.xtext.xbase.lib.Extension;
-import xpt.CodeStyle;
-import xpt.Common;
-
-@Singleton
-@SuppressWarnings("all")
-public class TextSelectionEditPolicy extends xpt.diagram.editpolicies.TextSelectionEditPolicy {
- @Inject
- @Extension
- private Common _common;
-
- @Inject
- @Extension
- private CodeStyle _codeStyle;
-
- public CharSequence textFeedback_createFocusFeedbackFigure(final GenDiagram it) {
- StringConcatenation _builder = new StringConcatenation();
- CharSequence _generatedMemberComment = this._common.generatedMemberComment();
- _builder.append(_generatedMemberComment, "");
- _builder.newLineIfNotEmpty();
- _builder.append("protected org.eclipse.draw2d.IFigure createFocusFeedbackFigure() {");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("return new org.eclipse.draw2d.Figure() {");
- _builder.newLine();
- _builder.newLine();
- _builder.append("\t");
- CharSequence _overrideC = this._codeStyle.overrideC(it);
- _builder.append(_overrideC, "\t");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.append("protected void paintFigure(org.eclipse.draw2d.Graphics graphics) {");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("graphics.drawFocus(getBounds().getResized(-1, -1));");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("};");
- _builder.newLine();
- _builder.append("}");
- _builder.newLine();
- return _builder;
- }
-
- public CharSequence textFeedback_getHostPositionListener(final GenDiagram it) {
- StringConcatenation _builder = new StringConcatenation();
- CharSequence _generatedMemberComment = this._common.generatedMemberComment();
- _builder.append(_generatedMemberComment, "");
- _builder.newLineIfNotEmpty();
- _builder.append("private org.eclipse.draw2d.FigureListener getHostPositionListener() {");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("if (hostPositionListener == null) {");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("hostPositionListener = new org.eclipse.draw2d.FigureListener() {");
- _builder.newLine();
- _builder.append("\t\t\t");
- CharSequence _overrideI = this._codeStyle.overrideI(it);
- _builder.append(_overrideI, "\t\t\t");
- _builder.newLineIfNotEmpty();
- _builder.append("\t\t\t");
- _builder.append("public void figureMoved(org.eclipse.draw2d.IFigure source) {");
- _builder.newLine();
- _builder.append("\t\t\t\t");
- _builder.append("refreshFeedback();");
- _builder.newLine();
- _builder.append("\t\t\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("};");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("return hostPositionListener;");
- _builder.newLine();
- _builder.append("}");
- _builder.newLine();
- return _builder;
- }
-}
diff --git a/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/diagram/editpolicies/Utils_qvto.java b/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/diagram/editpolicies/Utils_qvto.java
deleted file mode 100644
index 91b44e77ab8..00000000000
--- a/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/diagram/editpolicies/Utils_qvto.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/**
- * Copyright (c) 2007-2013 Borland Software Corporation && others
- *
- * All rights reserved. This program && the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, && is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Alexander Shatalin (Borland) - initial API && implementation
- * Michael Golubev (Borland) - [243151] explicit source/target for links
- * - #386838 - migrate to Xtend2
- */
-package aspects.xpt.diagram.editpolicies;
-
-import com.google.inject.Singleton;
-import org.eclipse.gmf.codegen.gmfgen.GenLink;
-import org.eclipse.gmf.codegen.gmfgen.GenLinkEnd;
-
-@Singleton
-@SuppressWarnings("all")
-public class Utils_qvto extends xpt.diagram.editpolicies.Utils_qvto {
- public Boolean containsCreateStartLinkCommand(final GenLinkEnd it) {
- Iterable<GenLink> _allPotentialLinks = this.getAllPotentialLinks(it);
- for (final GenLink l : _allPotentialLinks) {
- boolean _createStartLinkCommand = this.createStartLinkCommand(l, it);
- if (_createStartLinkCommand) {
- return Boolean.valueOf(true);
- }
- }
- return Boolean.valueOf(false);
- }
-
- public Boolean containsCreateCompleteLinkCommand(final GenLinkEnd it) {
- Iterable<GenLink> _allPotentialLinks = this.getAllPotentialLinks(it);
- for (final GenLink l : _allPotentialLinks) {
- boolean _createCompleteLinkCommand = this.createCompleteLinkCommand(l, it);
- if (_createCompleteLinkCommand) {
- return Boolean.valueOf(true);
- }
- }
- return Boolean.valueOf(false);
- }
-}
diff --git a/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/diagram/editpolicies/childContainerCreateCommand.java b/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/diagram/editpolicies/childContainerCreateCommand.java
deleted file mode 100644
index 38cf5a1b3b2..00000000000
--- a/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/diagram/editpolicies/childContainerCreateCommand.java
+++ /dev/null
@@ -1,154 +0,0 @@
-/**
- * Copyright (c) 2007, 2009 Borland Software Corporation
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Alexander Shatalin (Borland) - initial API and implementation
- * Michael Golubev (Montages) - #386838 - migrate to Xtend2
- */
-package aspects.xpt.diagram.editpolicies;
-
-import com.google.common.collect.Iterators;
-import com.google.inject.Inject;
-import com.google.inject.Singleton;
-import java.util.Iterator;
-import metamodel.MetaModel;
-import org.eclipse.emf.codegen.ecore.genmodel.GenFeature;
-import org.eclipse.emf.common.util.TreeIterator;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.gmf.codegen.gmfgen.GenNode;
-import org.eclipse.gmf.codegen.gmfgen.TypeModelFacet;
-import org.eclipse.papyrus.papyrusgmfgenextension.GenerateUsingElementTypeCreationCommand;
-import org.eclipse.xtend2.lib.StringConcatenation;
-import org.eclipse.xtext.xbase.lib.Extension;
-import org.eclipse.xtext.xbase.lib.IterableExtensions;
-import org.eclipse.xtext.xbase.lib.IteratorExtensions;
-import xpt.Common;
-import xpt.providers.ElementTypes;
-
-@Singleton
-@SuppressWarnings("all")
-public class childContainerCreateCommand extends xpt.diagram.editpolicies.childContainerCreateCommand {
- @Inject
- @Extension
- private Common _common;
-
- @Inject
- @Extension
- private ElementTypes _elementTypes;
-
- @Inject
- @Extension
- private MetaModel _metaModel;
-
- public CharSequence childContainerCreateCommand(final Iterable<? extends GenNode> nodes) {
- StringConcatenation _builder = new StringConcatenation();
- {
- boolean _isEmpty = IterableExtensions.isEmpty(nodes);
- boolean _not = (!_isEmpty);
- if (_not) {
- _builder.newLine();
- CharSequence _generatedMemberComment = this._common.generatedMemberComment();
- _builder.append(_generatedMemberComment, "");
- _builder.newLineIfNotEmpty();
- _builder.append("protected org.eclipse.gef.commands.Command getCreateCommand(org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest req) {");
- _builder.newLine();
- _builder.append("\t\t\t");
- _builder.append("org.eclipse.gmf.runtime.emf.type.core.IElementType requestElementType = req.getElementType();");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("if(requestElementType == null) {");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("return super.getCreateCommand(req);");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- _builder.newLine();
- _builder.newLine();
- {
- for(final GenNode n : nodes) {
- {
- boolean _isSansDomain = n.isSansDomain();
- boolean _not_1 = (!_isSansDomain);
- if (_not_1) {
- TypeModelFacet _modelFacet = n.getModelFacet();
- CharSequence _childNodeCreateCommand = this.childNodeCreateCommand(_modelFacet, n);
- _builder.append(_childNodeCreateCommand, "");
- _builder.newLineIfNotEmpty();
- }
- }
- }
- }
- _builder.append("\t");
- _builder.append("return super.getCreateCommand(req);");
- _builder.newLine();
- _builder.append("}");
- _builder.newLine();
- }
- }
- return _builder;
- }
-
- public CharSequence childNodeCreateCommand(final TypeModelFacet it, final GenNode node) {
- StringConcatenation _builder = new StringConcatenation();
- _builder.append("if (");
- CharSequence _accessElementType = this._elementTypes.accessElementType(node);
- _builder.append(_accessElementType, "");
- _builder.append(" == requestElementType) {");
- _builder.newLineIfNotEmpty();
- {
- Resource _eResource = it.eResource();
- TreeIterator<EObject> _allContents = _eResource.getAllContents();
- Iterator<GenerateUsingElementTypeCreationCommand> _filter = Iterators.<GenerateUsingElementTypeCreationCommand>filter(_allContents, GenerateUsingElementTypeCreationCommand.class);
- int _size = IteratorExtensions.size(_filter);
- boolean _greaterThan = (_size > 0);
- if (_greaterThan) {
- _builder.append("\t");
- _builder.append("// adjust the containment feature");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("org.eclipse.emf.ecore.EReference containmentFeature = ");
- GenFeature _childMetaFeature = it.getChildMetaFeature();
- CharSequence _MetaFeature = this._metaModel.MetaFeature(_childMetaFeature);
- _builder.append(_MetaFeature, "\t");
- _builder.append(";");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.append("req.setContainmentFeature(containmentFeature);");
- _builder.newLine();
- }
- }
- _builder.newLine();
- {
- Resource _eResource_1 = it.eResource();
- TreeIterator<EObject> _allContents_1 = _eResource_1.getAllContents();
- Iterator<GenerateUsingElementTypeCreationCommand> _filter_1 = Iterators.<GenerateUsingElementTypeCreationCommand>filter(_allContents_1, GenerateUsingElementTypeCreationCommand.class);
- int _size_1 = IteratorExtensions.size(_filter_1);
- boolean _greaterThan_1 = (_size_1 > 0);
- if (_greaterThan_1) {
- _builder.append("\t");
- _builder.append("return getGEFWrapper(getSemanticCreationCommand(req));");
- _builder.newLine();
- } else {
- _builder.append("\t");
- _builder.append("return getGEFWrapper(new ");
- String _createCommandQualifiedClassName = node.getCreateCommandQualifiedClassName();
- _builder.append(_createCommandQualifiedClassName, "\t");
- _builder.append("(req, org.eclipse.papyrus.infra.gmfdiag.common.utils.DiagramUtils.getDiagramFrom(getHost())));");
- _builder.newLineIfNotEmpty();
- }
- }
- _builder.append("\t");
- _builder.newLine();
- _builder.append("}");
- _builder.newLine();
- return _builder;
- }
-}
diff --git a/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/diagram/editpolicies/linkCommands.java b/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/diagram/editpolicies/linkCommands.java
deleted file mode 100644
index 954e1f07e0b..00000000000
--- a/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/diagram/editpolicies/linkCommands.java
+++ /dev/null
@@ -1,482 +0,0 @@
-/**
- * Copyright (c) 2007-2013 Borland Software Corporation and others
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Alexander Shatalin (Borland) - initial API and implementation
- * Dmitry Stadnik (Borland) - creation logic was moved in commands
- * Michael Golubev (Borland) - [243151] explicit source/target for links
- * - #386838 - migrate to Xtend2
- * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
- */
-package aspects.xpt.diagram.editpolicies;
-
-import com.google.common.collect.Iterators;
-import com.google.inject.Inject;
-import com.google.inject.Singleton;
-import java.util.Iterator;
-import java.util.List;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.common.util.TreeIterator;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.gmf.codegen.gmfgen.GenLink;
-import org.eclipse.gmf.codegen.gmfgen.GenLinkEnd;
-import org.eclipse.papyrus.papyrusgmfgenextension.EditPartUsingReorientService;
-import org.eclipse.papyrus.papyrusgmfgenextension.GenerateUsingElementTypeCreationCommand;
-import org.eclipse.xtend2.lib.StringConcatenation;
-import org.eclipse.xtext.xbase.lib.Extension;
-import org.eclipse.xtext.xbase.lib.Functions.Function1;
-import org.eclipse.xtext.xbase.lib.IterableExtensions;
-import org.eclipse.xtext.xbase.lib.IteratorExtensions;
-import xpt.Common;
-import xpt.diagram.commands.CreateLinkCommand;
-import xpt.diagram.editpolicies.Utils_qvto;
-import xpt.editor.VisualIDRegistry;
-import xpt.providers.ElementTypes;
-
-/**
- * Start start of link creation.
- * User click to this editpart and start dragging with link tool.
- * Complete end of the command
- * User points to this editpart as a link target and release mouse button.
- *
- * Outgoing the node is link source
- * This element could be a source for this type of link.
- * Incoming the node is link destination
- * This element could be a target for this type of link.
- *
- * Parameters:
- *
- * diagram GenDiagram used to collect all defined links
- *
- * this Instance of GenLinkEnd for the element link could be creates to/from.
- * This could be GenNode or GenLink in case of links to links,
- * in the latter case it is assumed that its a TypeLink (so its model facet is LinkTypeModelFacet),
- * because RefLinks don't have underlying semantic identity
- */
-@Singleton
-@SuppressWarnings("all")
-public class linkCommands extends xpt.diagram.editpolicies.linkCommands {
- @Inject
- @Extension
- private Utils_qvto _utils_qvto;
-
- @Inject
- @Extension
- private Common _common;
-
- @Inject
- private aspects.xpt.diagram.editpolicies.Utils_qvto aspectsUtils_qvto;
-
- @Inject
- private VisualIDRegistry xptVisualIDRegistry;
-
- @Inject
- private ElementTypes xptElementTypes;
-
- @Inject
- private CreateLinkCommand xptCreateLinkCommand;
-
- public CharSequence createLinkCommands(final GenLinkEnd it) {
- StringConcatenation _builder = new StringConcatenation();
- _builder.newLine();
- {
- Resource _eResource = it.eResource();
- TreeIterator<EObject> _allContents = _eResource.getAllContents();
- Iterator<GenerateUsingElementTypeCreationCommand> _filter = Iterators.<GenerateUsingElementTypeCreationCommand>filter(_allContents, GenerateUsingElementTypeCreationCommand.class);
- int _size = IteratorExtensions.size(_filter);
- boolean _lessThan = (_size < 1);
- if (_lessThan) {
- _builder.newLine();
- CharSequence _generatedMemberComment = this._common.generatedMemberComment();
- _builder.append(_generatedMemberComment, "");
- _builder.newLineIfNotEmpty();
- _builder.append("protected org.eclipse.gef.commands.Command getCreateRelationshipCommand(");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest req) {");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("org.eclipse.gef.commands.Command command = req.getTarget() == null ?");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("getStartCreateRelationshipCommand(req) : getCompleteCreateRelationshipCommand(req);");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("return command != null ? command : super.getCreateRelationshipCommand(req);");
- _builder.newLine();
- _builder.append("}");
- _builder.newLine();
- }
- }
- _builder.newLine();
- CharSequence _generatedMemberComment_1 = this._common.generatedMemberComment();
- _builder.append(_generatedMemberComment_1, "");
- _builder.newLineIfNotEmpty();
- _builder.append("protected org.eclipse.gef.commands.Command getStartCreateRelationshipCommand(");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest req) {");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("org.eclipse.gmf.runtime.emf.type.core.IElementType requestElementType = req.getElementType();");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("if(requestElementType == null) {");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("return null;");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("org.eclipse.gmf.runtime.emf.type.core.IElementType baseElementType = requestElementType;");
- _builder.newLine();
- {
- Boolean _containsCreateStartLinkCommand = this.aspectsUtils_qvto.containsCreateStartLinkCommand(it);
- if ((_containsCreateStartLinkCommand).booleanValue()) {
- _builder.append("\t");
- _builder.append("boolean isExtendedType = true;");
- _builder.newLine();
- }
- }
- _builder.append("\t");
- _builder.newLine();
- {
- Iterable<GenLink> _allPotentialLinks = this._utils_qvto.getAllPotentialLinks(it);
- for(final GenLink l : _allPotentialLinks) {
- _builder.append("\t");
- CharSequence _startLinkCommands = this.startLinkCommands(l, it);
- _builder.append(_startLinkCommands, "\t");
- _builder.newLineIfNotEmpty();
- }
- }
- _builder.append("\t");
- _builder.append("return null;");
- _builder.newLine();
- _builder.append("}");
- _builder.newLine();
- _builder.newLine();
- CharSequence _generatedMemberComment_2 = this._common.generatedMemberComment();
- _builder.append(_generatedMemberComment_2, "");
- _builder.newLineIfNotEmpty();
- _builder.append("protected org.eclipse.gef.commands.Command getCompleteCreateRelationshipCommand(");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest req) {");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("org.eclipse.gmf.runtime.emf.type.core.IElementType requestElementType = req.getElementType();");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("if(requestElementType == null) {");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("return null;");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("org.eclipse.gmf.runtime.emf.type.core.IElementType baseElementType = requestElementType;");
- _builder.newLine();
- {
- Boolean _containsCreateCompleteLinkCommand = this.aspectsUtils_qvto.containsCreateCompleteLinkCommand(it);
- if ((_containsCreateCompleteLinkCommand).booleanValue()) {
- _builder.append("\t");
- _builder.append("boolean isExtendedType = true;");
- _builder.newLine();
- }
- }
- _builder.newLine();
- {
- Iterable<GenLink> _allPotentialLinks_1 = this._utils_qvto.getAllPotentialLinks(it);
- for(final GenLink l_1 : _allPotentialLinks_1) {
- _builder.append("\t");
- CharSequence _completeLinkCommands = this.completeLinkCommands(l_1, it);
- _builder.append(_completeLinkCommands, "\t");
- _builder.newLineIfNotEmpty();
- }
- }
- _builder.append("\t");
- _builder.append("return null;");
- _builder.newLine();
- _builder.append("}");
- _builder.newLine();
- return _builder;
- }
-
- public CharSequence startLinkCommands(final GenLink it, final GenLinkEnd linkEnd) {
- StringConcatenation _builder = new StringConcatenation();
- _builder.append("if (");
- CharSequence _accessElementType = this.xptElementTypes.accessElementType(it);
- _builder.append(_accessElementType, "");
- _builder.append(" == baseElementType) {");
- _builder.newLineIfNotEmpty();
- {
- boolean _createStartLinkCommand = this._utils_qvto.createStartLinkCommand(it, linkEnd);
- if (_createStartLinkCommand) {
- _builder.append("if(isExtendedType) {");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("return getExtendedStartCreateRelationshipCommand(req, requestElementType);");
- _builder.newLine();
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("return getGEFWrapper(new ");
- CharSequence _qualifiedClassName = this.xptCreateLinkCommand.qualifiedClassName(it);
- _builder.append(_qualifiedClassName, "\t\t");
- _builder.append("(req,");
- _builder.newLineIfNotEmpty();
- {
- boolean _createStartIncomingLinkCommand = this._utils_qvto.createStartIncomingLinkCommand(it, linkEnd);
- if (_createStartIncomingLinkCommand) {
- _builder.append("\t\t\t");
- _builder.append("req.getTarget(), req.getSource()");
- _builder.newLine();
- } else {
- _builder.append("\t\t\t");
- _builder.append("req.getSource(), req.getTarget()");
- _builder.newLine();
- }
- }
- _builder.append("\t\t");
- _builder.append("));");
- _builder.newLine();
- } else {
- _builder.append("return null;");
- _builder.newLine();
- }
- }
- _builder.append("}");
- _builder.newLine();
- return _builder;
- }
-
- public CharSequence completeLinkCommands(final GenLink it, final GenLinkEnd linkEnd) {
- StringConcatenation _builder = new StringConcatenation();
- _builder.append("if (");
- CharSequence _accessElementType = this.xptElementTypes.accessElementType(it);
- _builder.append(_accessElementType, "");
- _builder.append(" == baseElementType) {");
- _builder.newLineIfNotEmpty();
- {
- boolean _createCompleteLinkCommand = this._utils_qvto.createCompleteLinkCommand(it, linkEnd);
- if (_createCompleteLinkCommand) {
- _builder.append("\t");
- _builder.append("if(isExtendedType) {");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("\t");
- _builder.append("return getExtendedCompleteCreateRelationshipCommand(req, requestElementType);");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("\t");
- _builder.append("return getGEFWrapper(new ");
- CharSequence _qualifiedClassName = this.xptCreateLinkCommand.qualifiedClassName(it);
- _builder.append(_qualifiedClassName, "\t\t");
- _builder.append("(req,");
- _builder.newLineIfNotEmpty();
- {
- boolean _createCompleteOutgoingLinkCommand = this._utils_qvto.createCompleteOutgoingLinkCommand(it, linkEnd);
- if (_createCompleteOutgoingLinkCommand) {
- _builder.append("\t");
- _builder.append("\t\t");
- _builder.append("req.getTarget(), req.getSource()");
- _builder.newLine();
- } else {
- _builder.append("\t");
- _builder.append("\t\t");
- _builder.append("req.getSource(), req.getTarget()");
- _builder.newLine();
- }
- }
- _builder.append("\t");
- _builder.append("\t");
- _builder.append("));");
- _builder.newLine();
- } else {
- _builder.append("\t");
- _builder.append("return null;");
- _builder.newLine();
- }
- }
- _builder.append("}");
- _builder.newLine();
- return _builder;
- }
-
- public CharSequence reorientTypeLinkCommands(final GenLinkEnd it) {
- StringConcatenation _builder = new StringConcatenation();
- CharSequence _generatedMemberComment = this._common.generatedMemberComment(
- ("Returns command to reorient EClass based link. New link target or source\n" + "should be the domain model element associated with this node.\n"));
- _builder.append(_generatedMemberComment, "");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.append("protected org.eclipse.gef.commands.Command getReorientRelationshipCommand(");
- _builder.newLine();
- _builder.append("\t\t\t");
- _builder.append("org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest req) {");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("switch (getVisualID(req)) {");
- _builder.newLine();
- {
- Iterable<GenLink> _reroutableTypeLinks = this._utils_qvto.getReroutableTypeLinks(it);
- for(final GenLink link : _reroutableTypeLinks) {
- _builder.append("\t\t\t");
- CharSequence _reorientLinkCommandWithService = this.reorientLinkCommandWithService(link);
- _builder.append(_reorientLinkCommandWithService, "\t\t\t");
- _builder.newLineIfNotEmpty();
- }
- }
- _builder.append("\t\t\t");
- CharSequence _callReorientCommand = this.callReorientCommand(it);
- _builder.append(_callReorientCommand, "\t\t\t");
- _builder.newLineIfNotEmpty();
- {
- Iterable<GenLink> _reroutableTypeLinks_1 = this._utils_qvto.getReroutableTypeLinks(it);
- for(final GenLink link_1 : _reroutableTypeLinks_1) {
- _builder.append("\t\t\t");
- CharSequence _reorientLinkCommandWithoutService = this.reorientLinkCommandWithoutService(link_1);
- _builder.append(_reorientLinkCommandWithoutService, "\t\t\t");
- _builder.newLineIfNotEmpty();
- }
- }
- _builder.append("\t\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("return super.getReorientRelationshipCommand(req);");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("}");
- _builder.newLine();
- return _builder;
- }
-
- public CharSequence reorientLinkCommandWithService(final GenLink it) {
- StringConcatenation _builder = new StringConcatenation();
- {
- Resource _eResource = it.eResource();
- TreeIterator<EObject> _allContents = _eResource.getAllContents();
- Iterator<EditPartUsingReorientService> _filter = Iterators.<EditPartUsingReorientService>filter(_allContents, EditPartUsingReorientService.class);
- final Function1<EditPartUsingReorientService, Boolean> _function = new Function1<EditPartUsingReorientService, Boolean>() {
- public Boolean apply(final EditPartUsingReorientService v) {
- EList<GenLink> _genView = v.getGenView();
- return Boolean.valueOf(_genView.contains(it));
- }
- };
- Iterator<EditPartUsingReorientService> _filter_1 = IteratorExtensions.<EditPartUsingReorientService>filter(_filter, _function);
- int _size = IteratorExtensions.size(_filter_1);
- boolean _notEquals = (_size != 0);
- if (_notEquals) {
- CharSequence _caseVisualID = this.xptVisualIDRegistry.caseVisualID(it);
- _builder.append(_caseVisualID, "");
- _builder.newLineIfNotEmpty();
- }
- }
- return _builder;
- }
-
- public CharSequence callReorientCommand(final GenLinkEnd it) {
- StringConcatenation _builder = new StringConcatenation();
- Resource _eResource = it.eResource();
- TreeIterator<EObject> _allContents = _eResource.getAllContents();
- Iterator<EditPartUsingReorientService> rServiceNodes = Iterators.<EditPartUsingReorientService>filter(_allContents, EditPartUsingReorientService.class);
- _builder.newLineIfNotEmpty();
- {
- boolean _isEmpty = IteratorExtensions.isEmpty(rServiceNodes);
- boolean _not = (!_isEmpty);
- if (_not) {
- {
- final Function1<EditPartUsingReorientService, Boolean> _function = new Function1<EditPartUsingReorientService, Boolean>() {
- public Boolean apply(final EditPartUsingReorientService rServiceNode) {
- EList<GenLink> _genView = rServiceNode.getGenView();
- final Function1<GenLink, Boolean> _function = new Function1<GenLink, Boolean>() {
- public Boolean apply(final GenLink view) {
- Iterable<GenLink> _reroutableTypeLinks = linkCommands.this._utils_qvto.getReroutableTypeLinks(it);
- List<GenLink> _list = IterableExtensions.<GenLink>toList(_reroutableTypeLinks);
- return Boolean.valueOf(_list.contains(view));
- }
- };
- Iterable<GenLink> _filter = IterableExtensions.<GenLink>filter(_genView, _function);
- boolean _isEmpty = IterableExtensions.isEmpty(_filter);
- return Boolean.valueOf((!_isEmpty));
- }
- };
- Iterator<EditPartUsingReorientService> _filter = IteratorExtensions.<EditPartUsingReorientService>filter(rServiceNodes, _function);
- boolean _isEmpty_1 = IteratorExtensions.isEmpty(_filter);
- boolean _not_1 = (!_isEmpty_1);
- if (_not_1) {
- _builder.append("org.eclipse.papyrus.infra.services.edit.service.IElementEditService provider =org.eclipse.papyrus.infra.services.edit.service.ElementEditServiceUtils.getCommandProvider(req.getRelationship());");
- _builder.newLine();
- _builder.append(" ");
- _builder.append("if(provider == null) {");
- _builder.newLine();
- _builder.append(" ");
- _builder.append("return org.eclipse.gef.commands.UnexecutableCommand.INSTANCE;");
- _builder.newLine();
- _builder.append(" ");
- _builder.append("}");
- _builder.newLine();
- _builder.append(" ");
- _builder.append("// Retrieve re-orient command from the Element Edit service");
- _builder.newLine();
- _builder.append(" ");
- _builder.append("org.eclipse.gmf.runtime.common.core.command.ICommand reorientCommand = provider.getEditCommand(req);");
- _builder.newLine();
- _builder.append(" ");
- _builder.append("if(reorientCommand == null) {");
- _builder.newLine();
- _builder.append(" ");
- _builder.append("return org.eclipse.gef.commands.UnexecutableCommand.INSTANCE;");
- _builder.newLine();
- _builder.append(" ");
- _builder.append("}");
- _builder.newLine();
- _builder.append(" ");
- _builder.append("return getGEFWrapper(reorientCommand.reduce());");
- _builder.newLine();
- }
- }
- }
- }
- return _builder;
- }
-
- public CharSequence reorientLinkCommandWithoutService(final GenLink it) {
- StringConcatenation _builder = new StringConcatenation();
- {
- Resource _eResource = it.eResource();
- TreeIterator<EObject> _allContents = _eResource.getAllContents();
- Iterator<EditPartUsingReorientService> _filter = Iterators.<EditPartUsingReorientService>filter(_allContents, EditPartUsingReorientService.class);
- final Function1<EditPartUsingReorientService, Boolean> _function = new Function1<EditPartUsingReorientService, Boolean>() {
- public Boolean apply(final EditPartUsingReorientService v) {
- EList<GenLink> _genView = v.getGenView();
- return Boolean.valueOf(_genView.contains(it));
- }
- };
- Iterator<EditPartUsingReorientService> _filter_1 = IteratorExtensions.<EditPartUsingReorientService>filter(_filter, _function);
- int _size = IteratorExtensions.size(_filter_1);
- boolean _equals = (_size == 0);
- if (_equals) {
- CharSequence _reorientLinkCommand = this.reorientLinkCommand(it);
- _builder.append(_reorientLinkCommand, "");
- _builder.append(" ");
- _builder.newLineIfNotEmpty();
- }
- }
- return _builder;
- }
-}
diff --git a/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/diagram/preferences/.gitignore b/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/diagram/preferences/.gitignore
deleted file mode 100644
index 52c1b8e9b16..00000000000
--- a/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/diagram/preferences/.gitignore
+++ /dev/null
@@ -1,2 +0,0 @@
-/PreferenceInitializer.java
-/extensions.java
diff --git a/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/diagram/preferences/PreferenceInitializer.java b/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/diagram/preferences/PreferenceInitializer.java
deleted file mode 100644
index 4fca19e938b..00000000000
--- a/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/diagram/preferences/PreferenceInitializer.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/**
- * Copyright (c) 2007, 2009, 2013 Borland Software Corporation and others
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Dmitry Stadnik (Borland) - initial API and implementation
- * Michael Golubev (Montages) - #386838 - migrate to Xtend2
- * Thibault Landre (Atos Origin) - initial API and implementation
- * Patrick Tessier (CEA LIST)
- */
-package aspects.xpt.diagram.preferences;
-
-import com.google.inject.Inject;
-import com.google.inject.Singleton;
-import org.eclipse.xtext.xbase.lib.Extension;
-import plugin.Activator;
-import xpt.Common;
-
-@Singleton
-@SuppressWarnings("all")
-public class PreferenceInitializer extends xpt.diagram.preferences.PreferenceInitializer {
- @Inject
- @Extension
- private Common _common;
-
- @Inject
- private Activator xptActivator;
-}
diff --git a/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/diagram/preferences/extensions.java b/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/diagram/preferences/extensions.java
deleted file mode 100644
index ee135cd03a4..00000000000
--- a/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/diagram/preferences/extensions.java
+++ /dev/null
@@ -1,201 +0,0 @@
-/**
- * Copyright (c) 2007, 2010, 2013 Borland Software Corporation and others
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Dmitry Stadnik (Borland) - initial API and implementation
- * Michael Golubev (Montages) - #386838 - migrate to Xtend2
- * Thibault Landre (Atos Origin) - initial API and implementation
- */
-package aspects.xpt.diagram.preferences;
-
-import com.google.common.base.Objects;
-import com.google.inject.Inject;
-import com.google.inject.Singleton;
-import java.util.List;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.gmf.codegen.gmfgen.GenDiagram;
-import org.eclipse.gmf.codegen.gmfgen.GenEditorGenerator;
-import org.eclipse.gmf.codegen.gmfgen.GenPreferencePage;
-import org.eclipse.gmf.codegen.gmfgen.GenStandardPreferencePage;
-import org.eclipse.gmf.codegen.gmfgen.StandardPreferencePages;
-import org.eclipse.xtend2.lib.StringConcatenation;
-import org.eclipse.xtext.xbase.lib.Extension;
-import utils.PrefsConstant_qvto;
-import xpt.Common;
-import xpt.diagram.Utils_qvto;
-import xpt.diagram.preferences.PreferenceInitializer;
-
-@Singleton
-@SuppressWarnings("all")
-public class extensions extends xpt.diagram.preferences.extensions {
- @Inject
- @Extension
- private Common _common;
-
- @Inject
- @Extension
- private Utils_qvto _utils_qvto;
-
- @Inject
- @Extension
- private PrefsConstant_qvto _prefsConstant_qvto;
-
- @Inject
- private PreferenceInitializer xptPreferenceInitializer;
-
- public CharSequence extensions(final GenDiagram it) {
- StringConcatenation _builder = new StringConcatenation();
- _builder.newLine();
- String _tripleSpace = this._common.tripleSpace(1);
- _builder.append(_tripleSpace, "");
- _builder.append("<extension point=\"org.eclipse.core.runtime.preferences\" id=\"prefs\">");
- _builder.newLineIfNotEmpty();
- String _tripleSpace_1 = this._common.tripleSpace(2);
- _builder.append(_tripleSpace_1, "");
- CharSequence _xmlGeneratedTag = this._common.xmlGeneratedTag();
- _builder.append(_xmlGeneratedTag, "");
- _builder.newLineIfNotEmpty();
- String _tripleSpace_2 = this._common.tripleSpace(2);
- _builder.append(_tripleSpace_2, "");
- _builder.append("<initializer class=\"");
- CharSequence _qualifiedClassName = this.xptPreferenceInitializer.qualifiedClassName(it);
- _builder.append(_qualifiedClassName, "");
- _builder.append("\"/>");
- _builder.newLineIfNotEmpty();
- String _tripleSpace_3 = this._common.tripleSpace(1);
- _builder.append(_tripleSpace_3, "");
- _builder.append("</extension>");
- _builder.newLineIfNotEmpty();
- _builder.newLine();
- {
- EList<GenPreferencePage> _preferencePages = it.getPreferencePages();
- boolean _isEmpty = _preferencePages.isEmpty();
- boolean _not = (!_isEmpty);
- if (_not) {
- String _tripleSpace_4 = this._common.tripleSpace(1);
- _builder.append(_tripleSpace_4, "");
- _builder.append("<extension point=\"org.eclipse.ui.preferencePages\" id=\"prefpages\">");
- _builder.newLineIfNotEmpty();
- String _tripleSpace_5 = this._common.tripleSpace(2);
- _builder.append(_tripleSpace_5, "");
- CharSequence _xmlGeneratedTag_1 = this._common.xmlGeneratedTag();
- _builder.append(_xmlGeneratedTag_1, "");
- _builder.newLineIfNotEmpty();
- {
- List<GenPreferencePage> _allPreferencePages = this._utils_qvto.allPreferencePages(it);
- for(final GenPreferencePage pref : _allPreferencePages) {
- {
- if ((pref instanceof GenStandardPreferencePage)) {
- CharSequence _papyrusPreferencePage = this.papyrusPreferencePage(((GenStandardPreferencePage) pref));
- _builder.append(_papyrusPreferencePage, "");
- _builder.newLineIfNotEmpty();
- }
- }
- }
- }
- String _tripleSpace_6 = this._common.tripleSpace(1);
- _builder.append(_tripleSpace_6, "");
- _builder.append("</extension>");
- _builder.newLineIfNotEmpty();
- }
- }
- return _builder;
- }
-
- public CharSequence papyrusPreferencePage(final GenStandardPreferencePage it) {
- StringConcatenation _builder = new StringConcatenation();
- {
- StandardPreferencePages _kind = it.getKind();
- boolean _equals = Objects.equal(StandardPreferencePages.GENERAL_LITERAL, _kind);
- if (_equals) {
- _builder.append("<page");
- _builder.newLine();
- _builder.append(" ");
- _builder.append("id=\"");
- String _diagramPreferencePageCategory = this._prefsConstant_qvto.getDiagramPreferencePageCategory();
- _builder.append(_diagramPreferencePageCategory, " ");
- _builder.append(".");
- GenDiagram _diagram = it.getDiagram();
- GenEditorGenerator _editorGen = _diagram.getEditorGen();
- String _modelID = _editorGen.getModelID();
- _builder.append(_modelID, " ");
- _builder.append("\"");
- _builder.newLineIfNotEmpty();
- _builder.append(" ");
- _builder.append("name=\"");
- GenDiagram _diagram_1 = it.getDiagram();
- GenEditorGenerator _editorGen_1 = _diagram_1.getEditorGen();
- String _modelID_1 = _editorGen_1.getModelID();
- _builder.append(_modelID_1, " ");
- _builder.append(" Diagram\"");
- _builder.newLineIfNotEmpty();
- _builder.append(" ");
- _builder.append("category=\"");
- String _diagramPreferencePageCategory_1 = this._prefsConstant_qvto.getDiagramPreferencePageCategory();
- _builder.append(_diagramPreferencePageCategory_1, " ");
- _builder.append("\"");
- _builder.newLineIfNotEmpty();
- _builder.append(" ");
- _builder.append("class=\"");
- String _qualifiedClassName = it.getQualifiedClassName();
- _builder.append(_qualifiedClassName, " ");
- _builder.append("\">");
- _builder.newLineIfNotEmpty();
- _builder.append("</page>");
- _builder.newLine();
- } else {
- boolean _or = false;
- StandardPreferencePages _kind_1 = it.getKind();
- boolean _equals_1 = Objects.equal(StandardPreferencePages.PRINTING_LITERAL, _kind_1);
- if (_equals_1) {
- _or = true;
- } else {
- StandardPreferencePages _kind_2 = it.getKind();
- boolean _equals_2 = Objects.equal(StandardPreferencePages.RULERS_AND_GRID_LITERAL, _kind_2);
- _or = _equals_2;
- }
- if (_or) {
- _builder.append("<page");
- _builder.newLine();
- _builder.append(" ");
- _builder.append("id=\"");
- String _qualifiedClassName_1 = it.getQualifiedClassName();
- _builder.append(_qualifiedClassName_1, " ");
- _builder.append("\"");
- _builder.newLineIfNotEmpty();
- _builder.append(" ");
- _builder.append("name=\"%prefpage.");
- String _iD = it.getID();
- _builder.append(_iD, " ");
- _builder.append("\"");
- _builder.newLineIfNotEmpty();
- _builder.append(" ");
- _builder.append("category=\"");
- String _diagramPreferencePageCategory_2 = this._prefsConstant_qvto.getDiagramPreferencePageCategory();
- _builder.append(_diagramPreferencePageCategory_2, " ");
- _builder.append(".");
- GenDiagram _diagram_2 = it.getDiagram();
- GenEditorGenerator _editorGen_2 = _diagram_2.getEditorGen();
- String _modelID_2 = _editorGen_2.getModelID();
- _builder.append(_modelID_2, " ");
- _builder.append("\"");
- _builder.newLineIfNotEmpty();
- _builder.append(" ");
- _builder.append("class=\"");
- String _qualifiedClassName_2 = it.getQualifiedClassName();
- _builder.append(_qualifiedClassName_2, " ");
- _builder.append("\">");
- _builder.newLineIfNotEmpty();
- _builder.append("</page>");
- _builder.newLine();
- }
- }
- }
- return _builder;
- }
-}
diff --git a/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/diagram/updater/.gitignore b/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/diagram/updater/.gitignore
deleted file mode 100644
index fd5fcc747d8..00000000000
--- a/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/diagram/updater/.gitignore
+++ /dev/null
@@ -1,2 +0,0 @@
-/DiagramUpdater.java
-/Extensions.java
diff --git a/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/diagram/updater/DiagramUpdater.java b/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/diagram/updater/DiagramUpdater.java
deleted file mode 100644
index 2d6b322abc7..00000000000
--- a/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/diagram/updater/DiagramUpdater.java
+++ /dev/null
@@ -1,1082 +0,0 @@
-/**
- * Copyright (c) 2007, 2010, 2014 Borland Software Corporation, CEA, and others
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Alexander Shatalin (Borland) - initial API and implementation
- * Michael Golubev (Borland) - [243151] explicit source/target for links
- * Michael Golubev (Montages) - API extracted to gmf.tooling.runtime, template migrated to Xtend2
- * Christian W. Damus (CEA) - bug 426732: override the cross-reference searches for views to use the CrossReferenceAdapter
- */
-package aspects.xpt.diagram.updater;
-
-import aspects.xpt.editor.VisualIDRegistry;
-import com.google.common.base.Objects;
-import com.google.common.collect.Iterators;
-import com.google.inject.Inject;
-import com.google.inject.Singleton;
-import java.util.Arrays;
-import java.util.Iterator;
-import java.util.Set;
-import metamodel.MetaModel;
-import org.eclipse.emf.codegen.ecore.genmodel.GenClass;
-import org.eclipse.emf.codegen.ecore.genmodel.GenFeature;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.common.util.TreeIterator;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.gmf.codegen.gmfgen.FeatureLinkModelFacet;
-import org.eclipse.gmf.codegen.gmfgen.GenCommonBase;
-import org.eclipse.gmf.codegen.gmfgen.GenContainerBase;
-import org.eclipse.gmf.codegen.gmfgen.GenDiagram;
-import org.eclipse.gmf.codegen.gmfgen.GenDiagramUpdater;
-import org.eclipse.gmf.codegen.gmfgen.GenEditorGenerator;
-import org.eclipse.gmf.codegen.gmfgen.GenLink;
-import org.eclipse.gmf.codegen.gmfgen.GenLinkEnd;
-import org.eclipse.gmf.codegen.gmfgen.GenNode;
-import org.eclipse.gmf.codegen.gmfgen.LinkModelFacet;
-import org.eclipse.gmf.codegen.gmfgen.TypeLinkModelFacet;
-import org.eclipse.papyrus.papyrusgmfgenextension.CustomDiagramUpdaterSingleton;
-import org.eclipse.papyrus.papyrusgmfgenextension.SpecificDiagramUpdater;
-import org.eclipse.xtend2.lib.StringConcatenation;
-import org.eclipse.xtext.xbase.lib.Extension;
-import org.eclipse.xtext.xbase.lib.Functions.Function1;
-import org.eclipse.xtext.xbase.lib.IterableExtensions;
-import org.eclipse.xtext.xbase.lib.IteratorExtensions;
-import xpt.Common;
-import xpt.Common_qvto;
-import xpt.GenModelUtils_qvto;
-import xpt.diagram.updater.LinkDescriptor;
-import xpt.diagram.updater.NodeDescriptor;
-import xpt.diagram.updater.UpdaterLinkType;
-import xpt.diagram.updater.Utils_qvto;
-
-@Singleton
-@SuppressWarnings("all")
-public class DiagramUpdater extends xpt.diagram.updater.DiagramUpdater {
- @Inject
- @Extension
- private Common _common;
-
- @Inject
- @Extension
- private Common_qvto _common_qvto;
-
- @Inject
- @Extension
- private Utils_qvto _utils_qvto;
-
- @Inject
- @Extension
- private GenModelUtils_qvto _genModelUtils_qvto;
-
- @Inject
- private LinkDescriptor linkDescriptor;
-
- @Inject
- private VisualIDRegistry xptVisualIDRegistry;
-
- @Inject
- private NodeDescriptor nodeDescriptor;
-
- @Inject
- private MetaModel xptMetaModel;
-
- public CharSequence diagramUpdaterInstanceToUse(final GenDiagramUpdater it) {
- StringConcatenation _builder = new StringConcatenation();
- {
- Resource _eResource = it.eResource();
- TreeIterator<EObject> _allContents = _eResource.getAllContents();
- Iterator<CustomDiagramUpdaterSingleton> _filter = Iterators.<CustomDiagramUpdaterSingleton>filter(_allContents, CustomDiagramUpdaterSingleton.class);
- final Function1<CustomDiagramUpdaterSingleton, Boolean> _function = new Function1<CustomDiagramUpdaterSingleton, Boolean>() {
- public Boolean apply(final CustomDiagramUpdaterSingleton v) {
- String _singletonPath = v.getSingletonPath();
- return Boolean.valueOf((!Objects.equal(_singletonPath, null)));
- }
- };
- Iterator<CustomDiagramUpdaterSingleton> _filter_1 = IteratorExtensions.<CustomDiagramUpdaterSingleton>filter(_filter, _function);
- int _size = IteratorExtensions.size(_filter_1);
- boolean _equals = (_size ==
- 1);
- if (_equals) {
- Resource _eResource_1 = it.eResource();
- TreeIterator<EObject> _allContents_1 = _eResource_1.getAllContents();
- Iterator<CustomDiagramUpdaterSingleton> _filter_2 = Iterators.<CustomDiagramUpdaterSingleton>filter(_allContents_1, CustomDiagramUpdaterSingleton.class);
- final Function1<CustomDiagramUpdaterSingleton, Boolean> _function_1 = new Function1<CustomDiagramUpdaterSingleton, Boolean>() {
- public Boolean apply(final CustomDiagramUpdaterSingleton v) {
- String _singletonPath = v.getSingletonPath();
- return Boolean.valueOf((!Objects.equal(_singletonPath, null)));
- }
- };
- Iterator<CustomDiagramUpdaterSingleton> _filter_3 = IteratorExtensions.<CustomDiagramUpdaterSingleton>filter(_filter_2, _function_1);
- CustomDiagramUpdaterSingleton _head = IteratorExtensions.<CustomDiagramUpdaterSingleton>head(_filter_3);
- String _singletonPath = _head.getSingletonPath();
- _builder.append(_singletonPath, "");
- _builder.newLineIfNotEmpty();
- } else {
- String _diagramUpdaterQualifiedClassName = it.getDiagramUpdaterQualifiedClassName();
- _builder.append(_diagramUpdaterQualifiedClassName, "");
- _builder.append(".INSTANCE");
- _builder.newLineIfNotEmpty();
- }
- }
- return _builder;
- }
-
- protected CharSequence typeOfCrossReferenceAdapter() {
- StringConcatenation _builder = new StringConcatenation();
- _builder.append("org.eclipse.gmf.runtime.emf.core.util.CrossReferenceAdapter");
- return _builder;
- }
-
- public CharSequence getSemanticChildrenMethodCall(final GenContainerBase it) {
- StringConcatenation _builder = new StringConcatenation();
- GenDiagramUpdater _diagramUpdater = this.diagramUpdater(it);
- CharSequence _diagramUpdaterInstanceToUse = this.diagramUpdaterInstanceToUse(_diagramUpdater);
- _builder.append(_diagramUpdaterInstanceToUse, "");
- _builder.append(".");
- CharSequence _semanticChildrenMethodName = this.getSemanticChildrenMethodName(it);
- _builder.append(_semanticChildrenMethodName, "");
- return _builder;
- }
-
- public CharSequence doGetSomeLinksMethodCall(final GenCommonBase it, final UpdaterLinkType linkType) {
- StringConcatenation _builder = new StringConcatenation();
- GenDiagram _diagram = it.getDiagram();
- GenDiagramUpdater _diagramUpdater = this.diagramUpdater(_diagram);
- CharSequence _diagramUpdaterInstanceToUse = this.diagramUpdaterInstanceToUse(_diagramUpdater);
- _builder.append(_diagramUpdaterInstanceToUse, "");
- _builder.append(".");
- CharSequence _linkGetterName = this.linkGetterName(it, linkType);
- _builder.append(_linkGetterName, "");
- return _builder;
- }
-
- public CharSequence _constructor(final GenDiagramUpdater it) {
- StringConcatenation _builder = new StringConcatenation();
- CharSequence _generatedMemberComment = this._common.generatedMemberComment();
- _builder.append(_generatedMemberComment, "");
- _builder.newLineIfNotEmpty();
- _builder.append("protected ");
- String _diagramUpdaterClassName = it.getDiagramUpdaterClassName();
- _builder.append(_diagramUpdaterClassName, "");
- _builder.append("(){");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.append("//to prevent instantiation allowing the override");
- _builder.newLine();
- _builder.append("}");
- _builder.newLine();
- return _builder;
- }
-
- public CharSequence classSingleton(final GenDiagramUpdater it) {
- StringConcatenation _builder = new StringConcatenation();
- {
- Resource _eResource = it.eResource();
- TreeIterator<EObject> _allContents = _eResource.getAllContents();
- Iterator<CustomDiagramUpdaterSingleton> _filter = Iterators.<CustomDiagramUpdaterSingleton>filter(_allContents, CustomDiagramUpdaterSingleton.class);
- final Function1<CustomDiagramUpdaterSingleton, Boolean> _function = new Function1<CustomDiagramUpdaterSingleton, Boolean>() {
- public Boolean apply(final CustomDiagramUpdaterSingleton v) {
- String _singletonPath = v.getSingletonPath();
- return Boolean.valueOf((!Objects.equal(_singletonPath, null)));
- }
- };
- Iterator<CustomDiagramUpdaterSingleton> _filter_1 = IteratorExtensions.<CustomDiagramUpdaterSingleton>filter(_filter, _function);
- int _size = IteratorExtensions.size(_filter_1);
- boolean _notEquals = (_size != 1);
- if (_notEquals) {
- CharSequence _generatedMemberComment = this._common.generatedMemberComment();
- _builder.append(_generatedMemberComment, "");
- _builder.newLineIfNotEmpty();
- _builder.append("public static final ");
- String _diagramUpdaterQualifiedClassName = it.getDiagramUpdaterQualifiedClassName();
- _builder.append(_diagramUpdaterQualifiedClassName, "");
- _builder.append(" INSTANCE = new ");
- String _diagramUpdaterClassName = it.getDiagramUpdaterClassName();
- _builder.append(_diagramUpdaterClassName, "");
- _builder.append("();");
- _builder.newLineIfNotEmpty();
- }
- }
- return _builder;
- }
-
- public CharSequence DiagramUpdater(final GenDiagramUpdater it) {
- StringConcatenation _builder = new StringConcatenation();
- _builder.append("\t");
- GenEditorGenerator _editorGen = it.getEditorGen();
- CharSequence _copyright = this._common.copyright(_editorGen);
- _builder.append(_copyright, "\t");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.append("package ");
- CharSequence _packageName = this.packageName(it);
- _builder.append(_packageName, "\t");
- _builder.append(";");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.newLine();
- _builder.append("\t");
- CharSequence _generatedClassComment = this._common.generatedClassComment();
- _builder.append(_generatedClassComment, "\t");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.append("public class ");
- CharSequence _className = this.className(it);
- _builder.append(_className, "\t");
- _builder.append(" implements org.eclipse.gmf.tooling.runtime.update.DiagramUpdater {");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- CharSequence _classSingleton = this.classSingleton(it);
- _builder.append(_classSingleton, "\t");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- CharSequence __constructor = this._constructor(it);
- _builder.append(__constructor, "\t");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- CharSequence _isShortcutOrphaned = this.isShortcutOrphaned(it);
- _builder.append(_isShortcutOrphaned, "\t");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- GenEditorGenerator _editorGen_1 = it.getEditorGen();
- GenDiagram _diagram = _editorGen_1.getDiagram();
- EList<GenContainerBase> _allContainers = _diagram.getAllContainers();
- final Function1<GenContainerBase, Boolean> _function = new Function1<GenContainerBase, Boolean>() {
- public Boolean apply(final GenContainerBase container) {
- return Boolean.valueOf(DiagramUpdater.this._utils_qvto.hasSemanticChildren(container));
- }
- };
- Iterable<GenContainerBase> semanticContainers = IterableExtensions.<GenContainerBase>filter(_allContainers, _function);
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- CharSequence _genericSemanticChildrenOfView = this.getGenericSemanticChildrenOfView(it, semanticContainers);
- _builder.append(_genericSemanticChildrenOfView, "\t");
- _builder.newLineIfNotEmpty();
- {
- for(final GenContainerBase next : semanticContainers) {
- _builder.append("\t");
- CharSequence _semanticChildrenOfView = this.getSemanticChildrenOfView(next);
- _builder.append(_semanticChildrenOfView, "\t");
- _builder.newLineIfNotEmpty();
- }
- }
- _builder.append("\t");
- _builder.newLine();
- _builder.append("\t");
- CharSequence _phantomNodesIterator = this.getPhantomNodesIterator(it);
- _builder.append(_phantomNodesIterator, "\t");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.newLine();
- _builder.append("\t");
- GenEditorGenerator _editorGen_2 = it.getEditorGen();
- GenDiagram _diagram_1 = _editorGen_2.getDiagram();
- Iterable<GenCommonBase> _allSemanticElements = this._utils_qvto.getAllSemanticElements(_diagram_1);
- CharSequence _genericConnectedLinks = this.getGenericConnectedLinks(it, _allSemanticElements, UpdaterLinkType.CONTAINED);
- _builder.append(_genericConnectedLinks, "\t");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.newLine();
- _builder.append("\t");
- GenEditorGenerator _editorGen_3 = it.getEditorGen();
- GenDiagram _diagram_2 = _editorGen_3.getDiagram();
- Iterable<GenLinkEnd> _allSemanticDiagramElements = this._utils_qvto.getAllSemanticDiagramElements(_diagram_2);
- CharSequence _genericConnectedLinks_1 = this.getGenericConnectedLinks(it, _allSemanticDiagramElements, UpdaterLinkType.INCOMING);
- _builder.append(_genericConnectedLinks_1, "\t");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.newLine();
- _builder.append("\t");
- GenEditorGenerator _editorGen_4 = it.getEditorGen();
- GenDiagram _diagram_3 = _editorGen_4.getDiagram();
- Iterable<GenLinkEnd> _allSemanticDiagramElements_1 = this._utils_qvto.getAllSemanticDiagramElements(_diagram_3);
- CharSequence _genericConnectedLinks_2 = this.getGenericConnectedLinks(it, _allSemanticDiagramElements_1, UpdaterLinkType.OUTGOING);
- _builder.append(_genericConnectedLinks_2, "\t");
- _builder.newLineIfNotEmpty();
- {
- GenEditorGenerator _editorGen_5 = it.getEditorGen();
- GenDiagram _diagram_4 = _editorGen_5.getDiagram();
- Iterable<GenCommonBase> _allSemanticElements_1 = this._utils_qvto.getAllSemanticElements(_diagram_4);
- for(final GenCommonBase e : _allSemanticElements_1) {
- _builder.append("\t");
- CharSequence _containedLinks = this.getContainedLinks(e);
- _builder.append(_containedLinks, "\t");
- _builder.newLineIfNotEmpty();
- }
- }
- {
- GenEditorGenerator _editorGen_6 = it.getEditorGen();
- GenDiagram _diagram_5 = _editorGen_6.getDiagram();
- Iterable<GenLinkEnd> _allSemanticDiagramElements_2 = this._utils_qvto.getAllSemanticDiagramElements(_diagram_5);
- for(final GenLinkEnd e_1 : _allSemanticDiagramElements_2) {
- _builder.append("\t");
- CharSequence _incomingLinks = this.getIncomingLinks(e_1);
- _builder.append(_incomingLinks, "\t");
- _builder.newLineIfNotEmpty();
- }
- }
- {
- GenEditorGenerator _editorGen_7 = it.getEditorGen();
- GenDiagram _diagram_6 = _editorGen_7.getDiagram();
- Iterable<GenLinkEnd> _allSemanticDiagramElements_3 = this._utils_qvto.getAllSemanticDiagramElements(_diagram_6);
- for(final GenLinkEnd e_2 : _allSemanticDiagramElements_3) {
- _builder.append("\t");
- CharSequence _outgoingLinks = this.getOutgoingLinks(e_2);
- _builder.append(_outgoingLinks, "\t");
- _builder.newLineIfNotEmpty();
- }
- }
- {
- GenEditorGenerator _editorGen_8 = it.getEditorGen();
- GenDiagram _diagram_7 = _editorGen_8.getDiagram();
- Iterable<GenLink> _allContainedLinks = this._utils_qvto.getAllContainedLinks(_diagram_7);
- for(final GenLink link : _allContainedLinks) {
- _builder.append("\t");
- CharSequence _containedLinksByTypeMethod = this.getContainedLinksByTypeMethod(link);
- _builder.append(_containedLinksByTypeMethod, "\t");
- _builder.newLineIfNotEmpty();
- }
- }
- {
- GenEditorGenerator _editorGen_9 = it.getEditorGen();
- GenDiagram _diagram_8 = _editorGen_9.getDiagram();
- Iterable<GenLink> _allIncomingLinks = this._utils_qvto.getAllIncomingLinks(_diagram_8);
- for(final GenLink link_1 : _allIncomingLinks) {
- _builder.append("\t");
- CharSequence _incomingLinksByTypeMethod = this.getIncomingLinksByTypeMethod(link_1);
- _builder.append(_incomingLinksByTypeMethod, "\t");
- _builder.newLineIfNotEmpty();
- }
- }
- {
- GenEditorGenerator _editorGen_10 = it.getEditorGen();
- GenDiagram _diagram_9 = _editorGen_10.getDiagram();
- Iterable<GenLink> _allOutgoingLinks = this._utils_qvto.getAllOutgoingLinks(_diagram_9);
- for(final GenLink link_2 : _allOutgoingLinks) {
- _builder.append("\t");
- CharSequence _outgoingLinksByTypeMethod = this.getOutgoingLinksByTypeMethod(link_2);
- _builder.append(_outgoingLinksByTypeMethod, "\t");
- _builder.newLineIfNotEmpty();
- }
- }
- _builder.append("\t");
- _builder.newLine();
- _builder.append("\t");
- CharSequence _runtimeTypedInstance = this.runtimeTypedInstance(it);
- _builder.append(_runtimeTypedInstance, "\t");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.newLine();
- _builder.append("\t");
- CharSequence _additions = this.additions(it);
- _builder.append(_additions, "\t");
- _builder.newLineIfNotEmpty();
- _builder.append("}");
- _builder.newLine();
- return _builder;
- }
-
- public CharSequence getConnectedLinks(final GenCommonBase it, final Iterable<GenLink> genLinks, final UpdaterLinkType linkType, final boolean needCrossReferencer) {
- StringConcatenation _builder = new StringConcatenation();
- _builder.newLine();
- CharSequence _generatedMemberComment = this._common.generatedMemberComment();
- _builder.append(_generatedMemberComment, "");
- _builder.newLineIfNotEmpty();
- _builder.append("\t\t");
- _builder.append("public ");
- CharSequence _listOfLinkDescriptors = this.listOfLinkDescriptors(it);
- _builder.append(_listOfLinkDescriptors, "\t\t");
- _builder.append(" ");
- CharSequence _linkGetterName = this.linkGetterName(it, linkType);
- _builder.append(_linkGetterName, "\t\t");
- _builder.append("(org.eclipse.gmf.runtime.notation.View view) {");
- _builder.newLineIfNotEmpty();
- {
- boolean _notEmpty = this._common_qvto.<GenLink>notEmpty(genLinks);
- if (_notEmpty) {
- GenClass _metaClass = this._utils_qvto.getMetaClass(it);
- CharSequence _DeclareAndAssign = this.xptMetaModel.DeclareAndAssign(_metaClass, "modelElement", "view.getElement()");
- _builder.append(_DeclareAndAssign, "");
- _builder.newLineIfNotEmpty();
- {
- if (needCrossReferencer) {
- CharSequence _typeOfCrossReferenceAdapter = this.typeOfCrossReferenceAdapter();
- _builder.append(_typeOfCrossReferenceAdapter, "");
- _builder.append(" crossReferencer = ");
- CharSequence _typeOfCrossReferenceAdapter_1 = this.typeOfCrossReferenceAdapter();
- _builder.append(_typeOfCrossReferenceAdapter_1, "");
- _builder.append(".getCrossReferenceAdapter(view.eResource().getResourceSet());");
- _builder.newLineIfNotEmpty();
- }
- }
- GenDiagramUpdater _diagramUpdater = this.diagramUpdater(it);
- CharSequence _newLinkedListOfLinkDescriptors = this.newLinkedListOfLinkDescriptors(_diagramUpdater, "result");
- _builder.append(_newLinkedListOfLinkDescriptors, "");
- _builder.append("();");
- _builder.newLineIfNotEmpty();
- {
- for(final GenLink link : genLinks) {
- GenClass _metaClass_1 = this._utils_qvto.getMetaClass(it);
- boolean _isExternalInterface = this._genModelUtils_qvto.isExternalInterface(_metaClass_1);
- CharSequence _colectConnectedLinks = this.colectConnectedLinks(link, linkType, needCrossReferencer, _isExternalInterface);
- _builder.append(_colectConnectedLinks, "");
- _builder.newLineIfNotEmpty();
- }
- }
- _builder.append("return result;");
- _builder.newLine();
- } else {
- _builder.append("return ");
- CharSequence _newEmptyList = this.newEmptyList();
- _builder.append(_newEmptyList, "");
- _builder.append(";");
- _builder.newLineIfNotEmpty();
- }
- }
- _builder.append("}");
- _builder.newLine();
- return _builder;
- }
-
- public CharSequence colectConnectedLinks(final GenLink it, final UpdaterLinkType linkType, final boolean needCrossReferencer, final boolean isExternalInterface) {
- StringConcatenation _builder = new StringConcatenation();
- {
- LinkModelFacet _modelFacet = it.getModelFacet();
- boolean _notEquals = (!Objects.equal(_modelFacet, null));
- if (_notEquals) {
- {
- boolean _and = false;
- if (!isExternalInterface) {
- _and = false;
- } else {
- LinkModelFacet _modelFacet_1 = it.getModelFacet();
- boolean _oclIsKindOf = this._common_qvto.oclIsKindOf(_modelFacet_1, FeatureLinkModelFacet.class);
- boolean _not = (!_oclIsKindOf);
- _and = _not;
- }
- if (_and) {
- _builder.append("if (");
- LinkModelFacet _modelFacet_2 = it.getModelFacet();
- GenClass _linkEndType = this._utils_qvto.getLinkEndType(_modelFacet_2, linkType);
- CharSequence _IsInstance = this.xptMetaModel.IsInstance(_linkEndType, "modelElement");
- _builder.append(_IsInstance, "");
- _builder.append(") {");
- _builder.newLineIfNotEmpty();
- }
- }
- _builder.append("result.addAll(");
- LinkModelFacet _modelFacet_3 = it.getModelFacet();
- CharSequence _chooseConnectedLinksByTypeMethodName = this.chooseConnectedLinksByTypeMethodName(_modelFacet_3, linkType, it);
- _builder.append(_chooseConnectedLinksByTypeMethodName, "");
- _builder.append("(");
- {
- boolean _and_1 = false;
- if (!isExternalInterface) {
- _and_1 = false;
- } else {
- LinkModelFacet _modelFacet_4 = it.getModelFacet();
- boolean _oclIsKindOf_1 = this._common_qvto.oclIsKindOf(_modelFacet_4, FeatureLinkModelFacet.class);
- boolean _not_1 = (!_oclIsKindOf_1);
- _and_1 = _not_1;
- }
- if (_and_1) {
- LinkModelFacet _modelFacet_5 = it.getModelFacet();
- GenClass _linkEndType_1 = this._utils_qvto.getLinkEndType(_modelFacet_5, linkType);
- CharSequence _CastEObject = this.xptMetaModel.CastEObject(_linkEndType_1, "modelElement");
- _builder.append(_CastEObject, "");
- } else {
- _builder.append("modelElement");
- }
- }
- {
- if (needCrossReferencer) {
- _builder.append(", crossReferencer");
- }
- }
- _builder.append(")); ");
- _builder.newLineIfNotEmpty();
- {
- boolean _and_2 = false;
- if (!isExternalInterface) {
- _and_2 = false;
- } else {
- LinkModelFacet _modelFacet_6 = it.getModelFacet();
- boolean _oclIsKindOf_2 = this._common_qvto.oclIsKindOf(_modelFacet_6, FeatureLinkModelFacet.class);
- boolean _not_2 = (!_oclIsKindOf_2);
- _and_2 = _not_2;
- }
- if (_and_2) {
- _builder.append("}");
- _builder.newLine();
- }
- }
- }
- }
- return _builder;
- }
-
- public CharSequence getIncomingLinksByTypeMethod(final GenLink it) {
- StringConcatenation _builder = new StringConcatenation();
- _builder.append(" ");
- CharSequence _generatedMemberComment = this._common.generatedMemberComment();
- _builder.append(_generatedMemberComment, " ");
- _builder.newLineIfNotEmpty();
- _builder.append(" \t\t");
- _builder.append("protected java.util.Collection<");
- GenDiagramUpdater _diagramUpdater = this.diagramUpdater(it);
- CharSequence _qualifiedClassName = this.linkDescriptor.qualifiedClassName(_diagramUpdater);
- _builder.append(_qualifiedClassName, " \t\t");
- _builder.append("> ");
- CharSequence _connectedLinksByTypeMethodName = this.getConnectedLinksByTypeMethodName(it,
- UpdaterLinkType.INCOMING);
- _builder.append(_connectedLinksByTypeMethodName, " \t\t");
- _builder.append("(");
- LinkModelFacet _modelFacet = it.getModelFacet();
- GenClass _targetType = _modelFacet.getTargetType();
- CharSequence _QualifiedClassName = this.xptMetaModel.QualifiedClassName(_targetType);
- _builder.append(_QualifiedClassName, " \t\t");
- _builder.append(" target, ");
- CharSequence _typeOfCrossReferenceAdapter = this.typeOfCrossReferenceAdapter();
- _builder.append(_typeOfCrossReferenceAdapter, " \t\t");
- _builder.append(" crossReferencer) {");
- _builder.newLineIfNotEmpty();
- _builder.append(" ");
- GenDiagramUpdater _diagramUpdater_1 = this.diagramUpdater(it);
- CharSequence _newLinkedListOfLinkDescriptors = this.newLinkedListOfLinkDescriptors(_diagramUpdater_1, "result");
- _builder.append(_newLinkedListOfLinkDescriptors, " ");
- _builder.append("();");
- _builder.newLineIfNotEmpty();
- _builder.append(" ");
- _builder.append("java.util.Collection<org.eclipse.emf.ecore.EStructuralFeature.Setting> settings = crossReferencer.getInverseReferences(target);");
- _builder.newLine();
- _builder.append(" ");
- _builder.append("for (org.eclipse.emf.ecore.EStructuralFeature.Setting setting : settings) {");
- _builder.newLine();
- _builder.append(" ");
- LinkModelFacet _modelFacet_1 = it.getModelFacet();
- CharSequence _incomingLinksByTypeMethodBody = this.getIncomingLinksByTypeMethodBody(_modelFacet_1, it);
- _builder.append(_incomingLinksByTypeMethodBody, " ");
- _builder.newLineIfNotEmpty();
- _builder.append(" ");
- _builder.append("}");
- _builder.newLine();
- _builder.append(" ");
- _builder.append("return result; ");
- _builder.newLine();
- _builder.append("}");
- _builder.newLine();
- return _builder;
- }
-
- public CharSequence getICustomDiagramUpdater(final GenContainerBase it) {
- StringConcatenation _builder = new StringConcatenation();
- _builder.append("org.eclipse.papyrus.uml.diagram.common.part.ICustomDiagramUpdater<");
- GenDiagramUpdater _diagramUpdater = this.diagramUpdater(it);
- CharSequence _qualifiedClassName = this.nodeDescriptor.qualifiedClassName(_diagramUpdater);
- _builder.append(_qualifiedClassName, "");
- _builder.append(">");
- return _builder;
- }
-
- public CharSequence getSemanticChildrenOfView(final GenContainerBase it) {
- StringConcatenation _builder = new StringConcatenation();
- {
- Resource _eResource = it.eResource();
- TreeIterator<EObject> _allContents = _eResource.getAllContents();
- Iterator<SpecificDiagramUpdater> _filter = Iterators.<SpecificDiagramUpdater>filter(_allContents, SpecificDiagramUpdater.class);
- final Function1<SpecificDiagramUpdater, Boolean> _function = new Function1<SpecificDiagramUpdater, Boolean>() {
- public Boolean apply(final SpecificDiagramUpdater v) {
- boolean _and = false;
- GenCommonBase _genNode = v.getGenNode();
- boolean _equals = Objects.equal(_genNode, it);
- if (!_equals) {
- _and = false;
- } else {
- String _classpath = v.getClasspath();
- boolean _notEquals = (!Objects.equal(_classpath, null));
- _and = _notEquals;
- }
- return Boolean.valueOf(_and);
- }
- };
- Iterator<SpecificDiagramUpdater> _filter_1 = IteratorExtensions.<SpecificDiagramUpdater>filter(_filter, _function);
- int _size = IteratorExtensions.size(_filter_1);
- boolean _notEquals = (_size != 0);
- if (_notEquals) {
- CharSequence _generatedMemberComment = this._common.generatedMemberComment();
- _builder.append(_generatedMemberComment, "");
- _builder.newLineIfNotEmpty();
- {
- Resource _eResource_1 = it.eResource();
- TreeIterator<EObject> _allContents_1 = _eResource_1.getAllContents();
- Iterator<SpecificDiagramUpdater> _filter_2 = Iterators.<SpecificDiagramUpdater>filter(_allContents_1, SpecificDiagramUpdater.class);
- final Function1<SpecificDiagramUpdater, Boolean> _function_1 = new Function1<SpecificDiagramUpdater, Boolean>() {
- public Boolean apply(final SpecificDiagramUpdater v) {
- boolean _and = false;
- GenCommonBase _genNode = v.getGenNode();
- boolean _equals = Objects.equal(_genNode, it);
- if (!_equals) {
- _and = false;
- } else {
- String _classpath = v.getClasspath();
- boolean _notEquals = (!Objects.equal(_classpath, null));
- _and = _notEquals;
- }
- return Boolean.valueOf(_and);
- }
- };
- Iterator<SpecificDiagramUpdater> _filter_3 = IteratorExtensions.<SpecificDiagramUpdater>filter(_filter_2, _function_1);
- Iterable<SpecificDiagramUpdater> _iterable = IteratorExtensions.<SpecificDiagramUpdater>toIterable(_filter_3);
- for(final SpecificDiagramUpdater updater : _iterable) {
- _builder.append("public ");
- CharSequence _listOfNodeDescriptors = this.listOfNodeDescriptors(it);
- _builder.append(_listOfNodeDescriptors, "");
- _builder.append(" ");
- CharSequence _semanticChildrenMethodName = this.getSemanticChildrenMethodName(it);
- _builder.append(_semanticChildrenMethodName, "");
- _builder.append("(org.eclipse.gmf.runtime.notation.View view) {");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- CharSequence _iCustomDiagramUpdater = this.getICustomDiagramUpdater(it);
- _builder.append(_iCustomDiagramUpdater, "\t");
- _builder.append(" customUpdater = new ");
- String _classpath = updater.getClasspath();
- _builder.append(_classpath, "\t");
- _builder.append("();");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.append("return customUpdater.getSemanticChildren(view);");
- _builder.newLine();
- _builder.append("}");
- _builder.newLine();
- }
- }
- } else {
- CharSequence _generatedMemberComment_1 = this._common.generatedMemberComment();
- _builder.append(_generatedMemberComment_1, "");
- _builder.newLineIfNotEmpty();
- _builder.append("public ");
- CharSequence _listOfNodeDescriptors_1 = this.listOfNodeDescriptors(it);
- _builder.append(_listOfNodeDescriptors_1, "");
- _builder.append(" ");
- CharSequence _semanticChildrenMethodName_1 = this.getSemanticChildrenMethodName(it);
- _builder.append(_semanticChildrenMethodName_1, "");
- _builder.append("(org.eclipse.gmf.runtime.notation.View view) {");
- _builder.newLineIfNotEmpty();
- {
- boolean _or = false;
- Set<GenFeature> _semanticChildrenChildFeatures = this._utils_qvto.getSemanticChildrenChildFeatures(it);
- boolean _notEmpty = this._common_qvto.<GenFeature>notEmpty(_semanticChildrenChildFeatures);
- if (_notEmpty) {
- _or = true;
- } else {
- Iterable<GenNode> _phantomNodes = this._utils_qvto.getPhantomNodes(it);
- boolean _notEmpty_1 = this._common_qvto.<GenNode>notEmpty(_phantomNodes);
- _or = _notEmpty_1;
- }
- if (_or) {
- _builder.append("\t");
- CharSequence _defineModelElement = this.defineModelElement(it);
- _builder.append(_defineModelElement, "\t");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- GenDiagramUpdater _diagramUpdater = this.diagramUpdater(it);
- CharSequence _newLinkedListOfNodeDescriptors = this.newLinkedListOfNodeDescriptors(_diagramUpdater, "result");
- _builder.append(_newLinkedListOfNodeDescriptors, "\t");
- _builder.append("();");
- _builder.newLineIfNotEmpty();
- {
- Set<GenFeature> _semanticChildrenChildFeatures_1 = this._utils_qvto.getSemanticChildrenChildFeatures(it);
- for(final GenFeature childMetaFeature : _semanticChildrenChildFeatures_1) {
- {
- boolean _equals = Objects.equal(null, childMetaFeature);
- if (_equals) {
- _builder.append("\t");
- _builder.append("{ \t/*FIXME no containment/child feature found in the genmodel, toolsmith need to specify Class here manually*/ childElement = ");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("\t");
- _builder.append("/*FIXME no containment/child feature found in the genmodel, toolsmith need to specify correct one here manually*/;");
- _builder.newLine();
- } else {
- boolean _isListType = childMetaFeature.isListType();
- if (_isListType) {
- _builder.append("\t");
- _builder.append("for (java.util.Iterator<?> it = ");
- GenClass _modelElementType = this._utils_qvto.getModelElementType(it);
- CharSequence _featureValue = this.xptMetaModel.getFeatureValue(childMetaFeature, "modelElement", _modelElementType);
- _builder.append(_featureValue, "\t");
- _builder.append(".iterator(); it.hasNext();) {");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- GenClass _typeGenClass = childMetaFeature.getTypeGenClass();
- CharSequence _DeclareAndAssign = this.xptMetaModel.DeclareAndAssign(_typeGenClass, "childElement", "it.next()", true);
- _builder.append(_DeclareAndAssign, "\t");
- _builder.newLineIfNotEmpty();
- } else {
- _builder.append("\t");
- _builder.append("{ ");
- GenClass _typeGenClass_1 = childMetaFeature.getTypeGenClass();
- GenClass _modelElementType_1 = this._utils_qvto.getModelElementType(it);
- CharSequence _DeclareAndAssign_1 = this.xptMetaModel.DeclareAndAssign(_typeGenClass_1, "childElement", "modelElement", _modelElementType_1, childMetaFeature);
- _builder.append(_DeclareAndAssign_1, "\t");
- _builder.newLineIfNotEmpty();
- }
- }
- }
- _builder.append("\t");
- _builder.append("int visualID = ");
- GenDiagram _diagram = it.getDiagram();
- CharSequence _nodeVisualIDMethodCall = this.xptVisualIDRegistry.getNodeVisualIDMethodCall(_diagram);
- _builder.append(_nodeVisualIDMethodCall, "\t");
- _builder.append("(view, ");
- GenClass _typeGenClass_2 = childMetaFeature.getTypeGenClass();
- CharSequence _DowncastToEObject = this.xptMetaModel.DowncastToEObject(_typeGenClass_2, "childElement");
- _builder.append(_DowncastToEObject, "\t");
- _builder.append(");");
- _builder.newLineIfNotEmpty();
- {
- Iterable<GenNode> _semanticChildren = this._utils_qvto.getSemanticChildren(it, childMetaFeature);
- for(final GenNode next : _semanticChildren) {
- _builder.append("\t");
- boolean _and = false;
- boolean _notEquals_1 = (!Objects.equal(null, childMetaFeature));
- if (!_notEquals_1) {
- _and = false;
- } else {
- boolean _isListType_1 = childMetaFeature.isListType();
- _and = _isListType_1;
- }
- CharSequence _checkChildElementVisualID = this.checkChildElementVisualID(next, Boolean.valueOf(_and));
- _builder.append(_checkChildElementVisualID, "\t");
- _builder.newLineIfNotEmpty();
- }
- }
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- }
- }
- {
- Iterable<GenNode> _phantomNodes_1 = this._utils_qvto.getPhantomNodes(it);
- boolean _notEmpty_2 = this._common_qvto.<GenNode>notEmpty(_phantomNodes_1);
- if (_notEmpty_2) {
- _builder.append("\t");
- _builder.append("org.eclipse.emf.ecore.resource.Resource resource = modelElement.eResource();");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("for (java.util.Iterator<org.eclipse.emf.ecore.EObject> it = getPhantomNodesIterator(resource); it.hasNext();) {");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("\t");
- _builder.append("org.eclipse.emf.ecore.EObject childElement = it.next();");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("\t");
- _builder.append("if (childElement == modelElement) {");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("\t\t");
- _builder.append("continue;");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- {
- Iterable<GenNode> _phantomNodes_2 = this._utils_qvto.getPhantomNodes(it);
- for(final GenNode phantom : _phantomNodes_2) {
- _builder.append("\t");
- _builder.append("\t");
- CharSequence _addNextIfPhantom = this.addNextIfPhantom(phantom);
- _builder.append(_addNextIfPhantom, "\t\t");
- _builder.newLineIfNotEmpty();
- }
- }
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- }
- }
- _builder.append("\t");
- _builder.append("return result;");
- _builder.newLine();
- } else {
- _builder.append("\t");
- _builder.append("return ");
- CharSequence _newEmptyList = this.newEmptyList();
- _builder.append(_newEmptyList, "\t");
- _builder.append(";");
- _builder.newLineIfNotEmpty();
- }
- }
- _builder.append("}");
- _builder.newLine();
- }
- }
- return _builder;
- }
-
- public CharSequence defineLinkSource(final TypeLinkModelFacet it, final boolean inLoop) {
- StringConcatenation _builder = new StringConcatenation();
- {
- GenFeature _sourceMetaFeature = it.getSourceMetaFeature();
- boolean _isListType = _sourceMetaFeature.isListType();
- if (_isListType) {
- _builder.append("java.util.List<?> sources = ");
- GenFeature _sourceMetaFeature_1 = it.getSourceMetaFeature();
- GenClass _metaClass = it.getMetaClass();
- CharSequence _featureValue = this.xptMetaModel.getFeatureValue(_sourceMetaFeature_1, "link", _metaClass);
- _builder.append(_featureValue, "");
- _builder.append(";");
- _builder.newLineIfNotEmpty();
- _builder.append("Object theSource = sources.size() == 1 ? sources.get(0) : null;");
- _builder.newLine();
- _builder.append("if (");
- GenClass _sourceType = it.getSourceType();
- CharSequence _NotInstance = this.xptMetaModel.NotInstance(_sourceType, "theSource");
- _builder.append(_NotInstance, "");
- _builder.append(") {");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- CharSequence _stopLinkProcessing = this.stopLinkProcessing(inLoop);
- _builder.append(_stopLinkProcessing, "\t");
- _builder.newLineIfNotEmpty();
- _builder.append("}");
- _builder.newLine();
- GenClass _sourceType_1 = it.getSourceType();
- CharSequence _DeclareAndAssign = this.xptMetaModel.DeclareAndAssign(_sourceType_1, "src", "theSource", true);
- _builder.append(_DeclareAndAssign, "");
- _builder.newLineIfNotEmpty();
- } else {
- GenClass _sourceType_2 = it.getSourceType();
- GenClass _metaClass_1 = it.getMetaClass();
- GenFeature _sourceMetaFeature_2 = it.getSourceMetaFeature();
- CharSequence _DeclareAndAssign_1 = this.xptMetaModel.DeclareAndAssign(_sourceType_2, "src", "link", _metaClass_1, _sourceMetaFeature_2);
- _builder.append(_DeclareAndAssign_1, "");
- _builder.newLineIfNotEmpty();
- }
- }
- return _builder;
- }
-
- public CharSequence isDiagram(final GenDiagram it) {
- StringConcatenation _builder = new StringConcatenation();
- return _builder;
- }
-
- public CharSequence defineLinkDestination(final TypeLinkModelFacet it, final Boolean inLoop) {
- StringConcatenation _builder = new StringConcatenation();
- {
- GenFeature _targetMetaFeature = it.getTargetMetaFeature();
- boolean _isListType = _targetMetaFeature.isListType();
- if (_isListType) {
- _builder.append("java.util.List<?> targets = ");
- GenFeature _targetMetaFeature_1 = it.getTargetMetaFeature();
- GenClass _metaClass = it.getMetaClass();
- CharSequence _featureValue = this.xptMetaModel.getFeatureValue(_targetMetaFeature_1, "link", _metaClass);
- _builder.append(_featureValue, "");
- _builder.append(";");
- _builder.newLineIfNotEmpty();
- _builder.append("Object theTarget = targets.size() == 1 ? targets.get(0) : null;");
- _builder.newLine();
- _builder.append("if (");
- GenClass _targetType = it.getTargetType();
- CharSequence _NotInstance = this.xptMetaModel.NotInstance(_targetType, "theTarget");
- _builder.append(_NotInstance, "");
- _builder.append(") {");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- CharSequence _stopLinkProcessing = this.stopLinkProcessing((inLoop).booleanValue());
- _builder.append(_stopLinkProcessing, "\t");
- _builder.newLineIfNotEmpty();
- _builder.append("}");
- _builder.newLine();
- GenClass _targetType_1 = it.getTargetType();
- CharSequence _DeclareAndAssign = this.xptMetaModel.DeclareAndAssign(_targetType_1, "dst", "theTarget", true);
- _builder.append(_DeclareAndAssign, "");
- _builder.newLineIfNotEmpty();
- } else {
- GenClass _targetType_2 = it.getTargetType();
- GenClass _metaClass_1 = it.getMetaClass();
- GenFeature _targetMetaFeature_2 = it.getTargetMetaFeature();
- CharSequence _DeclareAndAssign_1 = this.xptMetaModel.DeclareAndAssign(_targetType_2, "dst", "link", _metaClass_1, _targetMetaFeature_2);
- _builder.append(_DeclareAndAssign_1, "");
- _builder.newLineIfNotEmpty();
- }
- }
- return _builder;
- }
-
- public CharSequence getOutgoingLinksByTypeMethodSignature(final GenLink it) {
- StringConcatenation _builder = new StringConcatenation();
- _builder.append("protected java.util.Collection<");
- GenDiagramUpdater _diagramUpdater = this.diagramUpdater(it);
- CharSequence _qualifiedClassName = this.linkDescriptor.qualifiedClassName(_diagramUpdater);
- _builder.append(_qualifiedClassName, "");
- _builder.append("> ");
- CharSequence _connectedLinksByTypeMethodName = this.getConnectedLinksByTypeMethodName(it, UpdaterLinkType.OUTGOING);
- _builder.append(_connectedLinksByTypeMethodName, "");
- _builder.append("(");
- LinkModelFacet _modelFacet = it.getModelFacet();
- GenClass _sourceType = _modelFacet.getSourceType();
- CharSequence _QualifiedClassName = this.xptMetaModel.QualifiedClassName(_sourceType);
- _builder.append(_QualifiedClassName, "");
- _builder.append(" source)");
- return _builder;
- }
-
- public CharSequence getGenericSemanticChildrenOfView(final GenDiagramUpdater it, final Iterable<GenContainerBase> semanticContainers) {
- StringConcatenation _builder = new StringConcatenation();
- _builder.newLine();
- _builder.append("\t");
- CharSequence _generatedMemberComment = this._common.generatedMemberComment();
- _builder.append(_generatedMemberComment, "\t");
- _builder.newLineIfNotEmpty();
- _builder.append("\t\t");
- _builder.append("public ");
- CharSequence _listOfNodeDescriptors = this.listOfNodeDescriptors(it);
- _builder.append(_listOfNodeDescriptors, "\t\t");
- _builder.append(" getSemanticChildren(org.eclipse.gmf.runtime.notation.View view) {");
- _builder.newLineIfNotEmpty();
- {
- boolean _notEmpty = this._common_qvto.<GenContainerBase>notEmpty(semanticContainers);
- if (_notEmpty) {
- _builder.append("\t");
- _builder.append("switch (");
- GenEditorGenerator _editorGen = it.getEditorGen();
- GenDiagram _diagram = _editorGen.getDiagram();
- CharSequence _visualIDMethodCall = this.xptVisualIDRegistry.getVisualIDMethodCall(_diagram);
- _builder.append(_visualIDMethodCall, "\t");
- _builder.append("(view)) {");
- _builder.newLineIfNotEmpty();
- {
- for(final GenContainerBase next : semanticContainers) {
- _builder.append("\t");
- _builder.append("\t");
- CharSequence _semanticChildrenCase = this.getSemanticChildrenCase(next);
- _builder.append(_semanticChildrenCase, "\t\t");
- _builder.newLineIfNotEmpty();
- }
- }
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- }
- }
- _builder.append("\t");
- _builder.append("return ");
- CharSequence _newEmptyList = this.newEmptyList();
- _builder.append(_newEmptyList, "\t");
- _builder.append(";");
- _builder.newLineIfNotEmpty();
- _builder.append("}");
- _builder.newLine();
- return _builder;
- }
-
- protected CharSequence _getContainedLinksByTypeMethod(final TypeLinkModelFacet it, final GenLink genLink) {
- StringConcatenation _builder = new StringConcatenation();
- _builder.newLine();
- CharSequence _generatedMemberComment = this._common.generatedMemberComment();
- _builder.append(_generatedMemberComment, "");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.append("protected java.util.Collection<");
- GenDiagramUpdater _diagramUpdater = this.diagramUpdater(genLink);
- CharSequence _qualifiedClassName = this.linkDescriptor.qualifiedClassName(_diagramUpdater);
- _builder.append(_qualifiedClassName, "\t");
- _builder.append("> ");
- CharSequence _connectedLinksByTypeMethodName = this.getConnectedLinksByTypeMethodName(genLink, UpdaterLinkType.CONTAINED);
- _builder.append(_connectedLinksByTypeMethodName, "\t");
- _builder.append("(");
- GenFeature _childMetaFeature = it.getChildMetaFeature();
- GenClass _genClass = _childMetaFeature.getGenClass();
- CharSequence _QualifiedClassName = this.xptMetaModel.QualifiedClassName(_genClass);
- _builder.append(_QualifiedClassName, "\t");
- _builder.append(" container) {");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- CharSequence _containedLinksByTypeMethodBody = this.getContainedLinksByTypeMethodBody(it, genLink, false);
- _builder.append(_containedLinksByTypeMethodBody, "\t");
- _builder.newLineIfNotEmpty();
- _builder.append("}");
- _builder.newLine();
- return _builder;
- }
-
- public CharSequence getGenericConnectedLinks(final GenDiagramUpdater it, final Iterable<? extends GenCommonBase> linkContainers, final UpdaterLinkType linkType) {
- StringConcatenation _builder = new StringConcatenation();
- _builder.newLine();
- CharSequence _generatedMemberComment = this._common.generatedMemberComment();
- _builder.append(_generatedMemberComment, "");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.append("public ");
- CharSequence _listOfLinkDescriptors = this.listOfLinkDescriptors(it);
- _builder.append(_listOfLinkDescriptors, "\t");
- _builder.append(" get");
- String _linkMethodSuffix = this._utils_qvto.getLinkMethodSuffix(linkType);
- _builder.append(_linkMethodSuffix, "\t");
- _builder.append("Links(org.eclipse.gmf.runtime.notation.View view) {");
- _builder.newLineIfNotEmpty();
- {
- boolean _notEmpty = this._common_qvto.notEmpty(linkContainers);
- if (_notEmpty) {
- _builder.append("\t");
- _builder.append("switch (");
- GenEditorGenerator _editorGen = it.getEditorGen();
- GenDiagram _diagram = _editorGen.getDiagram();
- CharSequence _visualIDMethodCall = this.xptVisualIDRegistry.getVisualIDMethodCall(_diagram);
- _builder.append(_visualIDMethodCall, "\t");
- _builder.append("(view)) {");
- _builder.newLineIfNotEmpty();
- {
- for(final GenCommonBase next : linkContainers) {
- _builder.append("\t");
- _builder.append("\t");
- CharSequence _containedLinksCase = this.getContainedLinksCase(next, linkType);
- _builder.append(_containedLinksCase, "\t\t");
- _builder.newLineIfNotEmpty();
- }
- }
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- }
- }
- _builder.append("\t");
- _builder.append("return ");
- CharSequence _newEmptyList = this.newEmptyList();
- _builder.append(_newEmptyList, "\t");
- _builder.append(";");
- _builder.newLineIfNotEmpty();
- _builder.append("}");
- _builder.newLine();
- return _builder;
- }
-
- public CharSequence runtimeTypedInstance(final GenDiagramUpdater it) {
- StringConcatenation _builder = new StringConcatenation();
- return _builder;
- }
-
- public CharSequence getContainedLinksByTypeMethod(final LinkModelFacet it, final GenLink genLink) {
- if (it instanceof FeatureLinkModelFacet) {
- return _getContainedLinksByTypeMethod((FeatureLinkModelFacet)it, genLink);
- } else if (it instanceof TypeLinkModelFacet) {
- return _getContainedLinksByTypeMethod((TypeLinkModelFacet)it, genLink);
- } else if (it != null) {
- return _getContainedLinksByTypeMethod(it, genLink);
- } else {
- throw new IllegalArgumentException("Unhandled parameter types: " +
- Arrays.<Object>asList(it, genLink).toString());
- }
- }
-}
diff --git a/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/diagram/updater/Extensions.java b/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/diagram/updater/Extensions.java
deleted file mode 100644
index f6bd9af1b6a..00000000000
--- a/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/diagram/updater/Extensions.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/**
- * Copyright (c) 2007, 2009 Borland Software Corporation
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Alexander Shatalin (Borland) - initial API and implementation
- * Gabriel Pascual (ALL4TEC) - Bug 372322
- */
-package aspects.xpt.diagram.updater;
-
-import com.google.inject.Singleton;
-import org.eclipse.gmf.codegen.gmfgen.GenDiagramUpdater;
-import xpt.diagram.updater.extensions;
-
-@Singleton
-@SuppressWarnings("all")
-public class Extensions extends extensions {
- public CharSequence extensions(final GenDiagramUpdater it) {
- return null;
- }
-}
diff --git a/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/diagram/views/.gitignore b/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/diagram/views/.gitignore
deleted file mode 100644
index 9938cca4f24..00000000000
--- a/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/diagram/views/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-/ViewStyles.java
diff --git a/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/diagram/views/ViewStyles.java b/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/diagram/views/ViewStyles.java
deleted file mode 100644
index f596a952957..00000000000
--- a/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/diagram/views/ViewStyles.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/**
- * Copyright (c) 2007, 2009 Borland Software Corporation
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Dmitry Stadnik (Borland) - initial API and implementation
- * Artem Tikhomirov (Borland) - [257119] Create views directly, not through ViewFactories
- * Michael Golubev (Montages) - #386838 - migrate to Xtend2
- */
-package aspects.xpt.diagram.views;
-
-import com.google.inject.Inject;
-import com.google.inject.Singleton;
-import java.util.Arrays;
-import org.eclipse.gmf.codegen.gmfgen.GenExternalNodeLabel;
-import org.eclipse.gmf.codegen.gmfgen.GenLabel;
-import org.eclipse.gmf.codegen.gmfgen.GenLinkLabel;
-import org.eclipse.gmf.codegen.gmfgen.Viewmap;
-import org.eclipse.xtend2.lib.StringConcatenation;
-import org.eclipse.xtext.xbase.lib.Extension;
-import xpt.diagram.ViewmapAttributesUtils_qvto;
-
-/**
- * Renamed from xpt::diagram::views::Utils.xpt
- * in order to have consistent naming between Xtend files migrated from _qvto helpers and xpt templates
- */
-@Singleton
-@SuppressWarnings("all")
-public class ViewStyles extends xpt.diagram.views.ViewStyles {
- @Inject
- @Extension
- private ViewmapAttributesUtils_qvto _viewmapAttributesUtils_qvto;
-
- protected CharSequence _offset(final GenExternalNodeLabel it, final String viewVar) {
- StringConcatenation _builder = new StringConcatenation();
- {
- boolean _or = false;
- Viewmap _viewmap = it.getViewmap();
- int _labelOffsetX = this._viewmapAttributesUtils_qvto.labelOffsetX(_viewmap, 0);
- boolean _notEquals = (_labelOffsetX != 0);
- if (_notEquals) {
- _or = true;
- } else {
- Viewmap _viewmap_1 = it.getViewmap();
- int _labelOffsetY = this._viewmapAttributesUtils_qvto.labelOffsetY(_viewmap_1, 0);
- boolean _notEquals_1 = (_labelOffsetY != 0);
- _or = _notEquals_1;
- }
- if (_or) {
- Viewmap _viewmap_2 = it.getViewmap();
- int _labelOffsetX_1 = this._viewmapAttributesUtils_qvto.labelOffsetX(_viewmap_2, 0);
- Viewmap _viewmap_3 = it.getViewmap();
- int _labelOffsetY_1 = this._viewmapAttributesUtils_qvto.labelOffsetY(_viewmap_3, 0);
- CharSequence _offset = this.offset(it, viewVar, _labelOffsetX_1, _labelOffsetY_1);
- _builder.append(_offset, "");
- _builder.newLineIfNotEmpty();
- } else {
- CharSequence _offset_1 = this.offset(it, viewVar, 0, 5);
- _builder.append(_offset_1, "");
- _builder.newLineIfNotEmpty();
- }
- }
- return _builder;
- }
-
- public CharSequence offset(final GenLabel it, final String viewVar) {
- if (it instanceof GenExternalNodeLabel) {
- return _offset((GenExternalNodeLabel)it, viewVar);
- } else if (it instanceof GenLinkLabel) {
- return _offset((GenLinkLabel)it, viewVar);
- } else if (it != null) {
- return _offset(it, viewVar);
- } else {
- throw new IllegalArgumentException("Unhandled parameter types: " +
- Arrays.<Object>asList(it, viewVar).toString());
- }
- }
-}
diff --git a/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/editor/.gitignore b/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/editor/.gitignore
deleted file mode 100644
index fc8ff2b36f8..00000000000
--- a/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/editor/.gitignore
+++ /dev/null
@@ -1,14 +0,0 @@
-/InitDiagramFileAction.java
-/CreationWizard.java
-/DiagramEditorUtil.java
-/ResourceSetInfo.java
-/ActionBarContributor.java
-/DeleteElementAction.java
-/DiagramEditorContextMenuProvider.java
-/DocumentProvider.java
-/Editor.java
-/NewDiagramFileWizard.java
-/ResourceSetModificationListener.java
-/ValidateAction.java
-/VisualIDRegistry.java
-/extensions.java
diff --git a/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/editor/ActionBarContributor.java b/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/editor/ActionBarContributor.java
deleted file mode 100644
index 67ac810011e..00000000000
--- a/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/editor/ActionBarContributor.java
+++ /dev/null
@@ -1,108 +0,0 @@
-/**
- * Copyright (c) 2007, 2009, 2013 Borland Software Corporation and others
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Dmitry Stadnik (Borland) - initial API and implementation
- * Michael Golubev (Montages) - #386838 - migrate to Xtend2
- */
-package aspects.xpt.editor;
-
-import aspects.xpt.editor.Editor;
-import com.google.inject.Inject;
-import com.google.inject.Singleton;
-import org.eclipse.gmf.codegen.gmfgen.GenEditorGenerator;
-import org.eclipse.gmf.codegen.gmfgen.GenEditorView;
-import org.eclipse.xtend2.lib.StringConcatenation;
-import org.eclipse.xtext.xbase.lib.Extension;
-import xpt.Common;
-
-@Singleton
-@SuppressWarnings("all")
-public class ActionBarContributor extends xpt.editor.ActionBarContributor {
- @Inject
- @Extension
- private Common _common;
-
- @Inject
- private Editor xptEditor;
-
- public CharSequence ActionBarContributor(final GenEditorView it) {
- StringConcatenation _builder = new StringConcatenation();
- GenEditorGenerator _editorGen = it.getEditorGen();
- CharSequence _copyright = this._common.copyright(_editorGen);
- _builder.append(_copyright, "");
- _builder.newLineIfNotEmpty();
- _builder.append("package ");
- CharSequence _packageName = this.packageName(it);
- _builder.append(_packageName, "");
- _builder.append(";");
- _builder.newLineIfNotEmpty();
- _builder.newLine();
- CharSequence _generatedClassComment = this._common.generatedClassComment();
- _builder.append(_generatedClassComment, "");
- _builder.newLineIfNotEmpty();
- _builder.append("public class ");
- CharSequence _className = this.className(it);
- _builder.append(_className, "");
- _builder.append(" ");
- CharSequence _extendsList = this.extendsList(it);
- _builder.append(_extendsList, "");
- _builder.append(" {");
- _builder.newLineIfNotEmpty();
- _builder.newLine();
- _builder.append("\t");
- CharSequence _generatedMemberComment = this._common.generatedMemberComment();
- _builder.append(_generatedMemberComment, "\t");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("protected Class<");
- CharSequence _qualifiedClassName = this.xptEditor.qualifiedClassName(it);
- _builder.append(_qualifiedClassName, "\t");
- _builder.append("> getEditorClass() {");
- _builder.newLineIfNotEmpty();
- _builder.append("\t\t");
- _builder.append("return ");
- CharSequence _qualifiedClassName_1 = this.xptEditor.qualifiedClassName(it);
- _builder.append(_qualifiedClassName_1, "\t\t");
- _builder.append(".class;");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- _builder.newLine();
- _builder.append("\t");
- CharSequence _generatedMemberComment_1 = this._common.generatedMemberComment();
- _builder.append(_generatedMemberComment_1, "\t");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.append("protected String getEditorId() {");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("return ");
- CharSequence _qualifiedClassName_2 = this.xptEditor.qualifiedClassName(it);
- _builder.append(_qualifiedClassName_2, "\t\t");
- _builder.append(".ID;");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t");
- CharSequence _initMethod = this.initMethod(it);
- _builder.append(_initMethod, "\t");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- CharSequence _additions = this.additions(it);
- _builder.append(_additions, "\t");
- _builder.newLineIfNotEmpty();
- _builder.append("}");
- _builder.newLine();
- return _builder;
- }
-}
diff --git a/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/editor/CreationWizard.java b/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/editor/CreationWizard.java
deleted file mode 100644
index 10ac89c8643..00000000000
--- a/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/editor/CreationWizard.java
+++ /dev/null
@@ -1,595 +0,0 @@
-package aspects.xpt.editor;
-
-import com.google.common.base.Objects;
-import com.google.inject.Inject;
-import com.google.inject.Singleton;
-import org.eclipse.emf.codegen.ecore.genmodel.GenClass;
-import org.eclipse.emf.codegen.ecore.genmodel.GenPackage;
-import org.eclipse.gmf.codegen.gmfgen.GenApplication;
-import org.eclipse.gmf.codegen.gmfgen.GenDiagram;
-import org.eclipse.gmf.codegen.gmfgen.GenEditorGenerator;
-import org.eclipse.gmf.codegen.gmfgen.GenPlugin;
-import org.eclipse.xtend2.lib.StringConcatenation;
-import org.eclipse.xtext.xbase.lib.Extension;
-import plugin.Activator;
-import xpt.CodeStyle;
-import xpt.Common;
-import xpt.Externalizer;
-import xpt.ExternalizerUtils_qvto;
-import xpt.editor.CreationWizardPage;
-import xpt.editor.DiagramEditorUtil;
-import xpt.editor.GenDiagram_qvto;
-
-@Singleton
-@SuppressWarnings("all")
-public class CreationWizard extends xpt.editor.CreationWizard {
- @Inject
- @Extension
- private Common _common;
-
- @Inject
- @Extension
- private CodeStyle _codeStyle;
-
- @Inject
- @Extension
- private ExternalizerUtils_qvto _externalizerUtils_qvto;
-
- @Inject
- @Extension
- private GenDiagram_qvto _genDiagram_qvto;
-
- @Inject
- private Activator xptActivator;
-
- @Inject
- private CreationWizardPage xptCreationWizardPage;
-
- @Inject
- private DiagramEditorUtil xptDiagramEditorUtil;
-
- @Inject
- private Externalizer xptExternalizer;
-
- public CharSequence CreationWizard(final GenDiagram it) {
- StringConcatenation _builder = new StringConcatenation();
- GenEditorGenerator _editorGen = it.getEditorGen();
- CharSequence _copyright = this._common.copyright(_editorGen);
- _builder.append(_copyright, "");
- _builder.newLineIfNotEmpty();
- _builder.append("package ");
- CharSequence _packageName = this.packageName(it);
- _builder.append(_packageName, "");
- _builder.append(";");
- _builder.newLineIfNotEmpty();
- _builder.newLine();
- CharSequence _generatedClassComment = this._common.generatedClassComment();
- _builder.append(_generatedClassComment, "");
- _builder.newLineIfNotEmpty();
- _builder.append("public class ");
- CharSequence _className = this.className(it);
- _builder.append(_className, "");
- _builder.newLineIfNotEmpty();
- _builder.append("\t\t");
- CharSequence _extendsList = this.extendsList(it);
- _builder.append(_extendsList, "\t\t");
- _builder.append(" ");
- CharSequence _implementsList = this.implementsList(it);
- _builder.append(_implementsList, "\t\t");
- _builder.append(" {");
- _builder.newLineIfNotEmpty();
- _builder.newLine();
- _builder.append("\t");
- CharSequence _generatedMemberComment = this._common.generatedMemberComment();
- _builder.append(_generatedMemberComment, "\t");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.append("private org.eclipse.ui.IWorkbench workbench;");
- _builder.newLine();
- _builder.append("\t");
- _builder.newLine();
- _builder.append("\t");
- CharSequence _generatedMemberComment_1 = this._common.generatedMemberComment();
- _builder.append(_generatedMemberComment_1, "\t");
- _builder.newLineIfNotEmpty();
- _builder.append("\t ");
- _builder.append("protected org.eclipse.jface.viewers.IStructuredSelection selection;");
- _builder.newLine();
- _builder.append("\t ");
- _builder.newLine();
- _builder.append("\t");
- CharSequence _generatedMemberComment_2 = this._common.generatedMemberComment();
- _builder.append(_generatedMemberComment_2, "\t");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.append("protected ");
- CharSequence _qualifiedClassName = this.xptCreationWizardPage.qualifiedClassName(it);
- _builder.append(_qualifiedClassName, "\t");
- _builder.append(" diagramModelFilePage;");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.newLine();
- {
- boolean _standaloneDomainModel = this._genDiagram_qvto.standaloneDomainModel(it);
- if (_standaloneDomainModel) {
- _builder.append("\t");
- CharSequence _generatedMemberComment_3 = this._common.generatedMemberComment();
- _builder.append(_generatedMemberComment_3, "\t");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.append("protected ");
- CharSequence _qualifiedClassName_1 = this.xptCreationWizardPage.qualifiedClassName(it);
- _builder.append(_qualifiedClassName_1, "\t");
- _builder.append(" domainModelFilePage;");
- _builder.newLineIfNotEmpty();
- }
- }
- _builder.append("\t");
- _builder.newLine();
- _builder.append("\t");
- CharSequence _generatedMemberComment_4 = this._common.generatedMemberComment();
- _builder.append(_generatedMemberComment_4, "\t");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.append("protected org.eclipse.emf.ecore.resource.Resource diagram;");
- _builder.newLine();
- _builder.append("\t");
- _builder.newLine();
- _builder.append("\t");
- CharSequence _generatedMemberComment_5 = this._common.generatedMemberComment();
- _builder.append(_generatedMemberComment_5, "\t");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.append("private boolean openNewlyCreatedDiagramEditor = true;");
- _builder.newLine();
- _builder.append("\t");
- _builder.newLine();
- _builder.append("\t");
- CharSequence _generatedMemberComment_6 = this._common.generatedMemberComment();
- _builder.append(_generatedMemberComment_6, "\t");
- _builder.newLineIfNotEmpty();
- _builder.append("\t ");
- _builder.append("public org.eclipse.ui.IWorkbench getWorkbench() {");
- _builder.newLine();
- _builder.append("\t ");
- _builder.append("return workbench;");
- _builder.newLine();
- _builder.append("\t ");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t ");
- _builder.newLine();
- _builder.append("\t");
- CharSequence _generatedMemberComment_7 = this._common.generatedMemberComment();
- _builder.append(_generatedMemberComment_7, "\t");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.append("public org.eclipse.jface.viewers.IStructuredSelection getSelection() {");
- _builder.newLine();
- _builder.append("\t ");
- _builder.append("return selection;");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t");
- _builder.newLine();
- _builder.append("\t");
- CharSequence _generatedMemberComment_8 = this._common.generatedMemberComment();
- _builder.append(_generatedMemberComment_8, "\t");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.append("public final org.eclipse.emf.ecore.resource.Resource getDiagram() {");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("return diagram;");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t");
- _builder.newLine();
- _builder.append("\t");
- CharSequence _generatedMemberComment_9 = this._common.generatedMemberComment();
- _builder.append(_generatedMemberComment_9, "\t");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.append("public final boolean isOpenNewlyCreatedDiagramEditor() {");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("return openNewlyCreatedDiagramEditor;");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t");
- _builder.newLine();
- _builder.append("\t");
- CharSequence _generatedMemberComment_10 = this._common.generatedMemberComment();
- _builder.append(_generatedMemberComment_10, "\t");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.append("public void setOpenNewlyCreatedDiagramEditor(boolean openNewlyCreatedDiagramEditor) {");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("this.openNewlyCreatedDiagramEditor = openNewlyCreatedDiagramEditor;");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t");
- _builder.newLine();
- _builder.append("\t");
- CharSequence _generatedMemberComment_11 = this._common.generatedMemberComment();
- _builder.append(_generatedMemberComment_11, "\t");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.append("public void init(org.eclipse.ui.IWorkbench workbench, org.eclipse.jface.viewers.IStructuredSelection selection) {");
- _builder.newLine();
- _builder.append("\t ");
- _builder.append("this.workbench = workbench;");
- _builder.newLine();
- _builder.append("\t ");
- _builder.append("this.selection = selection;");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("setWindowTitle(");
- GenEditorGenerator _editorGen_1 = it.getEditorGen();
- String _i18nKeyForCreationWizard = this.i18nKeyForCreationWizard(it);
- String _titleKey = this._externalizerUtils_qvto.titleKey(_i18nKeyForCreationWizard);
- CharSequence _accessorCall = this.xptExternalizer.accessorCall(_editorGen_1, _titleKey);
- _builder.append(_accessorCall, "\t");
- _builder.append(");");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.append("setDefaultPageImageDescriptor(");
- GenEditorGenerator _editorGen_2 = it.getEditorGen();
- GenPlugin _plugin = _editorGen_2.getPlugin();
- CharSequence _qualifiedClassName_2 = this.xptActivator.qualifiedClassName(_plugin);
- _builder.append(_qualifiedClassName_2, "\t");
- _builder.append(".getBundledImageDescriptor(");
- _builder.newLineIfNotEmpty();
- _builder.append("\t\t\t");
- _builder.append("\"icons/wizban/New");
- {
- GenClass _domainDiagramElement = it.getDomainDiagramElement();
- boolean _notEquals = (!Objects.equal(_domainDiagramElement, null));
- if (_notEquals) {
- GenClass _domainDiagramElement_1 = it.getDomainDiagramElement();
- GenPackage _genPackage = _domainDiagramElement_1.getGenPackage();
- String _prefix = _genPackage.getPrefix();
- _builder.append(_prefix, "\t\t\t");
- }
- }
- _builder.append("Wizard.gif\")); //$NON-NLS-1$");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.append("setNeedsProgressMonitor(true);");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t");
- _builder.newLine();
- _builder.append("\t");
- CharSequence _generatedMemberComment_12 = this._common.generatedMemberComment();
- _builder.append(_generatedMemberComment_12, "\t");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.append("public void addPages() {");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("diagramModelFilePage = new ");
- CharSequence _qualifiedClassName_3 = this.xptCreationWizardPage.qualifiedClassName(it);
- _builder.append(_qualifiedClassName_3, "\t\t");
- _builder.append("(");
- _builder.newLineIfNotEmpty();
- _builder.append("\t\t\t\t");
- _builder.append("\"DiagramModelFile\", getSelection(), \"");
- GenEditorGenerator _editorGen_3 = it.getEditorGen();
- String _diagramFileExtension = _editorGen_3.getDiagramFileExtension();
- _builder.append(_diagramFileExtension, "\t\t\t\t");
- _builder.append("\"); //$NON-NLS-1$ //$NON-NLS-2$");
- _builder.newLineIfNotEmpty();
- _builder.append("\t\t");
- _builder.append("diagramModelFilePage.setTitle(");
- GenEditorGenerator _editorGen_4 = it.getEditorGen();
- String _i18nKeyForCreationWizardDiagramPage = this.i18nKeyForCreationWizardDiagramPage(it);
- String _titleKey_1 = this._externalizerUtils_qvto.titleKey(_i18nKeyForCreationWizardDiagramPage);
- CharSequence _accessorCall_1 = this.xptExternalizer.accessorCall(_editorGen_4, _titleKey_1);
- _builder.append(_accessorCall_1, "\t\t");
- _builder.append(");");
- _builder.newLineIfNotEmpty();
- _builder.append("\t\t");
- _builder.append("diagramModelFilePage.setDescription(");
- GenEditorGenerator _editorGen_5 = it.getEditorGen();
- String _i18nKeyForCreationWizardDiagramPage_1 = this.i18nKeyForCreationWizardDiagramPage(it);
- String _descriptionKey = this._externalizerUtils_qvto.descriptionKey(_i18nKeyForCreationWizardDiagramPage_1);
- CharSequence _accessorCall_2 = this.xptExternalizer.accessorCall(_editorGen_5, _descriptionKey);
- _builder.append(_accessorCall_2, "\t\t");
- _builder.append(");");
- _builder.newLineIfNotEmpty();
- _builder.append("\t\t");
- _builder.append("addPage(diagramModelFilePage);");
- _builder.newLine();
- {
- boolean _standaloneDomainModel_1 = this._genDiagram_qvto.standaloneDomainModel(it);
- if (_standaloneDomainModel_1) {
- _builder.append("\t");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("\t");
- _builder.append("domainModelFilePage = new ");
- CharSequence _qualifiedClassName_4 = this.xptCreationWizardPage.qualifiedClassName(it);
- _builder.append(_qualifiedClassName_4, "\t\t");
- _builder.append("(");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.append("\t\t\t");
- _builder.append("\"DomainModelFile\", getSelection(), \"");
- GenEditorGenerator _editorGen_6 = it.getEditorGen();
- String _domainFileExtension = _editorGen_6.getDomainFileExtension();
- _builder.append(_domainFileExtension, "\t\t\t\t");
- _builder.append("\") { //$NON-NLS-1$ //$NON-NLS-2$");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.append("\t\t\t");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("\t");
- CharSequence _overrideC = this._codeStyle.overrideC(it);
- _builder.append(_overrideC, "\t\t");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.append("\t");
- _builder.append("public void setVisible(boolean visible) {");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("\t\t");
- _builder.append("if (visible) {");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("\t\t\t");
- _builder.append("String fileName = diagramModelFilePage.getFileName();");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("\t\t\t");
- _builder.append("fileName = fileName.substring(0, fileName.length() - \".");
- GenEditorGenerator _editorGen_7 = it.getEditorGen();
- String _diagramFileExtension_1 = _editorGen_7.getDiagramFileExtension();
- _builder.append(_diagramFileExtension_1, "\t\t\t\t");
- _builder.append("\".length()); //$NON-NLS-1$");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.append("\t\t\t");
- _builder.append("setFileName(");
- CharSequence _qualifiedClassName_5 = this.xptDiagramEditorUtil.qualifiedClassName(it);
- _builder.append(_qualifiedClassName_5, "\t\t\t\t");
- _builder.append(".getUniqueFileName(");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.append("\t\t\t\t\t");
- _builder.append("getContainerFullPath(), fileName, \"");
- GenEditorGenerator _editorGen_8 = it.getEditorGen();
- String _domainFileExtension_1 = _editorGen_8.getDomainFileExtension();
- _builder.append(_domainFileExtension_1, "\t\t\t\t\t\t");
- _builder.append("\")); //$NON-NLS-1$");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.append("\t\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("\t\t");
- _builder.append("super.setVisible(visible);");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("\t");
- _builder.append("};");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("\t");
- _builder.append("domainModelFilePage.setTitle(");
- GenEditorGenerator _editorGen_9 = it.getEditorGen();
- String _i18nKeyForCreationWizardDomainPage = this.i18nKeyForCreationWizardDomainPage(it);
- String _titleKey_2 = this._externalizerUtils_qvto.titleKey(_i18nKeyForCreationWizardDomainPage);
- CharSequence _accessorCall_3 = this.xptExternalizer.accessorCall(_editorGen_9, _titleKey_2);
- _builder.append(_accessorCall_3, "\t\t");
- _builder.append(");");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.append("\t");
- _builder.append("domainModelFilePage.setDescription(");
- GenEditorGenerator _editorGen_10 = it.getEditorGen();
- String _i18nKeyForCreationWizardDomainPage_1 = this.i18nKeyForCreationWizardDomainPage(it);
- String _descriptionKey_1 = this._externalizerUtils_qvto.descriptionKey(_i18nKeyForCreationWizardDomainPage_1);
- CharSequence _accessorCall_4 = this.xptExternalizer.accessorCall(_editorGen_10, _descriptionKey_1);
- _builder.append(_accessorCall_4, "\t\t");
- _builder.append(");");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.append("\t");
- _builder.append("addPage(domainModelFilePage);");
- _builder.newLine();
- }
- }
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- _builder.newLine();
- _builder.append("\t");
- CharSequence _generatedMemberComment_13 = this._common.generatedMemberComment();
- _builder.append(_generatedMemberComment_13, "\t");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.append("public boolean performFinish() {");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("org.eclipse.jface.operation.IRunnableWithProgress op =");
- _builder.newLine();
- {
- GenEditorGenerator _editorGen_11 = it.getEditorGen();
- GenApplication _application = _editorGen_11.getApplication();
- boolean _equals = Objects.equal(_application, null);
- if (_equals) {
- _builder.append("\t");
- _builder.append("new org.eclipse.ui.actions.WorkspaceModifyOperation(null) {");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("\t");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("\t");
- CharSequence _overrideC_1 = this._codeStyle.overrideC(it);
- _builder.append(_overrideC_1, "\t\t");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.append("\t");
- _builder.append("protected void execute(org.eclipse.core.runtime.IProgressMonitor monitor)");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("\t\t");
- _builder.append("throws org.eclipse.core.runtime.CoreException, InterruptedException {");
- _builder.newLine();
- } else {
- _builder.append("\t");
- _builder.append("new org.eclipse.jface.operation.IRunnableWithProgress() {");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("\t");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("\t");
- _builder.append("public void run(org.eclipse.core.runtime.IProgressMonitor monitor)");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("\t\t");
- _builder.append("throws InvocationTargetException, InterruptedException {");
- _builder.newLine();
- }
- }
- _builder.append("\t");
- _builder.append("diagram = ");
- CharSequence _qualifiedClassName_6 = this.xptDiagramEditorUtil.qualifiedClassName(it);
- _builder.append(_qualifiedClassName_6, "\t");
- _builder.append(".createDiagram(diagramModelFilePage.getURI(),");
- _builder.newLineIfNotEmpty();
- {
- boolean _standaloneDomainModel_2 = this._genDiagram_qvto.standaloneDomainModel(it);
- if (_standaloneDomainModel_2) {
- _builder.append("\t");
- _builder.append("domainModelFilePage.getURI(),");
- _builder.newLine();
- }
- }
- _builder.append("\t");
- _builder.append("monitor);");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("if (isOpenNewlyCreatedDiagramEditor() && diagram != null) {");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("try {");
- _builder.newLine();
- _builder.append("\t\t\t");
- CharSequence _qualifiedClassName_7 = this.xptDiagramEditorUtil.qualifiedClassName(it);
- _builder.append(_qualifiedClassName_7, "\t\t\t");
- _builder.append(".openDiagram(diagram);");
- _builder.newLineIfNotEmpty();
- _builder.append("\t\t");
- _builder.append("} catch (org.eclipse.ui.PartInitException e) {");
- _builder.newLine();
- _builder.append("\t\t\t");
- _builder.append("org.eclipse.jface.dialogs.ErrorDialog.openError(getContainer().getShell(),");
- _builder.newLine();
- _builder.append("\t\t\t\t\t");
- GenEditorGenerator _editorGen_12 = it.getEditorGen();
- String _i18nKeyForCreationWizardOpenEditorError = this.i18nKeyForCreationWizardOpenEditorError(it);
- CharSequence _accessorCall_5 = this.xptExternalizer.accessorCall(_editorGen_12, _i18nKeyForCreationWizardOpenEditorError);
- _builder.append(_accessorCall_5, "\t\t\t\t\t");
- _builder.append(", null, e.getStatus());");
- _builder.newLineIfNotEmpty();
- _builder.append("\t\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("};");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("try {");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("getContainer().run(false, true, op);");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("} catch (InterruptedException e) {");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("return false;");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("} catch (java.lang.reflect.InvocationTargetException e) {");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("if (e.getTargetException() instanceof org.eclipse.core.runtime.CoreException) {");
- _builder.newLine();
- _builder.append("\t\t\t");
- _builder.append("org.eclipse.jface.dialogs.ErrorDialog.openError(getContainer().getShell(),");
- _builder.newLine();
- _builder.append("\t\t\t\t\t");
- GenEditorGenerator _editorGen_13 = it.getEditorGen();
- String _i18nKeyForCreationWizardCreationError = this.i18nKeyForCreationWizardCreationError(it);
- CharSequence _accessorCall_6 = this.xptExternalizer.accessorCall(_editorGen_13, _i18nKeyForCreationWizardCreationError);
- _builder.append(_accessorCall_6, "\t\t\t\t\t");
- _builder.append(", null,");
- _builder.newLineIfNotEmpty();
- _builder.append("\t\t\t\t\t");
- _builder.append("((org.eclipse.core.runtime.CoreException) e.getTargetException()).getStatus());");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("} else {");
- _builder.newLine();
- _builder.append("\t\t\t");
- GenEditorGenerator _editorGen_14 = it.getEditorGen();
- GenPlugin _plugin_1 = _editorGen_14.getPlugin();
- CharSequence _qualifiedClassName_8 = this.xptActivator.qualifiedClassName(_plugin_1);
- _builder.append(_qualifiedClassName_8, "\t\t\t");
- _builder.append(".getInstance().logError(");
- _builder.newLineIfNotEmpty();
- _builder.append("\t\t\t\t\t");
- _builder.append("\"Error creating diagram\", e.getTargetException()); //$NON-NLS-1$");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("return false;");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("return diagram != null;");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t");
- CharSequence _additions = this.additions(it);
- _builder.append(_additions, "\t");
- _builder.newLineIfNotEmpty();
- _builder.append("}");
- _builder.newLine();
- return _builder;
- }
-}
diff --git a/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/editor/DeleteElementAction.java b/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/editor/DeleteElementAction.java
deleted file mode 100644
index 980f5fc13df..00000000000
--- a/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/editor/DeleteElementAction.java
+++ /dev/null
@@ -1,21 +0,0 @@
-/**
- * Copyright (c) 2008, 2009, 2013 Borland Software Corporation and others
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Dmitry Stadnik (Borland) - initial API and implementation
- * Michael Golubev (Montages) - #386838 - migrate to Xtend2, use GMFT runtime
- * Vincent Lorenzo (CEA LIST)
- */
-package aspects.xpt.editor;
-
-import com.google.inject.Singleton;
-
-@Singleton
-@SuppressWarnings("all")
-public class DeleteElementAction extends xpt.editor.DeleteElementAction {
-}
diff --git a/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/editor/DiagramEditorContextMenuProvider.java b/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/editor/DiagramEditorContextMenuProvider.java
deleted file mode 100644
index 807235bfe1b..00000000000
--- a/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/editor/DiagramEditorContextMenuProvider.java
+++ /dev/null
@@ -1,159 +0,0 @@
-/**
- * Copyright (c) 2008, 2009, 2013 Borland Software Corporation and others
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Dmitry Stadnik (Borland) - initial API and implementation
- * Michael Golubev (Montages) - #386838 - migrate to Xtend2
- * Vincent Lorenzo (CEA LIST)
- */
-package aspects.xpt.editor;
-
-import com.google.inject.Inject;
-import com.google.inject.Singleton;
-import org.eclipse.gmf.codegen.gmfgen.GenDiagram;
-import org.eclipse.gmf.codegen.gmfgen.GenEditorGenerator;
-import org.eclipse.gmf.codegen.gmfgen.GenPlugin;
-import org.eclipse.xtend2.lib.StringConcatenation;
-import org.eclipse.xtext.xbase.lib.Extension;
-import plugin.Activator;
-import xpt.CodeStyle;
-import xpt.Common;
-
-@Singleton
-@SuppressWarnings("all")
-public class DiagramEditorContextMenuProvider extends xpt.editor.DiagramEditorContextMenuProvider {
- @Inject
- @Extension
- private Common _common;
-
- @Inject
- @Extension
- private CodeStyle _codeStyle;
-
- @Inject
- private Activator xptActivator;
-
- public CharSequence DiagramEditorContextMenuProvider(final GenDiagram it) {
- StringConcatenation _builder = new StringConcatenation();
- GenEditorGenerator _editorGen = it.getEditorGen();
- CharSequence _copyright = this._common.copyright(_editorGen);
- _builder.append(_copyright, "");
- _builder.newLineIfNotEmpty();
- _builder.append("package ");
- CharSequence _packageName = this.packageName(it);
- _builder.append(_packageName, "");
- _builder.append(";");
- _builder.newLineIfNotEmpty();
- _builder.newLine();
- CharSequence _generatedClassComment = this._common.generatedClassComment();
- _builder.append(_generatedClassComment, "");
- _builder.newLineIfNotEmpty();
- _builder.append("public class ");
- CharSequence _className = this.className(it);
- _builder.append(_className, "");
- _builder.append(" extends org.eclipse.gmf.runtime.diagram.ui.providers.DiagramContextMenuProvider {");
- _builder.newLineIfNotEmpty();
- _builder.newLine();
- _builder.append("\t");
- CharSequence _generatedMemberComment = this._common.generatedMemberComment();
- _builder.append(_generatedMemberComment, "\t");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.append("private org.eclipse.ui.IWorkbenchPart part;");
- _builder.newLine();
- _builder.newLine();
- _builder.append("\t\t\t\t");
- _builder.newLine();
- _builder.append("\t");
- CharSequence _generatedMemberComment_1 = this._common.generatedMemberComment();
- _builder.append(_generatedMemberComment_1, "\t");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.append("public DiagramEditorContextMenuProvider(org.eclipse.ui.IWorkbenchPart part, org.eclipse.gef.EditPartViewer viewer) {");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("super(part, viewer);");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("this.part = part;");
- _builder.newLine();
- _builder.append("\t\t\t\t\t\t\t\t\t");
- _builder.append("}");
- _builder.newLine();
- _builder.newLine();
- _builder.append("\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t");
- _builder.newLine();
- _builder.append("\t");
- CharSequence _generatedMemberComment_2 = this._common.generatedMemberComment();
- _builder.append(_generatedMemberComment_2, "\t");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.append("public void buildContextMenu(final org.eclipse.jface.action.IMenuManager menu) {");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("getViewer().flush();");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("try {");
- _builder.newLine();
- _builder.append("\t\t\t");
- _builder.append("org.eclipse.emf.transaction.util.TransactionUtil.getEditingDomain(");
- _builder.newLine();
- _builder.append("\t\t\t\t\t");
- _builder.append("(org.eclipse.emf.ecore.EObject) getViewer().getContents().getModel()).runExclusive(new Runnable() {");
- _builder.newLine();
- _builder.newLine();
- _builder.append("\t\t\t\t");
- GenEditorGenerator _editorGen_1 = it.getEditorGen();
- GenDiagram _diagram = _editorGen_1.getDiagram();
- CharSequence _overrideI = this._codeStyle.overrideI(_diagram);
- _builder.append(_overrideI, "\t\t\t\t");
- _builder.newLineIfNotEmpty();
- _builder.append("\t\t\t\t");
- _builder.append("public void run() {");
- _builder.newLine();
- _builder.append("\t\t\t\t\t");
- _builder.append("org.eclipse.gmf.runtime.common.ui.services.action.contributionitem.ContributionItemService.getInstance().contributeToPopupMenu(");
- _builder.newLine();
- _builder.append("\t\t\t\t\t\t\t");
- _builder.append("DiagramEditorContextMenuProvider.this, part);");
- _builder.newLine();
- _builder.append("\t\t\t\t\t");
- _builder.append("menu.remove(org.eclipse.gmf.runtime.diagram.ui.actions.ActionIds.ACTION_DELETE_FROM_MODEL);");
- _builder.newLine();
- _builder.append("\t\t\t\t\t\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t\t\t");
- _builder.append("});");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("} catch (Exception e) {");
- _builder.newLine();
- _builder.append("\t");
- GenEditorGenerator _editorGen_2 = it.getEditorGen();
- GenPlugin _plugin = _editorGen_2.getPlugin();
- CharSequence _qualifiedClassName = this.xptActivator.qualifiedClassName(_plugin);
- _builder.append(_qualifiedClassName, "\t");
- _builder.append(".getInstance().logError(\"Error building context menu\", e);");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t");
- CharSequence _additions = this.additions(it);
- _builder.append(_additions, "\t");
- _builder.newLineIfNotEmpty();
- _builder.append("}");
- _builder.newLine();
- return _builder;
- }
-}
diff --git a/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/editor/DiagramEditorUtil.java b/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/editor/DiagramEditorUtil.java
deleted file mode 100644
index 82881776ef6..00000000000
--- a/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/editor/DiagramEditorUtil.java
+++ /dev/null
@@ -1,300 +0,0 @@
-package aspects.xpt.editor;
-
-import aspects.xpt.editor.VisualIDRegistry;
-import com.google.common.base.Objects;
-import com.google.inject.Inject;
-import com.google.inject.Singleton;
-import metamodel.MetaModel;
-import org.eclipse.emf.codegen.ecore.genmodel.GenClass;
-import org.eclipse.gmf.codegen.gmfgen.GenApplication;
-import org.eclipse.gmf.codegen.gmfgen.GenDiagram;
-import org.eclipse.gmf.codegen.gmfgen.GenEditorGenerator;
-import org.eclipse.gmf.codegen.gmfgen.GenPlugin;
-import org.eclipse.xtend2.lib.StringConcatenation;
-import org.eclipse.xtext.xbase.lib.Extension;
-import plugin.Activator;
-import xpt.CodeStyle;
-import xpt.Common;
-import xpt.Externalizer;
-import xpt.editor.GenDiagram_qvto;
-
-@Singleton
-@SuppressWarnings("all")
-public class DiagramEditorUtil extends xpt.editor.DiagramEditorUtil {
- @Inject
- @Extension
- private Common _common;
-
- @Inject
- @Extension
- private CodeStyle _codeStyle;
-
- @Inject
- @Extension
- private GenDiagram_qvto _genDiagram_qvto;
-
- @Inject
- private Activator xptActivator;
-
- @Inject
- private Externalizer xptExternalizer;
-
- @Inject
- private MetaModel xptMetaModel;
-
- public CharSequence createDiagramMethod(final GenDiagram it) {
- StringConcatenation _builder = new StringConcatenation();
- String _xifexpression = null;
- GenEditorGenerator _editorGen = it.getEditorGen();
- GenApplication _application = _editorGen.getApplication();
- boolean _equals = Objects.equal(_application, null);
- if (_equals) {
- _xifexpression = "This method should be called within a workspace modify operation since it creates resources.";
- } else {
- _xifexpression = "";
- }
- CharSequence _generatedMemberComment = this._common.generatedMemberComment(_xifexpression);
- _builder.append(_generatedMemberComment, "");
- _builder.newLineIfNotEmpty();
- _builder.append("public static org.eclipse.emf.ecore.resource.Resource createDiagram(org.eclipse.emf.common.util.URI diagramURI,");
- {
- boolean _standaloneDomainModel = this._genDiagram_qvto.standaloneDomainModel(it);
- if (_standaloneDomainModel) {
- _builder.append(" org.eclipse.emf.common.util.URI modelURI,");
- }
- }
- _builder.append(" org.eclipse.core.runtime.IProgressMonitor progressMonitor) {");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.append("org.eclipse.emf.transaction.TransactionalEditingDomain editingDomain = org.eclipse.emf.workspace.WorkspaceEditingDomainFactory.INSTANCE.createEditingDomain();");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("progressMonitor.beginTask(");
- GenEditorGenerator _editorGen_1 = it.getEditorGen();
- String _i18nKeyForCreateDiagramProgressTask = this.i18nKeyForCreateDiagramProgressTask(it);
- CharSequence _accessorCall = this.xptExternalizer.accessorCall(_editorGen_1, _i18nKeyForCreateDiagramProgressTask);
- _builder.append(_accessorCall, "\t");
- _builder.append(", 3);");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.append("final org.eclipse.emf.ecore.resource.Resource diagramResource = editingDomain.getResourceSet().createResource(diagramURI);");
- _builder.newLine();
- {
- boolean _standaloneDomainModel_1 = this._genDiagram_qvto.standaloneDomainModel(it);
- if (_standaloneDomainModel_1) {
- _builder.append("\t");
- _builder.append("final org.eclipse.emf.ecore.resource.Resource modelResource = editingDomain.getResourceSet().createResource(modelURI);");
- _builder.newLine();
- } else {
- boolean _and = false;
- GenClass _domainDiagramElement = it.getDomainDiagramElement();
- boolean _notEquals = (!Objects.equal(_domainDiagramElement, null));
- if (!_notEquals) {
- _and = false;
- } else {
- boolean _hasDocumentRoot = this._genDiagram_qvto.hasDocumentRoot(it);
- _and = _hasDocumentRoot;
- }
- if (_and) {
- _builder.append("\t");
- _builder.append("((org.eclipse.emf.ecore.xmi.XMLResource) diagramResource).getDefaultSaveOptions().put(org.eclipse.emf.ecore.xmi.XMLResource.OPTION_EXTENDED_META_DATA, Boolean.TRUE);");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("((org.eclipse.emf.ecore.xmi.XMLResource) diagramResource).getDefaultLoadOptions().put(org.eclipse.emf.ecore.xmi.XMLResource.OPTION_EXTENDED_META_DATA, Boolean.TRUE);");
- _builder.newLine();
- }
- }
- }
- _builder.append("\t");
- _builder.append("final String diagramName = diagramURI.lastSegment();");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand command = new org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand(editingDomain, ");
- GenEditorGenerator _editorGen_2 = it.getEditorGen();
- String _i18nKeyForCreateDiagramCommandLabel = this.i18nKeyForCreateDiagramCommandLabel(it);
- CharSequence _accessorCall_1 = this.xptExternalizer.accessorCall(_editorGen_2, _i18nKeyForCreateDiagramCommandLabel);
- _builder.append(_accessorCall_1, "\t");
- _builder.append(", java.util.Collections.EMPTY_LIST) {");
- _builder.newLineIfNotEmpty();
- _builder.append("\t\t");
- CharSequence _overrideC = this._codeStyle.overrideC(it);
- _builder.append(_overrideC, "\t\t");
- _builder.newLineIfNotEmpty();
- _builder.append("\t\t");
- _builder.append("protected org.eclipse.gmf.runtime.common.core.command.CommandResult doExecuteWithResult(org.eclipse.core.runtime.IProgressMonitor monitor, org.eclipse.core.runtime.IAdaptable info) throws org.eclipse.core.commands.ExecutionException {");
- _builder.newLine();
- {
- GenClass _domainDiagramElement_1 = it.getDomainDiagramElement();
- boolean _notEquals_1 = (!Objects.equal(_domainDiagramElement_1, null));
- if (_notEquals_1) {
- _builder.append("\t\t\t");
- GenClass _domainDiagramElement_2 = it.getDomainDiagramElement();
- CharSequence _QualifiedClassName = this.xptMetaModel.QualifiedClassName(_domainDiagramElement_2);
- _builder.append(_QualifiedClassName, "\t\t\t");
- _builder.append(" model = createInitialModel();");
- _builder.newLineIfNotEmpty();
- _builder.append("\t\t\t");
- _builder.append("attachModelToResource(model, ");
- {
- boolean _standaloneDomainModel_2 = this._genDiagram_qvto.standaloneDomainModel(it);
- if (_standaloneDomainModel_2) {
- _builder.append("model");
- } else {
- _builder.append("diagram");
- }
- }
- _builder.append("Resource);");
- _builder.newLineIfNotEmpty();
- }
- }
- _builder.append("\t\t\t");
- CharSequence _extraLineBreak = this._common.extraLineBreak();
- _builder.append(_extraLineBreak, "\t\t\t");
- _builder.newLineIfNotEmpty();
- _builder.append("\t\t\t");
- _builder.append("org.eclipse.gmf.runtime.notation.Diagram diagram = org.eclipse.gmf.runtime.diagram.core.services.ViewService.createDiagram(");
- _builder.newLine();
- {
- GenClass _domainDiagramElement_3 = it.getDomainDiagramElement();
- boolean _notEquals_2 = (!Objects.equal(_domainDiagramElement_3, null));
- if (_notEquals_2) {
- _builder.append("\t\t\t\t");
- GenClass _domainDiagramElement_4 = it.getDomainDiagramElement();
- CharSequence _DowncastToEObject = this.xptMetaModel.DowncastToEObject(_domainDiagramElement_4, "model");
- _builder.append(_DowncastToEObject, "\t\t\t\t");
- _builder.append(", ");
- _builder.newLineIfNotEmpty();
- }
- }
- _builder.append("\t\t\t\t");
- CharSequence _modelID = VisualIDRegistry.modelID(it);
- _builder.append(_modelID, "\t\t\t\t");
- _builder.append(", ");
- GenEditorGenerator _editorGen_3 = it.getEditorGen();
- CharSequence _preferenceHintAccess = this.xptActivator.preferenceHintAccess(_editorGen_3);
- _builder.append(_preferenceHintAccess, "\t\t\t\t");
- _builder.append(");");
- _builder.newLineIfNotEmpty();
- _builder.append("\t\t\t");
- _builder.append("if (diagram != null) {");
- _builder.newLine();
- _builder.append("\t\t\t\t");
- _builder.append("diagramResource.getContents().add(diagram);");
- _builder.newLine();
- _builder.append("\t\t\t\t");
- _builder.append("diagram.setName(diagramName);");
- _builder.newLine();
- {
- GenClass _domainDiagramElement_5 = it.getDomainDiagramElement();
- boolean _notEquals_3 = (!Objects.equal(_domainDiagramElement_5, null));
- if (_notEquals_3) {
- _builder.append("\t\t\t\t");
- _builder.append("diagram.setElement(");
- GenClass _domainDiagramElement_6 = it.getDomainDiagramElement();
- CharSequence _DowncastToEObject_1 = this.xptMetaModel.DowncastToEObject(_domainDiagramElement_6, "model");
- _builder.append(_DowncastToEObject_1, "\t\t\t\t");
- _builder.append(");");
- _builder.newLineIfNotEmpty();
- }
- }
- _builder.append("\t\t\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t\t\t");
- _builder.newLine();
- _builder.append("\t\t\t");
- _builder.append("try {");
- _builder.newLine();
- _builder.append("\t\t\t\t");
- {
- boolean _standaloneDomainModel_3 = this._genDiagram_qvto.standaloneDomainModel(it);
- if (_standaloneDomainModel_3) {
- _builder.append("modelResource.save(");
- CharSequence _callGetSaveOptions = this.callGetSaveOptions(it);
- _builder.append(_callGetSaveOptions, "\t\t\t\t");
- _builder.append(");");
- }
- }
- _builder.newLineIfNotEmpty();
- _builder.append("\t\t\t\t");
- _builder.append("diagramResource.save(");
- CharSequence _callGetSaveOptions_1 = this.callGetSaveOptions(it);
- _builder.append(_callGetSaveOptions_1, "\t\t\t\t");
- _builder.append(");");
- _builder.newLineIfNotEmpty();
- _builder.append("\t\t\t");
- _builder.append("} catch (java.io.IOException e) {");
- _builder.newLine();
- _builder.append("\t\t\t\t");
- CharSequence _extraLineBreak_1 = this._common.extraLineBreak();
- _builder.append(_extraLineBreak_1, "\t\t\t\t");
- _builder.newLineIfNotEmpty();
- _builder.append("\t\t\t\t");
- GenEditorGenerator _editorGen_4 = it.getEditorGen();
- GenPlugin _plugin = _editorGen_4.getPlugin();
- CharSequence _qualifiedClassName = this.xptActivator.qualifiedClassName(_plugin);
- _builder.append(_qualifiedClassName, "\t\t\t\t");
- _builder.append(".getInstance().logError(\"Unable to store model and diagram resources\", e); ");
- CharSequence _nonNLS = this._common.nonNLS(1);
- _builder.append(_nonNLS, "\t\t\t\t");
- _builder.newLineIfNotEmpty();
- _builder.append("\t\t\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t\t\t");
- _builder.append("return org.eclipse.gmf.runtime.common.core.command.CommandResult.newOKCommandResult();");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("};");
- _builder.newLine();
- _builder.ap